Skip to content

Commit

Permalink
Shrouded enemies should now properly show the % they give for the spe…
Browse files Browse the repository at this point in the history
…cific dungeon you're in
  • Loading branch information
Numynum committed Aug 5, 2022
1 parent 090f23b commit f096e7e
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 4 deletions.
15 changes: 13 additions & 2 deletions Data/BFA.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@ function data:GetPatchVersion()
return 1;
end

function data:GetDungeonOverrides()
return {
[369] = { -- mechagon junkjard
[189878] = { ["name"] = "Nathrezim Infiltrator", ["count"] = 7 },
[190128] = { ["name"] = "Zul'gamux", ["count"] = 21 },
},
[370] = { -- mechagon workshop
[189878] = { ["name"] = "Nathrezim Infiltrator", ["count"] = 4 },
[190128] = { ["name"] = "Zul'gamux", ["count"] = 12 },
},
}
end

function data:GetNPCData()
-- data is sorted with natural sorting by NPC ID
return {
Expand Down Expand Up @@ -367,7 +380,5 @@ function data:GetNPCData()
[161241] = { ["name"] = "Voidweaver Mal'thir", ["count"] = 7 },
[161243] = { ["name"] = "Samh'rek, Beckoner of Chaos", ["count"] = 7 },
[161244] = { ["name"] = "Blood of the Corruptor", ["count"] = 7 },
[189878] = { ["name"] = "Nathrezim Infiltrator", ["count"] = 0 },
[190128] = { ["name"] = "Zul'gamux", ["count"] = 0 },
}
end
13 changes: 13 additions & 0 deletions Data/Legion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@ function data:GetPatchVersion()
return 1;
end

function data:GetDungeonOverrides()
return {
[227] = { -- lower kara
[189878] = { ["name"] = "Nathrezim Infiltrator", ["count"] = 4 },
[190128] = { ["name"] = "Zul'gamux", ["count"] = 12 },
},
[234] = { -- upper kara
[189878] = { ["name"] = "Nathrezim Infiltrator", ["count"] = 6 },
[190128] = { ["name"] = "Zul'gamux", ["count"] = 18 },
},
}
end

function data:GetNPCData()
-- data is sorted with natural sorting by NPC ID
return {
Expand Down
23 changes: 21 additions & 2 deletions Data/Shadowlands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,27 @@ function data:GetPatchVersion()
return 1;
end

function data:GetDungeonOverrides()
return {
[166] = { -- grimrail depot
[189878] = { ["name"] = "Nathrezim Infiltrator", ["count"] = 6 },
[190128] = { ["name"] = "Zul'gamux", ["count"] = 18 },
},
[169] = { -- iron docks
[189878] = { ["name"] = "Nathrezim Infiltrator", ["count"] = 4 },
[190128] = { ["name"] = "Zul'gamux", ["count"] = 12 },
},
[391] = { -- tazavesh streets
[189878] = { ["name"] = "Nathrezim Infiltrator", ["count"] = 3 },
[190128] = { ["name"] = "Zul'gamux", ["count"] = 9 },
},
[392] = { -- tazavesh gambit
[189878] = { ["name"] = "Nathrezim Infiltrator", ["count"] = 6 },
[190128] = { ["name"] = "Zul'gamux", ["count"] = 18 },
},
}
end

function data:GetNPCData()
-- data is sorted with natural sorting by NPC ID
return {
Expand Down Expand Up @@ -305,7 +326,5 @@ function data:GetNPCData()
[185680] = { ["name"] = "Vy Relic", ["count"] = 0 },
[185683] = { ["name"] = "Wo Relic", ["count"] = 0 },
[185685] = { ["name"] = "Urh Relic", ["count"] = 0 },
[189878] = { ["name"] = "Nathrezim Infiltrator", ["count"] = 0 },
[190128] = { ["name"] = "Zul'gamux", ["count"] = 0 },
}
end
16 changes: 16 additions & 0 deletions MythicPlusPullReEstimated.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ local StaticPopupDialogs = _G.StaticPopupDialogs
local max = _G.max
local wipe = _G.wipe
local Mixin = _G.Mixin
local C_ChallengeMode = _G.C_ChallengeMode

local name, ns = ...

Expand All @@ -51,6 +52,7 @@ MMPE.activeNameplates = {}
MMPE.simulationActive = false
MMPE.simulationMax = 220
MMPE.simulationCurrent = 28
MMPE.simulationMapId = 234 -- upper kara

MMPE.version = GetAddOnMetadata(name, "Version") or "unknown"
MMPE.defaultSettings = {
Expand Down Expand Up @@ -252,12 +254,22 @@ function MMPE:GetEnemyForcesProgress()
return progress
end

function MMPE:GetChallengeMapId()
if self.simulationActive then return self.simulationMapId end
return C_ChallengeMode.GetActiveChallengeMapID()
end

--
-- DB READ/WRITES
--

function MMPE:GetValue(npcID)
self:DebugPrint("GetValue called. Args:", npcID)
local activeMapId = self:GetChallengeMapId()
if (activeMapId and self.dungeonOverrides[activeMapId] and self.dungeonOverrides[activeMapId][npcID] and self.dungeonOverrides[activeMapId][npcID].count) then
return self.dungeonOverrides[activeMapId][npcID].count
end

local npcData = self.DB.npcData[npcID]
if npcData then
local bestValue, maxOccurrence = nil, -1
Expand Down Expand Up @@ -453,6 +465,7 @@ function MMPE:VerifyDB(fullWipe, npcDataWipe)

local currentPatchVersion = self.DB.npcDataPatchVersion or 0
local newPatchVersion = currentPatchVersion
self.dungeonOverrides = {}
for _, dataProvider in pairs(ns.data) do
local patchVersion = dataProvider.GetPatchVersion and dataProvider:GetPatchVersion() or 0
local defaultValues = dataProvider:GetNPCData()
Expand All @@ -465,6 +478,9 @@ function MMPE:VerifyDB(fullWipe, npcDataWipe)
for npcId, npcData in pairs(defaultValues) do
self:UpdateValue(npcId, npcData.count, npcData.name, false, forceUpdate)
end
if dataProvider.GetDungeonOverrides then
self.dungeonOverrides = Mixin(self.dungeonOverrides, dataProvider:GetDungeonOverrides())
end
end
self.DB.npcDataPatchVersion = newPatchVersion

Expand Down

0 comments on commit f096e7e

Please sign in to comment.