diff --git a/boot.lua b/boot.lua index 0d2dfc31..b9116365 100644 --- a/boot.lua +++ b/boot.lua @@ -73,6 +73,7 @@ Details222.MythicPlus = {} Details222.EJCache = {} Details222.Segments = {} + Details222.Tables = {} ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --initialization stuff @@ -1074,4 +1075,10 @@ Details222.UnitIdCache.Party = { [2] = "party2", [3] = "party3", [4] = "party4", -} \ No newline at end of file +} + +function Details222.Tables.MakeWeakTable(mode) + local newTable = {} + setmetatable(newTable, {__mode = mode or "v"}) + return newTable +end \ No newline at end of file diff --git a/classes/class_spelldamage.lua b/classes/class_spelldamage.lua index 5f652026..ce4133af 100644 --- a/classes/class_spelldamage.lua +++ b/classes/class_spelldamage.lua @@ -22,6 +22,11 @@ return habilidade_dano:NovaTabela(spellId, nil, cleuToken) end + --cleu token is used to check if the spell is a dot + function Details.CreateSpellTable(spellId, cleuToken) + return habilidade_dano:NovaTabela(spellId, nil, cleuToken) + end + function habilidade_dano:NovaTabela(id, link, token) local _newDamageSpell = { total = 0, --total damage diff --git a/classes/class_spellutility.lua b/classes/class_spellutility.lua index 46855cb4..b25240f5 100644 --- a/classes/class_spellutility.lua +++ b/classes/class_spellutility.lua @@ -29,115 +29,117 @@ counter = 0, targets = {} } - + if (token == "BUFF_UPTIME" or token == "DEBUFF_UPTIME") then _newMiscSpell.uptime = 0 _newMiscSpell.actived = false _newMiscSpell.activedamt = 0 --s�o quantos estao ativados no momento _newMiscSpell.refreshamt = 0 _newMiscSpell.appliedamt = 0 - + elseif (token == "SPELL_INTERRUPT") then _newMiscSpell.interrompeu_oque = {} - + elseif (token == "SPELL_DISPEL" or token == "SPELL_STOLEN") then _newMiscSpell.dispell_oque = {} - + elseif (token == "SPELL_AURA_BROKEN" or token == "SPELL_AURA_BROKEN_SPELL") then _newMiscSpell.cc_break_oque = {} - - end - + + end + return _newMiscSpell end function habilidade_misc:Add (serial, nome, flag, who_nome, token, spellID, spellName) + local actorUtilityObject = token - --print(self.id, GetSpellInfo(self.id)) - if (spellID == "BUFF_OR_DEBUFF") then - - if (spellName == "COOLDOWN") then + local parserToken = spellName + if (parserToken == "COOLDOWN") then self.counter = self.counter + 1 --target self.targets [nome] = (self.targets [nome] or 0) + 1 - - elseif (spellName == "BUFF_UPTIME_REFRESH") then + + elseif (parserToken == "BUFF_UPTIME_REFRESH") then if (self.actived_at and self.actived) then self.uptime = self.uptime + _detalhes._tempo - self.actived_at self.refreshamt = self.refreshamt + 1 - token.buff_uptime = token.buff_uptime + _detalhes._tempo - self.actived_at --token = actor misc object - end - self.actived_at = _detalhes._tempo - self.actived = true - - elseif (spellName == "BUFF_UPTIME_OUT") then - if (self.actived_at and self.actived) then - self.uptime = self.uptime + _detalhes._tempo - self.actived_at - token.buff_uptime = token.buff_uptime + _detalhes._tempo - self.actived_at --token = actor misc object - end - self.actived = false - self.actived_at = nil - - elseif (spellName == "BUFF_UPTIME_IN" or spellName == "DEBUFF_UPTIME_IN") then - self.actived = true - self.activedamt = self.activedamt + 1 - self.appliedamt = self.appliedamt + 1 - - if (self.actived_at and self.actived and spellName == "DEBUFF_UPTIME_IN") then - --ja esta ativo em outro mob e jogou num novo - self.uptime = self.uptime + _detalhes._tempo - self.actived_at - token.debuff_uptime = token.debuff_uptime + _detalhes._tempo - self.actived_at - end - - self.actived_at = _detalhes._tempo - - elseif (spellName == "DEBUFF_UPTIME_REFRESH") then - if (self.actived_at and self.actived) then - self.uptime = self.uptime + _detalhes._tempo - self.actived_at - self.refreshamt = self.refreshamt + 1 - token.debuff_uptime = token.debuff_uptime + _detalhes._tempo - self.actived_at + actorUtilityObject.buff_uptime = actorUtilityObject.buff_uptime + _detalhes._tempo - self.actived_at end self.actived_at = _detalhes._tempo self.actived = true - elseif (spellName == "DEBUFF_UPTIME_OUT") then + elseif (parserToken == "BUFF_UPTIME_OUT") then if (self.actived_at and self.actived) then self.uptime = self.uptime + _detalhes._tempo - self.actived_at - token.debuff_uptime = token.debuff_uptime + _detalhes._tempo - self.actived_at --token = actor misc object + actorUtilityObject.buff_uptime = actorUtilityObject.buff_uptime + _detalhes._tempo - self.actived_at end - + self.actived = false + self.actived_at = nil + + elseif (parserToken == "BUFF_UPTIME_IN" or parserToken == "DEBUFF_UPTIME_IN") then + self.actived = true + self.activedamt = self.activedamt + 1 + self.appliedamt = self.appliedamt + 1 + + if (self.actived_at and self.actived and parserToken == "DEBUFF_UPTIME_IN") then + --ja esta ativo em outro mob e jogou num novo + self.uptime = self.uptime + _detalhes._tempo - self.actived_at + actorUtilityObject.debuff_uptime = actorUtilityObject.debuff_uptime + _detalhes._tempo - self.actived_at + end + + self.actived_at = _detalhes._tempo + + if (not self.uptime) then + self.uptime = 0 + end + + elseif (parserToken == "DEBUFF_UPTIME_REFRESH") then + if (self.actived_at and self.actived) then + self.uptime = self.uptime + _detalhes._tempo - self.actived_at + self.refreshamt = self.refreshamt + 1 + actorUtilityObject.debuff_uptime = actorUtilityObject.debuff_uptime + _detalhes._tempo - self.actived_at + end + self.actived_at = _detalhes._tempo + self.actived = true + + elseif (parserToken == "DEBUFF_UPTIME_OUT") then + if (self.actived_at and self.actived) then + self.uptime = self.uptime + _detalhes._tempo - self.actived_at + actorUtilityObject.debuff_uptime = actorUtilityObject.debuff_uptime + _detalhes._tempo - self.actived_at + end + self.activedamt = self.activedamt - 1 - + if (self.activedamt == 0) then self.actived = false self.actived_at = nil else self.actived_at = _detalhes._tempo end - end - + elseif (token == "SPELL_INTERRUPT") then self.counter = self.counter + 1 - - if (not self.interrompeu_oque [spellID]) then + + if (not self.interrompeu_oque [spellID]) then self.interrompeu_oque [spellID] = 1 else self.interrompeu_oque [spellID] = self.interrompeu_oque [spellID] + 1 end - + --target self.targets [nome] = (self.targets [nome] or 0) + 1 - + elseif (token == "SPELL_RESURRECT") then self.ress = (self.ress or 0) + 1 --target - self.targets [nome] = (self.targets [nome] or 0) + 1 - + self.targets [nome] = (self.targets [nome] or 0) + 1 + elseif (token == "SPELL_DISPEL" or token == "SPELL_STOLEN") then self.dispell = (self.dispell or 0) + 1 - + if (not self.dispell_oque [spellID]) then self.dispell_oque [spellID] = 1 else @@ -145,19 +147,18 @@ end --target - self.targets [nome] = (self.targets [nome] or 0) + 1 - + self.targets [nome] = (self.targets [nome] or 0) + 1 + elseif (token == "SPELL_AURA_BROKEN_SPELL" or token == "SPELL_AURA_BROKEN") then self.cc_break = (self.cc_break or 0) + 1 - + if (not self.cc_break_oque [spellID]) then self.cc_break_oque [spellID] = 1 else self.cc_break_oque [spellID] = self.cc_break_oque [spellID] + 1 end - - --target - self.targets [nome] = (self.targets [nome] or 0) + 1 - end - end + --target + self.targets [nome] = (self.targets [nome] or 0) + 1 + end + end \ No newline at end of file diff --git a/classes/class_utility.lua b/classes/class_utility.lua index 8a7b5b27..9c8d72a8 100644 --- a/classes/class_utility.lua +++ b/classes/class_utility.lua @@ -131,32 +131,40 @@ function _detalhes:ContainerSortMisc(container, amount, keyName2) end end ---[[exported]] function _detalhes:GetSpellCastAmount (combat, actorName, spellId) - local misc_actor = combat:GetActor(4, actorName) - if (misc_actor) then - local spell_cast = misc_actor.spell_cast and misc_actor.spell_cast [spellId] - - --try to find a spell with the same name and get the amount of casts of that spell object - if (not spell_cast and misc_actor.spell_cast) then - local spellname = GetSpellInfo(spellId) - for casted_spellid, amount in pairs(misc_actor.spell_cast) do - local casted_spellname = GetSpellInfo(casted_spellid) - if (casted_spellname == spellname) then - return amount, true +--[[exported]] function _detalhes:GetSpellCastAmount(combat, actorName, spellId) + local actorUtilityObject = combat:GetActor(4, actorName) + if (actorUtilityObject) then + local castAmountTable = actorUtilityObject.spell_cast + if (castAmountTable) then + local castAmount = castAmountTable[spellId] + if (castAmount) then + return castAmount + + elseif (not castAmount) then + --if the amount of casts is not found, attempt to find a spell with the same name and get the amount of casts of that spell instead + local spellName = GetSpellInfo(spellId) + for thisSpellId, thisCastAmount in pairs(castAmountTable) do + local thisSpellName = GetSpellInfo(thisSpellId) + if (thisSpellName == spellName and thisCastAmount and thisCastAmount > 0) then + return thisCastAmount + end end end end - - if (not spell_cast) then - return false - end - - return spell_cast + end + + return 0 +end + +--[[exported]] function Details:GetSpellTableFromContainer(spellContainerName, spellId) + local spellContainer = self[spellContainerName] + if (spellContainer) then + local spellTable = spellContainer._ActorTable[spellId] + return spellTable end end function atributo_misc:NovaTabela(serial, nome, link) - local newActor = { last_event = 0, tipo = class_type, @@ -380,7 +388,6 @@ end local report_table = {} local ReportSingleDeathFunc = function(IsCurrent, IsReverse, AmtLines) - AmtLines = AmtLines + 1 local t = {} @@ -388,22 +395,20 @@ local ReportSingleDeathFunc = function(IsCurrent, IsReverse, AmtLines) local table = report_table [i] t [#t+1] = table [1] .. table [4] .. table [2] .. table [3] end - + local title = tremove(t, 1) t = _detalhes.table.reverse (t) tinsert(t, 1, title) - + _detalhes:SendReportLines (t) - end function atributo_misc:ReportSingleDeadLine (morte, instancia) - local barra = instancia.barras [morte.minha_barra] - + local max_health = morte [5] local time_of_death = morte [2] - + do if (not _detalhes.fontstring_len) then _detalhes.fontstring_len = _detalhes.listener:CreateFontString(nil, "background", "GameFontNormal") @@ -417,18 +422,18 @@ function atributo_misc:ReportSingleDeadLine (morte, instancia) _detalhes.fontstring_len:SetText("thisisspacement") end local default_len = _detalhes.fontstring_len:GetStringWidth() - + wipe (report_table) local report_array = report_table report_array[1] = {"Details! " .. Loc ["STRING_REPORT_SINGLE_DEATH"] .. " " .. morte [3] .. " " .. Loc ["STRING_ACTORFRAME_REPORTAT"] .. " " .. morte [6], "", "", ""} - + for index, evento in ipairs(_detalhes.table.reverse (morte [1])) do if (evento [1] and type(evento [1]) == "boolean") then --damage if (evento [3]) then local elapsed = _cstr ("%.1f", evento [4] - time_of_death) .."s" local spellname, _, spellicon = _GetSpellInfo(evento [2]) local spelllink - + if (evento [2] == 1) then spelllink = GetSpellLink(6603) elseif (evento [2] > 10) then @@ -436,29 +441,29 @@ function atributo_misc:ReportSingleDeadLine (morte, instancia) else spelllink = spellname end - + local source = _detalhes:GetOnlyName(evento [6]) local amount = evento [3] local hp = _math_floor(evento [5] / max_health * 100) - if (hp > 100) then + if (hp > 100) then hp = 100 end - + tinsert(report_array, {elapsed .. " ", spelllink, " (" .. source .. ")", "-" .. _detalhes:ToK (amount) .. " (" .. hp .. "%) "}) end - + elseif (not evento [1] and type(evento [1]) == "boolean") then --heal - + local amount = evento [3] - + if (amount > _detalhes.deathlog_healingdone_min) then local elapsed = _cstr ("%.1f", evento [4] - time_of_death) .."s" local spelllink = GetSpellLink(evento [2]) local source = _detalhes:GetOnlyName(evento [6]) local spellname, _, spellicon = _GetSpellInfo(evento [2]) - + local hp = _math_floor(evento [5] / max_health * 100) - if (hp > 100) then + if (hp > 100) then hp = 100 end @@ -468,28 +473,27 @@ function atributo_misc:ReportSingleDeadLine (morte, instancia) tinsert(report_array, {elapsed .. " ", spellname, " (" .. source .. ")", "+" .. _detalhes:ToK (amount) .. " (" .. hp .. "%) "}) end end - + elseif (type(evento [1]) == "number" and evento [1] == 4) then --debuff - + local elapsed = _cstr ("%.1f", evento [4] - time_of_death) .."s" local spelllink = GetSpellLink(evento [2]) local source = _detalhes:GetOnlyName(evento [6]) local spellname, _, spellicon = _GetSpellInfo(evento [2]) local stacks = evento [3] local hp = _math_floor(evento [5] / max_health * 100) - if (hp > 100) then + if (hp > 100) then hp = 100 end tinsert(report_array, {elapsed .. " ", "x" .. stacks .. "" .. spelllink, " (" .. source .. ")", "(" .. hp .. "%) "}) end end - + _detalhes:SendReportWindow (ReportSingleDeathFunc, nil, nil, true) end function atributo_misc:ReportSingleCooldownLine (misc_actor, instancia) - local reportar if (instancia.segmento == -1) then --overall @@ -497,29 +501,28 @@ function atributo_misc:ReportSingleCooldownLine (misc_actor, instancia) else reportar = {"Details!: " .. misc_actor.nome .. " - " .. Loc ["STRING_ATTRIBUTE_MISC_DEFENSIVE_COOLDOWNS"]} end - + local meu_total = _math_floor(misc_actor.cooldowns_defensive) local cooldowns = misc_actor.cooldowns_defensive_spells._ActorTable local cooldowns_used = {} - + for spellid, spell in pairs(cooldowns) do cooldowns_used [#cooldowns_used+1] = {spellid, spell.counter, spell} end table.sort (cooldowns_used, _detalhes.Sort2) for i, spell in ipairs(cooldowns_used) do - + local spelllink = GetSpellLink(spell [1]) reportar [#reportar+1] = spelllink .. ": " .. spell [2] - + for target_name, amount in pairs(spell[3].targets) do if (target_name ~= misc_actor.nome and target_name ~= Loc ["STRING_RAID_WIDE"] and amount > 0) then reportar [#reportar+1] = " -" .. target_name .. ": " .. amount end end - - end + end return _detalhes:Reportar (reportar, {_no_current = true, _no_inverse = true, _custom = true}) end @@ -529,21 +532,23 @@ local buff_format_name = function(spellid) end return _detalhes:GetSpellLink(spellid) end + local buff_format_amount = function(t) local total, percent = unpack(t) local m, s = _math_floor(total / 60), _math_floor(total % 60) return _cstr ("%.1f", percent) .. "% (" .. m .. "m " .. s .. "s)" end + local sort_buff_report = function(t1, t2) return t1[2][1] > t2[2][1] end function atributo_misc:ReportSingleBuffUptimeLine (misc_actor, instance) local report_table = {"Details!: " .. misc_actor.nome .. " - " .. Loc ["STRING_ATTRIBUTE_MISC_BUFF_UPTIME"]} - + local buffs = {} local combat_time = instance.showing:GetCombatTime() - + for spellid, spell in pairs(misc_actor.buff_uptime_spells._ActorTable) do local percent = spell.uptime / combat_time * 100 if (percent < 99.5) then @@ -561,7 +566,7 @@ function atributo_misc:ReportSingleDebuffUptimeLine (misc_actor, instance) local debuffs = {} local combat_time = instance.showing:GetCombatTime() - + for spellid, spell in pairs(misc_actor.debuff_uptime_spells._ActorTable) do local percent = spell.uptime / combat_time * 100 debuffs [#debuffs+1] = {spellid, {spell.uptime, percent}} @@ -570,46 +575,46 @@ function atributo_misc:ReportSingleDebuffUptimeLine (misc_actor, instance) table.sort (debuffs, sort_buff_report) _detalhes:FormatReportLines (report_table, debuffs, buff_format_name, buff_format_amount) - return _detalhes:Reportar (report_table, {_no_current = true, _no_inverse = true, _custom = true}) + return _detalhes:Reportar (report_table, {_no_current = true, _no_inverse = true, _custom = true}) end function atributo_misc:DeadAtualizarBarra (morte, whichRowLine, colocacao, instancia) - + morte ["dead"] = true --marca que esta tabela � uma tabela de mortes, usado no controla na hora de montar o tooltip local esta_barra = instancia.barras[whichRowLine] --pega a refer�ncia da barra na janela - + if (not esta_barra) then print("DEBUG: problema com "..whichRowLine.." "..lugar) return end - + local tabela_anterior = esta_barra.minha_tabela - + esta_barra.minha_tabela = morte - + morte.nome = morte [3] --evita dar erro ao redimencionar a janela morte.minha_barra = whichRowLine esta_barra.colocacao = colocacao - - if (not getmetatable(morte)) then - setmetatable(morte, {__call = RefreshBarraMorte}) + + if (not getmetatable(morte)) then + setmetatable(morte, {__call = RefreshBarraMorte}) morte._custom = true end - + esta_barra.lineText1:SetText(colocacao .. ". " .. morte [3]:gsub(("%-.*"), "")) esta_barra.lineText2:SetText("") esta_barra.lineText3:SetText("") esta_barra.lineText4:SetText(morte [6]) - + esta_barra:SetValue(100) if (esta_barra.hidden or esta_barra.fading_in or esta_barra.faded) then Details.FadeHandler.Fader(esta_barra, "out") end - + --seta a cor da barra e a cor do texto caso eles esteja mostrando com a cor da classe local r, g, b, a = unpack(_detalhes.class_colors [morte[4]]) _detalhes:SetBarColors(esta_barra, instancia, r, g, b, a) - + if (instancia.row_info.use_spec_icons) then local nome = morte[3] local spec = instancia.showing (1, nome) and instancia.showing (1, nome).spec or (instancia.showing (2, nome) and instancia.showing (2, nome).spec) @@ -636,35 +641,35 @@ function atributo_misc:DeadAtualizarBarra (morte, whichRowLine, colocacao, insta esta_barra.icone_classe:SetTexCoord(l, r, t, b) end end - + esta_barra.icone_classe:SetVertexColor(1, 1, 1) - + if (esta_barra.mouse_over and not instancia.baseframe.isMoving) then --precisa atualizar o tooltip gump:UpdateTooltip (whichRowLine, esta_barra, instancia) end - + esta_barra.lineText1:SetSize(esta_barra:GetWidth() - esta_barra.lineText4:GetStringWidth() - 20, 15) end function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, exportar, refresh_needed) - + local showing = tabela_do_combate [class_type] --o que esta sendo mostrado -> [1] - dano [2] - cura --pega o container com ._NameIndexTable ._ActorTable - + if (#showing._ActorTable < 1) then --n�o h� barras para mostrar return _detalhes:EsconderBarrasNaoUsadas (instancia, showing), "", 0, 0 end - - local total = 0 + + local total = 0 instancia.top = 0 - + local sub_atributo = instancia.sub_atributo --o que esta sendo mostrado nesta inst�ncia local conteudo = showing._ActorTable local amount = #conteudo local modo = instancia.modo - + if (exportar) then - if (type(exportar) == "boolean") then + if (type(exportar) == "boolean") then if (sub_atributo == 1) then --CC BREAKS keyName = "cc_break" elseif (sub_atributo == 2) then --RESS @@ -686,13 +691,13 @@ function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, expo keyName = exportar.key modo = exportar.modo end - + elseif (instancia.atributo == 5) then --custom keyName = "custom" - total = tabela_do_combate.totals [instancia.customName] - - else - + total = tabela_do_combate.totals [instancia.customName] + + else + --pega qual a sub key que ser� usada if (sub_atributo == 1) then --CC BREAKS keyName = "cc_break" @@ -711,15 +716,15 @@ function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, expo elseif (sub_atributo == 8) then --DEBUFF UPTIME keyName = "debuff_uptime" end - + end - - if (keyName == "dead") then + + if (keyName == "dead") then local mortes = tabela_do_combate.last_events_tables instancia.top = 1 total = #mortes - - if (exportar) then + + if (exportar) then return mortes end @@ -727,10 +732,10 @@ function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, expo instancia:EsconderScrollBar() return _detalhes:EndRefresh (instancia, total, tabela_do_combate, showing) --retorna a tabela que precisa ganhar o refresh end - + --estra mostrando ALL ent�o posso seguir o padr�o correto? primeiro, atualiza a scroll bar... instancia:RefreshScrollBar (total) - + --depois faz a atualiza��o normal dele atrav�s dos_ iterators local whichRowLine = 1 local barras_container = instancia.barras @@ -742,15 +747,15 @@ function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, expo whichRowLine = whichRowLine+1 end end - + return _detalhes:EndRefresh (instancia, total, tabela_do_combate, showing) --retorna a tabela que precisa ganhar o refresh - + else - + if (instancia.atributo == 5) then --custom --faz o sort da categoria e retorna o amount corrigido table.sort (conteudo, _detalhes.SortIfHaveKey) - + --n�o mostrar resultados com zero for i = amount, 1, -1 do --de tr�s pra frente if (not conteudo[i][keyName] or conteudo[i][keyName] < 1) then @@ -762,14 +767,14 @@ function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, expo --pega o total ja aplicado na tabela do combate total = tabela_do_combate.totals [class_type] [keyName] - + --grava o total instancia.top = conteudo[1][keyName] - + elseif (modo == modo_ALL) then --mostrando ALL - + table.sort (conteudo, _detalhes.SortIfHaveKey) - + --n�o mostrar resultados com zero for i = amount, 1, -1 do --de tr�s pra frente if (not conteudo[i][keyName] or conteudo[i][keyName] < 1) then @@ -781,12 +786,12 @@ function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, expo --pega o total ja aplicado na tabela do combate total = tabela_do_combate.totals [class_type] [keyName] - + --grava o total instancia.top = conteudo[1][keyName] - + elseif (modo == modo_GROUP) then --mostrando GROUP - + --if (refresh_needed) then table.sort (conteudo, _detalhes.SortGroupIfHaveKey) --end @@ -798,24 +803,24 @@ function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, expo elseif (index == 1) then --esse IF aqui, precisa mesmo ser aqui? n�o daria pra pega-lo com uma chave [1] nad grupo == true? instancia.top = conteudo[1][keyName] end - + total = total + player[keyName] else amount = index-1 break end end - + end end --refaz o mapa do container showing:remapear() - if (exportar) then + if (exportar) then return total, keyName, instancia.top, amount end - + if (amount < 1) then --n�o h� barras para mostrar instancia:EsconderScrollBar() --precisaria esconder a scroll bar return _detalhes:EndRefresh (instancia, total, tabela_do_combate, showing) --retorna a tabela que precisa ganhar o refresh @@ -823,7 +828,7 @@ function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, expo --estra mostrando ALL ent�o posso seguir o padr�o correto? primeiro, atualiza a scroll bar... instancia:RefreshScrollBar (amount) - + --depois faz a atualiza��o normal dele atrav�s dos_ iterators local whichRowLine = 1 local barras_container = instancia.barras @@ -832,20 +837,20 @@ function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, expo local bars_brackets = instancia:GetBarBracket() local bars_separator = instancia:GetBarSeparator() local use_animations = _detalhes.is_using_row_animations and (not instancia.baseframe.isStretching and not forcar) - + if (total == 0) then total = 0.00000001 end UsingCustomLeftText = instancia.row_info.textL_enable_custom_text UsingCustomRightText = instancia.row_info.textR_enable_custom_text - + if (instancia.bars_sort_direction == 1) then --top to bottom for i = instancia.barraS[1], instancia.barraS[2], 1 do --vai atualizar s� o range que esta sendo mostrado conteudo[i]:RefreshLine(instancia, barras_container, whichRowLine, i, total, sub_atributo, forcar, keyName, nil, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) whichRowLine = whichRowLine+1 end - + elseif (instancia.bars_sort_direction == 2) then --bottom to top for i = instancia.barraS[2], instancia.barraS[1], -1 do --vai atualizar s� o range que esta sendo mostrado if (conteudo[i]) then @@ -853,24 +858,24 @@ function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, expo whichRowLine = whichRowLine+1 end end - + end - + if (use_animations) then instancia:PerformAnimations (whichRowLine-1) end - + if (instancia.atributo == 5) then --custom --zerar o .custom dos_ Actors for index, player in ipairs(conteudo) do - if (player.custom > 0) then + if (player.custom > 0) then player.custom = 0 else break end end end - + --beta, hidar barras n�o usadas durante um refresh for�ado if (forcar) then if (instancia.modo == 2) then --group @@ -879,7 +884,7 @@ function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, expo end end end - + return _detalhes:EndRefresh (instancia, total, tabela_do_combate, showing) --retorna a tabela que precisa ganhar o refresh end @@ -889,32 +894,32 @@ local actor_class_color_r, actor_class_color_g, actor_class_color_b function atributo_misc:RefreshLine(instancia, barras_container, whichRowLine, lugar, total, sub_atributo, forcar, keyName, is_dead, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) local esta_barra = instancia.barras[whichRowLine] --pega a refer�ncia da barra na janela - + if (not esta_barra) then print("DEBUG: problema com "..whichRowLine.." "..lugar) return end - + local tabela_anterior = esta_barra.minha_tabela - + esta_barra.minha_tabela = self esta_barra.colocacao = lugar - + self.minha_barra = esta_barra self.colocacao = lugar - + local meu_total = _math_floor(self [keyName] or 0) --total if (not meu_total) then return end - + --local porcentagem = meu_total / total * 100 if (not percentage_type or percentage_type == 1) then porcentagem = _cstr ("%.1f", meu_total / total * 100) elseif (percentage_type == 2) then porcentagem = _cstr ("%.1f", meu_total / instancia.top * 100) end - + local esta_porcentagem = _math_floor((meu_total/instancia.top) * 100) if (not bars_show_data [1]) then @@ -925,7 +930,7 @@ function atributo_misc:RefreshLine(instancia, barras_container, whichRowLine, lu else porcentagem = porcentagem .. "%" end - + local rightText = meu_total .. bars_brackets[1] .. porcentagem .. bars_brackets[2] if (UsingCustomRightText) then esta_barra.lineText4:SetText(_string_replace (instancia.row_info.textR_custom_text, meu_total, "", porcentagem, self, instancia.showing, instancia, rightText)) @@ -936,27 +941,27 @@ function atributo_misc:RefreshLine(instancia, barras_container, whichRowLine, lu esta_barra.lineText4:SetText(rightText) end end - + if (esta_barra.mouse_over and not instancia.baseframe.isMoving) then --precisa atualizar o tooltip gump:UpdateTooltip (whichRowLine, esta_barra, instancia) end - - actor_class_color_r, actor_class_color_g, actor_class_color_b = self:GetBarColor() + + actor_class_color_r, actor_class_color_g, actor_class_color_b = self:GetBarColor() return self:RefreshBarra2 (esta_barra, instancia, tabela_anterior, forcar, esta_porcentagem, whichRowLine, barras_container, use_animations) end function atributo_misc:RefreshBarra2 (esta_barra, instancia, tabela_anterior, forcar, esta_porcentagem, whichRowLine, barras_container, use_animations) - + --primeiro colocado if (esta_barra.colocacao == 1) then if (not tabela_anterior or tabela_anterior ~= esta_barra.minha_tabela or forcar) then esta_barra:SetValue(100) - + if (esta_barra.hidden or esta_barra.fading_in or esta_barra.faded) then Details.FadeHandler.Fader(esta_barra, "out") end - + return self:RefreshBarra(esta_barra, instancia) else return @@ -964,40 +969,40 @@ function atributo_misc:RefreshBarra2 (esta_barra, instancia, tabela_anterior, fo else if (esta_barra.hidden or esta_barra.fading_in or esta_barra.faded) then - + if (use_animations) then esta_barra.animacao_fim = esta_porcentagem else esta_barra:SetValue(esta_porcentagem) esta_barra.animacao_ignorar = true end - + Details.FadeHandler.Fader(esta_barra, "out") - + if (instancia.row_info.texture_class_colors) then esta_barra.textura:SetVertexColor(actor_class_color_r, actor_class_color_g, actor_class_color_b) end if (instancia.row_info.texture_background_class_color) then esta_barra.background:SetVertexColor(actor_class_color_r, actor_class_color_g, actor_class_color_b) end - + return self:RefreshBarra(esta_barra, instancia) - + else --agora esta comparando se a tabela da barra � diferente da tabela na atualiza��o anterior if (not tabela_anterior or tabela_anterior ~= esta_barra.minha_tabela or forcar) then --aqui diz se a barra do jogador mudou de posi��o ou se ela apenas ser� atualizada - + if (use_animations) then esta_barra.animacao_fim = esta_porcentagem else esta_barra:SetValue(esta_porcentagem) esta_barra.animacao_ignorar = true end - + esta_barra.last_value = esta_porcentagem --reseta o ultimo valor da barra - + return self:RefreshBarra(esta_barra, instancia) - + elseif (esta_porcentagem ~= esta_barra.last_value) then --continua mostrando a mesma tabela ent�o compara a porcentagem --apenas atualizar if (use_animations) then @@ -1006,22 +1011,22 @@ function atributo_misc:RefreshBarra2 (esta_barra, instancia, tabela_anterior, fo esta_barra:SetValue(esta_porcentagem) end esta_barra.last_value = esta_porcentagem - + return self:RefreshBarra(esta_barra, instancia) end end end - + end function atributo_misc:RefreshBarra(esta_barra, instancia, from_resize) local class, enemy, arena_enemy, arena_ally = self.classe, self.enemy, self.arena_enemy, self.arena_ally - + if (from_resize) then actor_class_color_r, actor_class_color_g, actor_class_color_b = self:GetBarColor() end - + --icon self:SetClassIcon (esta_barra.icone_classe, instancia, class) --texture color @@ -1045,7 +1050,7 @@ function atributo_misc:ToolTip(instance, numero, barFrame, keydown) elseif (instance.sub_atributo == 1) then --cc_break return self:ToolTipCC(instance, numero, barFrame, keydown) - elseif (instance.sub_atributo == 2) then --ress + elseif (instance.sub_atributo == 2) then --ress return self:ToolTipRess(instance, numero, barFrame, keydown) elseif (instance.sub_atributo == 4) then --dispell @@ -1082,52 +1087,52 @@ function atributo_misc:ToolTipCC (instancia, numero, barra) r, g, b = unpack(_detalhes.class_colors [owner.classe]) else r, g, b = unpack(_detalhes.class_colors [self.classe]) - end + end local meu_total = self ["cc_break"] local habilidades = self.cc_break_spells._ActorTable - + --habilidade usada para tirar o CC local icon_size = _detalhes.tooltip.icon_size local icon_border = _detalhes.tooltip.icon_border_texcoord local lineHeight = _detalhes.tooltip.line_height local icon_border = _detalhes.tooltip.icon_border_texcoord - + for _spellid, _tabela in pairs(habilidades) do - + --quantidade local nome_magia, _, icone_magia = _GetSpellInfo(_spellid) GameCooltip:AddLine(nome_magia, _tabela.cc_break .. " (" .. _cstr ("%.1f", _tabela.cc_break / meu_total * 100) .. "%)") GameCooltip:AddIcon (icone_magia, nil, nil, lineHeight, lineHeight, icon_border.L, icon_border.R, icon_border.T, icon_border.B) _detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha) - + --o que quebrou local quebrou_oque = _tabela.cc_break_oque - for spellid_quebrada, amt_quebrada in pairs(_tabela.cc_break_oque) do + for spellid_quebrada, amt_quebrada in pairs(_tabela.cc_break_oque) do local nome_magia, _, icone_magia = _GetSpellInfo(spellid_quebrada) GameCooltip:AddLine(nome_magia, amt_quebrada .. " ") GameCooltip:AddIcon ([[Interface\Buttons\UI-GroupLoot-Pass-Down]], nil, 1, 14, 14) GameCooltip:AddIcon (icone_magia, nil, 2, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) GameCooltip:AddStatusBar (100, 1, 1, 0, 0, .2) end - + --em quem quebrou for target_name, amount in pairs(_tabela.targets) do GameCooltip:AddLine(target_name .. ": ", amount .. " ") - + local classe = _detalhes:GetClass(target_name) GameCooltip:AddIcon ([[Interface\AddOns\Details\images\espadas]], nil, 1, lineHeight, lineHeight) - if (classe) then + if (classe) then GameCooltip:AddIcon ([[Interface\AddOns\Details\images\classes_small]], nil, 2, lineHeight, lineHeight, unpack(_detalhes.class_coords [classe])) else GameCooltip:AddIcon ("Interface\\LFGFRAME\\LFGROLE_BW", nil, 2, lineHeight, lineHeight, .25, .5, 0, 1) end - + _detalhes:AddTooltipBackgroundStatusbar() end end - - + + return true end @@ -1138,11 +1143,11 @@ function atributo_misc:ToolTipDispell (instancia, numero, barra) r, g, b = unpack(_detalhes.class_colors [owner.classe]) else r, g, b = unpack(_detalhes.class_colors [self.classe]) - end + end local meu_total = _math_floor(self ["dispell"]) local habilidades = self.dispell_spells._ActorTable - + --habilidade usada para dispelar local meus_dispells = {} for _spellid, _tabela in pairs(habilidades) do @@ -1153,13 +1158,13 @@ function atributo_misc:ToolTipDispell (instancia, numero, barra) end end table.sort (meus_dispells, _detalhes.Sort2) - + _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_SPELLS"], headerColor, #meus_dispells, [[Interface\ICONS\Spell_Arcane_ArcaneTorrent]], 0.078125, 0.9375, 0.078125, 0.953125) _detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha) - + local icon_size = _detalhes.tooltip.icon_size local icon_border = _detalhes.tooltip.icon_border_texcoord - + if (#meus_dispells > 0) then for i = 1, min (25, #meus_dispells) do local esta_habilidade = meus_dispells[i] @@ -1171,14 +1176,14 @@ function atributo_misc:ToolTipDispell (instancia, numero, barra) else GameTooltip:AddLine(Loc ["STRING_NO_SPELL"]) end - + --quais habilidades foram dispaladas local buffs_dispelados = {} for _spellid, amt in pairs(self.dispell_oque) do buffs_dispelados [#buffs_dispelados+1] = {_spellid, amt} end table.sort (buffs_dispelados, _detalhes.Sort2) - + _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_DISPELLED"], headerColor, #buffs_dispelados, [[Interface\ICONS\Spell_Arcane_ManaTap]], 0.078125, 0.9375, 0.078125, 0.953125) _detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha) @@ -1193,7 +1198,7 @@ function atributo_misc:ToolTipDispell (instancia, numero, barra) end --alvos dispelados - + local alvos_dispelados = {} for target_name, amount in pairs(self.dispell_targets) do alvos_dispelados [#alvos_dispelados + 1] = {target_name, _math_floor(amount), amount / meu_total * 100} @@ -1202,17 +1207,17 @@ function atributo_misc:ToolTipDispell (instancia, numero, barra) _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_TARGETS"], headerColor, #alvos_dispelados, [[Interface\ICONS\ACHIEVEMENT_GUILDPERK_EVERYONES A HERO_RANK2]], 0.078125, 0.9375, 0.078125, 0.953125) _detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha) - + for i = 1, min (25, #alvos_dispelados) do if (alvos_dispelados[i][2] < 1) then break end - + GameCooltip:AddLine(alvos_dispelados[i][1], _detalhes:comma_value (alvos_dispelados[i][2]) .." (".._cstr ("%.1f", alvos_dispelados[i][3]).."%)") _detalhes:AddTooltipBackgroundStatusbar() - + local targetActor = instancia.showing[4]:PegarCombatente (_, alvos_dispelados[i][1]) - + if (targetActor) then local classe = targetActor.classe if (not classe) then @@ -1225,20 +1230,20 @@ function atributo_misc:ToolTipDispell (instancia, numero, barra) end end end - + --Pet local meus_pets = self.pets if (#meus_pets > 0) then --teve ajudantes - + local quantidade = {} --armazena a quantidade de pets iguais local interrupts = {} --armazena as habilidades local alvos = {} --armazena os alvos local totais = {} --armazena o dano total de cada objeto - + for index, nome in ipairs(meus_pets) do if (not quantidade [nome]) then quantidade [nome] = 1 - + local my_self = instancia.showing[class_type]:PegarCombatente (nil, nome) if (my_self and my_self.dispell) then totais [#totais+1] = {nome, my_self.dispell} @@ -1247,37 +1252,37 @@ function atributo_misc:ToolTipDispell (instancia, numero, barra) quantidade [nome] = quantidade [nome]+1 end end - + local _quantidade = 0 local added_logo = false - + table.sort (totais, _detalhes.Sort2) - + local ismaximized = false if (keydown == "alt" or TooltipMaximizedMethod == 2 or TooltipMaximizedMethod == 5) then ismaximized = true end - + for index, _table in ipairs(totais) do - + if (_table [2] > 0 and (index < 3 or ismaximized)) then - + if (not added_logo) then added_logo = true _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_PETS"], headerColor, #totais, [[Interface\COMMON\friendship-heart]], 0.21875, 0.78125, 0.09375, 0.6875) _detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha) end - + local n = _table [1]:gsub(("%s%<.*"), "") GameCooltip:AddLine(n, _table [2] .. " (" .. _math_floor(_table [2]/self.dispell*100) .. "%)") _detalhes:AddTooltipBackgroundStatusbar() GameCooltip:AddIcon ([[Interface\AddOns\Details\images\classes_small]], 1, 1, 14, 14, 0.25, 0.49609375, 0.75, 1) end end - + end - + return true end @@ -1287,10 +1292,10 @@ local UnitDebuff = UnitDebuff function _detalhes:CloseEnemyDebuffsUptime() local combat = _detalhes.tabela_vigente local misc_container = combat [4]._ActorTable - - for _, actor in ipairs(misc_container) do + + for _, actor in ipairs(misc_container) do if (actor.boss_debuff) then - for target_name, target in ipairs(actor.debuff_uptime_targets) do + for target_name, target in ipairs(actor.debuff_uptime_targets) do if (target.actived and target.actived_at) then target.uptime = target.uptime + _detalhes._tempo - target.actived_at actor.debuff_uptime = actor.debuff_uptime + _detalhes._tempo - target.actived_at @@ -1300,7 +1305,7 @@ function _detalhes:CloseEnemyDebuffsUptime() end end end - + return end @@ -1309,10 +1314,10 @@ function _detalhes:CatchRaidDebuffUptime (in_or_out) -- "DEBUFF_UPTIME_IN" if (in_or_out == "DEBUFF_UPTIME_OUT") then local combat = _detalhes.tabela_vigente local misc_container = combat [4]._ActorTable - - for _, actor in ipairs(misc_container) do + + for _, actor in ipairs(misc_container) do if (actor.debuff_uptime) then - for spellid, spell in pairs(actor.debuff_uptime_spells._ActorTable) do + for spellid, spell in pairs(actor.debuff_uptime_spells._ActorTable) do if (spell.actived and spell.actived_at) then spell.uptime = spell.uptime + _detalhes._tempo - spell.actived_at actor.debuff_uptime = actor.debuff_uptime + _detalhes._tempo - spell.actived_at @@ -1322,27 +1327,27 @@ function _detalhes:CatchRaidDebuffUptime (in_or_out) -- "DEBUFF_UPTIME_IN" end end end - + return end local cacheGetTime = GetTime() - + if (IsInRaid()) then - + local checked = {} - + for raidIndex = 1, GetNumGroupMembers() do - + local target = "raid"..raidIndex.."target" local his_target = UnitGUID(target) - + if (his_target and not checked [his_target]) then local rect = UnitReaction (target, "player") if (rect and rect <= 4) then - + checked [his_target] = true - + for debuffIndex = 1, 41 do local name, _, _, _, _, _, _, unitCaster, _, _, spellid = UnitDebuff (target, debuffIndex) if (name and unitCaster) then @@ -1361,18 +1366,18 @@ function _detalhes:CatchRaidDebuffUptime (in_or_out) -- "DEBUFF_UPTIME_IN" end end end - + elseif (IsInGroup()) then - + local checked = {} - + for raidIndex = 1, GetNumGroupMembers()-1 do local his_target = UnitGUID("party"..raidIndex.."target") local rect = UnitReaction ("party"..raidIndex.."target", "player") if (his_target and not checked [his_target] and rect and rect <= 4) then - + checked [his_target] = true - + for debuffIndex = 1, 40 do local name, _, _, _, _, _, _, unitCaster, _, _, spellid = UnitDebuff ("party"..raidIndex.."target", debuffIndex) if (name and unitCaster) then @@ -1382,14 +1387,14 @@ function _detalhes:CatchRaidDebuffUptime (in_or_out) -- "DEBUFF_UPTIME_IN" if (realmName and realmName ~= "") then playerName = playerName .. "-" .. realmName end - + _detalhes.parser:add_debuff_uptime (nil, GetTime(), playerGUID, playerName, 0x00000417, his_target, _UnitName ("party"..raidIndex.."target"), 0x842, nil, spellid, name, in_or_out) end end end end end - + local his_target = UnitGUID("playertarget") local rect = UnitReaction ("playertarget", "player") if (his_target and not checked [his_target] and rect and rect <= 4) then @@ -1407,7 +1412,7 @@ function _detalhes:CatchRaidDebuffUptime (in_or_out) -- "DEBUFF_UPTIME_IN" end end end - + else local his_target = UnitGUID("playertarget") if (his_target) then @@ -1442,24 +1447,24 @@ local runes_id = { function _detalhes:CatchRaidBuffUptime (in_or_out) if (IsInRaid()) then - + local pot_usage = {} local focus_augmentation = {} - + --raid groups local cacheGetTime = GetTime() - + for raidIndex = 1, GetNumGroupMembers() do local RaidIndex = "raid" .. raidIndex local playerGUID = UnitGUID(RaidIndex) if (playerGUID) then - + local playerName, realmName = _UnitName (RaidIndex) if (realmName and realmName ~= "") then playerName = playerName .. "-" .. realmName end - + for buffIndex = 1, 41 do local name, _, _, _, _, _, unitCaster, _, _, spellid = _UnitAura (RaidIndex, buffIndex, nil, "HELPFUL") if (name and unitCaster and UnitExists(unitCaster) and UnitExists(RaidIndex) and UnitIsUnit(unitCaster, RaidIndex)) then @@ -1490,31 +1495,31 @@ function _detalhes:CatchRaidBuffUptime (in_or_out) end string_output = string_output .. "|c" .. class_color .. playername .. "|r |T" .. icon .. ":14:14:0:0:64:64:0:64:0:64|t " end - + _detalhes.pre_pot_used = string_output - + _detalhes:SendEvent("COMBAT_PREPOTION_UPDATED", nil, pot_usage, focus_augmentation) end - + elseif (IsInGroup()) then - + local pot_usage = {} local focus_augmentation = {} - + --party members for groupIndex = 1, GetNumGroupMembers() - 1 do for buffIndex = 1, 41 do local name, _, _, _, _, _, unitCaster, _, _, spellid = _UnitAura ("party"..groupIndex, buffIndex, nil, "HELPFUL") if (name and unitCaster and UnitExists(unitCaster) and UnitExists("party" .. groupIndex) and UnitIsUnit(unitCaster, "party" .. groupIndex)) then - + local playerName, realmName = _UnitName ("party"..groupIndex) local playerGUID = UnitGUID("party"..groupIndex) - + if (playerGUID) then if (realmName and realmName ~= "") then playerName = playerName .. "-" .. realmName end - + if (in_or_out == "BUFF_UPTIME_IN") then if (_detalhes.PotionList [spellid]) then pot_usage [playerName] = spellid @@ -1523,13 +1528,13 @@ function _detalhes:CatchRaidBuffUptime (in_or_out) focus_augmentation [playerName] = true end end - + _detalhes.parser:add_buff_uptime (nil, GetTime(), playerGUID, playerName, 0x00000417, playerGUID, playerName, 0x00000417, 0x0, spellid, name, in_or_out) end end end end - + --player it self for buffIndex = 1, 41 do local name, _, _, _, _, _, unitCaster, _, _, spellid = _UnitAura ("player", buffIndex, nil, "HELPFUL") @@ -1544,15 +1549,15 @@ function _detalhes:CatchRaidBuffUptime (in_or_out) focus_augmentation [playerName] = true end end - + _detalhes.parser:add_buff_uptime (nil, GetTime(), playerGUID, playerName, 0x00000417, playerGUID, playerName, 0x00000417, 0x0, spellid, name, in_or_out) end end end - + if (in_or_out == "BUFF_UPTIME_IN") then local string_output = "pre-potion: " - + for playername, potspellid in pairs(pot_usage) do local name, _, icon = _GetSpellInfo(potspellid) local _, class = UnitClass(playername) @@ -1562,22 +1567,22 @@ function _detalhes:CatchRaidBuffUptime (in_or_out) end string_output = string_output .. "|c" .. class_color .. playername .. "|r |T" .. icon .. ":14:14:0:0:64:64:0:64:0:64|t " end - + _detalhes.pre_pot_used = string_output _detalhes:SendEvent("COMBAT_PREPOTION_UPDATED", nil, pot_usage, focus_augmentation) end - + else - + local pot_usage = {} local focus_augmentation = {} - + for buffIndex = 1, 41 do local name, _, _, _, _, _, unitCaster, _, _, spellid = _UnitAura ("player", buffIndex, nil, "HELPFUL") if (name and unitCaster and UnitExists(unitCaster) and UnitIsUnit(unitCaster, "player")) then local playerName = _UnitName ("player") local playerGUID = UnitGUID("player") - + if (playerGUID) then if (in_or_out == "BUFF_UPTIME_IN") then if (_detalhes.PotionList [spellid]) then @@ -1590,7 +1595,7 @@ function _detalhes:CatchRaidBuffUptime (in_or_out) end end end - + --[ if (in_or_out == "BUFF_UPTIME_IN") then local string_output = "pre-potion: " @@ -1603,14 +1608,14 @@ function _detalhes:CatchRaidBuffUptime (in_or_out) end string_output = string_output .. "|c" .. class_color .. playername .. "|r |T" .. icon .. ":14:14:0:0:64:64:0:64:0:64|t " end - + _detalhes.pre_pot_used = string_output _detalhes:SendEvent("COMBAT_PREPOTION_UPDATED", nil, pot_usage, focus_augmentation) end - + --]] -- _detalhes:Msg(string_output) - + end end @@ -1619,40 +1624,40 @@ local Sort2Reverse = function(a, b) end function atributo_misc:ToolTipDebuffUptime (instancia, numero, barra) - + local owner = self.owner if (owner and owner.classe) then r, g, b = unpack(_detalhes.class_colors [owner.classe]) else r, g, b = unpack(_detalhes.class_colors [self.classe]) - end - + end + local meu_total = self ["debuff_uptime"] local minha_tabela = self.debuff_uptime_spells._ActorTable - + --habilidade usada para interromper local debuffs_usados = {} - + local _combat_time = instancia.showing:GetCombatTime() - + for _spellid, _tabela in pairs(minha_tabela) do debuffs_usados [#debuffs_usados+1] = {_spellid, _tabela.uptime} end table.sort (debuffs_usados, _detalhes.Sort2) - + _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_SPELLS"], headerColor, #debuffs_usados, _detalhes.tooltip_spell_icon.file, unpack(_detalhes.tooltip_spell_icon.coords)) _detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha) local icon_size = _detalhes.tooltip.icon_size local icon_border = _detalhes.tooltip.icon_border_texcoord - + if (#debuffs_usados > 0) then for i = 1, min (30, #debuffs_usados) do local esta_habilidade = debuffs_usados[i] - + if (esta_habilidade[2] > 0) then local nome_magia, _, icone_magia = _GetSpellInfo(esta_habilidade[1]) - + local minutos, segundos = _math_floor(esta_habilidade[2]/60), _math_floor(esta_habilidade[2]%60) if (esta_habilidade[2] >= _combat_time) then --GameCooltip:AddLine(nome_magia, minutos .. "m " .. segundos .. "s" .. " (" .. _cstr ("%.1f", esta_habilidade[2] / _combat_time * 100) .. "%)", nil, "gray", "gray") @@ -1664,12 +1669,12 @@ function atributo_misc:ToolTipDebuffUptime (instancia, numero, barra) GameCooltip:AddLine(nome_magia, segundos .. "s" .. " (" .. _cstr ("%.1f", esta_habilidade[2] / _combat_time * 100) .. "%)") _detalhes:AddTooltipBackgroundStatusbar (false, esta_habilidade[2] / _combat_time * 100) end - + GameCooltip:AddIcon (icone_magia, nil, nil, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) end end else - GameCooltip:AddLine(Loc ["STRING_NO_SPELL"]) + GameCooltip:AddLine(Loc ["STRING_NO_SPELL"]) end return true @@ -1733,32 +1738,32 @@ function atributo_misc:ToolTipBuffUptime(instance, barFrame) end function atributo_misc:ToolTipDefensiveCooldowns (instancia, numero, barra) - + local owner = self.owner if (owner and owner.classe) then r, g, b = unpack(_detalhes.class_colors [owner.classe]) else r, g, b = unpack(_detalhes.class_colors [self.classe]) end - + local meu_total = _math_floor(self ["cooldowns_defensive"]) local minha_tabela = self.cooldowns_defensive_spells._ActorTable - + --spells local cooldowns_usados = {} - + for _spellid, _tabela in pairs(minha_tabela) do cooldowns_usados [#cooldowns_usados+1] = {_spellid, _tabela.counter} end table.sort (cooldowns_usados, _detalhes.Sort2) - + _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_SPELLS"], headerColor, #cooldowns_usados, _detalhes.tooltip_spell_icon.file, unpack(_detalhes.tooltip_spell_icon.coords)) _detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha) - + local icon_size = _detalhes.tooltip.icon_size local icon_border = _detalhes.tooltip.icon_border_texcoord local lineHeight = _detalhes.tooltip.line_height - + if (#cooldowns_usados > 0) then for i = 1, min (25, #cooldowns_usados) do local esta_habilidade = cooldowns_usados[i] @@ -1768,28 +1773,28 @@ function atributo_misc:ToolTipDefensiveCooldowns (instancia, numero, barra) _detalhes:AddTooltipBackgroundStatusbar() end else - GameCooltip:AddLine(Loc ["STRING_NO_SPELL"]) + GameCooltip:AddLine(Loc ["STRING_NO_SPELL"]) end --targets local meus_alvos = self.cooldowns_defensive_targets local alvos = {} - + for target_name, amount in pairs(meus_alvos) do alvos [#alvos+1] = {target_name, amount} end table.sort (alvos, _detalhes.Sort2) - + _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_TARGETS"], headerColor, #alvos, _detalhes.tooltip_target_icon.file, unpack(_detalhes.tooltip_target_icon.coords)) _detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha) - + if (#alvos > 0) then for i = 1, min (25, #alvos) do GameCooltip:AddLine(_detalhes:GetOnlyName(alvos[i][1]) .. ": ", alvos[i][2], 1, "white", "white") _detalhes:AddTooltipBackgroundStatusbar() - + GameCooltip:AddIcon ("Interface\\Icons\\PALADIN_HOLY", nil, nil, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) - + local targetActor = instancia.showing[4]:PegarCombatente (_, alvos[i][1]) if (targetActor) then local classe = targetActor.classe @@ -1808,12 +1813,12 @@ function atributo_misc:ToolTipDefensiveCooldowns (instancia, numero, barra) end end end - + end end - + return true - + end function atributo_misc:ToolTipRess (instancia, numero, barra) @@ -1823,24 +1828,24 @@ function atributo_misc:ToolTipRess (instancia, numero, barra) r, g, b = unpack(_detalhes.class_colors [owner.classe]) else r, g, b = unpack(_detalhes.class_colors [self.classe]) - end + end local meu_total = self ["ress"] local minha_tabela = self.ress_spells._ActorTable local lineHeight = _detalhes.tooltip.line_height local icon_border = _detalhes.tooltip.icon_border_texcoord - + --habilidade usada para interromper local meus_ress = {} - + for _spellid, _tabela in pairs(minha_tabela) do meus_ress [#meus_ress+1] = {_spellid, _tabela.ress} end table.sort (meus_ress, _detalhes.Sort2) - + _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_SPELLS"], headerColor, #meus_ress, _detalhes.tooltip_spell_icon.file, unpack(_detalhes.tooltip_spell_icon.coords)) _detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha) - + if (#meus_ress > 0) then for i = 1, min (3, #meus_ress) do local esta_habilidade = meus_ress[i] @@ -1850,26 +1855,26 @@ function atributo_misc:ToolTipRess (instancia, numero, barra) _detalhes:AddTooltipBackgroundStatusbar() end else - GameCooltip:AddLine(Loc ["STRING_NO_SPELL"]) + GameCooltip:AddLine(Loc ["STRING_NO_SPELL"]) end --quem foi que o cara reviveu local meus_alvos = self.ress_targets local alvos = {} - + for target_name, amount in pairs(meus_alvos) do alvos [#alvos+1] = {target_name, amount} end table.sort (alvos, _detalhes.Sort2) - + _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_TARGETS"], headerColor, #alvos, _detalhes.tooltip_target_icon.file, unpack(_detalhes.tooltip_target_icon.coords)) _detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha) - + if (#alvos > 0) then for i = 1, min (3, #alvos) do GameCooltip:AddLine(alvos[i][1], alvos[i][2]) _detalhes:AddTooltipBackgroundStatusbar() - + local targetActor = instancia.showing[4]:PegarCombatente (_, alvos[i][1]) if (targetActor) then local classe = targetActor.classe @@ -1888,10 +1893,10 @@ function atributo_misc:ToolTipRess (instancia, numero, barra) end end end - + end end - + return true end @@ -1903,26 +1908,26 @@ function atributo_misc:ToolTipInterrupt (instancia, numero, barra) r, g, b = unpack(_detalhes.class_colors [owner.classe]) else r, g, b = unpack(_detalhes.class_colors [self.classe]) - end + end local meu_total = self ["interrupt"] local minha_tabela = self.interrupt_spells._ActorTable - + local icon_size = _detalhes.tooltip.icon_size local icon_border = _detalhes.tooltip.icon_border_texcoord local lineHeight = _detalhes.tooltip.line_height - + --habilidade usada para interromper local meus_interrupts = {} - + for _spellid, _tabela in pairs(minha_tabela) do meus_interrupts [#meus_interrupts+1] = {_spellid, _tabela.counter} end table.sort (meus_interrupts, _detalhes.Sort2) - + _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_SPELLS"], headerColor, #meus_interrupts, _detalhes.tooltip_spell_icon.file, unpack(_detalhes.tooltip_spell_icon.coords)) _detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha) - + if (#meus_interrupts > 0) then for i = 1, min (25, #meus_interrupts) do local esta_habilidade = meus_interrupts[i] @@ -1934,18 +1939,18 @@ function atributo_misc:ToolTipInterrupt (instancia, numero, barra) else GameTooltip:AddLine(Loc ["STRING_NO_SPELL"]) end - + --quais habilidades foram interrompidas local habilidades_interrompidas = {} - + for _spellid, amt in pairs(self.interrompeu_oque) do habilidades_interrompidas [#habilidades_interrompidas+1] = {_spellid, amt} end table.sort (habilidades_interrompidas, _detalhes.Sort2) - + _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_SPELL_INTERRUPTED"] .. ":", headerColor, #habilidades_interrompidas, _detalhes.tooltip_target_icon.file, unpack(_detalhes.tooltip_target_icon.coords)) _detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha) - + if (#habilidades_interrompidas > 0) then for i = 1, min (25, #habilidades_interrompidas) do local esta_habilidade = habilidades_interrompidas[i] @@ -1955,20 +1960,20 @@ function atributo_misc:ToolTipInterrupt (instancia, numero, barra) _detalhes:AddTooltipBackgroundStatusbar() end end - + --Pet local meus_pets = self.pets if (#meus_pets > 0) then --teve ajudantes - + local quantidade = {} --armazena a quantidade de pets iguais local interrupts = {} --armazena as habilidades local alvos = {} --armazena os alvos local totais = {} --armazena o dano total de cada objeto - + for index, nome in ipairs(meus_pets) do if (not quantidade [nome]) then quantidade [nome] = 1 - + local my_self = instancia.showing[class_type]:PegarCombatente (nil, nome) if (my_self and my_self.interrupt) then totais [#totais+1] = {nome, my_self.interrupt} @@ -1977,37 +1982,37 @@ function atributo_misc:ToolTipInterrupt (instancia, numero, barra) quantidade [nome] = quantidade [nome]+1 end end - + local _quantidade = 0 local added_logo = false - + table.sort (totais, _detalhes.Sort2) - + local ismaximized = false if (keydown == "alt" or TooltipMaximizedMethod == 2 or TooltipMaximizedMethod == 5) then ismaximized = true end - + for index, _table in ipairs(totais) do - + if (_table [2] > 0 and (index < 3 or ismaximized)) then - + if (not added_logo) then added_logo = true _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_PETS"], headerColor, #totais, [[Interface\COMMON\friendship-heart]], 0.21875, 0.78125, 0.09375, 0.6875) _detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha) end - + local n = _table [1]:gsub(("%s%<.*"), "") GameCooltip:AddLine(n, _table [2] .. " (" .. _math_floor(_table [2]/self.interrupt*100) .. "%)") _detalhes:AddTooltipBackgroundStatusbar() GameCooltip:AddIcon ([[Interface\AddOns\Details\images\classes_small]], 1, 1, 14, 14, 0.25, 0.49609375, 0.75, 1) end end - + end - + return true end @@ -2033,16 +2038,16 @@ end function atributo_misc:MontaInfoInterrupt() local meu_total = self ["interrupt"] - + if (not self.interrupt_spells) then return end - + local minha_tabela = self.interrupt_spells._ActorTable local barras = info.barras1 local instancia = info.instancia - + local meus_interrupts = {} --player @@ -2055,7 +2060,7 @@ function atributo_misc:MontaInfoInterrupt() local class_color = "FFDDDDDD" for _, PetName in ipairs(ActorPets) do local PetActor = instancia.showing (class_type, PetName) - if (PetActor and PetActor.interrupt and PetActor.interrupt > 0) then + if (PetActor and PetActor.interrupt and PetActor.interrupt > 0) then local PetSkillsContainer = PetActor.interrupt_spells._ActorTable for _spellid, _skill in pairs(PetSkillsContainer) do --da foreach em cada spellid do container local nome, _, icone = _GetSpellInfo(_spellid) @@ -2063,7 +2068,7 @@ function atributo_misc:MontaInfoInterrupt() end end end - + table.sort (meus_interrupts, _detalhes.Sort2) local amt = #meus_interrupts @@ -2078,13 +2083,13 @@ function atributo_misc:MontaInfoInterrupt() if (not barra) then --se a barra n�o existir, criar ela ent�o barra = gump:CriaNovaBarraInfo1 (instancia, index) - + barra.textura:SetStatusBarColor(1, 1, 1, 1) --isso aqui � a parte da sele��o e descele��o barra.on_focus = false --isso aqui � a parte da sele��o e descele��o end --isso aqui � tudo da sele��o e descele��o das barras - + if (not info.mostrando_mouse_over) then if (tabela[1] == self.detalhes) then --tabela [1] = spellid = spellid que esta na caixa da direita if (not barra.on_focus) then --se a barra n�o tiver no foco @@ -2102,7 +2107,7 @@ function atributo_misc:MontaInfoInterrupt() end end end - + if (index == 1) then barra.textura:SetValue(100) else @@ -2111,7 +2116,7 @@ function atributo_misc:MontaInfoInterrupt() barra.lineText1:SetText(index..instancia.divisores.colocacao..tabela[4]) --seta o texto da esqueda barra.lineText4:SetText(tabela[2] .." ".. instancia.divisores.abre .._cstr("%.1f", tabela[3]) .."%".. instancia.divisores.fecha) --seta o texto da direita - + barra.icone:SetTexture(tabela[5]) barra.minha_tabela = self --grava o jogador na barrinho... � estranho pq todas as barras v�o ter o mesmo valor do jogador @@ -2129,25 +2134,25 @@ function atributo_misc:MontaInfoInterrupt() meus_alvos [#meus_alvos+1] = {target_name, amount} end table.sort (meus_alvos, _detalhes.Sort2) - + local amt_alvos = #meus_alvos if (amt_alvos < 1) then return end gump:JI_AtualizaContainerAlvos (amt_alvos) - + local max_alvos = meus_alvos[1][2] - + local barra for index, tabela in ipairs(meus_alvos) do - + barra = info.barras2 [index] - + if (not barra) then barra = gump:CriaNovaBarraInfo2 (instancia, index) barra.textura:SetStatusBarColor(1, 1, 1, 1) end - + if (index == 1) then barra.textura:SetValue(100) else @@ -2156,18 +2161,18 @@ function atributo_misc:MontaInfoInterrupt() barra.lineText1:SetText(index..instancia.divisores.colocacao..tabela[1]) --seta o texto da esqueda barra.lineText4:SetText(tabela[2] .." ".. instancia.divisores.abre .._cstr("%.1f", tabela[2]/meu_total*100) .. instancia.divisores.fecha) --seta o texto da direita - + if (barra.mouse_over) then --atualizar o tooltip if (barra.isAlvo) then - GameTooltip:Hide() + GameTooltip:Hide() GameTooltip:SetOwner(barra, "ANCHOR_TOPRIGHT") if (not barra.minha_tabela:MontaTooltipAlvos (barra, index)) then return end GameTooltip:Show() end - end - + end + barra.minha_tabela = self --grava o jogador na tabela barra.nome_inimigo = tabela [1] --salva o nome do inimigo na barra --isso � necess�rio? @@ -2180,7 +2185,7 @@ end ------ Detalhe Info Interrupt function atributo_misc:MontaDetalhesInterrupt (spellid, barra) - for _, barra in ipairs(info.barras3) do + for _, barra in ipairs(info.barras3) do barra:Hide() end @@ -2188,7 +2193,7 @@ function atributo_misc:MontaDetalhesInterrupt (spellid, barra) if (not esta_magia) then return end - + --icone direito superior local nome, _, icone = _GetSpellInfo(spellid) local infospell = {nome, nil, icone} @@ -2197,21 +2202,21 @@ function atributo_misc:MontaDetalhesInterrupt (spellid, barra) local total = self.interrupt local meu_total = esta_magia.counter - + local index = 1 - - local data = {} - + + local data = {} + local barras = info.barras3 local instancia = info.instancia - + local habilidades_alvos = {} - for spellid, amt in pairs(esta_magia.interrompeu_oque) do + for spellid, amt in pairs(esta_magia.interrompeu_oque) do habilidades_alvos [#habilidades_alvos+1] = {spellid, amt} end table.sort (habilidades_alvos, _detalhes.Sort2) local max_ = habilidades_alvos[1][2] - + local barra for index, tabela in ipairs(habilidades_alvos) do barra = barras [index] @@ -2220,42 +2225,42 @@ function atributo_misc:MontaDetalhesInterrupt (spellid, barra) barra = gump:CriaNovaBarraInfo3 (instancia, index) barra.textura:SetStatusBarColor(1, 1, 1, 1) --isso aqui � a parte da sele��o e descele��o end - + if (index == 1) then barra.textura:SetValue(100) else barra.textura:SetValue(tabela[2]/max_*100) --muito mais rapido... end - + local nome, _, icone = _GetSpellInfo(tabela[1]) barra.lineText1:SetText(index..instancia.divisores.colocacao..nome) --seta o texto da esqueda barra.lineText4:SetText(tabela[2] .." ".. instancia.divisores.abre .._cstr("%.1f", tabela[2]/total*100) .."%".. instancia.divisores.fecha) --seta o texto da direita - + barra.icone:SetTexture(icone) barra:Show() --mostra a barra - - if (index == 15) then + + if (index == 15) then break end end - + end function atributo_misc:MontaTooltipAlvos (esta_barra, index) - + local inimigo = esta_barra.nome_inimigo - + local container if (info.instancia.sub_atributo == 3) then --interrupt container = self.interrupt_spells._ActorTable end - + local habilidades = {} local total = self.interrupt - + for spellid, tabela in pairs(container) do --tabela = classe_damage_habilidade local alvos = tabela.targets @@ -2266,13 +2271,13 @@ function atributo_misc:MontaTooltipAlvos (esta_barra, index) end end end - + table.sort (habilidades, _detalhes.Sort2) - + GameTooltip:AddLine(index..". "..inimigo) - GameTooltip:AddLine(Loc ["STRING_SPELL_INTERRUPTED"] .. ":") + GameTooltip:AddLine(Loc ["STRING_SPELL_INTERRUPTED"] .. ":") GameTooltip:AddLine(" ") - + for index, tabela in ipairs(habilidades) do local nome, rank, icone = _GetSpellInfo(tabela[1]) if (index < 8) then @@ -2281,9 +2286,9 @@ function atributo_misc:MontaTooltipAlvos (esta_barra, index) GameTooltip:AddDoubleLine (index..". "..nome, tabela[2].." (".._cstr("%.1f", tabela[2]/total*100).."%)", .65, .65, .65, .65, .65, .65) end end - + return true - + end --controla se o dps do jogador esta travado ou destravado @@ -2301,13 +2306,13 @@ end TooltipMaximizedMethod = _detalhes.tooltip.maximize_method headerColor = _detalhes.tooltip.header_text_color end - + local sub_list = {"cc_break", "ress", "interrupt", "cooldowns_defensive", "dispell", "dead"} --subtract total from a combat table function atributo_misc:subtract_total (combat_table) - for _, sub_attribute in ipairs(sub_list) do + for _, sub_attribute in ipairs(sub_list) do if (self [sub_attribute]) then combat_table.totals [class_type][sub_attribute] = combat_table.totals [class_type][sub_attribute] - self [sub_attribute] if (self.grupo) then @@ -2317,7 +2322,7 @@ end end end function atributo_misc:add_total (combat_table) - for _, sub_attribute in ipairs(sub_list) do + for _, sub_attribute in ipairs(sub_list) do if (self [sub_attribute]) then combat_table.totals [class_type][sub_attribute] = combat_table.totals [class_type][sub_attribute] + self [sub_attribute] if (self.grupo) then @@ -2333,7 +2338,7 @@ local refresh_alvos = function(container1, container2) end end local refresh_habilidades = function(container1, container2) - for spellid, habilidade in pairs(container2._ActorTable) do + for spellid, habilidade in pairs(container2._ActorTable) do local habilidade_shadow = container1:PegaHabilidade (spellid, true, nil, true) refresh_alvos (habilidade_shadow.targets , habilidade.targets) end @@ -2347,10 +2352,10 @@ function atributo_misc:r_onlyrefresh_shadow (actor) if (not actor.nome) then actor.nome = "unknown" end - - if (not shadow) then + + if (not shadow) then shadow = overall_misc:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true) - + shadow.classe = actor.classe shadow:SetSpecId(actor.spec) shadow.grupo = actor.grupo @@ -2359,7 +2364,7 @@ function atributo_misc:r_onlyrefresh_shadow (actor) shadow.boss = actor.boss shadow.boss_fight_component = actor.boss_fight_component shadow.fight_component = actor.fight_component - + end _detalhes.refresh:r_atributo_misc (actor, shadow) @@ -2373,25 +2378,25 @@ function atributo_misc:r_onlyrefresh_shadow (actor) shadow.spell_cast [spellid] = shadow.spell_cast [spellid] or 0 end end - + --cc done if (actor.cc_done) then refresh_alvos (shadow.cc_done_targets, actor.cc_done_targets) refresh_habilidades (shadow.cc_done_spells, actor.cc_done_spells) - end - + end + --cooldowns if (actor.cooldowns_defensive) then refresh_alvos (shadow.cooldowns_defensive_targets, actor.cooldowns_defensive_targets) refresh_habilidades (shadow.cooldowns_defensive_spells, actor.cooldowns_defensive_spells) end - + --buff uptime if (actor.buff_uptime) then refresh_alvos (shadow.buff_uptime_targets, actor.buff_uptime_targets) refresh_habilidades (shadow.buff_uptime_spells, actor.buff_uptime_spells) end - + --debuff uptime if (actor.debuff_uptime) then refresh_habilidades (shadow.debuff_uptime_spells, actor.debuff_uptime_spells) @@ -2399,15 +2404,15 @@ function atributo_misc:r_onlyrefresh_shadow (actor) -- else refresh_alvos (shadow.debuff_uptime_targets, actor.debuff_uptime_targets) - end - + end + end - + --interrupt if (actor.interrupt) then refresh_alvos (shadow.interrupt_targets, actor.interrupt_targets) refresh_habilidades (shadow.interrupt_spells, actor.interrupt_spells) - for spellid, habilidade in pairs(actor.interrupt_spells._ActorTable) do + for spellid, habilidade in pairs(actor.interrupt_spells._ActorTable) do local habilidade_shadow = shadow.interrupt_spells:PegaHabilidade (spellid, true, nil, true) habilidade_shadow.interrompeu_oque = habilidade_shadow.interrompeu_oque or {} end @@ -2423,17 +2428,17 @@ function atributo_misc:r_onlyrefresh_shadow (actor) if (actor.dispell) then refresh_alvos (shadow.dispell_targets, actor.dispell_targets) refresh_habilidades (shadow.dispell_spells, actor.dispell_spells) - for spellid, habilidade in pairs(actor.dispell_spells._ActorTable) do + for spellid, habilidade in pairs(actor.dispell_spells._ActorTable) do local habilidade_shadow = shadow.dispell_spells:PegaHabilidade (spellid, true, nil, true) habilidade_shadow.dispell_oque = habilidade_shadow.dispell_oque or {} end end - + --cc break if (actor.cc_break) then refresh_alvos (shadow.cc_break_targets, actor.cc_break_targets) refresh_habilidades (shadow.cc_break_spells, actor.cc_break_spells) - for spellid, habilidade in pairs(actor.cc_break_spells._ActorTable) do + for spellid, habilidade in pairs(actor.cc_break_spells._ActorTable) do local habilidade_shadow = shadow.cc_break_spells:PegaHabilidade (spellid, true, nil, true) habilidade_shadow.cc_break_oque = habilidade_shadow.cc_break_oque or {} end @@ -2444,7 +2449,7 @@ function atributo_misc:r_onlyrefresh_shadow (actor) end local somar_keys = function(habilidade, habilidade_tabela1) - for key, value in pairs(habilidade) do + for key, value in pairs(habilidade) do if (type(value) == "number") then if (key ~= "id" and key ~= "spellschool") then habilidade_tabela1 [key] = (habilidade_tabela1 [key] or 0) + value @@ -2476,10 +2481,10 @@ function atributo_misc:r_connect_shadow (actor, no_refresh, combat_object) if (not actor.nome) then actor.nome = "unknown" end - - if (not shadow) then + + if (not shadow) then shadow = overall_misc:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true) - + shadow.classe = actor.classe shadow:SetSpecId(actor.spec) shadow.grupo = actor.grupo @@ -2488,14 +2493,14 @@ function atributo_misc:r_connect_shadow (actor, no_refresh, combat_object) shadow.boss = actor.boss shadow.boss_fight_component = actor.boss_fight_component shadow.fight_component = actor.fight_component - + end --aplica a meta e indexes if (not no_refresh) then _detalhes.refresh:r_atributo_misc (actor, shadow) end - + --pets (add unique pet names) for _, petName in ipairs(actor.pets) do DetailsFramework.table.addunique (shadow.pets, petName) @@ -2505,38 +2510,38 @@ function atributo_misc:r_connect_shadow (actor, no_refresh, combat_object) if (not shadow.spell_cast) then shadow.spell_cast = {} end - + for spellid, amount in pairs(actor.spell_cast) do shadow.spell_cast [spellid] = (shadow.spell_cast [spellid] or 0) + amount end end - + if (actor.cc_done) then if (not shadow.cc_done_targets) then shadow.cc_done = _detalhes:GetOrderNumber() shadow.cc_done_targets = {} shadow.cc_done_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) end - + shadow.cc_done = shadow.cc_done + actor.cc_done - + somar_alvos (shadow.cc_done_targets, actor.cc_done_targets) somar_habilidades (shadow.cc_done_spells, actor.cc_done_spells) end - + if (actor.cooldowns_defensive) then if (not shadow.cooldowns_defensive_targets) then shadow.cooldowns_defensive = _detalhes:GetOrderNumber(actor.nome) shadow.cooldowns_defensive_targets = {} shadow.cooldowns_defensive_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) end - + shadow.cooldowns_defensive = shadow.cooldowns_defensive + actor.cooldowns_defensive host_combat.totals[4].cooldowns_defensive = host_combat.totals[4].cooldowns_defensive + actor.cooldowns_defensive if (actor.grupo) then host_combat.totals_grupo[4].cooldowns_defensive = host_combat.totals_grupo[4].cooldowns_defensive + actor.cooldowns_defensive end - + somar_alvos (shadow.cooldowns_defensive_targets, actor.cooldowns_defensive_targets) somar_habilidades (shadow.cooldowns_defensive_spells, actor.cooldowns_defensive_spells) end @@ -2552,7 +2557,7 @@ function atributo_misc:r_connect_shadow (actor, no_refresh, combat_object) somar_alvos (shadow.buff_uptime_targets, actor.buff_uptime_targets) somar_habilidades (shadow.buff_uptime_spells, actor.buff_uptime_spells) end - + if (actor.debuff_uptime) then if (not shadow.debuff_uptime_targets) then @@ -2569,7 +2574,7 @@ function atributo_misc:r_connect_shadow (actor, no_refresh, combat_object) end shadow.debuff_uptime_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) end - + shadow.debuff_uptime = shadow.debuff_uptime + actor.debuff_uptime for target_name, amount in pairs(actor.debuff_uptime_targets) do @@ -2590,7 +2595,7 @@ function atributo_misc:r_connect_shadow (actor, no_refresh, combat_object) somar_habilidades (shadow.debuff_uptime_spells, actor.debuff_uptime_spells) end - + --interrupt if (actor.interrupt) then if (not shadow.interrupt_targets) then @@ -2599,26 +2604,26 @@ function atributo_misc:r_connect_shadow (actor, no_refresh, combat_object) shadow.interrupt_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) --cria o container das habilidades usadas para interromper shadow.interrompeu_oque = {} end - + shadow.interrupt = shadow.interrupt + actor.interrupt host_combat.totals[4].interrupt = host_combat.totals[4].interrupt + actor.interrupt if (actor.grupo) then host_combat.totals_grupo[4].interrupt = host_combat.totals_grupo[4].interrupt + actor.interrupt end - + somar_alvos (shadow.interrupt_targets, actor.interrupt_targets) somar_habilidades (shadow.interrupt_spells, actor.interrupt_spells) - - for spellid, habilidade in pairs(actor.interrupt_spells._ActorTable) do + + for spellid, habilidade in pairs(actor.interrupt_spells._ActorTable) do local habilidade_shadow = shadow.interrupt_spells:PegaHabilidade (spellid, true, nil, true) - + habilidade_shadow.interrompeu_oque = habilidade_shadow.interrompeu_oque or {} - + for _spellid, amount in pairs(habilidade.interrompeu_oque) do habilidade_shadow.interrompeu_oque [_spellid] = (habilidade_shadow.interrompeu_oque [_spellid] or 0) + amount end end - for spellid, amount in pairs(actor.interrompeu_oque) do + for spellid, amount in pairs(actor.interrompeu_oque) do shadow.interrompeu_oque [spellid] = (shadow.interrompeu_oque [spellid] or 0) + amount end end @@ -2630,13 +2635,13 @@ function atributo_misc:r_connect_shadow (actor, no_refresh, combat_object) shadow.ress_targets = {} shadow.ress_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) end - + shadow.ress = shadow.ress + actor.ress host_combat.totals[4].ress = host_combat.totals[4].ress + actor.ress if (actor.grupo) then host_combat.totals_grupo[4].ress = host_combat.totals_grupo[4].ress + actor.ress end - + somar_alvos (shadow.ress_targets, actor.ress_targets) somar_habilidades (shadow.ress_spells, actor.ress_spells) end @@ -2649,29 +2654,29 @@ function atributo_misc:r_connect_shadow (actor, no_refresh, combat_object) shadow.dispell_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) shadow.dispell_oque = {} end - + shadow.dispell = shadow.dispell + actor.dispell host_combat.totals[4].dispell = host_combat.totals[4].dispell + actor.dispell if (actor.grupo) then host_combat.totals_grupo[4].dispell = host_combat.totals_grupo[4].dispell + actor.dispell end - + somar_alvos (shadow.dispell_targets, actor.dispell_targets) somar_habilidades (shadow.dispell_spells, actor.dispell_spells) - for spellid, habilidade in pairs(actor.dispell_spells._ActorTable) do + for spellid, habilidade in pairs(actor.dispell_spells._ActorTable) do local habilidade_shadow = shadow.dispell_spells:PegaHabilidade (spellid, true, nil, true) habilidade_shadow.dispell_oque = habilidade_shadow.dispell_oque or {} for _spellid, amount in pairs(habilidade.dispell_oque) do habilidade_shadow.dispell_oque [_spellid] = (habilidade_shadow.dispell_oque [_spellid] or 0) + amount end end - - for spellid, amount in pairs(actor.dispell_oque) do + + for spellid, amount in pairs(actor.dispell_oque) do shadow.dispell_oque [spellid] = (shadow.dispell_oque [spellid] or 0) + amount end end - + if (actor.cc_break) then if (not shadow.cc_break) then shadow.cc_break = 0 @@ -2685,11 +2690,11 @@ function atributo_misc:r_connect_shadow (actor, no_refresh, combat_object) if (actor.grupo) then host_combat.totals_grupo[4].cc_break = host_combat.totals_grupo[4].cc_break + actor.cc_break end - + somar_alvos (shadow.cc_break_targets, actor.cc_break_targets) somar_habilidades (shadow.cc_break_spells, actor.cc_break_spells) - - for spellid, habilidade in pairs(actor.cc_break_spells._ActorTable) do + + for spellid, habilidade in pairs(actor.cc_break_spells._ActorTable) do local habilidade_shadow = shadow.cc_break_spells:PegaHabilidade (spellid, true, nil, true) habilidade_shadow.cc_break_oque = habilidade_shadow.cc_break_oque or {} for _spellid, amount in pairs(habilidade.cc_break_oque) do @@ -2712,14 +2717,14 @@ end function _detalhes.refresh:r_atributo_misc (este_jogador, shadow) setmetatable(este_jogador, _detalhes.atributo_misc) este_jogador.__index = _detalhes.atributo_misc - + --refresh spell cast if (este_jogador.spell_cast) then if (shadow and not shadow.spell_cast) then shadow.spell_cast = {} end end - + --refresh cc done if (este_jogador.cc_done) then if (shadow and not shadow.cc_done_targets) then @@ -2728,8 +2733,8 @@ function _detalhes.refresh:r_atributo_misc (este_jogador, shadow) shadow.cc_done_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) end _detalhes.refresh:r_container_habilidades (este_jogador.cc_done_spells, shadow and shadow.cc_done_spells) - end - + end + --refresh interrupts if (este_jogador.interrupt_targets) then if (shadow and not shadow.interrupt_targets) then @@ -2740,7 +2745,7 @@ function _detalhes.refresh:r_atributo_misc (este_jogador, shadow) end _detalhes.refresh:r_container_habilidades (este_jogador.interrupt_spells, shadow and shadow.interrupt_spells) end - + --refresh buff uptime if (este_jogador.buff_uptime_targets) then if (shadow and not shadow.buff_uptime_targets) then @@ -2750,7 +2755,7 @@ function _detalhes.refresh:r_atributo_misc (este_jogador, shadow) end _detalhes.refresh:r_container_habilidades (este_jogador.buff_uptime_spells, shadow and shadow.buff_uptime_spells) end - + --refresh buff uptime if (este_jogador.debuff_uptime_targets) then if (shadow and not shadow.debuff_uptime_targets) then @@ -2769,7 +2774,7 @@ function _detalhes.refresh:r_atributo_misc (este_jogador, shadow) end _detalhes.refresh:r_container_habilidades (este_jogador.debuff_uptime_spells, shadow and shadow.debuff_uptime_spells) end - + --refresh cooldowns defensive if (este_jogador.cooldowns_defensive_targets) then if (shadow and not shadow.cooldowns_defensive_targets) then @@ -2779,7 +2784,7 @@ function _detalhes.refresh:r_atributo_misc (este_jogador, shadow) end _detalhes.refresh:r_container_habilidades (este_jogador.cooldowns_defensive_spells, shadow and shadow.cooldowns_defensive_spells) end - + --refresh ressers if (este_jogador.ress_targets) then if (shadow and not shadow.ress_targets) then @@ -2789,7 +2794,7 @@ function _detalhes.refresh:r_atributo_misc (este_jogador, shadow) end _detalhes.refresh:r_container_habilidades (este_jogador.ress_spells, shadow and shadow.ress_spells) end - + --refresh dispells if (este_jogador.dispell_targets) then if (shadow and not shadow.dispell_targets) then @@ -2800,7 +2805,7 @@ function _detalhes.refresh:r_atributo_misc (este_jogador, shadow) end _detalhes.refresh:r_container_habilidades (este_jogador.dispell_spells, shadow and shadow.dispell_spells) end - + --refresh cc_breaks if (este_jogador.cc_break_targets) then if (shadow and not shadow.cc_break) then @@ -2819,39 +2824,39 @@ function _detalhes.clear:c_atributo_misc (este_jogador) este_jogador.shadow = nil este_jogador.links = nil este_jogador.minha_barra = nil - + if (este_jogador.cc_done_targets) then _detalhes.clear:c_container_habilidades (este_jogador.cc_done_spells) end - + if (este_jogador.interrupt_targets) then _detalhes.clear:c_container_habilidades (este_jogador.interrupt_spells) end - + if (este_jogador.cooldowns_defensive_targets) then _detalhes.clear:c_container_habilidades (este_jogador.cooldowns_defensive_spells) end - + if (este_jogador.buff_uptime_targets) then _detalhes.clear:c_container_habilidades (este_jogador.buff_uptime_spells) end - + if (este_jogador.debuff_uptime_targets) then _detalhes.clear:c_container_habilidades (este_jogador.debuff_uptime_spells) end - + if (este_jogador.ress_targets) then _detalhes.clear:c_container_habilidades (este_jogador.ress_spells) end - + if (este_jogador.cc_break_targets) then _detalhes.clear:c_container_habilidades (este_jogador.cc_break_spells) end - + if (este_jogador.dispell_targets) then _detalhes.clear:c_container_habilidades (este_jogador.dispell_spells) end - + end atributo_misc.__add = function(tabela1, tabela2) @@ -2864,74 +2869,74 @@ atributo_misc.__add = function(tabela1, tabela2) if (tabela2.cc_done) then tabela1.cc_done = tabela1.cc_done + tabela2.cc_done - + for target_name, amount in pairs(tabela2.cc_done_targets) do tabela1.cc_done_targets [target_name] = (tabela1.cc_done_targets [target_name] or 0) + amount end - - for spellid, habilidade in pairs(tabela2.cc_done_spells._ActorTable) do + + for spellid, habilidade in pairs(tabela2.cc_done_spells._ActorTable) do local habilidade_tabela1 = tabela1.cc_done_spells:PegaHabilidade (spellid, true, nil, false) - + for target_name, amount in pairs(habilidade.targets) do habilidade_tabela1.targets [target_name] = (habilidade_tabela1.targets [target_name] or 0) + amount end - + somar_keys (habilidade, habilidade_tabela1) end end if (tabela2.interrupt) then - + if (not tabela1.interrupt) then tabela1.interrupt = 0 tabela1.interrupt_targets = {} tabela1.interrupt_spells = container_habilidades:NovoContainer (container_misc) tabela1.interrompeu_oque = {} end - + --total de interrupts tabela1.interrupt = tabela1.interrupt + tabela2.interrupt --soma o interrompeu o que - for spellid, amount in pairs(tabela2.interrompeu_oque) do + for spellid, amount in pairs(tabela2.interrompeu_oque) do tabela1.interrompeu_oque [spellid] = (tabela1.interrompeu_oque [spellid] or 0) + amount end --soma os containers de alvos for target_name, amount in pairs(tabela2.interrupt_targets) do tabela1.interrupt_targets [target_name] = (tabela1.interrupt_targets [target_name] or 0) + amount end - + --soma o container de habilidades - for spellid, habilidade in pairs(tabela2.interrupt_spells._ActorTable) do + for spellid, habilidade in pairs(tabela2.interrupt_spells._ActorTable) do local habilidade_tabela1 = tabela1.interrupt_spells:PegaHabilidade (spellid, true, nil, false) - + habilidade_tabela1.interrompeu_oque = habilidade_tabela1.interrompeu_oque or {} for _spellid, amount in pairs(habilidade.interrompeu_oque) do habilidade_tabela1.interrompeu_oque [_spellid] = (habilidade_tabela1.interrompeu_oque [_spellid] or 0) + amount end - + for target_name, amount in pairs(habilidade.targets) do habilidade_tabela1.targets [target_name] = (habilidade_tabela1.targets [target_name] or 0) + amount end - + somar_keys (habilidade, habilidade_tabela1) end end - + if (tabela2.buff_uptime) then if (not tabela1.buff_uptime) then tabela1.buff_uptime = 0 tabela1.buff_uptime_targets = {} tabela1.buff_uptime_spells = container_habilidades:NovoContainer (container_misc) end - + tabela1.buff_uptime = tabela1.buff_uptime + tabela2.buff_uptime - + for target_name, amount in pairs(tabela2.buff_uptime_targets) do tabela1.buff_uptime_targets [target_name] = (tabela1.buff_uptime_targets [target_name] or 0) + amount end - - for spellid, habilidade in pairs(tabela2.buff_uptime_spells._ActorTable) do + + for spellid, habilidade in pairs(tabela2.buff_uptime_spells._ActorTable) do local habilidade_tabela1 = tabela1.buff_uptime_spells:PegaHabilidade (spellid, true, nil, false) for target_name, amount in pairs(habilidade.targets) do @@ -2941,7 +2946,7 @@ atributo_misc.__add = function(tabela1, tabela2) somar_keys (habilidade, habilidade_tabela1) end end - + if (tabela2.debuff_uptime) then if (not tabela1.debuff_uptime) then if (tabela2.boss_debuff) then @@ -2953,13 +2958,13 @@ atributo_misc.__add = function(tabela1, tabela2) else tabela1.debuff_uptime_targets = {} end - + tabela1.debuff_uptime = 0 tabela1.debuff_uptime_spells = container_habilidades:NovoContainer (container_misc) end tabela1.debuff_uptime = tabela1.debuff_uptime + tabela2.debuff_uptime - + for target_name, amount in pairs(tabela2.debuff_uptime_targets) do if (type(amount) == "table") then --boss debuff local t = tabela1.debuff_uptime_targets [target_name] @@ -2975,130 +2980,130 @@ atributo_misc.__add = function(tabela1, tabela2) tabela1.debuff_uptime_targets [target_name] = (tabela1.debuff_uptime_targets [target_name] or 0) + amount end end - - for spellid, habilidade in pairs(tabela2.debuff_uptime_spells._ActorTable) do + + for spellid, habilidade in pairs(tabela2.debuff_uptime_spells._ActorTable) do local habilidade_tabela1 = tabela1.debuff_uptime_spells:PegaHabilidade (spellid, true, nil, false) for target_name, amount in pairs(habilidade.targets) do habilidade_tabela1.targets [target_name] = (habilidade_tabela1.targets [target_name] or 0) + amount end - + somar_keys (habilidade, habilidade_tabela1) - end + end end - + if (tabela2.cooldowns_defensive) then if (not tabela1.cooldowns_defensive) then tabela1.cooldowns_defensive = 0 tabela1.cooldowns_defensive_targets = {} tabela1.cooldowns_defensive_spells = container_habilidades:NovoContainer (container_misc) end - + tabela1.cooldowns_defensive = tabela1.cooldowns_defensive + tabela2.cooldowns_defensive - - for target_name, amount in pairs(tabela2.cooldowns_defensive_targets) do + + for target_name, amount in pairs(tabela2.cooldowns_defensive_targets) do tabela1.cooldowns_defensive_targets [target_name] = (tabela1.cooldowns_defensive_targets [target_name] or 0) + amount end - - for spellid, habilidade in pairs(tabela2.cooldowns_defensive_spells._ActorTable) do + + for spellid, habilidade in pairs(tabela2.cooldowns_defensive_spells._ActorTable) do local habilidade_tabela1 = tabela1.cooldowns_defensive_spells:PegaHabilidade (spellid, true, nil, false) - for target_name, amount in pairs(habilidade.targets) do + for target_name, amount in pairs(habilidade.targets) do habilidade_tabela1.targets [target_name] = (habilidade_tabela1.targets [target_name] or 0) + amount end - + somar_keys (habilidade, habilidade_tabela1) - end + end end - + if (tabela2.ress) then if (not tabela1.ress) then tabela1.ress = 0 tabela1.ress_targets = {} tabela1.ress_spells = container_habilidades:NovoContainer (container_misc) end - + tabela1.ress = tabela1.ress + tabela2.ress - + for target_name, amount in pairs(tabela2.ress_targets) do tabela1.ress_targets [target_name] = (tabela1.ress_targets [target_name] or 0) + amount end - - for spellid, habilidade in pairs(tabela2.ress_spells._ActorTable) do + + for spellid, habilidade in pairs(tabela2.ress_spells._ActorTable) do local habilidade_tabela1 = tabela1.ress_spells:PegaHabilidade (spellid, true, nil, false) - - for target_name, amount in pairs(habilidade.targets) do + + for target_name, amount in pairs(habilidade.targets) do habilidade_tabela1.targets [target_name] = (habilidade_tabela1.targets [target_name] or 0) + amount end - + somar_keys (habilidade, habilidade_tabela1) end end - + if (tabela2.dispell) then - + if (not tabela1.dispell) then tabela1.dispell = 0 tabela1.dispell_targets = {} tabela1.dispell_spells = container_habilidades:NovoContainer (container_misc) tabela1.dispell_oque = {} end - + tabela1.dispell = tabela1.dispell + tabela2.dispell - + for target_name, amount in pairs(tabela2.dispell_targets) do tabela1.dispell_targets [target_name] = (tabela1.dispell_targets [target_name] or 0) + amount end - - for spellid, habilidade in pairs(tabela2.dispell_spells._ActorTable) do + + for spellid, habilidade in pairs(tabela2.dispell_spells._ActorTable) do local habilidade_tabela1 = tabela1.dispell_spells:PegaHabilidade (spellid, true, nil, false) - + habilidade_tabela1.dispell_oque = habilidade_tabela1.dispell_oque or {} for _spellid, amount in pairs(habilidade.dispell_oque) do habilidade_tabela1.dispell_oque [_spellid] = (habilidade_tabela1.dispell_oque [_spellid] or 0) + amount end - - for target_name, amount in pairs(habilidade.targets) do + + for target_name, amount in pairs(habilidade.targets) do habilidade_tabela1.targets [target_name] = (habilidade_tabela1.targets [target_name] or 0) + amount end - + somar_keys (habilidade, habilidade_tabela1) end - - for spellid, amount in pairs(tabela2.dispell_oque) do + + for spellid, amount in pairs(tabela2.dispell_oque) do tabela1.dispell_oque [spellid] = (tabela1.dispell_oque [spellid] or 0) + amount end - + end - + if (tabela2.cc_break) then - + if (not tabela1.cc_break) then tabela1.cc_break = 0 tabela1.cc_break_targets = {} tabela1.cc_break_spells = container_habilidades:NovoContainer (container_misc) tabela1.cc_break_oque = {} end - + tabela1.cc_break = tabela1.cc_break + tabela2.cc_break - - for target_name, amount in pairs(tabela2.cc_break_targets) do + + for target_name, amount in pairs(tabela2.cc_break_targets) do tabela1.cc_break_targets [target_name] = (tabela1.cc_break_targets [target_name] or 0) + amount end - - for spellid, habilidade in pairs(tabela2.cc_break_spells._ActorTable) do + + for spellid, habilidade in pairs(tabela2.cc_break_spells._ActorTable) do local habilidade_tabela1 = tabela1.cc_break_spells:PegaHabilidade (spellid, true, nil, false) - + habilidade_tabela1.cc_break_oque = habilidade_tabela1.cc_break_oque or {} for _spellid, amount in pairs(habilidade.cc_break_oque) do habilidade_tabela1.cc_break_oque [_spellid] = (habilidade_tabela1.cc_break_oque [_spellid] or 0) + amount end - - for target_name, amount in pairs(habilidade.targets) do + + for target_name, amount in pairs(habilidade.targets) do habilidade_tabela1.targets [target_name] = (habilidade_tabela1.targets [target_name] or 0) + amount end - + somar_keys (habilidade, habilidade_tabela1) end @@ -3106,12 +3111,12 @@ atributo_misc.__add = function(tabela1, tabela2) tabela1.cc_break_oque [spellid] = (tabela1.cc_break_oque [spellid] or 0) + amount end end - + return tabela1 end local subtrair_keys = function(habilidade, habilidade_tabela1) - for key, value in pairs(habilidade) do + for key, value in pairs(habilidade) do if (type(value) == "number") then if (key ~= "id" and key ~= "spellschool") then habilidade_tabela1 [key] = (habilidade_tabela1 [key] or 0) - value @@ -3130,18 +3135,18 @@ atributo_misc.__sub = function(tabela1, tabela2) if (tabela2.cc_done) then tabela1.cc_done = tabela1.cc_done - tabela2.cc_done - + for target_name, amount in pairs(tabela2.cc_done_targets) do tabela1.cc_done_targets [target_name] = (tabela1.cc_done_targets [target_name] or 0) - amount end - - for spellid, habilidade in pairs(tabela2.cc_done_spells._ActorTable) do + + for spellid, habilidade in pairs(tabela2.cc_done_spells._ActorTable) do local habilidade_tabela1 = tabela1.cc_done_spells:PegaHabilidade (spellid, true, nil, false) - + for target_name, amount in pairs(habilidade.targets) do habilidade_tabela1.targets [target_name] = (habilidade_tabela1.targets [target_name] or 0) - amount end - + subtrair_keys (habilidade, habilidade_tabela1) end end @@ -3150,39 +3155,39 @@ atributo_misc.__sub = function(tabela1, tabela2) --total de interrupts tabela1.interrupt = tabela1.interrupt - tabela2.interrupt --soma o interrompeu o que - for spellid, amount in pairs(tabela2.interrompeu_oque) do + for spellid, amount in pairs(tabela2.interrompeu_oque) do tabela1.interrompeu_oque [spellid] = (tabela1.interrompeu_oque [spellid] or 0) - amount end --soma os containers de alvos for target_name, amount in pairs(tabela2.interrupt_targets) do tabela1.interrupt_targets [target_name] = (tabela1.interrupt_targets [target_name] or 0) - amount end - + --soma o container de habilidades - for spellid, habilidade in pairs(tabela2.interrupt_spells._ActorTable) do + for spellid, habilidade in pairs(tabela2.interrupt_spells._ActorTable) do local habilidade_tabela1 = tabela1.interrupt_spells:PegaHabilidade (spellid, true, nil, false) - + habilidade_tabela1.interrompeu_oque = habilidade_tabela1.interrompeu_oque or {} for _spellid, amount in pairs(habilidade.interrompeu_oque) do habilidade_tabela1.interrompeu_oque [_spellid] = (habilidade_tabela1.interrompeu_oque [_spellid] or 0) - amount end - + for target_name, amount in pairs(habilidade.targets) do habilidade_tabela1.targets [target_name] = (habilidade_tabela1.targets [target_name] or 0) - amount end - + subtrair_keys (habilidade, habilidade_tabela1) end end - - if (tabela2.buff_uptime) then + + if (tabela2.buff_uptime) then tabela1.buff_uptime = tabela1.buff_uptime - tabela2.buff_uptime - + for target_name, amount in pairs(tabela2.buff_uptime_targets) do tabela1.buff_uptime_targets [target_name] = (tabela1.buff_uptime_targets [target_name] or 0) - amount end - - for spellid, habilidade in pairs(tabela2.buff_uptime_spells._ActorTable) do + + for spellid, habilidade in pairs(tabela2.buff_uptime_spells._ActorTable) do local habilidade_tabela1 = tabela1.buff_uptime_spells:PegaHabilidade (spellid, true, nil, false) for target_name, amount in pairs(habilidade.targets) do @@ -3190,12 +3195,12 @@ atributo_misc.__sub = function(tabela1, tabela2) end subtrair_keys (habilidade, habilidade_tabela1) - end + end end - - if (tabela2.debuff_uptime) then + + if (tabela2.debuff_uptime) then tabela1.debuff_uptime = tabela1.debuff_uptime - tabela2.debuff_uptime - + for target_name, amount in pairs(tabela2.debuff_uptime_targets) do if (type(amount) == "table") then --boss debuff local t = tabela1.debuff_uptime_targets [target_name] @@ -3211,102 +3216,102 @@ atributo_misc.__sub = function(tabela1, tabela2) tabela2.debuff_uptime_targets [target_name] = (tabela2.debuff_uptime_targets [target_name] or 0) - amount end end - - for spellid, habilidade in pairs(tabela2.debuff_uptime_spells._ActorTable) do + + for spellid, habilidade in pairs(tabela2.debuff_uptime_spells._ActorTable) do local habilidade_tabela1 = tabela1.debuff_uptime_spells:PegaHabilidade (spellid, true, nil, false) for target_name, amount in pairs(habilidade.targets) do habilidade_tabela1.targets [target_name] = (habilidade_tabela1.targets [target_name] or 0) - amount end - + subtrair_keys (habilidade, habilidade_tabela1) - end + end end - - if (tabela2.cooldowns_defensive) then + + if (tabela2.cooldowns_defensive) then tabela1.cooldowns_defensive = tabela1.cooldowns_defensive - tabela2.cooldowns_defensive - - for target_name, amount in pairs(tabela2.cooldowns_defensive_targets) do + + for target_name, amount in pairs(tabela2.cooldowns_defensive_targets) do tabela1.cooldowns_defensive_targets [target_name] = (tabela1.cooldowns_defensive_targets [target_name] or 0) - amount end - - for spellid, habilidade in pairs(tabela2.cooldowns_defensive_spells._ActorTable) do + + for spellid, habilidade in pairs(tabela2.cooldowns_defensive_spells._ActorTable) do local habilidade_tabela1 = tabela1.cooldowns_defensive_spells:PegaHabilidade (spellid, true, nil, false) - for target_name, amount in pairs(habilidade.targets) do + for target_name, amount in pairs(habilidade.targets) do habilidade_tabela1.targets [target_name] = (habilidade_tabela1.targets [target_name] or 0) - amount end - + subtrair_keys (habilidade, habilidade_tabela1) - end + end end - + if (tabela2.ress) then tabela1.ress = tabela1.ress - tabela2.ress - + for target_name, amount in pairs(tabela2.ress_targets) do tabela1.ress_targets [target_name] = (tabela1.ress_targets [target_name] or 0) - amount end - - for spellid, habilidade in pairs(tabela2.ress_spells._ActorTable) do + + for spellid, habilidade in pairs(tabela2.ress_spells._ActorTable) do local habilidade_tabela1 = tabela1.ress_spells:PegaHabilidade (spellid, true, nil, false) - - for target_name, amount in pairs(habilidade.targets) do + + for target_name, amount in pairs(habilidade.targets) do habilidade_tabela1.targets [target_name] = (habilidade_tabela1.targets [target_name] or 0) - amount end - + subtrair_keys (habilidade, habilidade_tabela1) end end - + if (tabela2.dispell) then tabela1.dispell = tabela1.dispell - tabela2.dispell - + for target_name, amount in pairs(tabela2.dispell_targets) do tabela1.dispell_targets [target_name] = (tabela1.dispell_targets [target_name] or 0) - amount end - - for spellid, habilidade in pairs(tabela2.dispell_spells._ActorTable) do + + for spellid, habilidade in pairs(tabela2.dispell_spells._ActorTable) do local habilidade_tabela1 = tabela1.dispell_spells:PegaHabilidade (spellid, true, nil, false) - + habilidade_tabela1.dispell_oque = habilidade_tabela1.dispell_oque or {} for _spellid, amount in pairs(habilidade.dispell_oque) do habilidade_tabela1.dispell_oque [_spellid] = (habilidade_tabela1.dispell_oque [_spellid] or 0) - amount end - - for target_name, amount in pairs(habilidade.targets) do + + for target_name, amount in pairs(habilidade.targets) do habilidade_tabela1.targets [target_name] = (habilidade_tabela1.targets [target_name] or 0) - amount end - + subtrair_keys (habilidade, habilidade_tabela1) end - - for spellid, amount in pairs(tabela2.dispell_oque) do + + for spellid, amount in pairs(tabela2.dispell_oque) do tabela1.dispell_oque [spellid] = (tabela1.dispell_oque [spellid] or 0) - amount end end - + if (tabela2.cc_break) then - + tabela1.cc_break = tabela1.cc_break - tabela2.cc_break - - for target_name, amount in pairs(tabela2.cc_break_targets) do + + for target_name, amount in pairs(tabela2.cc_break_targets) do tabela1.cc_break_targets [target_name] = (tabela1.cc_break_targets [target_name] or 0) - amount end - - for spellid, habilidade in pairs(tabela2.cc_break_spells._ActorTable) do + + for spellid, habilidade in pairs(tabela2.cc_break_spells._ActorTable) do local habilidade_tabela1 = tabela1.cc_break_spells:PegaHabilidade (spellid, true, nil, false) - + habilidade_tabela1.cc_break_oque = habilidade_tabela1.cc_break_oque or {} for _spellid, amount in pairs(habilidade.cc_break_oque) do habilidade_tabela1.cc_break_oque [_spellid] = (habilidade_tabela1.cc_break_oque [_spellid] or 0) - amount end - - for target_name, amount in pairs(habilidade.targets) do + + for target_name, amount in pairs(habilidade.targets) do habilidade_tabela1.targets [target_name] = (habilidade_tabela1.targets [target_name] or 0) - amount end - + subtrair_keys (habilidade, habilidade_tabela1) end @@ -3314,6 +3319,6 @@ atributo_misc.__sub = function(tabela1, tabela2) tabela1.cc_break_oque [spellid] = (tabela1.cc_break_oque [spellid] or 0) - amount end end - + return tabela1 end diff --git a/core/parser.lua b/core/parser.lua index 033eb76d..bb39f4a0 100755 --- a/core/parser.lua +++ b/core/parser.lua @@ -102,7 +102,9 @@ --cache local cacheAnything = { arenaHealth = {}, + paladin_vivaldi_blessings = {}, } + --druids kyrian bounds local druid_kyrian_bounds = {} --remove on 10.0 --spell containers for special cases @@ -961,7 +963,14 @@ --Light of the Martyr - paladin spell which causes damage to the caster it self elseif (spellid == 196917) then -- or spellid == 183998 < healing part return parser:LOTM_damage(token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spelltype, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand) + + elseif (spellid == 388009 or spellid == 388012) then --damage from the paladin blessings of the seasons + local blessingSource = cacheAnything.paladin_vivaldi_blessings[who_serial] + if (blessingSource) then + who_serial, who_name, who_flags = unpack(blessingSource) + end end + --end if (isWOTLK) then @@ -2739,7 +2748,10 @@ end end - if (spellid == 27827) then --spirit of redemption (holy ~priest) ~spirit + if (spellid == 388007 or spellid == 388011) then --buff: bleesing of the summer and winter + cacheAnything.paladin_vivaldi_blessings[alvo_serial] = {who_serial, who_name, who_flags} + + elseif (spellid == 27827) then --spirit of redemption (holy ~priest) ~spirit --C_Timer.After(0.1, function() parser:dead ("UNIT_DIED", time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags) ignore_death [who_name] = true @@ -3235,6 +3247,9 @@ elseif (spellid == SPELLID_NECROMANCER_CHEAT_DEATH) then --remove on 10.0 necro_cheat_deaths[who_serial] = nil + + elseif (spellid == 388007 or spellid == 388011) then --buff: bleesing of the summer + cacheAnything.paladin_vivaldi_blessings[alvo_serial] = nil end --druid kyrian empower bounds (9.0 kyrian covenant - probably remove on 10.0) @@ -6342,7 +6357,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 return _detalhes.cache_healing_group end - function _detalhes:ClearParserCache() + function _detalhes:ClearParserCache() --~wipe wipe(damage_cache) wipe(damage_cache_pets) wipe(damage_cache_petsOwners) @@ -6365,6 +6380,8 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 wipe(dk_pets_cache.army) wipe(dk_pets_cache.apoc) + wipe(cacheAnything.paladin_vivaldi_blessings) + damage_cache = setmetatable({}, _detalhes.weaktable) damage_cache_pets = setmetatable({}, _detalhes.weaktable) damage_cache_petsOwners = setmetatable({}, _detalhes.weaktable) diff --git a/core/util.lua b/core/util.lua index 5c327c37..763477c1 100644 --- a/core/util.lua +++ b/core/util.lua @@ -2,6 +2,7 @@ local _detalhes = _G._detalhes local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" ) + local addonName, Details222 = ... local _ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -1124,15 +1125,17 @@ end return true elseif (IsInRaid()) then + local unitIdCache = Details222.UnitIdCache.Raid for i = 1, GetNumGroupMembers(), 1 do - if (UnitAffectingCombat("raid"..i)) then + if (UnitAffectingCombat(unitIdCache[i])) then return true end end elseif (IsInGroup()) then + local unitIdCache = Details222.UnitIdCache.Party for i = 1, GetNumGroupMembers()-1, 1 do - if (UnitAffectingCombat("party"..i)) then + if (UnitAffectingCombat(unitIdCache[i])) then return true end end @@ -1150,7 +1153,7 @@ end end end - _detalhes:SairDoCombate() + Details:SairDoCombate() end function _detalhes:FindGUIDFromName (name) diff --git a/frames/window_playerbreakdown.lua b/frames/window_playerbreakdown.lua index 28d92dd7..cb39d1a3 100644 --- a/frames/window_playerbreakdown.lua +++ b/frames/window_playerbreakdown.lua @@ -3025,6 +3025,10 @@ function gump:CriaJanelaInfo() if (miscActor and miscActor.buff_uptime_spells) then for spellID, spellObject in pairs(miscActor.buff_uptime_spells._ActorTable) do local spellName, _, spellIcon = GetSpellInfo(spellID) + if (not spellObject.uptime) then + print(_GetSpellInfo(spellID)) + dumpt(spellObject) + end tinsert(newAuraTable, {spellIcon, spellName, spellObject.uptime, spellObject.appliedamt, spellObject.refreshamt, spellObject.uptime/combatTime*100, spellID = spellID}) end end diff --git a/functions/classes.lua b/functions/classes.lua index 9286ba57..93e906d9 100644 --- a/functions/classes.lua +++ b/functions/classes.lua @@ -181,12 +181,26 @@ do function _detalhes:GetFlag (actor) return self.flag_original or actor and actor.flag_original end + + function _detalhes:GetSpells() + return self.spells._ActorTable + end function _detalhes:GetActorSpells() return self.spells._ActorTable end - function _detalhes:GetSpell (spellid) + + function _detalhes:GetSpell(spellid) return self.spells._ActorTable [spellid] end + + ---return an array of pet names + ---@return table + function _detalhes:GetPets() + return self.pets + end + + ---return an array of pet names + ---@return table function _detalhes:Pets() return self.pets end diff --git a/functions/spellcache.lua b/functions/spellcache.lua index 33d912cf..ff18823e 100644 --- a/functions/spellcache.lua +++ b/functions/spellcache.lua @@ -381,7 +381,7 @@ do -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --Cache All Spells - function Details:BuildSpellListSlow() + function Details:BuildSpellListSlow() -- this is not in use local load_frame = _G.DetailsLoadSpellCache if (load_frame and (load_frame.completed or load_frame.inprogress)) then