From b267c1227355d3c514ae0365f36cc70a9ae5585c Mon Sep 17 00:00:00 2001 From: Hondacrx Date: Mon, 8 Dec 2025 10:25:40 -0500 Subject: [PATCH] Core/Auras: Implement SPELL_AURA_INTERFERE_ALL_TARGETING (SPELL_AURA_486) Port From (https://github.com/TrinityCore/TrinityCore/commit/5fad0fb43af8498c1ae6d4bc79f47fe318d391c8) --- .../Framework/Constants/Spells/SpellAuraConst.cs | 4 ++-- Source/Game/Spells/Spell.cs | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Source/Framework/Constants/Spells/SpellAuraConst.cs b/Source/Framework/Constants/Spells/SpellAuraConst.cs index 6c6d78c42..9c02ef6cd 100644 --- a/Source/Framework/Constants/Spells/SpellAuraConst.cs +++ b/Source/Framework/Constants/Spells/SpellAuraConst.cs @@ -329,7 +329,7 @@ namespace Framework.Constants ModMeleeHaste3 = 319, Unk320 = 320, ModNoActions = 321, - InterfereTargetting = 322, + InterfereEnemyTargeting = 322, Unk323 = 323, // Not Used In 4.3.4 OverrideUnlockedAzeriteEssenceRank = 324, // testing aura LearnPvpTalent = 325, // NYI @@ -493,7 +493,7 @@ namespace Framework.Constants SuppressTransforms = 483, // NYI AllowInterruptSpell = 484, // NYI ModMovementForceMagnitude = 485, - Unk486 = 486, + InterfereAllTargeting = 486, CosmeticMounted = 487, DisableGravity = 488, ModAlternativeDefaultLanguage = 489, // NYI diff --git a/Source/Game/Spells/Spell.cs b/Source/Game/Spells/Spell.cs index ee466a35c..8e60d82e6 100644 --- a/Source/Game/Spells/Spell.cs +++ b/Source/Game/Spells/Spell.cs @@ -5239,18 +5239,26 @@ namespace Game.Spells if (castResult != SpellCastResult.SpellCastOk) return castResult; - // If it's not a melee spell, check if vision is obscured by SPELL_AURA_INTERFERE_TARGETTING + // If it's not a melee spell, check if vision is obscured by SPELL_AURA_INTERFERE_ENEMY_TARGETING if (m_spellInfo.DmgClass != SpellDmgClass.Melee) { Unit unitCaster1 = m_caster.ToUnit(); if (unitCaster1 != null) { - foreach (var auraEffect in unitCaster1.GetAuraEffectsByType(AuraType.InterfereTargetting)) + foreach (var auraEffect in unitCaster1.GetAuraEffectsByType(AuraType.InterfereEnemyTargeting)) if (!unitCaster1.IsFriendlyTo(auraEffect.GetCaster()) && !unitTarget.HasAura(auraEffect.GetId(), auraEffect.GetCasterGUID())) return SpellCastResult.VisionObscured; - foreach (var auraEffect in unitTarget.GetAuraEffectsByType(AuraType.InterfereTargetting)) - if (!unitCaster1.IsFriendlyTo(auraEffect.GetCaster()) && (!unitTarget.HasAura(auraEffect.GetId(), auraEffect.GetCasterGUID()) || !unitCaster1.HasAura(auraEffect.GetId(), auraEffect.GetCasterGUID()))) + foreach (AuraEffect auraEff in unitTarget.GetAuraEffectsByType(AuraType.InterfereEnemyTargeting)) + if (!unitCaster.IsFriendlyTo(auraEff.GetCaster()) && !unitCaster.HasAura(auraEff.GetId(), auraEff.GetCasterGUID())) + return SpellCastResult.VisionObscured; + + foreach (AuraEffect auraEff in unitCaster.GetAuraEffectsByType(AuraType.InterfereAllTargeting)) + if (!unitTarget.HasAura(auraEff.GetId(), auraEff.GetCasterGUID())) + return SpellCastResult.VisionObscured; + + foreach (AuraEffect auraEff in unitTarget.GetAuraEffectsByType(AuraType.InterfereAllTargeting)) + if (!unitCaster.HasAura(auraEff.GetId(), auraEff.GetCasterGUID())) return SpellCastResult.VisionObscured; } }