表概述

vehicle_template_accessory 表允许管理员为每个载具模板(entry)添加配件生物(accessory_entry),并指定其座位(seat_id)、是否为仆从(minion)、召唤类型(summontype)和持续时间(summontimer)等属性。

当载具生成时,系统会自动创建所有配置的配件,并将它们放置在对应的座位上。这在巫妖王之怒(WLK)版本中用于攻城车、飞行载具、副本载具等场景。

entry
int unsigned, 主键
载具模板 ID
accessory_entry
int unsigned
配件生物模板 ID
seat_id
tinyint, 主键
座位 ID
summontype
tinyint unsigned
召唤类型

表结构

字段名数据类型默认值说明
entryint UNSIGNED0载具模板 ID,对应 creature_template.entry
accessory_entryint UNSIGNED0配件的生物模板 ID(creature_template.entry)
seat_idtinyint0座位 ID,对应载具的座位编号
miniontinyint UNSIGNED0是否为仆从(0=否, 1=是)
descriptiontext非空配件描述说明
summontypetinyint UNSIGNED6召唤类型(见 TempSummonType 枚举)
summontimerint UNSIGNED30000召唤持续时间(毫秒),0 表示永久

主键: (entry, seat_id) | 引擎: InnoDB | 字符集: utf8mb4

重要字段详解

entry (载具模板 ID)

指定载具的模板 ID,对应 creature_template 表中具有载具属性的生物(creature_template 中的 VehicleId 字段 > 0)。

accessory_entry (配件模板 ID)

要添加到载具上的配件或乘客的生物模板 ID。该生物必须存在于 creature_template 表中。

seat_id (座位 ID)

指定配件在载具上的座位位置:

  • 0 驾驶员位置
  • 1 副驾驶位置
  • 2-7 乘客位置
  • 特殊座位 ID 用于武器挂载点等

座位 ID 必须在载具的 VehicleSeat.dbc 定义范围内。

minion (仆从标志)

标识配件是否为载具的仆从:

  • 0 普通配件/独立乘客
  • 1 仆从,跟随载具主人行动

仆从配件会在载具消失时一同消失,独立配件则可能保留。

summontype (召唤类型)

定义配件的召唤方式(见 TempSummonType 枚举):

  • 5 TEMPSUMMON_TIMED_DESPAWN - 临时召唤(定时消失)
  • 6 TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT - 载具配件(默认)
  • 7 TEMPSUMMON_CORPSE_DESPAWN - 永久配件(留尸体)
  • 8 TEMPSUMMON_CORPSE_TIMED - 战斗配件

默认值 6 最常用于载具配件。

summontimer (召唤时间)

配件的存在时间,单位毫秒:

  • 0 永久存在
  • 30000 30 秒(默认值)
  • 600000 10 分钟

注意:summontimer 只对特定 summontype 有效(如 TEMPSUMMON_TIMED_DESPAWN)。

使用场景

实战案例

案例1:为攻城车添加操作员

INSERT INTO vehicle_template_accessory (entry, accessory_entry, seat_id, minion, description)
VALUES (28312, 28319, 0, 1, '攻城车操作员 - 驾驶员位置');

案例2:为攻城车添加武器配件

INSERT INTO vehicle_template_accessory (entry, accessory_entry, seat_id, minion, description, summontype, summontimer)
VALUES (28312, 28366, 1, 0, '攻城车炮手 - 副驾驶位置', 6, 30000);

案例3:为飞行载具添加乘客

INSERT INTO vehicle_template_accessory (entry, accessory_entry, seat_id, minion, description)
VALUES
(32535, 32536, 0, 1, '飞行坐骑驾驶员'),
(32535, 32537, 2, 0, '飞行坐骑乘客');
-- 32535 = 坐骑本体, 32536 = 骑手, 32537 = 后排乘客

案例4:查询某载具的所有配件

SELECT vta.*, ct.name as vehicle_name, ct2.name as accessory_name
FROM vehicle_template_accessory vta
JOIN creature_template ct ON vta.entry = ct.entry
JOIN creature_template ct2 ON vta.accessory_entry = ct2.entry
WHERE vta.entry = 28312
ORDER BY vta.seat_id;

常见载具配件类型

攻城器械

飞行载具

常见问题

Q: 配件不显示的原因?
  • 载具模板的 VehicleId 字段是否正确(需从 Vehicle.dbc 获取)
  • accessory_entry 对应的生物模板是否存在
  • seat_id 是否超出载具的座位数量
  • summontype 设置是否正确
Q: 修改后如何重新加载?
.reload vehicle_template_accessory
Q: 座位分配有什么注意事项?
  • seat_id 不能重复(同一载具同一座位只能有一个配件)
  • 驾驶员通常使用 seat_id=0
  • 武器操作员使用特定的武器座位(参考 VehicleSeat.dbc)
  • 确保主键 (entry, seat_id) 组合唯一

相关表格