From e37c0b9f504429962a92755c7a79926f092ed9af Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 07 一月 2020 18:57:53 +0800
Subject: [PATCH] 8346 【恺英】【后端】协助系统(副本协助支持,增加缥缈S副本)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerPiaomiaoTask.py                    |   24 +++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerAssist.py                          |   95 +++++++++++++
 ServerPython/CoreServerGroup/GameServer/Script/ChConfig.py                                                          |    2 
 ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerTeam.py                                                 |    3 
 ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerAssist.py                                               |   29 ++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_KillDevil.py |  255 ++++++++++++++++++++++++++++++++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py                                     |    5 
 7 files changed, 410 insertions(+), 3 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChConfig.py b/ServerPython/CoreServerGroup/GameServer/Script/ChConfig.py
index 75616d2..c10145a 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChConfig.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChConfig.py
@@ -673,6 +673,8 @@
 Def_FBMapID_MunekadoTrial = 60010
 #混乱妖域
 Def_FBMapID_ChaosDemon = 31180
+#讨伐妖魔
+Def_FBMapID_KillDevil = 31280
 #娲皇遗迹
 Def_FBMapID_QueenRelics = 51010
 #跨服竞技场
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerAssist.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerAssist.py
index eb5faa8..a23b1ff 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerAssist.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerAssist.py
@@ -389,6 +389,11 @@
         __DoBossAssistOver(queryData)
         return
     
+    # 副本协助结束
+    elif queryType == "OnFBAssistOver":
+        __DoFBAssistOver(queryData)
+        return
+    
     ## -------------------------------------------------------------------------------------------
     
     # 请求协助组队副本
@@ -678,7 +683,7 @@
                 OnCancelPlayerRequestAssist(assistObj, "BossAssistOver", False)
                 break
                 
-    if not assistAwardResult:
+    if not assistAwardItemID or not assistAwardResult:
         return
     
     # 新增感谢数据
@@ -691,6 +696,28 @@
         
     return
 
+def __DoFBAssistOver(queryData):
+    ## 副本协助结束
+    mapID, lineID, noAssistPlayerID, assistAwardItemID, assistPlayerDict = queryData
+    assistMgr = PyDataManager.GetPlayerAssistPyManager()
+    if noAssistPlayerID not in assistMgr.playerNoSaveDBAssistDict:
+        return
+    playerAssistList = assistMgr.playerNoSaveDBAssistDict[noAssistPlayerID]
+    for assistObj in playerAssistList:
+        if assistObj.MapID == mapID and assistObj.LineID == lineID:
+            OnCancelPlayerRequestAssist(assistObj, "FBAssistOver", False)
+            break
+        
+    if not assistAwardItemID or not assistPlayerDict:
+        return
+    
+    # 新增感谢数据
+    curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(noAssistPlayerID)
+    if curPlayer:
+        AddNewAssistThanks(curPlayer, assistAwardItemID, mapID, lineID, assistPlayerDict)
+        
+    return
+
 def AddNewAssistThanks(curPlayer, itemID, mapID, lineID, assistPlayerDict, npcID=0, exData=""):
     ## 添加协助感谢数据
     
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerTeam.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerTeam.py
index a511d9f..574a73e 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerTeam.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerTeam.py
@@ -2324,7 +2324,8 @@
         return
     
     playerLV = curPlayer.GetLV()
-    matchMapIDList = [ChConfig.Def_FBMapID_DuJie, ChConfig.Def_FBMapID_MunekadoTrial, ChConfig.Def_FBMapID_QueenRelics, ChConfig.Def_FBMapID_ChaosDemon]
+    matchMapIDList = [ChConfig.Def_FBMapID_DuJie, ChConfig.Def_FBMapID_MunekadoTrial, ChConfig.Def_FBMapID_QueenRelics, ChConfig.Def_FBMapID_ChaosDemon,
+                      ChConfig.Def_FBMapID_KillDevil]
     
     teamMgr = GameWorld.GetTeamManager()
     for matchMapID in matchMapIDList:
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index cb1f301..6b50cad 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -1756,6 +1756,9 @@
 #混乱妖域
 Def_FBMapID_ChaosDemon = 31180
 
+#讨伐妖魔
+Def_FBMapID_KillDevil = 31280
+
 #娲皇遗迹
 Def_FBMapID_QueenRelics = 51010
 
@@ -1901,6 +1904,7 @@
                 'FamilyParty':[Def_FBMapID_FamilyParty],#仙盟宴会
                 'MunekadoTrial':[Def_FBMapID_MunekadoTrial],#宗门试炼
                 'ChaosDemon':[Def_FBMapID_ChaosDemon], #混乱妖域
+                'KillDevil':[Def_FBMapID_KillDevil], #讨伐妖魔
                 'QueenRelics':[Def_FBMapID_QueenRelics], #娲皇遗迹
                 'ElderBattlefield':[Def_FBMapID_ElderBattlefield], #上古战场
                 'Guard':[Def_FBMapID_Guard], #守护副本
@@ -3991,6 +3995,7 @@
 #缥缈任务
 Def_PDict_PiaomiaoTaskTakeCount = "PiaomiaoTaskTakeCount" # 今日已接任务次数
 Def_PDict_PiaomiaoTaskRefreshCount = "PiaomiaoTaskRefreshCount" # 今日已刷新次数
+Def_PDict_PiaomiaoMaxGradeTaskID = "PiaomiaoMaxGradeTaskID" # 缥缈任务最大评分任务ID
 #-------------------------------------------------------------------------------
 #可以从07 41封包购买的背包类型,和对应字典{背包类型:[字典key, 默认格子数]}
 
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_KillDevil.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_KillDevil.py
new file mode 100644
index 0000000..bf77a59
--- /dev/null
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_KillDevil.py
@@ -0,0 +1,255 @@
+#!/usr/bin/python
+# -*- coding: GBK -*-
+#-------------------------------------------------------------------------------
+#
+##@package GameWorldLogic.FBProcess.GameLogic_KillDevil
+#
+# @todo:讨伐妖魔
+# @author hxp
+# @date 2020-01-07
+# @version 1.0
+#
+# 详细描述: 讨伐妖魔,组队/单人
+#
+#-------------------------------------------------------------------------------
+#"""Version = 2020-01-07 19:00"""
+#-------------------------------------------------------------------------------
+
+import FBCommon
+import EventShell
+import PlayerAssist
+import GameWorldProcess
+import NPCCustomRefresh
+import ItemControler
+import IPY_GameWorld
+import GameWorld
+import ChConfig
+
+(
+Def_PrepareTime, # 准备时间, 秒
+Def_FightTime, # 副本时间, 秒
+Def_ExitTime, # 退出时间, 秒
+) = range(3)
+
+# 副本状态
+(
+FB_Step_Open, #开启
+FB_Step_Prepare, #准备中
+FB_Step_Fight, # 战斗中
+FB_Step_Over, # 结束等待
+FB_Step_Close, # 关闭中
+) = range(5)
+
+FBDict_FBBossID = "FBBossID" # 副本bossID
+FBDict_KillNPCCount = "KillNPCCount_%s" # 已击杀NPC数,参数npcID
+
+## 开启副本
+def OnOpenFB(tick):
+    return
+
+## 是否能够通过活动查询进入
+def OnEnterFBEvent(curPlayer, mapID, lineID, tick):
+    teamID = curPlayer.GetTeamID()
+    if teamID:
+        if curPlayer.GetTeamLV() != IPY_GameWorld.tmlLeader:
+            return True
+        
+    taskID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_PiaomiaoMaxGradeTaskID)
+    curMission = curPlayer.FindMission(taskID)
+    if curMission == None:
+        GameWorld.DebugLog("没有该副本任务,无法进入!taskID=%s" % taskID)
+        return False
+    missionState = curMission.GetMissionState()
+    if missionState != IPY_GameWorld.msProcessing:
+        GameWorld.DebugLog("该副本任务非进行中,无法进入!taskID=%s,missionState=%s" % (taskID, missionState))
+        return False
+    
+    return True
+
+## 副本玩家进入点
+def OnGetFBEnterPos(curPlayer, mapID, lineID, ipyEnterPosInfo, tick):
+    return ipyEnterPosInfo
+
+## 是否可以进入
+def OnChangeMapAsk(ask, tick):
+    return IPY_GameWorld.cmeAccept
+
+## 玩家进入副本
+def DoEnterFB(curPlayer, tick):
+    mapID = GameWorld.GetGameWorld().GetMapID()
+    mapID = FBCommon.GetRecordMapID(mapID)
+    gameFB = GameWorld.GetGameFB()
+    
+    lineTimeCfg = FBCommon.GetFBLineStepTime(mapID)
+    
+    # 进入消耗处理
+    if not FBCommon.GetHadDelTicket(curPlayer):
+        FBCommon.SetHadDelTicket(curPlayer)
+        PlayerAssist.SetFBNoAssistPlayerID(curPlayer)
+        
+    fbStep = gameFB.GetFBStep()
+    if fbStep == FB_Step_Open:
+        FBCommon.SetFBStep(FB_Step_Prepare, tick)
+        bossID = FBCommon.GetFBLineRefreshNPC(mapID)[1]
+        gameFB.SetGameFBDict(FBDict_FBBossID, bossID)
+        
+    if fbStep <= FB_Step_Prepare:
+        notify_tick = lineTimeCfg[Def_PrepareTime] * 1000 - (tick - GameWorld.GetGameFB().GetFBStepTick())
+        curPlayer.Sync_TimeTick(IPY_GameWorld.tttAddUpTime, 0, max(notify_tick, 0), True)
+        curPlayer.Sync_TimeTick(IPY_GameWorld.tttWaitStart, 0, max(notify_tick, 0), True)
+        
+    elif fbStep == FB_Step_Fight:
+        notify_tick = lineTimeCfg[Def_FightTime] * 1000 - (tick - GameWorld.GetGameFB().GetFBStepTick())
+        curPlayer.Sync_TimeTick(IPY_GameWorld.tttTowerTake, 0, max(notify_tick, 0), True)
+        
+    DoFBHelp(curPlayer, tick)
+    return
+
+## 副本帮助信息
+def DoFBHelp(curPlayer, tick):
+    playerID = curPlayer.GetPlayerID()
+    gameFB = GameWorld.GetGameFB()
+    npcID = gameFB.GetGameFBDictByKey(FBDict_FBBossID)
+    killCount = gameFB.GetGameFBDictByKey(FBDict_KillNPCCount % npcID)
+    #fbHelpDict = {FBCommon.Help_npcTotal:killCount}
+    fbHelpDict = {FBCommon.Help_npc:FBCommon.GetJsonNPCKillList({npcID:killCount})}
+    FBCommon.Notify_FBHelp(curPlayer, fbHelpDict)
+    GameWorld.DebugLog("DoFBHelp %s" % str(fbHelpDict), playerID)
+    return
+
+## 玩家退出副本.
+def DoExitFB(curPlayer, tick):
+    return
+
+## 玩家主动离开副本.
+def DoPlayerLeaveFB(curPlayer, tick):
+    return
+
+## 关闭副本
+def OnCloseFB(tick):
+    return
+
+## 玩家副本复活
+def DoFBOnReborn(curPlayer, rebornType, tick):
+    return
+
+## 副本定时器
+def OnProcess(tick):
+    fbStep = GameWorld.GetGameFB().GetFBStep()
+
+    # 副本准备
+    if fbStep == FB_Step_Prepare:
+        __DoLogic_FB_Prepare(tick)
+    elif fbStep == FB_Step_Fight:
+        __ProcessFight(tick)
+    elif fbStep == FB_Step_Over:
+        __ProcessCloseFB(tick)
+        
+    return
+
+## 副本准备
+def __DoLogic_FB_Prepare(tick):
+    #gameFB = GameWorld.GetGameFB()
+    mapID = GameWorld.GetMap().GetMapID()
+    fbCfg = FBCommon.GetFBLineStepTime(mapID)
+    # 间隔未到
+    if tick - GameWorld.GetGameFB().GetFBStepTick() < fbCfg[Def_PrepareTime] * 1000:
+        return
+    
+    gameFB = GameWorld.GetGameFB()
+    mapID = GameWorld.GetMap().GetMapID()
+    refreshMark, bossID = FBCommon.GetFBLineRefreshNPC(mapID)
+    gameFB.SetGameFBDict(FBDict_FBBossID, bossID)
+    
+    NPCCustomRefresh.SetNPCRefresh(refreshMark, [bossID])
+    NPCCustomRefresh.ProcessAllNPCRefresh(tick) # 立即出发一次标识点刷新
+    
+    FBCommon.SetFBStep(FB_Step_Fight, tick)
+    FBCommon.Sync_Player_TimeTick(IPY_GameWorld.tttTowerTake, fbCfg[Def_FightTime] * 1000)
+    return
+
+## 副本战斗
+def __ProcessFight(tick):
+    mapID = GameWorld.GetMap().GetMapID()
+    fbCfg = FBCommon.GetFBLineStepTime(mapID)
+    # 间隔未到
+    if tick - GameWorld.GetGameFB().GetFBStepTick() < fbCfg[Def_FightTime] * 1000:
+        return
+    
+    __DoKillDevilOver(False, tick)        
+    return
+    
+## 副本关闭
+def __ProcessCloseFB(tick):
+    mapID = GameWorld.GetMap().GetMapID()
+    fbCfg = FBCommon.GetFBLineStepTime(mapID)
+    # 间隔未到
+    if tick - GameWorld.GetGameFB().GetFBStepTick() < fbCfg[Def_ExitTime] * 1000:
+        return
+    
+    GameWorldProcess.CloseFB(tick)
+    FBCommon.SetFBStep(FB_Step_Close, tick)
+    return
+
+## 玩家杀死NPC
+def DoFB_Player_KillNPC(curPlayer, curNPC, tick):
+    npcID = curNPC.GetNPCID()
+    gameFB = GameWorld.GetGameFB()
+    fbBossID = gameFB.GetGameFBDictByKey(FBDict_FBBossID)
+    if npcID != fbBossID:
+        return
+    gameFB.SetGameFBDict(FBDict_KillNPCCount % npcID, gameFB.GetGameFBDictByKey(FBDict_KillNPCCount % npcID) + 1)
+    FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 0)
+    
+    __DoKillDevilOver(True, tick)
+    return
+
+def __DoKillDevilOver(isPass, tick):
+    # 战斗超时
+    gameFB = GameWorld.GetGameFB()
+    if gameFB.GetFBStep() == FB_Step_Over:
+        return
+    FBCommon.SetFBStep(FB_Step_Over, tick)
+    
+    mapID = FBCommon.GetRecordMapID(GameWorld.GetMap().GetMapID())
+    noAssistPlayerID, assistMoneyType, assistPlayerMoneyDict = PlayerAssist.OnFBAssistOver(mapID)
+    exitTime = FBCommon.GetFBLineStepTime(mapID)[Def_ExitTime] * 1000
+    rewardInfo = FBCommon.GetFBLineReward(mapID, 0)
+    noAssistItemList, assistItemList = ([], []) if not rewardInfo else rewardInfo
+    
+    playerManager = GameWorld.GetMapCopyPlayerManager()
+    playerCount = playerManager.GetPlayerCount()
+    for index in xrange(playerCount):
+        curPlayer = playerManager.GetPlayerByIndex(index)
+        if not curPlayer:
+            continue
+        
+        playerID = curPlayer.GetPlayerID()
+        overDict = {FBCommon.Over_dataMapID:mapID, FBCommon.Over_isPass: int(isPass)}
+        if isPass:
+            itemList = []
+            if playerID == noAssistPlayerID:
+                itemList = noAssistItemList
+                EventShell.EventRespons_FBEvent(curPlayer, "fb_pass_%s" % mapID)
+                
+            elif playerID in assistPlayerMoneyDict:
+                addAssistMoney = assistPlayerMoneyDict[playerID]
+                itemList = assistItemList
+                overDict.update({FBCommon.Over_isAssist:1, FBCommon.Over_money:FBCommon.GetJsonMoneyList({assistMoneyType:addAssistMoney})})
+            overDict[FBCommon.Over_itemInfo] = FBCommon.GetJsonItemList(itemList)
+            
+            if itemList:
+                ItemControler.GivePlayerItemOrMail(curPlayer, itemList)
+                
+        GameWorld.DebugLog("overDict=%s" % overDict, playerID)
+        FBCommon.Notify_FB_Over(curPlayer, overDict)
+        curPlayer.Sync_TimeTick(IPY_GameWorld.tttLeaveMap, 0, exitTime, True)
+        
+    return
+
+## 检查是否可攻击, 主判定不可攻击的情况,其他逻辑由外层决定
+def CheckCanAttackTagObjInFB(attacker, defender):
+    return GameWorld.GetGameFB().GetFBStep() == FB_Step_Fight
+
+
+
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerAssist.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerAssist.py
index e0d7c0b..5651b56 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerAssist.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerAssist.py
@@ -25,6 +25,9 @@
 import ItemControler
 import ItemCommon
 import ChConfig
+import ShareDefine
+import PyGameData
+import FBCommon
 
 def DoPlayerOnDay(curPlayer):
     ## 过天处理
@@ -114,6 +117,21 @@
         GameWorld.DebugLog("请求协助CD中!mapID=%s,lineID=%s" % (mapID, lineID), playerID)
         return
     
+    mapAssistGiftDict = IpyGameDataPY.GetFuncEvalCfg("AssistAward", 2, {})
+    if str(mapID) not in mapAssistGiftDict:
+        return
+    
+    teamID = curPlayer.GetTeamID()
+    if teamID:
+        if curPlayer.GetTeamLV() != IPY_GameWorld.tmlLeader:
+            GameWorld.DebugLog("非队长,无法发布副本协助!")
+            return
+        
+    fbIpyData = FBCommon.GetFBIpyData(mapID)
+    fbLineIpyData = FBCommon.GetFBLineIpyData(mapID, lineID)
+    if PlayerControl.CheckMoveToFB(curPlayer, mapID, lineID, fbIpyData, fbLineIpyData, tick) != ShareDefine.EntFBAskRet_OK:
+        return
+    
     queryData = [mapID, lineID]
     QueryGameServer_PlayerAssist(playerID, "RequestAssistTeamFB", queryData)
     return
@@ -190,6 +208,83 @@
         
     return
 
+def SetFBNoAssistPlayerID(curPlayer):
+    ## 设置副本非协助玩家ID,玩家进入副本时调用
+    gameFB = GameWorld.GetGameFB()
+    if gameFB.GetGameFBDictByKey("FBNoAssistPlayerID"):
+        return
+    if curPlayer.GetTeamID():
+        if curPlayer.GetTeamLV() != IPY_GameWorld.tmlLeader:
+            return
+    noAssistPlayerID = curPlayer.GetPlayerID()
+    gameFB.SetGameFBDict("FBNoAssistPlayerID", noAssistPlayerID)
+    GameWorld.DebugLog("设置副本非协助玩家: noAssistPlayerID=%s" % noAssistPlayerID)
+    return
+
+def OnFBAssistOver(mapID, lineID=0):
+    ## 副本协助结束
+    assistPlayerMoneyDict = {}
+    assistMoneyType = ShareDefine.TYPE_Price_FamilyActivity
+    gameFB = GameWorld.GetGameFB()
+    noAssistPlayerID = gameFB.GetGameFBDictByKey("FBNoAssistPlayerID")
+    GameWorld.DebugLog("副本协助结算: mapID=%s,lineID=%s,noAssistPlayerID=%s" % (mapID, lineID, noAssistPlayerID))
+    
+    if not noAssistPlayerID:
+        return noAssistPlayerID, assistMoneyType, assistPlayerMoneyDict
+    
+    liheItemID, assistMoney = 0, 0
+    mapAssistGiftDict = IpyGameDataPY.GetFuncEvalCfg("AssistAward", 2, {})
+    if str(mapID) in mapAssistGiftDict:
+        liheItemID, assistMoney = mapAssistGiftDict[str(mapID)]
+        
+    friendList, memFamilyIDDict = [], {}
+    teamID = GameWorld.GetGameWorld().GetPropertyID()
+    if teamID in PyGameData.g_teamFBMemRelationDict:
+        friendList, memFamilyIDDict = PyGameData.g_teamFBMemRelationDict[teamID][:2]
+    noAssistPlayerFamilyID = memFamilyIDDict.get(noAssistPlayerID, 0)
+    
+    assistAwardItemID = liheItemID
+    assistPlayerDict = {}
+    copyPlayerManager = GameWorld.GetMapCopyPlayerManager()
+    noAssistPlayer = copyPlayerManager.FindPlayerByID(noAssistPlayerID)
+    for index in xrange(copyPlayerManager.GetPlayerCount()):
+        curPlayer = copyPlayerManager.GetPlayerByIndex(index)
+        if not curPlayer:
+            continue
+        
+        playerID = curPlayer.GetPlayerID()
+        if playerID == noAssistPlayerID:
+            continue
+        
+        assistPlayer = curPlayer
+        assistPlayerID = playerID
+        isFriend = [noAssistPlayerID, playerID] in friendList or [playerID, noAssistPlayerID] in friendList
+        assistFamilyID = assistPlayer.GetFamilyID()
+        
+        addAssistMoney = AddTodayAssistMoney(curPlayer, assistMoneyType, assistMoney, isFriend)
+        assistPlayerMoneyDict[assistPlayerID] = addAssistMoney
+        GameWorld.DebugLog("协助方给活跃令奖励: assistPlayerID=%s,assistMoney=%s,isFriend=%s,addAssistMoney=%s" 
+                           % (assistPlayerID, assistMoney, isFriend, addAssistMoney), mapID, lineID)
+        
+        if noAssistPlayer:
+            todayGiftCount = assistPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GetThanksGiftCount % liheItemID)
+            assistPlayerDict[assistPlayerID] = {"PlayerName":assistPlayer.GetPlayerName(), "Job":assistPlayer.GetJob(), 
+                                                "LV":assistPlayer.GetLV(), "RealmLV":assistPlayer.GetOfficialRank(),
+                                                "TodayGiftCount":todayGiftCount}
+            
+            # 暂定支持同队伍不同仙盟间协助
+            if assistFamilyID and assistFamilyID == noAssistPlayerFamilyID:
+                notifyParam = [assistPlayer.GetPlayerName(), noAssistPlayer.GetPlayerName(), mapID]
+                PlayerControl.FamilyNotify(assistFamilyID, "AssistFBFinish", notifyParam)
+                
+    if noAssistPlayer and assistPlayerDict:
+        GameWorld.DebugLog("发布方给感谢礼盒奖励: noAssistPlayerID=%s,assistAwardItemID=%s" % (noAssistPlayerID, assistAwardItemID), mapID, lineID)
+        ItemControler.GivePlayerItemOrMail(noAssistPlayer, [[assistAwardItemID, 1, 0]])
+        
+    queryData = [mapID, lineID, noAssistPlayerID, assistAwardItemID, assistPlayerDict]
+    QueryGameServer_PlayerAssist(0, "OnFBAssistOver", queryData)
+    return noAssistPlayerID, assistMoneyType, assistPlayerMoneyDict
+
 def AddTodayAssistMoney(curPlayer, moneyType, addMoney, isSocialEx):
     ''' 增加今日协助货币奖励    
     @param moneyType: 货币类型
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerPiaomiaoTask.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerPiaomiaoTask.py
index 1bf7862..6eed503 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerPiaomiaoTask.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerPiaomiaoTask.py
@@ -30,6 +30,7 @@
 import ItemCommon
 import ChConfig
 
+Def_MaxGrade = 5 # 暂时只针对组队缥缈副本
 
 def DoPiaomiaoTaskOpen(curPlayer):
     ## 缥缈任务开启
@@ -90,7 +91,7 @@
         
         curGrade = curMission.GetProperty(QuestCommon.Def_Mission_Grade)
         # 评级5 S不重置
-        if missionState != ChConfig.Def_Mission_State_NoAccept or curGrade == 5:
+        if missionState != ChConfig.Def_Mission_State_NoAccept or curGrade == Def_MaxGrade:
             piaomiaoMissionIDList.append(missionID)
             GameWorld.DebugLog("    缥缈任务非未接,保留! missionID=%s,missionState=%s" % (missionID, missionState))
             continue
@@ -132,6 +133,11 @@
         #通知客户端
         EventShell.NotifyOneMission(curPlayer, curMission)
         
+        if grade == Def_MaxGrade:
+            familyID = curPlayer.GetFamilyID()
+            if familyID:
+                PlayerControl.FamilyNotify(familyID, "RefreshPiaomiaoSFB", [curPlayer.GetPlayerName(), ChConfig.Def_FBMapID_KillDevil])
+             
     SyncPiaomiaoTaskInfo(curPlayer)
     return
 
@@ -143,10 +149,26 @@
     if todayTakeCount >= maxTakeCount:
         GameWorld.DebugLog("已达今日接任务上限!todayTakeCount=%s" % todayTakeCount)
         return
+    
+    for i in range(curPlayer.GetMissionCount()):
+        mission = curPlayer.GetMissionByIndex(i)
+        missionID = mission.GetMissionID()
+        questData = QuestManager.FindQuest(missionID)
+        if not questData:
+            continue
+        
+        if questData.Type == QuestCommon.Def_Mission_Type_Piaomiao and mission.GetState() != ChConfig.Def_Mission_State_NoAccept:
+            GameWorld.DebugLog("已经有接了缥缈任务,无法再接!missionID=%s" % missionID)
+            return
+        
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_PiaomiaoTaskTakeCount, todayTakeCount + 1)
     
     QuestCommon.SetPlayerMissionState(curPlayer, curMission, 1)
     
+    curGrade = curMission.GetProperty(QuestCommon.Def_Mission_Grade)
+    if curGrade == Def_MaxGrade:
+        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_PiaomiaoMaxGradeTaskID, curMission.GetMissionID())
+        
     EventShell.NotifyOneMission(curPlayer, curMission, isNotifyAll=False)
     SyncPiaomiaoTaskInfo(curPlayer)
     return

--
Gitblit v1.8.0