From 1ea0e353d47a78209a18f619374da252a0080940 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 19 四月 2024 19:13:43 +0800
Subject: [PATCH] 10054 【后端】任务系统(增加任务类型支持 6~16;优化修改任务值配置时上线进行修正进度值或任务状态;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Task.py |   33 +++++++++++++++++++++++++++++----
 1 files changed, 29 insertions(+), 4 deletions(-)

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 fc5d6cf..ea9f48c 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
@@ -26,14 +26,15 @@
 #  @param playerList 参数列表 [ missionID]
 #  @return None
 #  @remarks 函数详细说明.
-def OnExec(curPlayer, playerList):
+def OnExec(curPlayer, paramList):
     
-    if len(playerList) == 0:
+    if len(paramList) == 0:
         GameWorld.DebugAnswer(curPlayer, "重置主线: Task 0")
+        GameWorld.DebugAnswer(curPlayer, "输出任务: Task 1")
         GameWorld.DebugAnswer(curPlayer, "设置任务: Task 任务ID 进度")
         return
     
-    taskID = playerList[0]
+    taskID = paramList[0]
     if not taskID:
         taskGroup = ChConfig.TaskGroup_Main
         PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TaskIDLast % taskGroup, 0)
@@ -43,7 +44,11 @@
         PlayerTask.__giveNewTask(curPlayer, taskGroup)
         return
     
-    taskValue = playerList[1] if len(playerList) > 1 else 0
+    if len(paramList) == 1 and paramList[0] == 1:
+        __ShowTask(curPlayer)
+        return
+    
+    taskValue = paramList[1] if len(paramList) > 1 else 0
     ipyData = IpyGameDataPY.GetIpyGameData("Task", taskID)
     if not ipyData:
         GameWorld.DebugAnswer(curPlayer, "该任务ID不存在:%s" % taskID)
@@ -59,3 +64,23 @@
     GameWorld.DebugAnswer(curPlayer, "设置任务ID:%s  进度:%s/%s" % (taskID, curValue, needValue))
     return
 
+def __ShowTask(curPlayer):
+    taskCount = 0
+    for taskGroup in ChConfig.TaskGroupList:
+        taskID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TaskID % taskGroup)
+        if not taskID:
+            continue
+        ipyData = IpyGameDataPY.GetIpyGameData("Task", taskID)
+        if not ipyData:
+            continue
+        curState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TaskState % taskGroup)
+        curValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TaskValue % taskGroup)
+        needValue = ipyData.GetNeedValue()
+        GameWorld.DebugAnswer(curPlayer, "任务ID:%s 进度:%s/%s 状态:%s" % (taskID, curValue, needValue, curState))
+        taskCount += 1
+        
+    if not taskCount:
+        GameWorld.DebugAnswer(curPlayer, "当前没有任务!")       
+        
+    return
+

--
Gitblit v1.8.0