Core/Spells: Apply UNIT_FLAG_IMMUNE after applying SPELL_AURA_DAMAGE_IMMUNITY
Port From (https://github.com/TrinityCore/TrinityCore/commit/18beee8ba19c8848c868fdb9b9a7bad296e74d53)
This commit is contained in:
@@ -2834,7 +2834,7 @@ namespace Game.Spells
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// do not remove unit flag if there are more than this auraEffect of that kind on unit
|
// do not remove unit flag if there are more than this auraEffect of that kind on unit
|
||||||
if (target.HasAuraType(GetAuraType()))
|
if (target.HasAuraType(GetAuraType()) || target.HasAuraType(AuraType.DamageImmunity))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
target.RemoveUnitFlag(UnitFlags.Immune);
|
target.RemoveUnitFlag(UnitFlags.Immune);
|
||||||
@@ -2851,7 +2851,17 @@ namespace Game.Spells
|
|||||||
m_spellInfo.ApplyAllSpellImmunitiesTo(target, GetSpellEffectInfo(), apply);
|
m_spellInfo.ApplyAllSpellImmunitiesTo(target, GetSpellEffectInfo(), apply);
|
||||||
|
|
||||||
if (apply)
|
if (apply)
|
||||||
|
{
|
||||||
|
target.AddUnitFlag(UnitFlags.Immune);
|
||||||
target.GetThreatManager().EvaluateSuppressed();
|
target.GetThreatManager().EvaluateSuppressed();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// do not remove unit flag if there are more than this auraEffect of that kind on unit
|
||||||
|
if (target.HasAuraType(GetAuraType()) || target.HasAuraType(AuraType.SchoolImmunity))
|
||||||
|
return;
|
||||||
|
target.RemoveUnitFlag(UnitFlags.Immune);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[AuraEffectHandler(AuraType.DispelImmunity)]
|
[AuraEffectHandler(AuraType.DispelImmunity)]
|
||||||
|
|||||||
Reference in New Issue
Block a user