|  |  | 
 |  |  |                 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, {}]):
 |