5323 【主干】【后端】法器自动培养问题(自动购买支持按指定的商城表商品标识ID购买)
2个文件已修改
14 ■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/FunctionNPCCommon.py 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFaQi.py 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/FunctionNPCCommon.py
@@ -531,9 +531,11 @@
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_DelPackIndex, int(itemIndexs))
    return
def PayAutoBuyItem(curPlayer, lackItemDict, priceType, costType=ChConfig.Def_Cost_Unknown, infoDict={}, isCheck=False):
def PayAutoBuyItem(curPlayer, lackItemDict, priceType, costType=ChConfig.Def_Cost_Unknown, infoDict={}, isCheck=False, shopItemIndexDict=None):
    ''' 支付自动购买物品消耗,从商城中购买,直接扣钱,不产生物品
            一般用于基础商店自动购买物品,不考虑复杂的限购逻辑
    @param isCheck: 是否只是检查,不执行实际消耗逻辑
    @param shopItemIndexDict: 指定购买的商品对应商城表商品ID索引字典,如果没有指定商品索引,则按消耗的价格类型自动搜索商城表
    '''
    
    addLimitCountInfo = {}
@@ -547,12 +549,17 @@
        if not curItem:
            return
        
        ipyData = ItemCommon.GetShopItemPriceIpyData(itemID, priceType)
        if shopItemIndexDict and itemID in shopItemIndexDict:
            itemIndex = shopItemIndexDict[itemID]
            ipyData = IpyGameDataPY.GetIpyGameData("Store", itemIndex)
        else:
            ipyData = ItemCommon.GetShopItemPriceIpyData(itemID, priceType)
        if not ipyData:
            return
        
        itemIndex = ipyData.GetID()
        shopType = ipyData.GetShopType()
        priceType = ipyData.GetMoneyType()
        itemMoney = ipyData.GetMoneyNum()
        limitCntList = ipyData.GetLimitCnt()
        if limitCntList:
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFaQi.py
@@ -73,6 +73,7 @@
        return
    
    costItemID = IpyGameDataPY.GetFuncCfg("FaQiUpItem", 1)
    autoBuyShopIndex = IpyGameDataPY.GetFuncCfg("FaQiUpItem", 2)
    if not costItemID or not costItemCount:
        return
    
@@ -87,7 +88,7 @@
    if lackCnt > 0:
        autoBuyMoneyType = IPY_GameWorld.TYPE_Price_Gold_Money
        infoDict = {ChConfig.Def_Cost_Reason_SonKey:costItemID}
        if not FunctionNPCCommon.PayAutoBuyItem(curPlayer, {costItemID:lackCnt}, autoBuyMoneyType, ChConfig.Def_Cost_FaQi, infoDict):
        if not FunctionNPCCommon.PayAutoBuyItem(curPlayer, {costItemID:lackCnt}, autoBuyMoneyType, ChConfig.Def_Cost_FaQi, infoDict, shopItemIndexDict={costItemID:autoBuyShopIndex}):
            return
        delCnt -= lackCnt