game_event表是AzerothCore中控制游戏事件的核心表格。它定义了各种定时事件,如节日庆典、季节性活动、特殊事件等。这些事件可以自动启动和停止,为游戏增添丰富的内容和变化。
字段名 | 数据类型 | 默认值 | 说明 |
---|---|---|---|
eventEntry | TINYINT UNSIGNED | 0 | 事件ID,唯一标识符 |
start_time | TIMESTAMP | NULL | 事件开始时间 |
end_time | TIMESTAMP | NULL | 事件结束时间 |
occurence | BIGINT UNSIGNED | 86400 | 事件重复间隔(分钟) |
length | BIGINT UNSIGNED | 43200 | 事件持续时间(分钟) |
holiday | MEDIUMINT UNSIGNED | 0 | 节日ID,对应Holidays.dbc |
holidayStage | TINYINT UNSIGNED | 0 | 节日阶段 |
description | VARCHAR(255) | NULL | 事件描述 |
world_event | TINYINT UNSIGNED | 0 | 是否为世界事件,1=是,0=否 |
announce | TINYINT UNSIGNED | 2 | 公告类型,0=无,1=开始,2=结束 |
事件的唯一标识符,用于关联其他事件相关的表格。
定义事件的绝对时间范围。如果设置了这些值,事件只在指定时间段内有效。
事件重复的时间间隔,以分钟为单位:
事件每次激活的持续时间,以分钟为单位。
关联的节日ID,对应Holidays.dbc文件:
标识是否为影响整个服务器的世界事件。
控制事件的公告方式:
INSERT INTO game_event
(eventEntry, start_time, end_time, occurence, length, description, world_event, announce)
VALUES
(100, '2023-01-01 00:00:00', '2023-12-31 23:59:59', 1440, 60, '每日奖励事件', 1, 1);
INSERT INTO game_event
(eventEntry, start_time, end_time, occurence, length, holiday, description, world_event, announce)
VALUES
(101, '2023-12-15 00:00:00', '2024-01-02 23:59:59', 525600, 25920, 141, '冬幕节庆典', 1, 2);
INSERT INTO game_event
(eventEntry, start_time, end_time, occurence, length, description, world_event, announce)
VALUES
(102, '2023-01-07 18:00:00', '2023-12-31 23:59:59', 10080, 2880, '周末双倍经验', 1, 2);
SELECT * FROM game_event
WHERE start_time <= NOW() AND end_time >= NOW();
.event start 事件ID
.event stop 事件ID
.event list
.reload game_event
occurence = 1440 -- 24小时 = 1440分钟
length = 120 -- 2小时 = 120分钟
start_time = '2023-01-01 20:00:00'
occurence = 10080 -- 7天 = 10080分钟
length = 4320 -- 3天 = 4320分钟
start_time = '2023-01-06 18:00:00' -- 周五晚上6点