Core/Auras: Implemented new spell_area flag to allow skipping applying aura automatically when quest status changes

This commit is contained in:
hondacrx
2018-04-28 11:40:00 -04:00
parent fc237004f2
commit aac1d9c6fb
2 changed files with 3 additions and 2 deletions
@@ -2447,6 +2447,7 @@ namespace Framework.Constants
public enum SpellAreaFlag
{
AutoCast = 0x1, // if has autocast, spell is applied on enter
AutoRemove = 0x2, // if has autoremove, spell is remove automatically inside zone/area (allways removed on leaving area or zone)
AutoRemove = 0x2, // if has autoremove, spell is remove automatically inside zone/area (always removed on leaving area or zone)
IgnoreAutocastOnQuestStatusChange = 0x4, // if this flag is set then spell will not be applied automatically on quest status change
}
}
+1 -1
View File
@@ -1809,7 +1809,7 @@ namespace Game.Entities
{
if (spell.flags.HasAnyFlag(SpellAreaFlag.AutoRemove) && !spell.IsFitToRequirements(this, zone, area))
RemoveAurasDueToSpell(spell.spellId);
else if (spell.flags.HasAnyFlag(SpellAreaFlag.AutoCast))
else if (spell.flags.HasAnyFlag(SpellAreaFlag.AutoCast) && !spell.flags.HasAnyFlag(SpellAreaFlag.IgnoreAutocastOnQuestStatusChange))
if (!HasAura(spell.spellId))
CastSpell(this, spell.spellId, true);
}