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
|
|