diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-12-03 00:41:08 +0100 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2012-01-10 01:19:09 +0100 |
commit | 2a092bff6a889415d68b63db6e11942aa2d2bb33 (patch) | |
tree | d64f5f2b8675ef42ce19f1ca641945e7d308189c /src/game-server/inventory.h | |
parent | 4c9db4a20aad649f80c9db8379f372de7361096b (diff) | |
download | manaserv-2a092bff6a889415d68b63db6e11942aa2d2bb33.tar.gz manaserv-2a092bff6a889415d68b63db6e11942aa2d2bb33.tar.bz2 manaserv-2a092bff6a889415d68b63db6e11942aa2d2bb33.tar.xz manaserv-2a092bff6a889415d68b63db6e11942aa2d2bb33.zip |
Added unequip lua script functions.
You can unequip using the slot or an item id.
+ Fixes from Ablu's review.
Resolves: Mana-Mantis #350.
Reviewed-by: Ablu.
Diffstat (limited to 'src/game-server/inventory.h')
-rw-r--r-- | src/game-server/inventory.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/game-server/inventory.h b/src/game-server/inventory.h index 84981ea3..812c142d 100644 --- a/src/game-server/inventory.h +++ b/src/game-server/inventory.h @@ -64,6 +64,15 @@ class Inventory bool equip(int inventorySlot); /** + * Unequips all the items with the given item if + * from given equipment slot. + * @param itemId The item Id to unequip. + * @returns whether all item id could be unequipped. + * @note returns true when no item with given ids were equipped. + */ + bool unequipItem(unsigned int itemId); + + /** * Unequips item from given equipment slot. * @param itemInstance The item instance id used to know what to unequip * @returns Whether it was unequipped. @@ -71,6 +80,12 @@ class Inventory bool unequip(unsigned int itemInstance); /** + * Gets the item instance from the given equipment slot. + * Return 0 if none. + */ + unsigned int getSlotItemInstance(unsigned int slot); + + /** * Inserts some items into the inventory. * @return number of items not inserted (to be dropped on floor?). */ |