Use PVPDificulty.dbc for bg/arena bracket selection (levels and difficulty)

This commit is contained in:
VladimirMangos 2010-01-09 03:36:27 +03:00
parent 75c81894b2
commit 63709fdc49
15 changed files with 167 additions and 98 deletions

View file

@ -216,11 +216,10 @@ BattleGroundMap* MapInstanced::CreateBattleGroundMap(uint32 InstanceId, BattleGr
sLog.outDebug("MapInstanced::CreateBattleGroundMap: instance:%d for map:%d and bgType:%d created.", InstanceId, GetId(), bg->GetTypeID());
// 0-59 normal spawn 60-69 difficulty_1, 70-79 difficulty_2, 80 dufficulty_3
uint8 spawnMode = (bg->GetBracketId() > BG_BRACKET_ID_MAX_LEVEL_59) ? (bg->GetBracketId() - BG_BRACKET_ID_MAX_LEVEL_59) : 0;
// some bgs don't have different spawnmodes, with this we can stay close to dbc-data
while (!GetMapDifficultyData(GetId(), Difficulty(spawnMode)))
spawnMode--;
PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(),bg->GetMinLevel());
uint8 spawnMode = bracketEntry ? bracketEntry->difficulty : REGULAR_DIFFICULTY;
BattleGroundMap *map = new BattleGroundMap(GetId(), GetGridExpiry(), InstanceId, this, spawnMode);
ASSERT(map->IsBattleGroundOrArena());
map->SetBG(bg);