Lua接口/服务端/DispatchEventList:修订间差异
来自雪舞天龙知识库
跳到导航跳到搜索
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
||
| 第34行: | 第34行: | ||
无返回值。 | 无返回值。 | ||
== | == 调用示例 == | ||
以下取自随包服务端脚本的真实调用,可对照上方参数表确认参数顺序: | |||
<pre>-- city0_building0.lua | <pre>-- city0_building0.lua | ||
DispatchEventList(sceneId, selfId, targetId) | DispatchEventList(sceneId, selfId, targetId) | ||
-- event/chuansong/echuansong_loulan_gaochang.lua | -- event/chuansong/echuansong_loulan_gaochang.lua | ||
DispatchEventList(sceneId, selfId, -1) | DispatchEventList(sceneId, selfId, -1) | ||
-- event/city/ecity_mission.lua | -- event/city/ecity_mission.lua | ||
DispatchEventList(sceneId, selfId, selfId | DispatchEventList(sceneId, selfId, selfId)</pre> | ||
== 注意事项 == | == 注意事项 == | ||
2026年10月27日 (二) 12:31的最新版本
把当前场景中已构造的对话内容发送给指定玩家,并指定对话 NPC。
Lua 调用
DispatchEventList(sceneId, selfId, targetId)
服务端脚本中共出现 3492 处调用,实参个数出现过:3 个(3487 处)、5 个(5 处)。
实现位于 LuaFnTbl_Mission.h。
参数
| 序号 | 参数 / 类型 | 说明 |
|---|---|---|
| 1 | sceneIdnumber
|
当前调用所在的场景 ID。 脚本中的实参: sceneId(3490 处)、s(2 处)
|
| 2 | selfIdnumber
|
接收对话的玩家对象 ID。 脚本中的实参: selfId(3484 处)、p(2 处)、tId(2 处)
|
| 3 | targetIdnumber
|
对话 NPC 的场景对象 ID。 脚本中的实参: targetId(3398 处)、-1(87 处)、selfId(3 处)
|
返回值
无返回值。
调用示例
以下取自随包服务端脚本的真实调用,可对照上方参数表确认参数顺序:
-- city0_building0.lua DispatchEventList(sceneId, selfId, targetId) -- event/chuansong/echuansong_loulan_gaochang.lua DispatchEventList(sceneId, selfId, -1) -- event/city/ecity_mission.lua DispatchEventList(sceneId, selfId, selfId)
注意事项
- 调用对象必须是当前场景中的有效玩家。
- 完整流程见 NPC 对话示例。
- 脚本中有传入 5 个实参的调用,多于实现体读取的 3 个位置;多出的实参不会生效,如果需要其作用应改用别的接口。