1.15.0 Test Version

- Implemented a early support for Dungeons:
the addon is now capable of distinguishing dungeon boss and trash mobs.
not all bosses are implemented yet, atm is:
*Mogu'Shan Palace
*Temple of the Jade Serpent
*Stormstout Brewery

- Implemented Overall Data: Options for it are under combat tab.

- Implemented spell targets on Player Details Window.
Also, fixed lots of small issues like showing damage done where clicking on a Dps bar.
This commit is contained in:
tercio
2014-05-28 18:04:24 -03:00
parent e9e1fe4dfd
commit 9dd43d676d
34 changed files with 1988 additions and 809 deletions
+42 -56
View File
@@ -27,6 +27,12 @@ local _table_remove = table.remove
local _tempo = time()
local _
--constants
local class_type_dano = _detalhes.atributos.dano
local class_type_cura = _detalhes.atributos.cura
local class_type_e_energy = _detalhes.atributos.e_energy
local class_type_misc = _detalhes.atributos.misc
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--[[ __call function, get an actor from current combat.
@@ -301,7 +307,7 @@ end
combate.__sub = function (combate1, combate2)
if (combate1~= _detalhes.tabela_overall) then
if (combate1 ~= _detalhes.tabela_overall) then
return
end
@@ -366,62 +372,42 @@ end
combate.__add = function (combate1, combate2)
if (combate1 == _detalhes.tabela_overall or combate2 == _detalhes.tabela_overall) then
return
end
--> add dano
for index, actor_T2 in _ipairs (combate2[1]._ActorTable) do
local actor_T1 = combate1[1]:PegarCombatente (actor_T2.serial, actor_T2.nome, actor_T2.flag_original, true)
actor_T1 = actor_T1 + actor_T2
actor_T1:add_total (combate1)
actor_T1:add_total (_detalhes.tabela_overall)
end
combate1 [1].need_refresh = true
--> add heal
for index, actor_T2 in _ipairs (combate2[2]._ActorTable) do
local actor_T1 = combate1[2]:PegarCombatente (actor_T2.serial, actor_T2.nome, actor_T2.flag_original, true)
actor_T1 = actor_T1 + actor_T2
actor_T1:add_total (combate1)
actor_T1:add_total (_detalhes.tabela_overall)
end
combate1 [2].need_refresh = true
--> add energy
for index, actor_T2 in _ipairs (combate2[3]._ActorTable) do
local actor_T1 = combate1[3]:PegarCombatente (actor_T2.serial, actor_T2.nome, actor_T2.flag_original, true)
actor_T1 = actor_T1 + actor_T2
actor_T1:add_total (combate1)
actor_T1:add_total (_detalhes.tabela_overall)
end
combate1 [3].need_refresh = true
--> add misc
for index, actor_T2 in _ipairs (combate2[4]._ActorTable) do
local actor_T1 = combate1[4]:PegarCombatente (actor_T2.serial, actor_T2.nome, actor_T2.flag_original, true)
actor_T1 = actor_T1 + actor_T2
actor_T1:add_total (combate1)
actor_T1:add_total (_detalhes.tabela_overall)
end
combate1 [4].need_refresh = true
--> aumenta o tempo
combate1.start_time = combate1.start_time - (combate2.end_time - combate2.start_time)
--> frags
for fragName, fragAmount in pairs (combate2.frags) do
if (fragAmount) then
if (combate1.frags [fragName]) then
combate1.frags [fragName] = combate1.frags [fragName] + fragAmount
else
combate1.frags [fragName] = fragAmount
end
end
end
combate1.frags_need_refresh = true
return combate1
local all_containers = {combate2 [class_type_dano]._ActorTable, combate2 [class_type_cura]._ActorTable, combate2 [class_type_e_energy]._ActorTable, combate2 [class_type_misc]._ActorTable}
--actor.boss_fight_component
--actor.fight_component
--combat.is_boss
--combat.instance_type -- party raid
for class_type, actor_container in ipairs (all_containers) do
for _, actor in ipairs (actor_container) do
local shadow
if (class_type == class_type_dano) then
shadow = _detalhes.atributo_damage:r_connect_shadow (actor, true)
elseif (class_type == class_type_cura) then
shadow = _detalhes.atributo_heal:r_connect_shadow (actor, true)
elseif (class_type == class_type_e_energy) then
shadow = _detalhes.atributo_energy:r_connect_shadow (actor, true)
elseif (class_type == class_type_misc) then
shadow = _detalhes.atributo_misc:r_connect_shadow (actor, true)
end
shadow.boss_fight_component = actor.boss_fight_component
shadow.fight_component = actor.fight_component
shadow.grupo = actor.grupo
--if (shadow:EstaoLinkados (actor)) then
-- shadow:FazLinkagem (actor)
--end
end
end
--if (combate2.end_time and combate2.start_time) then
-- combate1.start_time = combate1.start_time - (combate1.end_time - combate1.start_time)
--end
return combate1
end
function _detalhes:UpdateCombat()
+184 -70
View File
@@ -72,6 +72,8 @@ local CLASS_ICON_TCOORDS = _G.CLASS_ICON_TCOORDS
local key_overlay = {1, 1, 1, .1}
local key_overlay_press = {1, 1, 1, .2}
local headerColor = "yellow"
local info = _detalhes.janela_info
local keyName
@@ -268,9 +270,9 @@ function _detalhes:ToolTipFrags (instancia, frag, esta_barra, keydown)
for aggressor, _ in _pairs (took_damage_from) do
local damager_actor = damage_container._ActorTable[damage_container._NameIndexTable [ aggressor ]]
local damager_actor = damage_container._ActorTable [damage_container._NameIndexTable [ aggressor ]]
if (damager_actor) then --> checagem por causa do total e do garbage collector que não limpa os names que deram dano
if (damager_actor and not damager_actor.owner) then --> checagem por causa do total e do garbage collector que não limpa os names que deram dano
local targets = damager_actor.targets
@@ -285,7 +287,7 @@ function _detalhes:ToolTipFrags (instancia, frag, esta_barra, keydown)
_table_sort (damage_taken_table, _detalhes.Sort2)
GameCooltip:AddLine (Loc ["STRING_FROM"], nil, nil, headerColor, nil, 12)
GameCooltip:AddLine (Loc ["STRING_DAMAGE_FROM"], nil, nil, headerColor, nil, 12)
GameCooltip:AddIcon ([[Interface\Addons\Details\images\icons]], 1, 1, 14, 14, 0.126953125, 0.1796875, 0, 0.0546875)
local min = 6
@@ -322,7 +324,8 @@ function _detalhes:ToolTipFrags (instancia, frag, esta_barra, keydown)
_detalhes:AddTooltipBackgroundStatusbar()
end
GameCooltip:AddLine (Loc ["STRING_REPORT_LEFTCLICK"], nil, 1, "white")
GameCooltip:AddLine ("")
GameCooltip:AddLine (Loc ["STRING_REPORT_LEFTCLICK"], nil, 1, _unpack (self.click_to_report_color))
GameCooltip:AddIcon ([[Interface\TUTORIALFRAME\UI-TUTORIAL-FRAME]], 1, 1, 12, 16, 0.015625, 0.13671875, 0.4375, 0.59765625)
GameCooltip:ShowCooltip()
@@ -475,6 +478,9 @@ function _detalhes:ToolTipVoidZones (instancia, actor, barra, keydown)
local GameCooltip = GameCooltip
GameCooltip:AddLine (Loc ["STRING_VOIDZONE_TOOLTIP"], nil, nil, headerColor, nil, 12)
GameCooltip:AddIcon ([[Interface\Addons\Details\images\icons]], 1, 1, 14, 14, 0.126953125, 0.1796875, 0, 0.0546875)
for _, alvo in _ipairs (container) do
local minutos, segundos = _math_floor (alvo.uptime / 60), _math_floor (alvo.uptime % 60)
@@ -495,8 +501,10 @@ function _detalhes:ToolTipVoidZones (instancia, actor, barra, keydown)
end
GameCooltip:AddLine (Loc ["STRING_REPORT_LEFTCLICK"], nil, 1, "white")
GameCooltip:AddLine ("")
GameCooltip:AddLine (Loc ["STRING_REPORT_LEFTCLICK"], nil, 1, _unpack (self.click_to_report_color))
GameCooltip:AddIcon ([[Interface\TUTORIALFRAME\UI-TUTORIAL-FRAME]], 1, 1, 12, 16, 0.015625, 0.13671875, 0.4375, 0.59765625)
GameCooltip:ShowCooltip()
end
@@ -1307,6 +1315,8 @@ end
if (from_resize) then
if (self.owner) then
actor_class_color_r, actor_class_color_g, actor_class_color_b = _unpack (_detalhes.class_colors [self.owner.classe])
elseif (self.monster) then
actor_class_color_r, actor_class_color_g, actor_class_color_b = _unpack (_detalhes.class_colors.ENEMY)
else
actor_class_color_r, actor_class_color_g, actor_class_color_b = _unpack (_detalhes.class_colors [self.classe])
end
@@ -1408,7 +1418,6 @@ function atributo_damage:ToolTip (instancia, numero, barra, keydown)
end
--> tooltip locals
local r, g, b
local headerColor = "yellow"
local barAlha = .6
--[[exported]] function _detalhes.Sort1 (table1, table2)
@@ -1453,7 +1462,7 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown)
if (_detalhes.time_type == 1 or not self.grupo) then
meu_tempo = self:Tempo()
elseif (_detalhes.time_type == 2) then
meu_tempo = self:GetCombatTime()
meu_tempo = instancia.showing:GetCombatTime()
end
--add and sort
@@ -1843,6 +1852,9 @@ function atributo_damage:MontaDetalhes (spellid, barra)
elseif (info.sub_atributo == 4) then
return self:MontaDetalhesFriendlyFire (spellid, barra)
elseif (info.sub_atributo == 6) then
if (_bit_band (self.serial, 0x00000400) ~= 0) then --é um jogador
return self:MontaDetalhesDamageDone (spellid, barra)
end
return self:MontaDetalhesEnemy (spellid, barra)
end
end
@@ -1921,15 +1933,21 @@ function atributo_damage:MontaInfoFriendlyFire()
barra.textura:SetValue (tabela[2]/FirstPlaceDamage*100)
end
barra.texto_esquerdo:SetText (index..instancia.divisores.colocacao..tabela[1]) --seta o texto da esqueda
barra.texto_direita:SetText (tabela[2] .." ".. instancia.divisores.abre .._cstr("%.1f", tabela[3]) .."%".. instancia.divisores.fecha) --seta o texto da direita
barra.texto_esquerdo:SetText (index .. instancia.divisores.colocacao .. tabela[1]) --seta o texto da esqueda
barra.texto_direita:SetText (_detalhes:comma_value (tabela[2]) .. " (" .. _cstr ("%.1f", tabela[3]) .."%)") --seta o texto da direita
local classe = tabela[4]
if (not classe) then
classe = "monster"
end
barra.icone:SetTexture ("Interface\\AddOns\\Details\\images\\"..classe:lower().."_small")
barra.icone:SetTexture (info.instancia.row_info.icon_file)
if (CLASS_ICON_TCOORDS [classe]) then
barra.icone:SetTexCoord (_unpack (CLASS_ICON_TCOORDS [classe]))
else
barra.icone:SetTexture (nil)
end
barra.minha_tabela = self
barra.show = tabela[1]
@@ -1972,7 +1990,7 @@ function atributo_damage:MontaInfoFriendlyFire()
end
barra.texto_esquerdo:SetText (index..instancia.divisores.colocacao..tabela[1]) --seta o texto da esqueda
barra.texto_direita:SetText (tabela[2] .." ".. instancia.divisores.abre .._cstr("%.1f", tabela[3]) .. instancia.divisores.fecha) --seta o texto da direita
barra.texto_direita:SetText (_detalhes:comma_value (tabela[2]) .." (" .._cstr("%.1f", tabela[3]) .. ")") --seta o texto da direita
barra.icone:SetTexture (tabela[4])
barra.minha_tabela = nil --> desativa o tooltip
@@ -2032,46 +2050,23 @@ function atributo_damage:MontaInfoDamageTaken()
texCoords = _detalhes.class_coords ["UNKNOW"]
end
self:UpdadeInfoBar (barra, index, tabela[1], tabela[1], tabela[2], max_, tabela[3], "Interface\\AddOns\\Details\\images\\classes_small", true, texCoords)
self:UpdadeInfoBar (barra, index, tabela[1], tabela[1], tabela[2], _detalhes:comma_value (tabela[2]), max_, tabela[3], "Interface\\AddOns\\Details\\images\\classes_small", true, texCoords)
end
end
--[[
--> TOP HABILIDADES
local ActorDamage = self.total_without_pet
local ActorSkillsContainer = self.spell_tables._ActorTable
local ActorSkillsSortTable = {}
for _spellid, _skill in _pairs (ActorSkillsContainer) do
ActorSkillsSortTable [#ActorSkillsSortTable+1] = {_spellid, _skill.total}
end
_table_sort (ActorSkillsSortTable, _detalhes.Sort2)
--> TOP INIMIGOS
local ActorTargetsContainer = self.targets._ActorTable
local ActorTargetsSortTable = {}
for _, _target in _ipairs (ActorTargetsContainer) do
ActorTargetsSortTable [#ActorTargetsSortTable+1] = {_target.nome, _target.total}
end
_table_sort (ActorTargetsSortTable, _detalhes.Sort2)
--]]
--[[exported]] function _detalhes:UpdadeInfoBar (row, index, spellid, name, value, max, percent, icon, detalhes, texCoords)
--[[exported]] function _detalhes:UpdadeInfoBar (row, index, spellid, name, value, value_formated, max, percent, icon, detalhes, texCoords)
--> seta o tamanho da barra
if (index == 1) then
row.textura:SetValue (100)
else
row.textura:SetValue (value/max*100)
end
--> seta o texto da esqueda
--row.texto_esquerdo:SetText (index.."."..name)
--if (not) then
--end
row.texto_esquerdo:SetText (index.."."..name)
--> seta o texto da direita
row.texto_direita:SetText (_detalhes:comma_value (value).." (".._cstr("%.1f", percent) .."%)")
row.texto_direita:SetText (value_formated .. " (" .. _cstr ("%.1f", percent) .."%)")
--> seta o icone
if (icon) then
@@ -2093,8 +2088,9 @@ end
row.show = spellid
row:Show() --> mostra a barra
if (detalhes and self.detalhes and self.detalhes == spellid) then
self:MontaDetalhes (spellid, row) --> poderia deixar isso pro final e montar uma tail call??
if (detalhes and self.detalhes and self.detalhes == spellid and info.showing == index) then
--self:MontaDetalhes (spellid, row) --> poderia deixar isso pro final e montar uma tail call??
self:MontaDetalhes (row.show, row, info.instancia) --> poderia deixar isso pro final e montar uma tail call??
end
end
@@ -2128,7 +2124,15 @@ function atributo_damage:MontaInfoDamageDone()
local ActorTotalDamage = self.total
local ActorSkillsSortTable = {}
local ActorSkillsContainer = self.spell_tables._ActorTable
--get time type
local meu_tempo
if (_detalhes.time_type == 1 or not self.grupo) then
meu_tempo = self:Tempo()
elseif (_detalhes.time_type == 2) then
meu_tempo = info.instancia.showing:GetCombatTime()
end
for _spellid, _skill in _pairs (ActorSkillsContainer) do --> da foreach em cada spellid do container
local nome, _, icone = _GetSpellInfo (_spellid)
_table_insert (ActorSkillsSortTable, {_spellid, _skill.total, _skill.total/ActorTotalDamage*100, nome, icone})
@@ -2144,11 +2148,7 @@ function atributo_damage:MontaInfoDamageDone()
local PetSkillsContainer = PetActor.spell_tables._ActorTable
for _spellid, _skill in _pairs (PetSkillsContainer) do --> da foreach em cada spellid do container
local nome, _, icone = _GetSpellInfo (_spellid)
if (class_color) then
_table_insert (ActorSkillsSortTable, {_spellid, _skill.total, _skill.total/ActorTotalDamage*100, nome .. " (|c" .. class_color .. PetName:gsub ((" <.*"), "") .. "|r)", icone, PetActor})
else
_table_insert (ActorSkillsSortTable, {_spellid, _skill.total, _skill.total/ActorTotalDamage*100, nome .. " (" .. PetName:gsub ((" <.*"), "") .. ")", icone, PetActor})
end
_table_insert (ActorSkillsSortTable, {_spellid, _skill.total, _skill.total/ActorTotalDamage*100, nome .. " (|c" .. class_color .. PetName:gsub ((" <.*"), "") .. "|r)", icone, PetActor})
end
--_table_insert (ActorSkillsSortTable, {PetName, PetActor.total, PetActor.total/ActorTotalDamage*100, PetName:gsub ((" <.*"), ""), "Interface\\AddOns\\Details\\images\\classes_small"})
end
@@ -2169,8 +2169,14 @@ function atributo_damage:MontaInfoDamageDone()
self:FocusLock (barra, tabela[1])
self:UpdadeInfoBar (barra, index, tabela[1], tabela[4], tabela[2], max_, tabela[3], tabela[5], true)
barra.other_actor = tabela [6]
if (info.sub_atributo == 2) then
self:UpdadeInfoBar (barra, index, tabela[1], tabela[4], tabela[2], _detalhes:comma_value (_math_floor (tabela[2]/meu_tempo)), max_, tabela[3], tabela[5], true)
else
self:UpdadeInfoBar (barra, index, tabela[1], tabela[4], tabela[2], _detalhes:comma_value (tabela[2]), max_, tabela[3], tabela[5], true)
end
end
--> TOP INIMIGOS
@@ -2224,7 +2230,15 @@ function atributo_damage:MontaInfoDamageDone()
barra.texto_esquerdo:SetText (index..instancia.divisores.colocacao..tabela[1]) --seta o texto da esqueda
barra.texto_direita:SetText (_detalhes:comma_value (tabela[2]) .." ".. instancia.divisores.abre .. _cstr ("%.1f", tabela[3]) .."%".. instancia.divisores.fecha) --seta o texto da direita
--barra.icone:SetTexture (tabela[4]) --CLASSE
barra.icone:SetTexture ([[Interface\AddOns\Details\images\classes_small]]) --CLASSE
local texCoords = _detalhes.class_coords [tabela[4]]
if (not texCoords) then
texCoords = _detalhes.class_coords ["UNKNOW"]
end
barra.icone:SetTexCoord (_unpack (texCoords))
_detalhes:name_space_info (barra)
if (barra.mouse_over) then --> atualizar o tooltip
if (barra.isAlvo) then
@@ -2283,7 +2297,11 @@ function atributo_damage:MontaInfoDamageDone()
end
barra.texto_esquerdo:SetText (index..instancia.divisores.colocacao..tabela[1]) --seta o texto da esqueda
barra.texto_direita:SetText (_detalhes:comma_value (tabela[2]) .." ".. instancia.divisores.abre .._cstr("%.1f", tabela[3]) .. instancia.divisores.fecha) --seta o texto da direita
if (info.sub_atributo == 2) then
barra.texto_direita:SetText (_detalhes:comma_value ( _math_floor (tabela[2]/meu_tempo)) .." ".. instancia.divisores.abre .._cstr("%.1f", tabela[3]) .. instancia.divisores.fecha) --seta o texto da direita
else
barra.texto_direita:SetText (_detalhes:comma_value (tabela[2]) .." ".. instancia.divisores.abre .._cstr("%.1f", tabela[3]) .. instancia.divisores.fecha) --seta o texto da direita
end
if (barra.mouse_over) then --> atualizar o tooltip
if (barra.isAlvo) then
@@ -2360,7 +2378,8 @@ function atributo_damage:MontaDetalhesFriendlyFire (nome, barra)
barra.texto_direita:SetText (_detalhes:comma_value (tabela[2]) .. " " .. instancia.divisores.abre .. _cstr ("%.1f", tabela[3]) .. "%" .. instancia.divisores.fecha) --seta o texto da direita
barra.icone:SetTexture (tabela[5])
barra.icone:SetTexCoord (0, 1, 0, 1)
barra:Show() --> mostra a barra
if (index == 15) then
@@ -2376,7 +2395,7 @@ function atributo_damage:MontaDetalhesEnemy (spellid, barra)
for _, barra in _ipairs (info.barras3) do
barra:Hide()
end
local container = info.instancia.showing[1]
local barras = info.barras3
local instancia = info.instancia
@@ -2393,6 +2412,7 @@ function atributo_damage:MontaDetalhesEnemy (spellid, barra)
else
classe = "UNKNOW"
end
target_pool [#target_pool+1] = {target.nome, target.total, classe}
end
@@ -2457,7 +2477,7 @@ function atributo_damage:MontaDetalhesDamageTaken (nome, barra)
local este_agressor = showing._ActorTable[showing._NameIndexTable[nome]]
if (not este_agressor ) then
print ("EROO este agressor eh NIL")
--print ("EROO este agressor eh NIL")
return
end
@@ -2511,6 +2531,7 @@ function atributo_damage:MontaDetalhesDamageTaken (nome, barra)
barra.texto_direita:SetText (_detalhes:comma_value (tabela[2]) .." ".. instancia.divisores.abre .._cstr("%.1f", tabela[3]) .."%".. instancia.divisores.fecha) --seta o texto da direita
barra.icone:SetTexture (tabela[5])
barra.icone:SetTexCoord (0, 1, 0, 1)
barra:Show() --> mostra a barra
@@ -2587,7 +2608,6 @@ function atributo_damage:MontaDetalhesDamageDone (spellid, barra, instancia)
return
end
local esta_magia
if (barra.other_actor) then
@@ -2607,11 +2627,12 @@ function atributo_damage:MontaDetalhesDamageDone (spellid, barra, instancia)
_detalhes.janela_info.spell_icone:SetTexture (infospell[3])
local total = self.total
local meu_tempo
if (_detalhes.time_type == 1 or not self.grupo) then
meu_tempo = self:Tempo()
elseif (_detalhes.time_type == 2) then
meu_tempo = self:GetCombatTime()
meu_tempo = info.instancia.showing:GetCombatTime()
end
local total_hits = esta_magia.counter
@@ -2620,6 +2641,8 @@ function atributo_damage:MontaDetalhesDamageDone (spellid, barra, instancia)
local data = {}
--print (debugstack())
--> GERAL
local media = esta_magia.total/total_hits
@@ -2806,17 +2829,40 @@ function atributo_damage:MontaTooltipAlvos (esta_barra, index, instancia)
table.sort (habilidades, function (a, b) return a[2] > b[2] end)
GameTooltip:AddLine (index..". "..inimigo)
GameTooltip:AddLine (Loc ["STRING_DAMAGE_FROM"]..":")
GameTooltip:AddLine (" ")
--get time type
local meu_tempo
if (_detalhes.time_type == 1 or not self.grupo) then
meu_tempo = self:Tempo()
elseif (_detalhes.time_type == 2) then
meu_tempo = info.instancia.showing:GetCombatTime()
end
local is_dps = info.instancia.sub_atributo == 2
if (is_dps) then
GameTooltip:AddLine (index..". "..inimigo)
GameTooltip:AddLine (Loc ["STRING_DAMAGE_DPS_IN"] .. ":")
GameTooltip:AddLine (" ")
else
GameTooltip:AddLine (index..". "..inimigo)
GameTooltip:AddLine (Loc ["STRING_DAMAGE_FROM"] .. ":")
GameTooltip:AddLine (" ")
end
for index, tabela in _ipairs (habilidades) do
if (index < 8) then
GameTooltip:AddDoubleLine (index..". |T"..tabela[3]..":0|t "..tabela[1], _detalhes:comma_value (tabela[2]).." (".._cstr("%.1f", tabela[2]/total*100).."%)", 1, 1, 1, 1, 1, 1)
--GameTooltip:AddTexture (icone)
if (is_dps) then
GameTooltip:AddDoubleLine (index..". |T"..tabela[3]..":0|t "..tabela[1], _detalhes:comma_value ( _math_floor (tabela[2] / meu_tempo) ).." (".._cstr("%.1f", tabela[2]/total*100).."%)", 1, 1, 1, 1, 1, 1)
else
GameTooltip:AddDoubleLine (index..". |T"..tabela[3]..":0|t "..tabela[1], _detalhes:comma_value (tabela[2]).." (".._cstr("%.1f", tabela[2]/total*100).."%)", 1, 1, 1, 1, 1, 1)
end
else
GameTooltip:AddDoubleLine (index..". "..tabela[1], _detalhes:comma_value (tabela[2]).." (".._cstr("%.1f", tabela[2]/total*100).."%)", .65, .65, .65, .65, .65, .65)
if (is_dps) then
GameTooltip:AddDoubleLine (index..". "..tabela[1], _detalhes:comma_value ( _math_floor (tabela[2] / meu_tempo) ).." (".._cstr("%.1f", tabela[2]/total*100).."%)", .65, .65, .65, .65, .65, .65)
else
GameTooltip:AddDoubleLine (index..". "..tabela[1], _detalhes:comma_value (tabela[2]).." (".._cstr("%.1f", tabela[2]/total*100).."%)", .65, .65, .65, .65, .65, .65)
end
end
end
@@ -2879,11 +2925,68 @@ end
end
--> restaura e liga o ator com a sua shadow durante a inicialização (startup function)
function atributo_damage:r_connect_shadow (actor)
function atributo_damage:r_onlyrefresh_shadow (actor)
--> criar uma shadow desse ator se ainda não tiver uma
local overall_dano = _detalhes.tabela_overall [1]
local shadow = overall_dano._ActorTable [overall_dano._NameIndexTable [actor.nome]]
if (not shadow) then
shadow = overall_dano:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true)
shadow.classe = actor.classe
shadow.grupo = actor.grupo
shadow.start_time = time() - 3
shadow.end_time = time()
end
--> restaura a meta e indexes ao ator
_detalhes.refresh:r_atributo_damage (actor, shadow)
--> copia o container de alvos (captura de dados)
for index, alvo in _ipairs (actor.targets._ActorTable) do
--> cria e soma o valor do total
local alvo_shadow = shadow.targets:PegarCombatente (nil, alvo.nome, nil, true)
--> refresh no alvo
_detalhes.refresh:r_alvo_da_habilidade (alvo, shadow.targets)
end
--> copia o container de habilidades (captura de dados)
for spellid, habilidade in _pairs (actor.spell_tables._ActorTable) do
--> cria e soma o valor
local habilidade_shadow = shadow.spell_tables:PegaHabilidade (spellid, true, nil, true)
--> refresh e soma os valores dos alvos
for index, alvo in _ipairs (habilidade.targets._ActorTable) do
--> cria e soma o valor do total
local alvo_shadow = habilidade_shadow.targets:PegarCombatente (nil, alvo.nome, nil, true)
--> refresh no alvo da habilidade
_detalhes.refresh:r_alvo_da_habilidade (alvo, habilidade_shadow.targets)
end
--> refresh na habilidade
_detalhes.refresh:r_habilidade_dano (habilidade, shadow.spell_tables)
end
--> copia o container de friendly fire (captura de dados)
for index, friendlyFire in _ipairs (actor.friendlyfire._ActorTable) do
--> cria ou pega a shadow
local friendlyFire_shadow = shadow.friendlyfire:PegarCombatente (nil, friendlyFire.nome, nil, true)
--> refresh na tabela e no container de habilidades
_setmetatable (friendlyFire, _detalhes)
friendlyFire.shadow = friendlyFire_shadow
for spellid, habilidade in _pairs (friendlyFire.spell_tables._ActorTable) do
--> cria ou pega a habilidade no container de habilidade
local habilidade_shadow = friendlyFire_shadow.spell_tables:PegaHabilidade (spellid, true, nil, true)
--> refresh na habilidade
_detalhes.refresh:r_habilidade_dano (habilidade, friendlyFire_shadow.spell_tables)
end
--> refresh na meta e indexes
_detalhes.refresh:r_container_habilidades (friendlyFire.spell_tables, friendlyFire_shadow.spell_tables)
end
return shadow
end
if (not actor) then
actor = self
end
function atributo_damage:r_connect_shadow (actor, no_refresh)
--> criar uma shadow desse ator se ainda não tiver uma
local overall_dano = _detalhes.tabela_overall [1]
@@ -2898,8 +3001,9 @@ end
end
--> restaura a meta e indexes ao ator
if (not no_refresh) then
_detalhes.refresh:r_atributo_damage (actor, shadow)
end
--> tempo decorrido (captura de dados)
if (actor.end_time) then
local tempo = (actor.end_time or time()) - actor.start_time
@@ -2932,7 +3036,9 @@ end
local alvo_shadow = shadow.targets:PegarCombatente (nil, alvo.nome, nil, true)
alvo_shadow.total = alvo_shadow.total + alvo.total
--> refresh no alvo
_detalhes.refresh:r_alvo_da_habilidade (alvo, shadow.targets)
if (not no_refresh) then
_detalhes.refresh:r_alvo_da_habilidade (alvo, shadow.targets)
end
end
--> copia o container de habilidades (captura de dados)
@@ -2945,7 +3051,9 @@ end
local alvo_shadow = habilidade_shadow.targets:PegarCombatente (nil, alvo.nome, nil, true)
alvo_shadow.total = alvo_shadow.total + alvo.total
--> refresh no alvo da habilidade
_detalhes.refresh:r_alvo_da_habilidade (alvo, habilidade_shadow.targets)
if (not no_refresh) then
_detalhes.refresh:r_alvo_da_habilidade (alvo, habilidade_shadow.targets)
end
end
--> soma todos os demais valores
for key, value in _pairs (habilidade) do
@@ -2960,7 +3068,9 @@ end
end
--> refresh na habilidade
_detalhes.refresh:r_habilidade_dano (habilidade, shadow.spell_tables)
if (not no_refresh) then
_detalhes.refresh:r_habilidade_dano (habilidade, shadow.spell_tables)
end
end
--> copia o container de friendly fire (captura de dados)
@@ -2980,10 +3090,14 @@ end
habilidade_shadow.counter = habilidade_shadow.counter + habilidade.counter
habilidade_shadow.total = habilidade_shadow.total + habilidade.total
--> refresh na habilidade
_detalhes.refresh:r_habilidade_dano (habilidade, friendlyFire_shadow.spell_tables)
if (not no_refresh) then
_detalhes.refresh:r_habilidade_dano (habilidade, friendlyFire_shadow.spell_tables)
end
end
--> refresh na meta e indexes
_detalhes.refresh:r_container_habilidades (friendlyFire.spell_tables, friendlyFire_shadow.spell_tables)
if (not no_refresh) then
_detalhes.refresh:r_container_habilidades (friendlyFire.spell_tables, friendlyFire_shadow.spell_tables)
end
end
return shadow
+39 -47
View File
@@ -98,9 +98,6 @@ end
function habilidade_dano:AddFF (amount)
self.counter = self.counter + 1
self.total = self.total + amount
if (self.shadow) then
return self.shadow:AddFF (amount)
end
end
function habilidade_dano:Add (serial, nome, flag, amount, who_nome, resisted, blocked, absorbed, critical, glacing, token)
@@ -157,61 +154,56 @@ function habilidade_dano:Add (serial, nome, flag, amount, who_nome, resisted, bl
end
--end
if (self.shadow) then
if (_recording_ability_with_buffs) then
if (who_nome == _detalhes.playername) then --aqui ele vai detalhar tudo sobre a magia usada
if (_recording_ability_with_buffs) then
if (who_nome == _detalhes.playername) then --aqui ele vai detalhar tudo sobre a magia usada
local buffsNames = _detalhes.SoloTables.BuffsTableNameCache
local buffsNames = _detalhes.SoloTables.BuffsTableNameCache
local SpellBuffDetails = self.BuffTable
if (not SpellBuffDetails) then
self.BuffTable = {}
SpellBuffDetails = self.BuffTable
end
if (token == "SPELL_PERIODIC_DAMAGE") then
--> precisa ver se ele tinha na hora que aplicou
local SoloDebuffPower = _detalhes.tabela_vigente.SoloDebuffPower
if (SoloDebuffPower) then
local ThisDebuff = SoloDebuffPower [self.id]
if (ThisDebuff) then
local ThisDebuffOnTarget = ThisDebuff [serial]
if (ThisDebuffOnTarget) then
for index, buff_name in _ipairs (ThisDebuffOnTarget.buffs) do
local buff_info = SpellBuffDetails [buff_name] or {["counter"] = 0, ["total"] = 0, ["critico"] = 0, ["critico_dano"] = 0}
buff_info.counter = buff_info.counter+1
buff_info.total = buff_info.total+amount
if (critical ~= nil) then
buff_info.critico = buff_info.critico+1
buff_info.critico_dano = buff_info.critico_dano+amount
end
SpellBuffDetails [buff_name] = buff_info
local SpellBuffDetails = self.BuffTable
if (not SpellBuffDetails) then
self.BuffTable = {}
SpellBuffDetails = self.BuffTable
end
if (token == "SPELL_PERIODIC_DAMAGE") then
--> precisa ver se ele tinha na hora que aplicou
local SoloDebuffPower = _detalhes.tabela_vigente.SoloDebuffPower
if (SoloDebuffPower) then
local ThisDebuff = SoloDebuffPower [self.id]
if (ThisDebuff) then
local ThisDebuffOnTarget = ThisDebuff [serial]
if (ThisDebuffOnTarget) then
for index, buff_name in _ipairs (ThisDebuffOnTarget.buffs) do
local buff_info = SpellBuffDetails [buff_name] or {["counter"] = 0, ["total"] = 0, ["critico"] = 0, ["critico_dano"] = 0}
buff_info.counter = buff_info.counter+1
buff_info.total = buff_info.total+amount
if (critical ~= nil) then
buff_info.critico = buff_info.critico+1
buff_info.critico_dano = buff_info.critico_dano+amount
end
SpellBuffDetails [buff_name] = buff_info
end
end
end
else
end
else
for BuffName, _ in _pairs (_detalhes.Buffs.BuffsTable) do
local name = _UnitAura ("player", BuffName)
if (name ~= nil) then
local buff_info = SpellBuffDetails [name] or {["counter"] = 0, ["total"] = 0, ["critico"] = 0, ["critico_dano"] = 0}
buff_info.counter = buff_info.counter+1
buff_info.total = buff_info.total+amount
if (critical ~= nil) then
buff_info.critico = buff_info.critico+1
buff_info.critico_dano = buff_info.critico_dano+amount
end
SpellBuffDetails [name] = buff_info
for BuffName, _ in _pairs (_detalhes.Buffs.BuffsTable) do
local name = _UnitAura ("player", BuffName)
if (name ~= nil) then
local buff_info = SpellBuffDetails [name] or {["counter"] = 0, ["total"] = 0, ["critico"] = 0, ["critico_dano"] = 0}
buff_info.counter = buff_info.counter+1
buff_info.total = buff_info.total+amount
if (critical ~= nil) then
buff_info.critico = buff_info.critico+1
buff_info.critico_dano = buff_info.critico_dano+amount
end
SpellBuffDetails [name] = buff_info
end
end
end
end
return self.shadow:Add (serial, nome, flag, amount, who_nome, resisted, blocked, absorbed, critical, glacing, token)
end
end
+56 -9
View File
@@ -856,7 +856,7 @@ function atributo_energy:MontaInfoRegenRecebido()
end
self:FocusLock (barra, tabela[1])
self:UpdadeInfoBar (barra, index, tabela[1], tabela[4], tabela[2], max_, tabela[3], tabela[5], true)
self:UpdadeInfoBar (barra, index, tabela[1], tabela[4], tabela[2], _detalhes:comma_value (tabela[2]), max_, tabela[3], tabela[5], true)
barra.minha_tabela = self
barra.show = tabela[1]
@@ -1036,11 +1036,8 @@ end
end
--> restaura e liga o ator com a sua shadow durante a inicialização
function atributo_energy:r_connect_shadow (actor)
if (not actor) then
actor = self
end
function atributo_energy:r_onlyrefresh_shadow (actor)
--> criar uma shadow desse ator se ainda não tiver uma
local overall_energy = _detalhes.tabela_overall [3]
@@ -1055,6 +1052,50 @@ end
--> restaura a meta e indexes ao ator
_detalhes.refresh:r_atributo_energy (actor, shadow)
--> copia o container de alvos (captura de dados)
for index, alvo in _ipairs (actor.targets._ActorTable) do
--> cria e soma o valor do total
local alvo_shadow = shadow.targets:PegarCombatente (nil, alvo.nome, nil, true)
--> refresh no alvo
_detalhes.refresh:r_alvo_da_habilidade (alvo, shadow.targets)
end
--> copia o container de habilidades (captura de dados)
for spellid, habilidade in _pairs (actor.spell_tables._ActorTable) do
--> cria e soma o valor
local habilidade_shadow = shadow.spell_tables:PegaHabilidade (spellid, true, nil, true)
--> refresh e soma os valores dos alvos
for index, alvo in _ipairs (habilidade.targets._ActorTable) do
--> cria e soma o valor do total
local alvo_shadow = habilidade_shadow.targets:PegarCombatente (nil, alvo.nome, nil, true)
--> refresh no alvo da habilidade
_detalhes.refresh:r_alvo_da_habilidade (alvo, habilidade_shadow.targets)
end
--> refresh na meta e indexes
_detalhes.refresh:r_habilidade_e_energy (habilidade, shadow.spell_tables)
end
return shadow
end
function atributo_energy:r_connect_shadow (actor, no_refresh)
--> criar uma shadow desse ator se ainda não tiver uma
local overall_energy = _detalhes.tabela_overall [3]
local shadow = overall_energy._ActorTable [overall_energy._NameIndexTable [actor.nome]]
if (not shadow) then
shadow = overall_energy:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true)
shadow.classe = actor.classe
shadow.grupo = actor.grupo
end
--> restaura a meta e indexes ao ator
if (not no_refresh) then
_detalhes.refresh:r_atributo_energy (actor, shadow)
end
--> total das energias (captura de dados)
shadow.mana = shadow.mana + actor.mana
shadow.e_rage = shadow.e_rage + actor.e_rage
@@ -1089,7 +1130,9 @@ end
local alvo_shadow = shadow.targets:PegarCombatente (nil, alvo.nome, nil, true)
alvo_shadow.total = alvo_shadow.total + alvo.total
--> refresh no alvo
_detalhes.refresh:r_alvo_da_habilidade (alvo, shadow.targets)
if (not no_refresh) then
_detalhes.refresh:r_alvo_da_habilidade (alvo, shadow.targets)
end
end
--> copia o container de habilidades (captura de dados)
@@ -1102,7 +1145,9 @@ end
local alvo_shadow = habilidade_shadow.targets:PegarCombatente (nil, alvo.nome, nil, true)
alvo_shadow.total = alvo_shadow.total + alvo.total
--> refresh no alvo da habilidade
_detalhes.refresh:r_alvo_da_habilidade (alvo, habilidade_shadow.targets)
if (not no_refresh) then
_detalhes.refresh:r_alvo_da_habilidade (alvo, habilidade_shadow.targets)
end
end
--> soma todos os demais valores
for key, value in _pairs (habilidade) do
@@ -1116,7 +1161,9 @@ end
end
end
--> refresh na meta e indexes
_detalhes.refresh:r_habilidade_e_energy (habilidade, shadow.spell_tables)
if (not no_refresh) then
_detalhes.refresh:r_habilidade_e_energy (habilidade, shadow.spell_tables)
end
end
return shadow
-3
View File
@@ -67,9 +67,6 @@ function habilidade_energy:Add (serial, nome, flag, amount, who_nome, powertype)
alvo.runepower = alvo.runepower + amount
end
if (self.shadow) then
return self.shadow:Add (serial, nome, flag, amount, who_nome, powertype)
end
end
function _detalhes.refresh:r_habilidade_e_energy (habilidade, shadow) --recebeu o container shadow
+133 -32
View File
@@ -928,7 +928,7 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown)
if (_detalhes.time_type == 1 or not self.grupo) then
meu_tempo = self:Tempo()
elseif (_detalhes.time_type == 2) then
meu_tempo = self:GetCombatTime()
meu_tempo = instancia.showing:GetCombatTime()
end
local ActorTotal = self [actor_key]
@@ -991,8 +991,10 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown)
end
if (instancia.sub_atributo == 6) then
GameCooltip:AddLine (Loc ["STRING_REPORT_LEFTCLICK"], nil, 1, "white")
GameCooltip:AddLine ("")
GameCooltip:AddLine (Loc ["STRING_REPORT_LEFTCLICK"], nil, 1, _unpack (self.click_to_report_color))
GameCooltip:AddIcon ([[Interface\TUTORIALFRAME\UI-TUTORIAL-FRAME]], 1, 1, 12, 16, 0.015625, 0.13671875, 0.4375, 0.59765625)
GameCooltip:ShowCooltip()
end
@@ -1072,7 +1074,7 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown)
if (_detalhes.time_type == 1 or not self.grupo) then
meu_tempo = my_self:Tempo()
elseif (_detalhes.time_type == 2) then
meu_tempo = my_self:GetCombatTime()
meu_tempo = instancia.showing:GetCombatTime()
end
totais [#totais+1] = {nome, my_self.total_without_pet, my_self.total_without_pet/meu_tempo}
@@ -1246,7 +1248,7 @@ function atributo_heal:MontaInfoHealTaken()
texCoords = _detalhes.class_coords ["UNKNOW"]
end
self:UpdadeInfoBar (barra, index, tabela[1], tabela[1], tabela[2], max_, tabela[3], "Interface\\AddOns\\Details\\images\\classes_small", true, texCoords)
self:UpdadeInfoBar (barra, index, tabela[1], tabela[1], tabela[2], _detalhes:comma_value (tabela[2]), max_, tabela[3], "Interface\\AddOns\\Details\\images\\classes_small", true, texCoords)
end
--[[
@@ -1377,19 +1379,25 @@ function atributo_heal:MontaInfoOverHealing()
end
--> TOP OVERHEALED
local meus_inimigos = {}
local jogadores_overhealed = {}
tabela = self.targets._ActorTable
local heal_container = instancia.showing[2]
for _, tabela in _ipairs (tabela) do
_table_insert (meus_inimigos, {tabela.nome, tabela.overheal, tabela.overheal/total*100})
local classe = "UNKNOW"
local actor_object = heal_container._ActorTable [heal_container._NameIndexTable [tabela.nome]]
if (actor_object) then
classe = actor_object.classe
end
_table_insert (jogadores_overhealed, {tabela.nome, tabela.overheal, tabela.overheal/total*100, classe})
end
_table_sort (meus_inimigos, function(a, b) return a[2] > b[2] end )
_table_sort (jogadores_overhealed, function(a, b) return a[2] > b[2] end )
local amt_alvos = #meus_inimigos
local amt_alvos = #jogadores_overhealed
gump:JI_AtualizaContainerAlvos (amt_alvos)
local max_inimigos = meus_inimigos[1] and meus_inimigos[1][2] or 0
local max_inimigos = jogadores_overhealed[1] and jogadores_overhealed[1][2] or 0
for index, tabela in _ipairs (meus_inimigos) do
for index, tabela in _ipairs (jogadores_overhealed) do
local barra = info.barras2 [index]
@@ -1401,15 +1409,21 @@ function atributo_heal:MontaInfoOverHealing()
if (index == 1) then
barra.textura:SetValue (100)
else
barra.textura:SetValue (tabela[2]/max_*100) --> muito mais rapido...
barra.textura:SetValue (tabela[2]/max_*100)
end
barra.texto_esquerdo:SetText (index..instancia.divisores.colocacao..tabela[1]) --seta o texto da esqueda
barra.texto_direita:SetText (_detalhes:comma_value (tabela[2]) .." ".. instancia.divisores.abre .. _cstr ("%.1f", tabela[3]) .. instancia.divisores.fecha) --seta o texto da direita
barra.texto_esquerdo:SetWidth (barra:GetWidth() - barra.texto_direita:GetStringWidth() - 30)
-- o que mostrar no local do ícone?
--barra.icone:SetTexture (tabela[4][3])
-- icon
barra.icone:SetTexture ([[Interface\AddOns\Details\images\classes_small]])
local texCoords = _detalhes.class_coords [tabela[4]]
if (not texCoords) then
texCoords = _detalhes.class_coords ["UNKNOW"]
end
barra.icone:SetTexCoord (_unpack (texCoords))
barra.minha_tabela = self
barra.nome_inimigo = tabela [1]
@@ -1434,6 +1448,14 @@ function atributo_heal:MontaInfoHealingDone()
local minhas_curas = {}
local barras = info.barras1
--get time type
local meu_tempo
if (_detalhes.time_type == 1 or not self.grupo) then
meu_tempo = self:Tempo()
elseif (_detalhes.time_type == 2) then
meu_tempo = info.instancia.showing:GetCombatTime()
end
for spellid, tabela in _pairs (tabela) do
local nome, rank, icone = _GetSpellInfo (spellid)
_table_insert (minhas_curas, {spellid, tabela.total, tabela.total/total*100, nome, icone})
@@ -1458,7 +1480,11 @@ function atributo_heal:MontaInfoHealingDone()
self:FocusLock (barra, tabela[1])
self:UpdadeInfoBar (barra, index, tabela[1], tabela[4], tabela[2], max_, tabela[3], tabela[5], true)
if (info.sub_atributo == 2) then
self:UpdadeInfoBar (barra, index, tabela[1], tabela[4], tabela[2], _detalhes:comma_value (_math_floor (tabela[2]/meu_tempo)), max_, tabela[3], tabela[5], true)
else
self:UpdadeInfoBar (barra, index, tabela[1], tabela[4], tabela[2], _detalhes:comma_value (tabela[2]), max_, tabela[3], tabela[5], true)
end
barra.minha_tabela = self
barra.show = tabela[1]
@@ -1499,7 +1525,12 @@ function atributo_heal:MontaInfoHealingDone()
end
barra.texto_esquerdo:SetText (index..instancia.divisores.colocacao..tabela[1]) --seta o texto da esqueda
barra.texto_direita:SetText (_detalhes:comma_value (tabela[2]) .." ".. instancia.divisores.abre .. _cstr ("%.1f", tabela[3]) .. instancia.divisores.fecha) --seta o texto da direita
if (info.sub_atributo == 2) then
barra.texto_direita:SetText (_detalhes:comma_value (_math_floor (tabela[2]/meu_tempo)) .." ".. instancia.divisores.abre .. _cstr ("%.1f", tabela[3]) .. instancia.divisores.fecha) --seta o texto da direita
else
barra.texto_direita:SetText (_detalhes:comma_value (tabela[2]) .." ".. instancia.divisores.abre .. _cstr ("%.1f", tabela[3]) .. instancia.divisores.fecha) --seta o texto da direita
end
-- o que mostrar no local do ícone?
--barra.icone:SetTexture (tabela[4][3])
@@ -1540,11 +1571,10 @@ function atributo_heal:MontaTooltipAlvos (esta_barra, index)
end
end
else
for spellid, tabela in _pairs (container) do
--> tabela = classe_damage_habilidade
local alvos = tabela.targets._ActorTable
for _, tabela in _ipairs (alvos) do
--> tabela = classe_target
if (tabela.nome == inimigo) then
habilidades [#habilidades+1] = {spellid, tabela.total}
end
@@ -1555,17 +1585,40 @@ function atributo_heal:MontaTooltipAlvos (esta_barra, index)
_table_sort (habilidades, function (a, b) return a[2] > b[2] end)
GameTooltip:AddLine (index..". "..inimigo)
GameTooltip:AddLine (Loc ["STRING_HEALING_FROM"]..":") --> localize-me
GameTooltip:AddLine (" ")
--get time type
local meu_tempo
if (_detalhes.time_type == 1 or not self.grupo) then
meu_tempo = self:Tempo()
elseif (_detalhes.time_type == 2) then
meu_tempo = info.instancia.showing:GetCombatTime()
end
local is_hps = info.instancia.sub_atributo == 2
if (is_hps) then
GameTooltip:AddLine (index..". "..inimigo)
GameTooltip:AddLine (Loc ["STRING_HEALING_HPS_FROM"] .. ":")
GameTooltip:AddLine (" ")
else
GameTooltip:AddLine (index..". "..inimigo)
GameTooltip:AddLine (Loc ["STRING_HEALING_FROM"] .. ":")
GameTooltip:AddLine (" ")
end
for index, tabela in _ipairs (habilidades) do
local nome, rank, icone = _GetSpellInfo (tabela[1])
if (index < 8) then
GameTooltip:AddDoubleLine (index..". |T"..icone..":0|t "..nome, _detalhes:comma_value (tabela[2]).." (".. _cstr ("%.1f", tabela[2]/total*100).."%)", 1, 1, 1, 1, 1, 1)
--GameTooltip:AddTexture (icone)
if (is_hps) then
GameTooltip:AddDoubleLine (index..". |T"..icone..":0|t "..nome, _detalhes:comma_value (_math_floor (tabela[2]/meu_tempo)).." (".. _cstr ("%.1f", tabela[2]/total*100).."%)", 1, 1, 1, 1, 1, 1)
else
GameTooltip:AddDoubleLine (index..". |T"..icone..":0|t "..nome, _detalhes:comma_value (tabela[2]).." (".. _cstr ("%.1f", tabela[2]/total*100).."%)", 1, 1, 1, 1, 1, 1)
end
else
GameTooltip:AddDoubleLine (index..". "..nome, _detalhes:comma_value (tabela[2]).." (".. _cstr ("%.1f", tabela[2]/total*100).."%)", .65, .65, .65, .65, .65, .65)
if (is_hps) then
GameTooltip:AddDoubleLine (index..". "..nome, _detalhes:comma_value (_math_floor (tabela[2]/meu_tempo)).." (".. _cstr ("%.1f", tabela[2]/total*100).."%)", .65, .65, .65, .65, .65, .65)
else
GameTooltip:AddDoubleLine (index..". "..nome, _detalhes:comma_value (tabela[2]).." (".. _cstr ("%.1f", tabela[2]/total*100).."%)", .65, .65, .65, .65, .65, .65)
end
end
end
@@ -1676,7 +1729,7 @@ function atributo_heal:MontaDetalhesHealingDone (spellid, barra)
if (_detalhes.time_type == 1 or not self.grupo) then
meu_tempo = self:Tempo()
elseif (_detalhes.time_type == 2) then
meu_tempo = self:GetCombatTime()
meu_tempo = info.instancia.showing:GetCombatTime()
end
--local total_hits = esta_magia.counter
@@ -1863,11 +1916,7 @@ end
end
--> restaura e liga o ator com a sua shadow durante a inicialização
function atributo_heal:r_connect_shadow (actor)
if (not actor) then
actor = self
end
function atributo_heal:r_onlyrefresh_shadow (actor)
--> criar uma shadow desse ator se ainda não tiver uma
local overall_cura = _detalhes.tabela_overall [2]
@@ -1883,6 +1932,52 @@ end
--> restaura a meta e indexes ao ator
_detalhes.refresh:r_atributo_heal (actor, shadow)
--> copia o container de alvos (captura de dados)
for index, alvo in _ipairs (actor.targets._ActorTable) do
--> cria e soma o valor do total
local alvo_shadow = shadow.targets:PegarCombatente (nil, alvo.nome, nil, true)
--> refresh no alvo
_detalhes.refresh:r_alvo_da_habilidade (alvo, shadow.targets)
end
--> copia o container de habilidades (captura de dados)
for spellid, habilidade in _pairs (actor.spell_tables._ActorTable) do
--> cria e soma o valor
local habilidade_shadow = shadow.spell_tables:PegaHabilidade (spellid, true, nil, true)
--> refresh e soma os valores dos alvos
for index, alvo in _ipairs (habilidade.targets._ActorTable) do
--> cria e soma o valor do total
local alvo_shadow = habilidade_shadow.targets:PegarCombatente (nil, alvo.nome, nil, true)
--> refresh no alvo da habilidade
_detalhes.refresh:r_alvo_da_habilidade (alvo, habilidade_shadow.targets)
end
--> refresh na habilidade
_detalhes.refresh:r_habilidade_cura (habilidade, shadow.spell_tables)
end
return shadow
end
function atributo_heal:r_connect_shadow (actor, no_refresh)
--> criar uma shadow desse ator se ainda não tiver uma
local overall_cura = _detalhes.tabela_overall [2]
local shadow = overall_cura._ActorTable [overall_cura._NameIndexTable [actor.nome]]
if (not shadow) then
shadow = overall_cura:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true)
shadow.classe = actor.classe
shadow.grupo = actor.grupo
shadow.start_time = time() - 3
shadow.end_time = time()
end
--> restaura a meta e indexes ao ator
if (not no_refresh) then
_detalhes.refresh:r_atributo_heal (actor, shadow)
end
--> tempo decorrido (captura de dados)
if (actor.end_time) then
@@ -1932,7 +2027,9 @@ end
alvo_shadow.overheal = alvo_shadow.overheal + alvo.overheal
alvo_shadow.absorbed = alvo_shadow.absorbed + alvo.absorbed
--> refresh no alvo
_detalhes.refresh:r_alvo_da_habilidade (alvo, shadow.targets)
if (not no_refresh) then
_detalhes.refresh:r_alvo_da_habilidade (alvo, shadow.targets)
end
end
--> copia o container de habilidades (captura de dados)
@@ -1947,7 +2044,9 @@ end
alvo_shadow.overheal = alvo_shadow.overheal + alvo.overheal
alvo_shadow.absorbed = alvo_shadow.absorbed + alvo.absorbed
--> refresh no alvo da habilidade
_detalhes.refresh:r_alvo_da_habilidade (alvo, habilidade_shadow.targets)
if (not no_refresh) then
_detalhes.refresh:r_alvo_da_habilidade (alvo, habilidade_shadow.targets)
end
end
--> soma todos os demais valores
for key, value in _pairs (habilidade) do
@@ -1962,7 +2061,9 @@ end
end
--> refresh na habilidade
_detalhes.refresh:r_habilidade_cura (habilidade, shadow.spell_tables)
if (not no_refresh) then
_detalhes.refresh:r_habilidade_cura (habilidade, shadow.spell_tables)
end
end
return shadow
+1 -4
View File
@@ -109,10 +109,7 @@ function habilidade_cura:Add (serial, nome, flag, amount, who_nome, absorbed, cr
else
alvo:AddQuantidade (0)
end
if (self.shadow) then
return self.shadow:Add (serial, nome, flag, amount, who_nome, absorbed, critical, overhealing)
end
end
function _detalhes.refresh:r_habilidade_cura (habilidade, shadow)
+14
View File
@@ -1633,6 +1633,20 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini
_detalhes:SendEvent ("DETAILS_INSTANCE_CHANGEATTRIBUTE", nil, instancia, atributo, sub_atributo)
end
if (_detalhes.janela_info:IsShown() and instancia == _detalhes.janela_info.instancia) then
if (not instancia.showing) then
_detalhes:FechaJanelaInfo()
else
local actor = instancia.showing (instancia.atributo, _detalhes.janela_info.jogador.nome)
if (actor) then
instancia:AbreJanelaInfo (actor, true)
else
_detalhes:FechaJanelaInfo()
end
end
--_detalhes:FechaJanelaInfo()
end
if (not instancia.showing) then
if (not iniciando_instancia) then
instancia:Freeze()
+206 -8
View File
@@ -1895,11 +1895,8 @@ end
end
--> restaura e liga o ator com a sua shadow durante a inicialização
function atributo_misc:r_connect_shadow (actor)
if (not actor) then
actor = self
end
function atributo_misc:r_onlyrefresh_shadow (actor)
--> criar uma shadow desse ator se ainda não tiver uma
local overall_misc = _detalhes.tabela_overall [4]
@@ -1918,6 +1915,133 @@ end
--> aplica a meta e indexes
_detalhes.refresh:r_atributo_misc (actor, shadow)
--> somar os alvos do ator
local somar_alvos = function (container)
for index, alvo in _ipairs (actor [container]._ActorTable) do
--> cria e soma o valor do total
local alvo_shadow = shadow [container]:PegarCombatente (nil, alvo.nome, nil, true)
--> refresh no alvo
_detalhes.refresh:r_alvo_da_habilidade (alvo, shadow [container])
end
end
--> somar as habilidades do ator
local somar_habilidades = function (container, shadow)
for spellid, habilidade in _pairs (actor [container]._ActorTable) do
--> cria e soma o valor
local habilidade_shadow = shadow [container]:PegaHabilidade (spellid, true, nil, true)
--> refresh e soma os valores dos alvos
for index, alvo in _ipairs (habilidade.targets._ActorTable) do
--> cria e soma o valor do total
local alvo_shadow = habilidade_shadow.targets:PegarCombatente (nil, alvo.nome, nil, true)
--> refresh no alvo da habilidade
_detalhes.refresh:r_alvo_da_habilidade (alvo, habilidade_shadow.targets)
end
--> refresh na habilidade
_detalhes.refresh:r_habilidade_misc (habilidade, shadow [container])
end
end
--> cooldowns
if (actor.cooldowns_defensive) then
--> copia o container de alvos (captura de dados)
somar_alvos ("cooldowns_defensive_targets", shadow)
--> copia o container de habilidades (captura de dados)
somar_habilidades ("cooldowns_defensive_spell_tables", shadow)
end
--> buff uptime
if (actor.buff_uptime) then
--> copia o container de alvos (captura de dados)
somar_alvos ("buff_uptime_targets", shadow)
--> copia o container de habilidades (captura de dados)
somar_habilidades ("buff_uptime_spell_tables", shadow)
end
--> debuff uptime
if (actor.debuff_uptime) then
--> copia o container de alvos (captura de dados)
somar_alvos ("debuff_uptime_targets", shadow)
--> copia o container de habilidades (captura de dados)
somar_habilidades ("debuff_uptime_spell_tables", shadow)
end
--> interrupt
if (actor.interrupt) then
--> copia o container de alvos (captura de dados)
somar_alvos ("interrupt_targets", shadow)
--> copia o container de habilidades (captura de dados)
somar_habilidades ("interrupt_spell_tables", shadow)
--> copia o que cada habilidade interrompeu
for spellid, habilidade in _pairs (actor.interrupt_spell_tables._ActorTable) do
--> pega o actor da shadow
local habilidade_shadow = shadow.interrupt_spell_tables:PegaHabilidade (spellid, true, nil, true)
--> copia as habilidades interrompidas
habilidade_shadow.interrompeu_oque = habilidade_shadow.interrompeu_oque or {}
end
end
--> ress
if (actor.ress) then
--> copia o container de alvos (captura de dados)
somar_alvos ("ress_targets", shadow)
--> copia o container de habilidades (captura de dados)
somar_habilidades ("ress_spell_tables", shadow)
end
--> dispell
if (actor.dispell) then
--> copia o container de alvos (captura de dados)
somar_alvos ("dispell_targets", shadow)
--> copia o container de habilidades (captura de dados)
somar_habilidades ("dispell_spell_tables", shadow)
--> copia o que cada habilidade dispelou
for spellid, habilidade in _pairs (actor.dispell_spell_tables._ActorTable) do
--> pega o actor da shadow
local habilidade_shadow = shadow.dispell_spell_tables:PegaHabilidade (spellid, true, nil, true)
--> copia as habilidades dispeladas
habilidade_shadow.dispell_oque = habilidade_shadow.dispell_oque or {}
end
end
--> cc break
if (actor.cc_break) then
--> copia o container de alvos (captura de dados)
somar_alvos ("cc_break_targets", shadow)
--> copia o container de habilidades (captura de dados)
somar_habilidades ("cc_break_spell_tables", shadow)
--> copia o que cada habilidade quebrou
for spellid, habilidade in _pairs (actor.cc_break_spell_tables._ActorTable) do
--> pega o actor da shadow
local habilidade_shadow = shadow.cc_break_spell_tables:PegaHabilidade (spellid, true, nil, true)
--> copia as habilidades quebradas
habilidade_shadow.cc_break_oque = habilidade_shadow.cc_break_oque or {}
end
end
return shadow
end
function atributo_misc:r_connect_shadow (actor, no_refresh)
--> criar uma shadow desse ator se ainda não tiver uma
local overall_misc = _detalhes.tabela_overall [4]
local shadow = overall_misc._ActorTable [overall_misc._NameIndexTable [actor.nome]]
if (not actor.nome) then
actor.nome = "unknown"
end
if (not shadow) then
shadow = overall_misc:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true)
shadow.classe = actor.classe
shadow.grupo = actor.grupo
end
--> aplica a meta e indexes
if (not no_refresh) then
_detalhes.refresh:r_atributo_misc (actor, shadow)
end
--> somar as keys das habilidades
local somar_keys = function (habilidade, habilidade_shadow)
for key, value in _pairs (habilidade) do
@@ -1944,7 +2068,9 @@ end
end
--end
--> refresh no alvo
_detalhes.refresh:r_alvo_da_habilidade (alvo, shadow [container])
if (not no_refresh) then
_detalhes.refresh:r_alvo_da_habilidade (alvo, shadow [container])
end
end
end
@@ -1959,17 +2085,29 @@ end
local alvo_shadow = habilidade_shadow.targets:PegarCombatente (nil, alvo.nome, nil, true)
alvo_shadow.total = alvo_shadow.total + alvo.total
--> refresh no alvo da habilidade
_detalhes.refresh:r_alvo_da_habilidade (alvo, habilidade_shadow.targets)
if (not no_refresh) then
_detalhes.refresh:r_alvo_da_habilidade (alvo, habilidade_shadow.targets)
end
end
--> soma todos os demais valores
somar_keys (habilidade, habilidade_shadow)
--> refresh na habilidade
_detalhes.refresh:r_habilidade_misc (habilidade, shadow [container])
if (not no_refresh) then
_detalhes.refresh:r_habilidade_misc (habilidade, shadow [container])
end
end
end
--> cooldowns
if (actor.cooldowns_defensive) then
--> verifica se tem o container
if (not shadow.cooldowns_defensive_targets) then
shadow.cooldowns_defensive = 0
shadow.cooldowns_defensive_targets = container_combatentes:NovoContainer (container_damage_target)
shadow.cooldowns_defensive_spell_tables = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS)
end
--> soma o total (captura de dados)
shadow.cooldowns_defensive = shadow.cooldowns_defensive + actor.cooldowns_defensive
--> total no combate overall (captura de dados)
@@ -1985,6 +2123,14 @@ end
--> buff uptime
if (actor.buff_uptime) then
--> verifica se tem o container
if (not shadow.buff_uptime_spell_targets) then
shadow.buff_uptime = 0
shadow.buff_uptime_spell_targets = container_combatentes:NovoContainer (container_damage_target) --> pode ser um container de alvo de dano, pois irá usar apenas o .total
shadow.buff_uptime_spell_tables = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) --> cria o container das habilidades usadas para interromper
end
--> soma o total (captura de dados)
shadow.buff_uptime = shadow.buff_uptime + actor.buff_uptime
--> copia o container de alvos (captura de dados)
@@ -1995,6 +2141,23 @@ end
--> debuff uptime
if (actor.debuff_uptime) then
--> verifica se tem o container
if (not shadow.debuff_uptime_targets) then
shadow.debuff_uptime = 0
if (actor.boss_debuff) then
shadow.debuff_uptime_targets = container_combatentes:NovoContainer (_detalhes.container_type.CONTAINER_ENEMYDEBUFFTARGET_CLASS)
shadow.boss_debuff = true
shadow.damage_twin = actor.damage_twin
shadow.spellschool = actor.spellschool
shadow.damage_spellid = actor.damage_spellid
shadow.debuff_uptime = 0
else
shadow.debuff_uptime_targets = container_combatentes:NovoContainer (container_damage_target)
end
shadow.debuff_uptime_spell_tables = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS)
end
--> soma o total (captura de dados)
shadow.debuff_uptime = shadow.debuff_uptime + actor.debuff_uptime
--> copia o container de alvos (captura de dados)
@@ -2005,6 +2168,15 @@ end
--> interrupt
if (actor.interrupt) then
--verifica se tem o container
if (not shadow.interrupt_targets) then
shadow.interrupt = 0
shadow.interrupt_targets = container_combatentes:NovoContainer (container_damage_target) --> pode ser um container de alvo de dano, pois irá usar apenas o .total
shadow.interrupt_spell_tables = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) --> cria o container das habilidades usadas para interromper
shadow.interrompeu_oque = {}
end
--> soma o total (captura de dados)
shadow.interrupt = shadow.interrupt + actor.interrupt
--> total no combate overall (captura de dados)
@@ -2041,6 +2213,14 @@ end
--> ress
if (actor.ress) then
--> verifica se tem o container
if (not shadow.ress_targets) then
shadow.ress = 0
shadow.ress_targets = container_combatentes:NovoContainer (container_damage_target) --> pode ser um container de alvo de dano, pois irá usar apenas o .total
shadow.ress_spell_tables = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) --> cria o container das habilidades usadas para interromper
end
--> soma o total (captura de dados)
shadow.ress = shadow.ress + actor.ress
--> total no combate overall (captura de dados)
@@ -2056,6 +2236,15 @@ end
--> dispell
if (actor.dispell) then
--> verifica se tem o container
if (not shadow.dispell_targets) then
shadow.dispell = 0
shadow.dispell_targets = container_combatentes:NovoContainer (container_damage_target) --> pode ser um container de alvo de dano, pois irá usar apenas o .total
shadow.dispell_spell_tables = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) --> cria o container das habilidades usadas para interromper
shadow.dispell_oque = {}
end
--> soma o total (captura de dados)
shadow.dispell = shadow.dispell + actor.dispell
--> total no combate overall (captura de dados)
@@ -2092,6 +2281,15 @@ end
end
--> cc break
if (actor.cc_break) then
--> verifica se tem o container
if (not shadow.cc_break) then
shadow.cc_break = 0
shadow.cc_break_targets = container_combatentes:NovoContainer (container_damage_target) --> pode ser um container de alvo de dano, pois irá usar apenas o .total
shadow.cc_break_spell_tables = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) --> cria o container das habilidades usadas para interromper
shadow.cc_break_oque = {}
end
--> soma o total (captura de dados)
shadow.cc_break = shadow.cc_break + actor.cc_break
--> total no combate overall (captura de dados)
-24
View File
@@ -70,10 +70,6 @@ function habilidade_misc:Add (serial, nome, flag, who_nome, token, spellID, spel
self.actived_at = _detalhes._tempo
self.actived = true
if (self.shadow) then
return self.shadow:Add (serial, nome, flag, who_nome, token.shadow, spellID, spellName)
end
elseif (spellName == "BUFF_UPTIME_OUT") then
if (self.actived_at and self.actived) then
self.uptime = self.uptime + _detalhes._tempo - self.actived_at
@@ -82,10 +78,6 @@ function habilidade_misc:Add (serial, nome, flag, who_nome, token, spellID, spel
self.actived = false
self.actived_at = nil
if (self.shadow) then
return self.shadow:Add (serial, nome, flag, who_nome, token.shadow, spellID, spellName)
end
elseif (spellName == "BUFF_UPTIME_IN" or spellName == "DEBUFF_UPTIME_IN") then
self.actived = true
self.activedamt = self.activedamt + 1
@@ -98,10 +90,6 @@ function habilidade_misc:Add (serial, nome, flag, who_nome, token, spellID, spel
self.actived_at = _detalhes._tempo
if (self.shadow) then
return self.shadow:Add (serial, nome, flag, who_nome, token.shadow, spellID, spellName)
end
elseif (spellName == "DEBUFF_UPTIME_REFRESH") then
if (self.actived_at and self.actived) then
self.uptime = self.uptime + _detalhes._tempo - self.actived_at
@@ -109,10 +97,6 @@ function habilidade_misc:Add (serial, nome, flag, who_nome, token, spellID, spel
end
self.actived_at = _detalhes._tempo
self.actived = true
if (self.shadow) then
return self.shadow:Add (serial, nome, flag, who_nome, token.shadow, spellID, spellName)
end
elseif (spellName == "DEBUFF_UPTIME_OUT") then
if (self.actived_at and self.actived) then
@@ -128,10 +112,6 @@ function habilidade_misc:Add (serial, nome, flag, who_nome, token, spellID, spel
else
self.actived_at = _detalhes._tempo
end
if (self.shadow) then
return self.shadow:Add (serial, nome, flag, who_nome, token.shadow, spellID, spellName)
end
end
@@ -217,10 +197,6 @@ function habilidade_misc:Add (serial, nome, flag, who_nome, token, spellID, spel
alvo.total = alvo.total + 1
end
if (self.shadow) then
return self.shadow:Add (serial, nome, flag, who_nome, token, spellID, spellName)
end
end
--> habilidade atual e o container de habilidades da shadow
+12 -30
View File
@@ -44,6 +44,7 @@ local OBJECT_TYPE_PET = 0x00001000
local OBJECT_TYPE_NPC = 0x00000800
local OBJECT_TYPE_PLAYER = 0x00000400
local OBJECT_TYPE_PETS = OBJECT_TYPE_PET + OBJECT_TYPE_GUARDIAN
local EM_GRUPO = 0x00000007
local REACTION_HOSTILE = COMBATLOG_OBJECT_REACTION_HOSTILE or 0x00000040
@@ -66,8 +67,7 @@ function container_combatentes:NovoContainer (tipo_do_container, combatTable, co
return _newContainer
end
local function get_class_ (novo_objeto, nome, flag)
local function get_actor_class (novo_objeto, nome, flag)
local _, engClass = _UnitClass (nome)
if (engClass) then
@@ -75,14 +75,11 @@ local function get_class_ (novo_objeto, nome, flag)
return
else
if (flag) then
--print ("tem flag: " .. flag)
--> conferir se o jogador é um player
if (_bit_band (flag, OBJECT_TYPE_PLAYER) ~= 0) then
--print ("eh um player sem grupo: "..novo_objeto.nome)
novo_objeto.classe = "UNGROUPPLAYER"
return
elseif (_bit_band (flag, OBJECT_TYPE_PETGUARDIAN) ~= 0) then
--print ("eh um pet: "..novo_objeto.nome)
novo_objeto.classe = "PET"
return
end
@@ -92,21 +89,6 @@ local function get_class_ (novo_objeto, nome, flag)
end
end
local EM_GRUPO = 0x00000007
function container_combatentes:Dupe (who)
local novo_objeto = {}
if (_getmetatable (who)) then
_setmetatable (novo_objeto, _getmetatable (who))
end
for cprop, value in _pairs (who) do
novo_objeto[cprop] = value
end
return novo_objeto
end
function container_combatentes:GetAmount (actorName, key)
key = key or "total"
local index = self._NameIndexTable [actorName]
@@ -117,7 +99,7 @@ function container_combatentes:GetAmount (actorName, key)
end
end
local read_flag_ = function (novo_objeto, shadow_objeto, dono_do_pet, serial, flag, nome)
local read_actor_flag = function (novo_objeto, shadow_objeto, dono_do_pet, serial, flag, nome)
-- converte a flag do wow em flag do details
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -261,8 +243,8 @@ function container_combatentes:PegarCombatente (serial, nome, flag, criar, isOwn
if (self.tipo == container_damage) then --> CONTAINER DAMAGE
get_class_ (novo_objeto, nome, flag)
read_flag_ (novo_objeto, shadow_objeto, dono_do_pet, serial, flag, nome)
get_actor_class (novo_objeto, nome, flag)
read_actor_flag (novo_objeto, shadow_objeto, dono_do_pet, serial, flag, nome)
if (dono_do_pet) then
dono_do_pet.pets [#dono_do_pet.pets+1] = nome
@@ -294,8 +276,8 @@ function container_combatentes:PegarCombatente (serial, nome, flag, criar, isOwn
elseif (self.tipo == container_heal) then --> CONTAINER HEALING
get_class_ (novo_objeto, nome, flag)
read_flag_ (novo_objeto, shadow_objeto, dono_do_pet, serial, flag, nome)
get_actor_class (novo_objeto, nome, flag)
read_actor_flag (novo_objeto, shadow_objeto, dono_do_pet, serial, flag, nome)
if (dono_do_pet) then
dono_do_pet.pets [#dono_do_pet.pets+1] = nome
@@ -324,8 +306,8 @@ function container_combatentes:PegarCombatente (serial, nome, flag, criar, isOwn
elseif (self.tipo == container_energy) then --> CONTAINER ENERGY
get_class_ (novo_objeto, nome, flag)
read_flag_ (novo_objeto, shadow_objeto, dono_do_pet, serial, flag, nome)
get_actor_class (novo_objeto, nome, flag)
read_actor_flag (novo_objeto, shadow_objeto, dono_do_pet, serial, flag, nome)
if (dono_do_pet) then
dono_do_pet.pets [#dono_do_pet.pets+1] = nome
@@ -350,8 +332,8 @@ function container_combatentes:PegarCombatente (serial, nome, flag, criar, isOwn
elseif (self.tipo == container_misc) then --> CONTAINER MISC
get_class_ (novo_objeto, nome, flag)
read_flag_ (novo_objeto, shadow_objeto, dono_do_pet, serial, flag, nome)
get_actor_class (novo_objeto, nome, flag)
read_actor_flag (novo_objeto, shadow_objeto, dono_do_pet, serial, flag, nome)
--local teste_classe =
@@ -420,7 +402,7 @@ function container_combatentes:PegarCombatente (serial, nome, flag, criar, isOwn
elseif (self.tipo == container_friendlyfire) then --> CONTAINER FRIENDLY FIRE
get_class_ (novo_objeto, nome)
get_actor_class (novo_objeto, nome)
if (shadow_objeto) then
novo_objeto.shadow = shadow_objeto
+160 -37
View File
@@ -1,3 +1,5 @@
local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" )
--lua api
local _table_remove = table.remove
local _table_insert = table.insert
@@ -19,6 +21,29 @@ function historico:NovoHistorico()
return esta_tabela
end
function historico:adicionar_overall (tabela)
if (_detalhes.overall_clear_newboss) then
if (tabela.instance_type == "raid" and tabela.is_boss) then
if (_detalhes.last_encounter ~= _detalhes.last_encounter2) then
for index, combat in ipairs (_detalhes.tabela_historico.tabelas) do
combat.overall_added = false
end
historico:resetar_overall()
end
end
end
_detalhes.tabela_overall = _detalhes.tabela_overall + tabela
tabela.overall_added = true
if (_detalhes.tabela_overall.start_time == 0) then
_detalhes.tabela_overall.start_time = tabela.start_time
_detalhes.tabela_overall.end_time = tabela.end_time
end
_detalhes:ClockPluginTickOnSegment()
end
--> sai do combate, chamou adicionar a tabela ao histórico
function historico:adicionar (tabela)
@@ -37,12 +62,60 @@ function historico:adicionar (tabela)
--> adiciona no index #1
_table_insert (self.tabelas, 1, tabela)
local overall_added = false
if (not overall_added and bit.band (_detalhes.overall_flag, 0x1) ~= 0) then --> raid boss - flag 0x1
if (tabela.is_boss and tabela.instance_type == "raid" and not tabela.is_pvp) then
overall_added = true
end
--print ("0x1")
end
if (not overall_added and bit.band (_detalhes.overall_flag, 0x2) ~= 0) then --> raid trash - flag 0x2
if (tabela.is_trash and tabela.instance_type == "raid") then --check if the player is in a raid
overall_added = true
end
--print ("0x2")
end
if (not overall_added and bit.band (_detalhes.overall_flag, 0x4) ~= 0) then --> dungeon boss - flag 0x4
if (tabela.is_boss and tabela.instance_type == "party" and not tabela.is_pvp) then --check if this is a dungeon boss
overall_added = true
end
--print ("0x4")
end
if (not overall_added and bit.band (_detalhes.overall_flag, 0x8) ~= 0) then --> dungeon trash - flag 0x8
if (tabela.is_trash and tabela.instance_type == "party") then --check if the player is in a raid
overall_added = true
end
--print ("0x8")
end
if (not overall_added and bit.band (_detalhes.overall_flag, 0x10) ~= 0) then --> any combat
overall_added = true
--print ("0x10")
end
if (overall_added) then
if (_detalhes.debug) then
_detalhes:Msg ("(debug) overall data flag match with the current combat.")
end
if (InCombatLockdown()) then
_detalhes.schedule_add_to_overall = true
if (_detalhes.debug) then
_detalhes:Msg ("(debug) player is in combat, scheduling overall addition.")
end
else
historico:adicionar_overall (tabela)
end
end
if (self.tabelas[2]) then
--> fazer limpeza na tabela
local _segundo_combate = self.tabelas[2]
local _terceiro_combate = self.tabelas[3]
local container_damage = _segundo_combate [1]
local container_heal = _segundo_combate [2]
@@ -65,9 +138,16 @@ function historico:adicionar (tabela)
end
if (_detalhes.trash_auto_remove) then
local _terceiro_combate = self.tabelas[3]
if (_terceiro_combate) then
if (_terceiro_combate.is_trash and not _terceiro_combate.is_boss) then
_detalhes.tabela_overall = _detalhes.tabela_overall - _terceiro_combate
--if (_terceiro_combate.overall_added) then
-- _detalhes.tabela_overall = _detalhes.tabela_overall - _terceiro_combate
-- print ("removendo combate 1")
--end
--> verificar novamente a time machine
for _, jogador in ipairs (_terceiro_combate [1]._ActorTable) do --> damage
if (jogador.timeMachine) then
@@ -83,53 +163,23 @@ function historico:adicionar (tabela)
_table_remove (self.tabelas, 3)
_detalhes:SendEvent ("DETAILS_DATA_SEGMENTREMOVED", nil, nil)
end
end
elseif (_detalhes.trash_concatenate) then
if (_terceiro_combate) then
if (_terceiro_combate.is_trash and _segundo_combate.is_trash and not _terceiro_combate.is_boss and not _segundo_combate.is_boss) then
--> tabela 2 deve ser deletada e somada a tabela 1
if (_detalhes.debug) then
detalhes:Msg ("(debug) concatenating two trash segments.")
end
_segundo_combate = _segundo_combate + _terceiro_combate
_detalhes.tabela_overall = _detalhes.tabela_overall - _terceiro_combate
_segundo_combate.is_trash = true
--> verificar novamente a time machine
for _, jogador in ipairs (_terceiro_combate [1]._ActorTable) do --> damage
if (jogador.timeMachine) then
jogador:DesregistrarNaTimeMachine()
end
end
for _, jogador in ipairs (_terceiro_combate [2]._ActorTable) do --> heal
if (jogador.timeMachine) then
jogador:DesregistrarNaTimeMachine()
end
end
--> remover
_table_remove (self.tabelas, 3)
_detalhes:SendEvent ("DETAILS_DATA_SEGMENTREMOVED", nil, nil)
end
end
end
end
--> chama a função que irá atualizar as instâncias com segmentos no histórico
_detalhes:InstanciaCallFunction (_detalhes.AtualizaSegmentos_AfterCombat, self)
--> verifica se precisa apagar a última tabela do histórico
if (#self.tabelas > _detalhes.segments_amount) then
local combat_removed = self.tabelas [#self.tabelas]
--> diminuir quantidades no overall
_detalhes.tabela_overall = _detalhes.tabela_overall - combat_removed
--_detalhes.tabela_overall.start_time = _detalhes.tabela_overall.start_time + (combat_removed.end_time-combat_removed.start_time)
--if (combat_removed.overall_added) then
-- _detalhes.tabela_overall = _detalhes.tabela_overall - combat_removed
-- print ("removendo combate 2")
--end
--> verificar novamente a time machine
for _, jogador in ipairs (combat_removed [1]._ActorTable) do --> damage
@@ -149,6 +199,9 @@ function historico:adicionar (tabela)
end
--> chama a função que irá atualizar as instâncias com segmentos no histórico
_detalhes:InstanciaCallFunction (_detalhes.AtualizaSegmentos_AfterCombat, self)
_detalhes:InstanciaCallFunction (_detalhes.AtualizarJanela)
end
@@ -162,6 +215,39 @@ function _detalhes:CheckFreeze (instancia, index_liberado, tabela)
end
end
function _detalhes:OverallOptions (reset_new_boss, reset_new_challenge)
if (reset_new_boss == nil) then
reset_new_boss = _detalhes.overall_clear_newboss
end
if (reset_new_challenge == nil) then
reset_new_challenge = _detalhes.overall_clear_newchallenge
end
_detalhes.overall_clear_newboss = reset_new_boss
_detalhes.overall_clear_newchallenge = reset_new_challenge
end
function historico:resetar_overall()
if (InCombatLockdown()) then
_detalhes:Msg (Loc ["STRING_ERASE_IN_COMBAT"])
_detalhes.schedule_remove_overall = true
else
--> fecha a janela de informações do jogador
_detalhes:FechaJanelaInfo()
_detalhes.tabela_overall = combate:NovaTabela()
for index, instancia in ipairs (_detalhes.tabela_instancias) do
if (instancia.ativa and instancia.segmento == -1) then
instancia:InstanceReset()
instancia:ReajustaGump()
end
end
end
_detalhes:ClockPluginTickOnSegment()
end
function historico:resetar()
if (_detalhes.bosswindow) then
@@ -228,3 +314,40 @@ function _detalhes.refresh:r_historico (este_historico)
_setmetatable (este_historico, historico)
--este_historico.__index = historico
end
--[[
elseif (_detalhes.trash_concatenate) then
if (true) then
return
end
if (_terceiro_combate) then
if (_terceiro_combate.is_trash and _segundo_combate.is_trash and not _terceiro_combate.is_boss and not _segundo_combate.is_boss) then
--> tabela 2 deve ser deletada e somada a tabela 1
if (_detalhes.debug) then
detalhes:Msg ("(debug) concatenating two trash segments.")
end
_segundo_combate = _segundo_combate + _terceiro_combate
_detalhes.tabela_overall = _detalhes.tabela_overall - _terceiro_combate
_segundo_combate.is_trash = true
--> verificar novamente a time machine
for _, jogador in ipairs (_terceiro_combate [1]._ActorTable) do --> damage
if (jogador.timeMachine) then
jogador:DesregistrarNaTimeMachine()
end
end
for _, jogador in ipairs (_terceiro_combate [2]._ActorTable) do --> heal
if (jogador.timeMachine) then
jogador:DesregistrarNaTimeMachine()
end
end
--> remover
_table_remove (self.tabelas, 3)
_detalhes:SendEvent ("DETAILS_DATA_SEGMENTREMOVED", nil, nil)
end
end
--]]