summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-03-12 15:07:42 -0700
committerJared Adams <jaxad0127@gmail.com>2010-03-12 18:22:42 -0700
commitef3685ef63999b7132fa7b6f8ebc9a3387972e53 (patch)
treeb770f306cf37b25fd2424391b7f225ee0b517134 /src
parent781b3c9f17708cc5fe08eb3c9ee38d596364d97c (diff)
downloadmana-ef3685ef63999b7132fa7b6f8ebc9a3387972e53.tar.gz
mana-ef3685ef63999b7132fa7b6f8ebc9a3387972e53.tar.bz2
mana-ef3685ef63999b7132fa7b6f8ebc9a3387972e53.tar.xz
mana-ef3685ef63999b7132fa7b6f8ebc9a3387972e53.zip
Add an optional offset property to monsters.xml
And remove the hardcoded offset from eAthena's BeingHandler. Reviewed-by: Freeyorp
Diffstat (limited to 'src')
-rw-r--r--src/net/ea/beinghandler.cpp3
-rw-r--r--src/resources/monsterdb.cpp4
2 files changed, 3 insertions, 4 deletions
diff --git a/src/net/ea/beinghandler.cpp b/src/net/ea/beinghandler.cpp
index dbfc0f3b..d3f6dd0e 100644
--- a/src/net/ea/beinghandler.cpp
+++ b/src/net/ea/beinghandler.cpp
@@ -80,10 +80,7 @@ Being *createBeing(int id, short job)
else if (job >= 46 && job <= 1000)
type = Being::NPC;
else if (job > 1000 && job <= 2000)
- {
type = Being::MONSTER;
- job -= 1002;
- }
Being *being = beingManager->createBeing(id, type, job);
diff --git a/src/resources/monsterdb.cpp b/src/resources/monsterdb.cpp
index f574053a..21f15a90 100644
--- a/src/resources/monsterdb.cpp
+++ b/src/resources/monsterdb.cpp
@@ -54,6 +54,8 @@ void MonsterDB::load()
logger->error("Monster Database: Error while loading monster.xml!");
}
+ int offset = XML::getProperty(rootNode, "offset", 0);
+
//iterate <monster>s
for_each_xml_child_node(monsterNode, rootNode)
{
@@ -143,7 +145,7 @@ void MonsterDB::load()
(const char*) spriteNode->xmlChildrenNode->content);
}
}
- mMonsterInfos[XML::getProperty(monsterNode, "id", 0)] = currentInfo;
+ mMonsterInfos[XML::getProperty(monsterNode, "id", 0) + offset] = currentInfo;
}
mLoaded = true;