Core/Unit: improve SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL immunities
Port From (https://github.com/TrinityCore/TrinityCore/commit/9b7c55921f521d1de2d19d39fc56e9cdeca5b138)
This commit is contained in:
@@ -1333,24 +1333,24 @@ namespace Game.Entities
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!spellInfo.HasAttribute(SpellAttr3.IgnoreHitResult))
|
AuraType aura = spellEffectInfo.ApplyAuraName;
|
||||||
|
if (aura != 0)
|
||||||
{
|
{
|
||||||
uint aura = (uint)spellEffectInfo.ApplyAuraName;
|
if (!spellInfo.HasAttribute(SpellAttr3.IgnoreHitResult))
|
||||||
if (aura != 0)
|
|
||||||
{
|
{
|
||||||
var list = m_spellImmune[(int)SpellImmunity.State];
|
var list = m_spellImmune[(int)SpellImmunity.State];
|
||||||
if (list.ContainsKey(aura))
|
if (list.ContainsKey(aura))
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (!spellInfo.HasAttribute(SpellAttr2.UnaffectedByAuraSchoolImmune))
|
if (!spellInfo.HasAttribute(SpellAttr2.UnaffectedByAuraSchoolImmune))
|
||||||
{
|
{
|
||||||
// Check for immune to application of harmful magical effects
|
// Check for immune to application of harmful magical effects
|
||||||
var immuneAuraApply = GetAuraEffectsByType(AuraType.ModImmuneAuraApplySchool);
|
var immuneAuraApply = GetAuraEffectsByType(AuraType.ModImmuneAuraApplySchool);
|
||||||
foreach (var auraEffect in immuneAuraApply)
|
foreach (var auraEffect in immuneAuraApply)
|
||||||
if (Convert.ToBoolean(auraEffect.GetMiscValue() & (int)spellInfo.GetSchoolMask()) && // Check school
|
if (Convert.ToBoolean(auraEffect.GetMiscValue() & (int)spellInfo.GetSchoolMask()) && // Check school
|
||||||
((caster && !IsFriendlyTo(caster)) || !spellInfo.IsPositiveEffect(spellEffectInfo.EffectIndex))) // Harmful
|
((caster && !IsFriendlyTo(caster)) || !spellInfo.IsPositiveEffect(spellEffectInfo.EffectIndex))) // Harmful
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user