From f682e86913dcc352323d7dc1b6271610f7ec1ad1 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 24 十二月 2019 21:20:23 +0800
Subject: [PATCH] 8346 【恺英】【后端】协助系统(修复最后一个非协助玩家退出地图后boss没有回血的bug)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/AddFairyEvent.py |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 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 106d354..366af91 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
@@ -36,10 +36,12 @@
     if not msgList:
         GameWorld.DebugAnswer(curPlayer, "AddFairyEvent 事件ID")
         return
-    fdEventIDList = msgList
+    maxEventCnt = PlayerFairyDomain.GetMaxEventCnt()  # 最大可出现事件个数
+    if len(msgList) > maxEventCnt:
+        GameWorld.DebugAnswer(curPlayer, "最大事件数量 %s"%maxEventCnt)
+    fdEventIDList = msgList[:maxEventCnt]
     openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
-    otherCntRateList = IpyGameDataPY.GetFuncEvalCfg('ImmortalDomain', 2)
-    maxEventCnt = max([info[1] for info in otherCntRateList]) + 1  #最大可出现事件个数
+
     for i in xrange(maxEventCnt):
         prefdEventID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyDomainEventID % i)
         if prefdEventID:
@@ -54,8 +56,11 @@
                 ipyData = IpyGameDataPY.InterpolationSearch('FairyAdventures', 'OpenServerDay', openServerDay, {'EventID':fdEventID})
                 if ipyData:
                     conditionList = ipyData.GetCondition()
-                    condition = random.choice(conditionList)
-                    index = conditionList.index(condition)
+                    if conditionList:
+                        condition = random.choice(conditionList)
+                        index = conditionList.index(condition)
+                    else:
+                        index = 0
                     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyAdventuresData % fdEventID, ipyData.GetID() * 100 + index)
         
     #设置寻访中

--
Gitblit v1.8.0