[9763] Use min/max BG/arena levels from DBC. Update table content.

* Use min/mac level from dbc because anyway list real selectable
  for player level bg/arena backets set min/max range.
* Drop related fields and update per team min/max values.
This commit is contained in:
VladimirMangos 2010-04-18 21:28:39 +04:00
parent c5974b8a7e
commit b2fefc2ca9
8 changed files with 58 additions and 53 deletions

View file

@ -24,7 +24,7 @@ CREATE TABLE `db_version` (
`version` varchar(120) default NULL, `version` varchar(120) default NULL,
`creature_ai_version` varchar(120) default NULL, `creature_ai_version` varchar(120) default NULL,
`cache_id` int(10) default '0', `cache_id` int(10) default '0',
`required_9761_01_mangos_mangos_string` bit(1) default NULL `required_9763_01_mangos_battleground_template` bit(1) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes'; ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
-- --
@ -438,8 +438,6 @@ CREATE TABLE `battleground_template` (
`id` mediumint(8) unsigned NOT NULL, `id` mediumint(8) unsigned NOT NULL,
`MinPlayersPerTeam` smallint(5) unsigned NOT NULL default '0', `MinPlayersPerTeam` smallint(5) unsigned NOT NULL default '0',
`MaxPlayersPerTeam` smallint(5) unsigned NOT NULL default '0', `MaxPlayersPerTeam` smallint(5) unsigned NOT NULL default '0',
`MinLvl` tinyint(3) unsigned NOT NULL default '0',
`MaxLvl` tinyint(3) unsigned NOT NULL default '0',
`AllianceStartLoc` mediumint(8) unsigned NOT NULL, `AllianceStartLoc` mediumint(8) unsigned NOT NULL,
`AllianceStartO` float NOT NULL, `AllianceStartO` float NOT NULL,
`HordeStartLoc` mediumint(8) unsigned NOT NULL, `HordeStartLoc` mediumint(8) unsigned NOT NULL,
@ -453,20 +451,19 @@ CREATE TABLE `battleground_template` (
LOCK TABLES `battleground_template` WRITE; LOCK TABLES `battleground_template` WRITE;
/*!40000 ALTER TABLE `battleground_template` DISABLE KEYS */; /*!40000 ALTER TABLE `battleground_template` DISABLE KEYS */;
INSERT INTO `battleground_template` VALUES (1,40,40,611,2.72532,610,2.27452),
(1,0,0,0,0,611,2.72532,610,2.27452), (2,10,10,769,3.14159,770,3.14159),
(2,0,0,0,0,769,3.14159,770,3.14159), (3,15,15,890,3.40156,889,0.263892),
(4,5,5,10,70,929,0,936,3.14159), (4,5,5,929,0,936,3.14159),
(3,0,0,0,0,890,3.40156,889,0.263892), (5,5,5,939,0,940,3.14159),
(5,5,5,10,70,939,0,940,3.14159), (6,5,5,0,0,0,0),
(6,5,5,10,70,0,0,0,0), (7,15,15,1103,3.40156,1104,0.263892),
(7,0,0,0,0,1103,3.40156,1104,0.263892), (8,5,5,1258,0,1259,3.14159),
(8,5,5,10,70,1258,0,1259,3.14159), (9,15,15,1367,0,1368,0),
(9,0,0,0,0,1367,0,1368,0), (10,5,5,1362,0,1363,0),
(10,5,5,10,80,1362,0,1363,0), (11,5,5,1364,0,1365,0),
(11,5,5,10,80,1364,0,1365,0), (30,40,40,1485,0,1486,0),
(30,20,40,71,80,1485,0,1486,0), (32,5,40,0,0,0,0);
(32,5,5,0,80,0,0,0,0);
/*!40000 ALTER TABLE `battleground_template` ENABLE KEYS */; /*!40000 ALTER TABLE `battleground_template` ENABLE KEYS */;
UNLOCK TABLES; UNLOCK TABLES;

View file

@ -0,0 +1,21 @@
ALTER TABLE db_version CHANGE COLUMN required_9761_01_mangos_mangos_string required_9763_01_mangos_battleground_template bit;
ALTER TABLE battleground_template
DROP COLUMN MinLvl,
DROP COLUMN MaxLvl;
DELETE FROM `battleground_template`;
INSERT INTO `battleground_template` VALUES
(1,40,40,611,2.72532,610,2.27452),
(2,10,10,769,3.14159,770,3.14159),
(3,15,15,890,3.40156,889,0.263892),
(4,5,5,929,0,936,3.14159),
(5,5,5,939,0,940,3.14159),
(6,5,5,0,0,0,0),
(7,15,15,1103,3.40156,1104,0.263892),
(8,5,5,1258,0,1259,3.14159),
(9,15,15,1367,0,1368,0),
(10,5,5,1362,0,1363,0),
(11,5,5,1364,0,1365,0),
(30,40,40,1485,0,1486,0),
(32,5,40,0,0,0,0);

View file

@ -126,6 +126,7 @@ pkgdata_DATA = \
9753_01_mangos_instance_template.sql \ 9753_01_mangos_instance_template.sql \
9755_01_mangos_instance_template.sql \ 9755_01_mangos_instance_template.sql \
9761_01_mangos_mangos_string.sql \ 9761_01_mangos_mangos_string.sql \
9763_01_mangos_battleground_template.sql \
README README
## Additional files to include when running 'make dist' ## Additional files to include when running 'make dist'
@ -232,4 +233,5 @@ EXTRA_DIST = \
9753_01_mangos_instance_template.sql \ 9753_01_mangos_instance_template.sql \
9755_01_mangos_instance_template.sql \ 9755_01_mangos_instance_template.sql \
9761_01_mangos_mangos_string.sql \ 9761_01_mangos_mangos_string.sql \
9763_01_mangos_battleground_template.sql \
README README

View file

@ -1596,17 +1596,10 @@ uint32 BattleGroundMgr::CreateBattleGround(BattleGroundTypeId bgTypeId, bool IsA
void BattleGroundMgr::CreateInitialBattleGrounds() void BattleGroundMgr::CreateInitialBattleGrounds()
{ {
float AStartLoc[4];
float HStartLoc[4];
uint32 MaxPlayersPerTeam, MinPlayersPerTeam, MinLvl, MaxLvl, start1, start2;
BattlemasterListEntry const *bl;
WorldSafeLocsEntry const *start;
bool IsArena;
uint32 count = 0; uint32 count = 0;
// 0 1 2 3 4 5 6 7 8 // 0 1 2 3 4 5 6
QueryResult *result = WorldDatabase.Query("SELECT id, MinPlayersPerTeam,MaxPlayersPerTeam,MinLvl,MaxLvl,AllianceStartLoc,AllianceStartO,HordeStartLoc,HordeStartO FROM battleground_template"); QueryResult *result = WorldDatabase.Query("SELECT id, MinPlayersPerTeam,MaxPlayersPerTeam,AllianceStartLoc,AllianceStartO,HordeStartLoc,HordeStartO FROM battleground_template");
if (!result) if (!result)
{ {
@ -1629,7 +1622,7 @@ void BattleGroundMgr::CreateInitialBattleGrounds()
uint32 bgTypeID_ = fields[0].GetUInt32(); uint32 bgTypeID_ = fields[0].GetUInt32();
// can be overwrite by values from DB // can be overwrite by values from DB
bl = sBattlemasterListStore.LookupEntry(bgTypeID_); BattlemasterListEntry const *bl = sBattlemasterListStore.LookupEntry(bgTypeID_);
if (!bl) if (!bl)
{ {
sLog.outError("Battleground ID %u not found in BattlemasterList.dbc. Battleground not created.", bgTypeID_); sLog.outError("Battleground ID %u not found in BattlemasterList.dbc. Battleground not created.", bgTypeID_);
@ -1638,11 +1631,9 @@ void BattleGroundMgr::CreateInitialBattleGrounds()
BattleGroundTypeId bgTypeID = BattleGroundTypeId(bgTypeID_); BattleGroundTypeId bgTypeID = BattleGroundTypeId(bgTypeID_);
IsArena = (bl->type == TYPE_ARENA); bool IsArena = (bl->type == TYPE_ARENA);
MinPlayersPerTeam = fields[1].GetUInt32(); uint32 MinPlayersPerTeam = fields[1].GetUInt32();
MaxPlayersPerTeam = fields[2].GetUInt32(); uint32 MaxPlayersPerTeam = fields[2].GetUInt32();
MinLvl = fields[3].GetUInt32();
MaxLvl = fields[4].GetUInt32();
//check values from DB //check values from DB
if (MaxPlayersPerTeam == 0 || MinPlayersPerTeam == 0) if (MaxPlayersPerTeam == 0 || MinPlayersPerTeam == 0)
@ -1654,31 +1645,25 @@ void BattleGroundMgr::CreateInitialBattleGrounds()
if (MinPlayersPerTeam > MaxPlayersPerTeam) if (MinPlayersPerTeam > MaxPlayersPerTeam)
MinPlayersPerTeam = MaxPlayersPerTeam; MinPlayersPerTeam = MaxPlayersPerTeam;
if (MinLvl == 0 || MaxLvl == 0) float AStartLoc[4];
{ float HStartLoc[4];
sLog.outErrorDb("Table `battleground_template` for id %u have wrong min/max level settings. BG not created.", bgTypeID);
continue;
}
if (MinLvl > MaxLvl) uint32 start1 = fields[3].GetUInt32();
MinLvl = MaxLvl;
start1 = fields[5].GetUInt32(); WorldSafeLocsEntry const *start = sWorldSafeLocsStore.LookupEntry(start1);
start = sWorldSafeLocsStore.LookupEntry(start1);
if (start) if (start)
{ {
AStartLoc[0] = start->x; AStartLoc[0] = start->x;
AStartLoc[1] = start->y; AStartLoc[1] = start->y;
AStartLoc[2] = start->z; AStartLoc[2] = start->z;
AStartLoc[3] = fields[6].GetFloat(); AStartLoc[3] = fields[4].GetFloat();
} }
else if (bgTypeID == BATTLEGROUND_AA || bgTypeID == BATTLEGROUND_RB) else if (bgTypeID == BATTLEGROUND_AA || bgTypeID == BATTLEGROUND_RB)
{ {
AStartLoc[0] = 0; AStartLoc[0] = 0;
AStartLoc[1] = 0; AStartLoc[1] = 0;
AStartLoc[2] = 0; AStartLoc[2] = 0;
AStartLoc[3] = fields[6].GetFloat(); AStartLoc[3] = fields[4].GetFloat();
} }
else else
{ {
@ -1686,7 +1671,7 @@ void BattleGroundMgr::CreateInitialBattleGrounds()
continue; continue;
} }
start2 = fields[7].GetUInt32(); uint32 start2 = fields[5].GetUInt32();
start = sWorldSafeLocsStore.LookupEntry(start2); start = sWorldSafeLocsStore.LookupEntry(start2);
if (start) if (start)
@ -1694,14 +1679,14 @@ void BattleGroundMgr::CreateInitialBattleGrounds()
HStartLoc[0] = start->x; HStartLoc[0] = start->x;
HStartLoc[1] = start->y; HStartLoc[1] = start->y;
HStartLoc[2] = start->z; HStartLoc[2] = start->z;
HStartLoc[3] = fields[8].GetFloat(); HStartLoc[3] = fields[6].GetFloat();
} }
else if (bgTypeID == BATTLEGROUND_AA || bgTypeID == BATTLEGROUND_RB) else if (bgTypeID == BATTLEGROUND_AA || bgTypeID == BATTLEGROUND_RB)
{ {
HStartLoc[0] = 0; HStartLoc[0] = 0;
HStartLoc[1] = 0; HStartLoc[1] = 0;
HStartLoc[2] = 0; HStartLoc[2] = 0;
HStartLoc[3] = fields[8].GetFloat(); HStartLoc[3] = fields[6].GetFloat();
} }
else else
{ {
@ -1710,7 +1695,7 @@ void BattleGroundMgr::CreateInitialBattleGrounds()
} }
//sLog.outDetail("Creating battleground %s, %u-%u", bl->name[sWorld.GetDBClang()], MinLvl, MaxLvl); //sLog.outDetail("Creating battleground %s, %u-%u", bl->name[sWorld.GetDBClang()], MinLvl, MaxLvl);
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])) if (!CreateBattleGround(bgTypeID, IsArena, MinPlayersPerTeam, MaxPlayersPerTeam, bl->minLevel, bl->maxLevel, bl->name[sWorld.GetDefaultDbcLocale()], bl->mapid[0], AStartLoc[0], AStartLoc[1], AStartLoc[2], AStartLoc[3], HStartLoc[0], HStartLoc[1], HStartLoc[2], HStartLoc[3]))
continue; continue;
++count; ++count;

View file

@ -573,8 +573,8 @@ struct BattlemasterListEntry
//uint32 nameFlags // 27 string flag, unused //uint32 nameFlags // 27 string flag, unused
uint32 maxGroupSize; // 28 maxGroupSize, used for checking if queue as group uint32 maxGroupSize; // 28 maxGroupSize, used for checking if queue as group
//uint32 HolidayWorldStateId; // 29 new 3.1 //uint32 HolidayWorldStateId; // 29 new 3.1
//uint32 MinLevel; // 30 uint32 minLevel; // 30, min level (sync with PvPDifficulty.dbc content)
//uint32 SomeLevel; // 31, may be max level uint32 maxLevel; // 31, max level (sync with PvPDifficulty.dbc content)
}; };
/*struct Cfg_CategoriesEntry /*struct Cfg_CategoriesEntry

View file

@ -27,7 +27,7 @@ const char AreaTriggerEntryfmt[]="niffffffff";
const char AuctionHouseEntryfmt[]="niiixxxxxxxxxxxxxxxxx"; const char AuctionHouseEntryfmt[]="niiixxxxxxxxxxxxxxxxx";
const char BankBagSlotPricesEntryfmt[]="ni"; const char BankBagSlotPricesEntryfmt[]="ni";
const char BarberShopStyleEntryfmt[]="nixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiii"; const char BarberShopStyleEntryfmt[]="nixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiii";
const char BattlemasterListEntryfmt[]="niiiiiiiiixssssssssssssssssxixxx"; const char BattlemasterListEntryfmt[]="niiiiiiiiixssssssssssssssssxixii";
const char CharStartOutfitEntryfmt[]="diiiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; const char CharStartOutfitEntryfmt[]="diiiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
const char CharTitlesEntryfmt[]="nxssssssssssssssssxxxxxxxxxxxxxxxxxxi"; const char CharTitlesEntryfmt[]="nxssssssssssssssssxxxxxxxxxxxxxxxxxxi";
const char ChatChannelsEntryfmt[]="iixssssssssssssssssxxxxxxxxxxxxxxxxxx"; const char ChatChannelsEntryfmt[]="iixssssssssssssssssxxxxxxxxxxxxxxxxxx";

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "9762" #define REVISION_NR "9763"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__

View file

@ -1,6 +1,6 @@
#ifndef __REVISION_SQL_H__ #ifndef __REVISION_SQL_H__
#define __REVISION_SQL_H__ #define __REVISION_SQL_H__
#define REVISION_DB_CHARACTERS "required_9751_01_characters" #define REVISION_DB_CHARACTERS "required_9751_01_characters"
#define REVISION_DB_MANGOS "required_9761_01_mangos_mangos_string" #define REVISION_DB_MANGOS "required_9763_01_mangos_battleground_template"
#define REVISION_DB_REALMD "required_9748_01_realmd_realmlist" #define REVISION_DB_REALMD "required_9748_01_realmd_realmlist"
#endif // __REVISION_SQL_H__ #endif // __REVISION_SQL_H__