From 8137c8b275547e2569a8c683012cd71c36ed70b4 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期六, 30 三月 2019 18:02:27 +0800
Subject: [PATCH] 2635 【BUG】【2.0】限时抢购,活动结束时发了一条活动开启的公告

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipWash.py |   79 +++++++++++++++------------------------
 1 files changed, 30 insertions(+), 49 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 91aef53..4fe25fc 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
@@ -46,9 +46,7 @@
     washType = GetEquipWashType(equipPlace)
     if not washType:
         return 0
-    maxLVDict = IpyGameDataPY.GetFuncEvalCfg("EquipWashGroup%s" % washType, 2)
-    if not maxLVDict:
-        return 0
+    
     equipPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
     curEquip = equipPack.GetAt(equipPackindex)
     if not curEquip or curEquip.IsEmpty():
@@ -56,38 +54,18 @@
         return 0
     
     equipStar = ChEquip.GetEquipPartStarByRank(curPlayer, equipPackindex, curEquip)
-    minStarCfg = min(maxLVDict)
-    if equipStar < minStarCfg:
-        GameWorld.DebugLog("该装备位装备星数=%s < minStarCfg(%s),无法洗练!equipPackindex=%s" 
-                           % (equipStar, minStarCfg, equipPackindex))
+    ipyData = IpyGameDataPY.InterpolationSearch('ItemWashMax', 'Star', equipStar, {'Type':washType})
+    if not ipyData:
         return 0
-    if equipStar in maxLVDict:
-        maxWashLV = maxLVDict[equipStar]
-        if not maxWashLV:
-            GameWorld.DebugLog("该装备位装备星数=%s,maxWashLV=%s,无法洗练!equipPackindex=%s" 
-                               % (equipStar, maxWashLV, equipPackindex))
-            return 0
-        return maxWashLV
-    maxStarCfg = max(maxLVDict)
-    if equipStar > maxStarCfg:
-        return maxLVDict[maxStarCfg]
-    # 默认返回当前部位洗练等级
-    return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % equipPackindex) + 1
+    return ipyData.GetLevelMax()
+    
+    
 
-def GetEquipWashPlaceList(washType):
-    ## 获取洗练类型对应的所有装备位
-    placeList = IpyGameDataPY.GetFuncEvalCfg("EquipWashGroup%s" % washType, 1)
-    if placeList:
-        return placeList
-    return []
 
 def GetEquipWashType(equipPlace):
     ## 获取装备位对应的洗练类型
-    for washType in range(1, Def_EquipWashMaxType + 1):
-        placeList = GetEquipWashPlaceList(washType)
-        if equipPlace in placeList:
-            return washType
-    return
+    return IpyGameDataPY.GetFuncEvalCfg('EquipWashGroup', 1, {}).get(equipPlace)
+    
 
 def GetEquipWashData(washType, washLV):
     return IpyGameDataPY.GetIpyGameData("EquipWash", washType, washLV)
@@ -97,13 +75,12 @@
     global g_allIndexList
     if not g_allIndexList:
         maxClasslv = IpyGameDataPY.GetFuncCfg('EquipMaxClasslv')
-        for washType in range(1, Def_EquipWashMaxType + 1):
-            for equipPlace in GetEquipWashPlaceList(washType):
-                for classLV in xrange(1, maxClasslv+1):
-                    ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classLV, equipPlace)
-                    if not ipyData:
-                        continue
-                    g_allIndexList.append(ipyData.GetGridIndex())
+        for equipPlace in IpyGameDataPY.GetFuncEvalCfg('EquipWashGroup', 1, {}):
+            for classLV in xrange(1, maxClasslv+1):
+                ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classLV, equipPlace)
+                if not ipyData:
+                    continue
+                g_allIndexList.append(ipyData.GetGridIndex())
     return g_allIndexList
 
 #// A3 25 装备洗炼 #tagCMEquipXLAttrChange
@@ -326,7 +303,7 @@
         return
     equipPlace = ipyData.GetEquipPlace()
     classLV = ipyData.GetClassLV()
-    washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % equipPlace) + 1
+    washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % equipPackindex) + 1
     maxWashLV = GetEquipWashMaxLV(curPlayer, equipPackindex, equipPlace)
     GameWorld.DebugLog("确认洗练结果: classLV=%s, equipPlace=%s,isSave=%s,washLV=%s,maxWashLV=%s" 
                        % (classLV, equipPlace, isSave, washLV, maxWashLV), playerID)
@@ -439,6 +416,8 @@
 def CalcAttr_EquipWash(curPlayer, equipIndex, equipPlace, allAttrList):
     ## 装备位洗练属性
     washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % equipIndex) + 1
+    maxWashLV = GetEquipWashMaxLV(curPlayer, equipIndex, equipPlace)
+    washLV = min(washLV, maxWashLV)
     washType = GetEquipWashType(equipPlace)
     if washType is None:
         return
@@ -448,23 +427,25 @@
     #GameWorld.DebugLog("装备位属性: equipPlace=%s,washLV=%s" % (equipPlace, washLV))
     for attrNum in range(1, Def_EquipWashMaxAttrCount + 1):
         attrID = getattr(washData, "GetAttrType%s" % attrNum)()
+        maxValue = getattr(washData, "GetAttrMax%s" % attrNum)()
         attrValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashValue % (equipIndex, attrNum))
+        attrValue = min(attrValue, maxValue)
         #GameWorld.DebugLog("    attrNum=%s,attrID=%s, attrValue=%s" % (attrNum, attrID, attrValue))
         if attrValue:
             PlayerControl.CalcAttrDict_Type(attrID, attrValue, allAttrList)
     return
 
 def EquipWashSuccess(curPlayer):
-    succList = [ShareDefine.SuccType_EquipWashLV1,ShareDefine.SuccType_EquipWashLV2,ShareDefine.SuccType_EquipWashLV3]
-    for washType in range(1, Def_EquipWashMaxType + 1):
-        washTypeLV = 999
-        placeList = GetEquipWashPlaceList(washType)
-        for equipPlace in placeList:
-            washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % equipPlace) + 1
-            washTypeLV = min(washTypeLV, washLV)
-        
-        if not washTypeLV:
-            continue
-        PlayerSuccess.DoAddSuccessProgress(curPlayer, succList[washType-1], 1, [washTypeLV])
+#    succList = [ShareDefine.SuccType_EquipWashLV1,ShareDefine.SuccType_EquipWashLV2,ShareDefine.SuccType_EquipWashLV3]
+#    for washType in range(1, Def_EquipWashMaxType + 1):
+#        washTypeLV = 999
+#        placeList = GetEquipWashPlaceList(washType)
+#        for equipPlace in placeList:
+#            washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % equipPlace) + 1
+#            washTypeLV = min(washTypeLV, washLV)
+#        
+#        if not washTypeLV:
+#            continue
+#        PlayerSuccess.DoAddSuccessProgress(curPlayer, succList[washType-1], 1, [washTypeLV])
     return
 

--
Gitblit v1.8.0