From 866ce280c4c931a34cedd06d86b81019018d4160 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 03 一月 2020 20:33:56 +0800
Subject: [PATCH] 8364 【恺英】【后端】缥缈随机任务(S副本未处理)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py |   56 +++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 49 insertions(+), 7 deletions(-)

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 335e550..102265c 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py
@@ -98,12 +98,13 @@
 import EventReport
 import PlayerCoat
 import PlayerGatherSoul
-import PlayerArrestTask
+#import PlayerArrestTask
 import PlayerRune
 import IpyGameDataPY
 import FormulaControl
 import GameFuncComm
 import ChPyNetSendPack
+import PlayerPiaomiaoTask
 import NetPackCommon
 import NPCCommon
 import PlayerVip
@@ -1573,9 +1574,13 @@
         GameWorld.DebugLog("任务状态(%s)不可提交,不能完成任务!taskID=%s" % (missionState, taskID))
         return
     
+    curQuestData = QuestManager.FindQuest(taskID)
+    if curQuestData.Type == QuestCommon.Def_Mission_Type_Piaomiao:
+        PlayerPiaomiaoTask.OnFinishPiaomiaoTask(curPlayer, curMission)
+        return
+    
     rewardPer = 100 if rewardPer <= 0 else rewardPer
     moneyType, moneyCnt = 0, 0
-    curQuestData = QuestManager.FindQuest(taskID)
     # 环任务支持多倍奖励领取
     if curQuestData != None and curQuestData.Type in QuestCommon.Def_RunTask_Type_List:
         if rewardPer != 100:
@@ -3960,15 +3965,22 @@
         PlayerControl.NotifyCode(curPlayer, "Task_cannot_Delete02")
         return
     
-    if GameWorld.GetMap().GetMapFBType() != IPY_GameWorld.fbtNull:
-        PlayerControl.NotifyCode(curPlayer, "GeRen_hgg_880525")
+    #if GameWorld.GetMap().GetMapFBType() != IPY_GameWorld.fbtNull:
+    #    PlayerControl.NotifyCode(curPlayer, "GeRen_hgg_880525")
+    #    return
+    
+    curQuestData = QuestManager.FindQuest(missionID)
+    if not curQuestData:
         return
     
     #放弃悬赏任务
-    if missionID == ChConfig.Def_ArrestMissionID:
-        PlayerArrestTask.OnDeleteArrestTask(curPlayer)
+    #if missionID == ChConfig.Def_ArrestMissionID:
+    #    PlayerArrestTask.OnDeleteArrestTask(curPlayer)
         
-        
+    if curQuestData.Type == QuestCommon.Def_Mission_Type_Piaomiao:
+        PlayerPiaomiaoTask.DoCancelPiaomiaoTask(curPlayer, curMission)
+        return
+    
     #先在任务表中找数据, 如果找到了, 就不遍历XML了
     if __DoLogic_DeleteMission(curPlayer, curMission):
         GameWorld.Log("在任务表中找数据, 删除任务 = %s, 状态 = %s"%(missionID, missionState), curPlayer.GetID())
@@ -4877,6 +4889,36 @@
     RunQuestEvent(curPlayer, "on_revlogintype_event", "on_revlogintype_event", Def_RunQuestType_Normal)
     return
 
+#// A2 07 接受任务 #tagCMTakeTask
+#
+#struct    tagCMTakeTask
+#{
+#    tagHead        Head;
+#    DWORD        TaskID;
+#};
+def OnTakeTask(index, clientData, tick):
+    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
+    
+    missionID = clientData.TaskID
+    curMission = curPlayer.FindMission(missionID)
+    if not curMission:
+        return
+    
+    missionState = curMission.GetState()
+    if missionState != ChConfig.Def_Mission_State_NoAccept:
+        return
+    
+    curQuestData = QuestManager.FindQuest(missionID)
+    if not curQuestData:
+        return
+    
+    if curQuestData.Type == QuestCommon.Def_Mission_Type_Piaomiao:
+        PlayerPiaomiaoTask.OnTakePiaomiaoTask(curPlayer, curMission)
+        return
+    
+    QuestCommon.SetPlayerMissionState(curPlayer, curMission, 1)
+    return
+
 #// A2 18 完成任务 #tagCMFinishTask
 #
 #struct tagCMFinishTask

--
Gitblit v1.8.0