mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[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:
parent
c5974b8a7e
commit
b2fefc2ca9
8 changed files with 58 additions and 53 deletions
|
|
@ -24,7 +24,7 @@ CREATE TABLE `db_version` (
|
|||
`version` varchar(120) default NULL,
|
||||
`creature_ai_version` varchar(120) default NULL,
|
||||
`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';
|
||||
|
||||
--
|
||||
|
|
@ -438,8 +438,6 @@ CREATE TABLE `battleground_template` (
|
|||
`id` mediumint(8) unsigned NOT NULL,
|
||||
`MinPlayersPerTeam` 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,
|
||||
`AllianceStartO` float NOT NULL,
|
||||
`HordeStartLoc` mediumint(8) unsigned NOT NULL,
|
||||
|
|
@ -453,20 +451,19 @@ CREATE TABLE `battleground_template` (
|
|||
|
||||
LOCK TABLES `battleground_template` WRITE;
|
||||
/*!40000 ALTER TABLE `battleground_template` DISABLE KEYS */;
|
||||
INSERT INTO `battleground_template` VALUES
|
||||
(1,0,0,0,0,611,2.72532,610,2.27452),
|
||||
(2,0,0,0,0,769,3.14159,770,3.14159),
|
||||
(4,5,5,10,70,929,0,936,3.14159),
|
||||
(3,0,0,0,0,890,3.40156,889,0.263892),
|
||||
(5,5,5,10,70,939,0,940,3.14159),
|
||||
(6,5,5,10,70,0,0,0,0),
|
||||
(7,0,0,0,0,1103,3.40156,1104,0.263892),
|
||||
(8,5,5,10,70,1258,0,1259,3.14159),
|
||||
(9,0,0,0,0,1367,0,1368,0),
|
||||
(10,5,5,10,80,1362,0,1363,0),
|
||||
(11,5,5,10,80,1364,0,1365,0),
|
||||
(30,20,40,71,80,1485,0,1486,0),
|
||||
(32,5,5,0,80,0,0,0,0);
|
||||
(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);
|
||||
/*!40000 ALTER TABLE `battleground_template` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
|
|
|
|||
21
sql/updates/9763_01_mangos_battleground_template.sql
Normal file
21
sql/updates/9763_01_mangos_battleground_template.sql
Normal 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);
|
||||
|
|
@ -126,6 +126,7 @@ pkgdata_DATA = \
|
|||
9753_01_mangos_instance_template.sql \
|
||||
9755_01_mangos_instance_template.sql \
|
||||
9761_01_mangos_mangos_string.sql \
|
||||
9763_01_mangos_battleground_template.sql \
|
||||
README
|
||||
|
||||
## Additional files to include when running 'make dist'
|
||||
|
|
@ -232,4 +233,5 @@ EXTRA_DIST = \
|
|||
9753_01_mangos_instance_template.sql \
|
||||
9755_01_mangos_instance_template.sql \
|
||||
9761_01_mangos_mangos_string.sql \
|
||||
9763_01_mangos_battleground_template.sql \
|
||||
README
|
||||
|
|
|
|||
|
|
@ -1596,17 +1596,10 @@ uint32 BattleGroundMgr::CreateBattleGround(BattleGroundTypeId bgTypeId, bool IsA
|
|||
|
||||
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;
|
||||
|
||||
// 0 1 2 3 4 5 6 7 8
|
||||
QueryResult *result = WorldDatabase.Query("SELECT id, MinPlayersPerTeam,MaxPlayersPerTeam,MinLvl,MaxLvl,AllianceStartLoc,AllianceStartO,HordeStartLoc,HordeStartO FROM battleground_template");
|
||||
// 0 1 2 3 4 5 6
|
||||
QueryResult *result = WorldDatabase.Query("SELECT id, MinPlayersPerTeam,MaxPlayersPerTeam,AllianceStartLoc,AllianceStartO,HordeStartLoc,HordeStartO FROM battleground_template");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
|
|
@ -1629,7 +1622,7 @@ void BattleGroundMgr::CreateInitialBattleGrounds()
|
|||
uint32 bgTypeID_ = fields[0].GetUInt32();
|
||||
|
||||
// can be overwrite by values from DB
|
||||
bl = sBattlemasterListStore.LookupEntry(bgTypeID_);
|
||||
BattlemasterListEntry const *bl = sBattlemasterListStore.LookupEntry(bgTypeID_);
|
||||
if (!bl)
|
||||
{
|
||||
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_);
|
||||
|
||||
IsArena = (bl->type == TYPE_ARENA);
|
||||
MinPlayersPerTeam = fields[1].GetUInt32();
|
||||
MaxPlayersPerTeam = fields[2].GetUInt32();
|
||||
MinLvl = fields[3].GetUInt32();
|
||||
MaxLvl = fields[4].GetUInt32();
|
||||
bool IsArena = (bl->type == TYPE_ARENA);
|
||||
uint32 MinPlayersPerTeam = fields[1].GetUInt32();
|
||||
uint32 MaxPlayersPerTeam = fields[2].GetUInt32();
|
||||
|
||||
//check values from DB
|
||||
if (MaxPlayersPerTeam == 0 || MinPlayersPerTeam == 0)
|
||||
|
|
@ -1654,31 +1645,25 @@ void BattleGroundMgr::CreateInitialBattleGrounds()
|
|||
if (MinPlayersPerTeam > MaxPlayersPerTeam)
|
||||
MinPlayersPerTeam = MaxPlayersPerTeam;
|
||||
|
||||
if (MinLvl == 0 || MaxLvl == 0)
|
||||
{
|
||||
sLog.outErrorDb("Table `battleground_template` for id %u have wrong min/max level settings. BG not created.", bgTypeID);
|
||||
continue;
|
||||
}
|
||||
float AStartLoc[4];
|
||||
float HStartLoc[4];
|
||||
|
||||
if (MinLvl > MaxLvl)
|
||||
MinLvl = MaxLvl;
|
||||
uint32 start1 = fields[3].GetUInt32();
|
||||
|
||||
start1 = fields[5].GetUInt32();
|
||||
|
||||
start = sWorldSafeLocsStore.LookupEntry(start1);
|
||||
WorldSafeLocsEntry const *start = sWorldSafeLocsStore.LookupEntry(start1);
|
||||
if (start)
|
||||
{
|
||||
AStartLoc[0] = start->x;
|
||||
AStartLoc[1] = start->y;
|
||||
AStartLoc[2] = start->z;
|
||||
AStartLoc[3] = fields[6].GetFloat();
|
||||
AStartLoc[3] = fields[4].GetFloat();
|
||||
}
|
||||
else if (bgTypeID == BATTLEGROUND_AA || bgTypeID == BATTLEGROUND_RB)
|
||||
{
|
||||
AStartLoc[0] = 0;
|
||||
AStartLoc[1] = 0;
|
||||
AStartLoc[2] = 0;
|
||||
AStartLoc[3] = fields[6].GetFloat();
|
||||
AStartLoc[3] = fields[4].GetFloat();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1686,7 +1671,7 @@ void BattleGroundMgr::CreateInitialBattleGrounds()
|
|||
continue;
|
||||
}
|
||||
|
||||
start2 = fields[7].GetUInt32();
|
||||
uint32 start2 = fields[5].GetUInt32();
|
||||
|
||||
start = sWorldSafeLocsStore.LookupEntry(start2);
|
||||
if (start)
|
||||
|
|
@ -1694,14 +1679,14 @@ void BattleGroundMgr::CreateInitialBattleGrounds()
|
|||
HStartLoc[0] = start->x;
|
||||
HStartLoc[1] = start->y;
|
||||
HStartLoc[2] = start->z;
|
||||
HStartLoc[3] = fields[8].GetFloat();
|
||||
HStartLoc[3] = fields[6].GetFloat();
|
||||
}
|
||||
else if (bgTypeID == BATTLEGROUND_AA || bgTypeID == BATTLEGROUND_RB)
|
||||
{
|
||||
HStartLoc[0] = 0;
|
||||
HStartLoc[1] = 0;
|
||||
HStartLoc[2] = 0;
|
||||
HStartLoc[3] = fields[8].GetFloat();
|
||||
HStartLoc[3] = fields[6].GetFloat();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1710,7 +1695,7 @@ void BattleGroundMgr::CreateInitialBattleGrounds()
|
|||
}
|
||||
|
||||
//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;
|
||||
|
||||
++count;
|
||||
|
|
|
|||
|
|
@ -573,8 +573,8 @@ struct BattlemasterListEntry
|
|||
//uint32 nameFlags // 27 string flag, unused
|
||||
uint32 maxGroupSize; // 28 maxGroupSize, used for checking if queue as group
|
||||
//uint32 HolidayWorldStateId; // 29 new 3.1
|
||||
//uint32 MinLevel; // 30
|
||||
//uint32 SomeLevel; // 31, may be max level
|
||||
uint32 minLevel; // 30, min level (sync with PvPDifficulty.dbc content)
|
||||
uint32 maxLevel; // 31, max level (sync with PvPDifficulty.dbc content)
|
||||
};
|
||||
|
||||
/*struct Cfg_CategoriesEntry
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ const char AreaTriggerEntryfmt[]="niffffffff";
|
|||
const char AuctionHouseEntryfmt[]="niiixxxxxxxxxxxxxxxxx";
|
||||
const char BankBagSlotPricesEntryfmt[]="ni";
|
||||
const char BarberShopStyleEntryfmt[]="nixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiii";
|
||||
const char BattlemasterListEntryfmt[]="niiiiiiiiixssssssssssssssssxixxx";
|
||||
const char BattlemasterListEntryfmt[]="niiiiiiiiixssssssssssssssssxixii";
|
||||
const char CharStartOutfitEntryfmt[]="diiiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
|
||||
const char CharTitlesEntryfmt[]="nxssssssssssssssssxxxxxxxxxxxxxxxxxxi";
|
||||
const char ChatChannelsEntryfmt[]="iixssssssssssssssssxxxxxxxxxxxxxxxxxx";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "9762"
|
||||
#define REVISION_NR "9763"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef __REVISION_SQL_H__
|
||||
#define __REVISION_SQL_H__
|
||||
#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"
|
||||
#endif // __REVISION_SQL_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue