Skip to content

Commit

Permalink
Spell: Add usage of SPELL_ATTR_EX3_IGNORE_CASTER_AND_TARGET_RESTRICTI…
Browse files Browse the repository at this point in the history
…ONS to checking immune on target
  • Loading branch information
killerwife committed May 5, 2024
1 parent 3187b03 commit b55130c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/game/Entities/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3156,7 +3156,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;
Expand Down
2 changes: 1 addition & 1 deletion src/game/Spells/Spell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5857,7 +5857,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;

Expand Down

0 comments on commit b55130c

Please sign in to comment.