From 552f4ce1704ee326eded21f56f032c7db0e11f4f Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期六, 27 四月 2019 20:10:09 +0800
Subject: [PATCH] 6603 【后端】【2.0】增加新版的sp和被动技能  --  删除废弃效果

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetEquipPartPlusLV.py |  132 ++++++++++++++++++++------------------------
 1 files changed, 60 insertions(+), 72 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 bde1d0f..dfcfe17 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
@@ -21,8 +21,7 @@
 import ChConfig
 import ChEquip
 import GameWorld
-import ItemCommon
-
+import IpyGameDataPY
 #---------------------------------------------------------------------
 #逻辑实现
 ## GM命令执行入口
@@ -31,84 +30,73 @@
 #  @return None
 #  @remarks 函数详细说明.
 def OnExec(curPlayer, cmdList):
-    if not cmdList:
-        __GMHelpAnswer(curPlayer)
-        return
     
-    if len(cmdList) == 1:
-        setStarLV = cmdList[0]
-        for pType, indexList in ChConfig.Pack_EquipPart_CanPlusStar.items():
-            for i in indexList:
-                curPack = curPlayer.GetItemManager().GetPack(pType)
-                curEquip = curPack.GetAt(i)
-                ChEquip.SetEquipPartPlusLV(curPlayer, pType, i, curEquip, setStarLV)
-                ChEquip.SetEquipPartProficiency(curPlayer, pType, i, 0)
-            Operate_EquipPlus.DoLogic_OnEquipPartStarLVChange(curPlayer, pType)
-        ChEquip.NotifyEquipPartPlusLV(curPlayer)
-        GameWorld.DebugAnswer(curPlayer, "设置所有部位强化等级为: %s" % setStarLV)
-        return
+    packType = IPY_GameWorld.rptEquip
+    curPack = curPlayer.GetItemManager().GetPack(packType)
+    refreshClassLV = 0
     
-    if len(cmdList) != 3:
+    # 设置所有阶
+    if len(cmdList) == 2:
+        setStarLV, evolveLV = cmdList
+        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, evolveLV)
+                
+        GameWorld.DebugAnswer(curPlayer, "设置所有部位强化等级(%s),进化等级(%s)" % (setStarLV, evolveLV))
+        
+    # 设置指定阶
+    elif len(cmdList) == 3:
+        classLV, setStarLV, evolveLV = cmdList
+        for equipPlace in ChConfig.Pack_EquipPart_CanPlusStar.get(packType, []):
+            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, evolveLV)
+            
+        GameWorld.DebugAnswer(curPlayer, "设置%s阶所有部位强化等级(%s),进化等级(%s)" % (classLV, setStarLV, evolveLV))
+        refreshClassLV = classLV
+        
+    # 设置指定阶部位
+    elif len(cmdList) == 4:
+        classLV, equipPlace, starLV, evolveLV = cmdList
+        
+        if equipPlace not in ChConfig.Pack_EquipPart_CanPlusStar[packType]:
+            __GMHelpAnswer(curPlayer, "部位不存在!")
+            return
+        ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classLV, equipPlace)
+        if not ipyData:
+            return
+        gridIndex = ipyData.GetGridIndex()
+        curEquip = curPack.GetAt(gridIndex)
+        ChEquip.SetEquipPartPlusLV(curPlayer, packType, gridIndex, curEquip, starLV)
+        ChEquip.SetEquipPartProficiency(curPlayer, packType, gridIndex, evolveLV)
+        GameWorld.DebugAnswer(curPlayer, "设置%s阶%s部位强化等级(%s),进化等级(%s)" % (classLV, equipPlace, starLV, evolveLV))
+        refreshClassLV = classLV
+        
+    else:
         __GMHelpAnswer(curPlayer, "参数错误!")
         return
     
-    packType, index, starLV = cmdList
-    if packType not in ChConfig.Pack_EquipPart_CanPlusStar:
-        __GMHelpAnswer(curPlayer, "packType不存在!")
-        return
-    
-    if index not in ChConfig.Pack_EquipPart_CanPlusStar[packType]:
-        __GMHelpAnswer(curPlayer, "index索引不存在!")
-        return
-    
-    curPack = curPlayer.GetItemManager().GetPack(packType)
-    curEquip = curPack.GetAt(index)
-
-    maxStarLV = ItemCommon.GetItemMaxPlusLV(curEquip)
-    starLV = min(starLV, maxStarLV)
-    ChEquip.SetEquipPartPlusLV(curPlayer, packType, index, curEquip, starLV)
-    ChEquip.SetEquipPartProficiency(curPlayer, packType, index, 0)
-    Operate_EquipPlus.DoLogic_OnEquipPartStarLVChange(curPlayer, packType)
+    Operate_EquipPlus.DoLogic_OnEquipPartStarLVChange(curPlayer, packType, refreshClassLV)
+    ChEquip.NotifyEquipPartPlusLV(curPlayer, packType)
     return
-
 
 def __GMHelpAnswer(curPlayer, errorMsg=""):
     if errorMsg:
         GameWorld.DebugAnswer(curPlayer, "%s" % errorMsg)
-    
-    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, "------------------------------")
-    #===========================================================================
+    GameWorld.DebugAnswer(curPlayer, "设置所有阶级: SetEquipPartPlusLV 强化等级 进阶等级")
+    GameWorld.DebugAnswer(curPlayer, "设置指定阶级: SetEquipPartPlusLV 阶级  强化等级 进阶等级")
+    GameWorld.DebugAnswer(curPlayer, "设置指定部位: SetEquipPartPlusLV 阶级 部位 强化等级 进阶等级")
     return

--
Gitblit v1.8.0