Difference between revisions of "LUA:ItemScripts"
John adams (talk | contribs) (Created page with "details to come") |
|||
| (4 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
| − | + | {{PageHeaderChild|LUA|Item Scripts}} | |
| + | Item scripts will give items more uses then just stats. There are currently 8 events that will call the item script, food/drink consumption, destroyed, examined, equipped, proc, removed, unequipped, and used. | ||
| + | |||
| + | {{Header|Cast|BackgroundColor=3d78b4|FontColor=ffffff}} | ||
| + | Cast is only used for food and drink when it is consumed, this is where you would cast the buff spell that the food or drink applies | ||
| + | |||
| + | <pre> | ||
| + | function cast(Item, Spawn) | ||
| + | end | ||
| + | </pre> | ||
| + | {{Header|Destroyed|BackgroundColor=3d78b4|FontColor=ffffff}} | ||
| + | Destroyed is called when the player destroys the item | ||
| + | |||
| + | <pre> | ||
| + | function destroyed(Item, Spawn) | ||
| + | end | ||
| + | </pre> | ||
| + | {{Header|Examined|BackgroundColor=3d78b4|FontColor=ffffff}} | ||
| + | Examined is called when the player examines an item | ||
| + | |||
| + | <pre> | ||
| + | function examined(Item, Spawn) | ||
| + | end | ||
| + | </pre> | ||
| + | {{Header|Equipped|BackgroundColor=3d78b4|FontColor=ffffff}} | ||
| + | Equipped is called when the player equips an item | ||
| + | |||
| + | <pre> | ||
| + | function equipped(Item, Spawn) | ||
| + | end | ||
| + | </pre> | ||
| + | {{Header|Obtained|BackgroundColor=3d78b4|FontColor=ffffff}} | ||
| + | Obtained is called when the player gets an item | ||
| + | |||
| + | <pre> | ||
| + | function obtained(Item, Player) | ||
| + | end | ||
| + | </pre> | ||
| + | {{Header|Proc|BackgroundColor=3d78b4|FontColor=ffffff}} | ||
| + | Proc is called when the item proc is triggered | ||
| + | |||
| + | <pre> | ||
| + | function proc(Item, Caster, Target, Type) | ||
| + | end | ||
| + | </pre> | ||
| + | {{Header|Removed|BackgroundColor=3d78b4|FontColor=ffffff}} | ||
| + | Removed is called when the item is removed from the player | ||
| + | |||
| + | <pre> | ||
| + | function removed(Item, Spawn) | ||
| + | end | ||
| + | </pre> | ||
| + | {{Header|Unequipped|BackgroundColor=3d78b4|FontColor=ffffff}} | ||
| + | Unequipped is called when the player unequips an item | ||
| + | |||
| + | <pre> | ||
| + | function unequipped(Item, Spawn) | ||
| + | end | ||
| + | </pre> | ||
| + | {{Header|Used|BackgroundColor=3d78b4|FontColor=ffffff}} | ||
| + | Used is called when the player uses an item | ||
| + | |||
| + | <pre> | ||
| + | function used(Item, Spawn) | ||
| + | end | ||
| + | </pre> | ||
Latest revision as of 16:42, 14 June 2016
LUA - Item Scripts
Return to: LUA | Tutorials | Portal | Forum | Project Manager | Bug Tracker
Item scripts will give items more uses then just stats. There are currently 8 events that will call the item script, food/drink consumption, destroyed, examined, equipped, proc, removed, unequipped, and used.
Cast is only used for food and drink when it is consumed, this is where you would cast the buff spell that the food or drink applies
function cast(Item, Spawn) end
Destroyed is called when the player destroys the item
function destroyed(Item, Spawn) end
Examined is called when the player examines an item
function examined(Item, Spawn) end
Equipped is called when the player equips an item
function equipped(Item, Spawn) end
Obtained is called when the player gets an item
function obtained(Item, Player) end
Proc is called when the item proc is triggered
function proc(Item, Caster, Target, Type) end
Removed is called when the item is removed from the player
function removed(Item, Spawn) end
Unequipped is called when the player unequips an item
function unequipped(Item, Spawn) end
Used is called when the player uses an item
function used(Item, Spawn) end