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/GM/Commands/SetEquipWash.py | 40 ++++++++++++++++++++++++---------------- 1 files changed, 24 insertions(+), 16 deletions(-) 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 -- Gitblit v1.8.0