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);
相关推荐
DisonTangor2 小时前
【2B篇】阿里通义 Qwen3-VL 新增 2B、32B 两个模型尺寸,手机也能轻松运行
人工智能·计算机视觉·语言模型·开源·aigc
Knight_AL4 小时前
Spring Boot 实现 DOCX 转 PDF(基于 docx4j 的轻量级开源方案)
spring boot·pdf·开源
CoderJia程序员甲9 小时前
GitHub 热榜项目 - 日榜(2025-10-23)
ai·开源·大模型·github·ai教程
FlagOS智算系统软件栈10 小时前
与创新者同频!与FlagOS共赴开源之约
人工智能·ai·开源
说私域15 小时前
流量转化与生态重构:“开源AI智能名片链动2+1模式S2B2C商城小程序”对直播电商的范式革新
人工智能·重构·开源
ajassi200017 小时前
开源 Linux 服务器与中间件(十一)Emqx服务器消息的订阅和发送(mqtt测试)
linux·服务器·开源
周杰伦_Jay1 天前
【PaddleOCR深度解析与DeepSeek-OCR对比】开源OCR工具库的技术路线与场景适配
人工智能·机器学习·云原生·架构·开源·ocr
CoderJia程序员甲1 天前
GitHub 热榜项目 - 日榜(2025-10-20)
ai·开源·大模型·github·ai教程
科兽的AI小记1 天前
从Coze到BuildingAI:一个程序员对开源AI应用平台的实战体验
数据库·开源·创业
尘世中一位迷途小书童1 天前
Vuetify Admin 后台管理系统
前端·前端框架·开源