From d5f5bbfa66e9096856f2109b184eb3fcf1fdfec0 Mon Sep 17 00:00:00 2001 From: Aqua Deus <95978183+aquadeus@users.noreply.github.com> Date: Thu, 16 Jun 2022 17:45:23 +0200 Subject: Scripts/Spells: Fix hunter talent Posthaste (#28019) --- src/server/scripts/Spells/spell_hunter.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/server/scripts') diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index d7f0abd4295..c93c32398a8 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -47,6 +47,8 @@ enum HunterSpells SPELL_HUNTER_PET_LAST_STAND_TRIGGERED = 53479, SPELL_HUNTER_PET_HEART_OF_THE_PHOENIX_TRIGGERED = 54114, SPELL_HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF = 55711, + SPELL_HUNTER_POSTHASTE_INCREASE_SPEED = 118922, + SPELL_HUNTER_POSTHASTE_TALENT = 109215, SPELL_HUNTER_STEADY_SHOT_FOCUS = 77443, SPELL_HUNTER_T9_4P_GREATNESS = 68130, SPELL_ROAR_OF_SACRIFICE_TRIGGERED = 67481 @@ -383,6 +385,31 @@ class spell_hun_pet_heart_of_the_phoenix : public SpellScript } }; +// 781 - Disengage +class spell_hun_posthaste : public SpellScript +{ + PrepareSpellScript(spell_hun_posthaste); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_HUNTER_POSTHASTE_TALENT, SPELL_HUNTER_POSTHASTE_INCREASE_SPEED }); + } + + void HandleAfterCast() + { + if (GetCaster()->HasAura(SPELL_HUNTER_POSTHASTE_TALENT)) + { + GetCaster()->RemoveMovementImpairingAuras(true); + GetCaster()->CastSpell(GetCaster(), SPELL_HUNTER_POSTHASTE_INCREASE_SPEED, GetSpell()); + } + } + + void Register() override + { + AfterCast += SpellCastFn(spell_hun_posthaste::HandleAfterCast); + } +}; + // 53480 - Roar of Sacrifice class spell_hun_roar_of_sacrifice : public AuraScript { @@ -594,6 +621,7 @@ void AddSC_hunter_spell_scripts() RegisterSpellScript(spell_hun_misdirection_proc); RegisterSpellScript(spell_hun_multi_shot); RegisterSpellScript(spell_hun_pet_heart_of_the_phoenix); + RegisterSpellScript(spell_hun_posthaste); RegisterSpellScript(spell_hun_roar_of_sacrifice); RegisterSpellScript(spell_hun_scatter_shot); RegisterSpellScript(spell_hun_steady_shot); -- cgit v1.2.3