Added support for mythic+ deaths

This commit is contained in:
Tercio Jose
2023-02-27 12:03:09 -03:00
parent d7f15831fa
commit 0dd7b1e91b
5 changed files with 197 additions and 156 deletions
+20 -20
View File
@@ -45,15 +45,15 @@ function segmentClass:NovoHistorico()
return esta_tabela
end
function segmentClass:adicionar_overall (tabela)
function segmentClass:adicionar_overall (combatObject)
local zoneName, zoneType = GetInstanceInfo()
if (zoneType ~= "none" and tabela:GetCombatTime() <= Details.minimum_overall_combat_time) then
if (zoneType ~= "none" and combatObject:GetCombatTime() <= Details.minimum_overall_combat_time) then
return
end
if (Details.overall_clear_newboss) then
--only for raids
if (tabela.instance_type == "raid" and tabela.is_boss) then
if (combatObject.instance_type == "raid" and combatObject.is_boss) then
if (Details.last_encounter ~= Details.last_encounter2) then
if (Details.debug) then
Details:Msg("(debug) new boss detected 'overall_clear_newboss' is true, cleaning overall data.")
@@ -66,12 +66,12 @@ function segmentClass:adicionar_overall (tabela)
end
end
if (tabela.overall_added) then
if (combatObject.overall_added) then
Details:Msg("error > attempt to add a segment already added > func historico:adicionar_overall()")
return
end
local mythicInfo = tabela.is_mythic_dungeon
local mythicInfo = combatObject.is_mythic_dungeon
if (mythicInfo) then
--do not add overall mythic+ dungeon segments
if (mythicInfo.TrashOverallSegment) then
@@ -85,11 +85,11 @@ function segmentClass:adicionar_overall (tabela)
--store the segments added to the overall data
Details.tabela_overall.segments_added = Details.tabela_overall.segments_added or {}
local this_clock = tabela.data_inicio
local this_clock = combatObject.data_inicio
local combatName = tabela:GetCombatName(true)
local combatTime = tabela:GetCombatTime()
local combatType = tabela:GetCombatType()
local combatName = combatObject:GetCombatName(true)
local combatTime = combatObject:GetCombatTime()
local combatType = combatObject:GetCombatType()
tinsert(Details.tabela_overall.segments_added, 1, {name = combatName, elapsed = combatTime, clock = this_clock, type = combatType})
@@ -98,26 +98,26 @@ function segmentClass:adicionar_overall (tabela)
end
if (Details.debug) then
Details:Msg("(debug) adding the segment to overall data: " .. (tabela:GetCombatName(true) or "no name") .. " with time of: " .. (tabela:GetCombatTime() or "no time"))
Details:Msg("(debug) adding the segment to overall data: " .. (combatObject:GetCombatName(true) or "no name") .. " with time of: " .. (combatObject:GetCombatTime() or "no time"))
end
Details.tabela_overall = Details.tabela_overall + tabela
tabela.overall_added = true
Details.tabela_overall = Details.tabela_overall + combatObject
combatObject.overall_added = true
if (not Details.tabela_overall.overall_enemy_name) then
Details.tabela_overall.overall_enemy_name = tabela.is_boss and tabela.is_boss.name or tabela.enemy
Details.tabela_overall.overall_enemy_name = combatObject.is_boss and combatObject.is_boss.name or combatObject.enemy
else
if (Details.tabela_overall.overall_enemy_name ~= (tabela.is_boss and tabela.is_boss.name or tabela.enemy)) then
if (Details.tabela_overall.overall_enemy_name ~= (combatObject.is_boss and combatObject.is_boss.name or combatObject.enemy)) then
Details.tabela_overall.overall_enemy_name = "-- x -- x --"
end
end
if (Details.tabela_overall.start_time == 0) then
Details.tabela_overall:SetStartTime (tabela.start_time)
Details.tabela_overall:SetEndTime (tabela.end_time)
Details.tabela_overall:SetStartTime (combatObject.start_time)
Details.tabela_overall:SetEndTime (combatObject.end_time)
else
Details.tabela_overall:SetStartTime (tabela.start_time - Details.tabela_overall:GetCombatTime())
Details.tabela_overall:SetEndTime (tabela.end_time)
Details.tabela_overall:SetStartTime (combatObject.start_time - Details.tabela_overall:GetCombatTime())
Details.tabela_overall:SetEndTime (combatObject.end_time)
end
if (Details.tabela_overall.data_inicio == 0) then
@@ -215,7 +215,7 @@ function Details:CanAddCombatToOverall (tabela)
end
--sai do combate, chamou adicionar a tabela ao histrico
function segmentClass:adicionar (tabela)
function segmentClass:adicionar(tabela)
local tamanho = #self.tabelas
@@ -259,7 +259,7 @@ function segmentClass:adicionar (tabela)
end
--see if can add the encounter to overall data
local canAddToOverall = Details:CanAddCombatToOverall (tabela)
local canAddToOverall = Details:CanAddCombatToOverall(tabela)
if (canAddToOverall) then
--if (InCombatLockdown()) then