From 4a6e4f7c0616cf362d79ce9667ad170a9a3c2962 Mon Sep 17 00:00:00 2001 From: killerwife Date: Wed, 17 Apr 2024 20:17:18 +0200 Subject: [PATCH] Spell: Add usage of SPELL_ATTR_EX3_IGNORE_CASTER_AND_TARGET_RESTRICTIONS to checking immune on target --- src/game/Entities/Unit.cpp | 3 ++- src/game/Spells/Spell.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/game/Entities/Unit.cpp b/src/game/Entities/Unit.cpp index 575d1a4634..2b3e7c5b40 100644 --- a/src/game/Entities/Unit.cpp +++ b/src/game/Entities/Unit.cpp @@ -2988,7 +2988,8 @@ SpellMissInfo Unit::SpellHitResult(WorldObject* caster, Unit* pVictim, SpellEntr // All positive spells can`t miss // TODO: client not show miss log for this spells - so need find info for this in dbc and use it! - if (IsPositiveEffectMask(spellInfo, effectMask, caster, pVictim)) + bool ignoreRestrictions = spellInfo->HasAttribute(SPELL_ATTR_EX3_IGNORE_CASTER_AND_TARGET_RESTRICTIONS) || spellInfo->HasAttribute(SPELL_ATTR_EX5_IGNORE_TARGET_REQUIREMENTS); + if (!ignoreRestrictions && IsPositiveEffectMask(spellInfo, effectMask, caster, pVictim)) { if (pVictim->IsImmuneToSpell(spellInfo, reflected ? false : (caster == pVictim), effectMask, caster)) return SPELL_MISS_IMMUNE; diff --git a/src/game/Spells/Spell.cpp b/src/game/Spells/Spell.cpp index e572df0039..a9f7fbb92b 100644 --- a/src/game/Spells/Spell.cpp +++ b/src/game/Spells/Spell.cpp @@ -5098,7 +5098,7 @@ SpellCastResult Spell::CheckCast(bool strict) } } - if (IsPositiveSpell(m_spellInfo->Id, m_trueCaster, target) && affectedMask) + if (!ignoreRestrictions && IsPositiveSpell(m_spellInfo->Id, m_trueCaster, target) && affectedMask) if (target->IsImmuneToSpell(m_spellInfo, target == m_trueCaster, affectedMask, m_trueCaster)) return SPELL_FAILED_TARGET_AURASTATE;