Difference between revisions of "LUA:AddQuestRewardItem"

(Undo revision 4231 by Iheqidela (talk))
Line 1: Line 1:
==Reward item(s) that a player receives upon quest completion==
+
= LUA Functions: AddQuestRewardItem() =
 +
Add an item reward to the given quest.
  
  
===Syntax===
+
==== Syntax ====
AddQuestRewardItem(Quest, item_id, quantity)
+
AddQuestRewardItem(param1, param2, [param3])
  
====Example====
 
AddQuestRewardItem(Quest, 34094, 1)
 
  
 +
==== 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
  
NOTE: The player will always receive the item or items added with this function
+
 
 +
==== Usage ====
 +
<pre>
 +
function Init(Quest)
 +
    -- Ad item 12000 to the quest reward
 +
    AddQuestRewardItem(Quest, 12000)
 +
end
 +
</pre>
 +
 
 +
Players will recieve item 12000 upon completing this quest.
 +
 
 +
 
 +
== 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.

Revision as of 15:38, 11 October 2012

LUA Functions: AddQuestRewardItem()

Add an item reward to the given quest.


Syntax

AddQuestRewardItem(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)
    -- Ad item 12000 to the quest reward
    AddQuestRewardItem(Quest, 12000)
end

Players will recieve item 12000 upon completing this quest.


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.