| | |
| | | GameWorld.ErrLog("获取NPC掉落配置错误!表不存在该NPCID=%s" % npcID, playerID)
|
| | | return
|
| | |
|
| | | curGrade = curGrade if curGrade else GameWorld.GetGameFB().GetGameFBDictByKey(ChConfig.Def_FB_Grade)
|
| | | |
| | | dropIDList = [] # 掉落的ID列表
|
| | | auctionIDList = []
|
| | | dropMoneyCnt, moneyValue = 0, 0
|
| | |
| | | indepRateDoCnt = ipyDrop.GetIndepRateDoCnt()
|
| | | if indepRateDoCnt:
|
| | | indepRateDoCnt = __GetNPCDropDoCountChange(indepRateDoCnt, doCountRate + equipDropDoCountPlus, doCountAdd)
|
| | | dropEquipInfoList += __GetNPCIndepRateEquipDrop(ipyDrop, indepRateDoCnt, equipDropRatePlus, curGrade) |
| | | dropEquipInfoList += __GetNPCIndepRateEquipDrop(mapID, ipyDrop, indepRateDoCnt, equipDropRatePlus, curGrade) |
| | | #GameWorld.DebugLog("阶,颜色 key,dropEquipInfoList=%s" % (dropEquipInfoList))
|
| | |
|
| | | # 3. 第x次击杀, 归属者公共附加掉落,所有归属者都增加击杀次数;
|
| | |
| | | fbGradeColorSuitRateDict = IpyGameDataPY.GetFuncEvalCfg("FBGradeEquipDropRate", 2) # 评级影响颜色套装概率 {npcID:{颜色:[D级影响概率, ..., S级影响概率], ...}, ...}
|
| | | if npcID in fbGradeColorSuitRateDict:
|
| | | gradeColorSuitRateDict = fbGradeColorSuitRateDict[npcID]
|
| | | curGrade = curGrade if curGrade else GameWorld.GetGameFB().GetGameFBDictByKey(ChConfig.Def_FB_Grade)
|
| | |
|
| | | colorDropCntDict = {} # 装备颜色已经掉落数 {颜色:数量, ...}
|
| | | colorMaxDropCntDict = ipyDrop.GetEquipColorMaxDropCount() # {颜色:上限数量,...}
|
| | |
| | | fbGradePriItemIDDropDict = IpyGameDataPY.GetFuncEvalCfg("FBGradeEquipDropRate", 3)
|
| | | if npcID in fbGradePriItemIDDropDict:
|
| | | gradePriItemIDDropDict = fbGradePriItemIDDropDict[npcID]
|
| | | curGrade = curGrade if curGrade else GameWorld.GetGameFB().GetGameFBDictByKey(ChConfig.Def_FB_Grade)
|
| | | priDropInfoList = gradePriItemIDDropDict.get(curGrade, [])
|
| | | priDropIDList = []
|
| | | for priItemID, priItemCount in priDropInfoList:
|
| | |
| | | for priDropID in priDropIDList:
|
| | | dropIDList.append(priDropID)
|
| | | #GameWorld.DebugLog("私有物品掉落: priDropID=%s" % priDropID)
|
| | | |
| | | # 6. 地图评级额外掉落
|
| | | fbGradeDropItemExDict = IpyGameDataPY.GetFuncEvalCfg("FBGradeEquipDropRate2", 2) # 地图评级额外物品掉落 {"mapID":{"评级":[[物品ID,个数], ...], ...}}
|
| | | if curGrade and str(mapID) in fbGradeDropItemExDict:
|
| | | gradeItemExDict = fbGradeDropItemExDict[str(mapID)]
|
| | | gradeItemExList = gradeItemExDict.get(str(curGrade), [])
|
| | | #GameWorld.DebugLog("评级额外掉落物品: curGrade=%s,gradeItemExList=%s" % (curGrade, gradeItemExList))
|
| | | for gItemExID, gItemExCount in gradeItemExList:
|
| | | dropIDList += [gItemExID] * gItemExCount
|
| | |
|
| | | # 检查掉落互斥ID组
|
| | | dropIDList = __RemoveMutexDropID(dropIDList, IpyGameDataPY.GetFuncCfg("MutexDrop", 1))
|
| | |
| | | #GameWorld.DebugLog("饼图装备掉落结果: doCnt=%s, %s" % (doCnt, dropEquipInfoList))
|
| | | return dropEquipInfoList
|
| | |
|
| | | def __GetNPCIndepRateEquipDrop(ipyDrop, doCnt, equipDropPlus, curGrade=0):
|
| | | def __GetNPCIndepRateEquipDrop(mapID, ipyDrop, doCnt, equipDropPlus, curGrade=0):
|
| | | ## 获取NPC独立掉率装备掉落信息
|
| | | npcID = ipyDrop.GetNPCID()
|
| | | indepRateDict = ipyDrop.GetIndepRateDrop() # 独立概率掉落信息 {(阶,颜色):概率,...}
|
| | |
| | | fbGradeColorRateDict = IpyGameDataPY.GetFuncEvalCfg("FBGradeEquipDropRate", 1) #{npcID:{颜色:[D级影响概率, ..., S级影响概率], ...}, ...}
|
| | | if npcID in fbGradeColorRateDict:
|
| | | gradeColorRateDict = fbGradeColorRateDict[npcID]
|
| | | curGrade = curGrade if curGrade else GameWorld.GetGameFB().GetGameFBDictByKey(ChConfig.Def_FB_Grade)
|
| | | |
| | | orangeEquipPer = 0
|
| | | fbGradeOrangeEquipPerDict = IpyGameDataPY.GetFuncEvalCfg("FBGradeEquipDropRate2", 1) # 地图评级影响橙装概率百分率 {"mapID":[D级影响概率, ..., S级影响概率], ..}
|
| | | if str(mapID) in fbGradeOrangeEquipPerDict and curGrade:
|
| | | orangeEquipPerList = fbGradeOrangeEquipPerDict[str(mapID)]
|
| | | orangeEquipPer = 0 if (curGrade <= 0 or curGrade > len(orangeEquipPerList)) else orangeEquipPerList[curGrade - 1]
|
| | |
|
| | | #colorDropCntDict = {} # 装备颜色已经掉落数 {颜色:数量, ...}
|
| | | dropEquipInfoList = []
|
| | |
| | | dropRate = int(dropRate * colorRate / 10000.0)
|
| | | #GameWorld.DebugLog(" 评级影响颜色概率: curGrade=%s,colorRate=%s,dropRate=%s" % (curGrade, colorRate, dropRate))
|
| | |
|
| | | if color == ChConfig.Def_Quality_Orange and orangeEquipPer:
|
| | | dropRate = int(dropRate * orangeEquipPer / 100.0)
|
| | | #GameWorld.DebugLog("评级橙装掉率加成: orangeEquipPer=%s,dropRate=%s" % (orangeEquipPer, dropRate))
|
| | | |
| | | dropRate = dropRate if not equipDropPlus else (dropRate + int(dropRate * equipDropPlus / 10000.0))
|
| | | mustDropCount = dropRate / Def_NPCMaxDropRate
|
| | | dropRate = dropRate % Def_NPCMaxDropRate # 基础概率
|