NL.RegBattleExitEvent
NL.RegBattleExitEvent(Dofile, FuncName)
函數功能
創建一個所有玩家離開戰鬥就會觸發的Lua函數。
參數說明
Dofile:字符串 要加載的腳本文件名,如果爲當前文件,則定義nil即可InitFuncName:字符串 觸發的Lua函數的名稱,該函數的申明格式請參考[BattleExitCallBack]
返回值
無返回值
語法
BattleExitCallBack(CharIndex, BattleIndex, Type)參數說明
CharIndex:數值型 響應事件的對象index,該值由Lua引擎傳遞給本函數。BattleIndex:數值型 戰鬥Index,該值由Lua引擎傳遞給本函數。Type:數值型 離開戰鬥的方式,如果值爲1則表示正常離開(包括戰鬥勝利、失敗、逃跑、登出),如果該值爲2,則表示玩家被飛。該值由Lua引擎傳遞給本函數。
返回值
無
參考實例
NL.RegBattleExitEvent(nil,”MyBattleExitCallBack”);
function MyBattleExitCallBack(CharIndex, BattleIndex, Type)
if(Type==2)then
print(CharIndex.."在戰鬥中被飛啦。");
end
end
HourGlass