From aac1d9c6fbf362e6ce5b5dd6601b7a372df7d584 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sat, 28 Apr 2018 11:40:00 -0400 Subject: [PATCH] Core/Auras: Implemented new spell_area flag to allow skipping applying aura automatically when quest status changes --- Source/Framework/Constants/Spells/SpellConst.cs | 3 ++- Source/Game/Entities/Player/Player.Quest.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/Framework/Constants/Spells/SpellConst.cs b/Source/Framework/Constants/Spells/SpellConst.cs index f4b5af0c1..97030c82e 100644 --- a/Source/Framework/Constants/Spells/SpellConst.cs +++ b/Source/Framework/Constants/Spells/SpellConst.cs @@ -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 } } diff --git a/Source/Game/Entities/Player/Player.Quest.cs b/Source/Game/Entities/Player/Player.Quest.cs index 3d7865819..40520267d 100644 --- a/Source/Game/Entities/Player/Player.Quest.cs +++ b/Source/Game/Entities/Player/Player.Quest.cs @@ -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); }