| | |
| | | # @param itemMark 当前物品
|
| | | # @return 是否是贵重品
|
| | | def IsValuableItem(curItem):
|
| | | |
| | | #装备是否卓越物品
|
| | | #===========================================================================
|
| | | # ValuableItemQualityList = ReadChConfig.GetEvalChConfig("ValuableItemQuality")
|
| | | # if curItem.GetItemQuality() in ValuableItemQualityList:
|
| | | # return True
|
| | | # |
| | | # # 贵重物品配置[[贵重物品id], [贵重物品类型], 贵重物品加强等级, 贵重物品追加等级]
|
| | | # valuablesInfo = ReadChConfig.GetEvalChConfig("ValuablesConfigInfo")
|
| | | # valuablesIDList, valuablesTypeList, valuableMinStar, valuableAddAttrLV = valuablesInfo
|
| | | # |
| | | # #物品ID满足
|
| | | # if curItem.GetItemTypeID() in valuablesIDList:
|
| | | # return True
|
| | | # |
| | | # #物品类型满足 |
| | | # if curItem.GetType() in valuablesTypeList:
|
| | | # return True
|
| | | # |
| | | # #普通装备判定
|
| | | # if ItemCommon.CheckItemIsEquip(curItem):
|
| | | # |
| | | # #套装物品
|
| | | # if curItem.GetIsSuite():
|
| | | # return True
|
| | | # |
| | | # #装备强化星级
|
| | | # if curItem.GetItemStarLV() >= valuableMinStar:
|
| | | # return True
|
| | | #===========================================================================
|
| | |
|
| | | return False
|
| | |
|
| | |
|
| | |
| | |
|
| | | # 计算装备的珍品数量
|
| | | def RefreshStartEquipCount(self):
|
| | | curPlayer = self.__Player
|
| | | count = 0
|
| | | equipPack = self.__PlayerEquip
|
| | | for i in xrange(equipPack.GetCount()):
|
| | | curEquip = equipPack.GetAt(i)
|
| | | |
| | | if curEquip.IsEmpty():
|
| | | continue
|
| | | |
| | | if not curEquip.GetItemQuality():
|
| | | continue
|
| | | |
| | | count += 1
|
| | | |
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_StartEquipCnt, count)
|
| | | # curPlayer = self.__Player
|
| | | # count = 0
|
| | | # equipPack = self.__PlayerEquip
|
| | | # for i in xrange(equipPack.GetCount()):
|
| | | # curEquip = equipPack.GetAt(i)
|
| | | # |
| | | # if curEquip.IsEmpty():
|
| | | # continue
|
| | | # |
| | | # if not curEquip.GetItemQuality():
|
| | | # continue
|
| | | # |
| | | # count += 1
|
| | | # |
| | | # curPlayer.SetDict(ChConfig.Def_PlayerKey_StartEquipCnt, count)
|
| | | return
|
| | |
|
| | | def GetStartEquipCount(self):
|
| | | curPlayer = self.__Player
|
| | | return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_StartEquipCnt)
|
| | | return 0
|
| | | #curPlayer = self.__Player
|
| | | #return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_StartEquipCnt)
|
| | |
|
| | | ## 装备当前物品
|
| | | # @param curItem 当前物品
|
| | |
| | | desItemID, desUserData = [0, ''] if equipItem.IsEmpty() else [equipItem.GetItemTypeID(), equipItem.GetUserData()]
|
| | | srcItemID, srcUserData = curItem.GetItemTypeID(), curItem.GetUserData()
|
| | |
|
| | | befIsOrangeEquip = 1 if (not equipItem.IsEmpty() and equipItem.GetItemColor() >= ChConfig.Def_Quality_Orange) else 0
|
| | | aftIsOrangeEquip = 1 if curItem.GetItemColor() >= ChConfig.Def_Quality_Orange else 0
|
| | | |
| | | #--其他装备物品---
|
| | | #itemColor = curItem.GetItemColor()
|
| | | result = self.SwitchEquip(curItem, equipPackIndex)
|
| | |
| | | PlayerSuccess.DoEquipSuccessLogic(curPlayer)
|
| | | #换装宝石处理
|
| | | Operate_EquipStone.DoMoveEquipStone(curPlayer, equipPackIndex)
|
| | | EventShell.EventRespons_EquipStar(curPlayer)
|
| | | EventShell.EventRespons_EquipItem(curPlayer)
|
| | | dataDict = {'dotype':'EquipItem', 'desItemID':desItemID, 'desUserData':desUserData,'srcItemID':srcItemID,'srcUserData':srcUserData}
|
| | | DataRecordPack.Cache_FightPowerChangeInfo(curPlayer, ChConfig.PowerDownType_EquipChange, dataDict)
|
| | | self.__UpdEquipOrangeCount(befIsOrangeEquip, aftIsOrangeEquip)
|
| | |
|
| | | self.RefreshStartEquipCount()
|
| | | return equipPlace if result else -1
|
| | |
|
| | |
|
| | | def __UpdEquipOrangeCount(self, befIsOrangeEquip, aftIsOrangeEquip):
|
| | | #更新橙装数量
|
| | | curPlayer = self.__Player
|
| | | befEquipOrangeCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PlayerKey_EquipOrangeCount)
|
| | | aftEquipOrangeCount = max(0, befEquipOrangeCount + aftIsOrangeEquip - befIsOrangeEquip)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PlayerKey_EquipOrangeCount, aftEquipOrangeCount)
|
| | | GameWorld.DebugLog("更新橙装及以上件数: befIsOrangeEquip=%s,aftIsOrangeEquip=%s,befEquipOrangeCount=%s,aftEquipOrangeCount=%s" |
| | | % (befIsOrangeEquip, aftIsOrangeEquip, befEquipOrangeCount, aftEquipOrangeCount))
|
| | | return
|
| | | |
| | | ## 替换可以叠加物品逻辑
|
| | | # @param curEquip 当前装备
|
| | | # @param curItem 当前物品
|
| | |
| | | #curEquip.SetIsSoulActive(False)
|
| | | # if curEquip.GetItemStarLV() != 0:
|
| | | # curEquip.SetItemStarLV(0) # 脱下的物品星级设置为0
|
| | | |
| | | |
| | | befIsOrangeEquip = 1 if curEquip.GetItemColor() >= ChConfig.Def_Quality_Orange else 0
|
| | | aftIsOrangeEquip = 0
|
| | | |
| | | #背包物品放入仓库
|
| | | if not DragItem(curPlayer, IPY_GameWorld.rptEquip, equipIndex, IPY_GameWorld.rptItem, packIndex, curEquipCount):
|
| | | return
|
| | | self.RefreshStartEquipCount()
|
| | | self.__UpdEquipOrangeCount(befIsOrangeEquip, aftIsOrangeEquip)
|
| | |
|
| | | # 广播卸装
|
| | | if equipIndex in PlayerControl.GetFaceEquipIndexList(curPlayer) or equipPlace in ChConfig.Def_SyncEquipStateByIndex:
|
| | |
| | | #脱当前外观阶的套装
|
| | | ChEquip.ChangeEquipfacadeByClassLV(curPlayer, itemClassLV)
|
| | |
|
| | | EventShell.EventRespons_EquipStar(curPlayer)
|
| | | EventShell.EventRespons_EquipItem(curPlayer)
|
| | | dataDict = {'dotype':'UnEquipItem', 'equipID':equipID, 'userData':userData}
|
| | | DataRecordPack.Cache_FightPowerChangeInfo(curPlayer, ChConfig.PowerDownType_EquipChange, dataDict)
|
| | | #===============================================================================
|
| | |
| | | PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_FamilyActivity, itemCount)
|
| | | 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)
|
| | | #elif itemID == ChConfig.Def_ItemID_GoldPaper:
|
| | | # 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_SoulCore, itemCount)
|
| | | elif itemID == ChConfig.Def_ItemID_Honor:
|
| | | PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_Honor, itemCount)
|
| | | elif itemID == ChConfig.Def_ItemID_GoldMoney:
|
| | | PlayerControl.GiveMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money, itemCount)
|
| | | elif itemID == ChConfig.Def_ItemID_XianyuanCoin:
|
| | | PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_XianyuanCoin, 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
|
| | |
| | | curItem.AddUserAttr(ShareDefine.Def_IudetLegendAttrValue, legendAttrValueList[i])
|
| | | ItemCommon.MakeEquipGS(curItem)
|
| | | updScore = ItemCommon.GetEquipGearScore(curItem)
|
| | | GameWorld.ErrLog("传奇属性异常,重新刷新一次属性: packType=%s,itemID=%s,legendAttrIDList=%s,legendAttrValueList=%s,srcScore=%s,updScore=%s" |
| | | GameWorld.DebugLog("传奇属性异常,重新刷新一次属性: packType=%s,itemID=%s,legendAttrIDList=%s,legendAttrValueList=%s,srcScore=%s,updScore=%s" |
| | | % (packType, curItem.GetItemTypeID(), legendAttrIDList, legendAttrValueList, srcScore, updScore), curPlayer.GetPlayerID())
|
| | | return
|
| | |
|
| | |
| | | # 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
|
| | |
|
| | |
| | |
|
| | | 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)
|
| | |
| | | itemID = curItem.GetItemTypeID()
|
| | | itemType = curItem.GetType()
|
| | | itemColor = curItem.GetItemColor()
|
| | | itemQuality = curItem.GetItemQuality()
|
| | | isSuit = 1 if curItem.GetSuiteID() else 0
|
| | | # 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))
|
| | |
| | | # % (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:{等级:库编号, ...}}
|
| | |
| | | self.source = ShareDefine.Item_Source_Unkown #物品来源
|
| | | self.legendAttrIDList = [] # 传奇属性ID
|
| | | self.legendAttrValueList = [] # 传奇属性值
|
| | | |
| | | self.OutOfPrintAttrIDList = [] # 绝版属性ID
|
| | | self.OutOfPrintAttrValueList = [] # 绝版属性最大值
|
| | | return
|
| | |
|
| | | def ClearPack(curPlayer, packType):
|