From 7d6425827901a98ff9f47b25718542bd81dbbfac Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 08 三月 2021 14:43:41 +0800
Subject: [PATCH] 8807 【BT2】【后端】Part1 14、投资返利送充值券(增加登录投资9、等级投资10、boss投资11;优化永久投资、周卡投资逻辑 同步主干);

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ClearInvest.py |   37 ++++++++++++++++++++++---------------
 1 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ClearInvest.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ClearInvest.py
index 3747330..7621542 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ClearInvest.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ClearInvest.py
@@ -20,6 +20,7 @@
 import PlayerControl
 import GameWorld
 #---------------------------------------------------------------------
+
 #逻辑实现
 ## GM命令执行入口
 #  @param curPlayer 当前玩家
@@ -27,22 +28,28 @@
 #  @return None
 #  @remarks 函数详细说明.
 def OnExec(curPlayer, msgList):
-    GameWorld.DebugAnswer(curPlayer, "ClearInvest 投资类型(不写则全部重置)")
-    investTypeList = [msgList[0]] if msgList else ChConfig.GoldInvestTypeList
-    for itype in investTypeList:
-        valueKey = ChConfig.Def_PDict_GoldInvest_Time % itype
-        PlayerControl.NomalDictSetProperty(curPlayer, valueKey, 0, ChConfig.Def_PDictType_GoldInvest)
-        
-        valueKey = ChConfig.Def_PDict_GoldInvest_Gold % itype
-        PlayerControl.NomalDictSetProperty(curPlayer, valueKey, 0, ChConfig.Def_PDictType_GoldInvest)
-        
-        valueKey = ChConfig.Def_PDict_GoldInvest_AwardData % itype
-        PlayerControl.NomalDictSetProperty(curPlayer, valueKey, 0, ChConfig.Def_PDictType_GoldInvest)
-        for i in range(1, 32):
-            valueKey = ChConfig.Def_PDict_GoldInvest_GotRewardValue % (itype, i)
-            PlayerControl.NomalDictSetProperty(curPlayer, valueKey, 0, ChConfig.Def_PDictType_GoldInvest)
     
-        PlayerGoldInvest.Sync_GoldInvestInfo(curPlayer, itype, isForce=True)
+    if not msgList:
+        GameWorld.DebugAnswer(curPlayer, "重置所有投资: ClearInvest 0")
+        GameWorld.DebugAnswer(curPlayer, "重置指定投资: ClearInvest 类型")
+        GameWorld.DebugAnswer(curPlayer, "类型:7-永久卡;8-周卡;9-登录卡;10-等级卡;11-boss卡;")
+        return
+    
+    investType = msgList[0]
+    if not investType:
+        investTypeList = ChConfig.InvestTypeList
+    elif investType not in ChConfig.InvestTypeList:
+        GameWorld.DebugAnswer(curPlayer, "不存在该投资类型!")
+        return
+    else:
+        investTypeList = [investType]
+        
+    for itype in investTypeList:
+        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_InvestTime % itype, 0)
+        for keyNum in range(ChConfig.Def_PDict_InvestKeyCount):
+            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_InvestReward % (itype, keyNum), 0)
+            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_InvestProgress % (itype, keyNum), 0)
+        PlayerGoldInvest.Sync_InvestInfo(curPlayer, itype)
         
     return
 

--
Gitblit v1.8.0