mirror of
https://github.com/araxiaonline/TrinityCore2.git
synced 2026-06-17 13:29:41 -04:00
Merge pull request #4229 from devilcoredev/fix_002
Core/Spells: Fix the spell immunity system to be effect-dependent
This commit is contained in:
@@ -11475,7 +11475,8 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (spellInfo->Mechanic)
|
||||
// Spells that don't have effectMechanics.
|
||||
if (!spellInfo->HasAnyEffectMechanic() && spellInfo->Mechanic)
|
||||
{
|
||||
SpellImmuneList const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC];
|
||||
for (SpellImmuneList::const_iterator itr = mechanicList.begin(); itr != mechanicList.end(); ++itr)
|
||||
@@ -11483,14 +11484,19 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo)
|
||||
return true;
|
||||
}
|
||||
|
||||
for (int i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
bool immuneToAllEffects = true;
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
// State/effect immunities applied by aura expect full spell immunity
|
||||
// Ignore effects with mechanic, they are supposed to be checked separately
|
||||
if (!spellInfo->Effects[i].Mechanic)
|
||||
if (IsImmunedToSpellEffect(spellInfo, i))
|
||||
return true;
|
||||
if (spellInfo->Effects[i].Mechanic || !IsImmunedToSpellEffect(spellInfo, i))
|
||||
{
|
||||
immuneToAllEffects = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (immuneToAllEffects) //Return immune only if the target is immune to all spell effects.
|
||||
return true;
|
||||
|
||||
if (spellInfo->Id != 42292 && spellInfo->Id !=59752)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user