summaryrefslogtreecommitdiff
path: root/src/game-server/monstermanager.cpp
diff options
context:
space:
mode:
authorPhilipp Sehmisch <tmw@crushnet.org>2008-02-11 23:42:48 +0000
committerPhilipp Sehmisch <tmw@crushnet.org>2008-02-11 23:42:48 +0000
commitf03e1cb4ce24e92fa3756d7b9aa9131853783810 (patch)
tree183c683de37783e42575f990d509b65cee0a44ab /src/game-server/monstermanager.cpp
parent504b008e264a3213d9802e52b984196ff348f814 (diff)
downloadmanaserv-f03e1cb4ce24e92fa3756d7b9aa9131853783810.tar.gz
manaserv-f03e1cb4ce24e92fa3756d7b9aa9131853783810.tar.bz2
manaserv-f03e1cb4ce24e92fa3756d7b9aa9131853783810.tar.xz
manaserv-f03e1cb4ce24e92fa3756d7b9aa9131853783810.zip
Implemented getting size and speed from monster.xml
Diffstat (limited to 'src/game-server/monstermanager.cpp')
-rw-r--r--src/game-server/monstermanager.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/game-server/monstermanager.cpp b/src/game-server/monstermanager.cpp
index c4bddfa3..ca823310 100644
--- a/src/game-server/monstermanager.cpp
+++ b/src/game-server/monstermanager.cpp
@@ -140,8 +140,8 @@ void MonsterManager::reload()
XML::getProperty(subnode, "physical-defence", -1));
monster->setAttribute(BASE_ATTR_MAG_RES,
XML::getProperty(subnode, "magical-defence", -1));
- // TODO: speed
- // TODO: size
+ monster->setSize(XML::getProperty(subnode, "size", 0));
+ int speed = (XML::getProperty(subnode, "speed", 0));
//check for completeness
bool attributesComplete = true;
@@ -153,8 +153,24 @@ void MonsterManager::reload()
monster->setAttribute(i, 0);
}
}
+ if (monster->getSize() == 0)
+ {
+ monster->setSize(16);
+ attributesComplete = false;
+ }
+ if (speed == 0)
+ {
+ speed = 1;
+ attributesComplete = false;
+ }
+
if (!attributesComplete) LOG_WARN(monsterReferenceFile
<<": Attributes incomplete for monster #"<<id);
+
+ //for usability reasons we set the speed in the monsters.xml as tiles per second
+ //instead of miliseconds per tile.
+ monster->setSpeed(1000/speed);
+
}
else if (xmlStrEqual(subnode->name, BAD_CAST "exp"))
{