From ab3c1e29995e5bae442a06bbd8c4ae821efe88d0 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 27 十一月 2025 11:11:46 +0800
Subject: [PATCH] 129 【战斗】战斗系统-服务端(优化被动buff触发有效效果逻辑;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTask.py |   67 ++++++++++++++++++++++++++++++---
 1 files changed, 60 insertions(+), 7 deletions(-)

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..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
@@ -145,17 +146,60 @@
     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_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)
         
     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
 
@@ -287,13 +331,22 @@
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TaskValue % taskGroup, 0)
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TaskState % taskGroup, 0)
     
-    for itemID, itemCount, isAuctionItem in awardItemList:
-        ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, isAuctionItem, [IPY_GameWorld.rptItem])
-        
+    # 支持定制属性物品
+    isAuctionItem = 0
+    notifyAwardList = []
+    appointInfo = {}
+    for itemID, itemCount, appointID in awardItemList:
+        setAttrDict = {ShareDefine.Def_CItemKey_AppointID:appointID} if appointID else {}
+        if not ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, isAuctionItem, event=["Task", False, {}], setAttrDict=setAttrDict):
+            continue
+        notifyAwardList.append([itemID, itemCount, isAuctionItem])
+        appointInfo[itemID] = appointID
+    ItemControler.NotifyGiveAwardInfo(curPlayer, notifyAwardList, "Task", dataEx={"appointInfo":appointInfo})
+    
     if not __giveNewTask(curPlayer, taskGroup):
         SyncTaskInfo(curPlayer, [taskGroup])
         
-    GameFuncComm.DoFuncOpenLogic(curPlayer, [taskID])
+    GameFuncComm.DoFuncOpenLogic(curPlayer)
     return
 
 def SyncTaskInfo(curPlayer, taskGroupList=None):

--
Gitblit v1.8.0