Difference between revisions of "LUA:AddQuestSelectableRewardItem"

(Undo revision 4233 by Iheqidela (talk))
Line 1: Line 1:
==Reward item(s) that a player receives after make their selection of choices upon quest completion==
+
= LUA Functions: AddQuestSelectableRewardItem() =
 +
Adds a selectable reward item to the given quest.
  
 +
==== Syntax ====
 +
AddQuestSelectableRewardItem(param1, param2, [param3])
  
===Syntax===
 
AddQuestSelectableRewardItem(Quest, item_id, quantity)
 
  
====Example====
+
==== Parameters ====
AddQuestSelectableRewardItem(Quest, 35249, 1)<br>
+
; Required - ''param1'' (Quest), ''param2'' (int32)
AddQuestSelectableRewardItem(Quest, 38926, 1)<br>
+
: ''param1'' is the quest we are adding a reward to
AddQuestSelectableRewardItem(Quest, 21046, 1)<br>
+
: ''param2'' is the item id
 +
; Optional - ''param3'' (int8)
 +
: ''param3'' is the amount of the given item
  
  
 +
==== Usage ====
 +
<pre>
 +
function Init(Quest)
 +
    -- Add items 5 and 6 as selectable rewards
 +
    AddQuestSelectableRewardItem(Quest, 5)
 +
    AddQuestSelectableRewardItem(Quest, 6)
 +
end
 +
</pre>
  
NOTE: The player only receives one item out of the selection
+
Players will have a choice between items 5 and 6 upon completing this 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.

Revision as of 16:18, 11 October 2012

LUA Functions: AddQuestSelectableRewardItem()

Adds a selectable reward item to the given quest.

Syntax

AddQuestSelectableRewardItem(param1, param2, [param3])


Parameters

Required - param1 (Quest), param2 (int32)
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

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

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.