From 0cb288fc2cad76d7cd8150a3e0b15bbe0eff2c1e Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期二, 05 三月 2019 10:57:47 +0800
Subject: [PATCH] 6307 【后端】【2.0】多套装备开发单(强化)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetEquipPartPlusLV.py |   52 ++++++++++++++++++++++++++++++----------------------
 1 files changed, 30 insertions(+), 22 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..f8f110c 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
@@ -22,7 +22,7 @@
 import ChEquip
 import GameWorld
 import ItemCommon
-
+import IpyGameDataPY
 #---------------------------------------------------------------------
 #逻辑实现
 ## GM命令执行入口
@@ -34,41 +34,49 @@
     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)
+    packType = IPY_GameWorld.rptEquip
+    curPack = curPlayer.GetItemManager().GetPack(packType)
+    if len(cmdList) == 2:
+        setStarLV = cmdList[1]
+        classLV = cmdList[0]
+        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, 0)
+            Operate_EquipPlus.DoLogic_OnEquipPartStarLVChange(curPlayer, packType, classLV)
         ChEquip.NotifyEquipPartPlusLV(curPlayer)
-        GameWorld.DebugAnswer(curPlayer, "设置所有部位强化等级为: %s" % setStarLV)
+        GameWorld.DebugAnswer(curPlayer, "设置%s阶所有部位强化等级为: %s" % (classLV, setStarLV))
         return
     
     if len(cmdList) != 3:
         __GMHelpAnswer(curPlayer, "参数错误!")
         return
     
-    packType, index, starLV = cmdList
+    classLV, equipPlace, starLV = cmdList
     if packType not in ChConfig.Pack_EquipPart_CanPlusStar:
         __GMHelpAnswer(curPlayer, "packType不存在!")
         return
     
-    if index not in ChConfig.Pack_EquipPart_CanPlusStar[packType]:
+    if equipPlace not in ChConfig.Pack_EquipPart_CanPlusStar[packType]:
         __GMHelpAnswer(curPlayer, "index索引不存在!")
         return
-    
-    curPack = curPlayer.GetItemManager().GetPack(packType)
-    curEquip = curPack.GetAt(index)
-
-    maxStarLV = ItemCommon.GetItemMaxPlusLV(curEquip)
+    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)
-    ChEquip.SetEquipPartPlusLV(curPlayer, packType, index, curEquip, starLV)
-    ChEquip.SetEquipPartProficiency(curPlayer, packType, index, 0)
-    Operate_EquipPlus.DoLogic_OnEquipPartStarLVChange(curPlayer, packType)
+    ChEquip.SetEquipPartPlusLV(curPlayer, packType, gridIndex, curEquip, starLV)
+    ChEquip.SetEquipPartProficiency(curPlayer, packType, gridIndex, 0)
+    Operate_EquipPlus.DoLogic_OnEquipPartStarLVChange(curPlayer, packType, classLV)
     return
 
 

--
Gitblit v1.8.0