From 3ddd283d8d8fc305e340c496a5993c3aa0356c17 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期六, 22 九月 2018 01:05:36 +0800
Subject: [PATCH] 3798 还原(修复活动日期相连时如果都配置了提前显示时间不会取最近的活动时间bug)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Dogz.py |   39 ++++++++++++++++++++++-----------------
 1 files changed, 22 insertions(+), 17 deletions(-)

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 f7fa69a..bea625d 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
@@ -27,15 +27,16 @@
 import ChConfig
 
 
-#{(标识点):[npcid,单个点数量,刷新间隔秒, 每次刷新只数, 第一次刷新只数]}
-#{(101,102,103):[20302001,1,'20', 2, 10]}
+#{(标识点):[npcid,单个点数量,刷新间隔秒, 每次刷新只数, 第一次刷新只数, 总个数上限]}
+#{(101,102,103):[20302001,1,'20', 2, 10,30]}
 (
 Def_NPCID,
 Def_MaxCnt,
 Def_TimeFormula,
 Def_RefreshCnt,
-Def_FirstRefreshCnt
-) = range(5)
+Def_FirstRefreshCnt,
+Def_TotalLimit,
+) = range(6)
 
 Map_Dogzfb_LastRefreshTime = "Dogzfb_LastRefreshTime%s"  # 刷新时间 参数npcid
 Map_Dogzfb_NextNeedTime = "NextNeedTime%s"  # 下次刷新需要时间 参数npcid
@@ -105,7 +106,6 @@
     
     return
 
-
 ## 收集中
 def OnCollecting(curPlayer, tick):
     tagObj = curPlayer.GetActionObj()
@@ -122,13 +122,13 @@
 
     lostCD = IpyGameDataPY.GetFuncEvalCfg('DogzFBCollect', 1, {}).get(npcID, 1)
     lostTime = (tick - collectLostHPTick) / 1000/lostCD # 掉血次数
-    if lostTime >3:
+    if lostTime >2:
         gameFB.SetPlayerGameFBDict(playerID, Map_Dogzfb_CollectLostHPTick, tick)
         return
     
     if not lostTime:
         return
-    gameFB.SetGameFBDict(Map_Dogzfb_CollectLostHPTick, tick)
+    gameFB.SetPlayerGameFBDict(playerID, Map_Dogzfb_CollectLostHPTick, tick)
         
    
     lostHPPer = IpyGameDataPY.GetFuncEvalCfg('DogzFBCollect', 2, {}).get(npcID, 1)
@@ -136,7 +136,7 @@
     lostValue = min(int(GameObj.GetMaxHP(curPlayer) * lostHPPer / 100.0) * lostTime, GameObj.GetHP(curPlayer)-1)
     if lostValue <=0:
         return
-    #GameWorld.DebugLog("OnCollecting npcID=%s, lostHPPer=%s,lostTime=%s,lostValue=%s" % (npcID, lostHPPer, lostTime, lostValue))
+    GameWorld.DebugLog("OnCollecting npcID=%s, lostHPPer=%s,lostTime=%s,lostValue=%s" % (npcID, lostHPPer, lostTime, lostValue))
     SkillCommon.SkillLostHP(curPlayer, skillTypeID, buffOwner, lostValue, tick)
     return
 
@@ -191,16 +191,21 @@
         gameWorld.SetGameWorldDict(Map_Dogzfb_LastRefreshTime % npcID, curTime)
         maxCnt = refreshInfo[Def_MaxCnt]
         markList = [markInfo] if isinstance(markInfo, int) else list(markInfo)
-        random.shuffle(markList)
+        curTotalCnt = 0
         for rMark in markList:
-            if refreshCnt <=0:
-                break
-            curCnt = npcCntDict.get(rMark, 0)
-            if curCnt >= maxCnt:
-                continue
-            needRefreshCnt = min(refreshCnt, maxCnt - curCnt)
-            refreshCnt -= needRefreshCnt
-            NPCCustomRefresh.SetNPCRefresh(rMark, [(npcID, needRefreshCnt)], needRefreshCnt + curCnt, needRefreshCnt)
+            curTotalCnt += npcCntDict.get(rMark, 0)
+        refreshCnt = min(refreshCnt, refreshInfo[Def_TotalLimit] - curTotalCnt)
+        if refreshCnt > 0:
+            random.shuffle(markList)
+            for rMark in markList:
+                if refreshCnt <=0:
+                    break
+                curCnt = npcCntDict.get(rMark, 0)
+                if curCnt >= maxCnt:
+                    continue
+                needRefreshCnt = min(refreshCnt, maxCnt - curCnt)
+                refreshCnt -= needRefreshCnt
+                NPCCustomRefresh.SetNPCRefresh(rMark, [(npcID, needRefreshCnt)], needRefreshCnt + curCnt, needRefreshCnt)
         
         #计算下次多久刷新
         __UpdateBossTime(npcID, refreshInfo[Def_TimeFormula])

--
Gitblit v1.8.0