Lua接口/服务端/GetOneMissionNpc:修订间差异
来自天龙知识库
跳到导航跳到搜索
整理当前服务端 Lua 接口:注册名称、参数、返回值与调用说明 |
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
||
| 第4行: | 第4行: | ||
<div style="padding:14px 0;border-top:3px solid #287568;border-bottom:1px solid #dbe3e6;">从任务配置中取得一个 NPC,返回编号、名称、场景、坐标等信息。</div> | <div style="padding:14px 0;border-top:3px solid #287568;border-bottom:1px solid #dbe3e6;">从任务配置中取得一个 NPC,返回编号、名称、场景、坐标等信息。</div> | ||
<div style="margin:10px 0;padding:10px 12px;border-left:3px solid #9a7940;background:#faf7f0;font-size:13px;color:#5f5136;">本页由服务端绑定源码与随包脚本自动整理:用途、参数位置与返回数量取实现体,<b>未在游戏内执行验证</b>。调用点取自 4244 个服务端脚本中的 38 处真实调用。</div> | |||
== Lua 调用 == | == Lua 调用 == | ||
<pre style="white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.7;padding:12px;background:#f5f7f8;border:1px solid #dbe3e6;">GetOneMissionNpc(nMissionIndex)</pre> | <pre style="white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.7;padding:12px;background:#f5f7f8;border:1px solid #dbe3e6;">GetOneMissionNpc(nMissionIndex)</pre> | ||
服务端脚本中共出现 38 处调用,实参个数出现过:1 个(38 处)。 | |||
== 参数 == | == 参数 == | ||
| 第16行: | 第20行: | ||
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | 1 | | style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | 1 | ||
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">nMissionIndex</code><br /><span style="color:#657078;"><code style="white-space:normal;overflow-wrap:anywhere;">number</code></span> | | style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">nMissionIndex</code><br /><span style="color:#657078;"><code style="white-space:normal;overflow-wrap:anywhere;">number</code></span> | ||
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | 任务条目索引。 | | style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | 任务条目索引。<br /><span style="color:#657078;">脚本中的实参:<code style="white-space:normal;overflow-wrap:anywhere;">43</code>(9 处)、<code style="white-space:normal;overflow-wrap:anywhere;">nPhase</code>(9 处)、<code style="white-space:normal;overflow-wrap:anywhere;">25</code></span> | ||
|} | |} | ||
| 第22行: | 第26行: | ||
依次返回 NPC 编号、名称、场景名称、场景编号、x、z、NPC 说明、性别、等级,共 9 项;未取得条目时无返回值。 | 依次返回 NPC 编号、名称、场景名称、场景编号、x、z、NPC 说明、性别、等级,共 9 项;未取得条目时无返回值。 | ||
<div style="margin-top:20px;padding-top:10px;border-top:1px solid #dbe3e6;color:#657078;font-size:12px;">核对依据:<code style="white-space:normal;overflow-wrap:anywhere;">LuaFnTbl_Mission.h</code> 第 | == 脚本中的调用 == | ||
以下是服务端脚本里的真实调用点,按实参形态去重后列出 8 条。这些调用取自随包发布的脚本,可用于确认参数顺序与实际传入的值;它们不代表该写法在当前版本仍然有效。 | |||
<pre style="white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.7;padding:12px;background:#f5f7f8;border:1px solid #dbe3e6;">-- event/city/ecity_0103deliverweapon.lua | |||
GetOneMissionNpc(x600005_GetMissionNPCKey( sceneId, selfId )) | |||
-- event/city/ecity_0203deliverplant.lua | |||
GetOneMissionNpc(x600010_GetMissionNPCKey( sceneId, selfId )) | |||
-- event/city/ecity_0303deliverbook.lua | |||
GetOneMissionNpc(x600015_GetMissionNPCKey( sceneId, selfId )) | |||
-- event/city/ecity_0403dun.lua | |||
GetOneMissionNpc(x600020_GetMissionNPCKey( sceneId, selfId )) | |||
-- event/city/ecity_0501contacthero.lua | |||
GetOneMissionNpc(x600024_GetMissionNPCKey( sceneId, selfId )) | |||
-- event/city/ecity_0602military.lua | |||
GetOneMissionNpc(25) | |||
-- event/city/ecity_0603military.lua | |||
GetOneMissionNpc(26) | |||
-- event/city/ecity_0603military.lua | |||
GetOneMissionNpc(27)</pre> | |||
<div style="margin-top:20px;padding-top:10px;border-top:1px solid #dbe3e6;color:#657078;font-size:12px;">核对依据:<code style="white-space:normal;overflow-wrap:anywhere;">LuaFnTbl_Mission.h</code> 第 2371 行,服务端注册表第 195 行。调用格式与返回数量依据当前实现整理;脚本调用点取自 4244 个随包脚本(共 535888 行、命中 85384 处调用),未经运行验证。游戏内效果、边界行为及未注明的业务枚举仍需实测。</div> | |||
</div> | </div> | ||
2026年9月19日 (六) 12:49的版本
从任务配置中取得一个 NPC,返回编号、名称、场景、坐标等信息。
本页由服务端绑定源码与随包脚本自动整理:用途、参数位置与返回数量取实现体,未在游戏内执行验证。调用点取自 4244 个服务端脚本中的 38 处真实调用。
Lua 调用
GetOneMissionNpc(nMissionIndex)
服务端脚本中共出现 38 处调用,实参个数出现过:1 个(38 处)。
参数
| 序号 | 参数 / 类型 | 说明 |
|---|---|---|
| 1 | nMissionIndexnumber
|
任务条目索引。 脚本中的实参: 43(9 处)、nPhase(9 处)、25
|
返回值
依次返回 NPC 编号、名称、场景名称、场景编号、x、z、NPC 说明、性别、等级,共 9 项;未取得条目时无返回值。
脚本中的调用
以下是服务端脚本里的真实调用点,按实参形态去重后列出 8 条。这些调用取自随包发布的脚本,可用于确认参数顺序与实际传入的值;它们不代表该写法在当前版本仍然有效。
-- event/city/ecity_0103deliverweapon.lua GetOneMissionNpc(x600005_GetMissionNPCKey( sceneId, selfId )) -- event/city/ecity_0203deliverplant.lua GetOneMissionNpc(x600010_GetMissionNPCKey( sceneId, selfId )) -- event/city/ecity_0303deliverbook.lua GetOneMissionNpc(x600015_GetMissionNPCKey( sceneId, selfId )) -- event/city/ecity_0403dun.lua GetOneMissionNpc(x600020_GetMissionNPCKey( sceneId, selfId )) -- event/city/ecity_0501contacthero.lua GetOneMissionNpc(x600024_GetMissionNPCKey( sceneId, selfId )) -- event/city/ecity_0602military.lua GetOneMissionNpc(25) -- event/city/ecity_0603military.lua GetOneMissionNpc(26) -- event/city/ecity_0603military.lua GetOneMissionNpc(27)
核对依据:
LuaFnTbl_Mission.h 第 2371 行,服务端注册表第 195 行。调用格式与返回数量依据当前实现整理;脚本调用点取自 4244 个随包脚本(共 535888 行、命中 85384 处调用),未经运行验证。游戏内效果、边界行为及未注明的业务枚举仍需实测。