From 3f5967eeefb1329d272e13e5823a7961ec0ea92c Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期四, 11 四月 2019 21:24:45 +0800
Subject: [PATCH] 6457 【后端】【2.0】缥缈仙域开发单(定制)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/QuestRunner.py                       |    9 ++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTalk.py                                |    4 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py                                  |   16 +++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py                                    |    6 
 PySysDB/PySysDBPY.h                                                                                                     |    2 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py                                 |    7 +
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFairyDomain.py                         |  103 ++++++++++++++++---------
 ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py                                                       |   16 +++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FairyTreasure.py |   49 ++++++-----
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py                                         |    2 
 10 files changed, 144 insertions(+), 70 deletions(-)

diff --git a/PySysDB/PySysDBPY.h b/PySysDB/PySysDBPY.h
index 5452aa1..8bd1ad7 100644
--- a/PySysDB/PySysDBPY.h
+++ b/PySysDB/PySysDBPY.h
@@ -1818,6 +1818,6 @@
 struct tagFairyDomainAppoint
 {
 	WORD		_Cnt;	//次数
-	DWORD		OpenServerDay;	//事件编号
+	DWORD		EventID;	//事件编号
 	list		Award;	//定制奖励(没配走正常奖励规则)[[物品ID,数量,是否拍品],..]
 };
\ No newline at end of file
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
index 8b7eeae..27ae39f 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
@@ -13903,7 +13903,9 @@
 
 class  tagMCFairyDomainInfo(Structure):
     Head = tagHead()
-    State = 0    #(BYTE State)//是否寻访中
+    IsAll = 0    #(BYTE IsAll)//是否全部
+    State = 0    #(BYTE State)//0-未寻访 1-寻访中 2-任务标记可寻访
+    VisitCnt = 0    #(DWORD VisitCnt)//寻访次数
     Energy = 0    #(WORD Energy)//体力
     Count = 0    #(BYTE Count)// 信息个数
     InfoList = list()    #(vector<tagMCFairyDomainEvent> InfoList)// 信息列表
@@ -13918,7 +13920,9 @@
     def ReadData(self, _lpData, _pos=0, _Len=0):
         self.Clear()
         _pos = self.Head.ReadData(_lpData, _pos)
+        self.IsAll,_pos = CommFunc.ReadBYTE(_lpData, _pos)
         self.State,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+        self.VisitCnt,_pos = CommFunc.ReadDWORD(_lpData, _pos)
         self.Energy,_pos = CommFunc.ReadWORD(_lpData, _pos)
         self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos)
         for i in range(self.Count):
@@ -13932,7 +13936,9 @@
         self.Head.Clear()
         self.Head.Cmd = 0xA3
         self.Head.SubCmd = 0x06
+        self.IsAll = 0
         self.State = 0
+        self.VisitCnt = 0
         self.Energy = 0
         self.Count = 0
         self.InfoList = list()
@@ -13942,6 +13948,8 @@
         length = 0
         length += self.Head.GetLength()
         length += 1
+        length += 1
+        length += 4
         length += 2
         length += 1
         for i in range(self.Count):
@@ -13952,7 +13960,9 @@
     def GetBuffer(self):
         data = ''
         data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+        data = CommFunc.WriteBYTE(data, self.IsAll)
         data = CommFunc.WriteBYTE(data, self.State)
+        data = CommFunc.WriteDWORD(data, self.VisitCnt)
         data = CommFunc.WriteWORD(data, self.Energy)
         data = CommFunc.WriteBYTE(data, self.Count)
         for i in range(self.Count):
@@ -13962,14 +13972,18 @@
     def OutputString(self):
         DumpString = '''
                                 Head:%s,
+                                IsAll:%d,
                                 State:%d,
+                                VisitCnt:%d,
                                 Energy:%d,
                                 Count:%d,
                                 InfoList:%s
                                 '''\
                                 %(
                                 self.Head.OutputString(),
+                                self.IsAll,
                                 self.State,
+                                self.VisitCnt,
                                 self.Energy,
                                 self.Count,
                                 "..."
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index b9646bc..92cd4cd 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -3859,7 +3859,7 @@
 Def_PDict_EquipPartStar = "EQPartStar_%s" #装备部位星数 参数 装备背包格子索引
 
 #缥缈仙域
-Def_PDict_FairyDomainState = "FairyDomainState" #是否寻访中
+Def_PDict_FairyDomainState = "FairyDomainState" #是否寻访中  0未寻访 1寻访中 2任务标记可寻访
 Def_PDict_FairyDomainEventState = "FairyDomainEventState%s" #单个事件状态1-未拜访  2-拜访中 3-已拜访   参数事件ID
 Def_PDict_FairyDomainEventID = "FairyDomainEventID%s" #事件ID 参数第n个事件
 Def_PDict_FairyDomainEnergy = "FairyDomainEnergy" #体力值
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
index 8b7eeae..27ae39f 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
@@ -13903,7 +13903,9 @@
 
 class  tagMCFairyDomainInfo(Structure):
     Head = tagHead()
-    State = 0    #(BYTE State)//是否寻访中
+    IsAll = 0    #(BYTE IsAll)//是否全部
+    State = 0    #(BYTE State)//0-未寻访 1-寻访中 2-任务标记可寻访
+    VisitCnt = 0    #(DWORD VisitCnt)//寻访次数
     Energy = 0    #(WORD Energy)//体力
     Count = 0    #(BYTE Count)// 信息个数
     InfoList = list()    #(vector<tagMCFairyDomainEvent> InfoList)// 信息列表
@@ -13918,7 +13920,9 @@
     def ReadData(self, _lpData, _pos=0, _Len=0):
         self.Clear()
         _pos = self.Head.ReadData(_lpData, _pos)
+        self.IsAll,_pos = CommFunc.ReadBYTE(_lpData, _pos)
         self.State,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+        self.VisitCnt,_pos = CommFunc.ReadDWORD(_lpData, _pos)
         self.Energy,_pos = CommFunc.ReadWORD(_lpData, _pos)
         self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos)
         for i in range(self.Count):
@@ -13932,7 +13936,9 @@
         self.Head.Clear()
         self.Head.Cmd = 0xA3
         self.Head.SubCmd = 0x06
+        self.IsAll = 0
         self.State = 0
+        self.VisitCnt = 0
         self.Energy = 0
         self.Count = 0
         self.InfoList = list()
@@ -13942,6 +13948,8 @@
         length = 0
         length += self.Head.GetLength()
         length += 1
+        length += 1
+        length += 4
         length += 2
         length += 1
         for i in range(self.Count):
@@ -13952,7 +13960,9 @@
     def GetBuffer(self):
         data = ''
         data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+        data = CommFunc.WriteBYTE(data, self.IsAll)
         data = CommFunc.WriteBYTE(data, self.State)
+        data = CommFunc.WriteDWORD(data, self.VisitCnt)
         data = CommFunc.WriteWORD(data, self.Energy)
         data = CommFunc.WriteBYTE(data, self.Count)
         for i in range(self.Count):
@@ -13962,14 +13972,18 @@
     def OutputString(self):
         DumpString = '''
                                 Head:%s,
+                                IsAll:%d,
                                 State:%d,
+                                VisitCnt:%d,
                                 Energy:%d,
                                 Count:%d,
                                 InfoList:%s
                                 '''\
                                 %(
                                 self.Head.OutputString(),
+                                self.IsAll,
                                 self.State,
+                                self.VisitCnt,
                                 self.Energy,
                                 self.Count,
                                 "..."
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py
index c195b83..95d5e9b 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py
@@ -1894,7 +1894,12 @@
 
 def EventRespons_Talk(curPlayer, eventName):
     #频道发言
-    RunQuestEvent(curPlayer, "Talk", eventName, Def_RunQuestType_Normal)
+    RunQuestEvent(curPlayer, "talk", eventName, Def_RunQuestType_Normal)
+    return
+
+def EventRespons_FairyDomain(curPlayer):
+    #完成缥缈仙域事件
+    RunQuestEvent(curPlayer, "fairydomain", 'fairydomain', Def_RunQuestType_Normal)
     return
 #---------------------------------------------------------------------
 
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/QuestRunner.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/QuestRunner.py
index d820532..13bf2af 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/QuestRunner.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/QuestRunner.py
@@ -56,6 +56,7 @@
 import PlayerFairyCeremony
 import PlayerNewFairyCeremony
 import PlayerWeekParty
+import PlayerFairyDomain
 import PlayerActLogin
 import PlayerHorse
 import FBCommon
@@ -7141,3 +7142,11 @@
     return
 
 
+def DoType_Setfairydomain(curPlayer, curMission, curActionNode):
+    ## 任务开启缥缈仙域 (做标记可寻访) <Setfairydomain/>
+    if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyDomainState):
+        #若已在寻访中则不可设置
+        return
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyDomainState, 2)
+    PlayerFairyDomain.NotifyVisitFairyDomainInfo(curPlayer)
+    return
\ No newline at end of file
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FairyTreasure.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FairyTreasure.py
index 4420541..a18207e 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FairyTreasure.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FairyTreasure.py
@@ -335,28 +335,32 @@
     FBCommon.SetFBStep(FB_Step_Over, tick)
     
     lineID = FBCommon.GetFBPropertyMark()
-    awardCfg = FBCommon.GetFBLineReward(ChConfig.Def_FBMapID_FairyTreasure, lineID)
-    curAlchemyLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AlchemyLV)
-    giveItemList = []
-    dropItemList = []
-    for awardRateList in awardCfg:
-        newItemInfoList = []
-        for itemInfo in awardRateList:
-            itemID = itemInfo[1][0]
-            itemData = GameWorld.GetGameData().GetItemByTypeID(itemID)
-            if not itemData:
-                return
-            if curAlchemyLV < itemData.GetLV() - 1:
-                #丹炉等级不足
+    ipyData = IpyGameDataPY.GetIpyGameDataByCondition('FairyDomain', {'MapID':ChConfig.Def_FBMapID_FairyTreasure, 'LineID':lineID})
+    fdeventID = ipyData.GetID()
+    giveItemList = PlayerFairyDomain.GetFairyAppointAward(curPlayer, fdeventID)
+    if not giveItemList:
+        awardCfg = FBCommon.GetFBLineReward(ChConfig.Def_FBMapID_FairyTreasure, lineID)
+        curAlchemyLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AlchemyLV)
+        giveItemList = []
+        dropItemList = []
+        for awardRateList in awardCfg:
+            newItemInfoList = []
+            for itemInfo in awardRateList:
+                itemID = itemInfo[1][0]
+                itemData = GameWorld.GetGameData().GetItemByTypeID(itemID)
+                if not itemData:
+                    return
+                if curAlchemyLV < itemData.GetLV() - 1:
+                    #丹炉等级不足
+                    continue
+    
+                newItemInfoList.append(itemInfo)
+            if not newItemInfoList:
                 continue
-
-            newItemInfoList.append(itemInfo)
-        if not newItemInfoList:
-            continue
-        randomitem = GameWorld.GetResultByWeightList(newItemInfoList)
-        giveItemList.append(randomitem)
-        for _ in randomitem[1]:
-            dropItemList.append([randomitem[0],1,randomitem[2]])
+            randomitem = GameWorld.GetResultByWeightList(newItemInfoList)
+            giveItemList.append(randomitem)
+            for _ in randomitem[1]:
+                dropItemList.append([randomitem[0],1,randomitem[2]])
         
     if giveItemList:
         NPCCommon.DoVirtualItemDrop(curPlayer, dropItemList, dropPosX, dropPosY)
@@ -365,8 +369,7 @@
         curPlayer.Sync_TimeTick(IPY_GameWorld.tttLeaveMap, 0, leaveTick, True)
         overDict = {FBCommon.Over_itemInfo:FBCommon.GetJsonItemList(giveItemList)}
         FBCommon.NotifyFBOver(curPlayer, ChConfig.Def_FBMapID_FairyTreasure, lineID, 1, overDict)
-    ipyData = IpyGameDataPY.GetIpyGameDataByCondition('FairyDomain', {'MapID':ChConfig.Def_FBMapID_FairyTreasure, 'LineID':lineID})
-    fdeventID = ipyData.GetID()
+    
     PlayerFairyDomain.SetFairyDomainEventState(curPlayer, fdeventID, PlayerFairyDomain.FDEventState_Visited)
     return
 
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
index 064f2a2..22f6cae 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -1404,7 +1404,7 @@
 
                 "FairyDomainAppoint":(
                         ("WORD", "Cnt", 1),
-                        ("DWORD", "OpenServerDay", 0),
+                        ("DWORD", "EventID", 0),
                         ("list", "Award", 0),
                         ),
                 }
@@ -4297,12 +4297,12 @@
     
     def __init__(self):
         self.Cnt = 0
-        self.OpenServerDay = 0
+        self.EventID = 0
         self.Award = []
         return
         
     def GetCnt(self): return self.Cnt # 次数
-    def GetOpenServerDay(self): return self.OpenServerDay # 事件编号
+    def GetEventID(self): return self.EventID # 事件编号
     def GetAward(self): return self.Award # 定制奖励(没配走正常奖励规则)[[物品ID,数量,是否拍品],..]
 
 
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 d0014c7..dcfd19e 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFairyDomain.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFairyDomain.py
@@ -25,6 +25,7 @@
 import IpyGameDataPY
 import PlayerActivity
 import ItemControler
+import EventShell
 
 import copy
 import random
@@ -62,16 +63,12 @@
 #};
 def OnVisitFairyDomain(index, clientData, tick):
     curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
-    dailyID = ShareDefine.DailyActionID_FairyDomain
-    hasOpen = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_DailyActionState % dailyID)
-    if not hasOpen:
-        GameWorld.DebugLog("    寻访仙域活动未开启!")
-        return
+    
     otherCntRateList = IpyGameDataPY.GetFuncEvalCfg('ImmortalDomain', 2)
     maxEventCnt = max([info[1] for info in otherCntRateList]) + 1  #最大可出现事件个数
-    
+    fairyDomainState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyDomainState) #是否寻访中  0未寻访 1寻访中 2任务标记可寻访
     if clientData.Type == 1:  #结束寻访
-        if not curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyDomainState):
+        if fairyDomainState != 1:
             GameWorld.DebugLog("    未开始寻访仙域, 无法结束")
             return
         PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyDomainState, 0)
@@ -86,21 +83,28 @@
         NotifyVisitFairyDomainInfo(curPlayer)
         return
     
+    dailyID = ShareDefine.DailyActionID_FairyDomain
+    hasOpen = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_DailyActionState % dailyID)
+    if fairyDomainState != 2 and not hasOpen:
+        GameWorld.DebugLog("    寻访仙域活动未开启!")
+        return
+    
     #是否寻访中
-    if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyDomainState):
+    if fairyDomainState == 1:
         GameWorld.DebugLog("    正在寻访仙域中!请先退出寻访")
         return
     
-    if not PlayerActivity.AddDailyActionFinishCnt(curPlayer, dailyID):
+    if fairyDomainState != 2 and not PlayerActivity.AddDailyActionFinishCnt(curPlayer, dailyID):
         GameWorld.DebugLog("    寻访仙域次数不足!")
         return
     
     #随机事件 重置事件状态
     visitCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyDomainVisitCnt)
-    specialVisitDict = IpyGameDataPY.GetFuncEvalCfg('ImmortalDomain', 5, {})
-    maxSpecialCnt = max(specialVisitDict) if specialVisitDict else 0
-    if visitCnt + 1 in specialVisitDict:
-        fdEventIDList = specialVisitDict[visitCnt + 1]
+    appointIpyDataList = IpyGameDataPY.GetIpyGameDataListNotLog('FairyDomainAppoint', visitCnt+1)
+    if appointIpyDataList:
+        fdEventIDList = []
+        for appointIpyData in appointIpyDataList:
+            fdEventIDList.append(appointIpyData.GetEventID()) 
     else:
         fdEventTypeDict = {}
         #先随机奇遇事件
@@ -150,8 +154,7 @@
         GameWorld.Log('寻访仙域, 没有随机出事件!!')
         return
     
-    if visitCnt < maxSpecialCnt:
-        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyDomainVisitCnt, visitCnt + 1)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyDomainVisitCnt, min(visitCnt + 1, ChConfig.Def_UpperLimit_DWord))
     #设置事件
     for i in xrange(maxEventCnt):
         fdEventID = fdEventIDList[i] if i < len(fdEventIDList) else 0
@@ -177,11 +180,17 @@
     randomRateList = []
     rate = 0
     curAlchemyLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AlchemyLV)
+    curLV = curPlayer.GetLV()
     for ipyData in ipyDataList:
         needAlchemyLV = ipyData.GetNeedAlchemyLV()
         if curAlchemyLV < needAlchemyLV - 1:
             #丹炉等级不足
             continue
+        lvLimit = ipyData.GetNeedLV()
+        if lvLimit and not (lvLimit[0]<=curLV<=lvLimit[1]):
+            #等级范围不满足
+            continue
+        
         rate += ipyData.GetWeight()
         randomRateList.append([rate, ipyData.GetID()])
     if not randomRateList:
@@ -221,14 +230,16 @@
         if curState != FDEventState_Visiting:
             GameWorld.Log('缥缈仙域事件状态设置错误,fdeventID=%s, state=%s, curState=%s' % (fdeventID, state, curState))
             return
-        
+        EventShell.EventRespons_FairyDomain(curPlayer)
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyDomainEventState % fdeventID, state)
     NotifyVisitFairyDomainInfo(curPlayer, [fdeventID])
     return True
 
 
 def NotifyVisitFairyDomainInfo(curPlayer, fdEventList=[]):
+    isAll = 0
     if not fdEventList:
+        isAll = 1
         otherCntRateList = IpyGameDataPY.GetFuncEvalCfg('ImmortalDomain', 2)
         maxEventCnt = max([info[1] for info in otherCntRateList]) + 1  #最大可出现事件个数
         for i in xrange(maxEventCnt):
@@ -237,8 +248,10 @@
                 fdEventList.append(fdEventID)
             
     packData = ChPyNetSendPack.tagMCFairyDomainInfo()
+    packData.IsAll = isAll
     packData.State = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyDomainState)
     packData.Energy = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyDomainEnergy)
+    packData.VisitCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyDomainVisitCnt)
     packData.InfoList = []
     for fdeventID in fdEventList:
         fdeventData = ChPyNetSendPack.tagMCFairyDomainEvent()
@@ -253,6 +266,8 @@
 ###=========================奇遇===============================
 def NotifyFairyAdventuresInfo(curPlayer):
     ##通知奇遇信息
+    visitCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyDomainVisitCnt)
+
     packData = ChPyNetSendPack.tagMCFairyAdventuresInfo()
     packData.InfoList = []
     otherCntRateList = IpyGameDataPY.GetFuncEvalCfg('ImmortalDomain', 2)
@@ -267,7 +282,10 @@
             continue
         conditionList = ipyData.GetCondition()
         index = adventuresdata % 100
-        condition = conditionList[index] if index < len(conditionList) else 0
+        if IpyGameDataPY.GetIpyGameDataByCondition('FairyDomainAppoint', {'Cnt':visitCnt, 'EventID':fdEventID}, False, False):
+            condition = 0 #定制的条件为0
+        else:
+            condition = conditionList[index] if index < len(conditionList) else 0
         adventuresdata = ChPyNetSendPack.tagMCFairyAdventuresData()
         adventuresdata.Gear = index + 1
         adventuresdata.Condition = condition
@@ -298,28 +316,39 @@
         if fdeventID != ipyData.GetEventID():
             GameWorld.Log('奇遇领取奖励 事件ID错误!')
             return
-        #1-等级奇遇 2-境界奇遇 3-战力奇遇 4-气运奇遇
-        if fdeventID == 1:
-            curData = curPlayer.GetLV()
-        elif fdeventID == 2:
-            curData = curPlayer.GetOfficialRank()
-        elif fdeventID == 3:
-            curData = curPlayer.GetFightPower()
-        elif fdeventID == 4:
-            curData = curPlayer.GetLuckValue()
-        else:
-            return
-        if curData >= condition:
-            gearAwardList = ipyData.GetGearAward()
-            if not gearAwardList:
+        giveItemList = GetFairyAppointAward(curPlayer, fdeventID)
+        if not giveItemList:
+            #1-等级奇遇 2-境界奇遇 3-战力奇遇 4-气运奇遇
+            if fdeventID == 1:
+                curData = curPlayer.GetLV()
+            elif fdeventID == 2:
+                curData = curPlayer.GetOfficialRank()
+            elif fdeventID == 3:
+                curData = curPlayer.GetFightPower()
+            elif fdeventID == 4:
+                curData = curPlayer.GetLuckValue()
+            else:
                 return
-            itemRateList = gearAwardList[index] if index < len(gearAwardList) else gearAwardList[-1]
-            itemInfo = GameWorld.GetResultByWeightList(itemRateList)
-        else:
-            itemInfo = ipyData.GetBasicAward()
+            if curData >= condition:
+                gearAwardList = ipyData.GetGearAward()
+                if not gearAwardList:
+                    return
+                itemRateList = gearAwardList[index] if index < len(gearAwardList) else gearAwardList[-1]
+                giveItemList = [GameWorld.GetResultByWeightList(itemRateList)]
+            else:
+                giveItemList = [ipyData.GetBasicAward()]
                 
-        ItemControler.GivePlayerItemOrMail(curPlayer, [itemInfo])
-        msgDict = {FBCommon.Over_itemInfo:FBCommon.GetJsonItemList([itemInfo])}
+        ItemControler.GivePlayerItemOrMail(curPlayer, giveItemList)
+        msgDict = {FBCommon.Over_itemInfo:FBCommon.GetJsonItemList(giveItemList)}
         FBCommon.Notify_FB_Over(curPlayer, msgDict)
         GameWorld.DebugLog('缥缈奇遇领奖 msgDict=%s, fdeventID=%s' % (msgDict, fdeventID))
     return
+
+
+def GetFairyAppointAward(curPlayer, fdEventID):
+    ##获取事件定制奖励, 没有的给正常奖励
+    visitCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyDomainVisitCnt)
+    ipyData = IpyGameDataPY.GetIpyGameDataByCondition('FairyDomainAppoint', {'Cnt':visitCnt, 'EventID':fdEventID}, False, False)
+    if not ipyData:
+        return
+    return ipyData.GetAward()
\ No newline at end of file
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTalk.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTalk.py
index 2f7662d..a41ad2e 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTalk.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTalk.py
@@ -108,7 +108,7 @@
     #世界频道发言成就
     #PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_TalkWorld, 1)
     PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_FeastRedPack_TalkWorld, 1)
-    EventShell.EventRespons_Talk(curPlayer, 'TalkWorld')
+    EventShell.EventRespons_Talk(curPlayer, 'talkworld')
     return
 
 ## 国家频道(封包参数)
@@ -164,7 +164,7 @@
     curPlayer.ChatFamily(content, 0, extras)
     #仙盟频道发言成就
     PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_TalkFamily, 1)
-    EventShell.EventRespons_Talk(curPlayer, 'TalkFamily')
+    EventShell.EventRespons_Talk(curPlayer, 'talkfamily')
     return
 
 ## 队伍频道(封包参数)

--
Gitblit v1.8.0