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

[svn] * Reimplemented packet/update forwarding in more generic way
* Implemented far sight spells (Far Sight, Eagle Eye, etc) at unlimited range and properly forward packets
* Implemented bind vision spells (Mind Vision, etc) to forward packets at unlimited distance
* Implemented Sentry Totem (both vision switching/forwarding and alerting)
* Other misc possession fixes
* Added .bindsight and .unbindsight commands

Please test out the above spells (including Mind Control) and report any issues on the forums.

Original author: gvcoman
Date: 2008-11-14 20:40:35-06:00

Files:
1 modified

Legend:

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

    r232 r233  
    828828            he->DuelComplete(DUEL_INTERUPTED); 
    829829        } 
    830  
    831         // Possessed unit died, restore control to possessor 
    832         pVictim->UnpossessSelf(false); 
    833  
    834         // Possessor died, remove possession 
    835         if(pVictim->GetTypeId() == TYPEID_PLAYER && pVictim->isPossessing()) 
    836             ((Player*)pVictim)->RemovePossess(false); 
    837830 
    838831        // battleground things (do this at the end, so the death state flag will be properly set to handle in the bg->handlekill) 
     
    71847177} 
    71857178 
     7179void Unit::AddPlayerToVision(Player* plr)  
     7180{  
     7181    if (m_sharedVision.empty() && GetTypeId() == TYPEID_UNIT) 
     7182    { 
     7183        setActive(true); 
     7184        GetMap()->SwitchGridContainers((Creature*)this, true); 
     7185    } 
     7186    m_sharedVision.push_back(plr); 
     7187    plr->SetFarsightTarget(this); 
     7188} 
     7189 
     7190void Unit::RemovePlayerFromVision(Player* plr)  
     7191{  
     7192    m_sharedVision.remove(plr);  
     7193    if (m_sharedVision.empty() && GetTypeId() == TYPEID_UNIT) 
     7194    { 
     7195        setActive(false); 
     7196        GetMap()->SwitchGridContainers((Creature*)this, false); 
     7197    } 
     7198    plr->ClearFarsight(); 
     7199} 
     7200 
     7201void Unit::RemoveAllFromVision() 
     7202{ 
     7203    while (!m_sharedVision.empty()) 
     7204    { 
     7205        Player* plr = *m_sharedVision.begin(); 
     7206        m_sharedVision.erase(m_sharedVision.begin()); 
     7207        plr->ClearFarsight(); 
     7208    } 
     7209} 
     7210 
    71867211void Unit::UncharmSelf() 
    71877212{ 
     
    89368961        UnsummonAllTotems(); 
    89378962 
     8963        // Possessed unit died, restore control to possessor 
     8964        UnpossessSelf(false); 
     8965        RemoveAllFromVision(); 
     8966 
    89388967        ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false); 
    89398968        ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false); 
     
    97579786 
    97589787        UnpossessSelf(false); 
     9788        RemoveAllFromVision(); 
    97599789    } 
    97609790    RemoveFromWorld(); 
    97619791} 
     9792 
     9793 
    97629794 
    97639795CharmInfo* Unit::InitCharmInfo(Unit *charm)