From 46106e962bee32271ee644224c5ac525eb32f888 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 4 Mar 2013 02:58:12 +0300 Subject: Add different effects to npc depend on qests status (evol only) --- src/being.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'src/being.cpp') diff --git a/src/being.cpp b/src/being.cpp index 7b494b4a7..b26b56c5d 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -247,9 +247,8 @@ Being::Being(const int id, const Type type, const uint16_t subtype, mInactive(false), mNumber(100), mHairColor(0), - mAfkParticle(nullptr) + mSpecialParticle(nullptr) { - for (int f = 0; f < 20; f ++) { mSpriteRemap[f] = f; @@ -2763,16 +2762,26 @@ int Being::getSpriteID(const int slot) const void Being::addAfkEffect() { - if (effectManager && !mAfkParticle && mAwayEffect != -1) - mAfkParticle = effectManager->triggerReturn(mAwayEffect, this); + addSpecialEffect(mAwayEffect); } void Being::removeAfkEffect() { - if (effectManager && mAfkParticle) + removeSpecialEffect(); +} + +void Being::addSpecialEffect(const int effect) +{ + if (effectManager && !mSpecialParticle && effect != -1) + mSpecialParticle = effectManager->triggerReturn(effect, this); +} + +void Being::removeSpecialEffect() +{ + if (effectManager && mSpecialParticle) { - mChildParticleEffects.removeLocally(mAfkParticle); - mAfkParticle = nullptr; + mChildParticleEffects.removeLocally(mSpecialParticle); + mSpecialParticle = nullptr; } } -- cgit v1.2.3-60-g2f50