Lua接口/服务端/LuaFnSetSceneLoad Monster:修订间差异
来自天龙知识库
跳到导航跳到搜索
整理当前服务端 Lua 接口:注册名称、参数、返回值与调用说明 |
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
||
| 第4行: | 第4行: | ||
<div style="padding:14px 0;border-top:3px solid #287568;border-bottom:1px solid #dbe3e6;">设置副本创建选项里的怪物分布文件,类似"*_monster.ini",</div> | <div style="padding:14px 0;border-top:3px solid #287568;border-bottom:1px solid #dbe3e6;">设置副本创建选项里的怪物分布文件,类似"*_monster.ini",</div> | ||
<div style="margin:10px 0;padding:10px 12px;border-left:3px solid #9a7940;background:#faf7f0;font-size:13px;color:#5f5136;">本页由服务端绑定源码与随包脚本自动整理:用途、参数位置与返回数量取实现体,<b>未在游戏内执行验证</b>。调用点取自 4244 个服务端脚本中的 122 处真实调用。</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;">LuaFnSetSceneLoad_Monster(sceneId, monsterName)</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;">LuaFnSetSceneLoad_Monster(sceneId, monsterName)</pre> | ||
服务端脚本中共出现 122 处调用,实参个数出现过:2 个(122 处)。 | |||
== 参数 == | == 参数 == | ||
| 第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;">sceneId</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;">sceneId</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;" | 当前调用所在的场景 ID。 | | style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | 当前调用所在的场景 ID。<br /><span style="color:#657078;">脚本中的实参:<code style="white-space:normal;overflow-wrap:anywhere;">sceneId</code>(122 处)</span> | ||
|- | |- | ||
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | 2 | | style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | 2 | ||
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">monsterName</code><br /><span style="color:#657078;"><code style="white-space:normal;overflow-wrap:anywhere;">string</code></span> | | style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">monsterName</code><br /><span style="color:#657078;"><code style="white-space:normal;overflow-wrap:anywhere;">string</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;">monsterINI</code>(4 处)、<code style="white-space:normal;overflow-wrap:anywhere;">"_pingpan_1_monster.ini"</code>(2 处)、<code style="white-space:normal;overflow-wrap:anywhere;">"_pingpan_40_monster.ini"</code>(2 处)</span> | ||
|} | |} | ||
| 第30行: | 第34行: | ||
不需要带路径 | 不需要带路径 | ||
<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_Scene.h</code> 第 170 行,服务端注册表第 | == 脚本中的调用 == | ||
以下是服务端脚本里的真实调用点,按实参形态去重后列出 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_0102eliminatethieves.lua | |||
LuaFnSetSceneLoad_Monster(sceneId, "kuangchang_monster_" .. iniLevel .. ".ini") | |||
-- event/city/ecity_0202convoypet.lua | |||
LuaFnSetSceneLoad_Monster(sceneId, "muchang_monster_" .. iniLevel .. ".ini") | |||
-- event/city/ecity_0302fightvermins.lua | |||
LuaFnSetSceneLoad_Monster(sceneId, "shuge_monster_" .. iniLevel .. ".ini") | |||
-- event/city/ecity_0402chuckoutvillain.lua | |||
LuaFnSetSceneLoad_Monster(sceneId, "jishi_monster_" .. iniLevel .. ".ini") | |||
-- event/city/ecity_0502directprentice.lua | |||
LuaFnSetSceneLoad_Monster(sceneId, "jiaochang_monster_" .. iniLevel .. ".ini") | |||
-- event/city/ecity_0503savefamily.lua | |||
LuaFnSetSceneLoad_Monster(sceneId, format( MenpaiInfo.Monster, iniLevel )) | |||
-- event/city/ecity_0602military.lua | |||
LuaFnSetSceneLoad_Monster(sceneId, x600032_g_CopyNpc[nMenpai] .. "_" .. tostring(in) | |||
-- event/city/ecity_0604military.lua | |||
LuaFnSetSceneLoad_Monster(sceneId, "yamen_monster_" .. tostring(iniLevel) .. ".ini")</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_Scene.h</code> 第 170 行,服务端注册表第 718 行。调用格式与返回数量依据当前实现整理;脚本调用点取自 4244 个随包脚本(共 535888 行、命中 85384 处调用),未经运行验证。游戏内效果、边界行为及未注明的业务枚举仍需实测。</div> | |||
</div> | </div> | ||
2026年9月19日 (六) 12:56的版本
设置副本创建选项里的怪物分布文件,类似"*_monster.ini",
本页由服务端绑定源码与随包脚本自动整理:用途、参数位置与返回数量取实现体,未在游戏内执行验证。调用点取自 4244 个服务端脚本中的 122 处真实调用。
Lua 调用
LuaFnSetSceneLoad_Monster(sceneId, monsterName)
服务端脚本中共出现 122 处调用,实参个数出现过:2 个(122 处)。
参数
| 序号 | 参数 / 类型 | 说明 |
|---|---|---|
| 1 | sceneIdnumber
|
当前调用所在的场景 ID。 脚本中的实参: sceneId(122 处)
|
| 2 | monsterNamestring
|
怪物分布文件名,字符串类型 脚本中的实参: monsterINI(4 处)、"_pingpan_1_monster.ini"(2 处)、"_pingpan_40_monster.ini"(2 处)
|
返回值
无返回值。赋值接收时得到 nil;这与返回数字 0 不同。
用法补充
设置副本创建选项里的怪物分布文件,类似"*_monster.ini",
不需要带路径
脚本中的调用
以下是服务端脚本里的真实调用点,按实参形态去重后列出 8 条。这些调用取自随包发布的脚本,可用于确认参数顺序与实际传入的值;它们不代表该写法在当前版本仍然有效。
-- event/city/ecity_0102eliminatethieves.lua LuaFnSetSceneLoad_Monster(sceneId, "kuangchang_monster_" .. iniLevel .. ".ini") -- event/city/ecity_0202convoypet.lua LuaFnSetSceneLoad_Monster(sceneId, "muchang_monster_" .. iniLevel .. ".ini") -- event/city/ecity_0302fightvermins.lua LuaFnSetSceneLoad_Monster(sceneId, "shuge_monster_" .. iniLevel .. ".ini") -- event/city/ecity_0402chuckoutvillain.lua LuaFnSetSceneLoad_Monster(sceneId, "jishi_monster_" .. iniLevel .. ".ini") -- event/city/ecity_0502directprentice.lua LuaFnSetSceneLoad_Monster(sceneId, "jiaochang_monster_" .. iniLevel .. ".ini") -- event/city/ecity_0503savefamily.lua LuaFnSetSceneLoad_Monster(sceneId, format( MenpaiInfo.Monster, iniLevel )) -- event/city/ecity_0602military.lua LuaFnSetSceneLoad_Monster(sceneId, x600032_g_CopyNpc[nMenpai] .. "_" .. tostring(in) -- event/city/ecity_0604military.lua LuaFnSetSceneLoad_Monster(sceneId, "yamen_monster_" .. tostring(iniLevel) .. ".ini")
核对依据:
LuaFnTbl_Scene.h 第 170 行,服务端注册表第 718 行。调用格式与返回数量依据当前实现整理;脚本调用点取自 4244 个随包脚本(共 535888 行、命中 85384 处调用),未经运行验证。游戏内效果、边界行为及未注明的业务枚举仍需实测。