Lua接口/服务端/LuaFnCompoundRandom:修订间差异
来自雪舞天龙知识库
跳到导航跳到搜索
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
||
| (未显示同一用户的1个中间版本) | |||
| 第20行: | 第20行: | ||
| 1 | | 1 | ||
| <code>randomIndex</code><br /><span class="lua-muted"><code>number</code></span> | | <code>randomIndex</code><br /><span class="lua-muted"><code>number</code></span> | ||
| 随机表索引。<br /><span class="lua-muted">脚本中的实参:<code> | | 随机表索引。<br /><span class="lua-muted">脚本中的实参:<code>randomIndex</code></span> | ||
|} | |} | ||
| 第26行: | 第26行: | ||
返回 1 个值。返回类型包括 <code>number</code>。明确的固定返回组合包括 <code>-1</code>。 | 返回 1 个值。返回类型包括 <code>number</code>。明确的固定返回组合包括 <code>-1</code>。 | ||
== | == 调用示例 == | ||
以下取自随包服务端脚本的真实调用,可对照上方参数表确认参数顺序: | |||
<pre>-- event/liveabilityevent/gem_compound.lua | <pre>-- event/liveabilityevent/gem_compound.lua | ||
LuaFnCompoundRandom( | LuaFnCompoundRandom(randomIndex)</pre> | ||
</div> | </div> | ||
2026年10月27日 (二) 12:36的最新版本
从指定合成随机表中取得随机结果,表索引范围为 0 到 127。
Lua 调用
LuaFnCompoundRandom(randomIndex)
服务端脚本中共出现 1 处调用,实参个数出现过:1 个(1 处)。
实现位于 LuaFnTbl_Ability.h。
参数
| 序号 | 参数 / 类型 | 说明 |
|---|---|---|
| 1 | randomIndexnumber
|
随机表索引。 脚本中的实参: randomIndex
|
返回值
返回 1 个值。返回类型包括 number。明确的固定返回组合包括 -1。
调用示例
以下取自随包服务端脚本的真实调用,可对照上方参数表确认参数顺序:
-- event/liveabilityevent/gem_compound.lua LuaFnCompoundRandom(randomIndex)