Difference between revisions of "LUA:AddPrimaryEntityCommand"

(Created page with "= LUA Functions: AddPrimaryEntityCommand() = Returns the current '''current hit points''' of ''param''. The parameter can be either a player or the NPC currently being interacted...")
 
Line 1: Line 1:
= LUA Functions: AddPrimaryEntityCommand() =
+
{{LUAFunction
Returns the current '''current hit points''' of ''param''. The parameter can be either a player or the NPC currently being interacted with.
+
|Name = AddQuestPrereqItem
 
+
|Description = Adds an item prerequisite to the given quest.
 
+
|Param1 = Spawn
==== Syntax ====
+
|Param1Desc = is the player who will see this new command on the given spawn, must be a player
AddPrimaryEntityCommand(param1, param2, param3, [param4], [param5], [param6], [param7], [param8])
+
|Param2 = Spawn
 
+
|Param2Desc = is the spawn that will get the new command
==== Parameters ====
+
|Param3= string
; Required - ''param1'' (spawn), ''param2'' (spawn), ''param3'' (string)
+
|Param3Desc = is the name of the command
: ''param1'' is the player who will see this new command on the given spawn, must be a player
+
|OptionalParam1 = float
: ''param2'' is the spawn that will get the new command
+
|OptionalParam1Desc = is the max distance from the spawn to be able to use the command, defaults to 10 if left out
: ''param3'' is the name of the command
+
|OptionalParam2 = string
 
+
|OptionalParam2Desc = is the command, defaults to the same value as param3 if left out
; Optional -  ''param4'' (float), ''param5'' (string), ''param6'' (string), ''param7''(int16), ''param8'' (int32)
+
|OptionalParam3 = string
: ''param4'' is the max distance from the spawn to be able to use the command
+
|OptionalParam3Desc = is the error text for when the command fails
: ''param5'' is the command
+
|OptionalParam4 = int16
: ''param6'' is the error text for when the command fails
+
|OptionalParam4Desc = is the time it takes to cast the command
: ''param7'' is the time it takes to cast the command
+
|OptionalParam5 = int32
: ''param8'' is the spell visual for this command
+
|OptionalParam5Desc = is the spell visual for this command
 
+
|Example =
 
 
==== Usage ====
 
 
<pre>
 
<pre>
 
function hailed(NPC, Spawn)
 
function hailed(NPC, Spawn)
Line 26: Line 24:
 
end
 
end
 
</pre>
 
</pre>
 
+
|ExampleDesc = Add the poke command to the spawn for the player after they have hailed the spawn.
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
 
+
}}
 
 
== 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.
 

Revision as of 12:03, 30 January 2021


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