[GP] BattleIndex_save.lua--获取战斗index

[复制链接]
发表于 5 天前 | 显示全部楼层 |阅读模式
Global_Reg.RegBattleStartEvent ("BattleIndex_start_GP");--战斗开始
Global_Reg.RegCharBattleOver ("BattleIndex_over_forGP");--战斗结束

BattleIndex_save_tbl=BattleIndex_save_tbl or {}


function BattleIndex_start_GP(battleIndex)
        local GetType = Battle.GetType(battleIndex);
        if GetType==2 then
                for Side=0,1 do
                        for Num=0,9 do
                                local Charindex = Battle.GetPlayIndex(battleIndex,Side,Num)
                                if Charindex >= 0 then
                                        local ifpet = Char.GetData(Charindex,0)--返回:3是宠,1是人
                                        if ifpet==1 then
                                                BattleIndex_save_tbl[Charindex]=battleIndex
                                                --NLG.SystemMessage(-1,"[战斗记录]玩家index是"..Charindex)
                                        end
                                end
                        end
                end
        end
    return 0
end

function BattleIndex_over_forGP(Battleindex,Charindex)
        if BattleIndex_save_tbl[Charindex] then
                BattleIndex_save_tbl[Charindex]=nil
        end
       
        return
end


回复

使用道具 举报

快速回复 返回顶部 返回列表