From 8fcbc76b6acb09d6a940e2ea374cceb270b4e4da Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期五, 19 四月 2019 14:13:05 +0800
Subject: [PATCH] 6374 开功能命令报错修复

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ChaosDemon.py |   30 ++++++++++++++++++++++--------
 1 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ChaosDemon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ChaosDemon.py
index fd1ba49..12cf089 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ChaosDemon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ChaosDemon.py
@@ -30,7 +30,9 @@
 import ShareDefine
 import ItemCommon
 import PlayerSuccess
+import FBHelpBattle
 import EventReport
+import PlayerWeekParty
 
 import math
 
@@ -161,7 +163,7 @@
         FBCommon.AddEnterFBCount(curPlayer, mapID, 1)
         joinType = FBCommon.GetFBJoinType(curPlayer, isHelpFight)
         EventReport.WriteEvent_FB(curPlayer, ChConfig.Def_FBMapID_ChaosDemon, 0, ChConfig.CME_Log_Start, joinType)
-       
+        PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_ChaosDemon, 1)
     
     fbStep = gameFB.GetFBStep()
     if fbStep <= FB_Step_Prepare:
@@ -174,7 +176,8 @@
         curPlayer.Sync_TimeTick(IPY_GameWorld.tttTowerTake, 0, max(notify_tick, 0), True)
         __UpdChaosDemonFBStar(tick, True, curPlayer)
         
-    DoFBHelp(curPlayer, tick)
+    FBHelpBattle.RefershTeamFBMemRelation(tick)
+    #DoFBHelp(curPlayer, tick)
     return
 
 ## 诅咒城堡刷怪
@@ -219,6 +222,9 @@
 # @return 返回值无意义
 def DoExitFB(curPlayer, tick):
     GameWorld.DebugLog("ChaosDemon DoExitFB...", curPlayer.GetPlayerID())
+    fbStep = GameWorld.GetGameFB().GetFBStep()
+    if fbStep <= FB_Step_Fight:
+        FBHelpBattle.RefershTeamFBMemRelation(tick, curPlayer.GetPlayerID())
     return
 
 ##玩家主动离开副本.
@@ -278,6 +284,7 @@
     # 间隔未到
     if tick - GameWorld.GetGameFB().GetFBStepTick() < fbCfg[Def_PrepareTime] * 1000:
         return
+    FBHelpBattle.RefershTeamFBMemRelation(tick)
     __RefreshChaosDemonNextNPC()
     playerManager = GameWorld.GetMapCopyPlayerManager()
     for i in range(playerManager.GetPlayerCount()):
@@ -350,9 +357,9 @@
             FBCommon.Notify_FB_Over(curPlayer, {FBCommon.Over_isPass: 0})
             continue
         overDict = {FBCommon.Over_grade:star,FBCommon.Over_dataMapID:mapID,FBCommon.Over_isPass:int(isPass), FBCommon.Over_costTime:costTime}
-        #增加助战积分
+        isHelp = False
         if FBCommon.GetIsHelpFight(curPlayer):
-            FBCommon.AddFBHelpPoint(curPlayer, mapID, 1)
+            isHelp = True
         else:
             #给奖励
             needSpace = len(prizeItemList)
@@ -363,7 +370,7 @@
                 GameWorld.DebugLog("背包空间不够,发送邮件: mailItemList=%s" % str(prizeItemList), curPlayer.GetPlayerID())
             else:
                 for itemID, itemCnt, isBind in prizeItemList:
-                    ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, isBind, [IPY_GameWorld.rptItem], event=["ChaosDemon", False, {}])
+                    ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, 0, [IPY_GameWorld.rptItem], event=["ChaosDemon", False, {}])
             
             reExp = PlayerControl.GetPlayerReExp(curPlayer)
             addExp = int(eval(giveExp) * rate/100)
@@ -374,7 +381,10 @@
             expPoint = addExp / ChConfig.Def_PerPointValue
             overDict[FBCommon.Over_exp] = exp
             overDict[FBCommon.Over_expPoint] = expPoint
-
+            
+        addXianyuanCoin, reason = FBHelpBattle.DoFBAddXianyuanCoin(curPlayer, mapID, 0, isHelp)
+        overDict[FBCommon.Over_xianyuanCoin] = [addXianyuanCoin, reason]
+        
         FBCommon.Notify_FB_Over(curPlayer, overDict)
         #成就
         PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_ChaosDemon, 1, [playerCount, star])
@@ -507,6 +517,7 @@
 # @return 无意义
 # @remarks 用于通知阵营比分条
 def DoFBHelp(curPlayer, tick):
+    playerID = curPlayer.GetPlayerID()
     gameFB = GameWorld.GetGameFB()
     star = gameFB.GetGameFBDictByKey(ChaosDemon_FBStar)
     wheelNum = gameFB.GetGameFBDictByKey(ChaosDemon_FBNextRefreshStep)
@@ -515,9 +526,12 @@
     KillNPCCnt = max(0, needKillCnt - remainNPCCnt)
     data = [KillNPCCnt, needKillCnt]
     lineID = FBCommon.GetFBPropertyMark()
-    fbHelpDict = {FBCommon.Help_step:wheelNum, FBCommon.Help_grade:star, FBCommon.Help_npcTotal:KillNPCCnt, FBCommon.Help_lineID:lineID}
-    
+    isHelp = FBCommon.GetIsHelpFight(curPlayer)
+    helpCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FBRealHelpCount % ChConfig.Def_FBMapID_ChaosDemon)
+    fbHelpDict = {FBCommon.Help_step:wheelNum, FBCommon.Help_grade:star, FBCommon.Help_npcTotal:KillNPCCnt, FBCommon.Help_lineID:lineID, 
+                  FBCommon.Help_isHelp:isHelp, FBCommon.Help_helpCount:helpCount, FBCommon.Help_relation:FBHelpBattle.GetTeamFBMemRelationInfo(playerID)}
     FBCommon.Notify_FBHelp(curPlayer, fbHelpDict)
+    GameWorld.DebugLog("DoFBHelp %s" % str(fbHelpDict), playerID)
     return
 
 

--
Gitblit v1.8.0