Lua接口/服务端/SetMissionByIndex:修订间差异
来自天龙知识库
跳到导航跳到搜索
整理当前服务端 Lua 接口:注册名称、参数、返回值与调用说明 |
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
||
| (未显示2个用户的4个中间版本) | |||
| 第1行: | 第1行: | ||
__NOTOC__ | __NOTOC__ | ||
<div class="lua-reference | <div class="lua-reference"> | ||
[[首页|首页]] · [[Lua接口/服务端函数索引|服务端接口]] · [[Lua接口/服务端函数索引/任务与对话|任务与对话]] · [[Lua接口/服务端调用约定|调用约定]] | [[首页|首页]] · [[Lua接口/服务端函数索引|服务端接口]] · [[Lua接口/服务端函数索引/任务与对话|任务与对话]] · [[Lua接口/服务端调用约定|调用约定]] | ||
<div | <div class="lua-lead lua-rule">设置任务参数</div> | ||
== Lua 调用 == | == Lua 调用 == | ||
<pre | <pre>SetMissionByIndex(sceneId, selfId, misIndex, paramIndex, value)</pre> | ||
服务端脚本中共出现 1764 处调用,实参个数出现过:5 个(1764 处)。 | |||
实现位于 <code>LuaFnTbl_Mission.h</code>。 | |||
== 参数 == | == 参数 == | ||
{| class="wikitable | {| class="wikitable" | ||
! scope="col" | ! scope="col" class="lua-w11" | 序号 | ||
! scope="col" | ! scope="col" class="lua-w36" | 参数 / 类型 | ||
! scope="col | ! scope="col" | 说明 | ||
|- | |- | ||
| 1 | |||
| <code>sceneId</code><br /><span class="lua-muted"><code>number</code></span> | |||
| | | 当前调用所在的场景 ID。<br /><span class="lua-muted">脚本中的实参:<code>sceneId</code>(1764 处)</span> | ||
|- | |- | ||
| 2 | |||
| <code>selfId</code><br /><span class="lua-muted"><code>number</code></span> | |||
| | | 当前场景内的对象 ID。玩家接口需传入有效玩家对象;不是角色 GUID。<br /><span class="lua-muted">脚本中的实参:<code>selfId</code>(1370 处)、<code>humanObjId</code>(181 处)、<code>mems[i]</code>(86 处)</span> | ||
|- | |- | ||
| 3 | |||
| <code>misIndex</code><br /><span class="lua-muted"><code>number</code></span> | |||
| | | 任务索引。<br /><span class="lua-muted">脚本中的实参:<code>misIndex</code>(1753 处)、<code>misIndexPre</code>(4 处)、<code>misIndex_1</code>(2 处)</span> | ||
|- | |- | ||
| 4 | |||
| <code>paramIndex</code><br /><span class="lua-muted"><code>number</code></span> | |||
| | | 该任务字段编号<br /><span class="lua-muted">脚本中的实参:<code>0</code>(367 处)、<code>1</code>(223 处)、<code>2</code>(49 处)</span> | ||
|- | |- | ||
| 5 | |||
| <code>value</code><br /><span class="lua-muted"><code>number</code></span> | |||
| | | 设paramIndex字段的值<br /><span class="lua-muted">脚本中的实参:<code>1</code>(550 处)、<code>0</code>(373 处)、<code>destsceneId</code>(54 处)</span> | ||
|} | |} | ||
== 返回值 == | == 返回值 == | ||
无返回值。赋值接收时得到 nil;这与返回数字 0 不同。 | 无返回值。赋值接收时得到 nil;这与返回数字 0 不同。 | ||
== 脚本中的调用 == | |||
以下是服务端脚本里的真实调用点,按实参形态去重后列出 8 条。这些调用取自随包发布的脚本,可用于确认参数顺序与实际传入的值;它们不代表该写法在当前版本仍然有效。 | |||
<pre>-- event/caoyun/ecaoyun.lua | |||
SetMissionByIndex(sceneId, selfId, misIndex, 3, 0) | |||
-- event/caoyun/ecaoyun.lua | |||
SetMissionByIndex(sceneId, selfId, misIndex, 0, 0) | |||
-- event/caoyun/ecaoyun.lua | |||
SetMissionByIndex(sceneId, selfId, misIndex, 1, 0) | |||
-- event/caoyun/ecaoyun.lua | |||
SetMissionByIndex(sceneId, selfId, misIndex, 0, Price_Up) | |||
-- event/caoyun/ecaoyun.lua | |||
SetMissionByIndex(sceneId, selfId, misIndex, 1, Price_Down) | |||
-- event/caoyun/ecaoyun.lua | |||
SetMissionByIndex(sceneId, selfId, misIndex, 2, 0) | |||
-- event/caoyun/ecaoyun.lua | |||
SetMissionByIndex(sceneId, selfId, misIndex, 4, 0) | |||
-- event/caoyun/ecaoyun.lua | |||
SetMissionByIndex(sceneId, selfId, misIndex, 5, Corpus)</pre> | |||
== 注意事项 == | == 注意事项 == | ||
* 调用对象必须是当前场景中的有效玩家。 | * 调用对象必须是当前场景中的有效玩家。 | ||
</div> | </div> | ||
2026年9月20日 (日) 00:10的最新版本
设置任务参数
Lua 调用
SetMissionByIndex(sceneId, selfId, misIndex, paramIndex, value)
服务端脚本中共出现 1764 处调用,实参个数出现过:5 个(1764 处)。
实现位于 LuaFnTbl_Mission.h。
参数
| 序号 | 参数 / 类型 | 说明 |
|---|---|---|
| 1 | sceneIdnumber
|
当前调用所在的场景 ID。 脚本中的实参: sceneId(1764 处)
|
| 2 | selfIdnumber
|
当前场景内的对象 ID。玩家接口需传入有效玩家对象;不是角色 GUID。 脚本中的实参: selfId(1370 处)、humanObjId(181 处)、mems[i](86 处)
|
| 3 | misIndexnumber
|
任务索引。 脚本中的实参: misIndex(1753 处)、misIndexPre(4 处)、misIndex_1(2 处)
|
| 4 | paramIndexnumber
|
该任务字段编号 脚本中的实参: 0(367 处)、1(223 处)、2(49 处)
|
| 5 | valuenumber
|
设paramIndex字段的值 脚本中的实参: 1(550 处)、0(373 处)、destsceneId(54 处)
|
返回值
无返回值。赋值接收时得到 nil;这与返回数字 0 不同。
脚本中的调用
以下是服务端脚本里的真实调用点,按实参形态去重后列出 8 条。这些调用取自随包发布的脚本,可用于确认参数顺序与实际传入的值;它们不代表该写法在当前版本仍然有效。
-- event/caoyun/ecaoyun.lua SetMissionByIndex(sceneId, selfId, misIndex, 3, 0) -- event/caoyun/ecaoyun.lua SetMissionByIndex(sceneId, selfId, misIndex, 0, 0) -- event/caoyun/ecaoyun.lua SetMissionByIndex(sceneId, selfId, misIndex, 1, 0) -- event/caoyun/ecaoyun.lua SetMissionByIndex(sceneId, selfId, misIndex, 0, Price_Up) -- event/caoyun/ecaoyun.lua SetMissionByIndex(sceneId, selfId, misIndex, 1, Price_Down) -- event/caoyun/ecaoyun.lua SetMissionByIndex(sceneId, selfId, misIndex, 2, 0) -- event/caoyun/ecaoyun.lua SetMissionByIndex(sceneId, selfId, misIndex, 4, 0) -- event/caoyun/ecaoyun.lua SetMissionByIndex(sceneId, selfId, misIndex, 5, Corpus)
注意事项
- 调用对象必须是当前场景中的有效玩家。