Lua接口/服务端/LuaFnIsBrother

来自天龙知识库
跳到导航跳到搜索

首页 · 服务端接口 · 好友与师徒 · 调用约定

判断 targetId 是否是 selfId 的结拜兄弟

Lua 调用

LuaFnIsBrother(sceneId, selfId, targetId)

服务端脚本中共出现 8 处调用,实参个数出现过:3 个(8 处)。

实现位于 LuaFnTbl_Relation.h。

参数

序号 参数 / 类型 说明
1 sceneId
number
当前调用所在的场景 ID。
脚本中的实参:sceneId(8 处)
2 selfId
number
当前场景内的对象 ID。玩家接口需传入有效玩家对象;不是角色 GUID。
脚本中的实参:firstPlayer(3 处)、selfId(3 处)、femaleId
3 targetId
number
对方 ID
脚本中的实参:otherPlayer(3 处)、theID(2 处)、femaleId

返回值

返回 1 个值。返回类型包括 number。明确的固定返回组合包括 -1。

脚本中的调用

以下是服务端脚本里的真实调用点,按实参形态去重后列出 5 条。这些调用取自随包发布的脚本,可用于确认参数顺序与实际传入的值;它们不代表该写法在当前版本仍然有效。

-- event/festival/christmas07/SuZhouZuoTong_QianXun.lua
LuaFnIsBrother(sceneId, firstPlayer, otherPlayer)

-- event/relation/b_swear.lua
LuaFnIsBrother(sceneId, selfId, theID)

-- event/relation/m_marry.lua
LuaFnIsBrother(sceneId, maleId, femaleId)

-- event/relation/m_marry.lua
LuaFnIsBrother(sceneId, femaleId, maleId)

-- event/relation/p_recruit.lua
LuaFnIsBrother(sceneId, selfId, tId)

注意事项

  • 调用对象必须是当前场景中的有效玩家。