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

[svn] -enabled instantiated battlegrounds
-enabled arena matches
-rewritten battleground queuing to support joining as group
-removed queue announcements

Original author: w12x
Date: 2008-10-05 08:48:32-05:00

Files:
1 modified

Legend:

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

    r6 r9  
    316316        Map* pMap = MapManager::Instance().GetMap(m_session->GetPlayer()->GetMapId(),m_session->GetPlayer()); 
    317317 
    318         if(pMap->Instanceable()) 
     318        if(pMap->IsBattleGroundOrArena()) 
     319        { 
     320            // cannot summon to bg 
     321            SendSysMessage(LANG_CANNOT_SUMMON_TO_BG); 
     322            SetSentErrorMessage(true); 
     323            return false; 
     324        } 
     325        else if(pMap->IsDungeon()) 
    319326        { 
    320327            Map* cMap = MapManager::Instance().GetMap(chr->GetMapId(),chr); 
     
    402409    { 
    403410        Map* cMap = MapManager::Instance().GetMap(chr->GetMapId(),chr); 
    404         if(cMap->Instanceable()) 
     411        if(cMap->IsBattleGroundOrArena()) 
     412        { 
     413            // only allow if gm mode is on 
     414            if (!_player->isGameMaster()) 
     415            { 
     416                SendSysMessage(LANG_CANNOT_GO_TO_BG_GM); 
     417                SetSentErrorMessage(true); 
     418                return false; 
     419            } 
     420            // if already in a bg, don't let port to other 
     421            else if (_player->GetBattleGroundId()) 
     422            { 
     423                SendSysMessage(LANG_CANNOT_GO_TO_BG_FROM_BG); 
     424                SetSentErrorMessage(true); 
     425                return false; 
     426            } 
     427            // all's well, set bg id 
     428            // when porting out from the bg, it will be reset to 0 
     429            _player->SetBattleGroundId(chr->GetBattleGroundId()); 
     430        } 
     431        else if(cMap->IsDungeon()) 
    405432        { 
    406433            Map* pMap = MapManager::Instance().GetMap(_player->GetMapId(),_player); 
     
    15861613    // id, or string, or [name] Shift-click form |color|Htele:id|h[name]|h|r 
    15871614    GameTele const* tele = extractGameTeleFromLink((char*)args); 
    1588  
    15891615    if (!tele) 
    15901616    { 
    15911617        SendSysMessage(LANG_COMMAND_TELE_NOTFOUND); 
     1618        SetSentErrorMessage(true); 
     1619        return false; 
     1620    } 
     1621 
     1622    MapEntry const * me = sMapStore.LookupEntry(tele->mapId); 
     1623    if(!me || me->IsBattleGroundOrArena()) 
     1624    { 
     1625        SendSysMessage(LANG_CANNOT_TELE_TO_BG); 
    15921626        SetSentErrorMessage(true); 
    15931627        return false; 
     
    18661900    } 
    18671901 
     1902    MapEntry const * me = sMapStore.LookupEntry(tele->mapId); 
     1903    if(!me || me->IsBattleGroundOrArena()) 
     1904    { 
     1905        SendSysMessage(LANG_CANNOT_TELE_TO_BG); 
     1906        SetSentErrorMessage(true); 
     1907        return false; 
     1908    } 
     1909 
    18681910    Player *chr = objmgr.GetPlayer(name.c_str()); 
    18691911    if (chr) 
     
    19281970    } 
    19291971 
     1972    MapEntry const * me = sMapStore.LookupEntry(tele->mapId); 
     1973    if(!me || me->IsBattleGroundOrArena()) 
     1974    { 
     1975        SendSysMessage(LANG_CANNOT_TELE_TO_BG); 
     1976        SetSentErrorMessage(true); 
     1977        return false; 
     1978    } 
    19301979    Group *grp = player->GetGroup(); 
    19311980    if(!grp)