From ff52a6596b014b171a10de35779648e46b7a621b Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期一, 11 三月 2019 17:28:23 +0800
Subject: [PATCH] 6307 【后端】【2.0】多套装备开发单(洗练配置修改)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipWash.py |   84 ++++++++++++++++++------------------------
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py                    |   23 +++++++++++
 PySysDB/PySysDBPY.h                                                                                     |    9 ++++
 3 files changed, 68 insertions(+), 48 deletions(-)

diff --git a/PySysDB/PySysDBPY.h b/PySysDB/PySysDBPY.h
index e055b45..b5b5762 100644
--- a/PySysDB/PySysDBPY.h
+++ b/PySysDB/PySysDBPY.h
@@ -1810,4 +1810,13 @@
 	list		WorldLV;	//世界等级
 	list		Rank;	//排名
 	list		Award;	//奖励 [[独立概率万分率,[物品ID,数量,拍品分组]],..]
+};
+
+//装备洗练等级上限
+
+struct tagItemWashMax
+{
+	BYTE		_Type;		//按装备位对应类型查找
+	BYTE		_Star;	// 装备星数
+	WORD		LevelMax;	//洗练等级上限
 };
\ No newline at end of file
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..2177e5c 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,29 @@
         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.GetIpyGameDataNotLog("ItemWashMax", washType, equipStar)
+    if ipyData:
+        return ipyData.GetLevelMax()
+    
+    ipyDataList = IpyGameDataPY.GetIpyGameDataByCondition('ItemWashMax', {'Type':washType}, True, False)
+    if not ipyDataList:
         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
+    maxStar = ipyDataList[-1].GetStar()
+    if equipStar > maxStar:
+        return ipyDataList[-1].GetLevelMax()
+    findMax = 0
+    for ipyData in ipyDataList:
+        if equipStar >= ipyData.GetStar():
+            findMax = ipyData.GetLevelMax()
+    return findMax
+    
+    
 
-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 +86,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
@@ -455,16 +443,16 @@
     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
 
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
index bb2af09..5c0ee33 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -1405,6 +1405,12 @@
                         ("list", "Rank", 0),
                         ("list", "Award", 0),
                         ),
+
+                "ItemWashMax":(
+                        ("BYTE", "Type", 1),
+                        ("BYTE", "Star", 1),
+                        ("WORD", "LevelMax", 0),
+                        ),
                 }
 
 
@@ -4295,6 +4301,19 @@
     def GetWorldLV(self): return self.WorldLV # 世界等级
     def GetRank(self): return self.Rank # 排名
     def GetAward(self): return self.Award # 奖励 [[独立概率万分率,[物品ID,数量,拍品分组]],..]
+
+# 装备洗练等级上限
+class IPY_ItemWashMax():
+    
+    def __init__(self):
+        self.Type = 0
+        self.Star = 0
+        self.LevelMax = 0
+        return
+        
+    def GetType(self): return self.Type # 按装备位对应类型查找
+    def GetStar(self): return self.Star #  装备星数
+    def GetLevelMax(self): return self.LevelMax # 洗练等级上限
 
 
 def Log(msg, playerID=0, par=0):
@@ -4600,6 +4619,8 @@
         self.ipyEquipPlusEvolveLen = len(self.ipyEquipPlusEvolveCache)
         self.ipyFamilyBossAwardCache = self.__LoadFileData("FamilyBossAward", IPY_FamilyBossAward)
         self.ipyFamilyBossAwardLen = len(self.ipyFamilyBossAwardCache)
+        self.ipyItemWashMaxCache = self.__LoadFileData("ItemWashMax", IPY_ItemWashMax)
+        self.ipyItemWashMaxLen = len(self.ipyItemWashMaxCache)
         Log("IPY_FuncConfig count=%s" % len(self.ipyFuncConfigDict))
         Log("IPY_DataMgr InitOK!")
         return
@@ -5046,6 +5067,8 @@
     def GetEquipPlusEvolveByIndex(self, index): return self.ipyEquipPlusEvolveCache[index]
     def GetFamilyBossAwardCount(self): return self.ipyFamilyBossAwardLen
     def GetFamilyBossAwardByIndex(self, index): return self.ipyFamilyBossAwardCache[index]
+    def GetItemWashMaxCount(self): return self.ipyItemWashMaxLen
+    def GetItemWashMaxByIndex(self, index): return self.ipyItemWashMaxCache[index]
 
 IPYData = IPY_DataMgr()
 def IPY_Data(): return IPYData

--
Gitblit v1.8.0