Lua接口/服务端/DispatchAbilityInfo:修订间差异
来自天龙知识库
跳到导航跳到搜索
整理当前服务端 Lua 接口:注册名称、参数、返回值与调用说明 |
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
||
| (未显示2个用户的4个中间版本) | |||
| 第1行: | 第1行: | ||
__NOTOC__ | __NOTOC__ | ||
<div class="lua-reference | <div class="lua-reference"> | ||
[[首页|首页]] · [[Lua接口/服务端函数索引|服务端接口]] · [[Lua接口/服务端函数索引/商店与交易|商店与交易]] · [[Lua接口/服务端调用约定|调用约定]] | [[首页|首页]] · [[Lua接口/服务端函数索引|服务端接口]] · [[Lua接口/服务端函数索引/商店与交易|商店与交易]] · [[Lua接口/服务端调用约定|调用约定]] | ||
<div | <div class="lua-lead lua-rule">向玩家发送生活技能老师的学习费用、经验和等级限制信息。</div> | ||
== Lua 调用 == | == Lua 调用 == | ||
<pre | <pre>DispatchAbilityInfo(sceneId, selfId, targetId, scriptId, AbilityId, nNeedMoney, nNeedExp, nNeedSkillExp, nLevelLimit)</pre> | ||
服务端脚本中共出现 30 处调用,实参个数出现过:9 个(30 处)。 | |||
实现位于 <code>LuaFnTbl_Shop.h</code>。 | |||
== 参数 == | == 参数 == | ||
{| class="wikitable | {| class="wikitable" | ||
! scope="col" | ! scope="col" class="lua-w11" | 序号 | ||
! scope="col" | ! scope="col" class="lua-w36" | 参数 / 类型 | ||
! scope="col | ! scope="col" | 说明 | ||
|- | |- | ||
| 1 | |||
| <code>sceneId</code><br /><span class="lua-muted"><code>number</code></span> | |||
| | | 当前调用所在的场景 ID。<br /><span class="lua-muted">脚本中的实参:<code>sceneId</code>(30 处)</span> | ||
|- | |- | ||
| 2 | |||
| <code>selfId</code><br /><span class="lua-muted"><code>number</code></span> | |||
| | | 当前场景内的对象 ID。玩家接口需传入有效玩家对象;不是角色 GUID。<br /><span class="lua-muted">脚本中的实参:<code>selfId</code>(30 处)</span> | ||
|- | |- | ||
| 3 | |||
| <code>targetId</code><br /><span class="lua-muted"><code>number</code></span> | |||
| | | 目标的场景对象 ID。<br /><span class="lua-muted">脚本中的实参:<code>targetId</code>(30 处)</span> | ||
|- | |- | ||
| 4 | |||
| <code>scriptId</code><br /><span class="lua-muted"><code>number</code></span> | |||
| | | 脚本配置编号。<br /><span class="lua-muted">脚本中的实参:<code>tempScriptId</code>(11 处)、<code>x713561_g_ScriptId</code>、<code>x713562_g_ScriptId</code></span> | ||
|- | |- | ||
| 5 | |||
| <code>AbilityId</code><br /><span class="lua-muted"><code>number</code></span> | |||
| | | 生活技能编号。<br /><span class="lua-muted">脚本中的实参:<code>tempAbilityId</code>(20 处)、<code>x713561_g_AbilityID</code>、<code>x713562_g_AbilityID</code></span> | ||
|- | |- | ||
| 6 | |||
| <code>nNeedMoney</code><br /><span class="lua-muted"><code>number</code></span> | |||
| | | 所需金钱。<br /><span class="lua-muted">脚本中的实参:<code>demandMoney</code>(30 处)</span> | ||
|- | |- | ||
| 7 | |||
| <code>nNeedExp</code><br /><span class="lua-muted"><code>number</code></span> | |||
| | | 所需经验。<br /><span class="lua-muted">脚本中的实参:<code>demandExp</code>(30 处)</span> | ||
|- | |- | ||
| 8 | |||
| <code>nNeedSkillExp</code><br /><span class="lua-muted"><code>number</code></span> | |||
| | | 所需技能经验。<br /><span class="lua-muted">脚本中的实参:<code>limitAbilityExpShow</code>(30 处)</span> | ||
|- | |- | ||
| 9 | |||
| <code>nLevelLimit</code><br /><span class="lua-muted"><code>number</code></span> | |||
| | | 等级限制。<br /><span class="lua-muted">脚本中的实参:<code>limitLevel</code>(30 处)</span> | ||
|} | |} | ||
== 返回值 == | == 返回值 == | ||
无返回值。赋值接收时得到 nil;这与返回数字 0 不同。 | 无返回值。赋值接收时得到 nil;这与返回数字 0 不同。 | ||
== 脚本中的调用 == | |||
以下是服务端脚本里的真实调用点,按实参形态去重后列出 8 条。这些调用取自随包发布的脚本,可用于确认参数顺序与实际传入的值;它们不代表该写法在当前版本仍然有效。 | |||
<pre>-- event/liveabilityevent/elevelup_caibingshu.lua | |||
DispatchAbilityInfo(sceneId, selfId, targetId, tempScriptId, tempAbilityId, demandMoney, demandExp, limitAbilityExpShow, limitLevel) | |||
-- event/liveabilityevent/elevelup_caikuang.lua | |||
DispatchAbilityInfo(sceneId, selfId, targetId, x713567_g_ScriptId, x713567_g_AbilityID, demandMoney, demandExp, limitAbilityExpShow, limitLevel) | |||
-- event/liveabilityevent/elevelup_caiyao.lua | |||
DispatchAbilityInfo(sceneId, selfId, targetId, x713568_g_ScriptId, x713568_g_AbilityID, demandMoney, demandExp, limitAbilityExpShow, limitLevel) | |||
-- event/liveabilityevent/elevelup_diaoyu.lua | |||
DispatchAbilityInfo(sceneId, selfId, targetId, x713569_g_ScriptId, x713569_g_AbilityID, demandMoney, demandExp, limitAbilityExpShow, limitLevel) | |||
-- event/liveabilityevent/elevelup_fengren.lua | |||
DispatchAbilityInfo(sceneId, selfId, targetId, x713565_g_ScriptId, x713565_g_AbilityID, demandMoney, demandExp, limitAbilityExpShow, limitLevel) | |||
-- event/liveabilityevent/elevelup_gongyi.lua | |||
DispatchAbilityInfo(sceneId, selfId, targetId, x713566_g_ScriptId, x713566_g_AbilityID, demandMoney, demandExp, limitAbilityExpShow, limitLevel) | |||
-- event/liveabilityevent/elevelup_kaiguang.lua | |||
DispatchAbilityInfo(sceneId, selfId, targetId, x713571_g_ScriptId, tempAbilityId, demandMoney, demandExp, limitAbilityExpShow, limitLevel) | |||
-- event/liveabilityevent/elevelup_liandan.lua | |||
DispatchAbilityInfo(sceneId, selfId, targetId, x713578_g_ScriptId, tempAbilityId, demandMoney, demandExp, limitAbilityExpShow, limitLevel)</pre> | |||
== 注意事项 == | == 注意事项 == | ||
* 调用对象必须是当前场景中的有效玩家。 | * 调用对象必须是当前场景中的有效玩家。 | ||
* 调用前要求玩家处于可执行逻辑的状态(实现体断言 <code>pHuman->IsCanLogic()</code>);不满足时会记录断言,应先确认玩家当前状态。 | |||
< | |||
</div> | </div> | ||
2026年9月20日 (日) 00:13的最新版本
向玩家发送生活技能老师的学习费用、经验和等级限制信息。
Lua 调用
DispatchAbilityInfo(sceneId, selfId, targetId, scriptId, AbilityId, nNeedMoney, nNeedExp, nNeedSkillExp, nLevelLimit)
服务端脚本中共出现 30 处调用,实参个数出现过:9 个(30 处)。
实现位于 LuaFnTbl_Shop.h。
参数
| 序号 | 参数 / 类型 | 说明 |
|---|---|---|
| 1 | sceneIdnumber
|
当前调用所在的场景 ID。 脚本中的实参: sceneId(30 处)
|
| 2 | selfIdnumber
|
当前场景内的对象 ID。玩家接口需传入有效玩家对象;不是角色 GUID。 脚本中的实参: selfId(30 处)
|
| 3 | targetIdnumber
|
目标的场景对象 ID。 脚本中的实参: targetId(30 处)
|
| 4 | scriptIdnumber
|
脚本配置编号。 脚本中的实参: tempScriptId(11 处)、x713561_g_ScriptId、x713562_g_ScriptId
|
| 5 | AbilityIdnumber
|
生活技能编号。 脚本中的实参: tempAbilityId(20 处)、x713561_g_AbilityID、x713562_g_AbilityID
|
| 6 | nNeedMoneynumber
|
所需金钱。 脚本中的实参: demandMoney(30 处)
|
| 7 | nNeedExpnumber
|
所需经验。 脚本中的实参: demandExp(30 处)
|
| 8 | nNeedSkillExpnumber
|
所需技能经验。 脚本中的实参: limitAbilityExpShow(30 处)
|
| 9 | nLevelLimitnumber
|
等级限制。 脚本中的实参: limitLevel(30 处)
|
返回值
无返回值。赋值接收时得到 nil;这与返回数字 0 不同。
脚本中的调用
以下是服务端脚本里的真实调用点,按实参形态去重后列出 8 条。这些调用取自随包发布的脚本,可用于确认参数顺序与实际传入的值;它们不代表该写法在当前版本仍然有效。
-- event/liveabilityevent/elevelup_caibingshu.lua DispatchAbilityInfo(sceneId, selfId, targetId, tempScriptId, tempAbilityId, demandMoney, demandExp, limitAbilityExpShow, limitLevel) -- event/liveabilityevent/elevelup_caikuang.lua DispatchAbilityInfo(sceneId, selfId, targetId, x713567_g_ScriptId, x713567_g_AbilityID, demandMoney, demandExp, limitAbilityExpShow, limitLevel) -- event/liveabilityevent/elevelup_caiyao.lua DispatchAbilityInfo(sceneId, selfId, targetId, x713568_g_ScriptId, x713568_g_AbilityID, demandMoney, demandExp, limitAbilityExpShow, limitLevel) -- event/liveabilityevent/elevelup_diaoyu.lua DispatchAbilityInfo(sceneId, selfId, targetId, x713569_g_ScriptId, x713569_g_AbilityID, demandMoney, demandExp, limitAbilityExpShow, limitLevel) -- event/liveabilityevent/elevelup_fengren.lua DispatchAbilityInfo(sceneId, selfId, targetId, x713565_g_ScriptId, x713565_g_AbilityID, demandMoney, demandExp, limitAbilityExpShow, limitLevel) -- event/liveabilityevent/elevelup_gongyi.lua DispatchAbilityInfo(sceneId, selfId, targetId, x713566_g_ScriptId, x713566_g_AbilityID, demandMoney, demandExp, limitAbilityExpShow, limitLevel) -- event/liveabilityevent/elevelup_kaiguang.lua DispatchAbilityInfo(sceneId, selfId, targetId, x713571_g_ScriptId, tempAbilityId, demandMoney, demandExp, limitAbilityExpShow, limitLevel) -- event/liveabilityevent/elevelup_liandan.lua DispatchAbilityInfo(sceneId, selfId, targetId, x713578_g_ScriptId, tempAbilityId, demandMoney, demandExp, limitAbilityExpShow, limitLevel)
注意事项
- 调用对象必须是当前场景中的有效玩家。
- 调用前要求玩家处于可执行逻辑的状态(实现体断言
pHuman->IsCanLogic());不满足时会记录断言,应先确认玩家当前状态。