Lua接口/服务端/IsPrescrLearned:修订间差异
来自天龙知识库
跳到导航跳到搜索
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
||
| 第4行: | 第4行: | ||
<div style="padding:14px 0;border-top:3px solid #287568;border-bottom:1px solid #dbe3e6;">判断是否已经学会某项配方</div> | <div style="padding:14px 0;border-top:3px solid #287568;border-bottom:1px solid #dbe3e6;">判断是否已经学会某项配方</div> | ||
同一接口的其他调用名称:<code style="white-space:normal;overflow-wrap:anywhere;">LuaFnIsPrescrLearned</code>。 | 同一接口的其他调用名称:<code style="white-space:normal;overflow-wrap:anywhere;">LuaFnIsPrescrLearned</code>。 | ||
| 第13行: | 第11行: | ||
服务端脚本中共出现 449 处调用,实参个数出现过:3 个(449 处)。 | 服务端脚本中共出现 449 处调用,实参个数出现过:3 个(449 处)。 | ||
实现位于 <code style="white-space:normal;overflow-wrap:anywhere;">LuaFnTbl_Ability.h</code> 第 1933 行,注册表第 605、840 行。 | |||
== 参数 == | == 参数 == | ||
| 第64行: | 第64行: | ||
== 注意事项 == | == 注意事项 == | ||
* 调用对象必须是当前场景中的有效玩家。 | * 调用对象必须是当前场景中的有效玩家。 | ||
</div> | </div> | ||
2026年9月19日 (六) 13:22的版本
判断是否已经学会某项配方
同一接口的其他调用名称:LuaFnIsPrescrLearned。
Lua 调用
IsPrescrLearned(sceneId, selfId, PrescrID)
服务端脚本中共出现 449 处调用,实参个数出现过:3 个(449 处)。
实现位于 LuaFnTbl_Ability.h 第 1933 行,注册表第 605、840 行。
参数
| 序号 | 参数 / 类型 | 说明 |
|---|---|---|
| 1 | sceneIdnumber
|
当前调用所在的场景 ID。 脚本中的实参: sceneId(449 处)
|
| 2 | selfIdnumber
|
当前场景内的对象 ID。玩家接口需传入有效玩家对象;不是角色 GUID。 脚本中的实参: selfId(449 处)
|
| 3 | PrescrIDnumber
|
配方编号。 脚本中的实参: id(2 处)、pfID、recipeIndex
|
返回值
返回 1 个值。返回类型包括 number。明确的固定返回组合包括 -1。
脚本中的调用
以下是服务端脚本里的真实调用点,按实参形态去重后列出 8 条。这些调用取自随包发布的脚本,可用于确认参数顺序与实际传入的值;它们不代表该写法在当前版本仍然有效。
-- event/liveabilityevent/estudy_cailiaojiagong.lua IsPrescrLearned(sceneId, selfId, pfID) -- event/peifang/eshiyongpeifang.lua IsPrescrLearned(sceneId, selfId, recipeIndex) -- event/peifang/eshiyongpeifang.lua LuaFnIsPrescrLearned(sceneId, selfId, recipeItem.recipeId) -- event/peifang/fengren/p_fengren_cuiyuhuwan.lua LuaFnIsPrescrLearned(sceneId, selfId, x700103_g_RecipeId) -- event/peifang/fengren/p_fengren_cuiyumao.lua LuaFnIsPrescrLearned(sceneId, selfId, x700101_g_RecipeId) -- event/peifang/fengren/p_fengren_cuiyuxie.lua LuaFnIsPrescrLearned(sceneId, selfId, x700104_g_RecipeId) -- event/peifang/fengren/p_fengren_cuiyuyi.lua LuaFnIsPrescrLearned(sceneId, selfId, x700102_g_RecipeId) -- event/peifang/fengren/p_fengren_huwan16.lua LuaFnIsPrescrLearned(sceneId, selfId, x700067_g_RecipeId)
注意事项
- 调用对象必须是当前场景中的有效玩家。