mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-02 18:43:48 +00:00
fix(Core/Spell): Make use of SPELL_ATTR2_NO_SCHOOL_IMMUNITIES (#5880)
This commit is contained in:
@@ -1289,15 +1289,27 @@ bool SpellInfo::IsAffectedBySpellMod(SpellModifier const* mod) const
|
||||
|
||||
bool SpellInfo::CanPierceImmuneAura(SpellInfo const* aura) const
|
||||
{
|
||||
// aura can't be pierced
|
||||
if (!aura || aura->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// these spells pierce all avalible spells (Resurrection Sickness for example)
|
||||
if (HasAttribute(SPELL_ATTR0_NO_IMMUNITIES))
|
||||
return true;
|
||||
|
||||
// these spells (Cyclone for example) can pierce all...
|
||||
if ((AttributesEx & SPELL_ATTR1_IMMUNITY_TO_HOSTILE_AND_FRIENDLY_EFFECTS)
|
||||
// ...but not these (Divine shield for example) // xinef: banish exception, banish can override banish to cancel itself
|
||||
&& !(aura && (aura->Mechanic == MECHANIC_IMMUNE_SHIELD || aura->Mechanic == MECHANIC_INVULNERABILITY || (aura->Mechanic == MECHANIC_BANISH && (Mechanic != MECHANIC_BANISH || !(AttributesEx2 & SPELL_ATTR2_CANNOT_CAST_ON_TAPPED))))))
|
||||
return true;
|
||||
if (HasAttribute(SPELL_ATTR1_IMMUNITY_TO_HOSTILE_AND_FRIENDLY_EFFECTS) || HasAttribute(SPELL_ATTR2_NO_SCHOOL_IMMUNITIES))
|
||||
{
|
||||
if (aura->Mechanic != MECHANIC_IMMUNE_SHIELD &&
|
||||
aura->Mechanic != MECHANIC_INVULNERABILITY &&
|
||||
aura->Mechanic != MECHANIC_BANISH)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -1308,22 +1320,20 @@ bool SpellInfo::CanDispelAura(SpellInfo const* aura) const
|
||||
if (aura->IsPassive())
|
||||
return false;
|
||||
|
||||
// Xinef: At frist we check non-player auras, that should be never dispellable
|
||||
// Xinef: Eg. Mark of the Fallen Champion
|
||||
if (aura->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES) && aura->SpellFamilyName == SPELLFAMILY_GENERIC)
|
||||
// These auras (like Divine Shield) can't be dispelled
|
||||
if (aura->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES))
|
||||
return false;
|
||||
|
||||
// These spells (like Mass Dispel) can dispell all auras
|
||||
if (HasAttribute(SPELL_ATTR0_NO_IMMUNITIES))
|
||||
return true;
|
||||
|
||||
// These auras (like Divine Shield) can't be dispelled
|
||||
if (aura->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES))
|
||||
return false;
|
||||
|
||||
// These auras (Cyclone for example) are not dispelable
|
||||
if (aura->HasAttribute(SPELL_ATTR1_IMMUNITY_TO_HOSTILE_AND_FRIENDLY_EFFECTS))
|
||||
if ((aura->HasAttribute(SPELL_ATTR1_IMMUNITY_TO_HOSTILE_AND_FRIENDLY_EFFECTS) && aura->Mechanic != MECHANIC_NONE)
|
||||
|| aura->HasAttribute(SPELL_ATTR2_NO_SCHOOL_IMMUNITIES))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user