From 855ebda9a35f0213f6c058518e270c2a8e615206 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 30 四月 2021 16:02:04 +0800
Subject: [PATCH] 4906 【主干】【BT】【BTZF】【BT2】【gt_1.100.6】跨服地图报错查看(防范触发嗜天风暴buff可能报错);

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_BZZD.py |   67 +++++++++++++++++++++++++--------
 1 files changed, 51 insertions(+), 16 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_BZZD.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_BZZD.py
index ddb564f..48ad529 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_BZZD.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_BZZD.py
@@ -30,6 +30,7 @@
 import PlayerFairyCeremony
 import PlayerNewFairyCeremony
 import PlayerActLogin
+import PlayerFeastTravel
 import PlayerWeekParty
 import ItemControler
 import GameFuncComm
@@ -56,6 +57,8 @@
 ) = range(5)
 
 BZZD_TotalNPCCount = 'BZZD_TotalNPCCount'   # 总需击杀NPC数量
+BZZD_LastNPCID = 'BZZD_LastNPCID'   # 最后一只怪NPCID,指定怪物刷完后,后续补刷的怪直接刷该NPCID,防止异常导致怪物不够杀无法结算
+BZZD_IsKillAll = 'BZZD_IsKillAll'   # 是否已经击杀到指定怪物数量
 
 FBPlayerDict_KillCnt = 'FBPlayerDict_KillCnt'   # 击杀数
 FBPlayerDict_EnterLV = 'FBPlayerDict_EnterLV'   # 进入副本时的等级
@@ -103,6 +106,7 @@
         PlayerFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_XJMJ, 1)
         PlayerNewFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_XJMJ, 1)
         PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_XJMJ, 1)
+        PlayerFeastTravel.AddFeastTravelTaskValue(curPlayer, ChConfig.Def_FeastTravel_XJMJ, 1)
         PlayerActLogin.AddLoginAwardActionCnt(curPlayer, ChConfig.Def_LoginAct_XJMJ, 1)
         EventShell.EventRespons_FBEvent(curPlayer, 'passxjmj')
         FBCommon.UpdateFBEnterTick(curPlayer)
@@ -242,10 +246,11 @@
     totalNPCCount = gameFB.GetGameFBDictByKey(BZZD_TotalNPCCount)
     exp = gameFB.GetPlayerGameFBDictByKey(playerID, FBPlayerDict_TotalExp)
     expPoint = gameFB.GetPlayerGameFBDictByKey(playerID, FBPlayerDict_TotalExpPoint)
+    grade = gameFB.GetGameFBDictByKey(ChConfig.Def_FB_Grade)
     
     #副本帮助
     helpDict = {FBCommon.Help_npcTotal:killNPCCnt, FBCommon.Help_npcTotalNeed:totalNPCCount,
-                FBCommon.Help_exp:exp, FBCommon.Help_expPoint:expPoint}
+                FBCommon.Help_exp:exp, FBCommon.Help_expPoint:expPoint, FBCommon.Help_grade:grade}
     GameWorld.DebugLog("DoFBHelp %s" % str(helpDict))
     FBCommon.Notify_FBHelp(curPlayer, helpDict)
     return
@@ -290,9 +295,11 @@
     if lineID not in PyGameData.g_bzzdRefreshNPCListDict:
         return
     refreshNPCList = PyGameData.g_bzzdRefreshNPCListDict[lineID]
-    if not refreshNPCList:
-        return
+    #if not refreshNPCList:
+    #    return
     
+    isRefresh = False
+    gameFB = GameWorld.GetGameFB()
     gameNPC = GameWorld.GetNPCManager()
     customNPCRefreshCount = gameNPC.GetCustomNPCRefreshCount()
     for i in xrange(customNPCRefreshCount):
@@ -300,14 +307,21 @@
         if npcRefresh.GetCount():
             continue
         rMark = npcRefresh.GetRefreshMark()
-        npcID = refreshNPCList.pop(0) # 直接按顺序取NPCID
-        NPCCustomRefresh.SetNPCRefresh(rMark, [npcID])
-        
-        if not refreshNPCList:
-            GameWorld.DebugLog("怪全部刷完了,没怪了!")
+        if refreshNPCList:
+            npcID = refreshNPCList.pop(0) # 直接按顺序取NPCID
+            gameFB.SetGameFBDict(BZZD_LastNPCID, npcID)
+        else:
+            npcID = gameFB.GetGameFBDictByKey(BZZD_LastNPCID)
+            GameWorld.DebugLog("怪全部刷完了,使用最后一次刷怪的NPCID=%s" % npcID)
+            
+        if not npcID:
             break
         
-    NPCCustomRefresh.ProcessAllNPCRefresh(tick) # 立即出发一次标识点刷新            
+        isRefresh = True
+        NPCCustomRefresh.SetNPCRefresh(rMark, [npcID])
+        
+    if isRefresh:
+        NPCCustomRefresh.ProcessAllNPCRefresh(tick) # 立即触发一次标识点刷新            
     return
 
 ## 副本进行中
@@ -344,6 +358,11 @@
     gameFB = GameWorld.GetGameFB()
     if gameFB.GetFBStep() != FB_Step_Fighting:
         return False
+    
+    if gameFB.GetGameFBDictByKey(BZZD_IsKillAll):
+        #GameWorld.DebugLog("击杀怪物数已达到最大,无法再攻击!")
+        return False
+    
     return True
 
 
@@ -352,9 +371,14 @@
     if not curPlayer:
         return 0
     
+    gameFB = GameWorld.GetGameFB()
+    isKillAll = gameFB.GetGameFBDictByKey(BZZD_IsKillAll)
+    if isKillAll:
+        GameWorld.DebugLog("已经杀到指定怪物数了,无法再获得经验! isKillAll=%s" % isKillAll)
+        return 0
+    
     npcID = curNPC.GetNPCID()
     playerID = curPlayer.GetPlayerID()
-    gameFB = GameWorld.GetGameFB()
     reExp = PlayerControl.GetPlayerReExp(curPlayer)
     baseExp = curNPC.GetExp()
     expMulti = IpyGameDataPY.GetFuncCfg("XjmjMonsterExp", 2)
@@ -367,6 +391,12 @@
     killNPCCnt = gameFB.GetPlayerGameFBDictByKey(playerID, FBPlayerDict_KillCnt) + 1
     gameFB.SetPlayerGameFBDict(playerID, FBPlayerDict_KillCnt, killNPCCnt)
     DoFBHelp(curPlayer, GameWorld.GetGameWorld().GetTick())
+    
+    totalNPCCount = gameFB.GetGameFBDictByKey(BZZD_TotalNPCCount)
+    if killNPCCnt >= totalNPCCount:
+        gameFB.SetGameFBDict(BZZD_IsKillAll, killNPCCnt)
+        GameWorld.DebugLog("怪物已击杀到指定数量: killNPCCnt=%s,totalNPCCount=%s" % (killNPCCnt, totalNPCCount))
+        
     return addExp
 
 ## 获得经验
@@ -377,6 +407,11 @@
     
     playerID = curPlayer.GetID() 
     gameFB = GameWorld.GetGameFB()
+    
+    if gameFB.GetFBStep() != FB_Step_Fighting:
+        #GameWorld.DebugLog("非战斗阶段,不处理! addExp=%s" % addExp)
+        return
+    
     exp = gameFB.GetPlayerGameFBDictByKey(playerID, FBPlayerDict_TotalExp)
     expPoint = gameFB.GetPlayerGameFBDictByKey(playerID, FBPlayerDict_TotalExpPoint)
     totalExp = expPoint * ChConfig.Def_PerPointValue + exp
@@ -388,9 +423,7 @@
     
     #GameWorld.DebugLog("OnGetExp() totalExp=%s,addExp=%s,updTotalExp=%s" % (totalExp, addExp, updTotalExp), playerID)
     
-    killNPCCnt = gameFB.GetPlayerGameFBDictByKey(playerID, FBPlayerDict_KillCnt)
-    totalNPCCount = gameFB.GetGameFBDictByKey(BZZD_TotalNPCCount)
-    if killNPCCnt >= totalNPCCount:
+    if gameFB.GetGameFBDictByKey(BZZD_IsKillAll):
         GameWorld.DebugLog("怪物已全部杀完,结算副本!")
         __DoBZZDOver()
     return
@@ -435,8 +468,8 @@
         totalExpRecord = expPointRecord * ChConfig.Def_PerPointValue + expRecord
         upPer = 0 #提升比例
         if totalExp > totalExpRecord:#超过旧记录
-            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_BZZD_TotalFightExp, exp)
-            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_BZZD_TotalFightExpPoint, expPoint)
+            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_BZZD_TotalFightExp, totalExp % ChConfig.Def_PerPointValue)
+            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_BZZD_TotalFightExpPoint, totalExp / ChConfig.Def_PerPointValue)
             upPer = (totalExp - totalExpRecord) * 100 / totalExpRecord if totalExpRecord else 0
             #单场总经验成就
             PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_XJMJGetExp, 1, [expPoint])
@@ -445,7 +478,9 @@
         
         # 通知结果
         enterLV = gameFB.GetPlayerGameFBDictByKey(playerID, FBPlayerDict_EnterLV)
-        overDict = {FBCommon.Over_enterLV:enterLV, FBCommon.Over_exp:exp, FBCommon.Over_expPoint:expPoint, 'gradeExp':gradeExp,
+        overDict = {FBCommon.Over_enterLV:enterLV, FBCommon.Over_exp:totalExp % ChConfig.Def_PerPointValue, 
+                    FBCommon.Over_expPoint: totalExp / ChConfig.Def_PerPointValue, 
+                    'gradeExp':gradeExp % ChConfig.Def_PerPointValue, 'gradeExpPoint':gradeExp / ChConfig.Def_PerPointValue,
                     FBCommon.Over_costTime:costTime, FBCommon.Over_npcTotal:killNPCCnt, 'upPer':upPer, FBCommon.Over_grade:grade}
         __SendBZZDOverInfo(curPlayer, overDict)
         

--
Gitblit v1.8.0