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
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: | ||
| − | = | + | {{LUAFunction |
| − | + | |Name = AddQuestPrereqItem | |
| − | + | |Description = Adds an item prerequisite to the given quest. | |
| − | + | |Param1 = Spawn | |
| − | + | |Param1Desc = is the player who will see this new command on the given spawn, must be a player | |
| − | + | |Param2 = Spawn | |
| − | + | |Param2Desc = is the spawn that will get the new command | |
| − | + | |Param3= string | |
| − | + | |Param3Desc = is the name of the command | |
| − | + | |OptionalParam1 = float | |
| − | + | |OptionalParam1Desc = is the max distance from the spawn to be able to use the command, defaults to 10 if left out | |
| − | + | |OptionalParam2 = string | |
| − | + | |OptionalParam2Desc = is the command, defaults to the same value as param3 if left out | |
| − | + | |OptionalParam3 = string | |
| − | + | |OptionalParam3Desc = is the error text for when the command fails | |
| − | + | |OptionalParam4 = int16 | |
| − | + | |OptionalParam4Desc = is the time it takes to cast the command | |
| − | + | |OptionalParam5 = int32 | |
| − | + | |OptionalParam5Desc = is the spell visual for this command | |
| − | + | |Example = | |
| − | |||
| − | |||
<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 |
| − | + | }} | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
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