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
+6 -6
View File
@@ -1132,16 +1132,16 @@ namespace Game.Spells
uint zone, area;
target.GetZoneAndAreaId(out zone, out area);
foreach (var bound in saBounds)
foreach (var spellArea in saBounds)
{
// some auras remove at aura remove
if (!bound.IsFitToRequirements((Player)target, zone, area))
target.RemoveAurasDueToSpell(bound.spellId);
if (spellArea.flags.HasAnyFlag(SpellAreaFlag.AutoRemove) && !spellArea.IsFitToRequirements((Player)target, zone, area))
target.RemoveAurasDueToSpell(spellArea.spellId);
// some auras applied at aura apply
else if (bound.autocast)
else if (spellArea.flags.HasAnyFlag(SpellAreaFlag.AutoCast))
{
if (!target.HasAura(bound.spellId))
target.CastSpell(target, bound.spellId, true);
if (!target.HasAura(spellArea.spellId))
target.CastSpell(target, spellArea.spellId, true);
}
}
}