Difference between revisions of "LUA:AddQuestRewardItem"

 
Line 1: Line 1:
= LUA Functions: AddQuestRewardItem() =
+
{{LUAFunction
Add an item reward to the given quest.
+
|Name = AddQuestRewardItem
 
+
|Description = Add an item reward to the given quest.
 
+
|Param1 = Quest
==== Syntax ====
+
|Param1Desc = is the quest id
AddQuestRewardItem(param1, param2, [param3])
+
|Param2 = int32
 
+
|Param2Desc = is the item id
 
+
|OptionalParam1 = int8
==== Parameters ====
+
|OptionalParam1Desc = is the amount of the given item, will default to 1 if left out.
; Required - ''param1'' (Quest), ''param2'' (int32)
+
|Example =
: ''param1'' is the quest we are adding a reward to
 
: ''param2'' is the item id
 
; Optional - ''param3'' (int8)
 
: ''param3'' is the amount of the given item
 
 
 
 
 
==== Usage ====
 
 
<pre>
 
<pre>
 
function Init(Quest)
 
function Init(Quest)
Line 22: Line 15:
 
end
 
end
 
</pre>
 
</pre>
 
+
|ExampleDesc = Players will recieve item 12000 upon completing this quest. This item will always be given to the player upon completion of the quest.
Players will recieve item 12000 upon completing this quest.
+
|Notes = Also while this function should still work the prefered way to handle quest rewards is in the DB.
 
+
}}
 
 
== Notes ==
 
This item will always be given to the player upon completion of the quest.
 
 
 
''param3'' will default to 1 if left out.
 
 
 
Also while this function should still work the prefered way to handle quest rewards is in the DB.
 

Latest revision as of 12:17, 30 January 2021


LUA:AllFunctions - AddQuestRewardItem

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


Add an item reward to the given quest.

Syntax

AddQuestRewardItem(param1, param2, [opt param1])

Parameters

Required - param1 (Quest), param2 (int32)
param1 is the quest id
param2 is the item id
Optional - opt param1 (int8)
opt param1 is the amount of the given item, will default to 1 if left out.

Example

function Init(Quest)
    -- Ad item 12000 to the quest reward
    AddQuestRewardItem(Quest, 12000)
end

Players will recieve item 12000 upon completing this quest. This item will always be given to the player upon completion of the quest.

Notes

Also while this function should still work the prefered way to handle quest rewards is in the DB.