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/SpellEffects.cpp

    r229 r233  
    34913491void Spell::EffectAddFarsight(uint32 i) 
    34923492{ 
     3493    if (m_caster->GetTypeId() != TYPEID_PLAYER) 
     3494        return; 
     3495 
    34933496    float radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i])); 
    34943497    int32 duration = GetSpellDuration(m_spellInfo); 
     
    35023505    dynObj->SetUInt32Value(DYNAMICOBJECT_BYTES, 0x80000002); 
    35033506    m_caster->AddDynObject(dynObj); 
    3504     MapManager::Instance().GetMap(dynObj->GetMapId(), dynObj)->Add(dynObj); 
    3505     m_caster->SetUInt64Value(PLAYER_FARSIGHT, dynObj->GetGUID()); 
     3507 
     3508    CellPair pair = Trinity::ComputeCellPair(dynObj->GetPositionX(), dynObj->GetPositionY()); 
     3509    Cell cell(pair); 
     3510    Map* map = MapManager::Instance().GetMap(dynObj->GetMapId(), dynObj); 
     3511    map->LoadGrid(cell);                        // In case the spell is casted into a different grid by player 
     3512    map->Add(dynObj); 
     3513    map->SwitchGridContainers(dynObj, true);    // Needed for forwarding player packets 
     3514    dynObj->setActive(true);                    // Keep the grid updated even if there are no players in it 
     3515       
     3516    // Need to update visibility of object for client to accept farsight guid 
     3517    ((Player*)m_caster)->UpdateVisibilityOf(dynObj); 
     3518    ((Player*)m_caster)->SetFarsightTarget(dynObj); 
    35063519} 
    35073520