diff options
Diffstat (limited to 'src/game/SpellHandler.cpp')
-rw-r--r-- | src/game/SpellHandler.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/game/SpellHandler.cpp b/src/game/SpellHandler.cpp index ba1eb20c631..051e1adbc30 100644 --- a/src/game/SpellHandler.cpp +++ b/src/game/SpellHandler.cpp @@ -302,6 +302,10 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket) return; } + // can't use our own spells when we're in possession of another unit, + if(_player->isPossessing()) + return; + // client provided targets SpellCastTargets targets; if(!targets.read(&recvPacket,_player)) @@ -348,6 +352,21 @@ void WorldSession::HandleCancelAuraOpcode( WorldPacket& recvPacket) if (!spellInfo) return; + // Remove possess aura from the possessed as well + if(_player->isPossessing()) + { + for (int i = 0; i < 3; ++i) + { + if (spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_POSSESS || + spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_POSSESS_PET) + { + _player->RemoveAurasDueToSpellByCancel(spellId); + _player->GetCharm()->RemoveAurasDueToSpellByCancel(spellId); + return; + } + } + } + // not allow remove non positive spells and spells with attr SPELL_ATTR_CANT_CANCEL if(!IsPositiveSpell(spellId) || (spellInfo->Attributes & SPELL_ATTR_CANT_CANCEL)) return; |