hxp
2018-11-08 c48c06a3e9465bd2a4dda0cf8d8e3a5a6bc6eedd
4623 【1.2】【后端】全局击杀掉落支持数量配置
1个文件已修改
26 ■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
@@ -1227,17 +1227,17 @@
        GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, "GlobalDropRate", msgInfo, len(msgInfo))
         
    # 4. 指定全服击杀次数必掉,算额外掉落
    globalKillDropDict = IpyGameDataPY.GetFuncEvalCfg("GlobalDropCD", 2) # {NPCID:{击杀次数:[是否本职业, [物品ID, ...], [随机物品ID, ...]]}, ...}
    globalKillDropDict = IpyGameDataPY.GetFuncEvalCfg("GlobalDropCD", 2) # {NPCID:{击杀次数:[是否本职业, {物品ID:个数, ...}, [[随机物品ID,个数], ...]]}, ...}
    if npcID in globalKillDropDict:
        killCountDropDict = globalKillDropDict[npcID]
        updNPCKilledCount = min(gw.GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_NPCKilledCount % npcID) + 1, ShareDefine.Def_UpperLimit_DWord)
        GameWorld.DebugLog("更新全服击杀次数: %s" % updNPCKilledCount)
        GameWorld.Log("更新全服击杀次数:npcID=%s, %s" % (npcID, updNPCKilledCount))
        # 通知GameServer记录
        msgInfo = str([npcID, updNPCKilledCount])
        GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, "GlobalKillCount", msgInfo, len(msgInfo))
        if updNPCKilledCount in killCountDropDict:
            isJobLimit, itemIDList, randItemIDList = killCountDropDict[updNPCKilledCount]
            for itemID in itemIDList:
            isJobLimit, itemIDCountDict, randItemIDCountList = killCountDropDict[updNPCKilledCount]
            for itemID, itemCount in itemIDCountDict.items():
                if isJobLimit:
                    itemData = GameWorld.GetGameData().GetItemByTypeID(itemID)
                    if not itemData:
@@ -1247,12 +1247,12 @@
                        # 非本职业可用,不掉落
                        GameWorld.DebugLog("全服击杀次数必掉,非本职业可用,不掉落! itemID=%s" % itemID)
                        continue
                dropItemIDList.append(itemID)
                GameWorld.DebugLog("全服击杀次数必掉物品: itemID=%s" % itemID)
            if randItemIDList:
                dropItemIDList += [itemID] * itemCount
                GameWorld.Log("全服击杀次数必掉物品: itemID=%s,itemCount=%s" % (itemID, itemCount))
            if randItemIDCountList:
                if isJobLimit:
                    randJobItemList = []
                    for rItemID in randItemIDList:
                    for rItemID, rItemCount in randItemIDCountList:
                        itemData = GameWorld.GetGameData().GetItemByTypeID(rItemID)
                        if not itemData:
                            continue
@@ -1261,12 +1261,12 @@
                            # 非本职业可用,不掉落
                            GameWorld.DebugLog("全服击杀次数必掉随机,非本职业可用,不掉落! rItemID=%s" % rItemID)
                            continue
                        randJobItemList.append(rItemID)
                    randItemID = random.choice(randJobItemList)
                        randJobItemList.append([rItemID, rItemCount])
                    randItemID, randItemCount = random.choice(randJobItemList)
                else:
                    randItemID = random.choice(randItemIDList)
                dropItemIDList.append(randItemID)
                GameWorld.DebugLog("全服击杀次数必掉随机物品: randItemID=%s" % randItemID)
                    randItemID, randItemCount = random.choice(randItemIDCountList)
                dropItemIDList += [randItemID] * randItemCount
                GameWorld.Log("全服击杀次数必掉随机物品: randItemID=%s,randItemCount=%s" % (randItemID, randItemCount))
                
    return dropItemIDList