| | |
| | | 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', [])
|