summaryrefslogtreecommitdiff
path: root/src/game-server/item.h
diff options
context:
space:
mode:
authorPhilipp Sehmisch <mana@crushnet.org>2011-03-15 20:51:38 +0100
committerPhilipp Sehmisch <mana@crushnet.org>2011-03-16 08:36:52 +0100
commit05ad0a28aa4bada4569417c0d292d6960a8af5a2 (patch)
treea618fb12b92a575f50a942746880c65b80f2cf49 /src/game-server/item.h
parentb6e7feedc82c3c549af0d3cd53be1a981945f42d (diff)
downloadmanaserv-05ad0a28aa4bada4569417c0d292d6960a8af5a2.tar.gz
manaserv-05ad0a28aa4bada4569417c0d292d6960a8af5a2.tar.bz2
manaserv-05ad0a28aa4bada4569417c0d292d6960a8af5a2.tar.xz
manaserv-05ad0a28aa4bada4569417c0d292d6960a8af5a2.zip
Allowed item names instead of IDs in @commands
The @drop and @item commands can now accept an item name instead of an item ID. In addition the amount can be omitted to create a single item.
Diffstat (limited to 'src/game-server/item.h')
-rw-r--r--src/game-server/item.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/game-server/item.h b/src/game-server/item.h
index 50619536..f03e951a 100644
--- a/src/game-server/item.h
+++ b/src/game-server/item.h
@@ -149,6 +149,7 @@ class ItemClass
public:
ItemClass(int id, unsigned int maxperslot)
: mDatabaseID(id)
+ , mName("unnamed")
, mSpriteID(0)
, mCost(0)
, mMaxPerSlot(maxperslot)
@@ -157,6 +158,18 @@ class ItemClass
~ItemClass() { resetEffects(); }
/**
+ * Returns the name of the item type
+ */
+ const std::string &getName() const
+ { return mName; }
+
+ /**
+ * Sets the name of the item type
+ */
+ void setName(const std::string &name)
+ { mName = name; }
+
+ /**
* Applies the modifiers of an item to a given user.
* @return true if item should be removed.
*/
@@ -232,6 +245,7 @@ class ItemClass
}
unsigned short mDatabaseID; /**< Item reference information */
+ std::string mName; /**< name used to identify the item class */
/** The sprite that should be shown to the character */
unsigned short mSpriteID;
unsigned short mCost; /**< Unit cost the item. */