6332 【后端】【2.0】主要是拍品相关规则调整及背包优化(GivePlayerAppointItem 默认都给非拍品)
| | |
| | | # else:
|
| | | # realItemID = ItemControler.GetAppointItemRealID(itemID)
|
| | | # for i in range(buyCount):
|
| | | # ItemControler.GivePlayerAppointItem(curPlayer, itemID, isBind, True, True, event=["BuyShopItem", True, eventDataEx])
|
| | | # ItemControler.GivePlayerAppointItem(curPlayer, itemID, False, event=["BuyShopItem", True, eventDataEx])
|
| | | #
|
| | | # if shopID in discountShopIDDict:
|
| | | # notifyMark = discountShopIDDict[shopID]
|
| | |
| | | #===========================================================================
|
| | |
|
| | | # 套装
|
| | | if equipData.isSuite:
|
| | | curItem.SetIsSuite(equipData.isSuite)
|
| | | if equipData.suiteLV:
|
| | | curItem.SetUserAttr(ShareDefine.Def_IudetSuiteLV, equipData.suiteLV)
|
| | | #if equipData.isSuite:
|
| | | # curItem.SetIsSuite(equipData.isSuite)
|
| | | #if equipData.suiteLV:
|
| | | # curItem.SetUserAttr(ShareDefine.Def_IudetSuiteLV, equipData.suiteLV)
|
| | | # 物品来源
|
| | | if equipData.source:
|
| | | curItem.SetUserAttr(ShareDefine.Def_IudetSource, equipData.source)
|
| | |
| | | if GetAppointItemRealID(itemID):
|
| | | isOK = False
|
| | | for _ in xrange(itemCount):
|
| | | if GivePlayerAppointItem(curPlayer, itemID, itemIsBind, showEff, showSysInfo, event):
|
| | | if GivePlayerAppointItem(curPlayer, itemID, False, event):
|
| | | isOK = True # 只要有成功的就返回成功,防止异常情况失败可能导致被刷
|
| | | return isOK
|
| | |
|
| | |
| | | showSysInfo, event)
|
| | |
|
| | |
|
| | | ## 给玩家定制物品表物品\PyMapTable\AppointItemList.txt
|
| | | # @param curPlayer 当前玩家
|
| | | # @param index 表index
|
| | | # @param isBind 是否绑定
|
| | | # @param showEff 显示放入背包的特效
|
| | | # @return 布尔值
|
| | | def GivePlayerAppointItem(curPlayer, index, isBind, showEff=False, showSysInfo=False, event=["", False, {}]):
|
| | | itemDictData = GetAppointItemDictData(index, isBind)
|
| | | def GivePlayerAppointItem(curPlayer, appointID, isAuctionItem, event=["", False, {}]):
|
| | | '''给玩家定制物品表物品,定制物品默认个数1
|
| | | @param appointID 定制表ID
|
| | | @param isAuctionItem 是否拍品
|
| | | '''
|
| | | itemDictData = GetAppointItemDictData(appointID, isAuctionItem)
|
| | | if not itemDictData:
|
| | | return False
|
| | | |
| | | return GivePlayerEquip(curPlayer, itemDictData, event=event)
|
| | |
|
| | | return GivePlayerEquip(curPlayer, itemDictData, showEff, showSysInfo=showSysInfo, event=event)
|
| | |
|
| | | ## 获取定制表物品数据
|
| | | # @param index 表index
|
| | | # @param isAuctionItem 是否拍品
|
| | | # @return ItemDictData
|
| | | def GetAppointItemDictData(index, isAuctionItem):
|
| | | itemID = GetAppointItemRealID(index)
|
| | | def GetAppointItemDictData(appointID, isAuctionItem):
|
| | | '''获取定制表物品数据,定制物品默认个数1
|
| | | @param appointID 定制表ID
|
| | | @param isAuctionItem 是否拍品
|
| | | '''
|
| | | itemID = GetAppointItemRealID(appointID)
|
| | | if not itemID:
|
| | | return {}
|
| | | ipyData = IpyGameDataPY.GetIpyGameData("AppointItem", index)
|
| | | ipyData = IpyGameDataPY.GetIpyGameData("AppointItem", appointID)
|
| | | if not ipyData:
|
| | | GameWorld.ErrLog("GetAppointItemDictData() Index=%s not data" % (index))
|
| | | return {}
|
| | | itemDictData = {}
|
| | |
|
| | | itemDictData['legendAttrID'] = ipyData.GetLegendAttrID()
|
| | | itemDictData['legendAttrValue'] = ipyData.GetLegendAttrValue()
|
| | | itemDictData['SuiteLV'] = ipyData.GetSuiteLV()
|
| | | #itemDictData['SuiteLV'] = ipyData.GetSuiteLV()
|
| | | itemDictData['ItemID'] = itemID
|
| | | itemDictData['CancelUseLimit'] = ipyData.GetCancelUseLimit()
|
| | |
|
| | | # 设置是否绑定
|
| | | isBind = 1 if not isAuctionItem else 0
|
| | | itemDictData['IsBind'] = isBind
|
| | | itemDictData['IsAuctionItem'] = isAuctionItem
|
| | |
|
| | | #装备绝版属性,随等级变化
|
| | | itemDictData['OutOfPrintAttrID'] = ipyData.GetOutOfPrintAttr()
|
| | |
| | | return
|
| | |
|
| | | itemID = int(itemData.get('ItemID', 0))
|
| | | equipItem = ItemCommon.CreateSingleItem(itemID)
|
| | | isAuctionItem = int(itemData.get('IsAuctionItem', 0))
|
| | | equipItem = ItemCommon.CreateSingleItem(itemID, isAuctionItem=isAuctionItem)
|
| | | if not equipItem:
|
| | | return
|
| | |
|
| | |
| | | #tmpEquipData.starLV = int(itemData.get('StarLV', '0'))
|
| | | #tmpEquipData.holeCnt = int(itemData.get('HoleCount', '0'))
|
| | | #tmpEquipData.stoneData = eval(itemData.get('StoneData', '[]'))
|
| | | tmpEquipData.isBind = int(itemData.get('IsBind', '0'))
|
| | | tmpEquipData.isSuite = int(itemData.get('IsSuit', '0'))
|
| | | tmpEquipData.suiteLV = int(itemData.get('SuiteLV', '0'))
|
| | | if tmpEquipData.suiteLV:
|
| | | tmpEquipData.isSuite = 1
|
| | | tmpEquipData.isBind = 1 if not isAuctionItem else 0
|
| | | #tmpEquipData.isSuite = int(itemData.get('IsSuit', '0'))
|
| | | #tmpEquipData.suiteLV = int(itemData.get('SuiteLV', '0'))
|
| | | #if tmpEquipData.suiteLV:
|
| | | # tmpEquipData.isSuite = 1
|
| | | tmpEquipData.source = int(itemData.get('Source', str(ShareDefine.Item_Source_Unkown)))
|
| | |
|
| | | tmpEquipData.legendAttrIDList = itemData.get('legendAttrID', [])
|
| | |
| | |
|
| | | if ItemControler.GetAppointItemRealID(itemID):
|
| | | # 定制物品转化为物品信息字典
|
| | | appointItemObj = ItemControler.GetItemByData(ItemControler.GetAppointItemDictData(itemID, isBind))
|
| | | appointItemObj = ItemControler.GetItemByData(ItemControler.GetAppointItemDictData(itemID, False))
|
| | | if not appointItemObj:
|
| | | GameWorld.ErrLog("邮件定制物品转化失败!itemID, itemCnt, isBind" % (itemID, itemCnt, isBind))
|
| | | continue
|
| | |
| | | giveFailList.append(itemInfo)
|
| | |
|
| | | elif itemType == Item_Type_Appoint:
|
| | | if not ItemControler.GivePlayerAppointItem(curPlayer, itemId, itemIsBind, True, showSysInfo=True):
|
| | | if not ItemControler.GivePlayerAppointItem(curPlayer, itemId, False):
|
| | | giveFailList.append(itemInfo)
|
| | |
|
| | | if giveFailList:
|
| | |
| | | ItemControler.GivePlayerItem(curPlayer, itemId, itemNum, 0, [IPY_GameWorld.rptItem], True)
|
| | |
|
| | | elif itemType == Item_Type_Appoint:
|
| | | ItemControler.GivePlayerAppointItem(curPlayer, itemId, itemIsBind, True)
|
| | | ItemControler.GivePlayerAppointItem(curPlayer, itemId, False)
|
| | |
|
| | | ## 奖励物品列表
|
| | | # @param curPlayer
|
| | |
| | | ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, 0,
|
| | | [IPY_GameWorld.rptItem, IPY_GameWorld.rptAnyWhere])
|
| | | elif itemType == 1:
|
| | | ItemControler.GivePlayerAppointItem(curPlayer, itemID, isBind)
|
| | | ItemControler.GivePlayerAppointItem(curPlayer, itemID, False)
|
| | |
|
| | | else:
|
| | | GameWorld.ErrLog("钓鱼奖励类型不支持itemType=%s" % itemType, curPlayer.GetPlayerID())
|
| | |
| | | isAppoint = itemInfo[3] if len(itemInfo) > 3 else 0
|
| | |
|
| | | if isAppoint:
|
| | | isOK = ItemControler.GivePlayerAppointItem(curPlayer, itemID, itemBind, True, True)
|
| | | isOK = ItemControler.GivePlayerAppointItem(curPlayer, itemID, False)
|
| | | else:
|
| | | isOK = ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, 0, [IPY_GameWorld.rptItem],
|
| | | True, showSysInfo=True)
|
| | |
| | | continue
|
| | | itemID, itemCount, isBind, isAppoint = awardItem
|
| | | if isAppoint:
|
| | | ItemControler.GivePlayerAppointItem(curPlayer, itemID, isBind, True, True)
|
| | | ItemControler.GivePlayerAppointItem(curPlayer, itemID, False)
|
| | | else:
|
| | | ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, 0, [IPY_GameWorld.rptItem], True, showSysInfo=True)
|
| | |
|