mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 00:48:56 +01:00
[svn] Implemented player on player and player on creature possession:
* Implemented packet and vision forwarding through possessed units * Added new OnPossess script call alerting scripts on when possession is applied/removed * Moved fall damage and fall under map calculations into the Player class * Added new PossessedAI that is applied only while possession on creature is active * Implemented summon possessed spell effect * Fixed Eyes of the Beast --HG-- branch : trunk
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user