summaryrefslogtreecommitdiff
path: root/src/game-server
diff options
context:
space:
mode:
Diffstat (limited to 'src/game-server')
-rw-r--r--src/game-server/character.cpp12
-rw-r--r--src/game-server/character.hpp5
2 files changed, 17 insertions, 0 deletions
diff --git a/src/game-server/character.cpp b/src/game-server/character.cpp
index b2a21c5a..0775c75f 100644
--- a/src/game-server/character.cpp
+++ b/src/game-server/character.cpp
@@ -519,6 +519,18 @@ void Character::incrementKillCount(int monsterType)
};
}
+int Character::getKillCount(int monsterType)
+{
+ std::map<int, int>::iterator i = mKillCount.find(monsterType);
+ if (i == mKillCount.end())
+ {
+ return 0;
+ } else {
+ return i->second;
+ };
+}
+
+
void Character::recalculateLevel()
{
std::list<float> levels;
diff --git a/src/game-server/character.hpp b/src/game-server/character.hpp
index fbba4eee..05c36c24 100644
--- a/src/game-server/character.hpp
+++ b/src/game-server/character.hpp
@@ -323,6 +323,11 @@ class Character : public Being
void incrementKillCount(int monsterType);
/**
+ * Gets the number of monsters the character killed of a given type
+ */
+ int getKillCount(int monsterType);
+
+ /**
* Shortcut to get being's health
*/
int getHealth() const