From 69ab786b26f7804908ff69764f566424042ac8a3 Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期二, 28 五月 2019 17:20:24 +0800
Subject: [PATCH] 6898 缥缈事件最大事件数量修改

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/AddFairyEvent.py |    3 +--
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFairyDomain.py  |   16 +++++++++-------
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/AddFairyEvent.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/AddFairyEvent.py
index ed59550..c3b75c3 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/AddFairyEvent.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/AddFairyEvent.py
@@ -38,8 +38,7 @@
         return
     fdEventIDList = msgList
     openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
-    otherCntRateList = IpyGameDataPY.GetFuncEvalCfg('ImmortalDomain', 2)
-    maxEventCnt = max([info[1] for info in otherCntRateList]) + 1  #最大可出现事件个数
+    maxEventCnt = PlayerFairyDomain.GetMaxEventCnt() #最大可出现事件个数
     for i in xrange(maxEventCnt):
         prefdEventID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyDomainEventID % i)
         if prefdEventID:
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFairyDomain.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFairyDomain.py
index e9a74cc..d3bc12b 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFairyDomain.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFairyDomain.py
@@ -114,7 +114,7 @@
     curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
     
     otherCntRateList = IpyGameDataPY.GetFuncEvalCfg('ImmortalDomain', 2)
-    maxEventCnt = max([info[1] for info in otherCntRateList]) + 1  #最大可出现事件个数
+    maxEventCnt = GetMaxEventCnt()  #最大可出现事件个数
     fairyDomainState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyDomainState)  #是否寻访中  0未寻访 1寻访中 2任务标记可寻访
     if clientData.Type == 1:  #结束寻访
         if fairyDomainState != 1:
@@ -231,8 +231,7 @@
     GameWorld.DebugLog("EndFairyDomain", curPlayer.GetID())
     ##结束寻访
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyDomainState, 0)
-    otherCntRateList = IpyGameDataPY.GetFuncEvalCfg('ImmortalDomain', 2)
-    maxEventCnt = max([info[1] for info in otherCntRateList]) + 1  #最大可出现事件个数
+    maxEventCnt = GetMaxEventCnt()  #最大可出现事件个数
     for i in xrange(maxEventCnt):
         fdEventID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyDomainEventID % i)
         if fdEventID:
@@ -347,8 +346,7 @@
 def NotifyVisitFairyDomainInfo(curPlayer, fdEventList=None, isAll=1):
     if not fdEventList:
         syncFDEventList = []
-        otherCntRateList = IpyGameDataPY.GetFuncEvalCfg('ImmortalDomain', 2)
-        maxEventCnt = max([info[1] for info in otherCntRateList]) + 1  #最大可出现事件个数
+        maxEventCnt = GetMaxEventCnt()  #最大可出现事件个数
         for i in xrange(maxEventCnt):
             fdEventID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyDomainEventID % i)
             if fdEventID:
@@ -371,6 +369,11 @@
     NetPackCommon.SendFakePack(curPlayer, packData)
     return
 
+def GetMaxEventCnt():
+    # 最大可出现事件个数
+    otherCntRateList = IpyGameDataPY.GetFuncEvalCfg('ImmortalDomain', 2)
+    maxEventCnt = max([info[1] for info in otherCntRateList]) + len(IpyGameDataPY.GetFuncEvalCfg('ImmortalDomain'))
+    return maxEventCnt
 
 ###=========================奇遇===============================
 def NotifyFairyAdventuresInfo(curPlayer):
@@ -379,8 +382,7 @@
 
     packData = ChPyNetSendPack.tagMCFairyAdventuresInfo()
     packData.InfoList = []
-    otherCntRateList = IpyGameDataPY.GetFuncEvalCfg('ImmortalDomain', 2)
-    maxEventCnt = max([info[1] for info in otherCntRateList]) + 1  #最大可出现事件个数
+    maxEventCnt = GetMaxEventCnt()  #最大可出现事件个数
     for i in xrange(maxEventCnt):
         fdEventID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyDomainEventID % i)
         if fdEventID not in AdventuresTypeList:

--
Gitblit v1.8.0