game_event表

概述

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=结束

字段详细说明

eventEntry (事件ID)

事件的唯一标识符,用于关联其他事件相关的表格。

start_time/end_time (时间范围)

定义事件的绝对时间范围。如果设置了这些值,事件只在指定时间段内有效。

occurence (重复间隔)

事件重复的时间间隔,以分钟为单位:

length (持续时间)

事件每次激活的持续时间,以分钟为单位。

holiday (节日ID)

关联的节日ID,对应Holidays.dbc文件:

world_event (世界事件)

标识是否为影响整个服务器的世界事件。

announce (公告类型)

控制事件的公告方式:

使用示例

创建每日事件

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

时间计算示例

每日事件(每天晚上8点开始,持续2小时)

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点

相关表格