Core/Spell: partial revert of SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE immunity handling

This commit is contained in:
hondacrx
2018-03-12 14:37:52 -04:00
parent 205887145e
commit 05ecb41a10
5 changed files with 23 additions and 15 deletions
@@ -298,7 +298,7 @@ namespace Framework.Constants
Interrupt = 26,
Daze = 27,
Discovery = 28,
Immune_Shield = 29, // Divine (Blessing) Shield/Protection And Ice Block
ImmuneShield = 29, // Divine (Blessing) Shield/Protection And Ice Block
Sapped = 30,
Enraged = 31,
Wounded = 32,
+1 -4
View File
@@ -1557,7 +1557,7 @@ namespace Game.Entities
{
// State/effect immunities applied by aura expect full spell immunity
// Ignore effects with mechanic, they are supposed to be checked separately
if (effect == null)
if (effect == null || !effect.IsEffect())
continue;
if (!IsImmunedToSpellEffect(spellInfo, effect.EffectIndex, caster))
@@ -1570,8 +1570,6 @@ namespace Game.Entities
if (immuneToAllEffects) //Return immune only if the target is immune to all spell effects.
return true;
if (!spellInfo.HasAttribute(SpellAttr1.UnaffectedBySchoolImmune) && !spellInfo.HasAttribute(SpellAttr2.UnaffectedByAuraSchoolImmune))
{
var schoolList = m_spellImmune[(int)SpellImmunity.School];
foreach (var pair in schoolList)
{
@@ -1581,7 +1579,6 @@ namespace Game.Entities
&& !spellInfo.CanPierceImmuneAura(immuneSpellInfo))
return true;
}
}
return false;
}
+1 -1
View File
@@ -152,7 +152,7 @@ namespace Game.Entities
_me.ApplySpellImmune(0, SpellImmunity.State, AuraType.ModUnattackable, true);
_me.ApplySpellImmune(0, SpellImmunity.State, AuraType.SchoolAbsorb, true);
_me.ApplySpellImmune(0, SpellImmunity.Mechanic, (uint)Mechanics.Shield, true);
_me.ApplySpellImmune(0, SpellImmunity.Mechanic, (uint)Mechanics.Immune_Shield, true);
_me.ApplySpellImmune(0, SpellImmunity.Mechanic, (uint)Mechanics.ImmuneShield, true);
// ... Resistance, Split damage, Change stats ...
_me.ApplySpellImmune(0, SpellImmunity.State, AuraType.DamageShield, true);
+12 -1
View File
@@ -675,6 +675,17 @@ namespace Game.Spells
if (HasAttribute(SpellAttr0.UnaffectedByInvulnerability))
return true;
// these spells (Cyclone for example) can pierce all...
if (HasAttribute(SpellAttr1.UnaffectedBySchoolImmune) || HasAttribute(SpellAttr2.UnaffectedByAuraSchoolImmune))
{
// ...but not these (Divine shield, Ice block, Cyclone and Banish for example)
if (auraSpellInfo == null ||
(auraSpellInfo.Mechanic != Mechanics.ImmuneShield &&
auraSpellInfo.Mechanic != Mechanics.Invulnerability &&
(auraSpellInfo.Mechanic != Mechanics.Banish || IsRankOf(auraSpellInfo)))) // Banish shouldn't be immune to itself
return true;
}
// Dispels other auras on immunity, check if this spell makes the unit immune to aura
if (HasAttribute(SpellAttr1.DispelAurasOnImmunity) && CanSpellProvideImmunityAgainstAura(auraSpellInfo))
return true;
@@ -3186,7 +3197,7 @@ namespace Game.Spells
break;
}
if (Mechanic == Mechanics.Immune_Shield)
if (Mechanic == Mechanics.ImmuneShield)
return true;
// Special case: effects which determine positivity of whole spell
+1 -1
View File
@@ -577,7 +577,7 @@ namespace Scripts.Spells.Warrior
// remove shields, will still display immune to damage part
Unit target = GetHitUnit();
if (target)
target.RemoveAurasWithMechanic(1 << (int)Mechanics.Immune_Shield, AuraRemoveMode.EnemySpell);
target.RemoveAurasWithMechanic(1 << (int)Mechanics.ImmuneShield, AuraRemoveMode.EnemySpell);
}
public override void Register()