No categories assigned

LUA:AddLootItem

Revision as of 22:13, 10 October 2012 by Jabantiz (talk | contribs) (Created page with "= LUA Functions: AddLootItem() = Adds an item to the given spawns loot table. ==== Syntax ==== AddLootItem(param1, param2, [param3]) ==== Parameters ==== ; Required - ''param1...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

LUA Functions: AddLootItem()

Adds an item to the given spawns loot table.

Syntax

AddLootItem(param1, param2, [param3])


Parameters

Required - param1 (Spawn), param2 (int32)
param1 is the spawn to add the item to
param2 is the item id
Optional - param3 (int16)
param3 is the amount of the specified item to give


Usage

function cast(Caster, Target)
    -- Add a stack of 5 items with the id of 100
    AddLootItem(Target, 100, 5)
end

This would add a stack of 5 items with the id of 100 to the Target's loot table.


Notes

If param3 is left out it will default to 1.