|  |  |  | 
|---|
|  |  |  | import SkillShell | 
|---|
|  |  |  | import EventReport | 
|---|
|  |  |  | import SkillCommon | 
|---|
|  |  |  | import PlayerWeekParty | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import random | 
|---|
|  |  |  | import time | 
|---|
|  |  |  | 
|---|
|  |  |  | FB_Step_Over,  # 副本结束 | 
|---|
|  |  |  | ) = range(3) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | def OnLogin(curPlayer): | 
|---|
|  |  |  | OnElderBattlefieldFBResult(curPlayer, True) | 
|---|
|  |  |  | def OnFBPlayerOnLogin(curPlayer): | 
|---|
|  |  |  | mapID = GameWorld.GetMap().GetMapID() | 
|---|
|  |  |  | if mapID != ChConfig.Def_FBMapID_ElderBattlefield: | 
|---|
|  |  |  | OnElderBattlefieldFBResult(curPlayer, True) | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | def OnElderBattlefieldStateChange(state, tick): | 
|---|
|  |  |  | 
|---|
|  |  |  | GameWorld.GetGameWorld().SetGameWorldDict(FBPlayerDict_TotalExp % playerID, 0) | 
|---|
|  |  |  | GameWorld.GetGameWorld().SetGameWorldDict(FBPlayerDict_TotalExpPoint % playerID, 0) | 
|---|
|  |  |  | EventReport.WriteEvent_FB(curPlayer, ChConfig.Def_FBMapID_ElderBattlefield, 0, ChConfig.CME_Log_Start) | 
|---|
|  |  |  | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_ElderBattlefield, 1) | 
|---|
|  |  |  | else: | 
|---|
|  |  |  | rebornBuffLV = GameWorld.GetGameFB().GetPlayerGameFBDictByKey(playerID, FBPlayerDict_RebornBuffLV) | 
|---|
|  |  |  | __DoAddRebornBuff(curPlayer, rebornBuffLV, tick) | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | def OnElderBattlefieldFBResult(curPlayer, isLogin=False): | 
|---|
|  |  |  | # 玩家处理上古战场结算信息 | 
|---|
|  |  |  | curStage = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ElderBattlefieldStage, 0) | 
|---|
|  |  |  | if not curStage: | 
|---|
|  |  |  | return | 
|---|
|  |  |  | GameWorld.DebugLog('    玩家处理上古战场结算信息 , isLogin=%s' % isLogin, curPlayer.GetPlayerID()) | 
|---|
|  |  |  | lineID = 0  #GameWorld.GetGameWorld().GetPropertyID() -1 | 
|---|
|  |  |  | fbRewardDict = FBCommon.GetFBLineReward(ChConfig.Def_FBMapID_ElderBattlefield, lineID) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | curStage = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ElderBattlefieldStage, 0) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | itemList = fbRewardDict.get(curStage, []) | 
|---|
|  |  |  | succIDList = PlayerSuccess.GetCanGetAwardSuccByType(curPlayer, [ShareDefine.SuccType_ElderBattlefieldKill, ShareDefine.SuccType_ElderBattlefieldConKill]) | 
|---|
|  |  |  | succAwardDict = PlayerSuccess.GiveSuccAward(curPlayer, succIDList, False) | 
|---|
|  |  |  | 
|---|
|  |  |  | PlayerControl.SendMailByKey("ElderBattlefieldMail" if mapID == ChConfig.Def_FBMapID_ElderBattlefield else 'ElderBattlefieldMail2', [curPlayer.GetPlayerID()], rewardItemList) | 
|---|
|  |  |  | else: | 
|---|
|  |  |  | for itemID, itemCnt, isBind in rewardItemList: | 
|---|
|  |  |  | ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, isBind, [IPY_GameWorld.rptItem], event=["ElderBattlefield", False, {}]) | 
|---|
|  |  |  | ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, 0, [IPY_GameWorld.rptItem], event=["ElderBattlefield", False, {}]) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | overDict = {FBCommon.Over_itemInfo:FBCommon.GetJsonItemList(itemList), FBCommon.Over_succItemInfo:FBCommon.GetJsonItemList(succAwardDict.items())} | 
|---|
|  |  |  | FBCommon.NotifyFBOver(curPlayer, ChConfig.Def_FBMapID_ElderBattlefield, lineID, 1, overDict) | 
|---|
|  |  |  | 
|---|
|  |  |  | def DoFBOnKill_Player(atkobj, defender, tick): | 
|---|
|  |  |  | gameFB = GameWorld.GetGameFB() | 
|---|
|  |  |  | atkIsPlayer = atkobj.GetGameObjType() == IPY_GameWorld.gotPlayer | 
|---|
|  |  |  | baseCnt = IpyGameDataPY.GetFuncCfg('ElderBattlefieldSys', 2) | 
|---|
|  |  |  | addScore = 0 | 
|---|
|  |  |  | if atkIsPlayer: | 
|---|
|  |  |  | playerID = atkobj.GetPlayerID() | 
|---|
|  |  |  | 
|---|
|  |  |  | gameFB.SetPlayerGameFBDict(playerID, FBPlayerDict_ContKillCntEx, contKillCntEx) | 
|---|
|  |  |  | #连杀广播 | 
|---|
|  |  |  | ckillSysList = IpyGameDataPY.GetFuncCfg('ElderBattlefieldSys', 1) | 
|---|
|  |  |  | baseCnt = IpyGameDataPY.GetFuncCfg('ElderBattlefieldSys', 2) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | perCnt = IpyGameDataPY.GetFuncCfg('ElderBattlefieldSys', 3) | 
|---|
|  |  |  | if contKillCntEx >= baseCnt and contKillCntEx % perCnt == 0: | 
|---|
|  |  |  | sysIndex = min((contKillCntEx - baseCnt) / perCnt, len(ckillSysList) - 1) | 
|---|
|  |  |  | 
|---|
|  |  |  | if atkIsPlayer: | 
|---|
|  |  |  | PlayerControl.FBNotify('AncientBattlefield_7', [atkobj.GetName(), defender.GetName(), defContKillCntEx]) | 
|---|
|  |  |  | else: | 
|---|
|  |  |  | PlayerControl.FBNotify('AncientBattlefield_robot', [atkobj.GetNPCID(), atkobj.GetObjID(), defender.GetName(), defContKillCntEx]) | 
|---|
|  |  |  | PlayerControl.FBNotify('AncientBattlefield_robot', [atkobj.GetNPCID(), atkobj.GetID(), defender.GetName(), defContKillCntEx]) | 
|---|
|  |  |  | gameFB.SetPlayerGameFBDict(tagPlayerID, FBPlayerDict_ContKillCntEx, 0) | 
|---|
|  |  |  | #记录仇人 | 
|---|
|  |  |  | if atkIsPlayer: | 
|---|