From 6116d6f0a555e60cffe9e82929bc0716423aad42 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Thu, 16 Jun 2022 22:33:32 -0400 Subject: [PATCH] Scripts/Spells: Fix hunter talent Posthaste Port From (https://github.com/TrinityCore/TrinityCore/commit/d5f5bbfa66e9096856f2109b184eb3fcf1fdfec0) --- Source/Scripts/Spells/Hunter.cs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Source/Scripts/Spells/Hunter.cs b/Source/Scripts/Spells/Hunter.cs index 0ffd59a64..b7f2a633a 100644 --- a/Source/Scripts/Spells/Hunter.cs +++ b/Source/Scripts/Spells/Hunter.cs @@ -41,6 +41,8 @@ namespace Scripts.Spells.Hunter public const uint PetLastStandTriggered = 53479; public const uint PetHeartOfThePhoenixTriggered = 54114; public const uint PetHeartOfThePhoenixDebuff = 55711; + public const uint PosthasteIncreaseSpeed = 118922; + public const uint PosthasteTalent = 109215; public const uint SteadyShotFocus = 77443; public const uint T94PGreatness = 68130; public const uint DraeneiGiftOfTheNaaru = 59543; @@ -316,6 +318,29 @@ namespace Scripts.Spells.Hunter } } + [Script] // 781 - Disengage + class spell_hun_posthaste : SpellScript + { + public override bool Validate(SpellInfo spellInfo) + { + return ValidateSpellInfo(SpellIds.PosthasteTalent, SpellIds.PosthasteIncreaseSpeed); + } + + void HandleAfterCast() + { + if (GetCaster().HasAura(SpellIds.PosthasteTalent)) + { + GetCaster().RemoveMovementImpairingAuras(true); + GetCaster().CastSpell(GetCaster(), SpellIds.PosthasteIncreaseSpeed, GetSpell()); + } + } + + public override void Register() + { + AfterCast.Add(new CastHandler(HandleAfterCast)); + } + } + [Script] // 53480 - Roar of Sacrifice class spell_hun_roar_of_sacrifice : AuraScript {