From 44f826ab007d78df5223841628712af5a42e9d6a Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 27 八月 2025 11:29:52 +0800
Subject: [PATCH] 92 【主界面】主线任务-服务端(修改官职、主线的副本过关任务改为过关主线任务; 完善官职、主线任务支持;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTask.py                            |   25 +++++++++++-
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MainLevel.py |    6 +++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py                            |    8 +++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py                         |    5 ++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerPrestigeSys.py                     |   12 +++--
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py                                     |    5 +-
 6 files changed, 50 insertions(+), 11 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py
index d99d20f..f595ce4 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py
@@ -20,6 +20,7 @@
 #-------------------------------------------------------------------------------
 
 import ChConfig
+import PlayerTask
 import ChPyNetSendPack
 import NetPackCommon
 import PlayerControl
@@ -1347,7 +1348,12 @@
     clientPack.ObjID = objID
     clientPack.KillerObjID = killerObjID
     clientPack.SkillID = skillID
-    turnFight.addBatPack(clientPack)        
+    turnFight.addBatPack(clientPack)
+    
+    curPlayer = turnFight.curPlayer
+    # 暂时只算主线小怪
+    if curPlayer and turnFight.mapID == ChConfig.Def_FBMapID_Main and gameObj.GetFaction() != ChConfig.Def_FactionA:
+        PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_KillNPC, 1)    
     return True
 
 def OnTurnAllOver(guid):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index f24c3c9..68741dd 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -5489,7 +5489,7 @@
 
 # 任务类型定义
 TaskTypeList = (
-TaskType_FBPass, # 副本过关到xxx 1
+TaskType_MainLevel, # 主线过关到xxx 1
 TaskType_TreeLV, # 仙树达到X级 2
 TaskType_EquipDecompose, # 分解装备x次 3
 TaskType_CutTree, # 消耗X个战锤  4
@@ -5497,7 +5497,8 @@
 TaskType_RealmLV, # 境界达到X级 6
 TaskType_KillNPC, # 击败X只怪物 7
 TaskType_GetMoney, # 累计获得xx货币 8
-) = range(1, 1 + 8)
+TaskType_EquipColor, # 穿戴x件x品质及以上装备 9
+) = range(1, 1 + 9)
 
 # 任务分组
 TaskGroupList = (
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MainLevel.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MainLevel.py
index 65f15e2..fba8115 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MainLevel.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MainLevel.py
@@ -25,6 +25,7 @@
 import IPY_GameWorld
 import NetPackCommon
 import ItemCommon
+import PlayerTask
 import NPCCommon
 import ChEquip
 import ObjPool
@@ -307,6 +308,8 @@
         
     # 刷属性
     ChEquip.RefreshRoleEquipAttr(curPlayer)
+    
+    PlayerTask.UpdTaskValue(curPlayer, ChConfig.TaskType_EquipColor)
     return
 
 def __doDecomposeMainEquip(curPlayer, itemIndexList):
@@ -320,6 +323,7 @@
     
     moneyTotal = 0
     
+    decomposeCnt = 0
     decomposeIndexList = []
     for itemIndex in itemIndexList:
         if itemIndex < 0 or itemIndex >= IdentifyPack.GetCount():
@@ -350,11 +354,13 @@
         
         ItemCommon.DelItem(curPlayer, curEquip, curEquip.GetCount(), True, ChConfig.ItemDel_EquipDecompose)
         decomposeIndexList.append(itemIndex)
+        decomposeCnt += 1
         
     if not moneyTotal:
         return
     
     PlayerControl.GiveMoney(curPlayer, moneyType, moneyTotal, "DecomposeMainEquip", isSysHint=False)
+    PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_EquipDecompose, decomposeCnt)
     return
 
 def __doPickupMainItem(curPlayer, itemIndexList):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
index 68e8e37..6b6254a 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
@@ -2806,6 +2806,9 @@
                 NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_UnXiantaoCntBooty % itemID, unXiantaoCntBooty + price)
                 
         PlayerPrestigeSys.AddRealmTaskValue(curPlayer, PlayerPrestigeSys.RealmTaskType_UseXiantao, price)
+        PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_CutTree, price)
+        
+        
     unitPrice = price if quantity == 1 else int(math.ceil(price * 1.0 / quantity)) # 单价
     #reason_name = "Unknown" if not costType else costType
     reason_name = costType
@@ -4408,6 +4411,8 @@
     # @param wave: 第x波
     value = ComMainLevelValue(chapterID, levelNum, wave)
     SetMainLevelPassValue(curPlayer, value)
+    if wave == 0:
+        PlayerTask.UpdTaskValue(curPlayer, ChConfig.TaskType_MainLevel)
     return value
 def GetMainLevelPassInfo(curPlayer):
     ## 获取主线关卡过关进度信息
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerPrestigeSys.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerPrestigeSys.py
index e1d4b11..0b403ff 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerPrestigeSys.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerPrestigeSys.py
@@ -29,13 +29,14 @@
 import PlayerBillboard
 import PlayerTongTianLing
 import PlayerGubao
+import PlayerTask
 
 #------------------------------------------------------------------------------
 
 # 渡劫任务类型
 RealmTaskTypeList = (
 RealmTaskType_LV, # 等级 1
-RealmTaskType_PassMap, # 过关关卡 2
+RealmTaskType_MainLevel, # 主线关卡 2
 RealmTaskType_UseXiantao, # 消耗战锤 3
 RealmTaskType_TreeLV, # 仙树等级 4
 ) = range(1, 1 + 4)
@@ -170,10 +171,10 @@
                                % (realmLV, taskID, taskType, playerLV, needValueA), playerID)
             return
         
-    # 过关副本
-    elif taskType == RealmTaskType_PassMap:
-        mapID = needValueA
-        lineID = GetRealmTaskNeedValue(needValueList, 1)
+    # 主线关卡
+    elif taskType == RealmTaskType_MainLevel:
+        mapID = ChConfig.Def_FBMapID_Main
+        lineID = needValueA
         if not FBCommon.IsFBPass(curPlayer, mapID, lineID):
             GameWorld.DebugLog('境界任务领奖,未过关! realmLV=%s,taskID=%s,taskType=%s,mapID=%s,lineID=%s' 
                                % (realmLV, taskID, taskType, mapID, lineID), playerID)
@@ -273,6 +274,7 @@
     #境界提升成就
     PlayerSuccess.UptateSuccessProgress(curPlayer, ShareDefine.SuccType_RealmlvUp, nextRealmLv)
     PlayerTongTianLing.AddTongTianTaskValue(curPlayer, ChConfig.TTLTaskType_RealmUp, 1)
+    PlayerTask.UpdTaskValue(curPlayer, ChConfig.TaskType_RealmLV)
     #更新排行榜
     PlayerBillboard.UpdateRealmBillboard(curPlayer)
     # 记录开服活动
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 0d8eef3..67b8319 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTask.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTask.py
@@ -145,10 +145,11 @@
     if taskType == ChConfig.TaskType_LV:
         taskValue = curPlayer.GetLV()
         
-    elif taskType == ChConfig.TaskType_FBPass:
-        if len(conds) != 2:
+    elif taskType == ChConfig.TaskType_MainLevel:
+        if not conds:
             return 0
-        mapID, lineID = conds
+        mapID = ChConfig.Def_FBMapID_Main
+        lineID = conds[0]
         taskValue = 1 if FBCommon.IsFBPass(curPlayer, mapID, lineID) else 0
         
     elif taskType == ChConfig.TaskType_TreeLV:
@@ -157,6 +158,24 @@
     elif taskType == ChConfig.TaskType_RealmLV:
         taskValue = curPlayer.GetOfficialRank()
         
+    elif taskType == ChConfig.TaskType_EquipColor:
+        if not conds:
+            return 0
+        needColor = conds[0]
+        equipCnt = 0
+        equipPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
+        for equipPlace in ChConfig.Def_MainEquipPlaces:
+            equipIndex = equipPlace - 1
+            if equipIndex < 0 or equipIndex >= equipPack.GetCount():
+                continue
+            curEquip = equipPack.GetAt(equipIndex)
+            if not curEquip or curEquip.IsEmpty():
+                continue
+            itemColor = curEquip.GetItemColor()
+            if itemColor >= needColor:
+                equipCnt += 1
+        taskValue = equipCnt
+        
     return taskValue
 
 def UpdTaskValue(curPlayer, taskType):

--
Gitblit v1.8.0