Lua接口/服务端/GetCharacterType:修订间差异
来自天龙知识库
跳到导航跳到搜索
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
||
| 第10行: | 第10行: | ||
服务端脚本中共出现 51 处调用,实参个数出现过:2 个(51 处)。 | 服务端脚本中共出现 51 处调用,实参个数出现过:2 个(51 处)。 | ||
实现位于 <code>LuaFnTbl_Monster.h</code> | 实现位于 <code>LuaFnTbl_Monster.h</code>。 | ||
== 参数 == | == 参数 == | ||
2026年9月20日 (日) 00:15的最新版本
返回指定角色单位的对象类型。
Lua 调用
GetCharacterType(sceneId, characterId)
服务端脚本中共出现 51 处调用,实参个数出现过:2 个(51 处)。
实现位于 LuaFnTbl_Monster.h。
参数
| 序号 | 参数 / 类型 | 说明 |
|---|---|---|
| 1 | sceneIdnumber
|
当前调用所在的场景 ID。 脚本中的实参: sceneId(51 处)
|
| 2 | characterIdnumber
|
角色对象 ID。 脚本中的实参: killerId(25 处)、targetId(12 处)、enemyId(6 处)
|
返回值
返回 1 个值。返回类型包括 number。明确的固定返回组合包括 -1。
脚本中的调用
以下是服务端脚本里的真实调用点,按实参形态去重后列出 5 条。这些调用取自随包发布的脚本,可用于确认参数顺序与实际传入的值;它们不代表该写法在当前版本仍然有效。
-- event/caoyun/ecaoyun.lua GetCharacterType(sceneId, targetId) -- event/caoyun/ocaoyun_limiti.lua GetCharacterType(sceneId, nKiller) -- event/fuben/efuben_1_zhenlong_huodong.lua GetCharacterType(sceneId, killerId) -- event/fuben/efuben_bangzhan.lua GetCharacterType(sceneId, selfId) -- event/piaomiaofeng/ai_hadaba.lua GetCharacterType(sceneId, enemyId)