diff --git a/src/Abilities.cpp b/src/Abilities.cpp index 0859220..58bfb45 100644 --- a/src/Abilities.cpp +++ b/src/Abilities.cpp @@ -123,7 +123,7 @@ static SkillResult handleSkillBuff(SkillData* skill, int power, ICombatant* sour int combatLifetime = 0; if(!target->addBuff(timeBuffId, [drainType](EntityRef self, Buff* buff, int status, BuffStack* stack) { - if(buff->id == ECSB_BOUNDINGBALL) { + if(buff->id == ECSB_BOUNDINGBALL && status == ETBU_ADD) { // drain ICombatant* combatant = dynamic_cast(self.getEntity()); combatant->takeDamage(buff->getLastSource(), 0); // aggro @@ -138,7 +138,7 @@ static SkillResult handleSkillBuff(SkillData* skill, int power, ICombatant* sour Buffs::tickDrain(self, buff, COMBAT_TICKS_PER_DRAIN_PROC); // drain combatLifetime++; }, - &passiveBuff)) return SkillResult(); // no result if already buffed + &passiveBuff)) return SkillResult(); sSkillResult_Buff result{}; result.eCT = target->getCharType(); diff --git a/src/Combat.cpp b/src/Combat.cpp index 80fbab1..d204f99 100644 --- a/src/Combat.cpp +++ b/src/Combat.cpp @@ -179,6 +179,9 @@ bool CombatNPC::addBuff(int buffId, BuffCallback onUpdate, Buff if(!isAlive()) return false; + if (this->state != AIState::COMBAT && this->state != AIState::ROAMING) + return false; + if(!hasBuff(buffId)) { buffs[buffId] = new Buff(buffId, getRef(), onUpdate, onTick, stack); return true;