Lua接口/状态效果
来自天龙知识库
查询、施加与移除角色单位的增益 / 减益(Impact)效果。效果编号(impactDataIndex)来自效果表,集合编号(collectionId)来自效果集合配置。
查询
| 接口 | 参数与返回 |
|---|---|
| LuaFnHaveImpactOfSpecificDataIndex | sceneId, selfId, dataIndex → 是否拥有该效果;失败 -1。
|
| LuaFnHaveImpactInSpecificCollection | sceneId, selfId, collectionId → 是否拥有集合中任一效果;失败 -1。
|
LuaFnHaveImpactInSpecificCollection 只要角色拥有该集合中的**任一**效果即返回真值,用于判断一组互斥或同类效果。
施加
| 接口 | 参数与返回 |
|---|---|
| LuaFnSendSpecificImpactToUnit | sceneId, nSelfID, nSenderID, nTargetID, nImpactDataIndex, nDelayTime → 返回值;失败 -1。
|
| LuaFnSendSpecificImpactBySkillToUnit | sceneId, selfId, senderId, targetId, impactDataIndex, delayTime → 返回值;失败 -1。
|
| LuaFnSendImpactAroundPosition | sceneId, selfId, x, z, radius, standFlag, levelRequire, effectCount, impact, delayTime → 10 个参数;失败 -1。
|
LuaFnSendSpecificImpactToUnit 与 LuaFnSendSpecificImpactBySkillToUnit 都是 6 个参数,区别是后者按战斗结算规则处理(命中、抗性等)。LuaFnSendImpactAroundPosition 需要 10 个参数,在指定坐标按半径和筛选条件对范围内角色施加效果。
移除
| 接口 | 参数与返回 |
|---|---|
| LuaFnCancelSpecificImpact | sceneId, nSelfID, nImpactDataIndex → 返回值;失败 -1。
|
| LuaFnDispelAllHostileImpacts | sceneId, selfId → 部分分支无返回值。
|
| LuaFnCancelMoveSpeedBuff | sceneId, selfId → 1 成功、-1 失败。
|
| LuaFnIsModelOrMount | sceneId, selfId → 是否有模型替换或坐骑修正;失败 -1。
|
LuaFnCancelSpecificImpact 移除指定编号的效果,LuaFnDispelAllHostileImpacts 清除全部敌对效果(部分分支无返回值)。LuaFnIsModelOrMount 判断人物当前是否具有模型替换或坐骑模型修正。
查询并移除效果
local has = LuaFnHaveImpactOfSpecificDataIndex(sceneId, selfId, dataIndex)
if type(has) == "number" and has ~= -1 then
LuaFnCancelSpecificImpact(sceneId, selfId, dataIndex)
end
LuaFnHaveImpactOfSpecificDataIndex 失败返回 -1,先判类型再排除 -1。
施加效果
LuaFnSendSpecificImpactToUnit(sceneId, selfId, senderId, targetId, impactDataIndex, delayTime) -- 6 个参数;失败 -1
LuaFnSendSpecificImpactToUnit 需要 6 个参数。要按战斗结算规则(含命中与抗性)施加,改用 LuaFnSendSpecificImpactBySkillToUnit。
相关主题
- 角色信息
- 属性读取与修改
- 等级与经验
- 货币相关
- 物品查询
- 物品发放与扣除
- 背包空间
- 装备操作
- 任务状态
- 任务变量
- NPC 对话
- 对话选项
- 技能相关
- 心法相关
- 状态效果
- 生活技能
- 珍兽查询
- 珍兽操作
- 场景查询
- 坐标与传送
- 副本相关
- 活动相关
- 时间与计时
- 怪物相关
函数不存在或提示 nil · 参数类型与顺序 · 返回值判断 · 对象 ID 与 GUID
本页函数签名与返回约定依据当前服务端注册表整理;sceneId、selfId 由实际回调提供,业务枚举、属性类型编号与运行效果需要实测。