hxp
2018-11-15 4f48659ed51c0e087e55da91ec76cbcdd7a87486
4788 【后端】【1.3】洗炼必增由消耗仙玉改为消耗道具
1个文件已修改
24 ■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipWash.py 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipWash.py
@@ -157,8 +157,8 @@
                           % (costItemID, costItemCount, bindCnt, unBindCnt), playerID)
        return
    
    goldWashCostList = washData.GetGoldWashCostList()
    if not goldWashCostList or len(goldWashCostList) != Def_EquipWashMaxAttrCount:
    goldWashCostItemCountList = washData.GetGoldWashCostList() # 洗练必增条数消耗必增道具个数
    if not goldWashCostItemCountList or len(goldWashCostItemCountList) != Def_EquipWashMaxAttrCount:
        return
    
    randAttrDict = {} # 随机变更值字典 {属性编号:随机值, ...}
@@ -193,7 +193,22 @@
        fixMaxValueDict[attrNum] = randValueMax
        
    checkUseGoldCnt = len(useGoldAttrNumList)
    needGold = 0 if checkUseGoldCnt <= 0 else goldWashCostList[checkUseGoldCnt - 1]
    needGold = 0
    needMustID = IpyGameDataPY.GetFuncCfg("EquipWashMustID", 1)
    needMustIDCount = 0 if checkUseGoldCnt <= 0 else goldWashCostItemCountList[checkUseGoldCnt - 1]
    delMustIDCount = needMustIDCount
    mustItemIndexList, mustBindCnt, mustUnBindCnt = [], 0, 0
    if needMustIDCount:
        mustItemIndexList, mustBindCnt, mustUnBindCnt = ItemCommon.GetPackItemBindStateIndexInfo(curPlayer, needMustID, needMustIDCount)
        mustItemLackCount = max(0, needMustIDCount - (mustBindCnt + mustUnBindCnt))
        if mustItemLackCount > 0:
            needGold = ItemCommon.GetAutoBuyItemNeedGold({needMustID:mustItemLackCount})
            if needGold <= 0:
                GameWorld.ErrLog("自动购买必增道具所需仙玉异常!needMustID=%s,mustItemLackCount=%s,needGold=%s"
                                 % (needMustID, mustItemLackCount, needGold), playerID)
                return
            delMustIDCount = needMustIDCount - mustItemLackCount
    if needGold and not PlayerControl.HaveMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money, needGold):
        GameWorld.DebugLog("仙玉不足,无法洗练!checkUseGoldCnt=%s,needGold=%s" % (checkUseGoldCnt, needGold), playerID)
        return
@@ -207,6 +222,9 @@
        
    # 扣除消耗
    ItemCommon.DelCostItemByBind(curPlayer, costItemIndexList, bindCnt, unBindCnt, costItemCount, "EquipWash")
    if delMustIDCount:
        ItemCommon.DelCostItemByBind(curPlayer, mustItemIndexList, mustBindCnt, mustUnBindCnt, delMustIDCount, "EquipWash")
    if needGold:
        infoDict = {"EquipPlace":equipPlace, "WashType":washType, "WashLV":washLV, "CheckUseGoldCnt":checkUseGoldCnt}
        PlayerControl.PayMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money, needGold, ChConfig.Def_Cost_EquipWash, infoDict)