hxp
2025-09-04 541f5d53ee3e0676c66157141aa868e31f27fa81
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerHero.py
@@ -554,11 +554,16 @@
    if not heroIpyData:
        return
    quality = heroIpyData.GetQuality()
    heroLV = heroItem.GetUserAttr(ShareDefine.Def_IudetHeroLV)
    breakLV = heroItem.GetUserAttr(ShareDefine.Def_IudetHeroBreakLV)
    GameWorld.DebugLog("请求武将突破: itemIndex=%s,heroID=%s,quality=%s,breakLV=%s"
                       % (itemIndex, heroID, quality, breakLV), playerID)
    GameWorld.DebugLog("请求武将突破: itemIndex=%s,heroID=%s,quality=%s,heroLV=%s,breakLV=%s"
                       % (itemIndex, heroID, quality, heroLV, breakLV), playerID)
    ipyData = IpyGameDataPY.GetIpyGameData("HeroQualityBreak", quality, breakLV)
    if not ipyData:
        return
    LVMax = ipyData.GetLVMax()
    if heroLV < LVMax:
        GameWorld.DebugLog("未满级,无法突破: heroLV=%s < %s" % (heroLV, LVMax), playerID)
        return
    nextBreakLV = breakLV + 1
    if not IpyGameDataPY.GetIpyGameData("HeroQualityBreak", quality, nextBreakLV):
@@ -820,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:
@@ -1134,6 +1133,9 @@
    __calcHeroBreakReturnitem(quality, breakLV, returnItemDict)
    __calcHeroAwakeReturnitem(quality, awakeLV, returnItemDict)
    
    if moneyType and costMoney and not PlayerControl.PayMoney(curPlayer, moneyType, costMoney, "HeroRebirth"):
        return
    # 执行重生
    item = heroItem.GetItem()
    item.SetUserAttr(ShareDefine.Def_IudetHeroLV, 1)
@@ -1205,7 +1207,7 @@
#struct    tagCSHeroDismiss
#{
#    tagHead         Head;
#    BYTE        Count;
#    WORD        Count;
#    WORD        ItemIndexList[Count];    // 武将物品所在武将背包位置索引列表
#};
def OnHeroDismiss(index, clientData, tick):