battleground_template表是AzerothCore中控制战场配置的核心表格。它定义了各个战场的基本属性,包括地图、玩家数量限制、开始位置、胜利条件等。这个表格是PVP战场系统的基础组件。
字段名 | 数据类型 | 默认值 | 说明 |
---|---|---|---|
ID | MEDIUMINT UNSIGNED | 0 | 战场模板ID |
MinPlayersPerTeam | SMALLINT UNSIGNED | 0 | 每队最少玩家数 |
MaxPlayersPerTeam | SMALLINT UNSIGNED | 0 | 每队最多玩家数 |
MinLvl | TINYINT UNSIGNED | 0 | 最低等级要求 |
MaxLvl | TINYINT UNSIGNED | 0 | 最高等级限制 |
AllianceStartLoc | MEDIUMINT UNSIGNED | 0 | 联盟起始位置ID |
AllianceStartO | FLOAT | 0 | 联盟起始朝向 |
HordeStartLoc | MEDIUMINT UNSIGNED | 0 | 部落起始位置ID |
HordeStartO | FLOAT | 0 | 部落起始朝向 |
StartMaxDist | FLOAT | 0 | 起始点最大距离 |
Weight | TINYINT UNSIGNED | 1 | 战场权重 |
ScriptName | CHAR(64) | '' | 战场脚本名称 |
Comment | CHAR(32) | '' | 备注说明 |
战场的唯一标识符,对应Battlemaster.dbc中的战场定义。
控制战场的玩家数量限制:
设置参与战场的等级范围:
指定双方阵营在战场中的出生点位置ID。
设置玩家出生时面向的方向(弧度值)。
战场的选择权重,数值越高越容易被选中。
指定战场使用的C++脚本:
INSERT INTO battleground_template
(ID, MinPlayersPerTeam, MaxPlayersPerTeam, MinLvl, MaxLvl,
AllianceStartLoc, HordeStartLoc, Weight, ScriptName, Comment)
VALUES
(1, 5, 10, 10, 60,
769, 770, 1, 'battleground_warsong_gulch', '战歌峡谷');
INSERT INTO battleground_template
(ID, MinPlayersPerTeam, MaxPlayersPerTeam, MinLvl, MaxLvl,
AllianceStartLoc, HordeStartLoc, Weight, ScriptName, Comment)
VALUES
(2, 8, 15, 20, 60,
890, 889, 1, 'battleground_arathi_basin', '阿拉希盆地');
INSERT INTO battleground_template
(ID, MinPlayersPerTeam, MaxPlayersPerTeam, MinLvl, MaxLvl,
AllianceStartLoc, HordeStartLoc, Weight, ScriptName, Comment)
VALUES
(3, 20, 40, 51, 60,
611, 610, 1, 'battleground_alterac_valley', '奥特兰克山谷');
SELECT * FROM battleground_template ORDER BY ID;
UPDATE battleground_template
SET Weight = 0
WHERE ID = 战场ID;
UPDATE battleground_template
SET MinPlayersPerTeam = 最少人数, MaxPlayersPerTeam = 最多人数
WHERE ID = 战场ID;
.reload battleground_template