| | |
| | | # @return 返回值真, 检查通过
|
| | | # @remarks 出售指定背包物品
|
| | | def SellPackItem(curPlayer, packType, itemIndexList, shopType):
|
| | | totalSellPrice = 0
|
| | | backPack = curPlayer.GetItemManager().GetPack(packType)
|
| | | if backPack == None:
|
| | | return False
|
| | |
|
| | | totalSellPriceDict = {}
|
| | | hasSellOK = False
|
| | | notForceRecordEquipTypeList = range(ChConfig.Def_ItemType_retWeapon, ChConfig.Def_ItemType_retNeck)
|
| | | for itemIndex in itemIndexList:
|
| | |
| | | curItemSellPrice, curItemSellType = __GetItemSellPrice(curPlayer, curItem)
|
| | | #获得整组销售价格
|
| | | curAllItemSellPrice = int(curItemSellPrice) * curItemCount
|
| | | totalSellPrice += curAllItemSellPrice
|
| | | totalSellPriceDict[curItemSellType] = totalSellPriceDict.get(curItemSellType, 0) + curAllItemSellPrice
|
| | | #GameWorld.Log('curItemSellPrice=%s,curAllItemSellPrice=%s,curItemCount=%s'%(curItemSellPrice,curAllItemSellPrice,curItemCount))
|
| | |
|
| | | #===========================================================================================
|
| | |
| | | #PutItemInBuyBackPack(curPlayer, curItem)
|
| | | if not hasSellOK:
|
| | | return False
|
| | | #玩家钱增加
|
| | | addDataDict = {}
|
| | | PlayerControl.GiveMoney(curPlayer, IPY_GameWorld.TYPE_Price_Silver_Money, totalSellPrice, ChConfig.Def_GiveMoney_SellPackItem, addDataDict, False)
|
| | | PlayerControl.NotifyCode(curPlayer, "GetMoney01", [IPY_GameWorld.TYPE_Price_Silver_Money, totalSellPrice])
|
| | | for priceType, priceMoney in totalSellPriceDict.items():
|
| | | #玩家钱增加
|
| | | addDataDict = {}
|
| | | PlayerControl.GiveMoney(curPlayer, priceType, priceMoney, ChConfig.Def_GiveMoney_SellPackItem, addDataDict, False)
|
| | | PlayerControl.NotifyCode(curPlayer, "GetMoney01", [priceType, priceMoney])
|
| | | return True
|
| | |
|
| | |
|
| | |
| | |
|
| | | # 修改此函数请同时修改 脱机挂出售
|
| | | #当前物品价格 原价出售
|
| | | priceType = IPY_GameWorld.TYPE_Price_Silver_Money
|
| | | priceType = curItem.GetGoldPaperPrice()
|
| | | if not priceType:
|
| | | priceType = IPY_GameWorld.TYPE_Price_Silver_Money
|
| | | curItemPrice = curItem.GetSilverPrice()
|
| | | return curItemPrice, priceType
|
| | |
|