Difference between revisions of "LUA:AddQuestPrereqItem"

(Created page with "= LUA Functions: AddQuestPrereqItem() = Adds an item prerequisite to the given quest. ==== Syntax ==== AddQuestPrereqItem(param1, param2, [param3]) ==== Parameters ==== ; Requi...")
 
 
Line 1: Line 1:
= LUA Functions: AddQuestPrereqItem() =
+
{{LUAFunction
Adds an item prerequisite to the given quest.
+
|Name = AddQuestPrereqItem
 
+
|Description = Adds an item prerequisite to the given quest.
==== Syntax ====
+
|Param1 = Quest
AddQuestPrereqItem(param1, param2, [param3])
+
|Param1Desc = is the quest we are adding a prerequisite to
 
+
|Param2 = int32
==== Parameters ====
+
|Param2Desc = is the item id
; Required - ''param1'' (Quest), ''param2'' (int32)
+
|OptionalParam1 = int8
: ''param1'' is the quest we are adding a prerequisite to
+
|OptionalParam1Desc = is the amount of the item, defaults to 1 if left out.
: ''param2'' is the item id
+
|Example =
; Optional - ''param3'' (int8)
 
: ''param3'' is the amount of the item
 
 
 
==== Usage ====
 
 
<pre>
 
<pre>
 
function Init(Quest)
 
function Init(Quest)
Line 19: Line 15:
 
end
 
end
 
</pre>
 
</pre>
 
+
|ExampleDesc = Only a player with 2 of item 17 can do the quest.
Only a player with 2 of item 17 can do the quest.
+
|Notes = None
 
+
}}
== Notes ==
 
''param3'' defaults to 1 if left out.
 

Latest revision as of 12:19, 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, [opt param1])

Parameters

Required - param1 (Quest), param2 (int32)
param1 is the quest we are adding a prerequisite to
param2 is the item id
Optional - opt param1 (int8)
opt param1 is the amount of the item, defaults to 1 if left out.

Example

function Init(Quest)
    -- Only players with 2 of item 17 can do this quest
    AddQuestPrereqItem(Quest, 17, 2)
end

Only a player with 2 of item 17 can do the quest.

Notes

None