121 【武将】武将系统-服务端(天赋洗炼改为仅使用洗炼ID,锁定天赋增加消耗洗炼道具个数;)
1个文件已修改
32 ■■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerHero.py 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerHero.py
@@ -825,33 +825,27 @@
        GameWorld.ErrLog("武将洗炼结果未处理,无法洗炼! washIDCnt=%s" % washIDCnt)
        return
    
    washCostItemInfo = IpyGameDataPY.GetFuncEvalCfg("HeroWash", 1)
    lockCostItemInfo = IpyGameDataPY.GetFuncEvalCfg("HeroWash", 2)
    if not washCostItemInfo or not lockCostItemInfo:
    washItemID = IpyGameDataPY.GetFuncCfg("HeroWash", 1)
    lockCostItemList = IpyGameDataPY.GetFuncEvalCfg("HeroWash", 2)
    if not lockCostItemList:
        return
    washItemID, washCostItemCount = washCostItemInfo
    lockItemID, lockCostItemCount = lockCostItemInfo
    singleItem = heroItem.GetItem()
    idCount = singleItem.GetUserAttrCount(ShareDefine.Def_IudetHeroTalentID)
    for lockIndex in lockTalentIndexs[::-1]:
        if lockIndex >= idCount:
            lockTalentIndexs.remove(lockIndex)
            GameWorld.DebugLog("去除不存在的锁定索引: lockIndex=%s" % lockIndex)
    lockCnt = len(lockTalentIndexs)
    washCostItemCount = lockCostItemList[lockCnt] if len(lockCostItemList) > lockCnt else lockCostItemList[-1]
    GameWorld.DebugLog("washItemID=%s,washCostItemCount=%s,lockTalentIndexs=%s" % (washItemID, washCostItemCount, lockTalentIndexs))
    itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
    hasEnough, washItemIndexList = ItemCommon.GetItem_FromPack_ByID(washItemID, itemPack, washCostItemCount)
    if not hasEnough:
        GameWorld.DebugLog("洗炼材料不足,武将无法洗炼! washItemID=%s,washCostItemCount=%s" % (washItemID, washCostItemCount))
        return
    lockItemIndexList = []
    lockCostItemCountTotal = 0
    if lockTalentIndexs:
        lockCostItemCountTotal = len(lockTalentIndexs) * lockCostItemCount
        hasEnough, lockItemIndexList = ItemCommon.GetItem_FromPack_ByID(lockItemID, itemPack, lockCostItemCountTotal)
        if not hasEnough:
            GameWorld.DebugLog("锁定材料不足,武将无法洗炼! lockItemID=%s,lockCostItemCount=%s,lockCostItemCountTotal=%s"
                               % (lockItemID, lockCostItemCount, lockCostItemCountTotal))
            return
    ItemCommon.ReduceItem(curPlayer, itemPack, washItemIndexList, washCostItemCount, True, "HeroTalentWash")
    ItemCommon.ReduceItem(curPlayer, itemPack, lockItemIndexList, lockCostItemCountTotal, True, "HeroTalentWash")
    
    singleItem = heroItem.GetItem()
    idCount = singleItem.GetUserAttrCount(ShareDefine.Def_IudetHeroTalentID)
    washIDList = []
    for index in range(idCount):
        if index in lockTalentIndexs: