mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-30 09:03:47 +00:00
fix(Core/Spell): Warlock Banish (#7832)
This commit is contained in:
committed by
GitHub
parent
c962833bf4
commit
fec27d8d8a
@@ -551,45 +551,27 @@ public:
|
|||||||
{
|
{
|
||||||
PrepareSpellScript(spell_warl_banish_SpellScript);
|
PrepareSpellScript(spell_warl_banish_SpellScript);
|
||||||
|
|
||||||
bool Load() override
|
|
||||||
{
|
|
||||||
_removed = false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void HandleBanish(SpellMissInfo missInfo)
|
void HandleBanish(SpellMissInfo missInfo)
|
||||||
{
|
{
|
||||||
if (missInfo != SPELL_MISS_NONE)
|
if (missInfo != SPELL_MISS_IMMUNE)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Unit* target = GetHitUnit())
|
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
|
banishAura->Remove();
|
||||||
PreventHitDefaultEffect(EFFECT_0);
|
|
||||||
PreventHitDefaultEffect(EFFECT_1);
|
|
||||||
PreventHitDefaultEffect(EFFECT_2);
|
|
||||||
_removed = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoveAura()
|
|
||||||
{
|
|
||||||
if (_removed)
|
|
||||||
PreventHitAura();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Register() override
|
void Register() override
|
||||||
{
|
{
|
||||||
BeforeHit += BeforeSpellHitFn(spell_warl_banish_SpellScript::HandleBanish);
|
BeforeHit += BeforeSpellHitFn(spell_warl_banish_SpellScript::HandleBanish);
|
||||||
AfterHit += SpellHitFn(spell_warl_banish_SpellScript::RemoveAura);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool _removed;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
SpellScript* GetSpellScript() const override
|
SpellScript* GetSpellScript() const override
|
||||||
|
|||||||
Reference in New Issue
Block a user