Lua接口/服务端/SetItemBoxOwner
来自天龙知识库
设置物品箱的归属对象。
本页由服务端绑定源码与随包脚本自动整理:用途、参数位置与返回数量取实现体,未在游戏内执行验证。调用点取自 4244 个服务端脚本中的 54 处真实调用。
Lua 调用
SetItemBoxOwner(sceneId, ItemBoxID, OwnerID)
服务端脚本中共出现 54 处调用,实参个数出现过:3 个(54 处)。
参数
| 序号 | 参数 / 类型 | 说明 |
|---|---|---|
| 1 | sceneIdnumber
|
当前调用所在的场景 ID。 脚本中的实参: sceneId(54 处)
|
| 2 | ItemBoxIDnumber
|
物品箱对象 ID。 脚本中的实参: ItemBoxId(48 处)、nBoxId(2 处)、ItemBoxId01
|
| 3 | OwnerIDnumber
|
归属对象 ID。 脚本中的实参: ItemBoxOwnerGUID(48 处)、guid(4 处)、LuaFnGetGUID(sceneId,activatorId)(2 处)
|
返回值
无返回值。赋值接收时得到 nil;这与返回数字 0 不同。
脚本中的调用
以下是服务端脚本里的真实调用点,按实参形态去重后列出 6 条。这些调用取自随包发布的脚本,可用于确认参数顺序与实际传入的值;它们不代表该写法在当前版本仍然有效。
-- event/jingji/ejingji_Box_1.lua SetItemBoxOwner(sceneId, nBoxId, LuaFnGetGUID(sceneId,activatorId)) -- obj/growpoint/ezhongzhi_xuanzezhiwu.lua SetItemBoxOwner(sceneId, ItemBoxId01, guid) -- obj/growpoint/ezhongzhi_xuanzezhiwu.lua SetItemBoxOwner(sceneId, ItemBoxId02, guid) -- obj/growpoint/ezhongzhi_xuanzezhiwu.lua SetItemBoxOwner(sceneId, ItemBoxId03, guid) -- obj/growpoint/ezhongzhi_xuanzezhiwu.lua SetItemBoxOwner(sceneId, ItemBoxId04, guid) -- obj/growpoint/gp_zhongzhi1.lua SetItemBoxOwner(sceneId, ItemBoxId, ItemBoxOwnerGUID)
核对依据:
LuaFnTbl_Ability.h 第 2076 行,服务端注册表第 620 行。调用格式与返回数量依据当前实现整理;脚本调用点取自 4244 个随包脚本(共 535888 行、命中 85384 处调用),未经运行验证。游戏内效果、边界行为及未注明的业务枚举仍需实测。