From a4d2f2c0373848fa8a886c1dddc6247b81527df3 Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Mon, 13 Oct 2008 09:34:46 +0000 Subject: Added mob particle attack effects to mobs. Inspired by the TMW patch in their trunk client. --- src/resources/monsterdb.cpp | 6 ++++++ src/resources/monsterinfo.h | 8 ++++++++ 2 files changed, 14 insertions(+) (limited to 'src/resources') diff --git a/src/resources/monsterdb.cpp b/src/resources/monsterdb.cpp index 73e9d666..8d8dd133 100644 --- a/src/resources/monsterdb.cpp +++ b/src/resources/monsterdb.cpp @@ -126,6 +126,12 @@ MonsterDB::load() } } + if (xmlStrEqual(spriteNode->name, BAD_CAST "attack")) + { + std::string event = XML::getProperty(spriteNode, "particle-effect", ""); + currentInfo->addAttackParticleEffect(event); + } + if (xmlStrEqual(spriteNode->name, BAD_CAST "particlefx")) { currentInfo->addParticleEffect( diff --git a/src/resources/monsterinfo.h b/src/resources/monsterinfo.h index 2f690756..c5345bd8 100644 --- a/src/resources/monsterinfo.h +++ b/src/resources/monsterinfo.h @@ -87,11 +87,19 @@ class MonsterInfo std::string getSound(MonsterSoundEvent event) const; + std::string + getAttackParticleEffect() const { return mAttackParticle; } + + void + addAttackParticleEffect(const std::string &particleEffect) + { mAttackParticle = particleEffect; } + const std::list& getParticleEffects() const { return mParticleEffects; } private: std::string mName; + std::string mAttackParticle; std::list mSprites; Being::TargetCursorSize mTargetCursorSize; std::map* > mSounds; -- cgit v1.2.3-70-g09d2