From 799d20c362856decaf211b98f102dd36fc1df180 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 24 十一月 2025 18:52:02 +0800
Subject: [PATCH] 92 【主界面】主线任务-服务端(增加任务类型11~19;优化任务类型10创角后挑战过就算;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MainLevelBoss.py |    4 +
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerHero.py                                |    4 ++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Zhanchui.py      |    4 ++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamily.py                              |    3 +
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTask.py                                |   35 ++++++++++++-----
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Task.py                                 |   10 +++-
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldRush.py                            |    5 ++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerHorse.py                               |    3 +
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Arena.py         |    3 +
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py                                         |   12 +++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Tianzi.py        |    2 +
 11 files changed, 70 insertions(+), 15 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index 2a6e740..6084922 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -3838,6 +3838,7 @@
 Def_PDict_UnXiantaoCntBooty = "UnXiantaoCntBooty_%s" # 累计未结算战利品掉落的战锤数,参数(itemID)
 Def_PDict_BootyDropToday = "BootyDropToday_%s" # 今日已累计掉落战利品数量,参数(itemID)
 Def_PDict_AppointDropEquipCnt = "AppointDropEquipCnt" # 定制掉落装备掉落第x次,只记录到配置的最高次数
+Def_PDict_ChallengeLVID = "ChallengeLVID" # 最后一次挑战的关卡ID,无论胜负
 
 #天子考验
 Def_PDict_TianziHisHurt = "TianziHisHurt_%s" # 历史最高伤害,求余亿部分,参数(bossID)
@@ -5094,7 +5095,16 @@
 TaskType_GetMoney, # 累计获得xx货币 8
 TaskType_EquipColor, # 穿戴x件x品质及以上装备 9
 TaskType_MainLevelChallenge, # 主线挑战xxx 10
-) = range(1, 1 + 10)
+TaskType_ArenaBattle, # 演武场战斗x次 11
+TaskType_HorseLVUP, # 坐骑升级x次 12
+TaskType_FBZhanchui, # 白骨盈野击败xx 13
+TaskType_HeroLVUP, # 武将升级X次 14
+TaskType_HeroStarUP, # 武将升星x次 15
+TaskType_GoldRush, # 淘金采集x次 16
+TaskType_GoldRushWorkers, # 拥有x名监工 17
+TaskType_ReqOrJoinFamily, # 创建或者申请加入公会 18
+TaskType_FBTianzi, # 挑战天子的考验x次 19
+) = range(1, 1 + 19)
 
 # 任务分组
 TaskGroupList = (
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Task.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Task.py
index c164703..f9e8542 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Task.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Task.py
@@ -44,18 +44,22 @@
         PlayerTask.__giveNewTask(curPlayer, taskGroup)
         return
     
-    taskValue = paramList[1] if len(paramList) > 1 else 0
+    taskValue = paramList[1] if len(paramList) > 1 else None
     ipyData = IpyGameDataPY.GetIpyGameData("Task", taskID)
     if not ipyData:
         GameWorld.DebugAnswer(curPlayer, "该任务ID不存在:%s" % taskID)
         return
     taskGroup = ipyData.GetTaskGroup()
+    taskType = ipyData.GetTaskType()
     needValue = ipyData.GetNeedValue()
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TaskID % taskGroup, taskID)
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TaskValue % taskGroup, taskValue)
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TaskState % taskGroup, ChConfig.TaskState_Doing)
-    PlayerTask.SetTaskValue(curPlayer, ipyData, taskValue)
-    
+    if taskValue == None:
+        PlayerTask.UpdTaskValue(curPlayer, taskType)
+    else:
+        PlayerTask.SetTaskValue(curPlayer, ipyData, taskValue)
+        
     curValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TaskValue % taskGroup)
     GameWorld.DebugAnswer(curPlayer, "设置任务ID:%s  进度:%s/%s" % (taskID, curValue, needValue))
     return
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Arena.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Arena.py
index f9d3308..e0ec257 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Arena.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Arena.py
@@ -29,6 +29,7 @@
 import PlayerArena
 import PlayerGubao
 import PyGameData
+import PlayerTask
 import FBCommon
 import ChConfig
 
@@ -68,6 +69,8 @@
     if not PlayerControl.HaveMoney(curPlayer, ShareDefine.TYPE_Price_ArenaTicket, 1):
         return
     
+    PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_ArenaBattle)
+    
     return True, funcLineID
 
 def GetFBPlayerLineupID(curPlayer, mapID, funcLineID):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MainLevelBoss.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MainLevelBoss.py
index 3d11e6e..52ba12f 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MainLevelBoss.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MainLevelBoss.py
@@ -60,7 +60,9 @@
         GameWorld.DebugLog("最后一波未通过,无法挑战本关boss! passWave=%s < %s" % (wave, waveMax))
         return
     
-    PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_MainLevelChallenge, 1, [levelID])
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ChallengeLVID, levelID)
+    
+    PlayerTask.UpdTaskValue(curPlayer, ChConfig.TaskType_MainLevelChallenge)
     
     return True, levelID
 
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Tianzi.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Tianzi.py
index f5d9a48..1cdb7fb 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Tianzi.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Tianzi.py
@@ -25,6 +25,7 @@
 import NetPackCommon
 import IpyGameDataPY
 import ShareDefine
+import PlayerTask
 import PlayerMail
 import DBDataMgr
 import TurnSkill
@@ -81,6 +82,7 @@
         GameWorld.DebugLog("非今日天子考验! mapID=%s,funcLineID=%s != %s,bossID=%s" % (mapID, funcLineID, lineID, bossID))
         return
     
+    PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_FBTianzi)
     return True, funcLineID
 
 def GetFBNPCInitAttr(curPlayer, turnFight, npcObj):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Zhanchui.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Zhanchui.py
index 4aa788e..b88a642 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Zhanchui.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Zhanchui.py
@@ -19,6 +19,8 @@
 import ItemControler
 import PlayerBeauty
 import FBCommon
+import PlayerTask
+import ChConfig
 
 def OnTurnFightRequest(curPlayer, mapID, funcLineID, tagType, tagID, valueList):
     ## 回合战斗请求 
@@ -65,6 +67,8 @@
     FBCommon.AddEnterFBCount(curPlayer, mapID, isFree=True)
     FBCommon.SetFBPass(curPlayer, mapID, funcLineID)
     ItemControler.GivePlayerItemOrMail(curPlayer, itemList, event=["Zhanchui", False, {}], isNotifyAward=False)
+    
+    PlayerTask.UpdTaskValue(curPlayer, ChConfig.TaskType_FBZhanchui)
     return
     
 def OnPlayerFBSweepAsk(curPlayer, mapID, lineID, sweepCnt, dataEx):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamily.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamily.py
index 93c6f86..dceae35 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamily.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamily.py
@@ -30,6 +30,7 @@
 import IPY_GameWorld
 import ItemControler
 import GameFuncComm
+import PlayerTask
 import DBDataMgr
 import DirtyList
 import ObjPool
@@ -465,6 +466,7 @@
     familyMgr.DelPlayerReqJoinFamilyIDAll(curPlayer.GetPlayerID())
     Sync_RequestAddFamilyInfo(curPlayer)
     PlayerFamilyTaofa.OnPlayerEnterFamily(curPlayer)
+    PlayerTask.UpdTaskValue(curPlayer, ChConfig.TaskType_ReqOrJoinFamily)
     return
 
 def __OnLeaveFamily(curPlayer, isVoluntarily, tick):
@@ -661,6 +663,7 @@
     
     # 申请加入
     if requestType == 0:
+        PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_ReqOrJoinFamily, 1)
         if not tagFamilyID:
             AutoJoinFamily(curPlayer)
         else:
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldRush.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldRush.py
index 1d67bb6..556531d 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldRush.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldRush.py
@@ -26,6 +26,7 @@
 import GameFuncComm
 import PlayerGubao
 import ShareDefine
+import PlayerTask
 import ObjPool
 
 import time
@@ -315,6 +316,8 @@
     campInfo = SetCampInfo(curPlayer, campID, refreshCnt, goldID, updWorkerCnt)
     GameWorld.DebugLog("    updWorkerCnt=%s,realNeedSeconds=%s,endTime=%s,campInfo=%s" 
                        % (updWorkerCnt, realNeedSeconds, GameWorld.ChangeTimeNumToStr(endTime), campInfo))
+    
+    PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_GoldRush, 1)
     return
 
 def GetWorkerTotal(curPlayer):
@@ -410,6 +413,8 @@
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GoldRushWorkerState, workerState)
     GameWorld.DebugLog("解锁淘金监工: workerID=%s,workerState=%s" % (workerID, workerState))
     SyncGoldRushInfo(curPlayer)
+    
+    PlayerTask.UpdTaskValue(curPlayer, ChConfig.TaskType_GoldRushWorkers)
     return
 
 #// B0 38 淘金仓库领奖 #tagCSGoldRushWarehouseAward
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerHero.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerHero.py
index d429bc5..420847f 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerHero.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerHero.py
@@ -25,6 +25,7 @@
 import NetPackCommon
 import PlayerControl
 import PlayerOnline
+import PlayerTask
 import GameWorld
 import ChConfig
 
@@ -353,6 +354,7 @@
     PlayerOnline.GetOnlinePlayer(curPlayer).OnHeroItemUpate([itemIndex])
     
     PlayerActivity.AddDailyTaskValue(curPlayer, ChConfig.DailyTask_HeroLVUP, 1)
+    PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_HeroLVUP)
     return
 
 def GetHeroLVMax(heroItem):
@@ -472,6 +474,8 @@
     if addStar > 0:
         __DoHeroStarTalentUp(item, addStar)
         PlayerActivity.AddDailyTaskValue(curPlayer, ChConfig.DailyTask_HeroStarUP, addStar)
+        PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_HeroStarUP, addStar)
+        
     if isSync:
         heroItem.Sync_Item()
     
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerHorse.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerHorse.py
index df1bd30..729cf68 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerHorse.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerHorse.py
@@ -25,6 +25,7 @@
 import IpyGameDataPY
 import GameFuncComm
 import PlayerOnline
+import PlayerTask
 import GameWorld
 import ObjPool
 
@@ -119,6 +120,8 @@
     # 有升级额外处理
     if updHorseLV > horseLV:
         RefreshHorseAttr(curPlayer)
+        
+    PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_HorseLVUP, costItemCount)
     return
 
 #// B2 02 坐骑进阶 #tagCSHorseClassUP
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTask.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTask.py
index 5feda41..2cf1796 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTask.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTask.py
@@ -19,6 +19,7 @@
 import IpyGameDataPY
 import PlayerControl
 import NetPackCommon
+import PlayerGoldRush
 import ChPyNetSendPack
 import ItemControler
 import IPY_GameWorld
@@ -152,6 +153,30 @@
         lineID = conds[0]
         taskValue = 1 if FBCommon.IsFBPass(curPlayer, mapID, lineID) else 0
         
+    # 挑战主线关
+    elif taskType == ChConfig.TaskType_MainLevelChallenge:
+        if not conds:
+            return 0
+        mapID = ChConfig.Def_FBMapID_Main
+        lvID = conds[0]
+        taskValue = 1 if PlayerControl.IsMainLevelPass(curPlayer, lvID) else 0
+        if not taskValue:
+            challengeLVID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ChallengeLVID)
+            taskValue = 1 if challengeLVID >= lvID else 0
+            
+    elif taskType == ChConfig.TaskType_FBZhanchui:
+        if not conds:
+            return 0
+        mapID = ChConfig.Def_FBMapID_Zhanchui
+        lineID = conds[0]
+        taskValue = 1 if FBCommon.IsFBPass(curPlayer, mapID, lineID) else 0
+        
+    elif taskType == ChConfig.TaskType_GoldRushWorkers:
+        taskValue = PlayerGoldRush.GetWorkerTotal(curPlayer)
+        
+    elif taskType == ChConfig.TaskType_ReqOrJoinFamily:
+        taskValue = 1 if curPlayer.GetFamilyID() else 0
+        
     elif taskType == ChConfig.TaskType_TreeLV:
         taskValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TreeLV)
         
@@ -230,16 +255,6 @@
             return
         if conds[0] != taskConds[0]:
             return
-        
-    # 挑战主线关
-    elif taskType == ChConfig.TaskType_MainLevelChallenge:
-        taskConds = ipyData.GetTaskConds()
-        if not conds or len(conds) != len(taskConds):
-            return
-        if conds[0] < taskConds[0]:
-            #GameWorld.DebugLog("挑战小于的不算完成: %s < TaskCond:%s" % (conds[0], taskConds[0]))
-            return
-        #GameWorld.DebugLog("挑战大于等于都算完整: %s >= TaskCond:%s" % (conds[0], taskConds[0]))
         
     return True
 

--
Gitblit v1.8.0