From 354f560a443e71c5981e0d353fbea6b5e38f60d2 Mon Sep 17 00:00:00 2001 From: Hondacrx Date: Sun, 8 Jun 2025 15:14:03 -0400 Subject: [PATCH] Core/Spells: Don't fail spells SPELL_ATTR2_FAIL_ON_ALL_TARGETS_IMMUNE when target list is empty for one effect Port From (https://github.com/TrinityCore/TrinityCore/commit/a5c547a383e40b155a2063404c040ea0007c9ebd) --- Source/Game/Spells/Spell.cs | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/Source/Game/Spells/Spell.cs b/Source/Game/Spells/Spell.cs index e82254754..32753eaff 100644 --- a/Source/Game/Spells/Spell.cs +++ b/Source/Game/Spells/Spell.cs @@ -275,17 +275,6 @@ namespace Game.Spells return; } } - if (m_spellInfo.HasAttribute(SpellAttr2.FailOnAllTargetsImmune)) - { - bool anyNonImmuneTargetFound = m_UniqueTargetInfo.Any(target => (target.EffectMask & 1 << (int)spellEffectInfo.EffectIndex) != 0 && target.MissCondition != SpellMissInfo.Immune && target.MissCondition != SpellMissInfo.Immune2); - - if (!anyNonImmuneTargetFound) - { - SendCastResult(SpellCastResult.Immune); - Finish(SpellCastResult.Immune); - return; - } - } } if (m_spellInfo.IsChanneled()) @@ -310,6 +299,18 @@ namespace Game.Spells } } + if (m_spellInfo.HasAttribute(SpellAttr2.FailOnAllTargetsImmune)) + { + bool anyNonImmuneTargetFound = m_UniqueTargetInfo.Any(target => target.MissCondition != SpellMissInfo.Immune && target.MissCondition != SpellMissInfo.Immune2); + + if (!anyNonImmuneTargetFound) + { + SendCastResult(SpellCastResult.Immune); + Finish(SpellCastResult.Immune); + return; + } + } + if (m_targets.HasDst()) { if (m_spellInfo.HasAttribute(SpellAttr8.RequiresLocationToBeOnLiquidSurface))