From f6e72aa5117b4d68e524c848d209753ff0ba3c6f Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Tue, 7 Jul 2009 00:05:20 +0400 Subject: [PATCH] Allow cancel mind control spells while control target. --- src/game/SpellHandler.cpp | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/src/game/SpellHandler.cpp b/src/game/SpellHandler.cpp index 04499d490..373f76489 100644 --- a/src/game/SpellHandler.cpp +++ b/src/game/SpellHandler.cpp @@ -27,6 +27,7 @@ #include "Spell.h" #include "ScriptCalls.h" #include "Totem.h" +#include "SpellAuras.h" void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) { @@ -377,10 +378,6 @@ void WorldSession::HandleCancelAuraOpcode( WorldPacket& recvPacket) { CHECK_PACKET_SIZE(recvPacket,4); - // ignore for remote control state - if(_player->m_mover != _player) - return; - uint32 spellId; recvPacket >> spellId; @@ -388,10 +385,34 @@ void WorldSession::HandleCancelAuraOpcode( WorldPacket& recvPacket) if (!spellInfo) return; - // not allow remove non positive spells and spells with attr SPELL_ATTR_CANT_CANCEL - if(!IsPositiveSpell(spellId) || (spellInfo->Attributes & SPELL_ATTR_CANT_CANCEL)) + if (spellInfo->Attributes & SPELL_ATTR_CANT_CANCEL) return; + if(!IsPositiveSpell(spellId)) + { + // ignore for remote control state + if (_player->m_mover != _player) + { + // except own aura spells + bool allow = false; + for(int k = 0; k < 3; ++k) + { + if (spellInfo->EffectApplyAuraName[k] == SPELL_AURA_MOD_POSSESS || + spellInfo->EffectApplyAuraName[k] == SPELL_AURA_MOD_POSSESS_PET) + { + allow = true; + break; + } + } + + // this also include case when aura not found + if(!allow) + return; + } + else + return; + } + // channeled spell case (it currently casted then) if (IsChanneledSpell(spellInfo)) { -- 2.11.4.GIT