6332 【后端】【2.0】主要是拍品相关规则调整及背包优化(GivePlayerItem 修复给非拍品报错)
2个文件已修改
46 ■■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/MakeItemCount.py 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/MakeItemCount.py
@@ -20,6 +20,7 @@
import IpyGameDataPY
import GameWorld
import ChConfig
import ItemCommon
#---------------------------------------------------------------------
#全局变量
@@ -61,7 +62,7 @@
    playerItemControler = ItemControler.PlayerItemControler(curPlayer)
    
    # 拍品
    if auctionGroup:
    if auctionGroup > 0:
        isAuctionItem = True
        ipyData = IpyGameDataPY.GetIpyGameData("AuctionItem", itemID)
        if not ipyData:
@@ -70,9 +71,11 @@
        if not ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, auctionGroup, [IPY_GameWorld.rptItem], event=event):
            GameWorld.DebugAnswer(curPlayer, "###放入物品失败!")
    else:
        auctionGroup = 0
        isAuctionItem = False
        if itemData.GetPackCount() > 1:
            __DoGMGivePlayerItem(curPlayer, playerItemControler, itemID, itemCount, isAuctionItem, isAllAttr, event)
        if not ItemCommon.GetIsEquip(itemData):
            if not ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, auctionGroup, [IPY_GameWorld.rptItem], event=event):
                GameWorld.DebugAnswer(curPlayer, "###放入物品失败!")
        else:
            for _ in xrange(itemCount):
                __DoGMGivePlayerItem(curPlayer, playerItemControler, itemID, 1, isAuctionItem, isAllAttr, event)
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py
@@ -2111,22 +2111,27 @@
                isOK = True # 只要有成功的就返回成功,防止异常情况失败可能导致被刷
        return isOK
    
    isOK = False
    doCount = itemCount
    maxPackCount = max(1, itemCount / auctionGroup) # 每组至少1个
    while itemCount > 0 and doCount > 0:
        doCount -= 1
        giveCount = maxPackCount if itemCount >= maxPackCount else itemCount
        if giveCount <= 0:
            break
        itemCount -= giveCount
        giveItem = GetOutPutItemObj(itemID, giveCount, isAuctionItem, curPlayer=curPlayer)
        if not giveItem:
            return isOK
        if DoLogic_PutItemInPack(curPlayer, giveItem, event, packIndexList):
            isOK = True # 只要有成功的就返回成功,防止异常情况失败可能导致被刷
    return isOK
    if auctionGroup > 0:
        isOK = False
        doCount = itemCount
        maxPackCount = max(1, itemCount / auctionGroup) # 每组至少1个
        while itemCount > 0 and doCount > 0:
            doCount -= 1
            giveCount = maxPackCount if itemCount >= maxPackCount else itemCount
            if giveCount <= 0:
                break
            itemCount -= giveCount
            giveItem = GetOutPutItemObj(itemID, giveCount, isAuctionItem, curPlayer=curPlayer)
            if not giveItem:
                return isOK
            if DoLogic_PutItemInPack(curPlayer, giveItem, event, packIndexList):
                isOK = True # 只要有成功的就返回成功,防止异常情况失败可能导致被刷
        return isOK
    giveItem = GetOutPutItemObj(itemID, itemCount, isAuctionItem, curPlayer=curPlayer)
    if not giveItem:
        return False
    return DoLogic_PutItemInPack(curPlayer, giveItem, event, packIndexList)
def GivePlayerAppointItem(curPlayer, appointID, isAuctionItem, event=["", False, {}]):