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);
相关推荐
TTGGGFF1 天前
开源项目分享:Gitee热榜项目 2025年11月第三周 周榜
gitee·开源
TTGGGFF1 天前
开源项目分享 : Gitee热榜项目 2025-11-14 日榜
gitee·开源
草梅友仁1 天前
代码重构与测试覆盖率提升实践 | 2025 年第 46 周草梅周报
单元测试·开源·github
FIT2CLOUD飞致云1 天前
支持CAS身份认证,支持接入Oracle11数据源,SQLBot开源智能问数系统v1.3.0版本发布
ai·数据分析·开源·智能问数·sqlbot
是Yu欸1 天前
仓颉迁移实战:将 Node.js 微服务移植到 Cangjie 的工程化评测
微服务·云原生·开源·node.js·vim·gitcode·cangjie
白衣鸽子1 天前
ArrayUtils:Java数组操作的瑞士军刀
后端·开源·设计
ajassi20001 天前
开源 Objective-C IOS 应用开发(九)复杂控件-tableview
ios·开源·objective-c
说私域2 天前
开源AI智能名片链动2+1模式S2B2C商城小程序:分享经济时代的技术赋能与模式创新
人工智能·小程序·开源
网络坤子-蔡先生2 天前
openEuler 22.03 ARM64 KVM虚拟化安装
linux·开源·负载均衡
DisonTangor2 天前
【百度拥抱开源】介绍ERNIE-4.5-VL-28B-A3B-Thinking:多模态AI的重大突破
人工智能·百度·语言模型·开源·aigc