diff options
author | Spp <none@none> | 2010-03-13 00:47:24 +0100 |
---|---|---|
committer | Spp <none@none> | 2010-03-13 00:47:24 +0100 |
commit | ff89bad0fea3148b840e6f416476ed3073837672 (patch) | |
tree | 1baab4183d4bdcbca6cd326cbfe973c6e70bc820 /src/game/BattleGroundMgr.cpp | |
parent | e1a8e1b2c9fd951665ca06a771cdf27a7be363de (diff) |
Allow Battlegrounds and arenas to be disabled by DB.
wtlk arenas disabled by default.
- Player will continue to see all bgs using UI, but won't be able to join disabled bg's
- Gossip menu not shown for disabled Bgs/arenas
- Id 6 disabled = all arenas disabled.
- Only id 6 arena enabled = Gossip shown but unable to join any arena
--HG--
branch : trunk
Diffstat (limited to 'src/game/BattleGroundMgr.cpp')
-rw-r--r-- | src/game/BattleGroundMgr.cpp | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/game/BattleGroundMgr.cpp b/src/game/BattleGroundMgr.cpp index 92723ae7ca2..93b6d0288f8 100644 --- a/src/game/BattleGroundMgr.cpp +++ b/src/game/BattleGroundMgr.cpp @@ -1532,17 +1532,10 @@ BattleGround * BattleGroundMgr::CreateNewBattleGround(BattleGroundTypeId bgTypeI //for arenas there is random map used if (bg_template->isArena()) { - // for type enter in arenas - uint32 arenaswitch = urand(1, 3); - - if (sWorld.getConfig(CONFIG_ARENA_LK_ARENAS_ENABLE) == 1) - arenaswitch = urand(0, 4); // Enable Ring of Valor and Dalaran Sewers arenas - in these arenas problem with LoS - else - arenaswitch = urand(1, 3); // Disable WoTLK Arenas (Ring of Valor, Dalaran Sewers) - - BattleGroundTypeId arenas[] = {BATTLEGROUND_RV, BATTLEGROUND_NA, BATTLEGROUND_BE, BATTLEGROUND_RL, BATTLEGROUND_DS}; - uint32 arena_num = arenaswitch; - bgTypeId = arenas[arena_num]; + if (!isAnyArenaEnabled()) // it's checked in handler but just to be sure + return NULL; + uint8 size = m_EnabledArenas.size() - 1; + bgTypeId = m_EnabledArenas[urand(0,size)]; bg_template = GetBattleGroundTemplate(bgTypeId); if (!bg_template) { @@ -1671,8 +1664,8 @@ void BattleGroundMgr::CreateInitialBattleGrounds() uint32 count = 0; - // 0 1 2 3 4 5 6 7 8 - QueryResult_AutoPtr result = WorldDatabase.Query("SELECT id, MinPlayersPerTeam,MaxPlayersPerTeam,MinLvl,MaxLvl,AllianceStartLoc,AllianceStartO,HordeStartLoc,HordeStartO FROM battleground_template"); + // 0 1 2 3 4 5 6 7 8 + QueryResult_AutoPtr result = WorldDatabase.Query("SELECT id, MinPlayersPerTeam,MaxPlayersPerTeam,MinLvl,MaxLvl,AllianceStartLoc,AllianceStartO,HordeStartLoc,HordeStartO FROM battleground_template WHERE disable = 0"); if (!result) { @@ -1772,6 +1765,9 @@ void BattleGroundMgr::CreateInitialBattleGrounds() if (!CreateBattleGround(bgTypeID, IsArena, MinPlayersPerTeam, MaxPlayersPerTeam, MinLvl, MaxLvl, bl->name[sWorld.GetDefaultDbcLocale()], bl->mapid[0], AStartLoc[0], AStartLoc[1], AStartLoc[2], AStartLoc[3], HStartLoc[0], HStartLoc[1], HStartLoc[2], HStartLoc[3])) continue; + if (IsArena && bgTypeID != BATTLEGROUND_AA) + m_EnabledArenas.push_back(bgTypeID); + ++count; } while (result->NextRow()); |