| | |
| | | itemNoteDict = ItemCommon.GetItemNoteDict(item, canPutinCount, packItemCount, canPutinCount)
|
| | | ItemCommon.DR_GetItem(curPlayer, packIndex, eventName, itemNoteDict, addDict)
|
| | | else:
|
| | | #可以放下
|
| | | if isEquip:
|
| | | self.CheckEquipAttr(packIndex, tagItem)
|
| | | |
| | | |
| | | if tagItem.GetGameWorldItemType() == IPY_GameWorld.gwitRoleItem:
|
| | | item.PutIn(tagItem)
|
| | | elif tagItem.GetGameWorldItemType() == IPY_GameWorld.gwitSingleItem:
|
| | |
| | | #放入东西
|
| | | return putResult
|
| | |
|
| | | def CheckEquipAttr(self, packType, curItem):
|
| | | legendAttrIDCount = curItem.GetUserAttrCount(ShareDefine.Def_IudetLegendAttrID)
|
| | | legendAttrValueCount = curItem.GetUserAttrCount(ShareDefine.Def_IudetLegendAttrValue)
|
| | | |
| | | if legendAttrIDCount and legendAttrValueCount and legendAttrIDCount == legendAttrValueCount:
|
| | | return
|
| | | |
| | | curPlayer = self.__Player
|
| | | legendAttrInfo = GetAddEquipLegendAttr(curItem, curPlayer)
|
| | | if not legendAttrInfo:
|
| | | return
|
| | | |
| | | curPlayer = self.__Player
|
| | | srcScore = ItemCommon.GetEquipGearScore(curItem)
|
| | | SetEquipLegendAttr(curItem, legendAttrInfo)
|
| | | ItemCommon.MakeEquipGS(curItem)
|
| | | updScore = ItemCommon.GetEquipGearScore(curItem)
|
| | | GameWorld.DebugLog("传奇属性异常,重新刷新一次属性: packType=%s,itemID=%s,srcScore=%s,updScore=%s" |
| | | % (packType, curItem.GetItemTypeID(), srcScore, updScore), curPlayer.GetPlayerID())
|
| | | return
|
| | |
|
| | | ## 是否能放入物品
|
| | | # @param packIndex 背包索引
|
| | | # @param curItemID 当前物品ID
|
| | |
| | |
|
| | | return
|
| | |
|
| | | def GivePlayerItem(curPlayer, itemID, itemCount, isAuctionItem, packIndexList, event=["", False, {}]):
|
| | | def GivePlayerItem(curPlayer, itemID, itemCount, isAuctionItem, packIndexList, event=["", False, {}], setAttrDict=None):
|
| | | '''给玩家物品
|
| | | @param isAuctionItem: 是否拍品
|
| | | '''
|
| | |
| | | #不可放入
|
| | | return False
|
| | |
|
| | | #定制物品
|
| | | if GetAppointItemRealID(itemID):
|
| | | isOK = False
|
| | | for _ in xrange(itemCount):
|
| | | if GivePlayerAppointItem(curPlayer, itemID, isAuctionItem, event):
|
| | | isOK = True # 只要有成功的就返回成功,防止异常情况失败可能导致被刷
|
| | | return isOK
|
| | | |
| | | #装备
|
| | | if ItemCommon.GetIsEquip(curItemData):
|
| | | isOK = False
|
| | | for _ in xrange(itemCount):
|
| | | outPutEquip = GetOutPutItemObj(itemID, 1, isAuctionItem, curPlayer=curPlayer)
|
| | | outPutEquip = GetOutPutItemObj(itemID, 1, isAuctionItem, curPlayer=curPlayer, setAttrDict=setAttrDict)
|
| | | if not outPutEquip:
|
| | | return isOK
|
| | | if DoLogic_PutItemInPack(curPlayer, outPutEquip, event, packIndexList):
|
| | | isOK = True # 只要有成功的就返回成功,防止异常情况失败可能导致被刷
|
| | | return isOK
|
| | |
|
| | | giveItem = GetOutPutItemObj(itemID, itemCount, isAuctionItem, curPlayer=curPlayer)
|
| | | giveItem = GetOutPutItemObj(itemID, itemCount, isAuctionItem, curPlayer=curPlayer, setAttrDict=setAttrDict)
|
| | | if not giveItem:
|
| | | return False
|
| | | return DoLogic_PutItemInPack(curPlayer, giveItem, event, packIndexList)
|
| | |
|
| | |
|
| | | 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)
|
| | |
|
| | | def GetAppointItemDictData(appointID, isAuctionItem):
|
| | | '''获取定制表物品数据,定制物品默认个数1
|
| | | @param appointID 定制表ID
|
| | | @param isAuctionItem 是否拍品
|
| | | '''
|
| | | itemID = GetAppointItemRealID(appointID)
|
| | | if not itemID:
|
| | | return {}
|
| | | ipyData = IpyGameDataPY.GetIpyGameData("AppointItem", appointID)
|
| | | if not ipyData:
|
| | | return {}
|
| | | itemDictData = {}
|
| | | |
| | | itemDictData['legendAttrID'] = ipyData.GetLegendAttrID()
|
| | | itemDictData['legendAttrValue'] = ipyData.GetLegendAttrValue()
|
| | | itemDictData['ItemID'] = itemID
|
| | | itemDictData['CancelUseLimit'] = ipyData.GetCancelUseLimit()
|
| | | |
| | | itemDictData['IsAuctionItem'] = isAuctionItem
|
| | | |
| | | return itemDictData
|
| | |
|
| | | def GetAppointItemRealID(itemID):
|
| | | '''获取定制物品对应的真实物品ID'''
|
| | | curItem = GameWorld.GetGameData().GetItemByTypeID(itemID)
|
| | | if not curItem:
|
| | | return 0
|
| | | curEff = curItem.GetEffectByIndex(0)
|
| | | curEffID = curEff.GetEffectID()
|
| | | if curEffID != ChConfig.Def_Effect_AppointItem:
|
| | | return 0
|
| | | return curEff.GetEffectValue(0)
|
| | |
|
| | | ## 根据物品data字典给玩家装备/翅膀
|
| | | # @param curPlayer:玩家实例
|
| | | # @param itemData:物品数据
|
| | | # @param packType:背包类型
|
| | | # @param defaultPile 默认先判断是否能进行物品堆叠
|
| | | # @return None
|
| | | def GivePlayerEquip(curPlayer, itemData, event=["", False, {}], packType=[IPY_GameWorld.rptItem, IPY_GameWorld.rptAnyWhere],
|
| | | defaultPile=True):
|
| | | equipItem = GetItemByData(itemData)
|
| | | #将物品放入背包
|
| | | return DoLogic_PutItemInPack(curPlayer, equipItem, event, packType, defaultPile)
|
| | |
|
| | |
|
| | | ## 根据物品data字典创建物品
|
| | | # @param itemData:物品数据
|
| | | # @return ItemObj
|
| | | def GetItemByData(itemData):
|
| | | if not itemData:
|
| | | return
|
| | | |
| | | itemID = int(itemData.get('ItemID', 0))
|
| | | isAuctionItem = int(itemData.get('IsAuctionItem', 0))
|
| | | equipItem = ItemCommon.CreateSingleItem(itemID, isAuctionItem=isAuctionItem)
|
| | | if not equipItem:
|
| | | return
|
| | | |
| | | tmpEquipData = SingleEquipTmpData()
|
| | | |
| | | #tmpEquipData.starLV = int(itemData.get('StarLV', '0'))
|
| | | #tmpEquipData.holeCnt = int(itemData.get('HoleCount', '0'))
|
| | | #tmpEquipData.stoneData = eval(itemData.get('StoneData', '[]'))
|
| | | tmpEquipData.isBind = isAuctionItem
|
| | | #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', [])
|
| | | tmpEquipData.legendAttrValueList = itemData.get('legendAttrValue', [])
|
| | | |
| | | # 装备附加属性
|
| | | ChItem.EquipAddAdditionEx(equipItem, tmpEquipData)
|
| | | |
| | | if "UserData" in itemData:
|
| | | userData = itemData["UserData"]
|
| | | equipItem.SetUserData(userData, len(userData))
|
| | | |
| | | if "EquipGS" in itemData:
|
| | | equipGS = int(itemData["EquipGS"])
|
| | | ItemCommon.SetEquipGearScore(equipItem, equipGS)
|
| | | |
| | | |
| | | # 取消等级限制
|
| | | if itemData.get('CancelUseLimit', 0):
|
| | | equipItem.SetUserAttr(ShareDefine.Def_IudetCancelUseLimit, 1)
|
| | | |
| | | return equipItem
|
| | |
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | ## 执行物品放入背包逻辑
|
| | |
| | | def SetIsAuctionItem(curItem, isAuctionItem, curPlayer=None):
|
| | | curItem.SetIsBind(isAuctionItem)
|
| | |
|
| | | if isAuctionItem:
|
| | | curItem.SetUserAttr(ShareDefine.Def_IudetAuctionItemCreateTime, int(time.time()))
|
| | | return
|
| | | # 20201223 主干取消拍品有效时长设定
|
| | | #if isAuctionItem:
|
| | | # curItem.SetUserAttr(ShareDefine.Def_IudetAuctionItemCreateTime, int(time.time()))
|
| | | # return
|
| | |
|
| | | if not curPlayer:
|
| | | return
|
| | | #if not curPlayer:
|
| | | # return
|
| | |
|
| | | if ItemCommon.GetIsEquip(curItem):
|
| | | legendAttrIDCnt = curItem.GetUserAttrCount(ShareDefine.Def_IudetLegendAttrID)
|
| | | legendAttrValueCnt = curItem.GetUserAttrCount(ShareDefine.Def_IudetLegendAttrValue)
|
| | | if legendAttrIDCnt and legendAttrIDCnt == legendAttrValueCnt:
|
| | | legendAttrInfo = GetEquipLegendAttrGroup(curItem)
|
| | | #GameWorld.DebugLog("已经有传奇属性的拍品: %s" % str(legendAttrInfo))
|
| | | else:
|
| | | # 生成传奇属性
|
| | | legendAttrInfo = GetAddEquipLegendAttr(curItem, curPlayer)
|
| | | #GameWorld.DebugLog("重新生成传奇属性的拍品: %s" % str(legendAttrInfo))
|
| | | if not legendAttrInfo:
|
| | | return
|
| | | |
| | | updateDict = {}
|
| | | if legendAttrInfo[0]:
|
| | | updateDict[ShareDefine.Def_IudetLegendAttrID] = legendAttrInfo[0]
|
| | | updateDict[ShareDefine.Def_IudetLegendAttrValue] = legendAttrInfo[1]
|
| | | if legendAttrInfo[2]:
|
| | | updateDict[ShareDefine.Def_IudetLegendAttrIDShen] = legendAttrInfo[2]
|
| | | updateDict[ShareDefine.Def_IudetLegendAttrValueShen] = legendAttrInfo[3]
|
| | | if legendAttrInfo[4]:
|
| | | updateDict[ShareDefine.Def_IudetLegendAttrIDXian] = legendAttrInfo[4]
|
| | | updateDict[ShareDefine.Def_IudetLegendAttrValueXian] = legendAttrInfo[5]
|
| | | if legendAttrInfo[6]:
|
| | | updateDict[ShareDefine.Def_IudetLegendAttrIDJi] = legendAttrInfo[6]
|
| | | updateDict[ShareDefine.Def_IudetLegendAttrValueJi] = legendAttrInfo[7]
|
| | | |
| | | delKeyList = [ShareDefine.Def_IudetAuctionItemCreateTime]
|
| | | ItemCommon.UpdateItemUserData(curItem, updateDict, delKeyList, isUpdateGS=True)
|
| | | #if ItemCommon.GetIsEquip(curItem):
|
| | | # delKeyList = [ShareDefine.Def_IudetAuctionItemCreateTime]
|
| | | # ItemCommon.UpdateItemUserData(curItem, updateDict, delKeyList, isUpdateGS=True)
|
| | |
|
| | | return
|
| | |
|
| | |
| | | #---无空位置,替换---
|
| | | return placeList[0]
|
| | |
|
| | | def GetOutPutItemObj(itemID, itemCount=1, isAuctionItem=False, expireTime=0, curPlayer=None, isAllAttr=False):
|
| | | def GetOutPutItemObj(itemID, itemCount=1, isAuctionItem=False, expireTime=0, curPlayer=None, setAttrDict=None):
|
| | | ''' 获取功能产出的物品实例
|
| | | @param isAuctionItem: 是否拍品,默认非拍品
|
| | | @param expireTime: 有效时间,时间单位由时效类型决定
|
| | | @param curPlayer: 产出该物品时的玩家,物品某些属性由玩家等级决定,如传奇属性
|
| | | @param isAllAttr: 是否生成该装备所有属性,GM创建物品时用,需验证相关权限
|
| | | @param setAttrDict: 直接设置物品的属性 {key:value, ...} key支持 ShareDefine.Def_IudetXXX字符串 或 自定key
|
| | | '''
|
| | | curItem = ItemCommon.CreateSingleItem(itemID, itemCount, isAuctionItem, expireTime)
|
| | | curItem = ItemCommon.CreateSingleItem(itemID, itemCount, isAuctionItem, expireTime, curPlayer, setAttrDict)
|
| | | if not curItem:
|
| | | GameWorld.ErrLog("产出物品异常,无法创建物品 = %s" % (itemID))
|
| | | return
|
| | | |
| | | # 非装备,无需设置属性
|
| | | if not ItemCommon.CheckItemIsEquip(curItem):
|
| | | return curItem
|
| | | |
| | | # 定制物品
|
| | | if GetAppointItemRealID(itemID):
|
| | | curItem.Clear()
|
| | | #GameWorld.DebugLog("清除给定制物品之前已经创建的物品ID=%s" % itemID)
|
| | | return GetItemByData(GetAppointItemDictData(itemID, isAuctionItem))
|
| | | |
| | | # # 拍品不处理其他属性
|
| | | # if isAuctionItem:
|
| | | # return curItem
|
| | | |
| | | tmpEquipData = SingleEquipTmpData()
|
| | | |
| | | # 传奇属性
|
| | | legendAttrInfo = GetAddEquipLegendAttr(curItem, curPlayer, isAllAttr)
|
| | | if legendAttrInfo:
|
| | | tmpEquipData.legendAttrIDList = legendAttrInfo[0]
|
| | | tmpEquipData.legendAttrValueList = legendAttrInfo[1]
|
| | | tmpEquipData.legendAttrIDListShen = legendAttrInfo[2]
|
| | | tmpEquipData.legendAttrValueListShen = legendAttrInfo[3]
|
| | | tmpEquipData.legendAttrIDListXian = legendAttrInfo[4]
|
| | | tmpEquipData.legendAttrValueListXian = legendAttrInfo[5]
|
| | | tmpEquipData.legendAttrIDListJi = legendAttrInfo[6]
|
| | | tmpEquipData.legendAttrValueListJi = legendAttrInfo[7]
|
| | | |
| | | # 其他装备属性
|
| | | ChItem.EquipAddAdditionEx(curItem, tmpEquipData)
|
| | | return curItem
|
| | |
|
| | | def GetAddEquipLegendAttr(curItem, curPlayer, isAllAttr=False):
|
| | | '''获取生成到装备上的传奇属性
|
| | | @return: None 或者 [传奇属性效果ID列表], [属性值列表], [神ID], [神值], [仙ID], [仙值], [极ID], [极值]
|
| | | '''
|
| | | # if GetIsAuctionItem(curItem):
|
| | | # #GameWorld.DebugLog("拍品无法生成传奇属性!")
|
| | | # return
|
| | | itemID = curItem.GetItemTypeID()
|
| | | itemType = curItem.GetType()
|
| | | itemColor = curItem.GetItemColor()
|
| | | itemQuality = curItem.GetItemQuality()
|
| | | isSuit = 1 if curItem.GetSuiteID() else 0
|
| | | |
| | | ipyData = IpyGameDataPY.GetIpyGameDataNotLog("EquipShenAttr", itemID)
|
| | | if ipyData:
|
| | | return ipyData.GetLegendAttrIDList(), ipyData.GetLegendAttrValueList(), \
|
| | | ipyData.GetShenAttrIDList(), ipyData.GetShenAttrValueList(), \
|
| | | ipyData.GetXianAttrIDList(), ipyData.GetXianAttrValueList(), \
|
| | | ipyData.GetJiAttrIDList(), ipyData.GetJiAttrValueList()
|
| | | |
| | | # 1. 定条数
|
| | | attrCountIpyData = IpyGameDataPY.GetIpyGameDataNotLog("EquipLegendAttrCount", itemType, itemColor, isSuit, itemQuality)
|
| | | if not attrCountIpyData:
|
| | | if itemColor >= ChConfig.Def_Quality_Purple:
|
| | | GameWorld.DebugLog("该装备没有传奇属性: itemID=%s" % (itemID))
|
| | | return
|
| | | legendAttrCountInfoList = attrCountIpyData.GetLegendAttrCountInfo() # 传奇属性条数信息 [[条数, [属性类型库编号, ...]], ...]
|
| | | if not legendAttrCountInfoList:
|
| | | return
|
| | | |
| | | if curPlayer:
|
| | | playerID, playerLV = curPlayer.GetPlayerID(), curPlayer.GetLV()
|
| | | else:
|
| | | playerID = 0
|
| | | playerLV = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_WorldAverageLv)
|
| | | GameWorld.Log("生成装备传奇属性时没有玩家等级, 取当前世界等级! itemID=%s,worldLV=%s" % (itemID, playerLV))
|
| | | |
| | | # 2. 定属性ID
|
| | | attrTypeIpyData = IpyGameDataPY.GetIpyGameData("EquipLegendAttrType", itemType)
|
| | | if not attrTypeIpyData:
|
| | | return
|
| | | legendAttrTypeLibDict = attrTypeIpyData.GetLegendAttrTypeLib() # 传奇属性类型库 {属性类型库编号:[属性ID,...], ...}
|
| | | |
| | | curLegAttrIDList = []
|
| | | curLegAttrValueList = []
|
| | | itemClassLV = ItemCommon.GetItemClassLV(curItem)
|
| | | if isAllAttr:
|
| | | if curPlayer.GetGMLevel() != 90:
|
| | | return
|
| | | for attrIDList in legendAttrTypeLibDict.values():
|
| | | curLegAttrIDList += attrIDList
|
| | | #GameWorld.DebugLog("所有传奇属性: %s" % (curLegAttrIDList), playerID)
|
| | | else:
|
| | | #GameWorld.DebugLog("随机传奇属性: itemID=%s,itemType=%s,itemClassLV=%s,itemColor=%s,isSuit=%s" |
| | | # % (itemID, itemType, itemClassLV, itemColor, isSuit), playerID)
|
| | | for attrCount, libNumList in legendAttrCountInfoList:
|
| | | attrIDList = []
|
| | | for libNum in libNumList:
|
| | | attrIDList.extend(legendAttrTypeLibDict.get(libNum, []))
|
| | | for curAttrID in curLegAttrIDList:
|
| | | if curAttrID in attrIDList:
|
| | | attrIDList.remove(curAttrID)
|
| | | if len(attrIDList) < attrCount:
|
| | | GameWorld.ErrLog("装备传奇属性ID库配置不够条数随机!itemID=%s,itemType=%s,legendAttrCountInfoList=%s,legendAttrTypeLibDict=%s" |
| | | % (itemID, itemType, legendAttrCountInfoList, legendAttrTypeLibDict), playerID)
|
| | | return
|
| | | curLegAttrIDList += random.sample(attrIDList, attrCount)
|
| | | #GameWorld.DebugLog(" 随机传奇属性: attrCount=%s,libNumList=%s,attrIDList=%s,curLegAttrIDList=%s" |
| | | # % (attrCount, libNumList, attrIDList, curLegAttrIDList), playerID)
|
| | | |
| | | # 3. 定数值
|
| | | attrValueIpyData = IpyGameDataPY.GetIpyGameData("EquipLegendAttrValue", itemType, itemClassLV, itemColor, isSuit, itemQuality)
|
| | | if not attrValueIpyData:
|
| | | GameWorld.ErrLog("传奇属性等级数值表找不到配置!itemID=%s,itemType=%s,itemClassLV=%s,itemColor=%s,isSuit=%s,itemQuality=%s" |
| | | % (itemID, itemType, itemClassLV, itemColor, isSuit, itemQuality), playerID)
|
| | | return
|
| | | |
| | | attrLVLibNumDict = attrValueIpyData.GetLVLegendAttrLibNumInfo() # {属性ID:{等级:库编号, ...}}
|
| | | for attrID in curLegAttrIDList:
|
| | | if attrID not in attrLVLibNumDict:
|
| | | GameWorld.ErrLog("传奇属性等级数值表没有配置属性ID对应等级库编号!itemID=%s,itemType=%s,itemClassLV=%s,itemColor=%s,isSuit=%s,attrID=%s" |
| | | % (itemID, itemType, itemClassLV, itemColor, isSuit, attrID), playerID)
|
| | | return
|
| | | curLibNum = None
|
| | | lvAttrLibList = attrLVLibNumDict[attrID]
|
| | | for lv, libNum in lvAttrLibList:
|
| | | if playerLV <= lv:
|
| | | curLibNum = libNum
|
| | | break
|
| | | if curLibNum == None:
|
| | | GameWorld.ErrLog("传奇属性等级数值表找不到属性ID对应等级库编号!itemID=%s,itemType=%s,itemClassLV=%s,itemColor=%s,isSuit=%s,attrID=%s,playerLV=%s" |
| | | % (itemID, itemType, itemClassLV, itemColor, isSuit, attrID, playerLV), playerID)
|
| | | return
|
| | | attrLibIpyData = attrValueIpyData = IpyGameDataPY.GetIpyGameData("EquipLegendAttrLib", attrID)
|
| | | if not attrLibIpyData:
|
| | | GameWorld.ErrLog("传奇属性库不存在传奇属性ID配置!itemID=%s,attrID=%s" % (itemID, attrID), playerID)
|
| | | return
|
| | | attrLibDict = attrLibIpyData.GetLegendAttrLib() # {库编号:[随机数值, ...], ...}
|
| | | if curLibNum not in attrLibDict:
|
| | | GameWorld.ErrLog("传奇属性库编号不存在!itemID=%s,attrID=%s,curLibNum=%s" % (itemID, attrID, curLibNum), playerID)
|
| | | return
|
| | | valueList = attrLibDict[curLibNum]
|
| | | attrValue = random.choice(valueList)
|
| | | curLegAttrValueList.append(attrValue)
|
| | | #GameWorld.DebugLog(" 随机属性: attrID=%s,attrValue=%s,playerLV=%s,curLibNum=%s,valueList=%s" |
| | | # % (attrID, attrValue, playerLV, curLibNum, valueList), playerID)
|
| | | return curLegAttrIDList, curLegAttrValueList, [], [], [], [], [], []
|
| | |
|
| | | def GetEquipLegendAttrAll(curItem):
|
| | | ## 获取装备传奇属性 - 所有分组合并返回
|
| | |
| | | jiAttrValueList.append(curItem.GetUserAttrByIndex(ShareDefine.Def_IudetLegendAttrValueJi, i))
|
| | |
|
| | | return legAttrIDList, legAttrValueList, shenAttrIDList, shenAttrValueList, xianAttrIDList, xianAttrValueList, jiAttrIDList, jiAttrValueList
|
| | |
|
| | | def SetEquipLegendAttr(curItem, legendAttrInfo):
|
| | | ## 设置装备传奇属性
|
| | | |
| | | legAttrIDList, legAttrValueList, shenAttrIDList, shenAttrValueList, \
|
| | | xianAttrIDList, xianAttrValueList, jiAttrIDList, jiAttrValueList = legendAttrInfo
|
| | | |
| | | # 普通传奇属性
|
| | | if legAttrIDList and legAttrValueList and len(legAttrIDList) == len(legAttrValueList):
|
| | | curItem.ClearUserAttr(ShareDefine.Def_IudetLegendAttrID)
|
| | | curItem.ClearUserAttr(ShareDefine.Def_IudetLegendAttrValue)
|
| | | for i in xrange(len(legAttrIDList)):
|
| | | curItem.AddUserAttr(ShareDefine.Def_IudetLegendAttrID, legAttrIDList[i])
|
| | | curItem.AddUserAttr(ShareDefine.Def_IudetLegendAttrValue, legAttrValueList[i])
|
| | | |
| | | # 神 传奇属性
|
| | | if shenAttrIDList and shenAttrValueList and len(shenAttrIDList) == len(shenAttrValueList):
|
| | | curItem.ClearUserAttr(ShareDefine.Def_IudetLegendAttrIDShen)
|
| | | curItem.ClearUserAttr(ShareDefine.Def_IudetLegendAttrValueShen)
|
| | | for i in xrange(len(shenAttrIDList)):
|
| | | curItem.AddUserAttr(ShareDefine.Def_IudetLegendAttrIDShen, shenAttrIDList[i])
|
| | | curItem.AddUserAttr(ShareDefine.Def_IudetLegendAttrValueShen, shenAttrValueList[i])
|
| | | |
| | | # 仙 传奇属性
|
| | | if xianAttrIDList and xianAttrValueList and len(xianAttrIDList) == len(xianAttrValueList):
|
| | | curItem.ClearUserAttr(ShareDefine.Def_IudetLegendAttrIDXian)
|
| | | curItem.ClearUserAttr(ShareDefine.Def_IudetLegendAttrValueXian)
|
| | | for i in xrange(len(xianAttrIDList)):
|
| | | curItem.AddUserAttr(ShareDefine.Def_IudetLegendAttrIDXian, xianAttrIDList[i])
|
| | | curItem.AddUserAttr(ShareDefine.Def_IudetLegendAttrValueXian, xianAttrValueList[i])
|
| | | |
| | | # 极 传奇属性
|
| | | if jiAttrIDList and jiAttrValueList and len(jiAttrIDList) == len(jiAttrValueList):
|
| | | curItem.ClearUserAttr(ShareDefine.Def_IudetLegendAttrIDJi)
|
| | | curItem.ClearUserAttr(ShareDefine.Def_IudetLegendAttrValueJi)
|
| | | for i in xrange(len(jiAttrIDList)):
|
| | | curItem.AddUserAttr(ShareDefine.Def_IudetLegendAttrIDJi, jiAttrIDList[i])
|
| | | curItem.AddUserAttr(ShareDefine.Def_IudetLegendAttrValueJi, jiAttrValueList[i])
|
| | | |
| | | return
|
| | |
|
| | | ##创建物品所需的动态数据
|
| | | #
|
| | | # 便于统一修改
|
| | | class SingleEquipTmpData():
|
| | | |
| | | ## 初始化
|
| | | # @param |
| | | # @return None
|
| | | def __init__(self):
|
| | | self.starLV = 0 # 强化等级(星数)
|
| | | self.holeCnt = 0
|
| | | self.stoneData = [] # 宝石列表
|
| | | self.isSuite = False
|
| | | self.suiteLV = 0 #套装等级
|
| | | self.isBind = False
|
| | | |
| | | self.source = ShareDefine.Item_Source_Unkown #物品来源
|
| | | self.legendAttrIDList = [] # 传奇属性ID
|
| | | self.legendAttrValueList = [] # 传奇属性值
|
| | | self.legendAttrIDListShen = [] # 传奇属性ID - 神
|
| | | self.legendAttrValueListShen = [] # 传奇属性值 - 神
|
| | | self.legendAttrIDListXian = [] # 传奇属性ID - 仙
|
| | | self.legendAttrValueListXian = [] # 传奇属性值 - 仙
|
| | | self.legendAttrIDListJi = [] # 传奇属性ID - 极
|
| | | self.legendAttrValueListJi = [] # 传奇属性值 - 极
|
| | | return
|
| | |
|
| | | def ClearPack(curPlayer, packType):
|
| | | ## 清空指定背包
|