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

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

字段详细说明

字段索引字段名称数据类型默认值说明可选值/范围
data0Timeto2ndflooruint320到第二层的时间(毫秒)0 - 2147483647
data1startOpenenumfalse初始状态0 = 关闭, 1 = 开启
data2autoCloseuint320自动关闭时间(毫秒)0 - 2147483647
data3Reached1stflooruint320到达第一层的事件ID引用 GameEvents.db2
data4Reached2ndflooruint320到达第二层的事件ID引用 GameEvents.db2
data5SpawnMapint32-1生成地图ID引用 Map.db2
data6Timeto3rdflooruint320到第三层的时间(毫秒)0 - 2147483647
data7Reached3rdflooruint320到达第三层的事件ID引用 GameEvents.db2
data8Timeto4thflooruint320到第四层的时间(毫秒)0 - 2147483647
data9Reached4thflooruint320到达第四层的事件ID引用 GameEvents.db2
data10Timeto5thflooruint320到第五层的时间(毫秒)0 - 2147483647
data11Reached5thflooruint320到达第五层的事件ID引用 GameEvents.db2
data12Timeto6thflooruint320到第六层的时间(毫秒)0 - 2147483647
data13Reached6thflooruint320到达第六层的事件ID引用 GameEvents.db2
data14Timeto7thflooruint320到第七层的时间(毫秒)0 - 2147483647
data15Reached7thflooruint320到达第七层的事件ID引用 GameEvents.db2
data16Timeto8thflooruint320到第八层的时间(毫秒)0 - 2147483647
data17Reached8thflooruint320到达第八层的事件ID引用 GameEvents.db2
data18Timeto9thflooruint320到第九层的时间(毫秒)0 - 2147483647
data19Reached9thflooruint320到达第九层的事件ID引用 GameEvents.db2
data20Timeto10thflooruint320到第十层的时间(毫秒)0 - 2147483647
data21Reached10thflooruint320到达第十层的事件ID引用 GameEvents.db2
data22onlychargeheightcheckuint320仅检查高度(码)0 - 65535
data23onlychargetimecheckuint320仅检查时间0 - 65535
data24InteractRadiusOverrideuint320交互半径覆盖值(码*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字段可以控制运输工具在特定地图生成

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

使用示例

-- 一个基本的双层运输工具,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);
-- 一个四层运输工具,每层间隔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);
-- 一个带事件触发的运输工具,到达各层时触发事件
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);

posted @ 2025-10-27 19:17  clnchanpin  阅读(1)  评论(0)    收藏  举报