No categories assigned

LUA:AddPrimaryEntityCommand

Revision as of 12:03, 30 January 2021 by Cynnar (talk | contribs)


LUA:AllFunctions - AddQuestPrereqItem

Return to: LUA:AllFunctions | Tutorials | Portal | Forum | Project Manager | Bug Tracker


Adds an item prerequisite to the given quest.

Syntax

AddQuestPrereqItem(param1, param2, param3, [opt param1], [opt param2], [opt param3], [opt param4], [opt param5])

Parameters

Required - param1 (Spawn), param2 (Spawn), param3 (string)
param1 is the player who will see this new command on the given spawn, must be a player
param2 is the spawn that will get the new command
param3 is the name of the command
Optional - opt param1 (float), opt param2 (string), opt param3 (string), opt param4 (int16), opt param5 (int32)
opt param1 is the max distance from the spawn to be able to use the command, defaults to 10 if left out
opt param2 is the command, defaults to the same value as param3 if left out
opt param3 is the error text for when the command fails
opt param4 is the time it takes to cast the command
opt param5 is the spell visual for this command

Example

function hailed(NPC, Spawn)
    AddPrimaryEntityCommand(Spawn, NPC, "poke")
end

Add the poke command to the spawn for the player after they have hailed the spawn.

Notes

OptionalParam2 needs to be in the Commands table in the DB