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);
相关推荐
周杰伦_Jay38 分钟前
【Agent智能体】开发流程与开源框架对比(GitHub热门项目分析)
开源·github
UpgradeLink1 小时前
开源Electron应用GitHubActions自动化部署与升级指南
electron·开源·自动化
lusasky1 小时前
开箱即用的开源智能体产品全览
开源·智能体
I'm a winner1 小时前
FreeRTOS 简介:轻量开源的嵌入式
开源
lusasky1 小时前
2025年高质量开源智能体框架全景
开源·智能体
南知意-2 小时前
开源高性能IM+集成AI能力,基于SpringBoot +Tauri+Vue 3+TypeScript支持全平台与丰富会话模式
typescript·开源·springboot·tauri·工具·im·软件
周杰伦_Jay2 小时前
【微服务注册与管理开源框架】从选型到实战(Nacos/Eureka/Consul/etcd/Zookeeper)
微服务·eureka·开源
说私域2 小时前
从“搅局”到“重构”:开源AI智能名片多商户商城小程序对电商生态的范式转型研究
人工智能·重构·开源
想用offer打牌10 小时前
RocketMQ如何防止消息丢失?
java·后端·架构·开源·rocketmq
大刘讲IT10 小时前
面向中小企业的企业AI Agent未来3年构建蓝图规划
人工智能·经验分享·ai·开源·制造