| | |
| | | for itemID, itemCount in jobAwardItemList:
|
| | | canSell = (not auctionItemCanSell) if itemID in aucionItemDiffSellIDList else auctionItemCanSell
|
| | | isAuctionItem = 1 if canSell and IpyGameDataPY.GetIpyGameDataNotLog("AuctionItem", itemID) else 0
|
| | | curItem = ItemControler.GetOutPutItemObj(itemID, itemCount, isAuctionItem, curPlayer=curPlayer)
|
| | | if not curItem:
|
| | | GameWorld.ErrLog("宝箱创建奖励物品异常!chestsItemID=%s,useCnt=%s,itemID=%s,itemCount=%s,isBind=%s" |
| | | % (chestsItemID, useCnt, itemID, itemCount, isBind), curPlayer.GetPlayerID())
|
| | | |
| | | userDataList = []
|
| | | giveOKCount = ItemControler.DoGiveItemLoop(curPlayer, itemID, itemCount, isAuctionItem, |
| | | event=[ChConfig.ItemGive_Chests, False, {"UseItemID":chestsItemID}], |
| | | jsonItemList=syncItemList, userDataList=userDataList)
|
| | | if giveOKCount < itemCount:
|
| | | GameWorld.ErrLog("宝箱给物品异常!chestsItemID=%s,useCnt=%s,itemID=%s,itemCount=%s,isBind=%s,giveOKCount=%s" |
| | | % (chestsItemID, useCnt, itemID, itemCount, isBind, giveOKCount), curPlayer.GetPlayerID())
|
| | | continue
|
| | |
|
| | | if showType:
|
| | | syncItemList.append(ItemCommon.GetJsonItem(curItem)) # 必须在给物品之前先get
|
| | | |
| | | userData = curItem.GetUserData()
|
| | | isOK = ItemControler.DoLogic_PutItemInPack(curPlayer, curItem, event=[ChConfig.ItemGive_Chests, False, {"UseItemID":chestsItemID}])
|
| | | if isOK and itemID in notifyItemList:
|
| | | if itemID in notifyItemList:
|
| | | userData = userDataList[0] if userDataList else ""
|
| | | PlayerControl.WorldNotify(0, "ChooseMessage", [curPlayer.GetPlayerName(), chestsItemID, itemID, isBind, itemCount, userData])
|
| | | |
| | | |
| | | # 货币
|
| | | if moneyType:
|
| | | addDataDict = {ChConfig.Def_Give_Reason_SonKey:chestsItemID}
|
| | |
| | | moneyType, moneyCount = 0, 0
|
| | |
|
| | | # ֪ͨ
|
| | | if syncItemList:
|
| | | if showType and syncItemList:
|
| | | ChItem.SendUseItemGetItemResult(curPlayer, chestsItemID, useCnt, syncItemList, moneyType, moneyCount)
|
| | | return True, useCnt
|
| | |
|