From 07a5b93ce90a08c7d60cecc7c61b984ca0b2ea97 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 12 十二月 2019 16:37:17 +0800
Subject: [PATCH] 8346 【恺英】【后端】协助系统(封魔坛支持协助,去除封魔坛旧版伤血统计)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCHurtManager.py |   34 +++++++++++++++++++++++++++++-----
 1 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCHurtManager.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCHurtManager.py
index 2af4573..7ceffe5 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCHurtManager.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCHurtManager.py
@@ -741,6 +741,7 @@
             return
         self.__assistAwardItemID = liheItemID
         
+        fbType = GameWorld.GetMap().GetMapFBTypeByMapID(mapID)
         friendAddAssistMoneyPer = IpyGameDataPY.GetFuncCfg("AssistAward", 3)
         GameWorld.DebugLog("执行协助奖励逻辑", self.npcID, self.lineID)
         copyPlayerManager = GameWorld.GetMapCopyPlayerManager()
@@ -768,8 +769,14 @@
                     addAssistMoney += int(assistMoney * friendAddAssistMoneyPer / 100.0)
                 GameWorld.DebugLog("协助方给活跃令奖励: assistPlayerID=%s,assistMoney=%s,isFriend=%s,addAssistMoney=%s" 
                                    % (assistPlayerID, assistMoney, isFriend, addAssistMoney), self.npcID, self.lineID)
-                PlayerControl.GiveMoney(assistPlayer, ShareDefine.TYPE_Price_XianyuanCoin, addAssistMoney) # 给活跃令无视发布方是否在线
-                
+                PlayerControl.GiveMoney(assistPlayer, ShareDefine.TYPE_Price_FamilyActivity, addAssistMoney) # 给活跃令无视发布方是否在线
+                if fbType == IPY_GameWorld.fbtNull:
+                    PlayerControl.NotifyCode(assistPlayer, "AssistSuccess")
+                else:
+                    overDict = {FBCommon.Over_isAssist:1, FBCommon.Over_money:FBCommon.GetJsonMoneyList({ShareDefine.TYPE_Price_FamilyActivity:addAssistMoney}),
+                                FBCommon.Over_itemInfo:[]}
+                    FBCommon.NotifyFBOver(assistPlayer, mapID, PlayerControl.GetFBFuncLineID(assistPlayer), 1, overDict)
+                    
                 if noAssistPlayer:
                     todayGiftCount = assistPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GetThanksGiftCount % liheItemID)
                     assistAwardPlayerDict[assistPlayerID] = {"PlayerName":assistPlayer.GetPlayerName(), "Job":assistPlayer.GetJob(), 
@@ -934,10 +941,12 @@
     if key not in PyGameData.g_npcHurtDict:
         ## 只统计最大伤血归属的boss
         npcData = GameWorld.GetGameData().FindNPCDataByID(npcID)
-        if not npcData:
+        if not npcData or not ChConfig.IsGameBoss(npcData):
             return defendHurtList
-        if not npcData.GetIsBoss() or NPCCommon.GetDropOwnerType(npcData) != ChConfig.DropOwnerType_MaxHurt:
-            return defendHurtList
+        if NPCCommon.GetDropOwnerType(npcData) != ChConfig.DropOwnerType_MaxHurt:
+            mapID = GameWorld.GetMap().GetMapID()
+            if mapID not in [ChConfig.Def_FBMapID_SealDemon]:
+                return defendHurtList
         defendHurtList = PlayerHurtList(lineID, objID, npcID)
         PyGameData.g_npcHurtDict[key] = defendHurtList
     defendHurtList = PyGameData.g_npcHurtDict[key]
@@ -997,3 +1006,18 @@
         return False
     return defendHurtList.IsAssistPlayer(playerID)
 
+def CheckPlayerCanAttackFBNPC(curPlayer, curNPC, mapID, isNotify=False):
+    ## 检查玩家可否攻击有副本次数的NPC
+    enterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_EnterFbCntDay % mapID)
+    if enterCnt < FBCommon.GetEnterFBMaxCnt(curPlayer, mapID):
+        return True
+    
+    # 没有次数的,如果是助战玩家也可攻击
+    if IsAssistPlayer(curPlayer.GetPlayerID(), curNPC):
+        return True
+    
+    if isNotify:
+        PlayerControl.NotifyCode(curPlayer, "AttackFBBossLimit")
+        
+    return False
+

--
Gitblit v1.8.0