Skip to content

Commit

Permalink
Fixes for Kel'Thuzad and Painsmith encounters
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Jul 11, 2021
1 parent 6f6d796 commit caf27f4
Show file tree
Hide file tree
Showing 9 changed files with 356 additions and 65 deletions.
2 changes: 1 addition & 1 deletion Libs/DF/DFPixelUtil.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ function DFPixelUtil.SetStatusBarValue(statusBar, value)
else
statusBar:SetValue(value);
end
end
end
22 changes: 12 additions & 10 deletions Libs/DF/fw.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@


local dversion = 260

local dversion = 261
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary (major, minor)

Expand Down Expand Up @@ -3798,15 +3797,18 @@ function DF:AddRoleIconToText(text, role, size)
return text
end

-- TODO: maybe make this auto-generaded some day?...
DF.CLEncounterID = {
{ID = 2144, Name = "Taloc"},
{ID = 2141, Name = "MOTHER"},
{ID = 2128, Name = "Fetid Devourer"},
{ID = 2136, Name = "Zek'voz"},
{ID = 2134, Name = "Vectis"},
{ID = 2145, Name = "Zul"},
{ID = 2135, Name = "Mythrax the Unraveler"},
{ID = 2122, Name = "G'huun"},
{ID = 2423, Name = "The Tarragrue"},
{ID = 2433, Name = "The Eye of the Jailer"},
{ID = 2429, Name = "The Nine"},
{ID = 2432, Name = "Remnant of Ner'zhul"},
{ID = 2434, Name = "Soulrender Dormazain"},
{ID = 2430, Name = "Painsmith Raznal"},
{ID = 2436, Name = "Guardian of the First Ones"},
{ID = 2431, Name = "Fatescribe Roh-Kalo"},
{ID = 2422, Name = "Kel'Thuzad"},
{ID = 2435, Name = "Sylvanas Windrunner"},
}

function DF:GetPlayerRole()
Expand Down
2 changes: 1 addition & 1 deletion Libs/DF/languages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ function DF.Language.RegisterLanguage(self, addonGlobalName, language)
addonObject.__language = addonObject.__language or {}
addonObject.__language[language] = {}
return addonObject.__language[language]
end
end
16 changes: 9 additions & 7 deletions Libs/DF/panel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6196,7 +6196,7 @@ function DF:PassLoadFilters (loadTable, encounterID)
return
end
local hasEncounter
for _, ID in ipairs (loadTable.encounter_ids) do
for _, ID in pairs (loadTable.encounter_ids) do
if (ID == encounterID) then
hasEncounter = true
break
Expand All @@ -6213,7 +6213,7 @@ function DF:PassLoadFilters (loadTable, encounterID)
local uiMapID = C_Map.GetBestMapForUnit ("player")

local hasMapID
for _, ID in ipairs (loadTable.map_ids) do
for _, ID in pairs (loadTable.map_ids) do
if (ID == zoneMapID or ID == uiMapID) then
hasMapID = true
break
Expand Down Expand Up @@ -6608,8 +6608,10 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions)
local textEntryRefresh = function (self)
local idList = f.OptionsTable [self.DBKey]
self:SetText ("")
for i = 1, #idList do
self:SetText (self:GetText() .. " " .. idList [i])
for _, id in pairs(idList) do
if tonumber(id) then
self:SetText (self:GetText() .. " " .. id)
end
end
self:SetText (self:GetText():gsub ("^ ", ""))
end
Expand All @@ -6618,7 +6620,7 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions)
wipe (f.OptionsTable [self.DBKey])
local text = self:GetText()

for _, ID in ipairs ({strsplit ("", text)}) do
for _, ID in ipairs ({strsplit (" ", text)}) do
ID = DF:trim (ID)
ID = tonumber (ID)
if (ID) then
Expand All @@ -6635,7 +6637,7 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions)
encounterIDEditbox:SetPoint ("topleft", encounterIDLabel, "bottomleft", 0, -2)
encounterIDEditbox.DBKey = "encounter_ids"
encounterIDEditbox.Refresh = textEntryRefresh
encounterIDEditbox.tooltip = "Enter multiple IDs separating with a semicolon ()\nExample: 35 45 95\n\nUldir:\n"
encounterIDEditbox.tooltip = "Enter multiple IDs separating with a whitespace.\nExample: 35 45 95\n\nSanctum of Domination:\n"
for _, encounterTable in ipairs (DF:GetCLEncounterIDs()) do
encounterIDEditbox.tooltip = encounterIDEditbox.tooltip .. encounterTable.ID .. " - " .. encounterTable.Name .. "\n"
end
Expand All @@ -6649,7 +6651,7 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions)
mapIDEditbox:SetPoint ("topleft", mapIDLabel, "bottomleft", 0, -2)
mapIDEditbox.DBKey = "map_ids"
mapIDEditbox.Refresh = textEntryRefresh
mapIDEditbox.tooltip = "Enter multiple IDs separating with a semicolon ()\nExample: 35 45 95"
mapIDEditbox.tooltip = "Enter multiple IDs separating with a whitespace\nExample: 35 45 95"
mapIDEditbox:SetHook ("OnEnterPressed", textEntryOnEnterPressed)
tinsert (f.AllTextEntries, mapIDEditbox)

Expand Down
2 changes: 1 addition & 1 deletion Libs/DF/schedules.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ end

function DF.Schedules.SetName(object, name)
object.name = name
end
end
4 changes: 2 additions & 2 deletions boot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

local version, build, date, tocversion = GetBuildInfo()

_detalhes.build_counter = 8700
_detalhes.alpha_build_counter = 8700 --if this is higher than the regular counter, use it instead
_detalhes.build_counter = 8710
_detalhes.alpha_build_counter = 8710 --if this is higher than the regular counter, use it instead
_detalhes.bcc_counter = 25
_detalhes.dont_open_news = true
_detalhes.game_version = version
Expand Down
7 changes: 5 additions & 2 deletions classes/class_combat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@
local tremove = _G.tremove

--delete an actor from the combat ~delete ~erase ~remove
function combate:DeleteActor(attribute, actorName, removeDamageTaken)
function combate:DeleteActor(attribute, actorName, removeDamageTaken, cannotRemap)
local container = self[attribute]
if (container) then

Expand Down Expand Up @@ -411,7 +411,10 @@
tremove(container._ActorTable, index)

--remap
container:Remap()
if (not cannotRemap) then
container:Remap()
end
return true
end
end
end
Expand Down
112 changes: 105 additions & 7 deletions classes/class_damage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2026,14 +2026,24 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex
return Details:EndRefresh (instancia, total, tabela_do_combate, showing) --> retorna a tabela que precisa ganhar o refresh

else

if (keyName == "enemies") then

--/run Details:Dump(Details:GetCurrentCombat():GetActor(1, "Injured Steelspine 1"))
if (keyName == "enemies") then
--amount, total = Details:ContainerSortEnemies (conteudo, amount, "total")
amount, total = Details:ContainerSortEnemies (conteudo, amount, "damage_taken")
--keyName = "enemies"
--> grava o total
instancia.top = conteudo[1][keyName]

--remove actors with zero damage taken
local newAmount = 0
for i = 1, #conteudo do
if (conteudo[i].damage_taken < 1) then
newAmount = i-1
break
end
end
amount = newAmount

--keyName = "damage_taken"
--result of the first actor
instancia.top = conteudo[1] and conteudo[1][keyName]

elseif (modo == modo_ALL) then --> mostrando ALL

Expand Down Expand Up @@ -5410,6 +5420,94 @@ function atributo_damage:ColetarLixo (lastevent)
return Details:ColetarLixo (class_type, lastevent)
end


--actor 1 is who will receive the sum from actor2
function Details.SumDamageActors(actor1, actor2, actorContainer)
--general
actor1.total = actor1.total + actor2.total
actor1.damage_taken = actor1.damage_taken + actor2.damage_taken
actor1.totalabsorbed = actor1.totalabsorbed + actor2.totalabsorbed
actor1.total_without_pet = actor1.total_without_pet + actor2.total_without_pet
actor1.friendlyfire_total = actor1.friendlyfire_total + actor2.friendlyfire_total

--damage taken from
for actorName in pairs(actor2.damage_from) do
actor1.damage_from[actorName] = true

--add the damage done to actor2 into the damage done to target1
if (actorContainer) then
--get the actor that caused the damage on actor2
local actorObject = actorContainer:GetActor(actorName)
if (actorObject) then
local damageToActor2 = (actorObject.targets[actor2.nome]) or 0
actorObject.targets[actor1.nome] = (actorObject.targets[actor1.nome] or 0) + damageToActor2
end
end
end

--targets
for actorName, damageDone in pairs(actor2.targets) do
actor1.targets[actorName] = (actor1.targets[actorName] or 0) + damageDone
end

--pets
for i = 1, #actor2.pets do
DetailsFramework.table.addunique(actor1.pets, actor2.pets[i])
end

--raid targets
for raidTargetFlag, damageDone in pairs(actor2.raid_targets) do
actor1.raid_targets[raidTargetFlag] = (actor1.raid_targets[raidTargetFlag] or 0) + damageDone
end

--friendly fire
for actorName, ffTable in pairs(actor2.friendlyfire) do
actor1.friendlyfire[actorName] = actor1.friendlyfire[actorName] or actor1:CreateFFTable(actorName)
actor1.friendlyfire[actorName].total = actor1.friendlyfire[actorName].total + ffTable.total

for spellId, damageDone in pairs(ffTable.spells) do
actor1.friendlyfire[actorName].spells[spellId] = (actor1.friendlyfire[actorName].spells[spellId] or 0) + damageDone
end
end

--spells
local ignoredKeys = {
id = true,
spellschool = true,
}

local actor1Spells = actor1.spells
for spellId, spellTable in pairs(actor2.spells._ActorTable) do

local actor1Spell = actor1Spells:GetOrCreateSpell(spellId, true, "DAMAGE_DONE")

--genetal spell attributes
for key, value in pairs(spellTable) do
if (type(value) == "number") then
if (not ignoredKeys[key]) then
if (key == "n_min" or key == "c_min") then
if (actor1Spell[key] > value) then
actor1Spell[key] = value
end
elseif (key == "n_max" or key == "c_max") then
if (actor1Spell[key] < value) then
actor1Spell[key] = value
end
else
actor1Spell[key] = actor1Spell[key] + value
end
end
end
end

--spell targets
for targetName, damageDone in pairs(spellTable) do
actor1Spell.targets[targetName] = (actor1Spell.targets[targetName] or 0) + damageDone
end
end
end


atributo_damage.__add = function (tabela1, tabela2)

--> tempo decorrido
Expand Down Expand Up @@ -5463,7 +5561,7 @@ atributo_damage.__add = function (tabela1, tabela2)

--> soma os alvos
for target_name, amount in _pairs (habilidade.targets) do
habilidade_tabela1.targets = (habilidade_tabela1.targets [target_name] or 0) + amount
habilidade_tabela1.targets[target_name] = (habilidade_tabela1.targets [target_name] or 0) + amount
end

--> soma os extras
Expand Down
Loading

0 comments on commit caf27f4

Please sign in to comment.