Core/Spells: Implemented NoImmunity spell effect attribute

Port From (https://github.com/TrinityCore/TrinityCore/commit/e883b61094c3a5d2e80d2165e53921631e72e33e)
This commit is contained in:
hondacrx
2024-01-30 10:45:14 -05:00
parent 54244bb6cc
commit 774f211f7a
3 changed files with 13 additions and 7 deletions
+7 -1
View File
@@ -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)
{