| | |
| | |
|
| | | def CalcEquipGS(curItem):
|
| | | '''计算装备评分
|
| | | 评分组成:装备基础 + 传奇属性 + 绝版属性
|
| | | 评分组成:装备基础 + 传奇属性
|
| | | '''
|
| | | if not CheckNoteEquipGS(curItem):
|
| | | #GameWorld.DebugLog("不设置装备评分")
|
| | |
| | | break
|
| | | attrDict[effectID] = attrDict.get(effectID, 0) + curEffect.GetEffectValue(0)
|
| | |
|
| | | skillGS = 0
|
| | | gsValueEx = 0
|
| | | skillGSDict = IpyGameDataPY.GetFuncCfg("EquipGSFormula", 4)
|
| | | for i in xrange(curItem.GetAddSkillCount()):
|
| | | addSkillID = curItem.GetAddSkill(i)
|
| | | if not addSkillID:
|
| | | break
|
| | | skillGS += skillGSDict.get(str(addSkillID), 0)
|
| | | gsValueEx += skillGSDict.get(str(addSkillID), 0)
|
| | |
|
| | | itemID = curItem.GetItemTypeID()
|
| | | classLV = GetItemClassLV(curItem)
|
| | | color = curItem.GetItemColor()
|
| | | isSuit = 1 if curItem.GetSuiteID() > 0 else 0
|
| | | gsParamIpyData = IpyGameDataPY.GetIpyGameData("EquipGSParam", classLV, color, isSuit)
|
| | | gsParamIpyData = IpyGameDataPY.GetIpyGameDataNotLog("EquipGSParam", classLV, color, isSuit)
|
| | | # 传奇属性
|
| | | legendAttrIDCnt = curItem.GetUserAttrCount(ShareDefine.Def_IudetLegendAttrID)
|
| | | legendAttrValueCnt = curItem.GetUserAttrCount(ShareDefine.Def_IudetLegendAttrValue)
|
| | |
| | | attrValue = curItem.GetUserAttrByIndex(ShareDefine.Def_IudetLegendAttrValue, i)
|
| | | attrDict[attrID] = attrDict.get(attrID, 0) + attrValue
|
| | |
|
| | | lingQiIpyData = IpyGameDataPY.GetIpyGameDataNotLog("LingQiAttr", itemID)
|
| | | if lingQiIpyData:
|
| | | gsValueEx += lingQiIpyData.GetLingQiAttrScore()
|
| | | |
| | | Atk = attrDict.get(ShareDefine.Def_Effect_Atk, 0)
|
| | | MinAtk = attrDict.get(ShareDefine.Def_Effect_MinAtk, 0) + Atk
|
| | | MaxAtk = attrDict.get(ShareDefine.Def_Effect_MaxAtk, 0) + Atk
|
| | |
| | | ArmorDefPer = 0
|
| | | IceAtk = attrDict.get(ShareDefine.Def_Effect_IceAtk, 0)
|
| | | IceDef = attrDict.get(ShareDefine.Def_Effect_IceDef, 0)
|
| | | FabaoHurt = attrDict.get(ShareDefine.Def_Effect_FabaoHurt, 0)
|
| | |
|
| | | BaseEquipMaxHPAddPer = attrDict.get(ShareDefine.Def_Effect_BaseEquipMaxHPAddPer, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetBaseEquipMaxHPAddPerC())
|
| | | BaseEquipAtkAddPer = attrDict.get(ShareDefine.Def_Effect_BaseEquipAtkAddPer, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetBaseEquipAtkAddPerC())
|
| | |
| | | SkillAtkRateReduce = 0#attrDict.get(ShareDefine.Def_Effect_SkillAtkRateReduce, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetSkillAtkRateReduceC())
|
| | | Hit = attrDict.get(ShareDefine.Def_Effect_Hit, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetHitC())
|
| | | Miss = attrDict.get(ShareDefine.Def_Effect_Miss, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetMissC())
|
| | | SkillAddPerA = 0#attrDict.get(ShareDefine.Def_Effect_SkillAddPer1, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetSkillAddPer1C())
|
| | | SkillAddPerB = 0#attrDict.get(ShareDefine.Def_Effect_SkillAddPer2, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetSkillAddPer2C())
|
| | | SkillAddPerC = 0#attrDict.get(ShareDefine.Def_Effect_SkillAddPer3, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetSkillAddPer3C())
|
| | | SkillAddPerD = 0#attrDict.get(ShareDefine.Def_Effect_SkillAddPer4, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetSkillAddPer4C())
|
| | | SkillAddPerE = 0#attrDict.get(ShareDefine.Def_Effect_SkillAddPer5, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetSkillAddPer5C())
|
| | | SkillAddPerF = 0#attrDict.get(ShareDefine.Def_Effect_SkillAddPer6, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetSkillAddPer6C())
|
| | | SkillAddPerG = 0#attrDict.get(ShareDefine.Def_Effect_SkillAddPer7, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetSkillAddPer7C())
|
| | | SkillReducePerA = 0#attrDict.get(ShareDefine.Def_Effect_SkillReducePer1, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetSkillReducePer1C())
|
| | | SkillReducePerB = 0#attrDict.get(ShareDefine.Def_Effect_SkillReducePer2, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetSkillReducePer2C())
|
| | | SkillReducePerC = 0#attrDict.get(ShareDefine.Def_Effect_SkillReducePer3, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetSkillReducePer3C())
|
| | | SkillReducePerD = 0#attrDict.get(ShareDefine.Def_Effect_SkillReducePer4, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetSkillReducePer4C())
|
| | | SkillReducePerE = 0#attrDict.get(ShareDefine.Def_Effect_SkillReducePer5, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetSkillReducePer5C())
|
| | | SkillReducePerF = 0#attrDict.get(ShareDefine.Def_Effect_SkillReducePer6, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetSkillReducePer6C())
|
| | | SkillReducePerG = 0#attrDict.get(ShareDefine.Def_Effect_SkillReducePer7, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetSkillReducePer7C())
|
| | | SkillAddPerA = 0
|
| | | SkillAddPerB = 0
|
| | | SkillAddPerC = 0
|
| | | SkillAddPerD = 0
|
| | | SkillAddPerE = 0
|
| | | SkillAddPerF = 0
|
| | | SkillAddPerG = 0
|
| | | SkillReducePerA = 0
|
| | | SkillReducePerB = 0
|
| | | SkillReducePerC = 0
|
| | | SkillReducePerD = 0
|
| | | SkillReducePerE = 0
|
| | | SkillReducePerF = 0
|
| | | SkillReducePerG = 0
|
| | |
|
| | | # 攻速不默认乘,仅作为参数提供策划使用
|
| | | AtkSpeed = 0#attrDict.get(ShareDefine.Def_Effect_AtkSpeed, 0)
|
| | | AtkSpeedC = 1#1 if not gsParamIpyData else gsParamIpyData.GetAtkSpeedC()
|
| | | |
| | | # 绝版
|
| | | outOfPrintAttrIDCnt = curItem.GetUserAttrCount(ShareDefine.Def_IudetOutOfPrintAttrID)
|
| | | outOfPrintAttrValueCnt = curItem.GetUserAttrCount(ShareDefine.Def_IudetOutOfPrintAttrValue)
|
| | | if outOfPrintAttrIDCnt and outOfPrintAttrIDCnt == outOfPrintAttrValueCnt:
|
| | | for i in xrange(legendAttrIDCnt):
|
| | | attrID = curItem.GetUserAttrByIndex(ShareDefine.Def_IudetOutOfPrintAttrID, i)
|
| | | attrValue = curItem.GetUserAttrByIndex(ShareDefine.Def_IudetOutOfPrintAttrValue, i)
|
| | | attrDict[attrID] = attrDict.get(attrID, 0) + attrValue
|
| | |
|
| | | OnlyFinalHurt = attrDict.get(ShareDefine.Def_Effect_OnlyFinalHurt, 0)
|
| | | PVPAtkBackHP = attrDict.get(ShareDefine.Def_Effect_PVPAtkBackHP, 0)
|
| | |
| | | value = eval(FormulaControl.GetCompileFormula("EquipGSFormula3", IpyGameDataPY.GetFuncCfg("EquipGSFormula", 3)))
|
| | | else:
|
| | | value = eval(FormulaControl.GetCompileFormula("EquipGSFormula", IpyGameDataPY.GetFuncCfg("EquipGSFormula")))
|
| | | value += skillGS
|
| | | value += gsValueEx
|
| | | return value
|
| | |
|
| | | def GetZhuXianEquipTotalGS(curPlayer):
|
| | | ##诛仙装备总评分
|
| | | equipScoreTotal = 0
|
| | | zhuXianEquipPack = curPlayer.GetItemManager().GetPack(ShareDefine.rptZhuXianEquip)
|
| | | for equipIndex in xrange(zhuXianEquipPack.GetCount()):
|
| | | curEquip = zhuXianEquipPack.GetAt(equipIndex) |
| | | if curEquip.IsEmpty():
|
| | | continue
|
| | | equipScoreTotal += GetEquipGearScore(curEquip)
|
| | | return equipScoreTotal
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | ## 通过效果ID,检查是否为指定物品
|
| | |
| | | def NotifyItemDropByKill(curPlayer, curItem, npcID, notifyMark='', mapID=0):
|
| | | return #吕超说此处屏蔽
|
| | |
|
| | | def GetNotifySuperItemInfo(curPlayer, curEquip, place=None):
|
| | | '''装备提示超链接信息汇总
|
| | | <a><Word info=item id=%s0/>|showitem=%s0 itemPlus=%s0</a>
|
| | | {"ItemID":物品ID, "UserData":..., "Star":星级, "EvolveLV":进化等级,"PlusLV":强化等级,"Stone":[宝石ID,...], "Wash":{"LV":洗练等级,"Value":[洗练值, ...]}, "Equips":[itemID, itemID, ...]}
|
| | | def CacheNotifyEquipDetailInfo(curPlayer, curEquip):
|
| | | ''' 缓存装备广播信息中的装备明细信息
|
| | | 因为本版本需要的查看的内容相对较多,为了减少全服广播流量消耗,所以先进行缓存,玩家点击查看时再进行查询
|
| | | '''
|
| | |
|
| | | guid = curEquip.GetGUID()
|
| | | packType = curEquip.GetItemPlaceType()
|
| | | packIndex = curEquip.GetItemPlaceIndex()
|
| | | if packType != IPY_GameWorld.rptEquip:
|
| | | return "{}"
|
| | | return guid
|
| | |
|
| | | classLV = GetItemClassLV(curEquip)
|
| | | if not classLV:
|
| | | return "{}"
|
| | | return guid
|
| | |
|
| | | packType = IPY_GameWorld.rptEquip
|
| | | itemDict = {}
|
| | | itemDict["ItemID"] = curEquip.GetItemTypeID()
|
| | | userData = curEquip.GetUserData()
|
| | | if userData and userData != "{}":
|
| | | itemDict["UserData"] = userData
|
| | | |
| | | #部位升星数据
|
| | | itemID = curEquip.GetItemTypeID()
|
| | | #部位星级
|
| | | equipStar = ChEquip.GetEquipPartStarByRank(curPlayer, packIndex, curEquip)
|
| | | if equipStar:
|
| | | itemDict["Star"] = equipStar
|
| | | |
| | | |
| | | #部位强化数据
|
| | | equipPartPlusLV = ChEquip.GetEquipPartPlusLVByRank(curPlayer, packType, packIndex, curEquip)
|
| | | equipPartPlusEvolveLV = ChEquip.GetEquipPartPlusEvolveLVByEquip(curPlayer, packType, packIndex, curEquip)
|
| | | if equipPartPlusLV:
|
| | | itemDict["PlusLV"] = equipPartPlusLV
|
| | | if equipPartPlusEvolveLV:
|
| | | itemDict["EvolveLV"] = equipPartPlusEvolveLV
|
| | | plusLV = ChEquip.GetEquipPartPlusLVByRank(curPlayer, packType, packIndex, curEquip)
|
| | | plusEvolveLV = ChEquip.GetEquipPartPlusEvolveLVByEquip(curPlayer, packType, packIndex, curEquip)
|
| | | |
| | | #部位洗练数据
|
| | | washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % packIndex)
|
| | | washValueList = []
|
| | | for attrNum in xrange(1, Operate_EquipWash.Def_EquipWashMaxAttrCount + 1):
|
| | | value = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashValue % (packIndex, attrNum))
|
| | | washValueList.append(value)
|
| | |
|
| | | #部位宝石数据
|
| | | stoneIDList = Operate_EquipStone.GetEquipIndexStoneIDList(curPlayer, packIndex)
|
| | | if stoneIDList and stoneIDList.count(0) != len(stoneIDList):
|
| | | itemDict["Stone"] = stoneIDList
|
| | | |
| | | #部位洗练数据
|
| | | washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % packIndex) + 1
|
| | | valueList = []
|
| | | for attrNum in xrange(1, Operate_EquipWash.Def_EquipWashMaxAttrCount + 1):
|
| | | value = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashValue % (packIndex, attrNum))
|
| | | valueList.append(value)
|
| | | if valueList and valueList.count(0) != len(valueList):
|
| | | itemDict["Wash"] = {"LV":washLV, "Value":valueList}
|
| | | |
| | | classItems = [] # 本阶已穿装备ID
|
| | | |
| | | #本阶已穿装备ID [[itemID,star], ...]
|
| | | classItems = [] |
| | | ipyDataList = IpyGameDataPY.GetIpyGameDataByCondition('EquipPlaceIndexMap', {'ClassLV':classLV}, True)
|
| | | if ipyDataList:
|
| | | equipPack = curPlayer.GetItemManager().GetPack(packType)
|
| | |
| | | if not classEquip or classEquip.IsEmpty():
|
| | | continue
|
| | | equipID = classEquip.GetItemTypeID()
|
| | | equipStar = ChEquip.GetEquipPartStarByRank(curPlayer, index, classEquip)
|
| | | classItems.append([equipID, equipStar])
|
| | | if classItems:
|
| | | itemDict["Equips"] = classItems
|
| | | |
| | | return json.dumps(itemDict, ensure_ascii=False).replace(" ", "")
|
| | |
|
| | | star = ChEquip.GetEquipPartStarByRank(curPlayer, index, classEquip)
|
| | | classItems.append([equipID, star])
|
| | | |
| | | cacheInfo = [guid, itemID, equipStar, plusLV, plusEvolveLV, washLV, washValueList, stoneIDList, classItems]
|
| | | cacheInfo = json.dumps(cacheInfo, ensure_ascii=False)
|
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, "NotifyEquipDetailInfo", cacheInfo, len(cacheInfo))
|
| | | return guid
|
| | |
|
| | | ## 使用物品的特殊提示
|
| | | # @param curPlayer 当前玩家
|
| | |
| | | # @remarks 函数详细说明.
|
| | | def SwitchItem(curPlayer, curItem, switchItem, putInPackIndex):
|
| | | ##物品绑定字段判定 -> 装备绑定
|
| | | if putInPackIndex in [IPY_GameWorld.rptEquip, ShareDefine.rptZhuXianEquip]:
|
| | | if putInPackIndex in [IPY_GameWorld.rptEquip]:
|
| | | DoLogic_ItemBindType(curPlayer, switchItem, ChConfig.Def_BindType_DoEquipBind)
|
| | |
|
| | | # 装备技能书、坐骑装备绑定
|
| | | if putInPackIndex in [IPY_GameWorld.rptHorseEquip, ShareDefine.rptZhuXianEquip]:
|
| | | if putInPackIndex in [IPY_GameWorld.rptHorseEquip]:
|
| | | DoLogic_ItemBindType(curPlayer, curItem, ChConfig.Def_BindType_DoEquipBind)
|
| | |
|
| | | #交换装备
|
| | |
| | | return
|
| | |
|
| | | ##物品绑定字段判定 -> 装备绑定
|
| | | if putInPackIndex in [IPY_GameWorld.rptEquip, ShareDefine.rptZhuXianEquip]:
|
| | | if putInPackIndex in [IPY_GameWorld.rptEquip]:
|
| | | DoLogic_ItemBindType(curPlayer, switchItem, ChConfig.Def_BindType_DoEquipBind)
|
| | |
|
| | | # 装备技能书、坐骑装备绑定
|
| | | if putInPackIndex in [IPY_GameWorld.rptHorseEquip, ShareDefine.rptZhuXianEquip]:
|
| | | if putInPackIndex in [IPY_GameWorld.rptHorseEquip]:
|
| | | DoLogic_ItemBindType(curPlayer, emptyItem, ChConfig.Def_BindType_DoEquipBind)
|
| | |
|
| | | if switchItem.GetGameWorldItemType() == IPY_GameWorld.gwitRoleItem:
|
| | |
| | | def GetIsDogzEquip(curItem):
|
| | | ## 返回是否神兽装备
|
| | | return curItem.GetType() in ChConfig.Def_DogzEquiipType
|
| | |
|
| | | def GetIsZhuXianEquip(curItem):
|
| | | ## 返回是否诛仙装备
|
| | | return curItem.GetType() in ChConfig.Def_ZhuXianEquiipType
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | ##遍历数据库查找合适的物品, 通过 效果ID + 效果A值确定物品
|
| | |
| | | return itemDict
|
| | |
|
| | | def GetWeightItemListByAlchemyDiffLV(curPlayer, weightList, alchemyDiffLV):
|
| | | ## 根据炼丹等级差异等级过滤权重列表中不满足的物品,返回新的权重列表
|
| | | ''' 根据炼丹等级差异等级过滤权重列表中不满足的物品,返回新的权重列表
|
| | | @param weightList: 物品权重信息列表
|
| | | @param alchemyDiffLV: 是否过滤掉大于X级的炼丹等级物品,0-不过滤,1-过滤且读默认配置,>1-特殊功能指定的过滤等级
|
| | | '''
|
| | | resultWeightList = []
|
| | | if alchemyDiffLV:
|
| | | # 如果有指定大于1的等级则取指定等级,没有的话取默认等级差
|
| | | if alchemyDiffLV == 1:
|
| | | alchemyDiffLV = IpyGameDataPY.GetFuncCfg("AlchemyDiffLV", 1)
|
| | | curAlchemyLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AlchemyLV)
|
| | | for itemInfo in weightList:
|
| | | itemID = itemInfo[1][0]
|
| | | itemData = GameWorld.GetGameData().GetItemByTypeID(itemID)
|
| | | if not itemData:
|
| | | continue
|
| | | if GetItemClassLV(itemData) > curAlchemyLV + alchemyDiffLV:
|
| | | continue
|
| | | if itemID: # 支持配置ID为0时代表不产出
|
| | | itemData = GameWorld.GetGameData().GetItemByTypeID(itemID)
|
| | | if not itemData:
|
| | | continue
|
| | | if GetItemClassLV(itemData) > curAlchemyLV + alchemyDiffLV:
|
| | | continue
|
| | | resultWeightList.append(itemInfo)
|
| | | else:
|
| | | resultWeightList = weightList
|