Item related LUA functions
Posted: Mon Aug 12, 2013 5:21 pm
It occured to me today we had no way of retrieving item pointers through LUA, so I coded some up
. I also fixed a bug in HasItem() where it was running a check to see if the item was in equipped slots, but it never returned the true or false from that check.
GetEquippedItemBySlot(Player, slot_id)
GetEquippedItemByID(Player, item_id)
GetItemByID(Player, item_id, count, include_bank 0 = false 1 = true)
These are used exactly how they look, just pass a player pointer for Player, and it checks that player for item pointers using the given values, the function then returns a pointer to that item.
GetEquippedItemBySlot(Player, slot_id)
GetEquippedItemByID(Player, item_id)
GetItemByID(Player, item_id, count, include_bank 0 = false 1 = true)
These are used exactly how they look, just pass a player pointer for Player, and it checks that player for item pointers using the given values, the function then returns a pointer to that item.