6805 【后端】【2.0】副本前端化(增加过滤炼丹等级通用配置)
| | |
| | | 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]
|
| | |
| | | npcControl.RefreshBuffState(tick)
|
| | |
|
| | | owner = NPCCommon.GetNpcObjOwnerDetail(curNPC)
|
| | | if not owner:
|
| | | return
|
| | | |
| | | if GameWorld.GetDist(curNPC.GetPosX(), curNPC.GetPosY(), owner.GetPosX(), owner.GetPosY()) > 3:
|
| | | resetPos = GameMap.GetEmptyPlaceInArea(owner.GetPosX(), owner.GetPosY(), 2)
|
| | | curNPC.ResetPos(resetPos.GetPosX(), resetPos.GetPosY())
|
| | |
| | |
|
| | | if not awardItemList:
|
| | | alchemyDiffLV = collectNPCIpyData.GetAlchemyDiffLV()
|
| | | giveItemWeightList = []
|
| | | if alchemyDiffLV:
|
| | | curAlchemyLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AlchemyLV)
|
| | | for itemInfo in collectAwardCfg:
|
| | | itemID = itemInfo[1][0]
|
| | | itemData = GameWorld.GetGameData().GetItemByTypeID(itemID)
|
| | | if not itemData:
|
| | | continue
|
| | | if ItemCommon.GetItemClassLV(itemData) > curAlchemyLV + alchemyDiffLV:
|
| | | continue
|
| | | giveItemWeightList.append(itemInfo)
|
| | | else:
|
| | | giveItemWeightList = collectAwardCfg
|
| | | |
| | | giveItemWeightList = ItemCommon.GetWeightItemListByAlchemyDiffLV(curPlayer, collectAwardCfg, alchemyDiffLV)
|
| | | GameWorld.DebugLog(" 常规采集物品权重列表: alchemyDiffLV=%s,collectAwardCfg=%s,giveItemWeightList=%s" % (alchemyDiffLV, collectAwardCfg, giveItemWeightList))
|
| | | giveItemInfo = GameWorld.GetResultByWeightList(giveItemWeightList)
|
| | | if giveItemInfo:
|