From afd62bf31c3c3dc8d6226a581fe1d48adaecad0b Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期三, 10 十月 2018 15:25:33 +0800
Subject: [PATCH] 2084 【BUG】【主干】【1.0.18】采集扣血问题

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerMissionCollect.py                    |    4 +-
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBLogic.py                         |   16 +++++++-
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyWar.py   |    2 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ManorWar.py    |    2 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyParty.py |    2 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py                                  |    2 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Dogz.py        |   41 ++++++++++++++++----
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MergeBoss.py   |    2 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerState.py                             |    2 
 9 files changed, 55 insertions(+), 18 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBLogic.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBLogic.py
index ac35418..31ad5c9 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBLogic.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBLogic.py
@@ -862,6 +862,18 @@
     callFunc(tick)
     return
 
+## 开始采集
+#  @param curPlayer 当前玩家
+#  @param curNPC 当前NPC
+#  @return None or False
+#  @remarks 函数详细说明.
+def OnBeginCollect(curPlayer, curNPC):
+    do_FBLogic_ID = __GetFBLogic_MapID(GameWorld.GetMap().GetMapID())
+    callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnBeginCollect"))
+    if callFunc:
+        callFunc(curPlayer, curNPC)
+    return
+
 ## 收集中(家族战副本中的棋和塔)
 #  @param curPlayer 当前玩家
 #  @param tick 当前时间
@@ -879,7 +891,7 @@
 #  @param tick 当前时间
 #  @return None or False
 #  @remarks 函数详细说明.
-def OnCollectOK(curPlayer, tick):
+def OnCollectOK(curPlayer, npcID, tick):
     do_FBLogic_ID = __GetFBLogic_MapID(GameWorld.GetMap().GetMapID())
     
     callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnCollectOK"))
@@ -889,7 +901,7 @@
         return False
     
     #执行副本逻辑
-    callFunc(curPlayer, tick)
+    callFunc(curPlayer, npcID, tick)
     return
 
 ## 玩家离开副本
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Dogz.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Dogz.py
index 3fd128b..0afc7a7 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Dogz.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Dogz.py
@@ -42,8 +42,8 @@
 Map_Dogzfb_NextNeedTime = "NextNeedTime%s"  # 下次刷新需要时间 参数npcid
 Map_Dogzfb_LastCheckTick = "LastCheckTick"  # 上次检查时间
 Map_Dogzfb_NPCRemainCnt = 'NPCRemainCnt_%s'   # NPC剩余数量
-Map_Dogzfb_CollectLostHPTick = 'CollectLostHPTick'   # 采集掉线Tick
-
+Map_Dogzfb_CollectLostHPTick = 'CollectLostHPTick'   # 采集掉血Tick
+Map_Dogzfb_CollectLostHPCnt = 'CollectLostHPCnt'   # 采集掉血次数
 
 ## 是否能够通过活动查询进入
 #  @param curPlayer 玩家实例
@@ -106,6 +106,19 @@
     
     return
 
+## 开始采集
+#  @param curPlayer 当前玩家
+#  @param curNPC 当前NPC
+#  @return None or False
+#  @remarks 函数详细说明.
+def OnBeginCollect(curPlayer, curNPC):
+    playerID = curPlayer.GetID()
+    tick = GameWorld.GetGameWorld().GetTick()
+    gameFB = GameWorld.GetGameFB()
+    gameFB.SetPlayerGameFBDict(playerID, Map_Dogzfb_CollectLostHPTick, tick)
+    gameFB.SetPlayerGameFBDict(playerID, Map_Dogzfb_CollectLostHPCnt, 0)
+    return
+
 ## 收集中
 def OnCollecting(curPlayer, tick):
     tagObj = curPlayer.GetActionObj()
@@ -116,19 +129,23 @@
     
     curNPC = GameWorld.GetNPCManager().GetNPCByIndex(tagObj.GetIndex())
     npcID = curNPC.GetNPCID()
+    __DoCollectLostHP(curPlayer, npcID, tick)
+    return
+
+def __DoCollectLostHP(curPlayer, npcID, tick):
+    
+    
     playerID = curPlayer.GetID()
     gameFB = GameWorld.GetGameFB()
     collectLostHPTick = gameFB.GetPlayerGameFBDictByKey(playerID, Map_Dogzfb_CollectLostHPTick)
-
+    lostHPCnt = gameFB.GetPlayerGameFBDictByKey(playerID, Map_Dogzfb_CollectLostHPCnt)
+    
     lostCD = IpyGameDataPY.GetFuncEvalCfg('DogzFBCollect', 1, {}).get(npcID, 1)
-    lostTime = (tick - collectLostHPTick) / 1000/lostCD # 掉血次数
-    if lostTime >2:
-        gameFB.SetPlayerGameFBDict(playerID, Map_Dogzfb_CollectLostHPTick, tick)
-        return
+    lostTime = (tick - collectLostHPTick) / (1000*lostCD)-lostHPCnt
     
     if not lostTime:
         return
-    gameFB.SetPlayerGameFBDict(playerID, Map_Dogzfb_CollectLostHPTick, tick)
+    gameFB.SetPlayerGameFBDict(playerID, Map_Dogzfb_CollectLostHPCnt, lostHPCnt+lostTime)
         
    
     lostHPPer = IpyGameDataPY.GetFuncEvalCfg('DogzFBCollect', 2, {}).get(npcID, 1)
@@ -140,6 +157,14 @@
     SkillCommon.SkillLostHP(curPlayer, skillTypeID, buffOwner, lostValue, tick)
     return
 
+##玩家收集成功(塔, 旗)
+# @param curPlayer 玩家实例
+# @param tick 时间戳
+# @return 无意义
+# @remarks
+def OnCollectOK(curPlayer, npcID, tick):
+    __DoCollectLostHP(curPlayer, npcID, tick)
+    return
 
 ##---副本总逻辑计时器---
 # @param tick:时间戳
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyParty.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyParty.py
index 289e5ff..546dc2e 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyParty.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyParty.py
@@ -375,7 +375,7 @@
 # @param tick 时间戳
 # @return 无意义
 # @remarks
-def OnCollectOK(curPlayer, tick):
+def OnCollectOK(curPlayer, npcID, tick):
     playerID = curPlayer.GetID()
     gameWorld = GameWorld.GetGameWorld()
     gameWorld.SetGameWorldDict(FBPlayerDict_HasCollect % playerID, 1)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyWar.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyWar.py
index 575f811..793c116 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyWar.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyWar.py
@@ -1268,7 +1268,7 @@
 # @param tick 时间戳
 # @return 无意义
 # @remarks
-def OnCollectOK(curPlayer, tick):
+def OnCollectOK(curPlayer, npcID, tick):
     tagObj = curPlayer.GetActionObj()
     if not tagObj:
         return
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ManorWar.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ManorWar.py
index 9f59aa9..1b2a8d0 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ManorWar.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ManorWar.py
@@ -714,7 +714,7 @@
 # @param tick 时间戳
 # @return 无意义
 # @remarks
-def OnCollectOK(curPlayer, tick):
+def OnCollectOK(curPlayer, npcID, tick):
     global g_getFlagFamilyName
 
     if not IsManorWarMap(curPlayer):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MergeBoss.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MergeBoss.py
index 5e4ced9..bab5052 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MergeBoss.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MergeBoss.py
@@ -1219,7 +1219,7 @@
 # @param tick 时间戳
 # @return 无意义
 # @remarks
-def OnCollectOK(curPlayer, tick):
+def OnCollectOK(curPlayer, npcID, tick):
     global g_buffOwnerNPCDict
     global g_bossBuffCntDict
     
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
index cd703bd..0d7b24c 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
@@ -5140,7 +5140,7 @@
 
     PlayerControl.Sync_PrepareBegin(curPlayer, prepareTime, IPY_GameWorld.pstMissionCollecting, \
                                     prepareID=curNPC.GetID())
-    
+    FBLogic.OnBeginCollect(curPlayer, curNPC)
     ##添加这个NPC的伤血列表,用于判断可否同时采集,改为字典判断
     AttackCommon.AddHurtValue(curNPC, curPlayer.GetPlayerID(), ChConfig.Def_NPCHurtTypePlayer, 1)
     return
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerMissionCollect.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerMissionCollect.py
index acc0153..c005eb0 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerMissionCollect.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerMissionCollect.py
@@ -29,7 +29,7 @@
 import PlayerControl
 import OperControlManager
 import NPCCommon
-import PlayerPrestigeSys
+import FBLogic
 import AttackCommon
 import GameObj
 #---------------------------------------------------------------------
@@ -145,7 +145,7 @@
     # 自定义的采集NPC
     if NPCCommon.DoCollectNPCOK(curPlayer, npcID):
         EventShell.EventRespons_MisCollectSuccess(curPlayer, curNPC) # 先直接写这边触发一下,自定义采集的不再处理后面的代码
-        
+        FBLogic.OnCollectOK(curPlayer, npcID, GameWorld.GetGameWorld().GetTick())
         return
     
     EventShell.EventRespons_MisCollectSuccess(curPlayer, curNPC)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerState.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerState.py
index f82909c..9912a3e 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerState.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerState.py
@@ -627,7 +627,7 @@
     if not result:
         return
     
-    FBLogic.OnCollectOK(curPlayer, tick)
+    FBLogic.OnCollectOK(curPlayer, curNPC.GetNPCID(), tick)
     return
 
 #---------------------------------------------------------------------

--
Gitblit v1.8.0