From 921ba9c6e954f2f1377cb08d5a8476c9e6c2b30e Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 15 三月 2019 17:44:27 +0800
Subject: [PATCH] 6332 【后端】【2.0】主要是拍品相关规则调整及背包优化(给非拍卖物品为拍品时优化)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetEquipPartPlusLV.py |   90 ++++++++++++++++++++-------------------------
 1 files changed, 40 insertions(+), 50 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 4825741..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,9 +21,7 @@
 import ChConfig
 import ChEquip
 import GameWorld
-import ItemCommon
 import IpyGameDataPY
-import PlayerControl
 #---------------------------------------------------------------------
 #逻辑实现
 ## GM命令执行入口
@@ -32,14 +30,14 @@
 #  @return None
 #  @remarks 函数详细说明.
 def OnExec(curPlayer, cmdList):
-    if not cmdList:
-        __GMHelpAnswer(curPlayer)
-        return
+    
     packType = IPY_GameWorld.rptEquip
     curPack = curPlayer.GetItemManager().GetPack(packType)
+    refreshClassLV = 0
     
-    if len(cmdList) == 1: #设置所有
-        setStarLV = cmdList[0]
+    # 设置所有阶
+    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):
@@ -50,16 +48,13 @@
                 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]
+                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:
@@ -68,45 +63,40 @@
             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阶所有部位强化等级为: %s" % (classLV, setStarLV))
-        return
-    
-    if len(cmdList) != 3:
+            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
     
-    classLV, equipPlace, starLV = 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)
-#    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))
+    Operate_EquipPlus.DoLogic_OnEquipPartStarLVChange(curPlayer, packType, refreshClassLV)
+    ChEquip.NotifyEquipPartPlusLV(curPlayer, packType)
     return
-
 
 def __GMHelpAnswer(curPlayer, errorMsg=""):
     if errorMsg:
         GameWorld.DebugAnswer(curPlayer, "%s" % errorMsg)
-        GameWorld.DebugAnswer(curPlayer, "SetEquipPartPlusLV 等级  设置所有")
-        GameWorld.DebugAnswer(curPlayer, "SetEquipPartPlusLV 阶级 强化等级")
-        GameWorld.DebugAnswer(curPlayer, "SetEquipPartPlusLV 阶级 部位 强化等级")
-    
-
-    #===========================================================================
+    GameWorld.DebugAnswer(curPlayer, "设置所有阶级: SetEquipPartPlusLV 强化等级 进阶等级")
+    GameWorld.DebugAnswer(curPlayer, "设置指定阶级: SetEquipPartPlusLV 阶级  强化等级 进阶等级")
+    GameWorld.DebugAnswer(curPlayer, "设置指定部位: SetEquipPartPlusLV 阶级 部位 强化等级 进阶等级")
     return

--
Gitblit v1.8.0