From 6086ae63f35375bc113e01c33c543a085d53b8a9 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sun, 29 May 2022 22:57:33 -0400 Subject: [PATCH] Scripts/Spells: Mount check aura for Gryphon Hatchling & Wind Rider Cub Port From (https://github.com/TrinityCore/TrinityCore/commit/5f40959687d78c6389a82c2f864cc8f60378dabb) --- Source/Scripts/Spells/Generic.cs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Source/Scripts/Spells/Generic.cs b/Source/Scripts/Spells/Generic.cs index 8d59cedbf..cc96465c1 100644 --- a/Source/Scripts/Spells/Generic.cs +++ b/Source/Scripts/Spells/Generic.cs @@ -1912,6 +1912,35 @@ namespace Scripts.Spells.Generic } } + [Script] // 69641 - Gryphon/Wyvern Pet - Mounting Check Aura + class spell_gen_gryphon_wyvern_mount_check : AuraScript + { + void HandleEffectPeriodic(AuraEffect aurEff) + { + Unit target = GetTarget(); + Unit owner = target.GetOwner(); + + if (owner == null) + return; + + if (owner.IsMounted()) + { + target.SetAnimTier(AnimTier.Fly); + target.SetDisableGravity(true); + } + else + { + target.SetAnimTier(AnimTier.Ground); + target.SetDisableGravity(false); + } + } + + public override void Register() + { + OnEffectPeriodic.Add(new EffectPeriodicHandler(HandleEffectPeriodic, 0, AuraType.PeriodicDummy)); + } + } + [Script] class spell_gen_interrupt : AuraScript {