Core/Spells: Allow skipping automatic removal of auras from spell_area when condition is no longer met (mostly used for cosmetic cutscenes after quest completion)

This commit is contained in:
hondacrx
2018-01-28 19:37:36 -05:00
parent 95e76df6ff
commit 84fdaef291
6 changed files with 151 additions and 77 deletions
+2 -2
View File
@@ -1802,9 +1802,9 @@ namespace Game.Entities
{
foreach (var spell in saBounds)
{
if (!spell.IsFitToRequirements(this, zone, area))
if (spell.flags.HasAnyFlag(SpellAreaFlag.AutoRemove) && !spell.IsFitToRequirements(this, zone, area))
RemoveAurasDueToSpell(spell.spellId);
else if (spell.autocast)
else if (spell.flags.HasAnyFlag(SpellAreaFlag.AutoCast))
if (!HasAura(spell.spellId))
CastSpell(this, spell.spellId, true);
}
+2 -2
View File
@@ -1765,7 +1765,7 @@ namespace Game.Entities
// Some spells applied at enter into zone (with subzones), aura removed in UpdateAreaDependentAuras that called always at zone.area update
var saBounds = Global.SpellMgr.GetSpellAreaForAreaMapBounds(newZone);
foreach (var spell in saBounds)
if (spell.autocast && spell.IsFitToRequirements(this, newZone, 0))
if (spell.flags.HasAnyFlag(SpellAreaFlag.AutoCast) && spell.IsFitToRequirements(this, newZone, 0))
if (!HasAura(spell.spellId))
CastSpell(this, spell.spellId, true);
}
@@ -1783,7 +1783,7 @@ namespace Game.Entities
// some auras applied at subzone enter
var saBounds = Global.SpellMgr.GetSpellAreaForAreaMapBounds(newArea);
foreach (var spell in saBounds)
if (spell.autocast && spell.IsFitToRequirements(this, m_zoneUpdateId, newArea))
if (spell.flags.HasAnyFlag(SpellAreaFlag.AutoCast) && spell.IsFitToRequirements(this, m_zoneUpdateId, newArea))
if (!HasAura(spell.spellId))
CastSpell(this, spell.spellId, true);
}