[svn] * Disabled the move and stay commands while pet is possessed
* Make pet come back to its owner after possession ends if it's not currently in combat * Allow the possessed unit to properly change attack targets * Also remove charm effects from charmed target on owner aura cancel --HG-- branch : trunk
This commit is contained in:
@@ -78,6 +78,10 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data )
|
||||
switch(flag)
|
||||
{
|
||||
case ACT_COMMAND: //0x0700
|
||||
// Possessed pets are only able to attack
|
||||
if (pet->isPossessed() && spellid != COMMAND_ATTACK)
|
||||
return;
|
||||
|
||||
switch(spellid)
|
||||
{
|
||||
case COMMAND_STAY: //flat=1792 //STAY
|
||||
|
||||
@@ -18764,8 +18764,16 @@ void Player::RemovePossess(bool attack)
|
||||
else
|
||||
{
|
||||
target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
|
||||
// Reinitialize the pet bar and make the pet come back to the owner
|
||||
if(((Creature*)target)->isPet())
|
||||
{
|
||||
PetSpellInitialize();
|
||||
if (!target->getVictim())
|
||||
{
|
||||
target->GetMotionMaster()->MoveFollow(this, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
|
||||
target->GetCharmInfo()->SetCommandState(COMMAND_FOLLOW);
|
||||
}
|
||||
}
|
||||
else if (target->isAlive())
|
||||
{
|
||||
// If we're still hostile to our target, continue attacking otherwise reset threat and go home
|
||||
|
||||
@@ -24,9 +24,12 @@
|
||||
|
||||
void PossessedAI::AttackStart(Unit *u)
|
||||
{
|
||||
if( i_pet.getVictim() || !u )
|
||||
if( !u )
|
||||
return;
|
||||
|
||||
if (i_pet.getVictim() && u != i_pet.getVictim())
|
||||
i_pet.AttackStop();
|
||||
|
||||
if(i_pet.Attack(u, true))
|
||||
i_victimGuid = u->GetGUID();
|
||||
|
||||
|
||||
@@ -352,13 +352,15 @@ void WorldSession::HandleCancelAuraOpcode( WorldPacket& recvPacket)
|
||||
if (!spellInfo)
|
||||
return;
|
||||
|
||||
// Remove possess aura from the possessed as well
|
||||
if(_player->isPossessing())
|
||||
// Remove possess/charm aura from the possessed/charmed as well
|
||||
// TODO: Remove this once the ability to cancel aura sets at once is implemented
|
||||
if(_player->GetCharm())
|
||||
{
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
if (spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_POSSESS ||
|
||||
spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_POSSESS_PET)
|
||||
spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_POSSESS_PET ||
|
||||
spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_CHARM)
|
||||
{
|
||||
_player->RemoveAurasDueToSpellByCancel(spellId);
|
||||
_player->GetCharm()->RemoveAurasDueToSpellByCancel(spellId);
|
||||
|
||||
Reference in New Issue
Block a user