From fec27d8d8a0a56d1e92001d78b1aab3b4df4e158 Mon Sep 17 00:00:00 2001 From: IntelligentQuantum Date: Thu, 16 Sep 2021 19:40:54 +0430 Subject: [PATCH] fix(Core/Spell): Warlock Banish (#7832) --- src/server/scripts/Spells/spell_warlock.cpp | 26 ++++----------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 53c4e355a..3fc437f87 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -551,45 +551,27 @@ public: { PrepareSpellScript(spell_warl_banish_SpellScript); - bool Load() override - { - _removed = false; - return true; - } - void HandleBanish(SpellMissInfo missInfo) { - if (missInfo != SPELL_MISS_NONE) + if (missInfo != SPELL_MISS_IMMUNE) { return; } if (Unit* target = GetHitUnit()) { - if (target->GetAuraEffect(SPELL_AURA_SCHOOL_IMMUNITY, SPELLFAMILY_WARLOCK, 0, 0x08000000, 0)) + // Casting Banish on a banished target will remove applied aura + if (Aura* banishAura = target->GetAura(GetSpellInfo()->Id, GetCaster()->GetGUID())) { - // No need to remove old aura since its removed due to not stack by current Banish aura - PreventHitDefaultEffect(EFFECT_0); - PreventHitDefaultEffect(EFFECT_1); - PreventHitDefaultEffect(EFFECT_2); - _removed = true; + banishAura->Remove(); } } } - void RemoveAura() - { - if (_removed) - PreventHitAura(); - } - void Register() override { BeforeHit += BeforeSpellHitFn(spell_warl_banish_SpellScript::HandleBanish); - AfterHit += SpellHitFn(spell_warl_banish_SpellScript::RemoveAura); } - - bool _removed; }; SpellScript* GetSpellScript() const override