From c409f8d2d3ac5530b7dc1f14c15715beb3bb1da7 Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期四, 14 三月 2019 17:42:47 +0800
Subject: [PATCH] 6307 【后端】【2.0】多套装备开发单(GM命令修改)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetEquipPartPlusLV.py |   80 +++++++++++++++++----------------------
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetEquipPartStar.py   |   40 ++++++++++++++++++-
 2 files changed, 72 insertions(+), 48 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetEquipPartPlusLV.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetEquipPartPlusLV.py
index f8f110c..4825741 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetEquipPartPlusLV.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetEquipPartPlusLV.py
@@ -23,6 +23,7 @@
 import GameWorld
 import ItemCommon
 import IpyGameDataPY
+import PlayerControl
 #---------------------------------------------------------------------
 #逻辑实现
 ## GM命令执行入口
@@ -36,9 +37,29 @@
         return
     packType = IPY_GameWorld.rptEquip
     curPack = curPlayer.GetItemManager().GetPack(packType)
-    if len(cmdList) == 2:
-        setStarLV = cmdList[1]
+    
+    if len(cmdList) == 1: #设置所有
+        setStarLV = cmdList[0]
+        equipMaxClasslv = IpyGameDataPY.GetFuncCfg('EquipMaxClasslv')
+        for equipPlace in ChConfig.Pack_EquipPart_CanPlusStar.get(packType, []):
+            for classlv in xrange(1, equipMaxClasslv+1):
+                ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classlv, equipPlace)
+                if not ipyData:
+                    continue 
+                gridIndex = ipyData.GetGridIndex()
+                curEquip = curPack.GetAt(gridIndex)
+                ChEquip.SetEquipPartPlusLV(curPlayer, packType, gridIndex, curEquip, setStarLV)
+                ChEquip.SetEquipPartProficiency(curPlayer, packType, gridIndex, 0)
+                ChEquip.SetEquipPartPlusEvolveLV(curPlayer, packType, gridIndex, 0)
+        #刷新所有属性
+        ChEquip.RefreshPlayerEquipAttribute(curPlayer)
+        playControl = PlayerControl.PlayerControl(curPlayer)
+        playControl.RefreshPlayerAttrState()
+        ChEquip.NotifyEquipPartPlusLV(curPlayer)
+        GameWorld.DebugAnswer(curPlayer, "设置所有部位强化等级为: %s" % (setStarLV))
+    elif len(cmdList) == 2:
         classLV = cmdList[0]
+        setStarLV = cmdList[1]
         for equipPlace in ChConfig.Pack_EquipPart_CanPlusStar.get(packType, []):
             ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classLV, equipPlace)
             if not ipyData:
@@ -48,7 +69,7 @@
             ChEquip.SetEquipPartPlusLV(curPlayer, packType, gridIndex, curEquip, setStarLV)
             ChEquip.SetEquipPartProficiency(curPlayer, packType, gridIndex, 0)
             ChEquip.SetEquipPartPlusEvolveLV(curPlayer, packType, gridIndex, 0)
-            Operate_EquipPlus.DoLogic_OnEquipPartStarLVChange(curPlayer, packType, classLV)
+        Operate_EquipPlus.DoLogic_OnEquipPartStarLVChange(curPlayer, packType, classLV)
         ChEquip.NotifyEquipPartPlusLV(curPlayer)
         GameWorld.DebugAnswer(curPlayer, "设置%s阶所有部位强化等级为: %s" % (classLV, setStarLV))
         return
@@ -58,65 +79,34 @@
         return
     
     classLV, equipPlace, starLV = cmdList
-    if packType not in ChConfig.Pack_EquipPart_CanPlusStar:
-        __GMHelpAnswer(curPlayer, "packType不存在!")
-        return
     
     if equipPlace not in ChConfig.Pack_EquipPart_CanPlusStar[packType]:
-        __GMHelpAnswer(curPlayer, "index索引不存在!")
+        __GMHelpAnswer(curPlayer, "部位不存在!")
         return
     ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classLV, equipPlace)
     if not ipyData:
         return
     gridIndex = ipyData.GetGridIndex()
     curEquip = curPack.GetAt(gridIndex)
-    if not ItemCommon.CheckItemCanUse(curEquip):
-        return
-    maxStarLV = ItemCommon.GetItemMaxPlusLV(curPlayer, gridIndex, curEquip)
-    starLV = min(starLV, maxStarLV)
+#    if not ItemCommon.CheckItemCanUse(curEquip):
+#        return
+#    maxStarLV = ItemCommon.GetItemMaxPlusLV(curPlayer, gridIndex, curEquip)
+#    starLV = min(starLV, maxStarLV)
     ChEquip.SetEquipPartPlusLV(curPlayer, packType, gridIndex, curEquip, starLV)
     ChEquip.SetEquipPartProficiency(curPlayer, packType, gridIndex, 0)
     Operate_EquipPlus.DoLogic_OnEquipPartStarLVChange(curPlayer, packType, classLV)
+    ChEquip.NotifyEquipPartPlusLV(curPlayer, packType, gridIndex)
+    GameWorld.DebugAnswer(curPlayer, "设置%s阶%s部位强化等级为: %s" % (classLV, equipPlace, starLV))
     return
 
 
 def __GMHelpAnswer(curPlayer, errorMsg=""):
     if errorMsg:
         GameWorld.DebugAnswer(curPlayer, "%s" % errorMsg)
+        GameWorld.DebugAnswer(curPlayer, "SetEquipPartPlusLV 等级  设置所有")
+        GameWorld.DebugAnswer(curPlayer, "SetEquipPartPlusLV 阶级 强化等级")
+        GameWorld.DebugAnswer(curPlayer, "SetEquipPartPlusLV 阶级 部位 强化等级")
     
-    packTypeStrDict = {
-                       IPY_GameWorld.rptEquip:"装备背包",
-                       IPY_GameWorld.rptHorseEquip:"坐骑装备背包",
-                       }
-    
-#===============================================================================
-#    indexStrDict = {
-#                    "%s_%s" % (IPY_GameWorld.rptEquip, IPY_GameWorld.retMask):"头盔",
-#                    "%s_%s" % (IPY_GameWorld.rptEquip, IPY_GameWorld.retClothes):"衣服",
-#                    "%s_%s" % (IPY_GameWorld.rptEquip, IPY_GameWorld.retArm):"护手",
-#                    "%s_%s" % (IPY_GameWorld.rptEquip, IPY_GameWorld.retTrousers):"裤子",
-#                    "%s_%s" % (IPY_GameWorld.rptEquip, IPY_GameWorld.retShoes):"鞋子",
-#                    "%s_%s" % (IPY_GameWorld.rptEquip, IPY_GameWorld.retNeck):"项链",
-#                    "%s_%s" % (IPY_GameWorld.rptEquip, IPY_GameWorld.retRingLeft):"左戒指",
-#                    "%s_%s" % (IPY_GameWorld.rptEquip, IPY_GameWorld.retRingRight):"右戒指",
-#                    "%s_%s" % (IPY_GameWorld.rptEquip, ShareDefine.retWeapon):"右手武器",
-#                    "%s_%s" % (IPY_GameWorld.rptEquip, ShareDefine.retWeapon2):"左手武器",
-#                    "%s_%s" % (IPY_GameWorld.rptEquip, IPY_GameWorld.retAmulet):"护符",
-#                    "%s_%s" % (IPY_GameWorld.rptEquip, IPY_GameWorld.retBelt):"腰带",
-# 
-#                    }
-#===============================================================================
-    
-    #===========================================================================
-    # GameWorld.DebugAnswer(curPlayer, "SetEquipPartPlusLV 参数[packType, index, starLV]")
-    # for pType, indexList in ChConfig.Pack_EquipPart_CanPlusStar.items():
-    #    GameWorld.DebugAnswer(curPlayer, "    packType=%s(%s)时" % (pType, packTypeStrDict.get(pType, "")))
-    #    indexStr = "index="
-    #    for i in indexList:
-    #        indexStr += "%s(%s)," % (i, indexStrDict.get("%s_%s" % (pType, i), ""))
-    #    GameWorld.DebugAnswer(curPlayer, "        %s" % indexStr)
-    #    
-    # GameWorld.DebugAnswer(curPlayer, "    SetEquipPartPlusLV 强化等级 可重置所有部位为对应的强化等级")
-    # GameWorld.DebugAnswer(curPlayer, "------------------------------")
+
     #===========================================================================
     return
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetEquipPartStar.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetEquipPartStar.py
index 3a69ff9..eb6af53 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetEquipPartStar.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetEquipPartStar.py
@@ -20,6 +20,8 @@
 import ChEquip
 import GameWorld
 import IpyGameDataPY
+import ChConfig
+import IPY_GameWorld
 #---------------------------------------------------------------------
 #逻辑实现
 ## GM命令执行入口
@@ -31,7 +33,36 @@
     if not cmdList:
         __GMHelpAnswer(curPlayer)
         return
-    
+    if len(cmdList) == 1:
+        starLV = cmdList[0]
+        equipMaxClasslv = IpyGameDataPY.GetFuncCfg('EquipMaxClasslv')
+        for equipPlace in ChConfig.Pack_EquipPart_CanPlusStar.get(IPY_GameWorld.rptEquip, []):
+            for classlv in xrange(1, equipMaxClasslv+1):
+                ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classlv, equipPlace)
+                if not ipyData:
+                    continue 
+                equipPackIndex = ipyData.GetGridIndex()
+                ChEquip.SetEquipPartStar(curPlayer, equipPackIndex, starLV)
+        ChEquip.NotifyEquipPartStar(curPlayer)
+        ChEquip.RefreshPlayerEquipAttribute(curPlayer)
+        playControl = PlayerControl.PlayerControl(curPlayer)
+        playControl.RefreshPlayerAttrState()
+        GameWorld.DebugAnswer(curPlayer, "设置所有部位星数为: %s" % (starLV))
+    elif len(cmdList) == 2:
+        classLV, starLV = cmdList
+        for equipPlace in ChConfig.Pack_EquipPart_CanPlusStar.get(IPY_GameWorld.rptEquip, []):
+
+            ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classLV, equipPlace)
+            if not ipyData:
+                continue 
+            equipPackIndex = ipyData.GetGridIndex()
+            ChEquip.SetEquipPartStar(curPlayer, equipPackIndex, starLV)
+        ChEquip.NotifyEquipPartStar(curPlayer)
+        ChEquip.RefreshPlayerEquipAttribute(curPlayer, classLV)
+        playControl = PlayerControl.PlayerControl(curPlayer)
+        playControl.RefreshPlayerAttrState()
+        GameWorld.DebugAnswer(curPlayer, "设置%s阶所有部位星数为: %s" % (classLV, starLV))
+        
     if len(cmdList) != 3:
         return
     classlv, equipPlace, starLV = cmdList
@@ -45,12 +76,15 @@
     ChEquip.RefreshPlayerEquipAttribute(curPlayer, classlv)
     playControl = PlayerControl.PlayerControl(curPlayer)
     playControl.RefreshPlayerAttrState()
+    GameWorld.DebugAnswer(curPlayer, "设置%s阶%s部位星数为: %s" % (classLV, equipPlace, starLV))
     return
 
 
-def __GMHelpAnswer(curPlayer, errorMsg="参数列表 [classlv, equipPlace, starLV]"):
+def __GMHelpAnswer(curPlayer, errorMsg=""):
     if errorMsg:
         GameWorld.DebugAnswer(curPlayer, "%s" % errorMsg)
-    
+        GameWorld.DebugAnswer(curPlayer, "SetEquipPartStar 星数")
+        GameWorld.DebugAnswer(curPlayer, "SetEquipPartStar 阶级 星数")
+        GameWorld.DebugAnswer(curPlayer, "SetEquipPartStar 阶级 部位 星数")
     
     return

--
Gitblit v1.8.0