Core/Spells: Implemented NoImmunity spell effect attribute
Port From (https://github.com/TrinityCore/TrinityCore/commit/e883b61094c3a5d2e80d2165e53921631e72e33e)
This commit is contained in:
@@ -1373,6 +1373,9 @@ namespace Game.Entities
|
||||
if (spellInfo.HasAttribute(SpellAttr0.NoImmunities))
|
||||
return false;
|
||||
|
||||
if (spellEffectInfo.EffectAttributes.HasFlag(SpellEffectAttributes.NoImmunity))
|
||||
return false;
|
||||
|
||||
bool hasImmunity(MultiMap<uint, uint> container, uint key)
|
||||
{
|
||||
var range = container.LookupByKey(key);
|
||||
@@ -1445,7 +1448,7 @@ namespace Game.Entities
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool IsImmunedToDamage(SpellInfo spellInfo)
|
||||
public bool IsImmunedToDamage(SpellInfo spellInfo, SpellEffectInfo spellEffectInfo = null)
|
||||
{
|
||||
if (spellInfo == null)
|
||||
return false;
|
||||
@@ -1457,6 +1460,9 @@ namespace Game.Entities
|
||||
if (spellInfo.HasAttribute(SpellAttr1.ImmunityToHostileAndFriendlyEffects) || spellInfo.HasAttribute(SpellAttr2.NoSchoolImmunities))
|
||||
return false;
|
||||
|
||||
if (spellEffectInfo != null && spellEffectInfo.EffectAttributes.HasFlag(SpellEffectAttributes.NoImmunity))
|
||||
return false;
|
||||
|
||||
uint schoolMask = (uint)spellInfo.GetSchoolMask();
|
||||
if (schoolMask != 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user