From 751709e3494aad919e4313c26066be24e2d4bf8a Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 09 五月 2019 14:10:54 +0800
Subject: [PATCH] 6711 【后端】【2.0】洗练从0级开始洗练

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipWash.py |   20 +++++++++-----------
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetEquipWash.py         |   20 ++++++++++----------
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py          |    2 +-
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCacheTube.py       |    2 +-
 4 files changed, 21 insertions(+), 23 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipWash.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipWash.py
index 4fe25fc..cdb674a 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipWash.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipWash.py
@@ -28,7 +28,6 @@
 import ItemCommon
 import ChConfig
 import ChEquip
-import EventShell
 
 import random
 
@@ -109,11 +108,11 @@
         return
     
     maxWashLV = GetEquipWashMaxLV(curPlayer, equipPackindex, equipPlace)
-    washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % equipPackindex) + 1
+    washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % equipPackindex)
     GameWorld.DebugLog("装备洗练: classLV=%s,equipPlace=%s,checkUseGoldAttr=%s,washType=%s,washLV=%s,maxWashLV=%s" 
                        % (classLV, equipPlace, checkUseGoldAttr, washType, washLV, maxWashLV), playerID)
     
-    if maxWashLV < 1:
+    if maxWashLV < washLV:
         return
         
     washData = GetEquipWashData(washType, washLV)
@@ -206,7 +205,7 @@
         return
     
     preWashData = None # 上一洗练等级数据
-    if washLV > 1:
+    if washLV > 0:
         preWashData = GetEquipWashData(washType, washLV - 1)
         if not preWashData:
             GameWorld.ErrLog("找不到上一级洗练数据,无法洗练!preWashLV=%s" % (washLV - 1))
@@ -303,7 +302,7 @@
         return
     equipPlace = ipyData.GetEquipPlace()
     classLV = ipyData.GetClassLV()
-    washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % equipPackindex) + 1
+    washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % equipPackindex)
     maxWashLV = GetEquipWashMaxLV(curPlayer, equipPackindex, equipPlace)
     GameWorld.DebugLog("确认洗练结果: classLV=%s, equipPlace=%s,isSave=%s,washLV=%s,maxWashLV=%s" 
                        % (classLV, equipPlace, isSave, washLV, maxWashLV), playerID)
@@ -311,7 +310,7 @@
     washType = GetEquipWashType(equipPlace)
     if washType is None:
         return
-    if maxWashLV < 1:
+    if maxWashLV < 0:
         return
     washData = GetEquipWashData(washType, washLV)
     if not washData:
@@ -360,8 +359,7 @@
         if tempValue < getattr(washData, "GetAttrMax%s" % attrNum)():
             return
     washLV += 1
-    # 字典存储的从0开始,0代表1级,所以实际存进去的值需减1
-    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashLV % (equipPackindex), washLV - 1)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashLV % (equipPackindex), washLV)
     GameWorld.DebugLog("装备洗练等级升级: equipPackindex=%s,washLV=%s" % (equipPackindex, washLV), curPlayer.GetPlayerID())
     
     # 洗练广播
@@ -384,7 +382,7 @@
     for place in syncPlaceList:
         equipPart = ChPyNetSendPack.tagMCEquipPartXLAttr()
         equipPart.EquipPlace = place
-        equipPart.XLAttrLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % place) + 1
+        equipPart.XLAttrLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % place)
         equipPart.XLAttrList = []
         for attrNum in range(1, Def_EquipWashMaxAttrCount + 1):
             washValue = ChPyNetSendPack.tagMCEquipPartXLAttrValue()
@@ -415,7 +413,7 @@
 
 def CalcAttr_EquipWash(curPlayer, equipIndex, equipPlace, allAttrList):
     ## 装备位洗练属性
-    washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % equipIndex) + 1
+    washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % equipIndex)
     maxWashLV = GetEquipWashMaxLV(curPlayer, equipIndex, equipPlace)
     washLV = min(washLV, maxWashLV)
     washType = GetEquipWashType(equipPlace)
@@ -441,7 +439,7 @@
 #        washTypeLV = 999
 #        placeList = GetEquipWashPlaceList(washType)
 #        for equipPlace in placeList:
-#            washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % equipPlace) + 1
+#            washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % equipPlace)
 #            washTypeLV = min(washTypeLV, washLV)
 #        
 #        if not washTypeLV:
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetEquipWash.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetEquipWash.py
index 4278582..86d7aa8 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetEquipWash.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetEquipWash.py
@@ -36,11 +36,11 @@
     allIndexList = Operate_EquipWash.GetAllEquipWashPlace()
     syncPlace = -1
     if len(cmdList) == 1 and cmdList[0] == 0:
-        for place in allIndexList:
-            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashLV % (place), 0)
+        for index in allIndexList:
+            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashLV % (index), 0)
             for attrNum in range(1, Operate_EquipWash.Def_EquipWashMaxAttrCount + 1):
-                PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashValue % (place, attrNum), 0)
-                PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashValueTemp % (place, attrNum), 0)
+                PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashValue % (index, attrNum), 0)
+                PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashValueTemp % (index, attrNum), 0)
         GameWorld.DebugLog("重置所有洗练数据")
                 
     elif len(cmdList) == 2:
@@ -52,8 +52,8 @@
                 continue
             equipPlace = ipyData.GetEquipPlace()
             maxWashLV = Operate_EquipWash.GetEquipWashMaxLV(curPlayer, equipPackindex, equipPlace)
-            if maxWashLV < 1:
-                continue
+            #if maxWashLV < 1:
+            #    continue
             __SetEquipPlaceWashLV(curPlayer, equipPackindex, equipPlace, washLV, attrPer, maxWashLV)
             isSync = True
         if not isSync:
@@ -68,8 +68,8 @@
         gridIndex = ipyData.GetGridIndex()
         syncPlace = gridIndex
         maxWashLV = Operate_EquipWash.GetEquipWashMaxLV(curPlayer, gridIndex, place)
-        if maxWashLV < 1:
-            return
+        #if maxWashLV < 1:
+        #    return
         __SetEquipPlaceWashLV(curPlayer, gridIndex, place, washLV, attrPer, maxWashLV)
         
     else:
@@ -88,10 +88,10 @@
     
     washType = Operate_EquipWash.GetEquipWashType(place)
     washData = Operate_EquipWash.GetEquipWashData(washType, washLV)
-    preWashData = None if washLV <= 1 else Operate_EquipWash.GetEquipWashData(washType, washLV - 1)
+    preWashData = None if washLV <= 0 else Operate_EquipWash.GetEquipWashData(washType, washLV - 1)
     
     #GameWorld.DebugLog("设置洗练: place=%s,washType=%s,washLV=%s,attrPer=%s" % (place, washType, washLV, attrPer))
-    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashLV % (equipPackindex), washLV - 1)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashLV % (equipPackindex), washLV)
     for attrNum in range(1, Operate_EquipWash.Def_EquipWashMaxAttrCount + 1):
         preMaxValue = 0 if not preWashData else getattr(preWashData, "GetAttrMax%s" % attrNum)()
         curMaxValue = getattr(washData, "GetAttrMax%s" % attrNum)()
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py
index 2f52e60..7cd332a 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py
@@ -750,7 +750,7 @@
         itemDict["Stone"] = stoneIDList
         
     #部位洗练数据
-    washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % packIndex) + 1
+    washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % packIndex)
     valueList = []
     for attrNum in xrange(1, Operate_EquipWash.Def_EquipWashMaxAttrCount + 1):
         value = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashValue % (packIndex, attrNum))
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCacheTube.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCacheTube.py
index 3df1084..55a738e 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCacheTube.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCacheTube.py
@@ -147,7 +147,7 @@
             itemDict["Stone"] = stoneIDList
             
         #部位洗练数据
-        washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % index) + 1
+        washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % index)
         valueList = []
         for attrNum in xrange(1, Operate_EquipWash.Def_EquipWashMaxAttrCount + 1):
             value = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashValue % (index, attrNum))

--
Gitblit v1.8.0