From a8e385260c4fc557bc23a9d9185c2f14ef140a36 Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期五, 22 二月 2019 10:45:25 +0800
Subject: [PATCH] 3023 【1.6】【2.0】七日巡礼道具使用加个提示

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCustomRefresh.py |   97 ++++++++++--------------------------------------
 1 files changed, 20 insertions(+), 77 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCustomRefresh.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCustomRefresh.py
index a86f294..2493ede 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCustomRefresh.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCustomRefresh.py
@@ -17,6 +17,7 @@
 import ShareDefine
 import ReadChConfig
 import GameLogic_SealDemon
+import GameLogic_ZhuXianBoss
 import PlayerControl
 import IPY_GameWorld
 import IpyGameDataPY
@@ -91,72 +92,6 @@
         
     return
 ##------------------------------------------------------------------------------
-
-## 合服活动BOSS(勇者大陆)
-#  @param npcRefresh 刷新的npc对象
-#  @param tick 当前时间
-#  @return None
-def NPCRefresh_63(npcRefresh, tick): return __RefreshMixBoss(npcRefresh, tick)
-def NPCRefresh_64(npcRefresh, tick): return __RefreshMixBoss(npcRefresh, tick)
-def NPCRefresh_65(npcRefresh, tick): return __RefreshMixBoss(npcRefresh, tick)
-
-## 合服活动BOSS(勇者大陆)
-#  @param npcRefresh 刷新的npc对象
-#  @param tick 当前时间
-#  @return None
-def __RefreshMixBoss(npcRefresh, tick):
-    gameWorld = GameWorld.GetGameWorld()
-    isMixServer = gameWorld.GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_IsMixServer)
-    mixDay = gameWorld.GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_MixServerDay)
-    refreshMark = npcRefresh.GetRefreshMark()
-    
-    # 配置
-    mixBossInfo = ReadChConfig.GetEvalChConfig("MixBossInfo")
-    curBossInfo = mixBossInfo.get(refreshMark)
-    if not curBossInfo:
-        #GameWorld.DebugLog("__RefreshMixBoss() hasn't configuration refreshMark(%s)"%refreshMark)
-        return
-    npcId, mixTime, refreshTimeList = curBossInfo
-    
-    # 合服期间
-    if not isMixServer or mixDay < mixTime[0] or mixDay > mixTime[1]:
-        #GameWorld.DebugLog("__RefreshMixBoss() no mix server")
-        return
-    
-    # 一线刷新
-    lineId = GameWorld.GetGameWorld().GetLineID()
-    if lineId != 0:
-        #GameWorld.DebugLog("__RefreshMixBoss() not in 1 line(%s), now"%lineId)
-        return
-    
-    # 有怪
-    if npcRefresh.GetCount() > 0:
-        #GameWorld.DebugLog("__RefreshMixBoss() have mix server boss(%s), now"%refreshMark)
-        return
-    
-    # 刷新时间匹配
-    curTime = GameWorld.GetCurrentTime()
-    if (curTime.hour, curTime.minute) not in refreshTimeList:
-        #GameWorld.DebugLog("__RefreshMixBoss() npcId(%s) isn't refresh(%s) time(%s)"
-        #                   % (npcId, str((curTime.hour, curTime.minute)), refreshTimeList))
-        return
-    
-    # 刷新Tick 一分钟内不再刷新
-    refreshTickKey = ChConfig.Map_NPC_WorldBossLastReBornTick % npcId
-    lastRefreshTick = gameWorld.GetGameWorldDictByKey(refreshTickKey)
-    if tick - lastRefreshTick <= 60 * 1000:
-        #GameWorld.DebugLog("__RefreshMixBoss() not refresh inside minute, npcID(%s) tick(%s) lastTick(%s)"
-        #                   % (npcId, tick, lastRefreshTick))
-        return
-    gameWorld.SetGameWorldDict(refreshTickKey, tick)
-    
-    # 刷新NPC
-    npcRefresh.Refresh(npcId, ChConfig.Def_SuperBossAngryCount, 1, False)
-    # 初始化NPC
-    __InitNewBornNPC(npcRefresh, tick)
-    
-    GameWorld.DebugLog("__RefreshMixBoss() refresh mix server boss npcId(%s) success!!!" % (npcId))
-    return
 
 ## 地图M个点随机刷N只怪
 #  @param npcRefresh 刷新实例
@@ -401,6 +336,9 @@
     if mapID == ChConfig.Def_FBMapID_SealDemon:
         bossID = GameLogic_SealDemon.CurFBLineBOSSID()
         stoneNPCID = 0
+    elif mapID == ChConfig.Def_FBMapID_ZhuXianBoss:
+        bossID = GameLogic_ZhuXianBoss.CurFBLineBOSSID()
+        stoneNPCID = 0
     else:
         ipyData = IpyGameDataPY.GetIpyGameDataByCondition('BOSSInfo', {'RefreshMark':refreshMark, 'MapID':mapID}, isLogNone=False)
         if not ipyData:
@@ -412,7 +350,6 @@
         isNeedShunt = ipyData.GetIsNeedShunt()
     if not bossID and not stoneNPCID:
         return
-    
     gameFB = GameWorld.GetGameFB()
     gameWorldMgr = GameWorld.GetGameWorld()
     isActivityBoss = False # 是否活动boss
@@ -463,7 +400,7 @@
             NPCCommon.SetDeadEx(curNPC)
             
         # 非复活线 且 不需要分流的地图 且 不是封魔坛  不允许复活
-        if lineID != rebornLineID and not isNeedShunt and mapID != ChConfig.Def_FBMapID_SealDemon:
+        if lineID != rebornLineID and not isNeedShunt and mapID not in [ChConfig.Def_FBMapID_SealDemon, ChConfig.Def_FBMapID_ZhuXianBoss]:
             return
         
         if isActivityBoss and activityBossRebornCount > 0:
@@ -553,9 +490,9 @@
     if not bossID and not stoneNPCID:
         return
     
-    if mapID not in ChConfig.Def_CrossZoneTableName:
+    if mapID not in ChConfig.Def_CrossZoneMapTableName:
         return
-    tableName = ChConfig.Def_CrossZoneTableName[mapID]
+    tableName = ChConfig.Def_CrossZoneMapTableName[mapID]
     realMapID = GameWorld.GetGameWorld().GetRealMapID()
     copyMapID = GameWorld.GetGameWorld().GetCopyMapID()
     zoneIpyData = IpyGameDataPY.GetIpyGameDataNotLog(tableName, realMapID, mapID, copyMapID)
@@ -905,7 +842,7 @@
             注意:同个虚拟线路中,标试点不可重复!标试点不可重复!标试点不可重复!
     '''
     mapID = gameWorld.GetMapID()
-    # {mapID:{编号:[[多个NPCID], [多个标试点], 单个点最大数量, 所有点总数量, 刷怪间隔秒], ...}, ...}
+    # {mapID:{编号:[[多个NPCID], [多个标试点], 单个点最大数量, 所有点总数量, 刷怪间隔秒, 每整X小时], ...}, ...}
     randRefreshNPCDict = IpyGameDataPY.GetFuncEvalCfg("RandomRefreshNPC", 1, {})
     if mapID not in randRefreshNPCDict:
         return
@@ -919,14 +856,20 @@
         return
     gameFB.SetGameFBDict(ChConfig.Def_RMark_RandomRefreshNPCTick, tick)
     
-    curTime = int(time.time())
+    serverTime = GameWorld.GetCurrentTime()
+    curHour, curMinute = serverTime.hour, serverTime.minute
     refreshNumList = []
     for num, refreshInfo in mapRandRefreshNPCDict.items():
-        refreshCD = refreshInfo[-1]
-        numLastTime = gameFB.GetGameFBDictByKey(ChConfig.Def_RMark_RandomRefreshNPCNumTime % num)
-        if numLastTime and curTime - numLastTime < refreshCD:
+        refreshCD = refreshInfo[4]
+        numLastTick = gameFB.GetGameFBDictByKey(ChConfig.Def_RMark_RandomRefreshNPCNumTime % num)
+        perHours = refreshInfo[5]
+        if numLastTick and perHours:
+            if curHour % perHours != 0 or curMinute != 0:
+                continue
+            refreshCD = 65 # 1分钟内不重复刷新
+        if numLastTick and tick - numLastTick < refreshCD * 1000:
             continue
-        gameFB.SetGameFBDict(ChConfig.Def_RMark_RandomRefreshNPCNumTime % num, curTime)
+        gameFB.SetGameFBDict(ChConfig.Def_RMark_RandomRefreshNPCNumTime % num, tick)
         refreshNumList.append(num)
         
     if not refreshNumList:
@@ -946,7 +889,7 @@
         
     #GameWorld.DebugLog("npcCountDict=%s" % npcCountDict, copyMapID)
     for num in refreshNumList:
-        npcIDList, markList, maxCount, totalMaxCount = mapRandRefreshNPCDict[num][:-1]
+        npcIDList, markList, maxCount, totalMaxCount = mapRandRefreshNPCDict[num][:4]
         
         curTotalCount = 0
         for rMark in markList:

--
Gitblit v1.8.0