diff options
author | Philipp Sehmisch <tmw@crushnet.org> | 2008-02-06 22:15:39 +0000 |
---|---|---|
committer | Philipp Sehmisch <tmw@crushnet.org> | 2008-02-06 22:15:39 +0000 |
commit | d4ad5de48f7f1e2a84bccd68b2584ce78fed05a4 (patch) | |
tree | 488cee232ba62465fb200814bca1514e97fa9667 /src/game-server/monster.hpp | |
parent | 402484c66f2cb4036e1af4bbda6345d8d79ecb41 (diff) | |
download | manaserv-d4ad5de48f7f1e2a84bccd68b2584ce78fed05a4.tar.gz manaserv-d4ad5de48f7f1e2a84bccd68b2584ce78fed05a4.tar.bz2 manaserv-d4ad5de48f7f1e2a84bccd68b2584ce78fed05a4.tar.xz manaserv-d4ad5de48f7f1e2a84bccd68b2584ce78fed05a4.zip |
Exp reward for killing monsters is now read from monster database.
Diffstat (limited to 'src/game-server/monster.hpp')
-rw-r--r-- | src/game-server/monster.hpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/game-server/monster.hpp b/src/game-server/monster.hpp index c6d43589..f5c7c18f 100644 --- a/src/game-server/monster.hpp +++ b/src/game-server/monster.hpp @@ -49,7 +49,7 @@ typedef std::vector< MonsterDrop > MonsterDrops; class MonsterClass { public: - MonsterClass(int id): mID(id), mAttributes(BASE_ATTR_NB, 0) {} + MonsterClass(int id): mID(id), mAttributes(BASE_ATTR_NB, 0), mExp(-1) {} /** * Gets monster type. @@ -76,6 +76,18 @@ class MonsterClass { return mAttributes.at(attribute); } /** + * Sets exp reward for killing the monster + */ + void setExp(int exp) + { mExp = exp; } + + /** + * Gets exp reward for killing the monster + */ + int getExp() const + { return mExp; } + + /** * Randomly selects a monster drop (may return NULL). * TODO: pass some luck modifier as an argument. */ @@ -85,6 +97,7 @@ class MonsterClass unsigned short mID; /**< ID of the monster class. */ MonsterDrops mDrops; /**< Items the monster drops when dying. */ std::vector<int> mAttributes; /**< Base attributes of the monster*/ + int mExp; /**< Exp reward for killing the monster */ }; /** @@ -169,9 +182,7 @@ class Monster : public Being int mAttackTime; /**< Delay until monster can attack */ // TODO: the following vars should all be the same for all monsters of - // the same type. So they should be put into some central data structure - // to save memory. - int mExpReward; /**< Exp reward for defeating the monster */ + // the same type. So they should be stored in mSpecy to save memory int mAttackPreDelay; /**< time between decision to make an attack and performing the attack */ int mAttackAftDelay; /**< time it takes to perform an attack */ int mAttackRange; /**< range of the monsters attacks in pixel */ |