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);
相关推荐
AI大佬的小弟2 小时前
【小白第一课】大模型基础知识(1)---大模型到底是啥?
人工智能·自然语言处理·开源·大模型基础·大模型分类·什么是大模型·国内外主流大模型
GitCode官方4 小时前
G-Star 精选开源项目推荐|第四期
开源·atomgit
Van_captain4 小时前
rn_for_openharmony常用组件_Breadcrumb面包屑
javascript·开源·harmonyos
半熟的皮皮虾6 小时前
又重新写了个PDF工具箱-转换office格式/合并/拆分/删除常见操作都有了
python·程序人生·pdf·flask·开源·json·学习方法
Kagol6 小时前
深入浅出 TinyEditor 富文本编辑器系列2:快速开始
前端·typescript·开源
Dream_iy8 小时前
国产开源自定义拖拽大屏可视化工具对比分析
开源
zhaoyang108 小时前
Dify开源LLM应用开发平台研究分享
ai·开源·dify
AIHubPro未来百科9 小时前
三天用AI开发完成开源WordPress导航主题:要哇棱镜主题详解 + 完整部署教程
人工智能·开源
CoderJia程序员甲9 小时前
GitHub 热榜项目 - 日榜(2026-1-10)
ai·开源·大模型·github·ai教程
头发还在的女程序员9 小时前
开源赋能智慧能源管理:技术全解
开源·能源监测系统·能源系统·能源系统源码·企业能源系统