GameObject 常见类型详解 -- 运输工具(TRANSPORT)

GAMEOBJECT_TYPE_TRANSPORT 是 TrinityCore 中用于创建运输工具的 GameObject 类型

字段详细说明

字段索引 字段名称 数据类型 默认值 说明 可选值/范围
data0 Timeto2ndfloor uint32 0 到第二层的时间(毫秒) 0 - 2147483647
data1 startOpen enum false 初始状态 0 = 关闭, 1 = 开启
data2 autoClose uint32 0 自动关闭时间(毫秒) 0 - 2147483647
data3 Reached1stfloor uint32 0 到达第一层的事件ID 引用 GameEvents.db2
data4 Reached2ndfloor uint32 0 到达第二层的事件ID 引用 GameEvents.db2
data5 SpawnMap int32 -1 生成地图ID 引用 Map.db2
data6 Timeto3rdfloor uint32 0 到第三层的时间(毫秒) 0 - 2147483647
data7 Reached3rdfloor uint32 0 到达第三层的事件ID 引用 GameEvents.db2
data8 Timeto4thfloor uint32 0 到第四层的时间(毫秒) 0 - 2147483647
data9 Reached4thfloor uint32 0 到达第四层的事件ID 引用 GameEvents.db2
data10 Timeto5thfloor uint32 0 到第五层的时间(毫秒) 0 - 2147483647
data11 Reached5thfloor uint32 0 到达第五层的事件ID 引用 GameEvents.db2
data12 Timeto6thfloor uint32 0 到第六层的时间(毫秒) 0 - 2147483647
data13 Reached6thfloor uint32 0 到达第六层的事件ID 引用 GameEvents.db2
data14 Timeto7thfloor uint32 0 到第七层的时间(毫秒) 0 - 2147483647
data15 Reached7thfloor uint32 0 到达第七层的事件ID 引用 GameEvents.db2
data16 Timeto8thfloor uint32 0 到第八层的时间(毫秒) 0 - 2147483647
data17 Reached8thfloor uint32 0 到达第八层的事件ID 引用 GameEvents.db2
data18 Timeto9thfloor uint32 0 到第九层的时间(毫秒) 0 - 2147483647
data19 Reached9thfloor uint32 0 到达第九层的事件ID 引用 GameEvents.db2
data20 Timeto10thfloor uint32 0 到第十层的时间(毫秒) 0 - 2147483647
data21 Reached10thfloor uint32 0 到达第十层的事件ID 引用 GameEvents.db2
data22 onlychargeheightcheck uint32 0 仅检查高度(码) 0 - 65535
data23 onlychargetimecheck uint32 0 仅检查时间 0 - 65535
data24 InteractRadiusOverride uint32 0 交互半径覆盖值(码*100) 0 - 2147483647

时间控制字段

字段 说明
Timeto2ndfloor 从起始位置到第二层所需的时间(毫秒)
Timeto3rdfloor 从起始位置到第三层所需的时间(毫秒)
Timeto4thfloor 从起始位置到第四层所需的时间(毫秒)
Timeto5thfloor 从起始位置到第五层所需的时间(毫秒)
Timeto6thfloor 从起始位置到第六层所需的时间(毫秒)
Timeto7thfloor 从起始位置到第七层所需的时间(毫秒)
Timeto8thfloor 从起始位置到第八层所需的时间(毫秒)
Timeto9thfloor 从起始位置到第九层所需的时间(毫秒)
Timeto10thfloor 从起始位置到第十层所需的时间(毫秒)

状态控制字段

字段 说明
startOpen 运输工具的初始状态,0=关闭,1=开启
autoClose 运输工具自动关闭的时间(毫秒)

事件触发字段

字段 说明
Reached1stfloor 到达第一层时触发的游戏事件ID
Reached2ndfloor 到达第二层时触发的游戏事件ID
Reached3rdfloor 到达第三层时触发的游戏事件ID
Reached4thfloor 到达第四层时触发的游戏事件ID
Reached5thfloor 到达第五层时触发的游戏事件ID
Reached6thfloor 到达第六层时触发的游戏事件ID
Reached7thfloor 到达第七层时触发的游戏事件ID
Reached8thfloor 到达第八层时触发的游戏事件ID
Reached9thfloor 到达第九层时触发的游戏事件ID
Reached10thfloor 到达第十层时触发的游戏事件ID

生成控制字段

字段 说明
SpawnMap 运输工具生成的地图ID,引用 Map.db2 表,-1表示当前地图

检查机制字段

字段 说明
onlychargeheightcheck 仅检查高度,单位为码
onlychargetimecheck 仅检查时间

性能优化字段

字段 说明
InteractRadiusOverride 自定义运输工具的交互距离,覆盖默认值

注意事项

  • 层级设计: TRANSPORT类型支持最多10层,每层都有独立的时间和事件控制

  • 时间管理: 时间字段以毫秒为单位

  • 事件系统: 每层都可以触发独立的游戏事件

  • 地图控制: SpawnMap字段可以控制运输工具在特定地图生成

  • 性能考虑: 复杂的多层运输工具会影响服务器性能,应谨慎设计

使用示例

sql 复制代码
-- 一个基本的双层运输工具,30秒到达第二层
INSERT INTO `gameobject_template` 
(entry, [type](file://c:\TrinityCore\dep\protobuf\src\google\protobuf\descriptor.h#L797-L797), displayId, [name](file://c:\TrinityCore\dep\g3dlite\include\G3D\XML.h#L166-L168), data0) 
VALUES (1123456, 11, 11234, '基本运输工具', 30000);
sql 复制代码
-- 一个四层运输工具,每层间隔30秒
INSERT INTO `gameobject_template` 
(entry, [type](file://c:\TrinityCore\dep\protobuf\src\google\protobuf\descriptor.h#L797-L797), displayId, [name](file://c:\TrinityCore\dep\g3dlite\include\G3D\XML.h#L166-L168), data0, data6, data8) 
VALUES (1123457, 11, 11235, '四层运输工具', 30000, 90000, 150000);
sql 复制代码
-- 一个带事件触发的运输工具,到达各层时触发事件
INSERT INTO `gameobject_template` 
(entry, [type](file://c:\TrinityCore\dep\protobuf\src\google\protobuf\descriptor.h#L797-L797), displayId, [name](file://c:\TrinityCore\dep\g3dlite\include\G3D\XML.h#L166-L168), data0, data4, data7) 
VALUES (1123458, 11, 11236, '事件运输工具', 30000, 100, 101);
相关推荐
ajassi20003 小时前
开源 C++ QT QML 开发(一)基本介绍
linux·qt·开源·qml
molihuan5 小时前
开源 全平台 哔哩哔哩缓存视频合并 Github地址:https://github.com/molihuan/hlbmerge_flutter
android·flutter·缓存·ffmpeg·开源·github·音视频
CoderJia程序员甲7 小时前
GitHub 热榜项目 - 日榜(2025-10-03)
ai·开源·大模型·github·ai教程
weixin_5112228017 小时前
不可见系统(Invisibility)
开源
CoderJia程序员甲18 小时前
GitHub 热榜项目 - 日榜(2025-09-26)
ai·开源·github·ai编程·github热榜
ajassi20001 天前
开源 C# 快速开发(十六)数据库--sqlserver增删改查
windows·开源·c#
说私域1 天前
开源AI大模型、AI智能名片与S2B2C商城小程序:用户需求满足的底层逻辑与实践路径
人工智能·小程序·开源
安当加密1 天前
如何利用开源库和安全芯片设计fido令牌
网络·安全·开源
weixin_511222801 天前
GameObject 常见类型详解 -- 按钮(BUTTON)
开源