Lua接口/服务端/GetMenPai:修订间差异
来自天龙知识库
跳到导航跳到搜索
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
||
| 第12行: | 第12行: | ||
服务端脚本中共出现 320 处调用,实参个数出现过:2 个(320 处)。 | 服务端脚本中共出现 320 处调用,实参个数出现过:2 个(320 处)。 | ||
实现位于 <code>LuaFnTbl_Attr.h</code> | 实现位于 <code>LuaFnTbl_Attr.h</code>。 | ||
== 参数 == | == 参数 == | ||
2026年9月20日 (日) 00:11的最新版本
获取玩家当前所属门派ID
同一接口的其他调用名称:LuaFnGetMenPai。
Lua 调用
GetMenPai(sceneId, selfId)
服务端脚本中共出现 320 处调用,实参个数出现过:2 个(320 处)。
实现位于 LuaFnTbl_Attr.h。
参数
| 序号 | 参数 / 类型 | 说明 |
|---|---|---|
| 1 | sceneIdnumber
|
当前调用所在的场景 ID。 脚本中的实参: sceneId(320 处)
|
| 2 | selfIdnumber
|
当前场景内的对象 ID。玩家接口需传入有效玩家对象;不是角色 GUID。 脚本中的实参: selfId(288 处)、humanObjId(18 处)、nHumanId(4 处)
|
返回值
返回 1 个值。返回类型包括 number。明确的固定返回组合包括 -1。
脚本中的调用
以下是服务端脚本里的真实调用点,按实参形态去重后列出 8 条。这些调用取自随包发布的脚本,可用于确认参数顺序与实际传入的值;它们不代表该写法在当前版本仍然有效。
-- event/dali/edali_0237.lua GetMenPai(sceneId, selfId) -- event/dali/edali_0287.lua GetMenPai(sceneId, nPlayerId) -- event/huashan/ehuashan_1.lua LuaFnGetMenPai(sceneId, nHumanId) -- event/huashan/ehuashan_1.lua GetMenPai(sceneId, killerId) -- event/huashan/ehuashan_1.lua GetMenPai(sceneId, PlayerId) -- event/huashan/ehuashan_4.lua LuaFnGetMenPai(sceneId, playerId) -- event/huodong/eTouximenpai_NPC_emei.lua GetMenPai(sceneId, humanObjId) -- event/piaomiaofeng/ai_zhuobufan.lua GetMenPai(sceneId, enemyId)
注意事项
- 调用对象必须是当前场景中的有效玩家。
- 调用前要求玩家处于可执行逻辑的状态(实现体断言
pHuman->IsCanLogic());不满足时会记录断言,应先确认玩家当前状态。