| | |
| | | for i in range(0, curPack.GetCount()):
|
| | | item = curPack.GetAt(i)
|
| | |
|
| | | if not ItemCommon.CheckItemCanUse(item) or GetIsAuctionItem(item):
|
| | | if not ItemCommon.CheckItemCanUse(item):
|
| | | continue
|
| | |
|
| | | if item.GetItemTypeID() == id:
|
| | |
| | | for i in range(0, curPack.GetCount()):
|
| | | item = curPack.GetAt(i)
|
| | |
|
| | | if not ItemCommon.CheckItemCanUse(item) or GetIsAuctionItem(item):
|
| | | if not ItemCommon.CheckItemCanUse(item):
|
| | | continue
|
| | |
|
| | | if item.GetItemTypeID() == id:
|
| | |
| | | for i in range(0, curPack.GetCount()):
|
| | | item = curPack.GetAt(i)
|
| | |
|
| | | if not ItemCommon.CheckItemCanUse(item) or GetIsAuctionItem(item):
|
| | | if not ItemCommon.CheckItemCanUse(item):
|
| | | continue
|
| | |
|
| | | effect = item.GetEffectByIndex(0)
|
| | |
| | | for i in range(0, curPack.GetCount()):
|
| | |
|
| | | item = curPack.GetAt(i)
|
| | | if not ItemCommon.CheckItemCanUse(item) or GetIsAuctionItem(item):
|
| | | if not ItemCommon.CheckItemCanUse(item):
|
| | | continue
|
| | |
|
| | | if item.GetItemTypeID() != id:
|
| | |
| | | return False
|
| | | return True
|
| | |
|
| | | def DoTransformItem(self, curPlayer, tagItem):
|
| | | def DoTransformItem(self, curPlayer, tagItem, event=["", False, {}]):
|
| | | ## 将特殊物品转化为对应数值
|
| | | itemID = tagItem.GetItemTypeID()
|
| | | if itemID not in ChConfig.Def_TransformItemIDList:
|
| | | return False
|
| | | itemCount = max(tagItem.GetUserAttr(ShareDefine.Def_IudetItemCount), tagItem.GetCount())
|
| | | eventName, isForceEvent, addDict = event
|
| | | if isForceEvent:
|
| | | pass
|
| | |
|
| | | if itemID == ChConfig.Def_ItemID_FamilyContribution:
|
| | | PlayerFamily.AddPlayerFamilyActiveValue(curPlayer, itemCount, True, ShareDefine.Def_AddFAVReason_UseItem, True)
|
| | |
| | | elif itemID == ChConfig.Def_ItemID_SP:
|
| | | PlayerControl.PlayerAddZhenQi(curPlayer, itemCount)
|
| | | elif itemID == ChConfig.Def_ItemID_GoldPaper:
|
| | | PlayerControl.GiveMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Paper, itemCount)
|
| | | PlayerControl.GiveMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Paper, itemCount, eventName, addDict)
|
| | | elif itemID == ChConfig.Def_ItemID_RealmPoint:
|
| | | PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_RealmPoint, itemCount)
|
| | | elif itemID == ChConfig.Def_ItemID_BossReborn:
|
| | |
| | | PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_Honor, itemCount)
|
| | | elif itemID == ChConfig.Def_ItemID_GoldMoney:
|
| | | PlayerControl.GiveMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money, itemCount)
|
| | |
|
| | | return True
|
| | |
|
| | | def __CrossServerPutInItem(self, packIndex, tagItem, event=["", False, {}]):
|
| | | ## 跨服获得物品
|
| | | if packIndex not in [IPY_GameWorld.rptItem, ShareDefine.rptDogzItem, ShareDefine.rptZhuXianItem]:
|
| | | if packIndex not in [IPY_GameWorld.rptItem, ShareDefine.rptDogzItem]:
|
| | | #GameWorld.DebugLog("跨服获得物品不同步, packIndex=%s" % (packIndex))
|
| | | return
|
| | | curPlayer = self.__Player
|
| | |
| | | if itemID in ChConfig.Def_TransformItemIDList:
|
| | | # 直接转化为对应货币的物品仅在放入背包时直接转化,否则还是以真实物品的形式存在,但堆叠上限需要做特殊处理
|
| | | if packIndex == IPY_GameWorld.rptItem:
|
| | | self.DoTransformItem(curPlayer, tagItem)
|
| | | self.DoTransformItem(curPlayer, tagItem, event)
|
| | | tagItem.Clear() # 需清除,不然会导致内存泄露
|
| | | return True
|
| | | defaultPile = True
|
| | |
| | |
|
| | | curPlayer = self.__Player
|
| | | srcScore = ItemCommon.GetEquipGearScore(curItem)
|
| | | legendAttrIDList, legendAttrValueList = legendAttrInfo
|
| | | curItem.ClearUserAttr(ShareDefine.Def_IudetLegendAttrID)
|
| | | curItem.ClearUserAttr(ShareDefine.Def_IudetLegendAttrValue)
|
| | | for i in xrange(len(legendAttrIDList)):
|
| | | curItem.AddUserAttr(ShareDefine.Def_IudetLegendAttrID, legendAttrIDList[i])
|
| | | curItem.AddUserAttr(ShareDefine.Def_IudetLegendAttrValue, legendAttrValueList[i])
|
| | | SetEquipLegendAttr(curItem, legendAttrInfo)
|
| | | ItemCommon.MakeEquipGS(curItem)
|
| | | updScore = ItemCommon.GetEquipGearScore(curItem)
|
| | | GameWorld.ErrLog("传奇属性异常,重新刷新一次属性: packType=%s,itemID=%s,legendAttrIDList=%s,legendAttrValueList=%s,srcScore=%s,updScore=%s" |
| | | % (packType, curItem.GetItemTypeID(), legendAttrIDList, legendAttrValueList, srcScore, updScore), curPlayer.GetPlayerID())
|
| | | GameWorld.DebugLog("传奇属性异常,重新刷新一次属性: packType=%s,itemID=%s,srcScore=%s,updScore=%s" |
| | | % (packType, curItem.GetItemTypeID(), srcScore, updScore), curPlayer.GetPlayerID())
|
| | | return
|
| | |
|
| | | def CheckRolePackEquipAttr(self):
|
| | |
| | | # return
|
| | | # playerID = curPlayer.GetPlayerID()
|
| | | # GameWorld.Log("玩家上线处理装备属性! curVersion=%s,checkVersion=%s" % (curVersion, checkVersion), playerID)
|
| | | # |
| | | # outOfPrintAttrItemDict = {} # 有绝版属性的定制物品属性信息 {itemID:[绝版属性ID列表, 绝版属性数值列表], ...}
|
| | | # ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | # for i in xrange(ipyDataMgr.GetAppointItemCount()):
|
| | | # ipyData = ipyDataMgr.GetAppointItemByIndex(i)
|
| | | # outOfPrintAttrList = ipyData.GetOutOfPrintAttr()
|
| | | # outOfPrintAttrValueList = ipyData.GetOutOfPrintAttrValue()
|
| | | # if not outOfPrintAttrList or len(outOfPrintAttrList) != len(outOfPrintAttrValueList):
|
| | | # continue
|
| | | # itemID = GetAppointItemRealID(ipyData.GetID())
|
| | | # if not itemID:
|
| | | # continue
|
| | | # outOfPrintAttrItemDict[itemID] = [outOfPrintAttrList, outOfPrintAttrValueList]
|
| | | # |
| | | # checkPackList = [IPY_GameWorld.rptEquip, IPY_GameWorld.rptItem, IPY_GameWorld.rptWarehouse]
|
| | | # for packType in checkPackList:
|
| | | # curPack = curPlayer.GetItemManager().GetPack(packType)
|
| | | # for i in xrange(curPack.GetCount()):
|
| | | # curItem = curPack.GetAt(i)
|
| | | # #GameWorld.DebugLog("packType=%s,i=%s" % (packType, i))
|
| | | # if curItem.IsEmpty():
|
| | | # continue
|
| | | # isEquip = ItemCommon.CheckItemIsEquip(curItem)
|
| | | # if not isEquip:
|
| | | # continue
|
| | | # itemID = curItem.GetItemTypeID()
|
| | | # self.CheckEquipAttr(packType, curItem)
|
| | | # |
| | | # # 重刷绝版属性
|
| | | # if itemID in outOfPrintAttrItemDict:
|
| | | # outOfPrintAttrList, outOfPrintAttrValueList = outOfPrintAttrItemDict[itemID]
|
| | | # curItem.ClearUserAttr(ShareDefine.Def_IudetOutOfPrintAttrID)
|
| | | # curItem.ClearUserAttr(ShareDefine.Def_IudetOutOfPrintAttrValue)
|
| | | # for outOfPrintAttrIndex in xrange(len(outOfPrintAttrList)):
|
| | | # curItem.AddUserAttr(ShareDefine.Def_IudetOutOfPrintAttrID, outOfPrintAttrList[outOfPrintAttrIndex])
|
| | | # curItem.AddUserAttr(ShareDefine.Def_IudetOutOfPrintAttrValue, outOfPrintAttrValueList[outOfPrintAttrIndex])
|
| | | # GameWorld.Log(" 玩家登录重刷装备绝版属性: packType=%s,i=%s,itemID=%s,outOfPrintAttrList=%s,outOfPrintAttrValueList=%s" |
| | | # % (packType, i, itemID, outOfPrintAttrList, outOfPrintAttrValueList), playerID)
|
| | | # |
| | | # PlayerControl.NomalDictSetProperty(curPlayer, key, checkVersion)
|
| | | return
|
| | |
|
| | |
| | | if curPack == None:
|
| | | #GameWorld.Log("重整背包类型不对")
|
| | | return
|
| | | |
| | | if endIndex == 0:
|
| | | endIndex = curPack.GetCount() - 1
|
| | | #检查是否能整理
|
| | | for i in range(0, curPack.GetCount()):
|
| | | curItem = curPack.GetAt(i)
|
| | |
| | | #需要比较评分的装备
|
| | | equipGS = ItemCommon.GetEquipGearScore(tmpItem)
|
| | | #查找当前装备比较GS
|
| | | cmpItem = equipPack.GetAt(tmpItem.GetEquipPlace())
|
| | | cmpItem = equipPack.GetAt(ItemCommon.GetEquipPackIndex(tmpItem))
|
| | | if ItemCommon.CheckNoteEquipGS(cmpItem):
|
| | | cmpEquipGS = ItemCommon.GetEquipGearScore(cmpItem)
|
| | | elif ItemCommon.CheckNoteEquipGS(tmpItem):
|
| | |
| | |
|
| | | itemDictData['legendAttrID'] = ipyData.GetLegendAttrID()
|
| | | itemDictData['legendAttrValue'] = ipyData.GetLegendAttrValue()
|
| | | #itemDictData['SuiteLV'] = ipyData.GetSuiteLV()
|
| | | itemDictData['ItemID'] = itemID
|
| | | itemDictData['CancelUseLimit'] = ipyData.GetCancelUseLimit()
|
| | |
|
| | | itemDictData['IsAuctionItem'] = isAuctionItem
|
| | |
|
| | | #装备绝版属性,随等级变化
|
| | | itemDictData['OutOfPrintAttrID'] = ipyData.GetOutOfPrintAttr()
|
| | | itemDictData['OutOfPrintAttrValue'] = ipyData.GetOutOfPrintAttrValue()
|
| | | return itemDictData
|
| | |
|
| | | def GetAppointItemRealID(itemID):
|
| | |
| | |
|
| | | tmpEquipData.legendAttrIDList = itemData.get('legendAttrID', [])
|
| | | tmpEquipData.legendAttrValueList = itemData.get('legendAttrValue', [])
|
| | | |
| | | tmpEquipData.OutOfPrintAttrIDList = itemData.get('OutOfPrintAttrID', []) # 绝版属性ID
|
| | | tmpEquipData.OutOfPrintAttrValueList = itemData.get('OutOfPrintAttrValue', []) # 绝版属性最大值
|
| | |
|
| | | # 装备附加属性
|
| | | ChItem.EquipAddAdditionEx(equipItem, tmpEquipData)
|
| | |
| | | return
|
| | |
|
| | | if ItemCommon.GetIsEquip(curItem):
|
| | | # 生成传奇属性
|
| | | legendAttrInfo = GetAddEquipLegendAttr(curItem, curPlayer)
|
| | | if not legendAttrInfo:
|
| | | return
|
| | | attrIDList, attrValueList = legendAttrInfo
|
| | | updateDict = {ShareDefine.Def_IudetLegendAttrID:attrIDList, ShareDefine.Def_IudetLegendAttrValue:attrValueList}
|
| | | 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)
|
| | |
|
| | |
| | | ''' 获取功能产出的物品实例
|
| | | @param isAuctionItem: 是否拍品,默认非拍品
|
| | | @param expireTime: 有效时间,时间单位由时效类型决定
|
| | | @param curPlayer: 产出该物品时的玩家,非拍品时需传入该值,物品某些属性由玩家等级决定,如传奇属性
|
| | | @param curPlayer: 产出该物品时的玩家,物品某些属性由玩家等级决定,如传奇属性
|
| | | @param isAllAttr: 是否生成该装备所有属性,GM创建物品时用,需验证相关权限
|
| | | '''
|
| | | curItem = ItemCommon.CreateSingleItem(itemID, itemCount, isAuctionItem, expireTime)
|
| | |
| | | #GameWorld.DebugLog("清除给定制物品之前已经创建的物品ID=%s" % itemID)
|
| | | return GetItemByData(GetAppointItemDictData(itemID, isAuctionItem))
|
| | |
|
| | | # 拍品不处理其他属性
|
| | | if isAuctionItem:
|
| | | return curItem
|
| | | # # 拍品不处理其他属性
|
| | | # if isAuctionItem:
|
| | | # return curItem
|
| | |
|
| | | tmpEquipData = SingleEquipTmpData()
|
| | |
|
| | |
| | | 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)
|
| | |
| | |
|
| | | def GetAddEquipLegendAttr(curItem, curPlayer, isAllAttr=False):
|
| | | '''获取生成到装备上的传奇属性
|
| | | @return: None 或者 [[传奇属性效果ID列表], [属性值列表]]
|
| | | @return: None 或者 [传奇属性效果ID列表], [属性值列表], [神ID], [神值], [仙ID], [仙值], [极ID], [极值]
|
| | | '''
|
| | | if GetIsAuctionItem(curItem):
|
| | | #GameWorld.DebugLog("拍品无法生成传奇属性!")
|
| | | return
|
| | | # 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)
|
| | | attrCountIpyData = IpyGameDataPY.GetIpyGameDataNotLog("EquipLegendAttrCount", itemType, itemColor, isSuit, itemQuality)
|
| | | if not attrCountIpyData:
|
| | | if itemColor >= ChConfig.Def_Quality_Purple:
|
| | | GameWorld.DebugLog("该装备没有传奇属性: itemID=%s" % (itemID))
|
| | |
| | | if not legendAttrCountInfoList:
|
| | | return
|
| | |
|
| | | if not curPlayer:
|
| | | GameWorld.ErrLog("生成装备传奇属性时玩家不存在!itemID=%s" % (itemID))
|
| | | return
|
| | | |
| | | playerID, playerLV = curPlayer.GetPlayerID(), curPlayer.GetLV()
|
| | | 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:
|
| | |
| | | # % (attrCount, libNumList, attrIDList, curLegAttrIDList), playerID)
|
| | |
|
| | | # 3. 定数值
|
| | | attrValueIpyData = IpyGameDataPY.GetIpyGameData("EquipLegendAttrValue", itemType, itemClassLV, itemColor, isSuit)
|
| | | attrValueIpyData = IpyGameDataPY.GetIpyGameData("EquipLegendAttrValue", itemType, itemClassLV, itemColor, isSuit, itemQuality)
|
| | | if not attrValueIpyData:
|
| | | GameWorld.ErrLog("传奇属性等级数值表找不到配置!itemID=%s,itemType=%s,itemClassLV=%s,itemColor=%s,isSuit=%s" |
| | | % (itemID, itemType, itemClassLV, itemColor, isSuit), playerID)
|
| | | 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:{等级:库编号, ...}}
|
| | |
| | | curLegAttrValueList.append(attrValue)
|
| | | #GameWorld.DebugLog(" 随机属性: attrID=%s,attrValue=%s,playerLV=%s,curLibNum=%s,valueList=%s"
|
| | | # % (attrID, attrValue, playerLV, curLibNum, valueList), playerID)
|
| | | return [curLegAttrIDList, curLegAttrValueList]
|
| | | return curLegAttrIDList, curLegAttrValueList, [], [], [], [], [], []
|
| | |
|
| | | def GetEquipLegendAttrAll(curItem):
|
| | | ## 获取装备传奇属性 - 所有分组合并返回
|
| | | legendAttrInfo = GetEquipLegendAttrGroup(curItem)
|
| | | legAttrIDList = legendAttrInfo[0] + legendAttrInfo[2] + legendAttrInfo[4] + legendAttrInfo[6]
|
| | | legAttrValueList = legendAttrInfo[1] + legendAttrInfo[3] + legendAttrInfo[5] + legendAttrInfo[7]
|
| | | return legAttrIDList, legAttrValueList
|
| | |
|
| | | def GetEquipLegendAttrGroup(curItem):
|
| | | ## 获取装备传奇属性 - 按类型分组返回
|
| | | |
| | | legAttrIDList, legAttrValueList = [], []
|
| | | legendAttrIDCnt = curItem.GetUserAttrCount(ShareDefine.Def_IudetLegendAttrID)
|
| | | legendAttrValueCnt = curItem.GetUserAttrCount(ShareDefine.Def_IudetLegendAttrValue)
|
| | | if legendAttrIDCnt == legendAttrValueCnt:
|
| | | for i in xrange(legendAttrIDCnt):
|
| | | legAttrIDList.append(curItem.GetUserAttrByIndex(ShareDefine.Def_IudetLegendAttrID, i))
|
| | | legAttrValueList.append(curItem.GetUserAttrByIndex(ShareDefine.Def_IudetLegendAttrValue, i))
|
| | | |
| | | shenAttrIDList, shenAttrValueList = [], []
|
| | | shenAttrIDCnt = curItem.GetUserAttrCount(ShareDefine.Def_IudetLegendAttrIDShen)
|
| | | shenAttrValueCnt = curItem.GetUserAttrCount(ShareDefine.Def_IudetLegendAttrValueShen)
|
| | | if shenAttrIDCnt == shenAttrValueCnt:
|
| | | for i in xrange(shenAttrIDCnt):
|
| | | shenAttrIDList.append(curItem.GetUserAttrByIndex(ShareDefine.Def_IudetLegendAttrIDShen, i))
|
| | | shenAttrValueList.append(curItem.GetUserAttrByIndex(ShareDefine.Def_IudetLegendAttrValueShen, i))
|
| | | |
| | | xianAttrIDList, xianAttrValueList = [], []
|
| | | xianAttrIDCnt = curItem.GetUserAttrCount(ShareDefine.Def_IudetLegendAttrIDXian)
|
| | | xianAttrValueCnt = curItem.GetUserAttrCount(ShareDefine.Def_IudetLegendAttrValueXian)
|
| | | if xianAttrIDCnt == xianAttrValueCnt:
|
| | | for i in xrange(xianAttrIDCnt):
|
| | | xianAttrIDList.append(curItem.GetUserAttrByIndex(ShareDefine.Def_IudetLegendAttrIDXian, i))
|
| | | xianAttrValueList.append(curItem.GetUserAttrByIndex(ShareDefine.Def_IudetLegendAttrValueXian, i))
|
| | | |
| | | jiAttrIDList, jiAttrValueList = [], []
|
| | | jiAttrIDCnt = curItem.GetUserAttrCount(ShareDefine.Def_IudetLegendAttrIDJi)
|
| | | jiAttrValueCnt = curItem.GetUserAttrCount(ShareDefine.Def_IudetLegendAttrValueJi)
|
| | | if jiAttrIDCnt == jiAttrValueCnt:
|
| | | for i in xrange(jiAttrIDCnt):
|
| | | jiAttrIDList.append(curItem.GetUserAttrByIndex(ShareDefine.Def_IudetLegendAttrIDJi, i))
|
| | | 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
|
| | |
|
| | | ##创建物品所需的动态数据
|
| | | #
|
| | |
| | | self.source = ShareDefine.Item_Source_Unkown #物品来源
|
| | | self.legendAttrIDList = [] # 传奇属性ID
|
| | | self.legendAttrValueList = [] # 传奇属性值
|
| | | |
| | | self.OutOfPrintAttrIDList = [] # 绝版属性ID
|
| | | self.OutOfPrintAttrValueList = [] # 绝版属性最大值
|
| | | self.legendAttrIDListShen = [] # 传奇属性ID - 神
|
| | | self.legendAttrValueListShen = [] # 传奇属性值 - 神
|
| | | self.legendAttrIDListXian = [] # 传奇属性ID - 仙
|
| | | self.legendAttrValueListXian = [] # 传奇属性值 - 仙
|
| | | self.legendAttrIDListJi = [] # 传奇属性ID - 极
|
| | | self.legendAttrValueListJi = [] # 传奇属性值 - 极
|
| | | return
|
| | |
|
| | | def ClearPack(curPlayer, packType):
|