diff options
| author | Kitzunu <24550914+Kitzunu@users.noreply.github.com> | 2024-01-07 16:03:53 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-07 12:03:53 -0300 |
| commit | 7a859da266bbee61e41b9ed9efa4d49b7f8eb503 (patch) | |
| tree | 12abe8402da46dae623ea10f0b3f28a77b9aa795 /src/server/scripts/Spells | |
| parent | a1f924050f95430cc2ff805abede6fafe34405b7 (diff) | |
fix(Script/Spell): Vanish Purge behavior (#18127)
Diffstat (limited to 'src/server/scripts/Spells')
| -rw-r--r-- | src/server/scripts/Spells/spell_rogue.cpp | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index 5bb10a6ffa..f9a4690259 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -693,6 +693,65 @@ class spell_rog_pickpocket : public SpellScript } }; +enum vanish +{ + SPELL_PARALYZE = 38132, + SPELL_CLEAN_ESCAPE_AURA = 23582, + SPELL_CLEAN_ESCAPE_HEAL = 23583 +}; + +// 18461 - Vanish Purge (Server Side) +class spell_rog_vanish_purge : public SpellScript +{ + PrepareSpellScript(spell_rog_vanish_purge); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_PARALYZE }); + } + + void HandleRootRemove(SpellEffIndex /*effIndex*/) + { + if (GetCaster() && !GetCaster()->HasAura(SPELL_PARALYZE)) // Root from Tainted Core SSC, should not be removed by vanish. + GetCaster()->RemoveAurasWithMechanic(1 << MECHANIC_ROOT); + } + + void HandleSnareRemove(SpellEffIndex /*effIndex*/) + { + if (GetCaster()) + GetCaster()->RemoveAurasWithMechanic(1 << MECHANIC_SNARE); + } + + void Register() override + { + // Blizzard handles EFFECT_0 as the unroot and EFFECT_1 as unsnare. Hence why they are not done in the same place. + OnEffectHitTarget += SpellEffectFn(spell_rog_vanish_purge::HandleRootRemove, EFFECT_0, SPELL_EFFECT_APPLY_AURA); + OnEffectHitTarget += SpellEffectFn(spell_rog_vanish_purge::HandleSnareRemove, EFFECT_1, SPELL_EFFECT_APPLY_AURA); + } +}; + +// -1856 - Vanish +class spell_rog_vanish : public SpellScript +{ + PrepareSpellScript(spell_rog_vanish); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_CLEAN_ESCAPE_AURA, SPELL_CLEAN_ESCAPE_HEAL }); + } + + void HandleEffect(SpellEffIndex /*effIndex*/) + { + if (GetCaster() && GetCaster()->HasAura(SPELL_CLEAN_ESCAPE_AURA)) + GetCaster()->CastSpell(GetCaster(), SPELL_CLEAN_ESCAPE_HEAL, true); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_rog_vanish::HandleEffect, EFFECT_2, SPELL_EFFECT_SANCTUARY); + } +}; + void AddSC_rogue_spell_scripts() { RegisterSpellScript(spell_rog_savage_combat); @@ -709,5 +768,7 @@ void AddSC_rogue_spell_scripts() RegisterSpellScript(spell_rog_tricks_of_the_trade); RegisterSpellScript(spell_rog_tricks_of_the_trade_proc); RegisterSpellScript(spell_rog_pickpocket); + RegisterSpellScript(spell_rog_vanish_purge); + RegisterSpellScript(spell_rog_vanish); } |
