From ae898aa1a5175b2b08f7248e4cd89bf61bc8e4be Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Thu, 29 Jul 2010 20:20:51 +0200 Subject: Changed the items loading to handle a new 'attack-action' parameter. The old behaviour was to load the weapon-type value and do many unnecessary checks and transformation on it: The weapon-type was transformed using hard-coded values into an integer enum value. The exact same thing was done on the opposite side in the animation files before comparing the two. As both data were string values, I simplified all of it by using the value taken in items.xml to call the corresponding action. This now also permit to set up new attack animation in items.xml and in the playerset.xml without having the need to modify the client code. Last but not least, the weapon-type value was used by both the skills and the actions and avoided the possibility to set up a definite action for a weapon-type. Note: The weapon-type parameter will become deprecated for the server in favor of a 'skill' parameter to reflect more it's actual use. This patch is the first step to fix Manasource issue: #157. --- src/resources/monsterdb.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/resources/monsterdb.cpp') diff --git a/src/resources/monsterdb.cpp b/src/resources/monsterdb.cpp index ed062acf..6bc64a89 100644 --- a/src/resources/monsterdb.cpp +++ b/src/resources/monsterdb.cpp @@ -126,8 +126,9 @@ void MonsterDB::load() const int id = XML::getProperty(spriteNode, "id", 0); const std::string particleEffect = XML::getProperty( spriteNode, "particle-effect", ""); - SpriteAction spriteAction = SpriteDef::makeSpriteAction( - XML::getProperty(spriteNode, "action", "attack")); + const std::string spriteAction = XML::getProperty(spriteNode, + "action", + "attack"); const std::string missileParticle = XML::getProperty( spriteNode, "missile-particle", ""); currentInfo->addAttack(id, spriteAction, -- cgit v1.2.3-60-g2f50