Difference between revisions of "LUA:ItemScripts"
| (One intermediate revision by the same user not shown) | |||
| Line 2: | Line 2: | ||
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. | 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 | 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 | ||
| Line 9: | Line 9: | ||
end | end | ||
</pre> | </pre> | ||
| − | + | {{Header|Destroyed|BackgroundColor=3d78b4|FontColor=ffffff}} | |
Destroyed is called when the player destroys the item | Destroyed is called when the player destroys the item | ||
| Line 16: | Line 16: | ||
end | end | ||
</pre> | </pre> | ||
| − | + | {{Header|Examined|BackgroundColor=3d78b4|FontColor=ffffff}} | |
Examined is called when the player examines an item | Examined is called when the player examines an item | ||
| Line 23: | Line 23: | ||
end | end | ||
</pre> | </pre> | ||
| − | + | {{Header|Equipped|BackgroundColor=3d78b4|FontColor=ffffff}} | |
Equipped is called when the player equips an item | Equipped is called when the player equips an item | ||
| Line 30: | Line 30: | ||
end | end | ||
</pre> | </pre> | ||
| − | == Proc == | + | {{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 | Proc is called when the item proc is triggered | ||
| Line 37: | Line 44: | ||
end | end | ||
</pre> | </pre> | ||
| − | + | {{Header|Removed|BackgroundColor=3d78b4|FontColor=ffffff}} | |
Removed is called when the item is removed from the player | Removed is called when the item is removed from the player | ||
| Line 44: | Line 51: | ||
end | end | ||
</pre> | </pre> | ||
| − | + | {{Header|Unequipped|BackgroundColor=3d78b4|FontColor=ffffff}} | |
Unequipped is called when the player unequips an item | Unequipped is called when the player unequips an item | ||
| Line 51: | Line 58: | ||
end | end | ||
</pre> | </pre> | ||
| − | + | {{Header|Used|BackgroundColor=3d78b4|FontColor=ffffff}} | |
Used is called when the player uses an item | Used is called when the player uses an item | ||
| Line 58: | Line 65: | ||
end | end | ||
</pre> | </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