Core/Spells: Corrected implementation of SPELL_ATTR1_ALLOW_WHILE_STEALTHED and SPELL_ATTR2_ALLOW_WHILE_INVISIBLE to use DispelType instead of checking effect types

Port From (https://github.com/TrinityCore/TrinityCore/commit/9cfc74d8c8a8579cd8160b6d7d1fa52b5ed1f068)
This commit is contained in:
hondacrx
2022-09-11 14:32:38 -04:00
parent 7cef6fc018
commit 81f3889539
+5 -2
View File
@@ -2802,11 +2802,13 @@ namespace Game.Entities
return count;
}
public Aura GetAuraOfRankedSpell(uint spellId, ObjectGuid casterGUID = default, ObjectGuid itemCasterGUID = default, uint reqEffMask = 0)
{
var aurApp = GetAuraApplicationOfRankedSpell(spellId, casterGUID, itemCasterGUID, reqEffMask);
return aurApp?.GetBase();
}
AuraApplication GetAuraApplicationOfRankedSpell(uint spellId, ObjectGuid casterGUID = default, ObjectGuid itemCasterGUID = default, uint reqEffMask = 0, AuraApplication except = null)
{
uint rankSpell = Global.SpellMgr.GetFirstSpellInChain(spellId);
@@ -2872,10 +2874,10 @@ namespace Game.Entities
case SpellAuraInterruptFlags.ActionDelayed:
if (interruptSource != null)
{
if (interruptSource.HasAttribute(SpellAttr1.AllowWhileStealthed) && auraSpellInfo.HasAura(AuraType.ModStealth))
if (interruptSource.HasAttribute(SpellAttr1.AllowWhileStealthed) && auraSpellInfo.Dispel == DispelType.Stealth)
return true;
if (interruptSource.HasAttribute(SpellAttr2.AllowWhileInvisible) && auraSpellInfo.HasAura(AuraType.ModInvisibility))
if (interruptSource.HasAttribute(SpellAttr2.AllowWhileInvisible) && auraSpellInfo.Dispel == DispelType.Invisibility)
return true;
}
break;
@@ -2885,6 +2887,7 @@ namespace Game.Entities
return false;
}
bool IsInterruptFlagIgnoredForSpell(SpellAuraInterruptFlags2 flag, Unit unit, SpellInfo auraSpellInfo, SpellInfo interruptSource)
{
return false;