Changeset 200

Show
Ignore:
Timestamp:
11/19/08 13:45:43 (17 years ago)
Author:
yumileroy
Message:

[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

Original author: gvcoman
Date: 2008-11-08 23:32:15-06:00

Location:
trunk/src/game
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/PetHandler.cpp

    r191 r200  
    7979    { 
    8080        case ACT_COMMAND:                                   //0x0700 
     81            // Possessed pets are only able to attack 
     82            if (pet->isPossessed() && spellid != COMMAND_ATTACK) 
     83                return; 
     84 
    8185            switch(spellid) 
    8286            { 
  • trunk/src/game/Player.cpp

    r193 r200  
    1876518765    { 
    1876618766        target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); 
     18767        // Reinitialize the pet bar and make the pet come back to the owner 
    1876718768        if(((Creature*)target)->isPet()) 
     18769        { 
    1876818770            PetSpellInitialize(); 
     18771            if (!target->getVictim()) 
     18772            { 
     18773                target->GetMotionMaster()->MoveFollow(this, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); 
     18774                target->GetCharmInfo()->SetCommandState(COMMAND_FOLLOW); 
     18775            } 
     18776        } 
    1876918777        else if (target->isAlive()) 
    1877018778        { 
  • trunk/src/game/PossessedAI.cpp

    r186 r200  
    2525void PossessedAI::AttackStart(Unit *u) 
    2626{ 
    27     if( i_pet.getVictim() || !u ) 
     27    if( !u ) 
    2828        return; 
     29 
     30    if (i_pet.getVictim() && u != i_pet.getVictim()) 
     31        i_pet.AttackStop(); 
    2932 
    3033    if(i_pet.Attack(u, true)) 
  • trunk/src/game/SpellHandler.cpp

    r174 r200  
    353353        return; 
    354354 
    355     // Remove possess aura from the possessed as well 
    356     if(_player->isPossessing()) 
     355    // Remove possess/charm aura from the possessed/charmed as well 
     356    // TODO: Remove this once the ability to cancel aura sets at once is implemented 
     357    if(_player->GetCharm()) 
    357358    { 
    358359        for (int i = 0; i < 3; ++i) 
    359360        { 
    360361            if (spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_POSSESS || 
    361                 spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_POSSESS_PET) 
     362                spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_POSSESS_PET || 
     363                spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_CHARM) 
    362364            { 
    363365                _player->RemoveAurasDueToSpellByCancel(spellId);