hxp
2023-11-13 a200c70ea4244a6924ed735096f027f408c02a46
9912 [BT0.1]BOSS凭证(天玄丹buff掉落支持) master
3个文件已修改
91 ■■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -762,6 +762,7 @@
Def_SkillID_FBEncourageBuff = 20051     # 副本鼓舞buff
Def_SkillID_PoisonAtkBuff = 25180   # 毒攻buff
Def_SkillID_DropOwnerBuff = 20040   # 掉落归属buff
Def_SkillID_TianxuanBuff = 5100   # 天玄丹特殊掉落buff
Def_SkillID_PetSignDay = 47111   # 灵宠签到属性技能, 单次签到的加成
Def_SkillID_LFZ = 47100   # 龙凤镯技能(打怪概率经验加成)
Def_SkillID_HorsePetRobBossKillCntBuff = 21020   # 骑宠的怨念buff
@@ -3718,6 +3719,9 @@
Def_PDict_ChestsOpenCount = "ChestsOpenCount_%s"  # 宝箱已开启次数, 参数(宝箱ID), 只有有开启次数额外奖励的才会记录
Def_PDict_DropCountToday = "DropCountToday_%s" # 今日物品已掉落次数,参数(物品ID)
Def_PDict_DropColorToday = "DropColorToday_%s" # 今日装备品质已掉落次数,参数(装备品质)
# 跑环
Def_PDict_RunTaskAwardState = "RunTaskAwardState_%s" # 是否已领取跑环本轮结束奖励 参数任务类型
Def_PDict_RunTaskAwardRecord = "RunTaskAwardRecord_%s" # 跑环本轮结束奖励记录 参数任务类型
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
@@ -79,6 +79,7 @@
import random
import math
import time
import copy
#---------------------------------------------------------------------
OnNPCDie = None
@@ -988,6 +989,8 @@
        GameWorld.ErrLog("获取NPC掉落配置错误!表不存在该NPCID=%s" % npcID, playerID)
        return
    
    tianxuanState = False # 是否有天玄额外掉落状态
    tianxuanBuff = SkillCommon.FindBuffByID(dropPlayer, ChConfig.Def_SkillID_TianxuanBuff)[0]
    curGrade = curGrade if curGrade else GameWorld.GetGameFB().GetGameFBDictByKey(ChConfig.Def_FB_Grade)
    
    dropIDList = [] # 掉落的ID列表
@@ -1047,6 +1050,14 @@
        dropEquipInfoList += __GetNPCIndepRateEquipDrop(mapID, ipyDrop, indepRateDoCnt, equipDropRatePlus, curGrade)    
    #GameWorld.DebugLog("阶,颜色 key,dropEquipInfoList=%s" % (dropEquipInfoList))
    
    # 天玄丹
    tianxuanEquipRateList = ipyDrop.GetTianxuanEquipRateList()
    if tianxuanBuff and tianxuanEquipRateList:
        tianxuanState = True
        dropInfo = GameWorld.GetResultByRandomList(tianxuanEquipRateList)
        if dropInfo:
            dropEquipInfoList.append(dropInfo)
    # 3. 第x次击杀, 归属者公共附加掉落,所有归属者都增加击杀次数; 
    tagClassLV, tagColor, tagIsSuit, tagPlaceKey = 0, 0, 0, 0
    killCountDropEquipPub = ipyDrop.GetKillCountDropEquipPub() # 第x次击杀附加必掉装备 {次数:[阶,颜色,是否套装,部位集合key], ...}
@@ -1098,6 +1109,7 @@
    if npcID in fbGradeColorSuitRateDict:
        gradeColorSuitRateDict = fbGradeColorSuitRateDict[npcID]
        
    equipColorDropLimitDay = IpyGameDataPY.GetFuncEvalCfg("ItemDropCountLimit", 1, {}) # 每日个人掉落装备个数限制 {品质:每日掉落个数, ...}
    colorDropCntDict = {} # 装备颜色已经掉落数 {颜色:数量, ...}
    colorMaxDropCntDict = ipyDrop.GetEquipColorMaxDropCount() # {颜色:上限数量,...}
    colorSuitRateDict = ipyDrop.GetEquipColorSuitInfo() # 装备颜色对应套装概率 {颜色:套装概率, ...}
@@ -1111,6 +1123,14 @@
        if realmNPCIpyData:
            classLV = realmNPCIpyData.GetEquipClassLV()
            GameWorld.DebugLog("掉落对应难度境界装备: classLV=%s" % classLV, playerID)
        colorCountToday = 0
        if color in equipColorDropLimitDay:
            colorCountMax = equipColorDropLimitDay[color]
            colorCountToday = dropPlayer.NomalDictGetProperty(ChConfig.Def_PDict_DropColorToday % color)
            if colorCountToday >= colorCountMax:
                GameWorld.DebugLog("已超过该颜色装备今日最大掉落数,不掉!color=%s,colorCountMax=%s" % (color, colorCountMax), playerID)
                continue
            
        if color in colorMaxDropCntDict:
            maxCount = colorMaxDropCntDict[color]
@@ -1157,6 +1177,9 @@
        randEquipIDList = __GetEquipIDList(npcID, classLV, color, isSuit, placeList, jobList)
        if not randEquipIDList:
            continue
        if color in equipColorDropLimitDay:
            colorCountToday += 1
            PlayerControl.NomalDictSetProperty(dropPlayer, ChConfig.Def_PDict_DropColorToday % color, colorCountToday)
        if color in colorMaxDropCntDict:
            colorDropCntDict[color] = dropCount + 1
        if isSuit and len(jobList) > 1:
@@ -1166,9 +1189,13 @@
        dropIDList.append(randItemID)
        GameWorld.DebugLog("掉落装备: npcID=%s,itemID=%s,classLV=%s,color=%s,isSuit=%s,placeKey=%s,jobList=%s,randEquipIDList=%s" 
                           % (npcID, randItemID, classLV, color, isSuit, placeKey, jobList, randEquipIDList), playerID)
        if colorCountToday:
            GameWorld.DebugLog("    更新掉落特殊品质装备今日次数: color=%s,colorCountToday=%s" % (color, colorCountToday), playerID)
        
    # 4. 指定物品ID库
    dropIDList += __GetAppointDropItemIDList(dropPlayer, npcID, ipyDrop, doCountRate, doCountAdd)
    if tianxuanBuff and (ipyDrop.GetTianxuanItemKeyRate() or ipyDrop.GetTianxuanItemIDRate()):
        tianxuanState = True
    
    # 5. 私有掉落
    if isSingle:
@@ -1247,6 +1274,12 @@
        GameWorld.DebugLog("    auctionIDList=%s" % (auctionIDList), playerID)
    elif ChConfig.IsGameBoss(npcData):
        GameWorld.ErrLog("Boss没有掉落物品,NPCID=%s" % (npcID), dropPlayer.GetPlayerID())
    if tianxuanState:
        GameWorld.DebugLog("    去除天玄丹buff", playerID)
        tick = GameWorld.GetGameWorld().GetTick()
        BuffSkill.DelBuffBySkillID(dropPlayer, ChConfig.Def_SkillID_TianxuanBuff, tick)
    return dropIDList, auctionIDList, dropMoneyCnt, moneyValue
def __GetRandDropSuitEquipID(curPlayer, randEquipIDList):
@@ -1356,11 +1389,12 @@
                
    return dropIDList
def __GetAppointDropItemIDList(curPlayer, npcID, ipyDrop, doCountRate, doCountAdd):
def __GetAppointDropItemIDList(curPlayer, npcID, ipyDrop, doCountRate, doCountAdd, tianxuanBuff):
    ## 指定物品ID掉落
    
    dropItemIDList = []
    
    itemDropLimitDayInfo = IpyGameDataPY.GetFuncEvalCfg("ItemDropCountLimit", 2, {}) # 每日个人掉落物品个数限制 {物品ID:每日掉落上限, ...}
    # 1. 职业物品ID集合
    job = curPlayer.GetJob()
    JobItemDropSets = IpyGameDataPY.GetFuncCfg("JobItemDropSets", 1) # {物品ID集合key:[职业顺序物品ID列表], ...}
@@ -1395,7 +1429,13 @@
                
    #     1.2 随机掉落一个
    ItemKeyDropRateDict = ipyDrop.GetItemKeyDropRate() # {物品ID集合key:概率, ...}, 随机掉一个,优先级低
    tianxuanItemKeyRateDict = ipyDrop.GetTianxuanItemKeyRate() # 天玄丹指定ID集合Key概率{物品ID集合key:概率, ...}
    if tianxuanBuff and tianxuanItemKeyRateDict:
        ItemKeyDropRateDict = copy.deepcopy(ItemKeyDropRateDict)
        ItemKeyDropRateDict.update(tianxuanItemKeyRateDict)
    if ItemKeyDropRateDict:
        GameWorld.DebugLog("ItemKeyDropRateDict:%s" % ItemKeyDropRateDict)
        for itemKey, dropRate in ItemKeyDropRateDict.items():
            # 在只掉本职业里的不处理
            if itemKey in ItemKeyDropRateJobDict:
@@ -1423,18 +1463,27 @@
                    continue
                if not randItemID:
                    continue
                if __dropIDCountLimitToday(curPlayer, randItemID, itemDropLimitDayInfo):
                    continue
                dropItemIDList.append(randItemID)
                #GameWorld.DebugLog("掉落随机指定物品ID: itemKey=%s,randItemID=%s" % (itemKey, randItemID))
                
    # 2. 指定掉落ID处理, 受全局设定影响
    itemIDDropRateDict = ipyDrop.GetItemIDDropRate() # {物品ID:概率, ...}
    itemIDDropMaxCntDict = ipyDrop.GetItemIDMaxDropCount() # {物品ID:最大掉落个数,...}
    tianxuanItemIDRate = ipyDrop.GetTianxuanItemIDRate() # 天玄丹指定ID概率 {物品ID:概率, ...}
    if tianxuanBuff and tianxuanItemIDRate:
        itemIDDropRateDict = copy.deepcopy(itemIDDropRateDict)
        itemIDDropRateDict.update(tianxuanItemIDRate)
    # 全局材料掉落控制
    globalDropCDDict = IpyGameDataPY.GetFuncCfg("GlobalDropCD", 1) # {物品ID:分钟, ...}
    globalDropRateDict = IpyGameDataPY.GetFuncCfg("NPCGlobalDropRate", 1) # {物品ID:[[npcID列表], "概率公式"], ...}
    gw = GameWorld.GetGameWorld()
    
    if itemIDDropRateDict:
        GameWorld.DebugLog("itemIDDropRateDict=%s" % itemIDDropRateDict)
    for itemID, dropRate in itemIDDropRateDict.items():
        
        if not dropRate:
@@ -1462,6 +1511,9 @@
        #GameWorld.DebugLog("    指定判断: itemID=%s, dropRate=%s, doCnt=%s" % (itemID, dropRate, doCnt))
        for _ in xrange(doCnt):
            if not GameWorld.CanHappen(dropRate, maxRate=Def_NPCMaxDropRate):
                continue
            if __dropIDCountLimitToday(curPlayer, itemID, itemDropLimitDayInfo):
                continue
            
            dropItemIDList.append(itemID)
@@ -1533,6 +1585,23 @@
                GameWorld.Log("全服击杀次数必掉随机物品: randItemID=%s,randItemCount=%s" % (randItemID, randItemCount))
                
    return dropItemIDList
def __dropIDCountLimitToday(curPlayer, itemID, itemDropLimitDayInfo):
    ## 处理今日掉落物品ID个数限制
    # @return: 是否限制
    if itemID not in itemDropLimitDayInfo:
        return False
    dropCountTodayMax = itemDropLimitDayInfo[itemID]
    if not dropCountTodayMax:
        return False
    dropCountToday = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_DropCountToday % itemID)
    if dropCountToday >= dropCountTodayMax:
        GameWorld.DebugLog("    物品ID今日掉落次数已达上限: itemID=%s,dropCountToday=%s" % (itemID, dropCountToday), curPlayer.GetPlayerID())
        return True
    dropCountToday += 1
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_DropCountToday % itemID, dropCountToday)
    GameWorld.DebugLog("    更新物品ID今日掉落次数: itemID=%s,dropCountToday=%s" % (itemID, dropCountToday), curPlayer.GetPlayerID())
    return False
def __GetEquipIDList(findID, classLV, color, isSuit, placeList, itemJobList, findType="NPC"):
    #存一个满足要求的所有的物品的列表 然后从当中随机选一个
@@ -6031,6 +6100,18 @@
    NetPackCommon.SendFakePack(curPlayer, npcIDCollInfo)
    return
def PlayerOnDay(curPlayer):
    #采集次数重置
    CollNPCTimeOnDay(curPlayer)
    itemDropLimitDayInfo = IpyGameDataPY.GetFuncEvalCfg("ItemDropCountLimit", 2, {})
    for itemID in itemDropLimitDayInfo.keys():
        if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_DropCountToday % itemID):
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_DropCountToday % itemID, 0)
    for color in range(20):
        if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_DropColorToday % color):
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_DropColorToday % color, 0)
    return
def CollNPCTimeOnDay(curPlayer):
    ## 采集NPCOnDay处理
    DoResetCollectNPCTimeByType(curPlayer, [1])
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py
@@ -579,7 +579,7 @@
        # 极品白拿
        PlayerFreeGoods.OnDay(curPlayer)
        #采集次数重置
        NPCCommon.CollNPCTimeOnDay(curPlayer)
        NPCCommon.PlayerOnDay(curPlayer)
        #副本助战
        FBHelpBattle.DoPlayerOnDay(curPlayer)
        #跨服竞技场