diff options
| author | Aqua Deus <95978183+aquadeus@users.noreply.github.com> | 2022-06-16 17:45:23 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-16 17:45:23 +0200 |
| commit | d5f5bbfa66e9096856f2109b184eb3fcf1fdfec0 (patch) | |
| tree | 767d5cbb6eb5426d205d2ddcadf040d7df6b6ccc /src | |
| parent | 5517208b67cf5c0b8054067cee081e968e66694d (diff) | |
Scripts/Spells: Fix hunter talent Posthaste (#28019)
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/scripts/Spells/spell_hunter.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
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); |
