diff options
-rwxr-xr-x | src/server/game/AI/CoreAI/CombatAI.cpp | 2 | ||||
-rwxr-xr-x | src/server/game/AI/CoreAI/PetAI.cpp | 2 | ||||
-rwxr-xr-x | src/server/game/Entities/Unit/Unit.cpp | 21 | ||||
-rwxr-xr-x | src/server/game/Entities/Unit/Unit.h | 4 | ||||
-rw-r--r-- | src/server/scripts/World/npcs_special.cpp | 2 |
5 files changed, 18 insertions, 13 deletions
diff --git a/src/server/game/AI/CoreAI/CombatAI.cpp b/src/server/game/AI/CoreAI/CombatAI.cpp index 03d1b9793d9..6ce8ce330cf 100755 --- a/src/server/game/AI/CoreAI/CombatAI.cpp +++ b/src/server/game/AI/CoreAI/CombatAI.cpp @@ -158,7 +158,7 @@ void CasterAI::UpdateAI(const uint32 diff) events.Update(diff); - if (me->getVictim()->HasBreakableByDamageCrowdControlAura()) + if (me->getVictim()->HasBreakableByDamageCrowdControlAura(me)) { me->InterruptNonMeleeSpells(false); return; diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp index e07042df149..30ebd06745f 100755 --- a/src/server/game/AI/CoreAI/PetAI.cpp +++ b/src/server/game/AI/CoreAI/PetAI.cpp @@ -92,7 +92,7 @@ void PetAI::UpdateAI(const uint32 diff) if (me->getVictim()) { // is only necessary to stop casting, the pet must not exit combat - if (me->getVictim()->HasBreakableByDamageCrowdControlAura()) + if (me->getVictim()->HasBreakableByDamageCrowdControlAura(me)) { me->InterruptNonMeleeSpells(false); return; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index db36a148a57..63b1729766b 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -516,22 +516,27 @@ bool Unit::HasAuraTypeWithFamilyFlags(AuraType auraType, uint32 familyName, uint return false; } -bool Unit::HasBreakableByDamageAuraType(AuraType type) const +bool Unit::HasBreakableByDamageAuraType(AuraType type, uint32 excludeAura) const { AuraEffectList const& auras = GetAuraEffectsByType(type); for (AuraEffectList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr) - if ((*itr)->GetSpellInfo()->Attributes & SPELL_ATTR0_BREAKABLE_BY_DAMAGE || (*itr)->GetSpellInfo()->AuraInterruptFlags & AURA_INTERRUPT_FLAG_TAKE_DAMAGE) + if ((!excludeAura || excludeAura != (*itr)->GetSpellInfo()->Id) && //Avoid self interrupt of channeled Crowd Control spells like Seduction + ((*itr)->GetSpellInfo()->Attributes & SPELL_ATTR0_BREAKABLE_BY_DAMAGE || (*itr)->GetSpellInfo()->AuraInterruptFlags & AURA_INTERRUPT_FLAG_TAKE_DAMAGE)) return true; return false; } -bool Unit::HasBreakableByDamageCrowdControlAura() const +bool Unit::HasBreakableByDamageCrowdControlAura(Unit* excludeCasterChannel) const { - return ( HasBreakableByDamageAuraType(SPELL_AURA_MOD_CONFUSE) - || HasBreakableByDamageAuraType(SPELL_AURA_MOD_FEAR) - || HasBreakableByDamageAuraType(SPELL_AURA_MOD_STUN) - || HasBreakableByDamageAuraType(SPELL_AURA_MOD_ROOT) - || HasBreakableByDamageAuraType(SPELL_AURA_TRANSFORM)); + uint32 excludeAura = 0; + if (Spell* currentChanneledSpell = excludeCasterChannel ? excludeCasterChannel->GetCurrentSpell(CURRENT_CHANNELED_SPELL) : NULL) + excludeAura = currentChanneledSpell->GetSpellInfo()->Id; //Avoid self interrupt of channeled Crowd Control spells like Seduction + + return ( HasBreakableByDamageAuraType(SPELL_AURA_MOD_CONFUSE, excludeAura) + || HasBreakableByDamageAuraType(SPELL_AURA_MOD_FEAR, excludeAura) + || HasBreakableByDamageAuraType(SPELL_AURA_MOD_STUN, excludeAura) + || HasBreakableByDamageAuraType(SPELL_AURA_MOD_ROOT, excludeAura) + || HasBreakableByDamageAuraType(SPELL_AURA_TRANSFORM, excludeAura)); } void Unit::DealDamageMods(Unit* victim, uint32 &damage, uint32* absorb) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index abcdf13c49b..423f83844d3 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1555,8 +1555,8 @@ class Unit : public WorldObject bool HasAuraTypeWithFamilyFlags(AuraType auraType, uint32 familyName, uint32 familyFlags) const; bool virtual HasSpell(uint32 /*spellID*/) const { return false; } - bool HasBreakableByDamageAuraType(AuraType type) const; - bool HasBreakableByDamageCrowdControlAura() const; + bool HasBreakableByDamageAuraType(AuraType type, uint32 excludeAura = 0) const; + bool HasBreakableByDamageCrowdControlAura(Unit* excludeCasterChannel = NULL) const; bool HasStealthAura() const { return HasAuraType(SPELL_AURA_MOD_STEALTH); } bool HasInvisibilityAura() const { return HasAuraType(SPELL_AURA_MOD_INVISIBILITY); } diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 04e9c05e02d..fda2ececf1f 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -1738,7 +1738,7 @@ public: if (!UpdateVictim()) return; - if (me->getVictim()->HasBreakableByDamageCrowdControlAura()) + if (me->getVictim()->HasBreakableByDamageCrowdControlAura(me)) { me->InterruptNonMeleeSpells(false); return; |