Core/Auras: Allow SPELL_AURA_MECHANIC_IMMUNITY_MASK to apply aoe/chain targeting immunity
Port From (https://github.com/TrinityCore/TrinityCore/commit/ed0b621d1569a14174a9802027b68dbe4329da69)
This commit is contained in:
+13
-18
@@ -9185,26 +9185,21 @@ namespace Game.Spells
|
||||
if (!isInsideCylinder)
|
||||
return false;
|
||||
|
||||
Creature creatureTarget = target.ToCreature();
|
||||
if (creatureTarget != null)
|
||||
Unit unitTarget = target.ToUnit();
|
||||
if (unitTarget != null)
|
||||
{
|
||||
CreatureImmunities immunities = Global.SpellMgr.GetCreatureImmunities(creatureTarget.GetCreatureTemplate().CreatureImmunitiesId);
|
||||
if (immunities != null)
|
||||
switch (_searchReason)
|
||||
{
|
||||
switch (_searchReason)
|
||||
{
|
||||
case WorldObjectSpellAreaTargetSearchReason.Area:
|
||||
if (immunities.ImmuneAoE)
|
||||
return false;
|
||||
break;
|
||||
case WorldObjectSpellAreaTargetSearchReason.Chain:
|
||||
if (immunities.ImmuneChain)
|
||||
return false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
case WorldObjectSpellAreaTargetSearchReason.Area:
|
||||
if (unitTarget.GetSpellOtherImmunityMask().HasFlag(SpellOtherImmunity.AoETarget))
|
||||
return false;
|
||||
break;
|
||||
case WorldObjectSpellAreaTargetSearchReason.Chain:
|
||||
if (unitTarget.GetSpellOtherImmunityMask().HasFlag(SpellOtherImmunity.ChainTarget))
|
||||
return false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user