From 3ce314ef4b86c678cebf388d20b6befeb6dfa216 Mon Sep 17 00:00:00 2001 From: Hondacrx Date: Sun, 25 Aug 2024 23:54:10 -0400 Subject: [PATCH] Core/Spells: Implemented SPELL_ATTR9_TARGET_MUST_BE_GROUNDED Port From (https://github.com/TrinityCore/TrinityCore/commit/dd61ba2844fc96b3344183fe0b05ce65985fa8be) --- Source/Framework/Constants/Spells/SpellConst.cs | 2 +- Source/Game/Spells/SpellInfo.cs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/Framework/Constants/Spells/SpellConst.cs b/Source/Framework/Constants/Spells/SpellConst.cs index ff8c28e81..62a9f05cd 100644 --- a/Source/Framework/Constants/Spells/SpellConst.cs +++ b/Source/Framework/Constants/Spells/SpellConst.cs @@ -1976,7 +1976,7 @@ namespace Framework.Constants DoNotAddToUnlearnList = 0x80, // NYI - unlearn list not maintained SMSG_SEND_UNLEARN_SPELLS always empty // Do Not Add to Unlearn List CooldownIgnoresRangedWeapon = 0x100, // Cooldown Ignores Ranged Weapon NotInArena = 0x200, // 9 Not In Arena - Unk10 = 0x400, // 10 + TargetMustBeGrounded = 0x400, // Target Must Be Grounded Unk11 = 0x800, // 11 Unk12 = 0x1000, // 12 Slam = 0x2000, // 13 diff --git a/Source/Game/Spells/SpellInfo.cs b/Source/Game/Spells/SpellInfo.cs index 37d47c8ad..79b4ad146 100644 --- a/Source/Game/Spells/SpellInfo.cs +++ b/Source/Game/Spells/SpellInfo.cs @@ -1079,6 +1079,11 @@ namespace Game.Spells if (HasAttribute(SpellAttr3.NotOnAoeImmune)) if (unitTarget.GetSpellOtherImmunityMask().HasFlag(SpellOtherImmunity.AoETarget)) return SpellCastResult.BadTargets; + + if (HasAttribute(SpellAttr9.TargetMustBeGrounded) && + (unitTarget.HasUnitMovementFlag(MovementFlag.Falling | MovementFlag.Swimming | MovementFlag.Flying | MovementFlag.Hover) || + unitTarget.HasExtraUnitMovementFlag2(MovementFlags3.AdvFlying))) + return SpellCastResult.TargetNotGrounded; } // corpse specific target checks else if (target.IsTypeId(TypeId.Corpse))