You are viewing an old version of this page. Return to the latest version.
Version of 16:40, 15 October 2012 by I need to Update My Profile
No categories assigned
LUA:AddPrimaryEntityCommand
- Last edited 4 years ago by Vlash Nytefall
LUA Functions: AddPrimaryEntityCommand()
Returns the current current hit points of param. The parameter can be either a player or the NPC currently being interacted with.
Syntax
AddPrimaryEntityCommand(param1, param2, param3, [param4], [param5], [param6], [param7], [param8])
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 - param4 (float), param5 (string), param6 (string), param7(int16), param8 (int32)
- param4 is the max distance from the spawn to be able to use the command
- param5 is the command
- param6 is the error text for when the command fails
- param7 is the time it takes to cast the command
- param8 is the spell visual for this command
Usage
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
If left out param4 defaults to 10.
If left out param5 defaults to the same value as param3
param5 needs to be in the Commands table in the DB.