| | |
| | | import ShareDefine
|
| | | import ReadChConfig
|
| | | import GameLogic_SealDemon
|
| | | import CrossRealmPlayer
|
| | | import PlayerControl
|
| | | import IPY_GameWorld
|
| | | import IpyGameDataPY
|
| | |
| | | '''非分流地图boss只在一线刷
|
| | | 分流地图boss每条线都刷新,其他分流线路boss在没人打的情况下同生同死
|
| | | '''
|
| | | if GameWorld.IsCrossServer():
|
| | | __DoRefreshWorldBossCrossServer(npcRefresh, tick)
|
| | | return
|
| | | mapID = GameWorld.GetMap().GetMapID()
|
| | | refreshMark = npcRefresh.GetRefreshMark()
|
| | | lineID = GameWorld.GetGameWorld().GetLineID()
|
| | |
| | |
|
| | | #===================================================================================================
|
| | |
|
| | | def __DoRefreshWorldBossCrossServer(npcRefresh, tick):
|
| | | ## 跨服服务器刷boss
|
| | | |
| | | mapID = GameWorld.GetGameWorld().GetMapID() # dataMapID
|
| | | if mapID not in ChConfig.Def_CrossMapIDList:
|
| | | return
|
| | | |
| | | refreshMark = npcRefresh.GetRefreshMark()
|
| | | lineID = GameWorld.GetGameWorld().GetLineID()
|
| | | bossIpyData = IpyGameDataPY.GetIpyGameDataByCondition('BOSSInfo', {'RefreshMark':refreshMark, 'MapID':mapID}, isLogNone=False)
|
| | | if not bossIpyData:
|
| | | return
|
| | | |
| | | stoneNPCID = bossIpyData.GetStoneNPCID()
|
| | | bossID = bossIpyData.GetNPCID()
|
| | | if not bossID and not stoneNPCID:
|
| | | return
|
| | | |
| | | if mapID not in ChConfig.Def_CrossZoneTableName:
|
| | | return
|
| | | tableName = ChConfig.Def_CrossZoneTableName[mapID]
|
| | | realMapID = GameWorld.GetGameWorld().GetRealMapID()
|
| | | copyMapID = GameWorld.GetGameWorld().GetCopyMapID()
|
| | | zoneIpyData = IpyGameDataPY.GetIpyGameDataNotLog(tableName, realMapID, mapID, copyMapID)
|
| | | if not zoneIpyData:
|
| | | return
|
| | | zoneID = zoneIpyData.GetZoneID()
|
| | | |
| | | gameFB = GameWorld.GetGameFB()
|
| | | bosskey = ShareDefine.Def_Notify_WorldKey_GameWorldBossRebornCross % (zoneID, bossID)
|
| | | rebornBossState = GameWorld.GetGameWorld().GetGameWorldDictByKey(bosskey)
|
| | | curNPC = None
|
| | | if npcRefresh.GetCount() > 0:
|
| | | curNPC = npcRefresh.GetAt(0)
|
| | | |
| | | # 复活状态
|
| | | if rebornBossState:
|
| | | if curNPC:
|
| | | if curNPC.GetNPCID() == bossID:
|
| | | return
|
| | | #去掉非bossNPC
|
| | | NPCCommon.SetDeadEx(curNPC)
|
| | | |
| | | # 死亡状态
|
| | | else:
|
| | | if curNPC:
|
| | | if curNPC.GetNPCID() == stoneNPCID:
|
| | | return
|
| | | #去掉非墓碑NPC
|
| | | NPCCommon.SetDeadEx(curNPC)
|
| | | |
| | | # 延迟刷墓碑
|
| | | bossDeadTick = gameFB.GetGameFBDictByKey(ChConfig.Map_NPC_WorldBossDeadTick % bossID)
|
| | | bossStoneDelayTime = IpyGameDataPY.GetFuncCfg('BossStoneDelayTime')
|
| | | if tick - bossDeadTick <= bossStoneDelayTime:
|
| | | return
|
| | | gameFB.SetGameFBDict(ChConfig.Map_NPC_WorldBossDeadTick % bossID, tick)
|
| | | |
| | | rebornNPCID = bossID if rebornBossState else stoneNPCID
|
| | | if not rebornNPCID:
|
| | | return
|
| | | rebornTickKey = ChConfig.Map_NPC_WorldBossLastReBornTick % rebornNPCID
|
| | | lastRebornTick = gameFB.GetGameFBDictByKey(rebornTickKey)
|
| | | if tick - lastRebornTick <= 50 * 1000:
|
| | | GameWorld.DebugLog("CrossBossRefresh mapID=%s,realMapID=%s,copyMapID=%s,refreshMark=%s,rebornNPCID=%s,tick=%s,lastRebornTick=%s 不重复刷新!" |
| | | % (mapID, realMapID, copyMapID, refreshMark, rebornNPCID, tick, lastRebornTick))
|
| | | return
|
| | | |
| | | npcRefresh.Refresh(rebornNPCID, ChConfig.Def_SuperBossAngryCount, 1, False)
|
| | | #初始化NPC
|
| | | __InitNewBornNPC(npcRefresh, tick)
|
| | | gameFB.SetGameFBDict(rebornTickKey, tick)
|
| | | |
| | | GameWorld.DebugLog("CrossBossRefresh mapID=%s,realMapID=%s,copyMapID=%s,refreshMark=%s,rebornNPCID=%s,OK!" |
| | | % (mapID, realMapID, copyMapID, refreshMark, rebornNPCID), lineID)
|
| | | return
|
| | |
|
| | | ################################ 通用刷怪逻辑 ####################################
|
| | | def GetNPCRefreshCountList(refreshID):
|
| | | ## 获取刷怪标识点规则ID需要刷新的NPC个数信息;
|