Difference between revisions of "LUA:AddQuestSelectableRewardItem"

 
Line 1: Line 1:
= LUA Functions: AddQuestSelectableRewardItem() =
+
{{LUAFunction
Adds a selectable reward item to the given quest.
+
|Name = AddQuestSelectableRewardItem
 
+
|Description = Adds a selectable reward item to the given quest.
==== Syntax ====
+
|Param1 = Quest
AddQuestSelectableRewardItem(param1, param2, [param3])
+
|Param1Desc = is the quest we are adding a reward to
 
+
|Param2 = int32
 
+
|Param2Desc = is the item id
==== Parameters ====
+
|OptionalParam1 = int8
; Required - ''param1'' (Quest), ''param2'' (int32)
+
|OptionalParam1Desc = is the amount of the given item, will default to 1 if left out.
: ''param1'' is the quest we are adding a reward to
+
|Example =
: ''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 16:
 
end
 
end
 
</pre>
 
</pre>
 
+
|ExampleDesc = Players will have a choice between items 5 and 6 upon completing this quest.
Players will have a choice between items 5 and 6 upon completing this quest.
+
|Notes = Only 1 item can be selected to recieve upon completion of the quest.
 
 
 
 
== Notes ==
 
''param3'' will default to 1 if left out.
 
 
 
Only 1 item can be selected to recieve upon completion of the quest.
 
  
 
While this function should still work the prefered way to handle quest rewards is in the DB.
 
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 - AddQuestSelectableRewardItem

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


Adds a selectable reward item to the given quest.

Syntax

AddQuestSelectableRewardItem(param1, param2, [opt param1])

Parameters

Required - param1 (Quest), param2 (int32)
param1 is the quest we are adding a reward to
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)
    -- Add items 5 and 6 as selectable rewards
    AddQuestSelectableRewardItem(Quest, 5)
    AddQuestSelectableRewardItem(Quest, 6)
end

Players will have a choice between items 5 and 6 upon completing this quest.

Notes

Only 1 item can be selected to recieve upon completion of the quest.

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