summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChuck Miller <shadowmil@gmail.com>2009-07-06 16:20:24 -0400
committerChuck Miller <shadowmil@gmail.com>2009-07-06 16:20:24 -0400
commit7de5af037fda994ca1c6a47d5df01e21dea3f243 (patch)
tree7dbfb1da4119962995a574b09689d138fc767a8e /src
parentde8af07bb5a1ecc17893e78a580209f899132575 (diff)
downloadmanaserv-7de5af037fda994ca1c6a47d5df01e21dea3f243.tar.gz
manaserv-7de5af037fda994ca1c6a47d5df01e21dea3f243.tar.bz2
manaserv-7de5af037fda994ca1c6a47d5df01e21dea3f243.tar.xz
manaserv-7de5af037fda994ca1c6a47d5df01e21dea3f243.zip
More Skill fixes, this time for getModifiedAttribute
Diffstat (limited to 'src')
-rw-r--r--src/game-server/character.cpp13
-rw-r--r--src/game-server/character.hpp10
2 files changed, 21 insertions, 2 deletions
diff --git a/src/game-server/character.cpp b/src/game-server/character.cpp
index 2af2808e..c78a8a92 100644
--- a/src/game-server/character.cpp
+++ b/src/game-server/character.cpp
@@ -334,6 +334,19 @@ int Character::getAttribute(int attr) const
}
}
+int Character::getModifiedAttribute(int attr) const
+{
+ if (attr <= CHAR_ATTR_END)
+ {
+ return Being::getModifiedAttribute(attr);
+ }
+ else
+ {
+ //TODO: Find a way to modify skills
+ return Character::levelForExp(mExperience.find(attr)->second);
+ }
+}
+
void Character::modifiedAttribute(int attr)
{
if (attr >= CHAR_ATTR_BEGIN && attr < CHAR_ATTR_END)
diff --git a/src/game-server/character.hpp b/src/game-server/character.hpp
index da2af285..828566ab 100644
--- a/src/game-server/character.hpp
+++ b/src/game-server/character.hpp
@@ -239,10 +239,16 @@ class Character : public Being
void setMapId(int);
/**
- * Over loads being::getAttribute, character skills are
+ * Over loads Being::getAttribute, character skills are
* treated as extend attributes
*/
- int getAttribute(int) const;
+ int getAttribute(int) const;
+
+ /**
+ * Over loads Being::getModifiedAttribute
+ * Charcter skills are treated as extend attributes
+ */
+ int getModifiedAttribute(int) const;
/**
* Updates base Being attributes.