Show
Ignore:
Timestamp:
11/22/08 01:55:16 (17 years ago)
Author:
yumileroy
Message:

*Alterac Valley. By Bogie and Balrok. Note: some core contents are modified. Will fix them later. Some sql are disabled because of possible conflict with offical DB. Use them at your own risk.

Original author: megamage
Date: 2008-11-21 19:45:49-06:00

Files:
1 modified

Legend:

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

    r279 r283  
    4747#include "CellImpl.h" 
    4848#include "Path.h" 
    49 #include "TemporarySummon.h" 
    5049 
    5150#include <math.h> 
     
    831830 
    832831        // battleground things (do this at the end, so the death state flag will be properly set to handle in the bg->handlekill) 
    833         if(pVictim->GetTypeId() == TYPEID_PLAYER && (((Player*)pVictim)->InBattleGround())) 
    834         { 
    835             Player *killed = ((Player*)pVictim); 
    836             Player *killer = NULL; 
    837             if(GetTypeId() == TYPEID_PLAYER) 
    838                 killer = ((Player*)this); 
    839             else if(GetTypeId() == TYPEID_UNIT && ((Creature*)this)->isPet()) 
    840             { 
    841                 Unit *owner = GetOwner(); 
    842                 if(owner && owner->GetTypeId() == TYPEID_PLAYER) 
    843                     killer = ((Player*)owner); 
    844             } 
    845  
    846             if(killer) 
    847                 if(BattleGround *bg = killed->GetBattleGround()) 
    848                     bg->HandleKillPlayer(killed, killer);   // drop flags and etc 
     832        if(player && player->InBattleGround()) 
     833        { 
     834            if(BattleGround *bg = player->GetBattleGround()) 
     835            { 
     836                if(pVictim->GetTypeId() == TYPEID_PLAYER) 
     837                    bg->HandleKillPlayer((Player*)pVictim, player); 
     838                else 
     839                    bg->HandleKillUnit((Creature*)pVictim, player); 
     840            } 
    849841        } 
    850842    } 
     
    34203412    if (m_currentSpells[CURRENT_CHANNELED_SPELL] && (!spell_id || m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo->Id==spell_id)) 
    34213413    { 
    3422         // Unsummon any summoned as possessed creatures on channel interrupt 
    3423         SpellEntry const *spellInfo = m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo; 
    3424         for (int i = 0; i < 3; i++) 
    3425         { 
    3426             if (spellInfo->Effect[i] == SPELL_EFFECT_SUMMON &&  
    3427                 (spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED ||  
    3428                  spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED2 ||  
    3429                  spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED3)) 
    3430             { 
    3431                 // Possession is removed in the UnSummon function 
    3432                 if (GetCharm()) 
    3433                     ((TemporarySummon*)GetCharm())->UnSummon();  
    3434             } 
    3435         } 
    3436  
    34373414        if (m_currentSpells[CURRENT_CHANNELED_SPELL]->getState() != SPELL_STATE_FINISHED) 
    34383415            m_currentSpells[CURRENT_CHANNELED_SPELL]->cancel(); 
     
    98149791 
    98159792CharmInfo::CharmInfo(Unit* unit) 
    9816 : m_unit(unit), m_CommandState(COMMAND_FOLLOW), m_reactState(REACT_PASSIVE), m_petnumber(0), m_barInit(false) 
     9793: m_unit(unit), m_CommandState(COMMAND_FOLLOW), m_reactState(REACT_PASSIVE), m_petnumber(0) 
    98179794{ 
    98189795    for(int i =0; i<4; ++i) 
     
    98259802void CharmInfo::InitPetActionBar() 
    98269803{ 
    9827     if (m_barInit) 
    9828         return; 
    9829  
    98309804    // the first 3 SpellOrActions are attack, follow and stay 
    98319805    for(uint32 i = 0; i < 3; i++) 
     
    98429816        PetActionBar[i + 3].SpellOrAction = 0; 
    98439817    } 
    9844     m_barInit = true; 
    9845 } 
    9846  
    9847 void CharmInfo::InitEmptyActionBar(bool withAttack) 
    9848 { 
    9849     if (m_barInit) 
    9850         return; 
    9851  
    9852     for(uint32 x = 0; x < 10; ++x) 
     9818} 
     9819 
     9820void CharmInfo::InitEmptyActionBar() 
     9821{ 
     9822    for(uint32 x = 1; x < 10; ++x) 
    98539823    { 
    98549824        PetActionBar[x].Type = ACT_CAST; 
    98559825        PetActionBar[x].SpellOrAction = 0; 
    98569826    } 
    9857     if (withAttack) 
    9858     { 
    9859         PetActionBar[0].Type = ACT_COMMAND; 
    9860         PetActionBar[0].SpellOrAction = COMMAND_ATTACK; 
    9861     } 
    9862     m_barInit = true; 
     9827    PetActionBar[0].Type = ACT_COMMAND; 
     9828    PetActionBar[0].SpellOrAction = COMMAND_ATTACK; 
    98639829} 
    98649830