From 37f57ce6b9c548798e2c12e6d0514150ab3ad9da Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 28 Apr 2018 14:09:01 +0200 Subject: Core/Auras: Implemented new spell_area flag to allow skipping applying aura automatically when quest status changes --- src/server/game/Entities/Player/Player.cpp | 2 +- src/server/game/Spells/SpellMgr.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index d02a812bbb8..ff792ac82e1 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -16205,7 +16205,7 @@ void Player::SendQuestUpdate(uint32 questId) { if (itr->second->flags & SPELL_AREA_FLAG_AUTOREMOVE && !itr->second->IsFitToRequirements(this, zone, area)) RemoveAurasDueToSpell(itr->second->spellId); - else if (itr->second->flags & SPELL_AREA_FLAG_AUTOCAST) + else if (itr->second->flags & SPELL_AREA_FLAG_AUTOCAST && !(itr->second->flags & SPELL_AREA_FLAG_IGNORE_AUTOCAST_ON_QUEST_STATUS_CHANGE)) if (!HasAura(itr->second->spellId)) CastSpell(this, itr->second->spellId, true); } diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h index db49b577c3c..1034f6b4333 100644 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -452,8 +452,9 @@ typedef std::map SpellPetAuraMap; enum SpellAreaFlag { - SPELL_AREA_FLAG_AUTOCAST = 0x1, // if has autocast, spell is applied on enter - SPELL_AREA_FLAG_AUTOREMOVE = 0x2, // if has autoremove, spell is remove automatically inside zone/area (allways removed on leaving area or zone) + SPELL_AREA_FLAG_AUTOCAST = 0x1, // if has autocast, spell is applied on enter + SPELL_AREA_FLAG_AUTOREMOVE = 0x2, // if has autoremove, spell is remove automatically inside zone/area (always removed on leaving area or zone) + SPELL_AREA_FLAG_IGNORE_AUTOCAST_ON_QUEST_STATUS_CHANGE = 0x4, // if this flag is set then spell will not be applied automatically on quest status change }; struct TC_GAME_API SpellArea -- cgit v1.2.3