RegRecovery_Battle (DoFile, InitFuncName);


函数功能:

创建一个所有战斗中使用物品成功会触发的Lua函数。


请求方式:

参数名 是否必须 类型 说明
DoFile string 脚本文件路径(如是本文件则填写nil)
InitFuncName string 响应事件处理函数的名称,声明格式参考如下

参数说明:

参数名 是否必须 类型 说明
CharIndex int 响应事件的对象索引
ItemPos int 道具在物品栏位置

返回值:

类型 是否必须 正常 拦截
int 1 0

操作实例:


function Recovery_Battle(CharIndex, ItemPos)
--竞技场内战斗中不允许使用15607(血瓶)道具
    local ItemIndex = Char.GetItemIndex(CharIndex,Pos);
    local ItemID = Item.GetData(Itemindex, %道具_ID%);
    if (ItemID == 15607)then
        NLG.SystemMessage(CharIndex, "竞技场不能使用血瓶!")
        return 0;
    end
    return 1;
end

备注:

  • 返回错误代码请使用 GetErrorStr 获取具体错误信息。
文档更新时间: 2023-04-21 15:45   作者:105493660