Use PVPDificulty.dbc for bg/arena bracket selection (levels and difficulty). Rename BG/arena queue_id to bracket_id and related functions/etc. Author: VladimirMangos.

--HG--
branch : trunk
This commit is contained in:
n0n4m3
2010-02-15 15:31:27 +01:00
parent 535068d740
commit 3dd6fdedf7
16 changed files with 516 additions and 491 deletions
+33 -1
View File
@@ -107,6 +107,8 @@ MapDifficultyMap sMapDifficultyMap;
DBCStorage <MovieEntry> sMovieStore(MovieEntryfmt);
DBCStorage <PvPDifficultyEntry> sPvPDifficultyStore(PvPDifficultyfmt);
DBCStorage <QuestSortEntry> sQuestSortStore(QuestSortEntryfmt);
DBCStorage <QuestXPEntry> sQuestXPStore(QuestXPfmt);
DBCStorage <QuestFactionRewEntry> sQuestFactionRewardStore(QuestFactionRewardfmt);
@@ -216,7 +218,7 @@ void LoadDBCStores(const std::string& dataPath)
{
std::string dbcPath = dataPath+"dbc/";
const uint32 DBCFilesCount = 83;
const uint32 DBCFilesCount = 84;
barGoLink bar(DBCFilesCount);
@@ -329,6 +331,12 @@ void LoadDBCStores(const std::string& dataPath)
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sMovieStore, dbcPath,"Movie.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sQuestSortStore, dbcPath,"QuestSort.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sPvPDifficultyStore, dbcPath,"PvpDifficulty.dbc");
for(uint32 i = 0; i < sPvPDifficultyStore.GetNumRows(); ++i)
if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i))
if (entry->bracketId > MAX_BATTLEGROUND_BRACKETS)
assert(false && "Need update MAX_BATTLEGROUND_BRACKETS by DBC data");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sQuestXPStore, dbcPath,"QuestXP.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sQuestFactionRewardStore, dbcPath,"QuestFactionReward.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sRandomPropertiesPointsStore, dbcPath,"RandPropPoints.dbc");
@@ -720,6 +728,30 @@ MapDifficulty const* GetMapDifficultyData(uint32 mapId, Difficulty difficulty)
return itr != sMapDifficultyMap.end() ? &itr->second : NULL;
}
PvPDifficultyEntry const* GetBattlegroundBracketByLevel( uint32 mapid, uint32 level )
{
// prevent out-of-range levels for dbc data
if (level > DEFAULT_MAX_LEVEL)
level = DEFAULT_MAX_LEVEL;
for(uint32 i = 0; i < sPvPDifficultyStore.GetNumRows(); ++i)
if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i))
if (entry->mapId == mapid && entry->minLevel <= level && entry->maxLevel >= level)
return entry;
return NULL;
}
PvPDifficultyEntry const* GetBattlegroundBracketById(uint32 mapid, BattleGroundBracketId id)
{
for(uint32 i = 0; i < sPvPDifficultyStore.GetNumRows(); ++i)
if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i))
if (entry->mapId == mapid && entry->GetBracketId() == id)
return entry;
return NULL;
}
uint32 const* GetTalentTabPages(uint8 cls)
{
return sTalentTabPages[cls];