From e0a5413902002d830146b8da4cc4069277979f8e Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期一, 04 三月 2019 14:13:01 +0800
Subject: [PATCH] 6307 【后端】【2.0】多套装备开发单(洗炼)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipWash.py | 203 +++++++++++++++++----------------------
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetEquipWash.py | 40 ++++---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py | 7
3 files changed, 116 insertions(+), 134 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 a08f4aa..91aef53 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
@@ -33,14 +33,15 @@
import random
-Def_EquipWashMaxType = 3 # 装备洗练最大归组类型
+Def_EquipWashMaxType = 2 # 装备洗练最大归组类型
Def_EquipWashMaxAttrCount = 3 # 装备洗练最大洗练属性条数
+g_allIndexList = [] #可洗炼的部位缓存
def OnEquipWashLogin(curPlayer):
Sycn_EquipWashInfo(curPlayer, isLogin=True)
return
-def GetEquipWashMaxLV(curPlayer, equipPlace):
+def GetEquipWashMaxLV(curPlayer, equipPackindex, equipPlace):
# @return: 0-未开放; >=1-该装备位最大可洗练等级
washType = GetEquipWashType(equipPlace)
if not washType:
@@ -49,28 +50,29 @@
if not maxLVDict:
return 0
equipPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
- curEquip = equipPack.GetAt(equipPlace)
+ curEquip = equipPack.GetAt(equipPackindex)
if not curEquip or curEquip.IsEmpty():
- GameWorld.DebugLog("该装备位没有装备,无法洗练!equipPlace=%s" % (equipPlace))
+ GameWorld.DebugLog("该装备位没有装备,无法洗练!equipPackindex=%s" % (equipPackindex))
return 0
- equipClassLV = ItemCommon.GetItemClassLV(curEquip)
- minClassLVCfg = min(maxLVDict)
- if equipClassLV < minClassLVCfg:
- GameWorld.DebugLog("该装备位装备阶级=%s < minClassLVCfg(%s),无法洗练!equipPlace=%s"
- % (equipClassLV, minClassLVCfg, equipPlace))
+
+ equipStar = ChEquip.GetEquipPartStarByRank(curPlayer, equipPackindex, curEquip)
+ minStarCfg = min(maxLVDict)
+ if equipStar < minStarCfg:
+ GameWorld.DebugLog("该装备位装备星数=%s < minStarCfg(%s),无法洗练!equipPackindex=%s"
+ % (equipStar, minStarCfg, equipPackindex))
return 0
- if equipClassLV in maxLVDict:
- maxWashLV = maxLVDict[equipClassLV]
+ if equipStar in maxLVDict:
+ maxWashLV = maxLVDict[equipStar]
if not maxWashLV:
- GameWorld.DebugLog("该装备位装备阶级=%s,maxWashLV=%s,无法洗练!equipPlace=%s"
- % (equipClassLV, maxWashLV, equipPlace))
+ GameWorld.DebugLog("该装备位装备星数=%s,maxWashLV=%s,无法洗练!equipPackindex=%s"
+ % (equipStar, maxWashLV, equipPackindex))
return 0
return maxWashLV
- maxClassLVCfg = max(maxLVDict)
- if equipClassLV > maxClassLVCfg:
- return maxLVDict[maxClassLVCfg]
+ maxStarCfg = max(maxLVDict)
+ if equipStar > maxStarCfg:
+ return maxLVDict[maxStarCfg]
# 默认返回当前部位洗练等级
- return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % equipPlace) + 1
+ return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % equipPackindex) + 1
def GetEquipWashPlaceList(washType):
## 获取洗练类型对应的所有装备位
@@ -92,10 +94,17 @@
def GetAllEquipWashPlace():
# 获取所有可洗练的装备位
- allPlaceList = []
- for washType in range(1, Def_EquipWashMaxType + 1):
- allPlaceList += GetEquipWashPlaceList(washType)
- return allPlaceList
+ 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())
+ return g_allIndexList
#// A3 25 装备洗炼 #tagCMEquipXLAttrChange
#
@@ -110,18 +119,22 @@
curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
playerID = curPlayer.GetPlayerID()
- equipPlace = clientData.EquipPlace
+ equipPackindex = clientData.EquipPlace
checkUseGoldAttr = clientData.CheckUseGoldAttr
-
+ ipyData = IpyGameDataPY.GetIpyGameDataByCondition('EquipPlaceIndexMap', {'GridIndex':equipPackindex})
+ if not ipyData:
+ return
+ equipPlace = ipyData.GetEquipPlace()
+ classLV = ipyData.GetClassLV()
washType = GetEquipWashType(equipPlace)
- maxWashLV = GetEquipWashMaxLV(curPlayer, equipPlace)
- washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % equipPlace) + 1
- GameWorld.DebugLog("装备洗练: equipPlace=%s,checkUseGoldAttr=%s,washType=%s,washLV=%s,maxWashLV=%s"
- % (equipPlace, checkUseGoldAttr, washType, washLV, maxWashLV), playerID)
-
if washType is None:
GameWorld.Log("该装备位无法洗练! equipPlace=%s" % (equipPlace), playerID)
return
+
+ maxWashLV = GetEquipWashMaxLV(curPlayer, equipPackindex, equipPlace)
+ washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % equipPackindex) + 1
+ GameWorld.DebugLog("装备洗练: classLV=%s,equipPlace=%s,checkUseGoldAttr=%s,washType=%s,washLV=%s,maxWashLV=%s"
+ % (classLV, equipPlace, checkUseGoldAttr, washType, washLV, maxWashLV), playerID)
if maxWashLV < 1:
return
@@ -134,11 +147,11 @@
maxValueAttrNumList = [] # 已达到当前等级最大值的属性编号列表
for attrNum in range(1, Def_EquipWashMaxAttrCount + 1):
maxValue = getattr(washData, "GetAttrMax%s" % attrNum)()
- washValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashValue % (equipPlace, attrNum))
- washValueTemp = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashValueTemp % (equipPlace, attrNum))
+ washValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashValue % (equipPackindex, attrNum))
+ washValueTemp = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashValueTemp % (equipPackindex, attrNum))
if washValueTemp != 0:
- GameWorld.Log("还有未选择是否保存的洗练属性,不可洗练!equipPlace=%s,attrNum=%s,washValueTemp=%s"
- % (equipPlace, attrNum, washValueTemp), playerID)
+ GameWorld.Log("还有未选择是否保存的洗练属性,不可洗练!equipPackindex=%s,attrNum=%s,washValueTemp=%s"
+ % (equipPackindex, attrNum, washValueTemp), playerID)
return
if washValue >= maxValue:
maxValueAttrNumList.append(attrNum)
@@ -171,7 +184,7 @@
if attrNum in maxValueAttrNumList:
continue
- washValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashValue % (equipPlace, attrNum))
+ washValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashValue % (equipPackindex, attrNum))
if checkUseGoldAttr & pow(2, attrNum - 1):
useGoldAttrNumList.append(attrNum)
randValueMin = getattr(washData, "GetAttrCostGoldMin%s" % attrNum)()
@@ -184,8 +197,8 @@
randValueMin, randValueMax = randRange
break
if not randValueMin and not randValueMax:
- GameWorld.ErrLog("找不到该装备位当前洗练值范围随机值!equipPlace=%s,washType=%s,washLV=%s,attrNum=%s,washValue=%s,randDict=%s"
- % (equipPlace, washType, washLV, attrNum, washValue, randDict))
+ GameWorld.ErrLog("找不到该装备位当前洗练值范围随机值!equipPackindex=%s,washType=%s,washLV=%s,attrNum=%s,washValue=%s,randDict=%s"
+ % (equipPackindex, washType, washLV, attrNum, washValue, randDict))
return
GameWorld.DebugLog("随机范围属性%s, washValue=%s, %s~%s" % (attrNum, washValue, randValueMin, randValueMax))
randValue = random.randint(randValueMin, randValueMax)
@@ -228,7 +241,7 @@
ItemCommon.DelCostItemByBind(curPlayer, mustItemIndexList, mustBindCnt, mustUnBindCnt, delMustIDCount, "EquipWash")
if needGold:
- infoDict = {"EquipPlace":equipPlace, "WashType":washType, "WashLV":washLV, "CheckUseGoldCnt":checkUseGoldCnt}
+ infoDict = {'classLV':classLV, "EquipPlace":equipPlace, "WashType":washType, "WashLV":washLV, "CheckUseGoldCnt":checkUseGoldCnt}
PlayerControl.PayMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money, needGold, ChConfig.Def_Cost_EquipWash, infoDict)
GameWorld.DebugLog("随机洗练: randAttrDict=%s,fixMaxValueDict=%s" % (randAttrDict, fixMaxValueDict), playerID)
@@ -237,7 +250,7 @@
minPer = 1
minPerAttrNum = 1
for attrNum in range(1, Def_EquipWashMaxAttrCount + 1):
- washValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashValue % (equipPlace, attrNum))
+ washValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashValue % (equipPackindex, attrNum))
preMaxValue = 0 if not preWashData else getattr(preWashData, "GetAttrMax%s" % attrNum)()
curMaxValue = getattr(washData, "GetAttrMax%s" % attrNum)()
curPer = (washValue - preMaxValue) / float(curMaxValue - preMaxValue)
@@ -255,7 +268,7 @@
# 最终洗练值确认
isRefreshAttr = False
for attrNum, randValue in randAttrDict.items():
- washValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashValue % (equipPlace, attrNum))
+ washValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashValue % (equipPackindex, attrNum))
tempValue = washValue + randValue
preMaxValue = 0 if not preWashData else getattr(preWashData, "GetAttrMax%s" % attrNum)()
maxValue = getattr(washData, "GetAttrMax%s" % attrNum)()
@@ -275,21 +288,21 @@
# 使用钻石洗练的直接更新,不用确认
if attrNum in useGoldAttrNumList:
isRefreshAttr = True
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashValue % (equipPlace, attrNum), tempValue)
- dataDict = {'equipPlace':equipPlace,'attrNum':attrNum,'oldValue':washValue,'newValue':tempValue}
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashValue % (equipPackindex, attrNum), tempValue)
+ dataDict = {'classLV':classLV, 'equipPlace':equipPlace,'attrNum':attrNum,'oldValue':washValue,'newValue':tempValue}
DataRecordPack.Cache_FightPowerChangeInfo(curPlayer, ChConfig.PowerDownType_EquipWash, dataDict)
GameWorld.DebugLog(" 勾选洗练,直接更新数值: %s" % tempValue, playerID)
else:
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashValueTemp % (equipPlace, attrNum), tempValue)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashValueTemp % (equipPackindex, attrNum), tempValue)
#屏蔽自动升级
# if isRefreshAttr and washLV < maxWashLV:
# CheckEquipWashLVUp(curPlayer, equipPlace, washLV, washData)
- Sycn_EquipWashInfo(curPlayer, equipPlace)
+ Sycn_EquipWashInfo(curPlayer, equipPackindex)
if isRefreshAttr:
- RefreshEquipWashAttr(curPlayer)
+ RefreshEquipWashAttr(curPlayer, classLV)
PlayerActLogin.AddLoginAwardActionCnt(curPlayer, ChConfig.Def_LoginAct_EquipWash, 1)
return
@@ -306,13 +319,17 @@
curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
playerID = curPlayer.GetPlayerID()
- equipPlace = clientData.EquipPlace
+ equipPackindex = clientData.EquipPlace
isSave = clientData.IsSave
-
+ ipyData = IpyGameDataPY.GetIpyGameDataByCondition('EquipPlaceIndexMap', {'GridIndex':equipPackindex})
+ if not ipyData:
+ return
+ equipPlace = ipyData.GetEquipPlace()
+ classLV = ipyData.GetClassLV()
washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % equipPlace) + 1
- maxWashLV = GetEquipWashMaxLV(curPlayer, equipPlace)
- GameWorld.DebugLog("确认洗练结果: equipPlace=%s,isSave=%s,washLV=%s,maxWashLV=%s"
- % (equipPlace, isSave, washLV, maxWashLV), playerID)
+ maxWashLV = GetEquipWashMaxLV(curPlayer, equipPackindex, equipPlace)
+ GameWorld.DebugLog("确认洗练结果: classLV=%s, equipPlace=%s,isSave=%s,washLV=%s,maxWashLV=%s"
+ % (classLV, equipPlace, isSave, washLV, maxWashLV), playerID)
washType = GetEquipWashType(equipPlace)
if washType is None:
@@ -328,80 +345,64 @@
if washLV >= maxWashLV:
GameWorld.DebugLog("已达到最大洗练等级,不可升级!", playerID)
return
- if CheckEquipWashLVUp(curPlayer, equipPlace, washLV, washData):
- RefreshEquipWashAttr(curPlayer)
- Sycn_EquipWashInfo(curPlayer, equipPlace)
+ if CheckEquipWashLVUp(curPlayer, equipPackindex, classLV, equipPlace, washLV, washData):
+ RefreshEquipWashAttr(curPlayer, classLV)
+ Sycn_EquipWashInfo(curPlayer, equipPackindex)
EquipWashSuccess(curPlayer)
else:
GameWorld.DebugLog("升级失败,有属性未达到最大值,无法升级!", playerID)
return
for attrNum in range(1, Def_EquipWashMaxAttrCount + 1):
- tempValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashValueTemp % (equipPlace, attrNum))
+ tempValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashValueTemp % (equipPackindex, attrNum))
if not tempValue:
continue
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashValueTemp % (equipPlace, attrNum), 0)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashValueTemp % (equipPackindex, attrNum), 0)
if isSave == 1:
- oldValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashValue % (equipPlace, attrNum))
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashValue % (equipPlace, attrNum), tempValue)
- dataDict = {'equipPlace':equipPlace,'attrNum':attrNum,'oldValue':oldValue,'newValue':tempValue}
+ oldValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashValue % (equipPackindex, attrNum))
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashValue % (equipPackindex, attrNum), tempValue)
+ dataDict = {'classLV':classLV, 'equipPlace':equipPlace,'attrNum':attrNum,'oldValue':oldValue,'newValue':tempValue}
DataRecordPack.Cache_FightPowerChangeInfo(curPlayer, ChConfig.PowerDownType_EquipWash, dataDict)
- GameWorld.DebugLog("保存洗练数据: equipPlace=%s,attrNum=%s,tempValue=%s" % (equipPlace, attrNum, tempValue), playerID)
+ GameWorld.DebugLog("保存洗练数据: classLV=%s, equipPlace=%s,attrNum=%s,tempValue=%s" % (classLV, equipPlace, attrNum, tempValue), playerID)
if isSave == 1:
- RefreshEquipWashAttr(curPlayer)
+ RefreshEquipWashAttr(curPlayer, classLV)
#屏蔽自动升级
# if washLV < maxWashLV:
# CheckEquipWashLVUp(curPlayer, equipPlace, washLV, washData)
- Sycn_EquipWashInfo(curPlayer, equipPlace)
+ Sycn_EquipWashInfo(curPlayer, equipPackindex)
return
-def CheckEquipWashLVUp(curPlayer, equipPlace, washLV, washData):
+def CheckEquipWashLVUp(curPlayer, equipPackindex, classLV, equipPlace, washLV, washData):
# 检查洗练类型升级
for attrNum in range(1, Def_EquipWashMaxAttrCount + 1):
- tempValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashValue % (equipPlace, attrNum))
+ tempValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashValue % (equipPackindex, attrNum))
# 只要有未达到本级最大值的,则不能升级
if tempValue < getattr(washData, "GetAttrMax%s" % attrNum)():
return
washLV += 1
# 字典存储的从0开始,0代表1级,所以实际存进去的值需减1
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashLV % (equipPlace), washLV - 1)
- GameWorld.DebugLog("装备洗练等级升级: equipPlace=%s,washLV=%s" % (equipPlace, washLV), curPlayer.GetPlayerID())
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashLV % (equipPackindex), washLV - 1)
+ GameWorld.DebugLog("装备洗练等级升级: equipPackindex=%s,washLV=%s" % (equipPackindex, washLV), curPlayer.GetPlayerID())
# 洗练广播
- PlayerControl.WorldNotify(0, "WashCongratulation", [curPlayer.GetPlayerName(), curPlayer.GetPlayerID(), equipPlace, washLV])
- for washType in range(1, Def_EquipWashMaxType + 1):
- placeList = GetEquipWashPlaceList(washType)
- if equipPlace not in placeList:
- continue
-
- minWashLV = 999
- for equipPlace in placeList:
- minWashLV = min(minWashLV, curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % equipPlace) + 1)
-
- if minWashLV == washLV:
- # 有精确命中数据等级,代表刚好达成该洗练套装
- washSpecLVIpyData = IpyGameDataPY.GetIpyGameDataNotLog("EquipWashSpec", washType, washLV)
- if washSpecLVIpyData:
- PlayerControl.WorldNotify(0, "WashMasterCongratulation", [curPlayer.GetPlayerName(), curPlayer.GetPlayerID(), washType, washLV])
- EventShell.EventRespons_EquipWash(curPlayer, washType, washLV)
- break
+ PlayerControl.WorldNotify(0, "WashCongratulation", [curPlayer.GetPlayerName(), curPlayer.GetPlayerID(), classLV, equipPlace, washLV])
return True
-def Sycn_EquipWashInfo(curPlayer, equipPlace=-1, isLogin=False):
+def Sycn_EquipWashInfo(curPlayer, equipPackindex=-1, isLogin=False):
hasValue = False
pack = ChPyNetSendPack.tagMCEquipPartXLAttrInfo()
pack.Clear()
pack.InfoList = []
- if equipPlace == -1:
+ if equipPackindex == -1:
syncPlaceList = GetAllEquipWashPlace()
else:
- syncPlaceList = [equipPlace]
+ syncPlaceList = [equipPackindex]
for place in syncPlaceList:
equipPart = ChPyNetSendPack.tagMCEquipPartXLAttr()
@@ -428,16 +429,16 @@
NetPackCommon.SendFakePack(curPlayer, pack)
return
-def RefreshEquipWashAttr(curPlayer):
- ChEquip.RefreshPlayerEquipAttribute(curPlayer)
+def RefreshEquipWashAttr(curPlayer, classLV):
+ ChEquip.RefreshPlayerEquipAttribute(curPlayer, classLV)
#刷新所有属性
playControl = PlayerControl.PlayerControl(curPlayer)
playControl.RefreshPlayerAttrState()
return
-def CalcAttr_EquipWash(curPlayer, equipPlace, allAttrList):
+def CalcAttr_EquipWash(curPlayer, equipIndex, equipPlace, allAttrList):
## 装备位洗练属性
- washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % equipPlace) + 1
+ washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % equipIndex) + 1
washType = GetEquipWashType(equipPlace)
if washType is None:
return
@@ -447,36 +448,10 @@
#GameWorld.DebugLog("装备位属性: equipPlace=%s,washLV=%s" % (equipPlace, washLV))
for attrNum in range(1, Def_EquipWashMaxAttrCount + 1):
attrID = getattr(washData, "GetAttrType%s" % attrNum)()
- attrValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashValue % (equipPlace, attrNum))
+ attrValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashValue % (equipIndex, attrNum))
#GameWorld.DebugLog(" attrNum=%s,attrID=%s, attrValue=%s" % (attrNum, attrID, attrValue))
if attrValue:
PlayerControl.CalcAttrDict_Type(attrID, attrValue, allAttrList)
- return
-
-def CalcAttr_EquipWashSpec(curPlayer, equipPlaceList, allAttrList):
- ## 装备洗练类型等级对应特殊套属性
- for washType in range(1, Def_EquipWashMaxType + 1):
- washTypeLV = 999
- placeList = GetEquipWashPlaceList(washType)
- for equipPlace in placeList:
- if equipPlace not in equipPlaceList:
- washTypeLV = 0 # 需穿戴装备才有效
- break
- washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % equipPlace) + 1
- washTypeLV = min(washTypeLV, washLV)
- #GameWorld.DebugLog("洗练套装属性: washType=%s,washTypeLV=%s" % (washType, washTypeLV))
- if not washTypeLV:
- continue
- washSpecData = IpyGameDataPY.InterpolationSearch("EquipWashSpec", "WashLVNeed", washTypeLV, {"WashTypeNeed":washType})
- if not washSpecData:
- continue
-
- attrTypeList = washSpecData.GetAddAttrType()
- attrValueList = washSpecData.GetAddAttrValue()
- for i, attrID in enumerate(attrTypeList):
- PlayerControl.CalcAttrDict_Type(attrID, attrValueList[i], allAttrList)
- #GameWorld.DebugLog(" EquipWashSpec attrID=%s, attrValue=%s" % (attrID, attrValueList[i]))
-
return
def EquipWashSuccess(curPlayer):
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 21407d9..fb08fb9 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
@@ -18,6 +18,7 @@
import PlayerControl
import ChConfig
import GameWorld
+import IpyGameDataPY
#---------------------------------------------------------------------
#逻辑实现
@@ -30,13 +31,13 @@
if not cmdList:
GameWorld.DebugAnswer(curPlayer, "重置所有部位洗练信息: SetEquipWash 0")
GameWorld.DebugAnswer(curPlayer, "设置所有部位洗练信息: SetEquipWash 洗练等级 当前等级洗练属性百分比")
- GameWorld.DebugAnswer(curPlayer, "设置指定部位洗练信息: SetEquipWash 装备位 洗练等级 当前等级洗练属性百分比")
+ GameWorld.DebugAnswer(curPlayer, "设置指定部位洗练信息: SetEquipWash 阶级 装备位 洗练等级 当前等级洗练属性百分比")
return
- placeList = Operate_EquipWash.GetAllEquipWashPlace()
+ allIndexList = Operate_EquipWash.GetAllEquipWashPlace()
syncPlace = -1
if len(cmdList) == 1 and cmdList[0] == 0:
- for place in placeList:
+ for place in allIndexList:
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashLV % (place), 0)
for attrNum in range(1, Operate_EquipWash.Def_EquipWashMaxAttrCount + 1):
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashValue % (place, attrNum), 0)
@@ -46,24 +47,31 @@
elif len(cmdList) == 2:
isSync = False
washLV, attrPer = cmdList
- for place in placeList:
- maxWashLV = Operate_EquipWash.GetEquipWashMaxLV(curPlayer, place)
+ for equipPackindex in allIndexList:
+ ipyData = IpyGameDataPY.GetIpyGameDataByCondition('EquipPlaceIndexMap', {'GridIndex':equipPackindex})
+ if not ipyData:
+ continue
+ equipPlace = ipyData.GetEquipPlace()
+ maxWashLV = Operate_EquipWash.GetEquipWashMaxLV(curPlayer, equipPackindex, equipPlace)
if maxWashLV < 1:
continue
- __SetEquipPlaceWashLV(curPlayer, place, washLV, attrPer, maxWashLV)
+ __SetEquipPlaceWashLV(curPlayer, equipPackindex, equipPlace, washLV, attrPer, maxWashLV)
isSync = True
if not isSync:
return
- elif len(cmdList) == 3:
- place, washLV, attrPer = cmdList
- if place not in placeList:
+ elif len(cmdList) == 4:
+ classLV, place, washLV, attrPer = cmdList
+ ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classLV, place)
+ if not ipyData:
return
- syncPlace = place
- maxWashLV = Operate_EquipWash.GetEquipWashMaxLV(curPlayer, place)
+
+ gridIndex = ipyData.GetGridIndex()
+ syncPlace = gridIndex
+ maxWashLV = Operate_EquipWash.GetEquipWashMaxLV(curPlayer, gridIndex, place)
if maxWashLV < 1:
return
- __SetEquipPlaceWashLV(curPlayer, place, washLV, attrPer, maxWashLV)
+ __SetEquipPlaceWashLV(curPlayer, gridIndex, place, washLV, attrPer, maxWashLV)
else:
return
@@ -72,7 +80,7 @@
Operate_EquipWash.Sycn_EquipWashInfo(curPlayer, syncPlace)
return
-def __SetEquipPlaceWashLV(curPlayer, place, washLV, attrPer, maxWashLV):
+def __SetEquipPlaceWashLV(curPlayer, equipPackindex, place, washLV, attrPer, maxWashLV):
washLV = min(maxWashLV, washLV)
washLV = max(1, washLV)
attrPer = max(0, attrPer)
@@ -83,13 +91,13 @@
preWashData = None if washLV <= 1 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 % (place), washLV - 1)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashLV % (equipPackindex), washLV - 1)
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)()
value = preMaxValue + int((curMaxValue - preMaxValue) * attrPer / 100.0)
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashValue % (place, attrNum), value)
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashValueTemp % (place, attrNum), 0)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashValue % (equipPackindex, attrNum), value)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashValueTemp % (equipPackindex, attrNum), 0)
#GameWorld.DebugLog(" attrNum=%s,value=%s" % (attrNum, value))
return
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py
index 320f964..4025566 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py
@@ -458,7 +458,7 @@
#allAttrListPlusBase = [{} for _ in range(4)] # 基础强化属性
allAttrListStone = [{} for _ in range(4)] # 宝石属性
allAttrListSuit = [{} for _ in range(4)] # 套装属性
- #allAttrListWash = [{} for _ in range(4)] # 洗练属性
+ allAttrListWash = [{} for _ in range(4)] # 洗练属性
#allAttrListOutOfPrintEquip = [{} for _ in range(4)] # 绝版装备属性 需在等级变化独立计算
packType = IPY_GameWorld.rptEquip
@@ -542,10 +542,9 @@
#绝世属性
#CalcAttr_OutOfPrintAttr(curPlayer, curEquip, allAttrListOutOfPrintEquip)
#洗练属性
- #Operate_EquipWash.CalcAttr_EquipWash(curPlayer, equipIndex, allAttrListWash)
+ Operate_EquipWash.CalcAttr_EquipWash(curPlayer, equipIndex, equipPlace, allAttrListWash)
- #洗练套装属性
- #Operate_EquipWash.CalcAttr_EquipWashSpec(curPlayer, equipPlaceList, allAttrListWash)
+
#套装属性
CalcEquipSuiteAttr(curPlayer, suitCntDict, allAttrListSuit)
#GameWorld.DebugLog("所有传奇属性: %s" % legendAttrDict)
--
Gitblit v1.8.0