diff --git a/boot.lua b/boot.lua index aeb0c468..ebfae4ee 100644 --- a/boot.lua +++ b/boot.lua @@ -8,10 +8,10 @@ _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") - _detalhes.userversion = "v1.6.0" + _detalhes.userversion = "v1.6.1" _detalhes.version = "Alpha 010" _detalhes.realversion = 10 - + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> initialization stuff diff --git a/classes/classe_combate.lua b/classes/classe_combate.lua index 49360e0d..c1c84563 100644 --- a/classes/classe_combate.lua +++ b/classes/classe_combate.lua @@ -21,6 +21,7 @@ local _ipairs = ipairs --> lua api local _pairs = pairs --> lua api local _bit_band = bit.band --> lua api local _date = date --> lua api +local _table_remove = table.remove --time hold local _tempo = time() @@ -268,294 +269,113 @@ function _detalhes.clear:c_combate (tabela_combate) tabela_combate.shadow = nil end -combate.__sub = function (overall, combate) +combate.__sub = function (combate1, combate2) - --> subtrai no damage - for index, classe_damage in _ipairs (combate [1]._ActorTable) do - - local nome = classe_damage.nome - local no_overall = overall[1]._ActorTable [overall[1]._NameIndexTable [nome]] - - --> ator do damage - no_overall = no_overall - classe_damage - - --> alvos - local alvos = classe_damage.targets - for index, alvo in _ipairs (alvos._ActorTable) do - local alvo_overall = no_overall.targets._ActorTable [no_overall.targets._NameIndexTable [alvo.nome]] - alvo_overall = alvo_overall - alvo - end - - --> habilidades - local habilidades = classe_damage.spell_tables - for _spellid, habilidade in _pairs (habilidades._ActorTable) do - local habilidade_overall = no_overall.spell_tables._ActorTable [_spellid] - habilidade_overall = habilidade_overall - habilidade - - --> alvos das habilidades - local alvos = habilidade.targets - for index, alvo in _ipairs (alvos._ActorTable) do - local alvo_overall = habilidade_overall.targets._ActorTable [habilidade_overall.targets._NameIndexTable [alvo.nome]] - alvo_overall = alvo_overall - alvo - end - end - end - - --> foreach na cura - for index, classe_heal in _ipairs (combate[2]._ActorTable) do - local nome = classe_heal.nome - local no_overall = overall[2]._ActorTable [overall[2]._NameIndexTable [nome]] - no_overall = no_overall - classe_heal - - local alvos = classe_heal.targets - for index, alvo in _ipairs (alvos._ActorTable) do - local alvo_overall = no_overall.targets._ActorTable [no_overall.targets._NameIndexTable [alvo.nome]] - alvo_overall = alvo_overall - alvo - end - - local habilidades = classe_heal.spell_tables - for _spellid, habilidade in _pairs (habilidades._ActorTable) do - local habilidade_overall = no_overall.spell_tables._ActorTable [_spellid] - habilidade_overall = habilidade_overall - habilidade - - local alvos = habilidade.targets - for index, alvo in _ipairs (alvos._ActorTable) do - local alvo_overall = habilidade_overall.targets._ActorTable [habilidade_overall.targets._NameIndexTable [alvo.nome]] - alvo_overall = alvo_overall - alvo - end - end - end - - --> foreach na e_energy - for index, classe_energy in _ipairs (combate[3]._ActorTable) do - local nome = classe_energy.nome - local no_overall = overall[3]._ActorTable [overall[3]._NameIndexTable [nome]] - no_overall = no_overall - classe_energy - - local alvos = classe_energy.targets - for index, alvo in _ipairs (alvos._ActorTable) do - local alvo_overall = no_overall.targets._ActorTable [no_overall.targets._NameIndexTable [alvo.nome]] - alvo_overall = alvo_overall - alvo - end - - local habilidades = classe_energy.spell_tables - for _spellid, habilidade in _pairs (habilidades._ActorTable) do - local habilidade_overall = no_overall.spell_tables._ActorTable [_spellid] - habilidade_overall = habilidade_overall - habilidade - - local alvos = habilidade.targets - for index, alvo in _ipairs (alvos._ActorTable) do - local alvo_overall = habilidade_overall.targets._ActorTable [habilidade_overall.targets._NameIndexTable [alvo.nome]] - alvo_overall = alvo_overall - alvo - end - end - end - - --> foreach no misc - for index, classe_misc in _ipairs (combate[4]._ActorTable) do - local nome = classe_misc.nome - local no_overall = overall[4]._ActorTable [overall[4]._NameIndexTable [nome]] - no_overall = no_overall - classe_misc - - if (classe_misc.cooldowns_defensive) then - local alvos = classe_misc.cooldowns_defensive_targets - local habilidades = classe_misc.cooldowns_defensive_spell_tables - - for index, alvo in _ipairs (alvos._ActorTable) do - local alvo_overall = no_overall.cooldowns_defensive_targets._ActorTable [no_overall.cooldowns_defensive_targets._NameIndexTable [alvo.nome]] - alvo_overall = alvo_overall - alvo - end - - for _spellid, habilidade in _pairs (habilidades._ActorTable) do - local habilidade_overall = no_overall.cooldowns_defensive_spell_tables._ActorTable [_spellid] - habilidade_overall = habilidade_overall - habilidade - - local alvos = habilidade.targets - for index, alvo in _ipairs (alvos._ActorTable) do - local alvo_overall = habilidade_overall.targets._ActorTable [habilidade_overall.targets._NameIndexTable [alvo.nome]] - alvo_overall = alvo_overall - alvo - end - end - end - - if (classe_misc.interrupt) then - local alvos = classe_misc.interrupt_targets - local habilidades = classe_misc.interrupt_spell_tables - - for index, alvo in _ipairs (alvos._ActorTable) do - local alvo_overall = no_overall.interrupt_targets._ActorTable [no_overall.interrupt_targets._NameIndexTable [alvo.nome]] - alvo_overall = alvo_overall - alvo - end - - for _spellid, habilidade in _pairs (habilidades._ActorTable) do - local habilidade_overall = no_overall.interrupt_spell_tables._ActorTable [_spellid] - habilidade_overall = habilidade_overall - habilidade - - local alvos = habilidade.targets - for index, alvo in _ipairs (alvos._ActorTable) do - local alvo_overall = habilidade_overall.targets._ActorTable [habilidade_overall.targets._NameIndexTable [alvo.nome]] - alvo_overall = alvo_overall - alvo - end - end - end - - if (classe_misc.ress) then - local alvos = classe_misc.ress_targets - local habilidades = classe_misc.ress_spell_tables - - for index, alvo in _ipairs (alvos._ActorTable) do - local alvo_overall = no_overall.ress_targets._ActorTable [no_overall.ress_targets._NameIndexTable [alvo.nome]] - alvo_overall = alvo_overall - alvo - end - - for _spellid, habilidade in _pairs (habilidades._ActorTable) do - local habilidade_overall = no_overall.ress_spell_tables._ActorTable [_spellid] - habilidade_overall = habilidade_overall - habilidade - - local alvos = habilidade.targets - for index, alvo in _ipairs (alvos._ActorTable) do - local alvo_overall = habilidade_overall.targets._ActorTable [habilidade_overall.targets._NameIndexTable [alvo.nome]] - alvo_overall = alvo_overall - alvo - end - end - end - - if (classe_misc.dispell) then - local alvos = classe_misc.dispell_targets - local habilidades = classe_misc.dispell_spell_tables - - for index, alvo in _ipairs (alvos._ActorTable) do - local alvo_overall = no_overall.dispell_targets._ActorTable [no_overall.dispell_targets._NameIndexTable [alvo.nome]] - alvo_overall = alvo_overall - alvo - end - - for _spellid, habilidade in _pairs (habilidades._ActorTable) do - local habilidade_overall = no_overall.dispell_spell_tables._ActorTable [_spellid] - habilidade_overall = habilidade_overall - habilidade - - local alvos = habilidade.targets - for index, alvo in _ipairs (alvos._ActorTable) do - local alvo_overall = habilidade_overall.targets._ActorTable [habilidade_overall.targets._NameIndexTable [alvo.nome]] - alvo_overall = alvo_overall - alvo - end - end - end - - if (classe_misc.cc_break) then - local alvos = classe_misc.cc_break_targets - local habilidades = classe_misc.cc_break_spell_tables - - for index, alvo in _ipairs (alvos._ActorTable) do - local alvo_overall = no_overall.cc_break_targets._ActorTable [no_overall.cc_break_targets._NameIndexTable [alvo.nome]] - alvo_overall = alvo_overall - alvo - end - - for _spellid, habilidade in _pairs (habilidades._ActorTable) do - local habilidade_overall = no_overall.cc_break_spell_tables._ActorTable [_spellid] - habilidade_overall = habilidade_overall - habilidade - - local alvos = habilidade.targets - for index, alvo in _ipairs (alvos._ActorTable) do - local alvo_overall = habilidade_overall.targets._ActorTable [habilidade_overall.targets._NameIndexTable [alvo.nome]] - alvo_overall = alvo_overall - alvo - end - end - end - - end - - --> diminui o total - overall.totals[1] = overall.totals[1] - combate.totals[1] - overall.totals[2] = overall.totals[2] - combate.totals[2] - - overall.totals[3].mana = overall.totals[3].mana - combate.totals[3].mana - overall.totals[3].e_rage = overall.totals[3].e_rage - combate.totals[3].e_rage - overall.totals[3].e_energy = overall.totals[3].e_energy - combate.totals[3].e_energy - overall.totals[3].runepower = overall.totals[3].runepower - combate.totals[3].runepower - - overall.totals[4].cc_break = overall.totals[4].cc_break - combate.totals[4].cc_break - overall.totals[4].ress = overall.totals[4].ress - combate.totals[4].ress - overall.totals[4].interrupt = overall.totals[4].interrupt - combate.totals[4].interrupt - overall.totals[4].dispell = overall.totals[4].dispell - combate.totals[4].dispell - overall.totals[4].dead = overall.totals[4].dead - combate.totals[4].dead - overall.totals[4].cooldowns_defensive = overall.totals[4].cooldowns_defensive - combate.totals[4].cooldowns_defensive - - overall.totals_grupo[1] = overall.totals_grupo[1] - combate.totals_grupo[1] - overall.totals_grupo[2] = overall.totals_grupo[2] - combate.totals_grupo[2] - - overall.totals_grupo[3].mana = overall.totals_grupo[3].mana - combate.totals_grupo[3].mana - overall.totals_grupo[3].e_rage = overall.totals_grupo[3].e_rage - combate.totals_grupo[3].e_rage - overall.totals_grupo[3].e_energy = overall.totals_grupo[3].e_energy - combate.totals_grupo[3].e_energy - overall.totals_grupo[3].runepower = overall.totals_grupo[3].runepower - combate.totals_grupo[3].runepower - - overall.totals_grupo[4].cc_break = overall.totals_grupo[4].cc_break - combate.totals_grupo[4].cc_break - overall.totals_grupo[4].ress = overall.totals_grupo[4].ress - combate.totals_grupo[4].ress - overall.totals_grupo[4].interrupt = overall.totals_grupo[4].interrupt - combate.totals_grupo[4].interrupt - overall.totals_grupo[4].dispell = overall.totals_grupo[4].dispell - combate.totals_grupo[4].dispell - overall.totals_grupo[4].dead = overall.totals_grupo[4].dead - combate.totals_grupo[4].dead - overall.totals_grupo[4].cooldowns_defensive = overall.totals_grupo[4].cooldowns_defensive - combate.totals_grupo[4].cooldowns_defensive - - for fragName, fragAmount in pairs (combate.frags) do - if (fragAmount and overall.frags [fragName]) then --> not sure why - overall.frags [fragName] = overall.frags [fragName] - fragAmount - end + if (combate1~= _detalhes.tabela_overall) then + return end - overall.frags_need_refresh = true + + --> sub dano + for index, actor_T2 in _ipairs (combate2[1]._ActorTable) do + local actor_T1 = combate1[1]:PegarCombatente (actor_T2.serial, actor_T2.nome, actor_T2.flag_original, true) + actor_T1 = actor_T1 - actor_T2 + actor_T2:subtract_total (combate1) + end + combate1 [1].need_refresh = true + + --> sub heal + for index, actor_T2 in _ipairs (combate2[2]._ActorTable) do + local actor_T1 = combate1[2]:PegarCombatente (actor_T2.serial, actor_T2.nome, actor_T2.flag_original, true) + actor_T1 = actor_T1 - actor_T2 + actor_T2:subtract_total (combate1) + end + combate1 [2].need_refresh = true + + --> sub energy + for index, actor_T2 in _ipairs (combate2[3]._ActorTable) do + local actor_T1 = combate1[3]:PegarCombatente (actor_T2.serial, actor_T2.nome, actor_T2.flag_original, true) + actor_T1 = actor_T1 - actor_T2 + actor_T2:subtract_total (combate1) + end + combate1 [3].need_refresh = true + + --> sub misc + for index, actor_T2 in _ipairs (combate2[4]._ActorTable) do + local actor_T1 = combate1[4]:PegarCombatente (actor_T2.serial, actor_T2.nome, actor_T2.flag_original, true) + actor_T1 = actor_T1 - actor_T2 + actor_T2:subtract_total (combate1) + end + combate1 [4].need_refresh = true + + --> reduz o tempo + combate1.start_time = combate1.start_time + (combate2.end_time - combate2.start_time) + + --> apaga as mortes da luta diminuida + local amt_mortes = #combate2.last_events_tables --> quantas mortes teve nessa luta + if (amt_mortes > 0) then + for i = #combate1.last_events_tables, #combate1.last_events_tables-amt_mortes, -1 do + _table_remove (combate1.last_events_tables, #combate1.last_events_tables) + end + end + + --> frags + for fragName, fragAmount in pairs (combate2.frags) do + if (fragAmount) then + if (combate1.frags [fragName]) then + combate1.frags [fragName] = combate1.frags [fragName] - fragAmount + else + combate1.frags [fragName] = fragAmount + end + end + end + combate1.frags_need_refresh = true + + return combate1 - return overall end combate.__add = function (combate1, combate2) + + if (combate1 == _detalhes.tabela_overall or combate2 == _detalhes.tabela_overall) then + return + end + --> add dano for index, actor_T2 in _ipairs (combate2[1]._ActorTable) do local actor_T1 = combate1[1]:PegarCombatente (actor_T2.serial, actor_T2.nome, actor_T2.flag_original, true) actor_T1 = actor_T1 + actor_T2 + actor_T1:add_total (combate1) + actor_T1:add_total (_detalhes.tabela_overall) end + combate1 [1].need_refresh = true + --> add heal for index, actor_T2 in _ipairs (combate2[2]._ActorTable) do local actor_T1 = combate1[2]:PegarCombatente (actor_T2.serial, actor_T2.nome, actor_T2.flag_original, true) actor_T1 = actor_T1 + actor_T2 + actor_T1:add_total (combate1) + actor_T1:add_total (_detalhes.tabela_overall) end + combate1 [2].need_refresh = true + --> add energy for index, actor_T2 in _ipairs (combate2[3]._ActorTable) do local actor_T1 = combate1[3]:PegarCombatente (actor_T2.serial, actor_T2.nome, actor_T2.flag_original, true) actor_T1 = actor_T1 + actor_T2 + actor_T1:add_total (combate1) + actor_T1:add_total (_detalhes.tabela_overall) end + combate1 [3].need_refresh = true + --> add misc for index, actor_T2 in _ipairs (combate2[4]._ActorTable) do local actor_T1 = combate1[4]:PegarCombatente (actor_T2.serial, actor_T2.nome, actor_T2.flag_original, true) actor_T1 = actor_T1 + actor_T2 + actor_T1:add_total (combate1) + actor_T1:add_total (_detalhes.tabela_overall) end - --> aumenta o total - combate1.totals[1] = combate1.totals[1] - combate2.totals[1] - combate1.totals[2] = combate1.totals[2] - combate2.totals[2] - - combate1.totals[3].mana = combate1.totals[3].mana - combate2.totals[3].mana - combate1.totals[3].e_rage = combate1.totals[3].e_rage - combate2.totals[3].e_rage - combate1.totals[3].e_energy = combate1.totals[3].e_energy - combate2.totals[3].e_energy - combate1.totals[3].runepower = combate1.totals[3].runepower - combate2.totals[3].runepower - - combate1.totals[4].cc_break = combate1.totals[4].cc_break - combate2.totals[4].cc_break - combate1.totals[4].ress = combate1.totals[4].ress - combate2.totals[4].ress - combate1.totals[4].interrupt = combate1.totals[4].interrupt - combate2.totals[4].interrupt - combate1.totals[4].dispell = combate1.totals[4].dispell - combate2.totals[4].dispell - combate1.totals[4].dead = combate1.totals[4].dead - combate2.totals[4].dead - combate1.totals[4].cooldowns_defensive = combate1.totals[4].cooldowns_defensive - combate2.totals[4].cooldowns_defensive - - combate1.totals_grupo[1] = combate1.totals_grupo[1] - combate2.totals_grupo[1] - combate1.totals_grupo[2] = combate1.totals_grupo[2] - combate2.totals_grupo[2] - - combate1.totals_grupo[3].mana = combate1.totals_grupo[3].mana - combate2.totals_grupo[3].mana - combate1.totals_grupo[3].e_rage = combate1.totals_grupo[3].e_rage - combate2.totals_grupo[3].e_rage - combate1.totals_grupo[3].e_energy = combate1.totals_grupo[3].e_energy - combate2.totals_grupo[3].e_energy - combate1.totals_grupo[3].runepower = combate1.totals_grupo[3].runepower - combate2.totals_grupo[3].runepower - - combate1.totals_grupo[4].cc_break = combate1.totals_grupo[4].cc_break - combate2.totals_grupo[4].cc_break - combate1.totals_grupo[4].ress = combate1.totals_grupo[4].ress - combate2.totals_grupo[4].ress - combate1.totals_grupo[4].interrupt = combate1.totals_grupo[4].interrupt - combate2.totals_grupo[4].interrupt - combate1.totals_grupo[4].dispell = combate1.totals_grupo[4].dispell - combate2.totals_grupo[4].dispell - combate1.totals_grupo[4].dead = combate1.totals_grupo[4].dead - combate2.totals_grupo[4].dead - combate1.totals_grupo[4].cooldowns_defensive = combate1.totals_grupo[4].cooldowns_defensive - combate2.totals_grupo[4].cooldowns_defensive + combate1 [4].need_refresh = true + --> aumenta o tempo combate1.start_time = combate1.start_time - (combate2.end_time - combate2.start_time) --> frags @@ -577,46 +397,3 @@ end function _detalhes:UpdateCombat() _tempo = _detalhes._tempo end - ---[[ - local nome = actor_T2.nome - - --> actor principal - local actor_T1 = combate1[1]._ActorTable [combate1[1]._NameIndexTable [nome] ] - if (not actor_T1) then --> precisa cria-lo - actor_T1 = combate1[1]:PegarCombatente (actor_T2.serial, nome, actor_T2.flag_original, true) - end - - if (actor_T1) then - - --> add basic members - actor_T1 = actor_T1 + actor_T2 - - --> alvos - local alvos = actor_T2.targets - for index, alvo in _ipairs (alvos._ActorTable) do - local alvo_T1 = actor_T1.targets._ActorTable [actor_T1.targets._NameIndexTable [alvo.nome] ] - if (not alvo_T1) then - alvo_T1 = actor_T1.targets:PegarCombatente (alvo.serial, alvo.nome, alvo.flag_original, true) - end - alvo_T1 = alvo_T1 + alvo - end - - --> spells - local habilidades = actor_T2.spell_tables - for _spellid, habilidade in _pairs (habilidades._ActorTable) do - local habilidade_T1 = actor_T1.spell_tables._ActorTable [_spellid] - if (not habilidade_T1) then - - end - - habilidade_overall = habilidade_overall - habilidade - - local alvos = habilidade.targets - for index, alvo in _ipairs (alvos._ActorTable) do - local alvo_overall = habilidade_overall.targets._ActorTable [habilidade_overall.targets._NameIndexTable [alvo.nome] ] - alvo_overall = alvo_overall - alvo - end - end - end ---]] \ No newline at end of file diff --git a/classes/classe_damage.lua b/classes/classe_damage.lua index b38324c6..5b92ac0b 100644 --- a/classes/classe_damage.lua +++ b/classes/classe_damage.lua @@ -730,7 +730,7 @@ function atributo_damage:AtualizaBarra (instancia, barras_container, qual_barra, local porcentagem = self [keyName] / total * 100 local esta_porcentagem - if ((_detalhes.time_type == 2 and self.grupo) or not _detalhes:CaptureGet ("damage")) then + if ((_detalhes.time_type == 2 and self.grupo) or not _detalhes:CaptureGet ("damage") or not self.shadow) then dps = damage_total / combat_time self.last_dps = dps else @@ -2139,7 +2139,7 @@ function atributo_damage:MontaDetalhesDamageDone (spellid, barra) for i = #data+2, 5 do gump:HidaDetalheInfo (i) end - + end @@ -2193,13 +2193,13 @@ function atributo_damage:Iniciar (iniciar) self:RegistrarNaTimeMachine() --coloca ele da timeMachine if (self.shadow) then self.shadow.dps_started = true --> isso foi posto recentemente - self.shadow:RegistrarNaTimeMachine() + --self.shadow:RegistrarNaTimeMachine() end else self.dps_started = false self:DesregistrarNaTimeMachine() --retira ele da timeMachine if (self.shadow) then - self.shadow:DesregistrarNaTimeMachine() + --self.shadow:DesregistrarNaTimeMachine() self.shadow.dps_started = false --> isso foi posto recentemente end end @@ -2215,6 +2215,12 @@ end combat_table.totals_grupo [class_type] = combat_table.totals_grupo [class_type] - self.total end end + function atributo_damage:add_total (combat_table) + combat_table.totals [class_type] = combat_table.totals [class_type] + self.total + if (self.grupo) then + combat_table.totals_grupo [class_type] = combat_table.totals_grupo [class_type] + self.total + end + end --> restaura a tabela de last event function atributo_damage:r_last_events_table (actor) @@ -2224,49 +2230,113 @@ end actor.last_events_table = _detalhes:CreateActorLastEventTable() end - --> restaura e liga o ator com a sua shadow durante a inicialização + --> restaura e liga o ator com a sua shadow durante a inicialização (startup function) function atributo_damage:r_connect_shadow (actor) if (not actor) then actor = self end - - local overall_dano = _detalhes.tabela_overall [1] - local shadow = overall_dano._ActorTable [overall_dano._NameIndexTable [actor.nome]] - - --> constroi a shadow se não tiver uma - if (not shadow) then - shadow = overall_dano:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true) - shadow.classe = actor.classe - shadow.start_time = time() - shadow.end_time = time() - end - - --> reconstruir o container do friendly fire shadow - for index, friendlyfire in _ipairs (actor.friendlyfire._ActorTable) do - local ff_shadow = shadow.friendlyfire:PegarCombatente (friendlyfire.serial, friendlyfire.nome, friendlyfire.flag_original, true) - friendlyfire.shadow = ff_shadow - --nao reconstroi as habilidades aqui - end - - --> aplica a meta e indexes - _detalhes.refresh:r_atributo_damage (actor, shadow) - - --> soma os valores - shadow = shadow + actor - - --> reconstroi o container de alvos - for index, alvo in _ipairs (actor.targets._ActorTable) do - _detalhes.refresh:r_alvo_da_habilidade (alvo, shadow.targets) - end - - --> reconstroi o container de habilidades - for spellid, habilidade in _pairs (actor.spell_tables._ActorTable) do - _detalhes.refresh:r_habilidade_dano (habilidade, shadow.spell_tables) - for index, alvo in _ipairs (habilidade.targets._ActorTable) do - _detalhes.refresh:r_alvo_da_habilidade (alvo, habilidade.targets.shadow) + + --> criar uma shadow desse ator se ainda não tiver uma + local overall_dano = _detalhes.tabela_overall [1] + local shadow = overall_dano._ActorTable [overall_dano._NameIndexTable [actor.nome]] + + if (not shadow) then + shadow = overall_dano:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true) + shadow.classe = actor.classe + shadow.grupo = actor.grupo + shadow.start_time = time() - 3 + shadow.end_time = time() + end + + --> restaura a meta e indexes ao ator + _detalhes.refresh:r_atributo_damage (actor, shadow) + + --> tempo decorrido (captura de dados) + if (actor.end_time) then + local tempo = (actor.end_time or time()) - actor.start_time + shadow.start_time = shadow.start_time - tempo + end + + --> total de dano (captura de dados) + shadow.total = shadow.total + actor.total + --> total de dano sem o pet (captura de dados) + shadow.total_without_pet = shadow.total_without_pet + actor.total_without_pet + --> total de dano que o ator sofreu (captura de dados) + shadow.damage_taken = shadow.damage_taken + actor.damage_taken + --> total do friendly fire causado + shadow.friendlyfire_total = shadow.friendlyfire_total + actor.friendlyfire_total + + --> total no combate overall (captura de dados) + _detalhes.tabela_overall.totals[1] = _detalhes.tabela_overall.totals[1] + actor.total + if (actor.grupo) then + _detalhes.tabela_overall.totals_grupo[1] = _detalhes.tabela_overall.totals_grupo[1] + actor.total + end + + --> copia o damage_from (captura de dados) + for nome, _ in _pairs (actor.damage_from) do + shadow.damage_from [nome] = true + end + + --> copia o container de alvos (captura de dados) + for index, alvo in _ipairs (actor.targets._ActorTable) do + --> cria e soma o valor do total + local alvo_shadow = shadow.targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_shadow.total = alvo_shadow.total + alvo.total + --> refresh no alvo + _detalhes.refresh:r_alvo_da_habilidade (alvo, shadow.targets) + end + + --> copia o container de habilidades (captura de dados) + for spellid, habilidade in _pairs (actor.spell_tables._ActorTable) do + --> cria e soma o valor + local habilidade_shadow = shadow.spell_tables:PegaHabilidade (spellid, true, nil, true) + --> refresh e soma os valores dos alvos + for index, alvo in _ipairs (habilidade.targets._ActorTable) do + --> cria e soma o valor do total + local alvo_shadow = habilidade_shadow.targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_shadow.total = alvo_shadow.total + alvo.total + --> refresh no alvo da habilidade + _detalhes.refresh:r_alvo_da_habilidade (alvo, habilidade_shadow.targets) + end + --> soma todos os demais valores + for key, value in _pairs (habilidade) do + if (_type (value) == "number") then + if (key ~= "id") then + if (not habilidade_shadow [key]) then + habilidade_shadow [key] = 0 + end + habilidade_shadow [key] = habilidade_shadow [key] + value + end + end + end + + --> refresh na habilidade + _detalhes.refresh:r_habilidade_dano (habilidade, shadow.spell_tables) + end + + --> copia o container de friendly fire (captura de dados) + for index, friendlyFire in _ipairs (actor.friendlyfire._ActorTable) do + --> cria ou pega a shadow + local friendlyFire_shadow = shadow.friendlyfire:PegarCombatente (nil, friendlyFire.nome, nil, true) + --> refresh na tabela e no container de habilidades + _setmetatable (friendlyFire, _detalhes) + friendlyFire.shadow = friendlyFire_shadow + --> soma o total + friendlyFire_shadow.total = friendlyFire_shadow.total + friendlyFire.total + + for spellid, habilidade in _pairs (friendlyFire.spell_tables._ActorTable) do + --> cria ou pega a habilidade no container de habilidade + local habilidade_shadow = friendlyFire_shadow.spell_tables:PegaHabilidade (spellid, true, nil, true) + --> soma os valores + habilidade_shadow.counter = habilidade_shadow.counter + habilidade.counter + habilidade_shadow.total = habilidade_shadow.total + habilidade.total + --> refresh na habilidade + _detalhes.refresh:r_habilidade_dano (habilidade, friendlyFire_shadow.spell_tables) + end + --> refresh na meta e indexes + _detalhes.refresh:r_container_habilidades (friendlyFire.spell_tables, friendlyFire_shadow.spell_tables) end - end return shadow end @@ -2285,41 +2355,17 @@ function atributo_damage:ColetarLixo (lastevent) return _detalhes:ColetarLixo (class_type, lastevent) end -local function ReconstroiMapa (tabela) - local mapa = {} - for i = 1, #tabela._ActorTable do - mapa [tabela._ActorTable[i].nome] = i - end - tabela._NameIndexTable = mapa -end - function _detalhes.refresh:r_atributo_damage (este_jogador, shadow) - _setmetatable (este_jogador, _detalhes.atributo_damage) - este_jogador.__index = _detalhes.atributo_damage - - if (shadow ~= -1) then - + + --> restaura metas do ator + _setmetatable (este_jogador, _detalhes.atributo_damage) + este_jogador.__index = _detalhes.atributo_damage + --> atribui a shadow a ele este_jogador.shadow = shadow - + --> restaura as metas dos container de alvos, habilidades e ff _detalhes.refresh:r_container_combatentes (este_jogador.targets, shadow.targets) _detalhes.refresh:r_container_combatentes (este_jogador.friendlyfire, shadow.friendlyfire) _detalhes.refresh:r_container_habilidades (este_jogador.spell_tables, shadow.spell_tables) - - for index, friendlyfire in _ipairs (este_jogador.friendlyfire._ActorTable) do - - _setmetatable (friendlyfire, _detalhes) - - local friendlyfire_shadow = shadow.friendlyfire:PegarCombatente (nil, friendlyfire.nome) --> corrigido erro aqui, estava este_jogador.nome - _detalhes.refresh:r_container_habilidades (friendlyfire.spell_tables, friendlyfire_shadow.spell_tables) -- acho que corrigi mais um bug, estava apenas 'friendlyfire_shadow' - - end - else - _detalhes.refresh:r_container_combatentes (este_jogador.targets, -1) - _detalhes.refresh:r_container_combatentes (este_jogador.friendlyfire, -1) - _detalhes.refresh:r_container_habilidades (este_jogador.spell_tables, -1) - _detalhes.refresh:r_container_habilidades (este_jogador.friendlyfire.spell_tables, -1) - end - end function _detalhes.clear:c_atributo_damage (este_jogador) @@ -2351,106 +2397,131 @@ function _detalhes.clear:c_atributo_damage_FF (container) end end -atributo_damage.__add = function (shadow, tabela2) +atributo_damage.__add = function (tabela1, tabela2) --> tempo decorrido - local tempo = (tabela2.end_time or time()) - tabela2.start_time - shadow.start_time = shadow.start_time - tempo + local tempo = (tabela2.end_time or time()) - tabela2.start_time + tabela1.start_time = tabela1.start_time - tempo --> total de dano - shadow.total = shadow.total + tabela2.total - - if ( not (shadow.shadow and tabela2.shadow) ) then - _detalhes.tabela_overall.totals[1] = _detalhes.tabela_overall.totals[1] + tabela2.total - - if (tabela2.grupo) then - _detalhes.tabela_overall.totals_grupo[1] = _detalhes.tabela_overall.totals_grupo[1] + tabela2.total - end - end - + tabela1.total = tabela1.total + tabela2.total --> total de dano sem o pet - shadow.total_without_pet = shadow.total_without_pet + tabela2.total_without_pet + tabela1.total_without_pet = tabela1.total_without_pet + tabela2.total_without_pet --> total de dano que o cara levou - shadow.damage_taken = shadow.damage_taken + tabela2.damage_taken + tabela1.damage_taken = tabela1.damage_taken + tabela2.damage_taken + --> total do friendly fire causado + tabela1.friendlyfire_total = tabela1.friendlyfire_total + tabela2.friendlyfire_total - --> copia o damage_from - for nome, _ in _pairs (tabela2.damage_from) do - shadow.damage_from [nome] = true - end - - --> copia o container de alvos - for index, alvo in _ipairs (tabela2.targets._ActorTable) do - local alvo_shadow = shadow.targets:PegarCombatente (alvo.serial, alvo.nome, nil, true) - alvo_shadow.total = alvo_shadow.total + alvo.total - end - --> copia o container de friendly fire - for index, friendlyFire in _ipairs (tabela2.friendlyfire._ActorTable) do - -- friendlyFire é uma tabela com .total e .spell_tables -- habilidade é um container de habilidades tipo damage - local friendlyFire_shadow = shadow.friendlyfire:PegarCombatente (friendlyFire.serial, friendlyFire.nome, friendlyFire.flag_original, true) - --_detalhes:DelayMsg ("+ achou -> " .. friendlyFire_shadow.nome) - - --friendlyFire_shadow agora tem uma tabela com .total e .spell_tables - friendlyFire_shadow.total = friendlyFire_shadow.total + friendlyFire.total - - --> container de habilidade - - local shadow_habilidades = friendlyFire_shadow.spell_tables - - for spellid, habilidade in _pairs (friendlyFire.spell_tables._ActorTable) do - - local habilidade_shadow = friendlyFire_shadow.spell_tables:PegaHabilidade (spellid, true, nil, true) - - habilidade_shadow.counter = habilidade_shadow.counter + habilidade.counter - habilidade_shadow.total = habilidade_shadow.total + habilidade.total - habilidade.shadow = habilidade_shadow --> aqui ele linka a habilidade com a shadow dele - - --> restaura a metatable das habilidades - _detalhes.refresh:r_habilidade_dano (habilidade, shadow_habilidades) - + --> soma o damage_from + for nome, _ in _pairs (tabela2.damage_from) do + tabela1.damage_from [nome] = true end - end - --> copia o container de habilidades - for spellid, habilidade in _pairs (tabela2.spell_tables._ActorTable) do - local habilidade_shadow = shadow.spell_tables:PegaHabilidade (spellid, true, nil, true) - - for index, alvo in _ipairs (habilidade.targets._ActorTable) do - local alvo_shadow = habilidade_shadow.targets:PegarCombatente (alvo.serial, alvo.nome, alvo.flag_original, true) - alvo_shadow.total = alvo_shadow.total + alvo.total + --> soma os containers de alvos + for index, alvo in _ipairs (tabela2.targets._ActorTable) do + --> pega o alvo no ator + local alvo_tabela1 = tabela1.targets:PegarCombatente (nil, alvo.nome, nil, true) + --> soma o valor + alvo_tabela1.total = alvo_tabela1.total + alvo.total end - for key, value in _pairs (habilidade) do - if (_type (value) == "number") then - if (key ~= "id") then - if (not habilidade_shadow [key]) then - habilidade_shadow [key] = 0 + --> soma o container de habilidades + for spellid, habilidade in _pairs (tabela2.spell_tables._ActorTable) do + --> pega a habilidade no primeiro ator + local habilidade_tabela1 = tabela1.spell_tables:PegaHabilidade (spellid, true, "SPELL_DAMAGE", false) + --> soma os alvos + for index, alvo in _ipairs (habilidade.targets._ActorTable) do + local alvo_tabela1 = habilidade_tabela1.targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_tabela1.total = alvo_tabela1.total + alvo.total + end + --> soma os valores da habilidade + for key, value in _pairs (habilidade) do + if (_type (value) == "number") then + if (key ~= "id") then + if (not habilidade_tabela1 [key]) then + habilidade_tabela1 [key] = 0 + end + habilidade_tabela1 [key] = habilidade_tabela1 [key] + value end - habilidade_shadow [key] = habilidade_shadow [key] + value end end end - end - return shadow + --> soma o container de friendly fire + for index, friendlyFire in _ipairs (tabela2.friendlyfire._ActorTable) do + --> pega o ator ff no ator principal + local friendlyFire_tabela1 = tabela1.friendlyfire:PegarCombatente (nil, friendlyFire.nome, nil, true) + --> soma o total + friendlyFire_tabela1.total = friendlyFire_tabela1.total + friendlyFire.total + --> soma as habilidades + for spellid, habilidade in _pairs (friendlyFire.spell_tables._ActorTable) do + local habilidade_tabela1 = friendlyFire_tabela1.spell_tables:PegaHabilidade (spellid, true, nil, false) + habilidade_tabela1.counter = habilidade_tabela1.counter + habilidade.counter + habilidade_tabela1.total = habilidade_tabela1.total + habilidade.total + end + end + + return tabela1 end atributo_damage.__sub = function (tabela1, tabela2) - tabela1.total = tabela1.total - tabela2.total - tabela1.total_without_pet = tabela1.total_without_pet - tabela2.total_without_pet - tabela1.damage_taken = tabela1.damage_taken - tabela2.damage_taken - tabela1.friendlyfire_total = tabela1.friendlyfire_total - tabela2.friendlyfire_total + --> tempo decorrido + local tempo = (tabela2.end_time or time()) - tabela2.start_time + tabela1.start_time = tabela1.start_time + tempo - for index, friendlyfire in _ipairs (tabela2.friendlyfire._ActorTable) do - friendlyfire.shadow.total = friendlyfire.shadow.total - friendlyfire.total - for spellid, habilidade in _pairs (friendlyfire.spell_tables._ActorTable) do - -- eu di reload para trocar os talentos - if (not habilidade.shadow) then --> tapa buraco - return - end - habilidade.shadow.total = habilidade.shadow.total - habilidade.total -- attempt to index field 'shadow' (a nil value) -- Deu erro denovo depois de um /reload + --> total de dano + tabela1.total = tabela1.total - tabela2.total + --> total de dano sem o pet + tabela1.total_without_pet = tabela1.total_without_pet - tabela2.total_without_pet + --> total de dano que o cara levou + tabela1.damage_taken = tabela1.damage_taken - tabela2.damage_taken + --> total do friendly fire causado + tabela1.friendlyfire_total = tabela1.friendlyfire_total - tabela2.friendlyfire_total + + --> reduz os containers de alvos + for index, alvo in _ipairs (tabela2.targets._ActorTable) do + --> pega o alvo no ator + local alvo_tabela1 = tabela1.targets:PegarCombatente (nil, alvo.nome, nil, true) + --> subtrai o valor + alvo_tabela1.total = alvo_tabela1.total - alvo.total + end + + --> reduz o container de habilidades + for spellid, habilidade in _pairs (tabela2.spell_tables._ActorTable) do + --> pega a habilidade no primeiro ator + local habilidade_tabela1 = tabela1.spell_tables:PegaHabilidade (spellid, true, "SPELL_DAMAGE", false) + --> soma os alvos + for index, alvo in _ipairs (habilidade.targets._ActorTable) do + local alvo_tabela1 = habilidade_tabela1.targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_tabela1.total = alvo_tabela1.total - alvo.total + end + --> subtrai os valores da habilidade + for key, value in _pairs (habilidade) do + if (_type (value) == "number") then + if (key ~= "id") then + if (not habilidade_tabela1 [key]) then + habilidade_tabela1 [key] = 0 + end + habilidade_tabela1 [key] = habilidade_tabela1 [key] - value + end + end + end + end + + --> reduz o container de friendly fire + for index, friendlyFire in _ipairs (tabela2.friendlyfire._ActorTable) do + --> pega o ator ff no ator principal + local friendlyFire_tabela1 = tabela1.friendlyfire:PegarCombatente (nil, friendlyFire.nome, nil, true) + --> soma o total + friendlyFire_tabela1.total = friendlyFire_tabela1.total - friendlyFire.total + --> soma as habilidades + for spellid, habilidade in _pairs (friendlyFire.spell_tables._ActorTable) do + local habilidade_tabela1 = friendlyFire_tabela1.spell_tables:PegaHabilidade (spellid, true, nil, false) + habilidade_tabela1.counter = habilidade_tabela1.counter - habilidade.counter + habilidade_tabela1.total = habilidade_tabela1.total - habilidade.total + end end - end return tabela1 end diff --git a/classes/classe_damage_habilidade.lua b/classes/classe_damage_habilidade.lua index 4bb196d2..2b20094a 100644 --- a/classes/classe_damage_habilidade.lua +++ b/classes/classe_damage_habilidade.lua @@ -261,12 +261,8 @@ end function _detalhes.refresh:r_habilidade_dano (habilidade, shadow) --recebeu o container shadow _setmetatable (habilidade, habilidade_dano) habilidade.__index = habilidade_dano - - if (shadow ~= -1) then - habilidade.shadow = shadow._ActorTable[habilidade.id] - _detalhes.refresh:r_container_combatentes (habilidade.targets, habilidade.shadow.targets) else - _detalhes.refresh:r_container_combatentes (habilidade.targets, -1) - end + habilidade.shadow = shadow._ActorTable [habilidade.id] + _detalhes.refresh:r_container_combatentes (habilidade.targets, habilidade.shadow.targets) end function _detalhes.clear:c_habilidade_dano (habilidade) diff --git a/classes/classe_energy.lua b/classes/classe_energy.lua index 0c3d993f..3b244568 100644 --- a/classes/classe_energy.lua +++ b/classes/classe_energy.lua @@ -875,6 +875,19 @@ end combat_table.totals_grupo [class_type].runepower = combat_table.totals_grupo [class_type].runepower - self.runepower end end + function atributo_energy:add_total (combat_table) + combat_table.totals [class_type].mana = combat_table.totals [class_type].mana + self.mana + combat_table.totals [class_type].e_rage = combat_table.totals [class_type].e_rage + self.e_rage + combat_table.totals [class_type].e_energy = combat_table.totals [class_type].e_energy + self.e_energy + combat_table.totals [class_type].runepower = combat_table.totals [class_type].runepower + self.runepower + + if (self.grupo) then + combat_table.totals_grupo [class_type].mana = combat_table.totals_grupo [class_type].mana + self.mana + combat_table.totals_grupo [class_type].e_rage = combat_table.totals_grupo [class_type].e_rage + self.e_rage + combat_table.totals_grupo [class_type].e_energy = combat_table.totals_grupo [class_type].e_energy + self.e_energy + combat_table.totals_grupo [class_type].runepower = combat_table.totals_grupo [class_type].runepower + self.runepower + end + end --> restaura e liga o ator com a sua shadow durante a inicialização function atributo_energy:r_connect_shadow (actor) @@ -883,34 +896,83 @@ end actor = self end - local overall_energy = _detalhes.tabela_overall [3] - local shadow = overall_energy._ActorTable [overall_energy._NameIndexTable [actor.nome]] + --> criar uma shadow desse ator se ainda não tiver uma + local overall_energy = _detalhes.tabela_overall [3] + local shadow = overall_energy._ActorTable [overall_energy._NameIndexTable [actor.nome]] - --> constroi a shadow se não tiver uma - if (not shadow) then - shadow = overall_energy:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true) - shadow.classe = actor.classe - end - - --> aplica a meta e indexes - _detalhes.refresh:r_atributo_energy (actor, shadow) - - --> soma os valores - shadow = shadow + actor - - --> reconstroi o container de alvos - for index, alvo in _ipairs (actor.targets._ActorTable) do - _detalhes.refresh:r_alvo_da_habilidade (alvo, shadow.targets) - end - - --> reconstroi o container de habilidades - for spellid, habilidade in _pairs (actor.spell_tables._ActorTable) do - _detalhes.refresh:r_habilidade_e_energy (habilidade, shadow.spell_tables) - for index, alvo in _ipairs (habilidade.targets._ActorTable) do - _detalhes.refresh:r_alvo_da_habilidade (alvo, habilidade.targets.shadow) + if (not shadow) then + shadow = overall_energy:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true) + shadow.classe = actor.classe + shadow.grupo = actor.grupo end - end + --> restaura a meta e indexes ao ator + _detalhes.refresh:r_atributo_energy (actor, shadow) + + --> total das energias (captura de dados) + shadow.mana = shadow.mana + actor.mana + shadow.e_rage = shadow.e_rage + actor.e_rage + shadow.e_energy = shadow.e_energy + actor.e_energy + shadow.runepower = shadow.runepower + actor.runepower + shadow.focus = shadow.focus + actor.focus + shadow.holypower = shadow.holypower + actor.holypower + + shadow.mana_r = shadow.mana_r + actor.mana_r + shadow.e_rage_r = shadow.e_rage_r + actor.e_rage_r + shadow.e_energy_r = shadow.e_energy_r + actor.e_energy_r + shadow.runepower_r = shadow.runepower_r + actor.runepower_r + shadow.focus_r = shadow.focus_r + actor.focus_r + shadow.holypower_r = shadow.holypower_r + actor.holypower_r + + --> total no combate overall (captura de dados) + _detalhes.tabela_overall.totals[3].mana = _detalhes.tabela_overall.totals[3].mana + actor.mana + _detalhes.tabela_overall.totals[3].e_rage = _detalhes.tabela_overall.totals[3].e_rage + actor.e_rage + _detalhes.tabela_overall.totals[3].e_energy = _detalhes.tabela_overall.totals[3].e_energy + actor.e_energy + _detalhes.tabela_overall.totals[3].runepower = _detalhes.tabela_overall.totals[3].runepower + actor.runepower + + if (actor.grupo) then + _detalhes.tabela_overall.totals_grupo[3]["mana"] = _detalhes.tabela_overall.totals_grupo[3]["mana"] + actor.mana + _detalhes.tabela_overall.totals_grupo[3]["e_rage"] = _detalhes.tabela_overall.totals_grupo[3]["e_rage"] + actor.e_rage + _detalhes.tabela_overall.totals_grupo[3]["e_energy"] = _detalhes.tabela_overall.totals_grupo[3]["e_energy"] + actor.e_energy + _detalhes.tabela_overall.totals_grupo[3]["runepower"] = _detalhes.tabela_overall.totals_grupo[3]["runepower"] + actor.runepower + end + + --> copia o container de alvos (captura de dados) + for index, alvo in _ipairs (actor.targets._ActorTable) do + --> cria e soma o valor do total + local alvo_shadow = shadow.targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_shadow.total = alvo_shadow.total + alvo.total + --> refresh no alvo + _detalhes.refresh:r_alvo_da_habilidade (alvo, shadow.targets) + end + + --> copia o container de habilidades (captura de dados) + for spellid, habilidade in _pairs (actor.spell_tables._ActorTable) do + --> cria e soma o valor + local habilidade_shadow = shadow.spell_tables:PegaHabilidade (spellid, true, nil, true) + --> refresh e soma os valores dos alvos + for index, alvo in _ipairs (habilidade.targets._ActorTable) do + --> cria e soma o valor do total + local alvo_shadow = habilidade_shadow.targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_shadow.total = alvo_shadow.total + alvo.total + --> refresh no alvo da habilidade + _detalhes.refresh:r_alvo_da_habilidade (alvo, habilidade_shadow.targets) + end + --> soma todos os demais valores + for key, value in _pairs (habilidade) do + if (_type (value) == "number") then + if (key ~= "id") then + if (not habilidade_shadow [key]) then + habilidade_shadow [key] = 0 + end + habilidade_shadow [key] = habilidade_shadow [key] + value + end + end + end + --> refresh na meta e indexes + _detalhes.refresh:r_habilidade_e_energy (habilidade, shadow.spell_tables) + end + return shadow end @@ -918,14 +980,6 @@ function atributo_energy:ColetarLixo (lastevent) return _detalhes:ColetarLixo (class_type, lastevent) end -local function ReconstroiMapa (tabela) - local mapa = {} - for i = 1, #tabela._ActorTable do - mapa [tabela._ActorTable[i].nome] = i - end - tabela._NameIndexTable = mapa -end - function _detalhes.refresh:r_atributo_energy (este_jogador, shadow) _setmetatable (este_jogador, _detalhes.atributo_energy) este_jogador.__index = _detalhes.atributo_energy @@ -951,80 +1005,102 @@ function _detalhes.clear:c_atributo_energy (este_jogador) _detalhes.clear:c_container_habilidades (este_jogador.spell_tables) end -atributo_energy.__add = function (shadow, tabela2) +atributo_energy.__add = function (tabela1, tabela2) - shadow.mana = shadow.mana + tabela2.mana - shadow.e_rage = shadow.e_rage + tabela2.e_rage - shadow.e_energy = shadow.e_energy + tabela2.e_energy - shadow.runepower = shadow.runepower + tabela2.runepower - shadow.focus = shadow.focus + tabela2.focus - shadow.holypower = shadow.holypower + tabela2.holypower - - if ( not (shadow.shadow and tabela2.shadow) ) then - _detalhes.tabela_overall.totals[3]["mana"] = _detalhes.tabela_overall.totals[3]["mana"] + tabela2.mana - _detalhes.tabela_overall.totals[3]["e_rage"] = _detalhes.tabela_overall.totals[3]["e_rage"] + tabela2.e_rage - _detalhes.tabela_overall.totals[3]["e_energy"] = _detalhes.tabela_overall.totals[3]["e_energy"] + tabela2.e_energy - _detalhes.tabela_overall.totals[3]["runepower"] = _detalhes.tabela_overall.totals[3]["runepower"] + tabela2.runepower + --> soma os totais das energias + tabela1.mana = tabela1.mana + tabela2.mana + tabela1.e_rage = tabela1.e_rage + tabela2.e_rage + tabela1.e_energy = tabela1.e_energy + tabela2.e_energy + tabela1.runepower = tabela1.runepower + tabela2.runepower + tabela1.focus = tabela1.focus + tabela2.focus + tabela1.holypower = tabela1.holypower + tabela2.holypower - if (tabela2.grupo) then - _detalhes.tabela_overall.totals_grupo[3]["mana"] = _detalhes.tabela_overall.totals_grupo[3]["mana"] + tabela2.mana - _detalhes.tabela_overall.totals_grupo[3]["e_rage"] = _detalhes.tabela_overall.totals_grupo[3]["e_rage"] + tabela2.e_rage - _detalhes.tabela_overall.totals_grupo[3]["e_energy"] = _detalhes.tabela_overall.totals_grupo[3]["e_energy"] + tabela2.e_energy - _detalhes.tabela_overall.totals_grupo[3]["runepower"] = _detalhes.tabela_overall.totals_grupo[3]["runepower"] + tabela2.runepower + tabela1.mana_r = tabela1.mana_r + tabela2.mana_r + tabela1.e_rage_r = tabela1.e_rage_r + tabela2.e_rage_r + tabela1.e_energy_r = tabela1.e_energy_r + tabela2.e_energy_r + tabela1.runepower_r = tabela1.runepower_r + tabela2.runepower_r + tabela1.focus_r = tabela1.focus_r + tabela2.focus_r + tabela1.holypower_r = tabela1.holypower_r + tabela2.holypower_r + + --> soma os containers de alvos + for index, alvo in _ipairs (tabela2.targets._ActorTable) do + --> pega o alvo no ator + local alvo_tabela1 = tabela1.targets:PegarCombatente (nil, alvo.nome, nil, true) + --> soma o valor + alvo_tabela1.total = alvo_tabela1.total + alvo.total end - end - shadow.mana_r = shadow.mana_r + tabela2.mana_r - shadow.e_rage_r = shadow.e_rage_r + tabela2.e_rage_r - shadow.e_energy_r = shadow.e_energy_r + tabela2.e_energy_r - shadow.runepower_r = shadow.runepower_r + tabela2.runepower_r - shadow.focus_r = shadow.focus_r + tabela2.focus_r - shadow.holypower_r = shadow.holypower_r + tabela2.holypower_r - - for index, alvo in _ipairs (tabela2.targets._ActorTable) do - local alvo_shadow = shadow.targets:PegarCombatente (alvo.serial, alvo.nome, nil, true) - alvo_shadow.total = alvo_shadow.total + alvo.total - end - - --> copia o container de habilidades - for spellid, habilidade in _pairs (tabela2.spell_tables._ActorTable) do - local habilidade_shadow = shadow.spell_tables:PegaHabilidade (spellid, true, nil, true) - - for index, alvo in _ipairs (habilidade.targets._ActorTable) do - local alvo_shadow = habilidade_shadow.targets:PegarCombatente (alvo.serial, alvo.nome, nil, true) - alvo_shadow.total = alvo_shadow.total + alvo.total - end - - for key, value in _pairs (habilidade) do - if (_type (value) == "number") then - if (key ~= "id") then - if (not habilidade_shadow [key]) then - habilidade_shadow [key] = 0 + --> soma o container de habilidades + for spellid, habilidade in _pairs (tabela2.spell_tables._ActorTable) do + --> pega a habilidade no primeiro ator + local habilidade_tabela1 = tabela1.spell_tables:PegaHabilidade (spellid, true, "SPELL_ENERGY", false) + --> soma os alvos + for index, alvo in _ipairs (habilidade.targets._ActorTable) do + local alvo_tabela1 = habilidade_tabela1.targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_tabela1.total = alvo_tabela1.total + alvo.total + end + --> soma os valores da habilidade + for key, value in _pairs (habilidade) do + if (_type (value) == "number") then + if (key ~= "id") then + if (not habilidade_tabela1 [key]) then + habilidade_tabela1 [key] = 0 + end + habilidade_tabela1 [key] = habilidade_tabela1 [key] + value end - habilidade_shadow [key] = habilidade_shadow [key] + value end end - end - end + end - return shadow + return tabela1 end atributo_energy.__sub = function (tabela1, tabela2) - tabela1.mana = tabela1.mana - tabela2.mana - tabela1.e_rage = tabela1.e_rage - tabela2.e_rage - tabela1.e_energy = tabela1.e_energy - tabela2.e_energy - tabela1.runepower = tabela1.runepower - tabela2.runepower - tabela1.focus = tabela1.focus - tabela2.focus - tabela1.holypower = tabela1.holypower - tabela2.holypower + --> soma os totais das energias + tabela1.mana = tabela1.mana - tabela2.mana + tabela1.e_rage = tabela1.e_rage - tabela2.e_rage + tabela1.e_energy = tabela1.e_energy - tabela2.e_energy + tabela1.runepower = tabela1.runepower - tabela2.runepower + tabela1.focus = tabela1.focus - tabela2.focus + tabela1.holypower = tabela1.holypower - tabela2.holypower + + tabela1.mana_r = tabela1.mana_r - tabela2.mana_r + tabela1.e_rage_r = tabela1.e_rage_r - tabela2.e_rage_r + tabela1.e_energy_r = tabela1.e_energy_r - tabela2.e_energy_r + tabela1.runepower_r = tabela1.runepower_r - tabela2.runepower_r + tabela1.focus_r = tabela1.focus_r - tabela2.focus_r + tabela1.holypower_r = tabela1.holypower_r - tabela2.holypower_r - tabela1.mana_r = tabela1.mana_r - tabela2.mana_r - tabela1.e_rage_r = tabela1.e_rage_r - tabela2.e_rage_r - tabela1.e_energy_r = tabela1.e_energy_r - tabela2.e_energy_r - tabela1.runepower_r = tabela1.runepower_r - tabela2.runepower_r - tabela1.focus_r = tabela1.focus_r - tabela2.focus_r - tabela1.holypower_r = tabela1.holypower_r - tabela2.holypower_r + --> soma os containers de alvos + for index, alvo in _ipairs (tabela2.targets._ActorTable) do + --> pega o alvo no ator + local alvo_tabela1 = tabela1.targets:PegarCombatente (nil, alvo.nome, nil, true) + --> soma o valor + alvo_tabela1.total = alvo_tabela1.total - alvo.total + end + + --> soma o container de habilidades + for spellid, habilidade in _pairs (tabela2.spell_tables._ActorTable) do + --> pega a habilidade no primeiro ator + local habilidade_tabela1 = tabela1.spell_tables:PegaHabilidade (spellid, true, "SPELL_ENERGY", false) + --> soma os alvos + for index, alvo in _ipairs (habilidade.targets._ActorTable) do + local alvo_tabela1 = habilidade_tabela1.targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_tabela1.total = alvo_tabela1.total - alvo.total + end + --> soma os valores da habilidade + for key, value in _pairs (habilidade) do + if (_type (value) == "number") then + if (key ~= "id") then + if (not habilidade_tabela1 [key]) then + habilidade_tabela1 [key] = 0 + end + habilidade_tabela1 [key] = habilidade_tabela1 [key] - value + end + end + end + end return tabela1 end diff --git a/classes/classe_heal.lua b/classes/classe_heal.lua index 342910db..e742f5a5 100644 --- a/classes/classe_heal.lua +++ b/classes/classe_heal.lua @@ -405,7 +405,7 @@ function atributo_heal:AtualizaBarra (instancia, barras_container, qual_barra, l local porcentagem = self [keyName] / total * 100 local esta_porcentagem - if ((_detalhes.time_type == 2 and self.grupo) or (not _detalhes:CaptureGet ("heal") and not _detalhes:CaptureGet ("aura"))) then + if ((_detalhes.time_type == 2 and self.grupo) or (not _detalhes:CaptureGet ("heal") and not _detalhes:CaptureGet ("aura")) or not self.shadow) then hps = healing_total / combat_time self.last_hps = hps else @@ -1565,14 +1565,14 @@ function atributo_heal:Iniciar (iniciar) self:RegistrarNaTimeMachine() --coloca ele da timeMachine if (self.shadow) then self.shadow.iniciar_hps = true --> isso foi posto recentemente - self.shadow:RegistrarNaTimeMachine() + --self.shadow:RegistrarNaTimeMachine() end else self.iniciar_hps = false self:DesregistrarNaTimeMachine() --retira ele da timeMachine if (self.shadow) then - self.shadow:DesregistrarNaTimeMachine() self.shadow.iniciar_hps = false --> isso foi posto recentemente + --self.shadow:DesregistrarNaTimeMachine() end end end @@ -1587,6 +1587,12 @@ end combat_table.totals_grupo [class_type] = combat_table.totals_grupo [class_type] - self.total end end + function atributo_heal:add_total (combat_table) + combat_table.totals [class_type] = combat_table.totals [class_type] + self.total + if (self.grupo) then + combat_table.totals_grupo [class_type] = combat_table.totals_grupo [class_type] + self.total + end + end --> restaura a tabela de last event function atributo_heal:r_last_events_table (actor) @@ -1603,35 +1609,101 @@ end actor = self end - local overall_cura = _detalhes.tabela_overall [2] - local shadow = overall_cura._ActorTable [overall_cura._NameIndexTable [actor.nome]] + --> criar uma shadow desse ator se ainda não tiver uma + local overall_cura = _detalhes.tabela_overall [2] + local shadow = overall_cura._ActorTable [overall_cura._NameIndexTable [actor.nome]] - --> constroi a shadow se não tiver uma - if (not shadow) then - shadow = overall_cura:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true) - shadow.classe = actor.classe - shadow.start_time = time() - shadow.end_time = time() - end - - --> aplica a meta e indexes - _detalhes.refresh:r_atributo_heal (actor, shadow) - - --> soma os valores - shadow = shadow + actor - - --> reconstroi o container de alvos - for index, alvo in _ipairs (actor.targets._ActorTable) do - _detalhes.refresh:r_alvo_da_habilidade (alvo, shadow.targets) - end - - --> reconstroi o container de habilidades - for spellid, habilidade in _pairs (actor.spell_tables._ActorTable) do - _detalhes.refresh:r_habilidade_cura (habilidade, shadow.spell_tables) - for index, alvo in _ipairs (habilidade.targets._ActorTable) do - _detalhes.refresh:r_alvo_da_habilidade (alvo, habilidade.targets.shadow) + if (not shadow) then + shadow = overall_cura:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true) + shadow.classe = actor.classe + shadow.grupo = actor.grupo + shadow.start_time = time() - 3 + shadow.end_time = time() + end + + --> restaura a meta e indexes ao ator + _detalhes.refresh:r_atributo_heal (actor, shadow) + + --> tempo decorrido (captura de dados) + if (actor.end_time) then + local tempo = (actor.end_time or time()) - actor.start_time + shadow.start_time = shadow.start_time - tempo + end + + --> total de cura (captura de dados) + shadow.total = shadow.total + actor.total + --> total de overheal (captura de dados) + shadow.totalover = shadow.totalover + actor.totalover + --> total de absorbs (captura de dados) + shadow.totalabsorb = shadow.totalabsorb + actor.totalabsorb + --> total de cura feita em inimigos (captura de dados) + shadow.heal_enemy_amt = shadow.heal_enemy_amt + actor.heal_enemy_amt + --> total sem pets (captura de dados) + shadow.total_without_pet = shadow.total_without_pet + actor.total_without_pet + shadow.totalover_without_pet = shadow.totalover_without_pet + actor.totalover_without_pet + --> total de cura recebida (captura de dados) + shadow.healing_taken = shadow.healing_taken + actor.healing_taken + + --> total no combate overall (captura de dados) + _detalhes.tabela_overall.totals[2] = _detalhes.tabela_overall.totals[2] + actor.total + if (actor.grupo) then + _detalhes.tabela_overall.totals_grupo[2] = _detalhes.tabela_overall.totals_grupo[2] + actor.total + end + + --> copia o healing_from (captura de dados) + for nome, _ in _pairs (actor.healing_from) do + shadow.healing_from [nome] = true + end + + --> copia o heal_enemy (captura de dados) + for spellid, amount in _pairs (actor.heal_enemy) do + if (shadow.heal_enemy [spellid]) then + shadow.heal_enemy [spellid] = shadow.heal_enemy [spellid] + amount + else + shadow.heal_enemy [spellid] = amount + end + end + + --> copia o container de alvos (captura de dados) + for index, alvo in _ipairs (actor.targets._ActorTable) do + --> cria e soma o valor do total + local alvo_shadow = shadow.targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_shadow.total = alvo_shadow.total + alvo.total + alvo_shadow.overheal = alvo_shadow.overheal + alvo.overheal + alvo_shadow.absorbed = alvo_shadow.absorbed + alvo.absorbed + --> refresh no alvo + _detalhes.refresh:r_alvo_da_habilidade (alvo, shadow.targets) + end + + --> copia o container de habilidades (captura de dados) + for spellid, habilidade in _pairs (actor.spell_tables._ActorTable) do + --> cria e soma o valor + local habilidade_shadow = shadow.spell_tables:PegaHabilidade (spellid, true, nil, true) + --> refresh e soma os valores dos alvos + for index, alvo in _ipairs (habilidade.targets._ActorTable) do + --> cria e soma o valor do total + local alvo_shadow = habilidade_shadow.targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_shadow.total = alvo_shadow.total + alvo.total + alvo_shadow.overheal = alvo_shadow.overheal + alvo.overheal + alvo_shadow.absorbed = alvo_shadow.absorbed + alvo.absorbed + --> refresh no alvo da habilidade + _detalhes.refresh:r_alvo_da_habilidade (alvo, habilidade_shadow.targets) + end + --> soma todos os demais valores + for key, value in _pairs (habilidade) do + if (_type (value) == "number") then + if (key ~= "id") then + if (not habilidade_shadow [key]) then + habilidade_shadow [key] = 0 + end + habilidade_shadow [key] = habilidade_shadow [key] + value + end + end + end + + --> refresh na habilidade + _detalhes.refresh:r_habilidade_cura (habilidade, shadow.spell_tables) end - end return shadow end @@ -1665,91 +1737,139 @@ function _detalhes.clear:c_atributo_heal (este_jogador) _detalhes.clear:c_container_habilidades (este_jogador.spell_tables) end -atributo_heal.__add = function (shadow, tabela2) +atributo_heal.__add = function (tabela1, tabela2) --> tempo decorrido - local tempo = (tabela2.end_time or time()) - tabela2.start_time - shadow.start_time = shadow.start_time - tempo + local tempo = (tabela2.end_time or time()) - tabela2.start_time + tabela1.start_time = tabela1.start_time - tempo - shadow.total = shadow.total + tabela2.total - - if ( not (shadow.shadow and tabela2.shadow) ) then - _detalhes.tabela_overall.totals[2] = _detalhes.tabela_overall.totals[2] + tabela2.total + --> total de cura + tabela1.total = tabela1.total + tabela2.total + --> total de overheal + tabela1.totalover = tabela1.totalover + tabela2.totalover + --> total de absorbs + tabela1.totalabsorb = tabela1.totalabsorb + tabela2.totalabsorb + --> total de cura feita em inimigos + tabela1.heal_enemy_amt = tabela1.heal_enemy_amt + tabela2.heal_enemy_amt + --> total sem pets + tabela1.total_without_pet = tabela1.total_without_pet + tabela2.total_without_pet + tabela1.totalover_without_pet = tabela1.totalover_without_pet + tabela2.totalover_without_pet + --> total de cura recebida + tabela1.healing_taken = tabela1.healing_taken + tabela2.healing_taken - if (tabela2.grupo) then - _detalhes.tabela_overall.totals_grupo[2] = _detalhes.tabela_overall.totals_grupo[2] + tabela2.total + --> soma o healing_from + for nome, _ in _pairs (tabela2.healing_from) do + tabela1.healing_from [nome] = true end - end - shadow.totalover = shadow.totalover + tabela2.totalover - shadow.totalabsorb = shadow.totalabsorb + tabela2.totalabsorb - shadow.heal_enemy_amt = shadow.heal_enemy_amt + tabela2.heal_enemy_amt - - shadow.total_without_pet = shadow.total_without_pet + tabela2.total_without_pet - shadow.totalover_without_pet = shadow.totalover_without_pet + tabela2.totalover_without_pet - - shadow.healing_taken = shadow.healing_taken + tabela2.healing_taken - - --> copia o healing_from - for nome, _ in _pairs (tabela2.healing_from) do - shadow.healing_from [nome] = true - end - - --> copiar o heal_enemy - if (tabela2.heal_enemy) then + --> somar o heal_enemy for spellid, amount in _pairs (tabela2.heal_enemy) do - if (shadow.heal_enemy [spellid]) then - shadow.heal_enemy [spellid] = shadow.heal_enemy [spellid] + amount + if (tabela1.heal_enemy [spellid]) then + tabela1.heal_enemy [spellid] = tabela1.heal_enemy [spellid] + amount else - shadow.heal_enemy [spellid] = amount + tabela1.heal_enemy [spellid] = amount end end - end - --> copia o container de alvos - for index, alvo in _ipairs (tabela2.targets._ActorTable) do - local alvo_shadow = shadow.targets:PegarCombatente (alvo.serial, alvo.nome, alvo.flag_original, true) - alvo_shadow.total = alvo_shadow.total + alvo.total - alvo_shadow.overheal = alvo_shadow.overheal + alvo.overheal - alvo_shadow.absorbed = alvo_shadow.absorbed + alvo.absorbed - end - - --> copia o container de habilidades - for spellid, habilidade in _pairs (tabela2.spell_tables._ActorTable) do - local habilidade_shadow = shadow.spell_tables:PegaHabilidade (spellid, true, nil, true) - - for index, alvo in _ipairs (habilidade.targets._ActorTable) do - local alvo_shadow = habilidade_shadow.targets:PegarCombatente (alvo.serial, alvo.nome, alvo.flag_original, true) - alvo_shadow.total = alvo_shadow.total + alvo.total - alvo_shadow.overheal = alvo_shadow.overheal + alvo.overheal - alvo_shadow.absorbed = alvo_shadow.absorbed + alvo.absorbed + --> somar o container de alvos + for index, alvo in _ipairs (tabela2.targets._ActorTable) do + --> pega o alvo no ator + local alvo_tabela1 = tabela1.targets:PegarCombatente (nil, alvo.nome, nil, true) + --> soma os valores + alvo_tabela1.total = alvo_tabela1.total + alvo.total + alvo_tabela1.overheal = alvo_tabela1.overheal + alvo.overheal + alvo_tabela1.absorbed = alvo_tabela1.absorbed + alvo.absorbed end - - for key, value in _pairs (habilidade) do - if (_type (value) == "number") then - if (key ~= "id") then - if (not habilidade_shadow [key]) then - habilidade_shadow [key] = 0 + + --> soma o container de habilidades + for spellid, habilidade in _pairs (tabela2.spell_tables._ActorTable) do + --> pega a habilidade no primeiro ator + local habilidade_tabela1 = tabela1.spell_tables:PegaHabilidade (spellid, true, "SPELL_HEAL", false) + --> soma os alvos + for index, alvo in _ipairs (habilidade.targets._ActorTable) do + local alvo_tabela1 = habilidade_tabela1.targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_tabela1.total = alvo_tabela1.total + alvo.total + alvo_tabela1.overheal = alvo_tabela1.overheal + alvo.overheal + alvo_tabela1.absorbed = alvo_tabela1.absorbed + alvo.absorbed + end + --> soma os valores da habilidade + for key, value in _pairs (habilidade) do + if (_type (value) == "number") then + if (key ~= "id") then + if (not habilidade_tabela1 [key]) then + habilidade_tabela1 [key] = 0 + end + habilidade_tabela1 [key] = habilidade_tabela1 [key] + value + end + end + end + end + + return tabela1 +end + +atributo_heal.__sub = function (tabela1, tabela2) + + --> tempo decorrido + local tempo = (tabela2.end_time or time()) - tabela2.start_time + tabela1.start_time = tabela1.start_time + tempo + + --> total de cura + tabela1.total = tabela1.total - tabela2.total + --> total de overheal + tabela1.totalover = tabela1.totalover - tabela2.totalover + --> total de absorbs + tabela1.totalabsorb = tabela1.totalabsorb - tabela2.totalabsorb + --> total de cura feita em inimigos + tabela1.heal_enemy_amt = tabela1.heal_enemy_amt - tabela2.heal_enemy_amt + --> total sem pets + tabela1.total_without_pet = tabela1.total_without_pet - tabela2.total_without_pet + tabela1.totalover_without_pet = tabela1.totalover_without_pet - tabela2.totalover_without_pet + --> total de cura recebida + tabela1.healing_taken = tabela1.healing_taken - tabela2.healing_taken + + --> reduz o heal_enemy + for spellid, amount in _pairs (tabela2.heal_enemy) do + if (tabela1.heal_enemy [spellid]) then + tabela1.heal_enemy [spellid] = tabela1.heal_enemy [spellid] - amount + else + tabela1.heal_enemy [spellid] = amount + end + end + + --> reduz o container de alvos + for index, alvo in _ipairs (tabela2.targets._ActorTable) do + --> pega o alvo no ator + local alvo_tabela1 = tabela1.targets:PegarCombatente (nil, alvo.nome, nil, true) + --> soma os valores + alvo_tabela1.total = alvo_tabela1.total - alvo.total + alvo_tabela1.overheal = alvo_tabela1.overheal - alvo.overheal + alvo_tabela1.absorbed = alvo_tabela1.absorbed - alvo.absorbed + end + + --> reduz o container de habilidades + for spellid, habilidade in _pairs (tabela2.spell_tables._ActorTable) do + --> pega a habilidade no primeiro ator + local habilidade_tabela1 = tabela1.spell_tables:PegaHabilidade (spellid, true, "SPELL_HEAL", false) + --> soma os alvos + for index, alvo in _ipairs (habilidade.targets._ActorTable) do + local alvo_tabela1 = habilidade_tabela1.targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_tabela1.total = alvo_tabela1.total - alvo.total + alvo_tabela1.overheal = alvo_tabela1.overheal - alvo.overheal + alvo_tabela1.absorbed = alvo_tabela1.absorbed - alvo.absorbed + end + --> soma os valores da habilidade + for key, value in _pairs (habilidade) do + if (_type (value) == "number") then + if (key ~= "id") then + if (not habilidade_tabela1 [key]) then + habilidade_tabela1 [key] = 0 + end + habilidade_tabela1 [key] = habilidade_tabela1 [key] - value end - habilidade_shadow [key] = habilidade_shadow [key] + value end end end - end - - return shadow -end - -atributo_heal.__sub = function (tabela1, tabela2) - tabela1.total = tabela1.total - tabela2.total - tabela1.totalover = tabela1.totalover - tabela2.totalover - tabela1.totalabsorb = tabela1.totalabsorb - tabela2.totalabsorb - tabela1.heal_enemy_amt = tabela1.heal_enemy_amt - tabela2.heal_enemy_amt - - tabela1.total_without_pet = tabela1.total_without_pet - tabela2.total_without_pet - tabela1.totalover_without_pet = tabela1.totalover_without_pet - tabela2.totalover_without_pet - - tabela1.healing_taken = tabela1.healing_taken - tabela2.healing_taken return tabela1 end diff --git a/classes/classe_instancia.lua b/classes/classe_instancia.lua index e9988de8..3b33a40c 100644 --- a/classes/classe_instancia.lua +++ b/classes/classe_instancia.lua @@ -1172,21 +1172,18 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini instancia = self end - --> não trocar de modo se tiver em combate e a janela no solo mode - --[[if (_detalhes.solo and _detalhes.solo == instancia.meu_id) then - if (UnitAffectingCombat ("player")) then - print (Loc ["STRING_SOLO_SWITCHINCOMBAT"]) - return - end - end --]] - if (InstanceMode and InstanceMode ~= instancia:GetMode()) then instancia:AlteraModo (instancia, InstanceMode) end local update_coolTip = false + local sub_attribute_click = false - if (segmento == -2) then --> clicou para mudar de segmento + if (_type (segmento) == "boolean" and segmento) then --> clicou em um sub atributo + sub_attribute_click = true + segmento = instancia.segmento + + elseif (segmento == -2) then --> clicou para mudar de segmento segmento = instancia.segmento + 1 if (segmento > _detalhes.segments_amount) then @@ -1215,9 +1212,11 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini end --> pega os atributos desta instancia - local meu_segmento = instancia.segmento - local meu_atributo = instancia.atributo - local meu_sub_atributo = instancia.sub_atributo + local current_segmento = instancia.segmento + local current_atributo = instancia.atributo + local current_sub_atributo = instancia.sub_atributo + + local atributo_changed = false --> verifica possiveis valores não passados if (not segmento) then @@ -1226,19 +1225,21 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini if (not atributo) then atributo = instancia.atributo end - --if (not sub_atributo) then - -- sub_atributo = instancia.sub_atributo - --end - - --print ("DEBUG: trocando para "..atributo.." "..sub_atributo) + if (not sub_atributo) then + if (atributo == current_atributo) then + sub_atributo = instancia.sub_atributo + else + sub_atributo = instancia.sub_atributo_last [atributo] + end + end --> já esta mostrando isso que esta pedindo - if (not iniciando_instancia and segmento == meu_segmento and atributo == meu_atributo and sub_atributo == meu_sub_atributo and not _detalhes.initializing) then + if (not iniciando_instancia and segmento == current_segmento and atributo == current_atributo and sub_atributo == current_sub_atributo and not _detalhes.initializing) then return end --> Muda o segmento caso necessário - if (segmento ~= meu_segmento or _detalhes.initializing or iniciando_instancia) then + if (segmento ~= current_segmento or _detalhes.initializing or iniciando_instancia) then --> na troca de segmento, conferir se a instancia esta frozen if (instancia.freezed) then @@ -1281,13 +1282,7 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini end end - local atributo_changed = false - local last_sub_atributo = instancia.sub_atributo_last [atributo] - if (not sub_atributo) then - sub_atributo = instancia.sub_atributo_last [atributo] - end - - if (atributo ~= meu_atributo or _detalhes.initializing or iniciando_instancia or (instancia.modo == modo_alone or instancia.modo == modo_raid)) then + if (atributo ~= current_atributo or _detalhes.initializing or iniciando_instancia or (instancia.modo == modo_alone or instancia.modo == modo_raid)) then if (instancia.modo == modo_alone and not (_detalhes.initializing or iniciando_instancia)) then if (_detalhes.SoloTables.Mode == #_detalhes.SoloTables.Plugins) then @@ -1310,14 +1305,10 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini end return _detalhes.RaidTables.switch (nil, nil, -1) end - - atributo_changed = true - - instancia.sub_atributo_last [instancia.atributo] = meu_sub_atributo - --print ("atributo last changed:",instancia.atributo, "->", meu_sub_atributo) + atributo_changed = true instancia.atributo = atributo - instancia.sub_atributo = last_sub_atributo + instancia.sub_atributo = instancia.sub_atributo_last [atributo] --> troca icone instancia:ChangeIcon() @@ -1368,16 +1359,13 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini end - if (sub_atributo ~= meu_sub_atributo or _detalhes.initializing or iniciando_instancia or atributo_changed) then - - --instancia.sub_atributo_last [meu_atributo] = sub_atributo - instancia.sub_atributo_last [meu_atributo] = meu_sub_atributo - --print ("atributo last changed:",meu_atributo, "->", meu_sub_atributo) + if (sub_atributo ~= current_sub_atributo or _detalhes.initializing or iniciando_instancia or atributo_changed) then instancia.sub_atributo = sub_atributo - --print (instancia.sub_atributo_last [meu_atributo]) - --print (instancia.sub_atributo) + if (sub_attribute_click) then + instancia.sub_atributo_last [instancia.atributo] = instancia.sub_atributo + end if (instancia.atributo == 5) then --> custom instancia:ChangeIcon() @@ -1464,11 +1452,11 @@ function _detalhes:MontaAtributosOption (instancia, func) for o = 1, atributos [i] do if (_detalhes:CaptureIsEnabled ( _detalhes.atributos_capture [gindex] )) then - CoolTip:AddMenu (2, func, nil, i, o, options[o], nil, true) + CoolTip:AddMenu (2, func, true, i, o, options[o], nil, true) CoolTip:AddIcon (icones[i], 2, 1, 20, 20, p*(o-1), p*(o), 0, 1) else CoolTip:AddLine (options[o], nil, 2, .5, .5, .5, 1) - CoolTip:AddMenu (2, func, nil, i, o) + CoolTip:AddMenu (2, func, true, i, o) CoolTip:AddIcon (icones[i], 2, 1, 20, 20, p*(o-1), p*(o), 0, 1, {.3, .3, .3, 1}) end diff --git a/classes/classe_others.lua b/classes/classe_others.lua index 75b840d4..1f2921a0 100644 --- a/classes/classe_others.lua +++ b/classes/classe_others.lua @@ -1807,6 +1807,16 @@ local sub_list = {"cc_break", "ress", "interrupt", "cooldowns_defensive", "dispe end end end + function atributo_misc:add_total (combat_table) + 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 + combat_table.totals_grupo [class_type][sub_attribute] = combat_table.totals_grupo [class_type][sub_attribute] + self [sub_attribute] + end + end + end + end --> restaura e liga o ator com a sua shadow durante a inicialização function atributo_misc:r_connect_shadow (actor) @@ -1815,133 +1825,223 @@ local sub_list = {"cc_break", "ress", "interrupt", "cooldowns_defensive", "dispe actor = self end - local overall_misc = _detalhes.tabela_overall [4] - local shadow = overall_misc._ActorTable [overall_misc._NameIndexTable [actor.nome]] + --> criar uma shadow desse ator se ainda não tiver uma + local overall_misc = _detalhes.tabela_overall [4] + local shadow = overall_misc._ActorTable [overall_misc._NameIndexTable [actor.nome]] - if (not actor.nome) then - actor.nome = "unknown" - end - - --> constroi a shadow se não tiver uma - if (not shadow) then - shadow = overall_misc:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true) - shadow.classe = actor.classe - end - - --> cooldowns - if (actor.cooldowns_defensive) then - if (not shadow.cooldowns_defensive_targets) then - shadow.cooldowns_defensive = 0 - shadow.cooldowns_defensive_targets = container_combatentes:NovoContainer (container_damage_target) - shadow.cooldowns_defensive_spell_tables = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) + if (not actor.nome) then + actor.nome = "unknown" end - end - --> buff uptime - if (actor.buff_uptime) then - if (not shadow.buff_uptime_spell_targets) then - shadow.buff_uptime = 0 - shadow.buff_uptime_spell_targets = container_combatentes:NovoContainer (container_damage_target) --> pode ser um container de alvo de dano, pois irá usar apenas o .total - shadow.buff_uptime_spell_tables = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) --> cria o container das habilidades usadas para interromper + + if (not shadow) then + shadow = overall_misc:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true) + shadow.classe = actor.classe + shadow.grupo = actor.grupo end - end - --> debuff uptime - if (actor.debuff_uptime) then - if (not shadow.debuff_uptime_spell_targets) then - shadow.debuff_uptime = 0 - shadow.debuff_uptime_spell_targets = container_combatentes:NovoContainer (container_damage_target) --> pode ser um container de alvo de dano, pois irá usar apenas o .total - shadow.debuff_uptime_spell_tables = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) --> cria o container das habilidades usadas para interromper - end - end - --> interrupt - if (actor.interrupt) then - if (not shadow.interrupt_targets) then - shadow.interrupt = 0 - shadow.interrupt_targets = container_combatentes:NovoContainer (container_damage_target) --> pode ser um container de alvo de dano, pois irá usar apenas o .total - shadow.interrupt_spell_tables = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) --> cria o container das habilidades usadas para interromper - shadow.interrompeu_oque = {} - end - end - --> ress - if (actor.ress) then - if (not shadow.ress_targets) then - shadow.ress = 0 - shadow.ress_targets = container_combatentes:NovoContainer (container_damage_target) --> pode ser um container de alvo de dano, pois irá usar apenas o .total - shadow.ress_spell_tables = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) --> cria o container das habilidades usadas para interromper - end - end - --> dispell - if (actor.dispell) then - if (not shadow.dispell_targets) then - shadow.dispell = 0 - shadow.dispell_targets = container_combatentes:NovoContainer (container_damage_target) --> pode ser um container de alvo de dano, pois irá usar apenas o .total - shadow.dispell_spell_tables = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) --> cria o container das habilidades usadas para interromper - shadow.dispell_oque = {} - end - end - --> cc break - if (actor.cc_break) then - if (not shadow.cc_break) then - shadow.cc_break = 0 - shadow.cc_break_targets = container_combatentes:NovoContainer (container_damage_target) --> pode ser um container de alvo de dano, pois irá usar apenas o .total - shadow.cc_break_spell_tables = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) --> cria o container das habilidades usadas para interromper - shadow.cc_break_oque = {} - end - end - + --> aplica a meta e indexes - _detalhes.refresh:r_atributo_misc (actor, shadow) - - --> soma os valores - shadow = shadow + actor - - if (actor.interrupt) then - for _, este_alvo in _ipairs (actor.interrupt_targets._ActorTable) do - _detalhes.refresh:r_alvo_da_habilidade (este_alvo, shadow.interrupt_targets) - end - end - if (actor.buff_uptime) then - for _, este_alvo in _ipairs (actor.buff_uptime_targets._ActorTable) do - _detalhes.refresh:r_alvo_da_habilidade (este_alvo, shadow.buff_uptime_targets) - end - end - if (actor.debuff_uptime) then - for _, este_alvo in _ipairs (actor.debuff_uptime_targets._ActorTable) do - _detalhes.refresh:r_alvo_da_habilidade (este_alvo, shadow.debuff_uptime_targets) - end - end - if (actor.cooldowns_defensive) then - for _, este_alvo in _ipairs (actor.cooldowns_defensive_targets._ActorTable) do - _detalhes.refresh:r_alvo_da_habilidade (este_alvo, shadow.cooldowns_defensive_targets) - end - end - if (actor.ress) then - for _, este_alvo in _ipairs (actor.ress_targets._ActorTable) do - _detalhes.refresh:r_alvo_da_habilidade (este_alvo, shadow.ress_targets) - end - end - if (actor.dispell) then - for _, este_alvo in _ipairs (actor.dispell_targets._ActorTable) do - _detalhes.refresh:r_alvo_da_habilidade (este_alvo, shadow.dispell_targets) - end - end - if (actor.cc_break) then - for _, este_alvo in _ipairs (actor.cc_break_targets._ActorTable) do - _detalhes.refresh:r_alvo_da_habilidade (este_alvo, shadow.cc_break_targets) - end - end - - --> reconstroi o container de alvos - local t = {"cc_break", "ress", "interrupt", "cooldowns_defensive", "dispell", "buff_uptime", "debuff_uptime"} - for index, sub_attribute in _ipairs (t) do - if (actor [sub_attribute]) then - for spellid, habilidade in _pairs (actor [sub_attribute .. "_spell_tables"]._ActorTable) do - _detalhes.refresh:r_habilidade_misc (habilidade, shadow [sub_attribute .. "_spell_tables"]) - for _, este_alvo in _ipairs (habilidade.targets._ActorTable) do - _detalhes.refresh:r_alvo_da_habilidade (este_alvo, habilidade.targets.shadow) + _detalhes.refresh:r_atributo_misc (actor, shadow) + + --> somar as keys das habilidades + local somar_keys = function (habilidade, habilidade_shadow) + for key, value in _pairs (habilidade) do + if (_type (value) == "number") then + if (key ~= "id") then + if (not habilidade_shadow [key]) then + habilidade_shadow [key] = 0 + end + habilidade_shadow [key] = habilidade_shadow [key] + value + end end end end - end + --> somar os alvos do ator + local somar_alvos = function (container) + for index, alvo in _ipairs (actor [container]._ActorTable) do + --> cria e soma o valor do total + local alvo_shadow = shadow [container]:PegarCombatente (nil, alvo.nome, nil, true) + alvo_shadow.total = alvo_shadow.total + alvo.total + --> refresh no alvo + _detalhes.refresh:r_alvo_da_habilidade (alvo, shadow [container]) + end + end + --> somar as habilidades do ator + local somar_habilidades = function (container, shadow) + for spellid, habilidade in _pairs (actor [container]._ActorTable) do + --> cria e soma o valor + local habilidade_shadow = shadow [container]:PegaHabilidade (spellid, true, nil, true) + --> refresh e soma os valores dos alvos + for index, alvo in _ipairs (habilidade.targets._ActorTable) do + --> cria e soma o valor do total + local alvo_shadow = habilidade_shadow.targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_shadow.total = alvo_shadow.total + alvo.total + --> refresh no alvo da habilidade + _detalhes.refresh:r_alvo_da_habilidade (alvo, habilidade_shadow.targets) + end + --> soma todos os demais valores + somar_keys (habilidade, habilidade_shadow) + --> refresh na habilidade + _detalhes.refresh:r_habilidade_misc (habilidade, shadow [container]) + end + end + + --> cooldowns + if (actor.cooldowns_defensive) then + --> soma o total (captura de dados) + shadow.cooldowns_defensive = shadow.cooldowns_defensive + actor.cooldowns_defensive + --> total no combate overall (captura de dados) + _detalhes.tabela_overall.totals[4].cooldowns_defensive = _detalhes.tabela_overall.totals[4].cooldowns_defensive + actor.cooldowns_defensive + if (actor.grupo) then + _detalhes.tabela_overall.totals_grupo[4].cooldowns_defensive = _detalhes.tabela_overall.totals_grupo[4].cooldowns_defensive + actor.cooldowns_defensive + end + --> copia o container de alvos (captura de dados) + somar_alvos ("cooldowns_defensive_targets", shadow) + --> copia o container de habilidades (captura de dados) + somar_habilidades ("cooldowns_defensive_spell_tables", shadow) + end + + --> buff uptime + if (actor.buff_uptime) then + --> soma o total (captura de dados) + shadow.buff_uptime = shadow.buff_uptime + actor.buff_uptime + --> copia o container de alvos (captura de dados) + somar_alvos ("buff_uptime_targets", shadow) + --> copia o container de habilidades (captura de dados) + somar_habilidades ("buff_uptime_spell_tables", shadow) + end + + --> debuff uptime + if (actor.debuff_uptime) then + --> soma o total (captura de dados) + shadow.debuff_uptime = shadow.debuff_uptime + actor.debuff_uptime + --> copia o container de alvos (captura de dados) + somar_alvos ("debuff_uptime_targets", shadow) + --> copia o container de habilidades (captura de dados) + somar_habilidades ("debuff_uptime_spell_tables", shadow) + end + + --> interrupt + if (actor.interrupt) then + --> soma o total (captura de dados) + shadow.interrupt = shadow.interrupt + actor.interrupt + --> total no combate overall (captura de dados) + _detalhes.tabela_overall.totals[4].interrupt = _detalhes.tabela_overall.totals[4].interrupt + actor.interrupt + if (actor.grupo) then + _detalhes.tabela_overall.totals_grupo[4].interrupt = _detalhes.tabela_overall.totals_grupo[4].interrupt + actor.interrupt + end + --> copia o container de alvos (captura de dados) + somar_alvos ("interrupt_targets", shadow) + --> copia o container de habilidades (captura de dados) + somar_habilidades ("interrupt_spell_tables", shadow) + --> copia o que cada habilidade interrompeu + for spellid, habilidade in _pairs (actor.interrupt_spell_tables._ActorTable) do + --> pega o actor da shadow + local habilidade_shadow = shadow.interrupt_spell_tables:PegaHabilidade (spellid, true, nil, true) + --> copia as habilidades interrompidas + habilidade_shadow.interrompeu_oque = habilidade_shadow.interrompeu_oque or {} + for _spellid, amount in _pairs (habilidade.interrompeu_oque) do + if (habilidade_shadow.interrompeu_oque [_spellid]) then + habilidade_shadow.interrompeu_oque [_spellid] = habilidade_shadow.interrompeu_oque [_spellid] + amount + else + habilidade_shadow.interrompeu_oque [_spellid] = amount + end + end + end + --> copia o que ator interrompeu + for spellid, amount in _pairs (actor.interrompeu_oque) do + if (not shadow.interrompeu_oque [spellid]) then + shadow.interrompeu_oque [spellid] = 0 + end + shadow.interrompeu_oque [spellid] = shadow.interrompeu_oque [spellid] + amount + end + end + + --> ress + if (actor.ress) then + --> soma o total (captura de dados) + shadow.ress = shadow.ress + actor.ress + --> total no combate overall (captura de dados) + _detalhes.tabela_overall.totals[4].ress = _detalhes.tabela_overall.totals[4].ress + actor.ress + if (actor.grupo) then + _detalhes.tabela_overall.totals_grupo[4].ress = _detalhes.tabela_overall.totals_grupo[4].ress + actor.ress + end + --> copia o container de alvos (captura de dados) + somar_alvos ("ress_targets", shadow) + --> copia o container de habilidades (captura de dados) + somar_habilidades ("ress_spell_tables", shadow) + end + + --> dispell + if (actor.dispell) then + --> soma o total (captura de dados) + shadow.dispell = shadow.dispell + actor.dispell + --> total no combate overall (captura de dados) + _detalhes.tabela_overall.totals[4].dispell = _detalhes.tabela_overall.totals[4].dispell + actor.dispell + if (actor.grupo) then + _detalhes.tabela_overall.totals_grupo[4].dispell = _detalhes.tabela_overall.totals_grupo[4].dispell + actor.dispell + end + --> copia o container de alvos (captura de dados) + somar_alvos ("dispell_targets", shadow) + --> copia o container de habilidades (captura de dados) + somar_habilidades ("dispell_spell_tables", shadow) + --> copia o que cada habilidade dispelou + for spellid, habilidade in _pairs (actor.dispell_spell_tables._ActorTable) do + --> pega o actor da shadow + local habilidade_shadow = shadow.dispell_spell_tables:PegaHabilidade (spellid, true, nil, true) + --> copia as habilidades dispeladas + habilidade_shadow.dispell_oque = habilidade_shadow.dispell_oque or {} + for _spellid, amount in _pairs (habilidade.dispell_oque) do + if (habilidade_shadow.dispell_oque [_spellid]) then + habilidade_shadow.dispell_oque [_spellid] = habilidade_shadow.dispell_oque [_spellid] + amount + else + habilidade_shadow.dispell_oque [_spellid] = amount + end + end + end + --> copia o que ator dispelou + for spellid, amount in _pairs (actor.dispell_oque) do + if (not shadow.dispell_oque [spellid]) then + shadow.dispell_oque [spellid] = 0 + end + shadow.dispell_oque [spellid] = shadow.dispell_oque [spellid] + amount + end + + end + --> cc break + if (actor.cc_break) then + --> soma o total (captura de dados) + shadow.cc_break = shadow.cc_break + actor.cc_break + --> total no combate overall (captura de dados) + _detalhes.tabela_overall.totals[4].cc_break = _detalhes.tabela_overall.totals[4].cc_break + actor.cc_break + if (actor.grupo) then + _detalhes.tabela_overall.totals_grupo[4].cc_break = _detalhes.tabela_overall.totals_grupo[4].cc_break + actor.cc_break + end + --> copia o container de alvos (captura de dados) + somar_alvos ("cc_break_targets", shadow) + --> copia o container de habilidades (captura de dados) + somar_habilidades ("cc_break_spell_tables", shadow) + --> copia o que cada habilidade quebrou + for spellid, habilidade in _pairs (actor.cc_break_spell_tables._ActorTable) do + --> pega o actor da shadow + local habilidade_shadow = shadow.cc_break_spell_tables:PegaHabilidade (spellid, true, nil, true) + --> copia as habilidades quebradas + habilidade_shadow.cc_break_oque = habilidade_shadow.cc_break_oque or {} + for _spellid, amount in _pairs (habilidade.cc_break_oque) do + if (habilidade_shadow.cc_break_oque [_spellid]) then + habilidade_shadow.cc_break_oque [_spellid] = habilidade_shadow.cc_break_oque [_spellid] + amount + else + habilidade_shadow.cc_break_oque [_spellid] = amount + end + end + end + --> copia o que ator quebrou + for spellid, amount in _pairs (actor.cc_break_oque) do + if (not shadow.cc_break_oque [spellid]) then + shadow.cc_break_oque [spellid] = 0 + end + shadow.cc_break_oque [spellid] = shadow.cc_break_oque [spellid] + amount + end + end return shadow @@ -1951,106 +2051,107 @@ function atributo_misc:ColetarLixo (lastevent) return _detalhes:ColetarLixo (class_type, lastevent) end -local function ReconstroiMapa (tabela) - local mapa = {} - for i = 1, #tabela._ActorTable do - mapa [tabela._ActorTable[i].nome] = i - end - tabela._NameIndexTable = mapa -end function _detalhes.refresh:r_atributo_misc (este_jogador, shadow) _setmetatable (este_jogador, _detalhes.atributo_misc) este_jogador.__index = _detalhes.atributo_misc + + este_jogador.shadow = shadow - if (shadow ~= -1) then - este_jogador.shadow = shadow - - --> refresh interrupts - if (este_jogador.interrupt_targets) then + --> refresh interrupts + if (este_jogador.interrupt_targets) then + --> constrói os containers na shadow se não existir + if (not shadow.interrupt_targets) then + shadow.interrupt = 0 + shadow.interrupt_targets = container_combatentes:NovoContainer (container_damage_target) --> pode ser um container de alvo de dano, pois irá usar apenas o .total + shadow.interrupt_spell_tables = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) --> cria o container das habilidades usadas para interromper + shadow.interrompeu_oque = {} + end + --> recupera metas e indexes _detalhes.refresh:r_container_combatentes (este_jogador.interrupt_targets, shadow.interrupt_targets) _detalhes.refresh:r_container_habilidades (este_jogador.interrupt_spell_tables, shadow.interrupt_spell_tables) - end - - --> refresh buff uptime - if (este_jogador.buff_uptime_targets) then + end + + --> refresh buff uptime + if (este_jogador.buff_uptime_targets) then + --> constrói os containers na shadow se não existir + if (not shadow.buff_uptime_spell_targets) then + shadow.buff_uptime = 0 + shadow.buff_uptime_spell_targets = container_combatentes:NovoContainer (container_damage_target) --> pode ser um container de alvo de dano, pois irá usar apenas o .total + shadow.buff_uptime_spell_tables = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) --> cria o container das habilidades usadas para interromper + end + --> recupera metas e indexes _detalhes.refresh:r_container_combatentes (este_jogador.buff_uptime_targets, shadow.buff_uptime_targets) _detalhes.refresh:r_container_habilidades (este_jogador.buff_uptime_spell_tables, shadow.buff_uptime_spell_tables) - end - - --> refresh buff uptime - if (este_jogador.debuff_uptime_targets) then + end + + --> refresh buff uptime + if (este_jogador.debuff_uptime_targets) then + --> constrói os containers na shadow se não existir + if (not shadow.debuff_uptime_spell_targets) then + shadow.debuff_uptime = 0 + shadow.debuff_uptime_spell_targets = container_combatentes:NovoContainer (container_damage_target) --> pode ser um container de alvo de dano, pois irá usar apenas o .total + shadow.debuff_uptime_spell_tables = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) --> cria o container das habilidades usadas para interromper + end + --> recupera metas e indexes _detalhes.refresh:r_container_combatentes (este_jogador.debuff_uptime_targets, shadow.debuff_uptime_targets) _detalhes.refresh:r_container_habilidades (este_jogador.debuff_uptime_spell_tables, shadow.debuff_uptime_spell_tables) - end - - --> refresh cooldowns defensive - if (este_jogador.cooldowns_defensive_targets) then + end + + --> refresh cooldowns defensive + if (este_jogador.cooldowns_defensive_targets) then + --> constrói os containers na shadow se não existir + if (not shadow.cooldowns_defensive_targets) then + shadow.cooldowns_defensive = 0 + shadow.cooldowns_defensive_targets = container_combatentes:NovoContainer (container_damage_target) + shadow.cooldowns_defensive_spell_tables = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) + end + --> recupera metas e indexes _detalhes.refresh:r_container_combatentes (este_jogador.cooldowns_defensive_targets, shadow.cooldowns_defensive_targets) _detalhes.refresh:r_container_habilidades (este_jogador.cooldowns_defensive_spell_tables, shadow.cooldowns_defensive_spell_tables) - end - - --> refresh ressers - if (este_jogador.ress_targets) then + end + + --> refresh ressers + if (este_jogador.ress_targets) then + --> constrói os containers na shadow se não existir + if (not shadow.ress_targets) then + shadow.ress = 0 + shadow.ress_targets = container_combatentes:NovoContainer (container_damage_target) --> pode ser um container de alvo de dano, pois irá usar apenas o .total + shadow.ress_spell_tables = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) --> cria o container das habilidades usadas para interromper + end + --> recupera metas e indexes _detalhes.refresh:r_container_combatentes (este_jogador.ress_targets, shadow.ress_targets) _detalhes.refresh:r_container_habilidades (este_jogador.ress_spell_tables, shadow.ress_spell_tables) - end - - --> refresh dispells - if (este_jogador.dispell_targets) then + end + + --> refresh dispells + if (este_jogador.dispell_targets) then + --> constrói os containers na shadow se não existir + if (not shadow.dispell_targets) then + shadow.dispell = 0 + shadow.dispell_targets = container_combatentes:NovoContainer (container_damage_target) --> pode ser um container de alvo de dano, pois irá usar apenas o .total + shadow.dispell_spell_tables = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) --> cria o container das habilidades usadas para interromper + shadow.dispell_oque = {} + end + --> recupera metas e indexes _detalhes.refresh:r_container_combatentes (este_jogador.dispell_targets, shadow.dispell_targets) _detalhes.refresh:r_container_habilidades (este_jogador.dispell_spell_tables, shadow.dispell_spell_tables) - end - - --> refresh cc_breaks - if (este_jogador.cc_break_targets) then + end + + --> refresh cc_breaks + if (este_jogador.cc_break_targets) then + --> constrói os containers na shadow se não existir + if (not shadow.cc_break) then + shadow.cc_break = 0 + shadow.cc_break_targets = container_combatentes:NovoContainer (container_damage_target) --> pode ser um container de alvo de dano, pois irá usar apenas o .total + shadow.cc_break_spell_tables = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) --> cria o container das habilidades usadas para interromper + shadow.cc_break_oque = {} + end + --> recupera metas e indexes _detalhes.refresh:r_container_combatentes (este_jogador.cc_break_targets, shadow.cc_break_targets) _detalhes.refresh:r_container_habilidades (este_jogador.cc_break_spell_tables, shadow.cc_break_spell_tables) - end - else - - --> refresh interrupts - if (este_jogador.interrupt_targets) then - _detalhes.refresh:r_container_combatentes (este_jogador.interrupt_targets, -1) - _detalhes.refresh:r_container_habilidades (este_jogador.interrupt_spell_tables, -1) - end - - --> refresh cooldowns defensive - if (este_jogador.cooldowns_defensive_targets) then - _detalhes.refresh:r_container_combatentes (este_jogador.cooldowns_defensive_targets, -1) - _detalhes.refresh:r_container_habilidades (este_jogador.cooldowns_defensive_spell_tables, -1) - end - - --> refresh buff uptime - if (este_jogador.buff_uptime_targets) then - _detalhes.refresh:r_container_combatentes (este_jogador.buff_uptime_targets, -1) - _detalhes.refresh:r_container_habilidades (este_jogador.buff_uptime_spell_tables, -1) - end - - --> refresh debuff uptime - if (este_jogador.debuff_uptime_targets) then - _detalhes.refresh:r_container_combatentes (este_jogador.debuff_uptime_targets, -1) - _detalhes.refresh:r_container_habilidades (este_jogador.debuff_uptime_spell_tables, -1) - end - - --> refresh ressers - if (este_jogador.ress_targets) then - _detalhes.refresh:r_container_combatentes (este_jogador.ress_targets, -1) - _detalhes.refresh:r_container_habilidades (este_jogador.ress_spell_tables, -1) - end - - --> refresh dispells - if (este_jogador.dispell_targets) then - _detalhes.refresh:r_container_combatentes (este_jogador.dispell_targets, -1) - _detalhes.refresh:r_container_habilidades (este_jogador.dispell_spell_tables, -1) - end - - --> refresh cc_breaks - if (este_jogador.cc_break_targets) then - _detalhes.refresh:r_container_combatentes (este_jogador.cc_break_targets, -1) - _detalhes.refresh:r_container_habilidades (este_jogador.cc_break_spell_tables, -1) - end end + end function _detalhes.clear:c_atributo_misc (este_jogador) @@ -2098,403 +2199,497 @@ function _detalhes.clear:c_atributo_misc (este_jogador) end -atributo_misc.__add = function (shadow, tabela2) +atributo_misc.__add = function (tabela1, tabela2) + + local somar_keys = function (habilidade, habilidade_tabela1) + for key, value in _pairs (habilidade) do + if (_type (value) == "number") then + if (key ~= "id") then + if (not habilidade_tabela1 [key]) then + habilidade_tabela1 [key] = 0 + end + habilidade_tabela1 [key] = habilidade_tabela1 [key] + value + end + end + end + end if (tabela2.interrupt) then - if (not shadow.interrupt) then - shadow.interrupt = 0 - shadow.interrupt_targets = container_combatentes:NovoContainer (container_damage_target) - shadow.interrupt_spell_tables = container_habilidades:NovoContainer (container_misc) - shadow.interrompeu_oque = {} + if (not tabela1.interrupt) then + tabela1.interrupt = 0 + tabela1.interrupt_targets = container_combatentes:NovoContainer (container_damage_target) + tabela1.interrupt_spell_tables = container_habilidades:NovoContainer (container_misc) + tabela1.interrompeu_oque = {} end - shadow.interrupt = shadow.interrupt + tabela2.interrupt - - if ( not (shadow.shadow and tabela2.shadow) ) then - _detalhes.tabela_overall.totals[4]["interrupt"] = _detalhes.tabela_overall.totals[4]["interrupt"] + tabela2.interrupt - - if (tabela2.grupo) then - _detalhes.tabela_overall.totals_grupo[4]["interrupt"] = _detalhes.tabela_overall.totals_grupo[4]["interrupt"] + tabela2.interrupt + --> total de interrupts + tabela1.interrupt = tabela1.interrupt + tabela2.interrupt + --> soma o interrompeu o que + for spellid, amount in _pairs (tabela2.interrompeu_oque) do + if (not tabela1.interrompeu_oque [spellid]) then + tabela1.interrompeu_oque [spellid] = 0 + end + tabela1.interrompeu_oque [spellid] = tabela1.interrompeu_oque [spellid] + amount end - end - - for index, alvo in _ipairs (tabela2.interrupt_targets._ActorTable) do - local alvo_shadow = shadow.interrupt_targets:PegarCombatente (alvo.serial, alvo.nome, alvo.flag_original, true) - alvo_shadow.total = alvo_shadow.total + alvo.total - end - - for spellid, habilidade in _pairs (tabela2.interrupt_spell_tables._ActorTable) do - local habilidade_shadow = shadow.interrupt_spell_tables:PegaHabilidade (spellid, true, nil, true) - - habilidade_shadow.interrompeu_oque = {} - for _spellid, amount in _pairs (habilidade.interrompeu_oque) do - habilidade_shadow.interrompeu_oque [_spellid] = amount + --> soma os containers de alvos + for index, alvo in _ipairs (tabela2.interrupt_targets._ActorTable) do + --> pega o alvo no ator + local alvo_tabela1 = tabela1.interrupt_targets:PegarCombatente (nil, alvo.nome, nil, true) + --> soma o valor + alvo_tabela1.total = alvo_tabela1.total + alvo.total end - - for index, alvo in _ipairs (habilidade.targets._ActorTable) do - local alvo_shadow = habilidade_shadow.targets:PegarCombatente (alvo.serial, alvo.nome, alvo.flag_original, true) - alvo_shadow.total = alvo_shadow.total + alvo.total - end - - for key, value in _pairs (habilidade) do - if (_type (value) == "number") then - if (key ~= "id") then - if (not habilidade_shadow [key]) then - habilidade_shadow [key] = 0 - end - habilidade_shadow [key] = habilidade_shadow [key] + value + + --> soma o container de habilidades + for spellid, habilidade in _pairs (tabela2.interrupt_spell_tables._ActorTable) do + --> pega a habilidade no primeiro ator + local habilidade_tabela1 = tabela1.interrupt_spell_tables:PegaHabilidade (spellid, true, nil, false) + --> soma o que essa habilidade interrompeu + habilidade_tabela1.interrompeu_oque = habilidade_tabela1.interrompeu_oque or {} + for _spellid, amount in _pairs (habilidade.interrompeu_oque) do + if (habilidade_tabela1.interrompeu_oque [_spellid]) then + habilidade_tabela1.interrompeu_oque [_spellid] = habilidade_tabela1.interrompeu_oque [_spellid] + amount + else + habilidade_tabela1.interrompeu_oque [_spellid] = amount end end - end - end + --> soma os alvos + for index, alvo in _ipairs (habilidade.targets._ActorTable) do + local alvo_tabela1 = habilidade_tabela1.targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_tabela1.total = alvo_tabela1.total + alvo.total + end + + somar_keys (habilidade, habilidade_tabela1) + end - for spellid, amount in _pairs (tabela2.interrompeu_oque) do - if (not shadow.interrompeu_oque [spellid]) then - shadow.interrompeu_oque [spellid] = 0 - end - shadow.interrompeu_oque [spellid] = shadow.interrompeu_oque [spellid] + amount - end - end if (tabela2.buff_uptime) then - if (not shadow.buff_uptime) then - shadow.buff_uptime = 0 - shadow.buff_uptime_targets = container_combatentes:NovoContainer (container_damage_target) --> pode ser um container de alvo de dano, pois irá usar apenas o .total - shadow.buff_uptime_spell_tables = container_habilidades:NovoContainer (container_misc) --> cria o container das habilidades usadas + if (not tabela1.buff_uptime) then + tabela1.buff_uptime = 0 + tabela1.buff_uptime_targets = container_combatentes:NovoContainer (container_damage_target) --> pode ser um container de alvo de dano, pois irá usar apenas o .total + tabela1.buff_uptime_spell_tables = container_habilidades:NovoContainer (container_misc) --> cria o container das habilidades usadas end - shadow.buff_uptime = shadow.buff_uptime + tabela2.buff_uptime - - if ( not (shadow.shadow and tabela2.shadow) ) then - --_detalhes.tabela_overall.totals[4]["cooldowns_defensive"] = _detalhes.tabela_overall.totals[4]["cooldowns_defensive"] + tabela2.cooldowns_defensive - - --if (tabela2.grupo) then - -- _detalhes.tabela_overall.totals_grupo[4]["cooldowns_defensive"] = _detalhes.tabela_overall.totals_grupo[4]["cooldowns_defensive"] + tabela2.cooldowns_defensive - --end - end + tabela1.buff_uptime = tabela1.buff_uptime + tabela2.buff_uptime for index, alvo in _ipairs (tabela2.buff_uptime_targets._ActorTable) do - local alvo_shadow = shadow.buff_uptime_targets:PegarCombatente (alvo.serial, alvo.nome, alvo.flag_original, true) - alvo_shadow.total = alvo_shadow.total + alvo.total + local alvo_tabela1 = tabela1.buff_uptime_targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_tabela1.total = alvo_tabela1.total + alvo.total end for spellid, habilidade in _pairs (tabela2.buff_uptime_spell_tables._ActorTable) do - local habilidade_shadow = shadow.buff_uptime_spell_tables:PegaHabilidade (spellid, true, nil, true) + local habilidade_tabela1 = tabela1.buff_uptime_spell_tables:PegaHabilidade (spellid, true, nil, false) for index, alvo in _ipairs (habilidade.targets._ActorTable) do - local alvo_shadow = habilidade_shadow.targets:PegarCombatente (alvo.serial, alvo.nome, alvo.flag_original, true) - alvo_shadow.total = alvo_shadow.total + alvo.total - end - - for key, value in _pairs (habilidade) do - if (_type (value) == "number") then - if (key ~= "id") then - if (not habilidade_shadow [key]) then - habilidade_shadow [key] = 0 - end - habilidade_shadow [key] = habilidade_shadow [key] + value - end - end + local alvo_tabela1 = habilidade_tabela1.targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_tabela1.total = alvo_tabela1.total + alvo.total end + + somar_keys (habilidade, habilidade_tabela1) end end if (tabela2.debuff_uptime) then - if (not shadow.debuff_uptime) then - shadow.debuff_uptime = 0 - shadow.debuff_uptime_targets = container_combatentes:NovoContainer (container_damage_target) --> pode ser um container de alvo de dano, pois irá usar apenas o .total - shadow.debuff_uptime_spell_tables = container_habilidades:NovoContainer (container_misc) --> cria o container das habilidades usadas + if (not tabela1.debuff_uptime) then + tabela1.debuff_uptime = 0 + tabela1.debuff_uptime_targets = container_combatentes:NovoContainer (container_damage_target) --> pode ser um container de alvo de dano, pois irá usar apenas o .total + tabela1.debuff_uptime_spell_tables = container_habilidades:NovoContainer (container_misc) --> cria o container das habilidades usadas end - shadow.debuff_uptime = shadow.debuff_uptime + tabela2.debuff_uptime - - if ( not (shadow.shadow and tabela2.shadow) ) then - --_detalhes.tabela_overall.totals[4]["cooldowns_defensive"] = _detalhes.tabela_overall.totals[4]["cooldowns_defensive"] + tabela2.cooldowns_defensive - - --if (tabela2.grupo) then - -- _detalhes.tabela_overall.totals_grupo[4]["cooldowns_defensive"] = _detalhes.tabela_overall.totals_grupo[4]["cooldowns_defensive"] + tabela2.cooldowns_defensive - --end - end + tabela1.debuff_uptime = tabela1.debuff_uptime + tabela2.debuff_uptime for index, alvo in _ipairs (tabela2.debuff_uptime_targets._ActorTable) do - local alvo_shadow = shadow.debuff_uptime_targets:PegarCombatente (alvo.serial, alvo.nome, alvo.flag_original, true) - alvo_shadow.total = alvo_shadow.total + alvo.total + local alvo_tabela1 = tabela1.debuff_uptime_targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_tabela1.total = alvo_tabela1.total + alvo.total end for spellid, habilidade in _pairs (tabela2.debuff_uptime_spell_tables._ActorTable) do - local habilidade_shadow = shadow.debuff_uptime_spell_tables:PegaHabilidade (spellid, true, nil, true) + local habilidade_tabela1 = tabela1.debuff_uptime_spell_tables:PegaHabilidade (spellid, true, nil, false) for index, alvo in _ipairs (habilidade.targets._ActorTable) do - local alvo_shadow = habilidade_shadow.targets:PegarCombatente (alvo.serial, alvo.nome, alvo.flag_original, true) - alvo_shadow.total = alvo_shadow.total + alvo.total + local alvo_tabela1 = habilidade_tabela1.targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_tabela1.total = alvo_tabela1.total + alvo.total end - for key, value in _pairs (habilidade) do - if (_type (value) == "number") then - if (key ~= "id") then - if (not habilidade_shadow [key]) then - habilidade_shadow [key] = 0 - end - habilidade_shadow [key] = habilidade_shadow [key] + value - end - end - end + somar_keys (habilidade, habilidade_tabela1) end end if (tabela2.cooldowns_defensive) then - if (not shadow.cooldowns_defensive) then - shadow.cooldowns_defensive = 0 - shadow.cooldowns_defensive_targets = container_combatentes:NovoContainer (container_damage_target) --> pode ser um container de alvo de dano, pois irá usar apenas o .total - shadow.cooldowns_defensive_spell_tables = container_habilidades:NovoContainer (container_misc) --> cria o container das habilidades usadas + if (not tabela1.cooldowns_defensive) then + tabela1.cooldowns_defensive = 0 + tabela1.cooldowns_defensive_targets = container_combatentes:NovoContainer (container_damage_target) --> pode ser um container de alvo de dano, pois irá usar apenas o .total + tabela1.cooldowns_defensive_spell_tables = container_habilidades:NovoContainer (container_misc) --> cria o container das habilidades usadas end - shadow.cooldowns_defensive = shadow.cooldowns_defensive + tabela2.cooldowns_defensive - - if ( not (shadow.shadow and tabela2.shadow) ) then - _detalhes.tabela_overall.totals[4]["cooldowns_defensive"] = _detalhes.tabela_overall.totals[4]["cooldowns_defensive"] + tabela2.cooldowns_defensive - - if (tabela2.grupo) then - _detalhes.tabela_overall.totals_grupo[4]["cooldowns_defensive"] = _detalhes.tabela_overall.totals_grupo[4]["cooldowns_defensive"] + tabela2.cooldowns_defensive - end - end + tabela1.cooldowns_defensive = tabela1.cooldowns_defensive + tabela2.cooldowns_defensive for index, alvo in _ipairs (tabela2.cooldowns_defensive_targets._ActorTable) do - local alvo_shadow = shadow.cooldowns_defensive_targets:PegarCombatente (alvo.serial, alvo.nome, alvo.flag_original, true) - alvo_shadow.total = alvo_shadow.total + alvo.total + local alvo_tabela1 = tabela1.cooldowns_defensive_targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_tabela1.total = alvo_tabela1.total + alvo.total end for spellid, habilidade in _pairs (tabela2.cooldowns_defensive_spell_tables._ActorTable) do - local habilidade_shadow = shadow.cooldowns_defensive_spell_tables:PegaHabilidade (spellid, true, nil, true) + local habilidade_tabela1 = tabela1.cooldowns_defensive_spell_tables:PegaHabilidade (spellid, true, nil, false) for index, alvo in _ipairs (habilidade.targets._ActorTable) do - local alvo_shadow = habilidade_shadow.targets:PegarCombatente (alvo.serial, alvo.nome, alvo.flag_original, true) - alvo_shadow.total = alvo_shadow.total + alvo.total + local alvo_tabela1 = habilidade_tabela1.targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_tabela1.total = alvo_tabela1.total + alvo.total end - for key, value in _pairs (habilidade) do - if (_type (value) == "number") then - if (key ~= "id") then - if (not habilidade_shadow [key]) then - habilidade_shadow [key] = 0 - end - habilidade_shadow [key] = habilidade_shadow [key] + value - end - end - end + somar_keys (habilidade, habilidade_tabela1) end end if (tabela2.ress) then - if (not shadow.ress) then - shadow.ress = 0 - shadow.ress_targets = container_combatentes:NovoContainer (container_damage_target) - shadow.ress_spell_tables = container_habilidades:NovoContainer (container_misc) + if (not tabela1.ress) then + tabela1.ress = 0 + tabela1.ress_targets = container_combatentes:NovoContainer (container_damage_target) + tabela1.ress_spell_tables = container_habilidades:NovoContainer (container_misc) end - shadow.ress = shadow.ress + tabela2.ress - - if ( not (shadow.shadow and tabela2.shadow) ) then - _detalhes.tabela_overall.totals[4]["ress"] = _detalhes.tabela_overall.totals[4]["ress"] + tabela2.ress - - if (tabela2.grupo) then - _detalhes.tabela_overall.totals_grupo[4]["ress"] = _detalhes.tabela_overall.totals_grupo[4]["ress"] + tabela2.ress - end - end + tabela1.ress = tabela1.ress + tabela2.ress for index, alvo in _ipairs (tabela2.ress_targets._ActorTable) do - local alvo_shadow = shadow.ress_targets:PegarCombatente (alvo.serial, alvo.nome, alvo.flag_original, true) - alvo_shadow.total = alvo_shadow.total + alvo.total + local alvo_tabela1 = tabela1.ress_targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_tabela1.total = alvo_tabela1.total + alvo.total end for spellid, habilidade in _pairs (tabela2.ress_spell_tables._ActorTable) do - local habilidade_shadow = shadow.ress_spell_tables:PegaHabilidade (spellid, true, nil, true) + local habilidade_tabela1 = tabela1.ress_spell_tables:PegaHabilidade (spellid, true, nil, false) for index, alvo in _ipairs (habilidade.targets._ActorTable) do - local alvo_shadow = habilidade_shadow.targets:PegarCombatente (alvo.serial, alvo.nome, alvo.flag_original, true) - alvo_shadow.total = alvo_shadow.total + alvo.total + local alvo_tabela1 = habilidade_tabela1.targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_tabela1.total = alvo_tabela1.total + alvo.total end - for key, value in _pairs (habilidade) do - if (_type (value) == "number") then - if (key ~= "id") then - if (not habilidade_shadow [key]) then - habilidade_shadow [key] = 0 - end - habilidade_shadow [key] = habilidade_shadow [key] + value - end - end - end + somar_keys (habilidade, habilidade_tabela1) end end if (tabela2.dispell) then - if (not shadow.dispell) then - shadow.dispell = 0 - shadow.dispell_targets = container_combatentes:NovoContainer (container_damage_target) - shadow.dispell_spell_tables = container_habilidades:NovoContainer (container_misc) - shadow.dispell_oque = {} + if (not tabela1.dispell) then + tabela1.dispell = 0 + tabela1.dispell_targets = container_combatentes:NovoContainer (container_damage_target) + tabela1.dispell_spell_tables = container_habilidades:NovoContainer (container_misc) + tabela1.dispell_oque = {} end - shadow.dispell = shadow.dispell + tabela2.dispell - - if ( not (shadow.shadow and tabela2.shadow) ) then - _detalhes.tabela_overall.totals[4]["dispell"] = _detalhes.tabela_overall.totals[4]["dispell"] + tabela2.dispell - - if (tabela2.grupo) then - _detalhes.tabela_overall.totals_grupo[4]["dispell"] = _detalhes.tabela_overall.totals_grupo[4]["dispell"] + tabela2.dispell - end - end + tabela1.dispell = tabela1.dispell + tabela2.dispell for index, alvo in _ipairs (tabela2.dispell_targets._ActorTable) do - local alvo_shadow = shadow.dispell_targets:PegarCombatente (alvo.serial, alvo.nome, alvo.flag_original, true) - alvo_shadow.total = alvo_shadow.total + alvo.total + local alvo_tabela1 = tabela1.dispell_targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_tabela1.total = alvo_tabela1.total + alvo.total end for spellid, habilidade in _pairs (tabela2.dispell_spell_tables._ActorTable) do - local habilidade_shadow = shadow.dispell_spell_tables:PegaHabilidade (spellid, true, nil, true) + local habilidade_tabela1 = tabela1.dispell_spell_tables:PegaHabilidade (spellid, true, nil, false) - habilidade_shadow.dispell_oque = {} + habilidade_tabela1.dispell_oque = habilidade_tabela1.dispell_oque or {} - if (habilidade.dispell_oque) then - for _spellid, amount in _pairs (habilidade.dispell_oque) do - habilidade_shadow.dispell_oque [_spellid] = amount + for _spellid, amount in _pairs (habilidade.dispell_oque) do + if (habilidade_tabela1.dispell_oque [_spellid]) then + habilidade_tabela1.dispell_oque [_spellid] = habilidade_tabela1.dispell_oque [_spellid] + amount + else + habilidade_tabela1.dispell_oque [_spellid] = amount end end for index, alvo in _ipairs (habilidade.targets._ActorTable) do - local alvo_shadow = habilidade_shadow.targets:PegarCombatente (alvo.serial, alvo.nome, alvo.flag_original, true) - alvo_shadow.total = alvo_shadow.total + alvo.total + local alvo_tabela1 = habilidade_tabela1.targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_tabela1.total = alvo_tabela1.total + alvo.total end - for key, value in _pairs (habilidade) do - if (_type (value) == "number") then - if (key ~= "id") then - if (not habilidade_shadow [key]) then - habilidade_shadow [key] = 0 - end - habilidade_shadow [key] = habilidade_shadow [key] + value - end - end - end + somar_keys (habilidade, habilidade_tabela1) end for spellid, amount in _pairs (tabela2.dispell_oque) do - if (not shadow.dispell_oque [spellid]) then - shadow.dispell_oque [spellid] = 0 + if (not tabela1.dispell_oque [spellid]) then + tabela1.dispell_oque [spellid] = 0 end - shadow.dispell_oque [spellid] = shadow.dispell_oque [spellid] + amount + tabela1.dispell_oque [spellid] = tabela1.dispell_oque [spellid] + amount end end if (tabela2.cc_break) then - if (not shadow.cc_break) then - shadow.cc_break = 0 - shadow.cc_break_targets = container_combatentes:NovoContainer (container_damage_target) --> pode ser um container de alvo de dano, pois irá usar apenas o .total - shadow.cc_break_spell_tables = container_habilidades:NovoContainer (container_misc) --> cria o container das habilidades usadas para interromper - shadow.cc_break_oque = {} + if (not tabela1.cc_break) then + tabela1.cc_break = 0 + tabela1.cc_break_targets = container_combatentes:NovoContainer (container_damage_target) --> pode ser um container de alvo de dano, pois irá usar apenas o .total + tabela1.cc_break_spell_tables = container_habilidades:NovoContainer (container_misc) --> cria o container das habilidades usadas para interromper + tabela1.cc_break_oque = {} end - shadow.cc_break = shadow.cc_break + tabela2.cc_break - - if ( not (shadow.shadow and tabela2.shadow) ) then - _detalhes.tabela_overall.totals[4]["cc_break"] = _detalhes.tabela_overall.totals[4]["cc_break"] + tabela2.cc_break - - if (tabela2.grupo) then - _detalhes.tabela_overall.totals_grupo[4]["cc_break"] = _detalhes.tabela_overall.totals_grupo[4]["cc_break"] + tabela2.cc_break - end - end + tabela1.cc_break = tabela1.cc_break + tabela2.cc_break for index, alvo in _ipairs (tabela2.cc_break_targets._ActorTable) do - local alvo_shadow = shadow.cc_break_targets:PegarCombatente (alvo.serial, alvo.nome, alvo.flag_original, true) - alvo_shadow.total = alvo_shadow.total + alvo.total + local alvo_tabela1 = tabela1.cc_break_targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_tabela1.total = alvo_tabela1.total + alvo.total end for spellid, habilidade in _pairs (tabela2.cc_break_spell_tables._ActorTable) do - local habilidade_shadow = shadow.cc_break_spell_tables:PegaHabilidade (spellid, true, nil, true) + local habilidade_tabela1 = tabela1.cc_break_spell_tables:PegaHabilidade (spellid, true, nil, false) - habilidade_shadow.cc_break_oque = {} + habilidade_tabela1.cc_break_oque = habilidade_tabela1.cc_break_oque or {} for _spellid, amount in _pairs (habilidade.cc_break_oque) do - habilidade_shadow.cc_break_oque [_spellid] = amount + if (habilidade_tabela1.cc_break_oque [_spellid]) then + habilidade_tabela1.cc_break_oque [_spellid] = habilidade_tabela1.cc_break_oque [_spellid] + amount + else + habilidade_tabela1.cc_break_oque [_spellid] = amount + end end for index, alvo in _ipairs (habilidade.targets._ActorTable) do - local alvo_shadow = habilidade_shadow.targets:PegarCombatente (alvo.serial, alvo.nome, alvo.flag_original, true) - alvo_shadow.total = alvo_shadow.total + alvo.total + local alvo_tabela1 = habilidade_tabela1.targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_tabela1.total = alvo_tabela1.total + alvo.total end - for key, value in _pairs (habilidade) do - if (_type (value) == "number") then - if (key ~= "id") then - if (not habilidade_shadow [key]) then - habilidade_shadow [key] = 0 - end - habilidade_shadow [key] = habilidade_shadow [key] + value - end - end - end + somar_keys (habilidade, habilidade_tabela1) end for spellid, amount in _pairs (tabela2.cc_break_oque) do - if (not shadow.cc_break_oque [spellid]) then - shadow.cc_break_oque [spellid] = 0 + if (not tabela1.cc_break_oque [spellid]) then + tabela1.cc_break_oque [spellid] = 0 end - shadow.cc_break_oque [spellid] = shadow.cc_break_oque [spellid] + amount + tabela1.cc_break_oque [spellid] = tabela1.cc_break_oque [spellid] + amount + end + end + + return tabela1 +end + +atributo_misc.__sub = function (tabela1, tabela2) + + local subtrair_keys = function (habilidade, habilidade_tabela1) + for key, value in _pairs (habilidade) do + if (_type (value) == "number") then + if (key ~= "id") then + if (not habilidade_tabela1 [key]) then + habilidade_tabela1 [key] = 0 + end + habilidade_tabela1 [key] = habilidade_tabela1 [key] - value + end + end + end + end + + if (tabela2.interrupt) then + + --> total de interrupts + tabela1.interrupt = tabela1.interrupt - tabela2.interrupt + --> soma o interrompeu o que + for spellid, amount in _pairs (tabela2.interrompeu_oque) do + if (not tabela1.interrompeu_oque [spellid]) then + tabela1.interrompeu_oque [spellid] = 0 + end + tabela1.interrompeu_oque [spellid] = tabela1.interrompeu_oque [spellid] - amount + end + --> soma os containers de alvos + for index, alvo in _ipairs (tabela2.interrupt_targets._ActorTable) do + --> pega o alvo no ator + local alvo_tabela1 = tabela1.interrupt_targets:PegarCombatente (nil, alvo.nome, nil, true) + --> soma o valor + alvo_tabela1.total = alvo_tabela1.total - alvo.total + end + + --> soma o container de habilidades + for spellid, habilidade in _pairs (tabela2.interrupt_spell_tables._ActorTable) do + --> pega a habilidade no primeiro ator + local habilidade_tabela1 = tabela1.interrupt_spell_tables:PegaHabilidade (spellid, true, nil, false) + --> soma o que essa habilidade interrompeu + habilidade_tabela1.interrompeu_oque = habilidade_tabela1.interrompeu_oque or {} + for _spellid, amount in _pairs (habilidade.interrompeu_oque) do + if (habilidade_tabela1.interrompeu_oque [_spellid]) then + habilidade_tabela1.interrompeu_oque [_spellid] = habilidade_tabela1.interrompeu_oque [_spellid] - amount + else + habilidade_tabela1.interrompeu_oque [_spellid] = amount + end + end + --> soma os alvos + for index, alvo in _ipairs (habilidade.targets._ActorTable) do + local alvo_tabela1 = habilidade_tabela1.targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_tabela1.total = alvo_tabela1.total - alvo.total + end + + subtrair_keys (habilidade, habilidade_tabela1) + end + + end + + if (tabela2.buff_uptime) then + + tabela1.buff_uptime = tabela1.buff_uptime - tabela2.buff_uptime + + for index, alvo in _ipairs (tabela2.buff_uptime_targets._ActorTable) do + local alvo_tabela1 = tabela1.buff_uptime_targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_tabela1.total = alvo_tabela1.total - alvo.total + end + + for spellid, habilidade in _pairs (tabela2.buff_uptime_spell_tables._ActorTable) do + local habilidade_tabela1 = tabela1.buff_uptime_spell_tables:PegaHabilidade (spellid, true, nil, false) + + for index, alvo in _ipairs (habilidade.targets._ActorTable) do + local alvo_tabela1 = habilidade_tabela1.targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_tabela1.total = alvo_tabela1.total - alvo.total + end + + subtrair_keys (habilidade, habilidade_tabela1) + end + + end + + if (tabela2.debuff_uptime) then + + tabela1.debuff_uptime = tabela1.debuff_uptime - tabela2.debuff_uptime + + for index, alvo in _ipairs (tabela2.debuff_uptime_targets._ActorTable) do + local alvo_tabela1 = tabela1.debuff_uptime_targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_tabela1.total = alvo_tabela1.total - alvo.total + end + + for spellid, habilidade in _pairs (tabela2.debuff_uptime_spell_tables._ActorTable) do + local habilidade_tabela1 = tabela1.debuff_uptime_spell_tables:PegaHabilidade (spellid, true, nil, false) + + for index, alvo in _ipairs (habilidade.targets._ActorTable) do + local alvo_tabela1 = habilidade_tabela1.targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_tabela1.total = alvo_tabela1.total - alvo.total + end + + subtrair_keys (habilidade, habilidade_tabela1) + end + + end + + if (tabela2.cooldowns_defensive) then + + tabela1.cooldowns_defensive = tabela1.cooldowns_defensive - tabela2.cooldowns_defensive + + for index, alvo in _ipairs (tabela2.cooldowns_defensive_targets._ActorTable) do + local alvo_tabela1 = tabela1.cooldowns_defensive_targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_tabela1.total = alvo_tabela1.total - alvo.total + end + + for spellid, habilidade in _pairs (tabela2.cooldowns_defensive_spell_tables._ActorTable) do + local habilidade_tabela1 = tabela1.cooldowns_defensive_spell_tables:PegaHabilidade (spellid, true, nil, false) + + for index, alvo in _ipairs (habilidade.targets._ActorTable) do + local alvo_tabela1 = habilidade_tabela1.targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_tabela1.total = alvo_tabela1.total - alvo.total + end + + subtrair_keys (habilidade, habilidade_tabela1) + end + + end + + if (tabela2.ress) then + + tabela1.ress = tabela1.ress - tabela2.ress + + for index, alvo in _ipairs (tabela2.ress_targets._ActorTable) do + local alvo_tabela1 = tabela1.ress_targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_tabela1.total = alvo_tabela1.total - alvo.total + end + + for spellid, habilidade in _pairs (tabela2.ress_spell_tables._ActorTable) do + local habilidade_tabela1 = tabela1.ress_spell_tables:PegaHabilidade (spellid, true, nil, false) + + for index, alvo in _ipairs (habilidade.targets._ActorTable) do + local alvo_tabela1 = habilidade_tabela1.targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_tabela1.total = alvo_tabela1.total - alvo.total + end + + subtrair_keys (habilidade, habilidade_tabela1) + end + + end + + if (tabela2.dispell) then + + tabela1.dispell = tabela1.dispell - tabela2.dispell + + for index, alvo in _ipairs (tabela2.dispell_targets._ActorTable) do + local alvo_tabela1 = tabela1.dispell_targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_tabela1.total = alvo_tabela1.total - alvo.total + end + + for spellid, habilidade in _pairs (tabela2.dispell_spell_tables._ActorTable) do + local habilidade_tabela1 = tabela1.dispell_spell_tables:PegaHabilidade (spellid, true, nil, false) + + habilidade_tabela1.dispell_oque = habilidade_tabela1.dispell_oque or {} + + for _spellid, amount in _pairs (habilidade.dispell_oque) do + if (habilidade_tabela1.dispell_oque [_spellid]) then + habilidade_tabela1.dispell_oque [_spellid] = habilidade_tabela1.dispell_oque [_spellid] - amount + else + habilidade_tabela1.dispell_oque [_spellid] = amount + end + end + + for index, alvo in _ipairs (habilidade.targets._ActorTable) do + local alvo_tabela1 = habilidade_tabela1.targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_tabela1.total = alvo_tabela1.total - alvo.total + end + + subtrair_keys (habilidade, habilidade_tabela1) + end + + for spellid, amount in _pairs (tabela2.dispell_oque) do + if (not tabela1.dispell_oque [spellid]) then + tabela1.dispell_oque [spellid] = 0 + end + tabela1.dispell_oque [spellid] = tabela1.dispell_oque [spellid] - amount + end + + end + + if (tabela2.cc_break) then + + tabela1.cc_break = tabela1.cc_break - tabela2.cc_break + + for index, alvo in _ipairs (tabela2.cc_break_targets._ActorTable) do + local alvo_tabela1 = tabela1.cc_break_targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_tabela1.total = alvo_tabela1.total - alvo.total + end + + for spellid, habilidade in _pairs (tabela2.cc_break_spell_tables._ActorTable) do + local habilidade_tabela1 = tabela1.cc_break_spell_tables: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 + if (habilidade_tabela1.cc_break_oque [_spellid]) then + habilidade_tabela1.cc_break_oque [_spellid] = habilidade_tabela1.cc_break_oque [_spellid] - amount + else + habilidade_tabela1.cc_break_oque [_spellid] = amount + end + end + + for index, alvo in _ipairs (habilidade.targets._ActorTable) do + local alvo_tabela1 = habilidade_tabela1.targets:PegarCombatente (nil, alvo.nome, nil, true) + alvo_tabela1.total = alvo_tabela1.total - alvo.total + end + + subtrair_keys (habilidade, habilidade_tabela1) + end + + for spellid, amount in _pairs (tabela2.cc_break_oque) do + if (not tabela1.cc_break_oque [spellid]) then + tabela1.cc_break_oque [spellid] = 0 + end + tabela1.cc_break_oque [spellid] = tabela1.cc_break_oque [spellid] - amount end end - return shadow -end - -atributo_misc.__sub = function (tabela1, tabela2) - - if (tabela1.interrupt and tabela2.interrupt) then - tabela1.interrupt = tabela1.interrupt - tabela2.interrupt - - --> reduz o interrompeu_oque - for spellid, amt in _pairs (tabela2.interrompeu_oque) do - tabela1.interrompeu_oque [spellid] = tabela1.interrompeu_oque [spellid] - amt - end - end - - if (tabela1.buff_uptime and tabela2.buff_uptime) then - tabela1.buff_uptime = tabela1.buff_uptime - tabela2.buff_uptime - end - - if (tabela1.debuff_uptime and tabela2.debuff_uptime) then - tabela1.debuff_uptime = tabela1.debuff_uptime - tabela2.debuff_uptime - end - - if (tabela1.cooldowns_defensive and tabela2.cooldowns_defensive) then - tabela1.cooldowns_defensive = tabela1.cooldowns_defensive - tabela2.cooldowns_defensive - end - - if (tabela1.ress and tabela2.ress) then - tabela1.ress = tabela1.ress - tabela2.ress - end - - if (tabela1.dispell and tabela2.dispell) then - tabela1.dispell = tabela1.dispell - tabela2.dispell - -- precisaria diminuir o que foi dispelado - end - - if (tabela1.cc_break and tabela2.cc_break) then - tabela1.cc_break = tabela1.cc_break - tabela2.cc_break - -- precisaria diminuir o que foi quebrado - end - return tabela1 end diff --git a/classes/classe_others_habilidade.lua b/classes/classe_others_habilidade.lua index df7229ea..25113572 100644 --- a/classes/classe_others_habilidade.lua +++ b/classes/classe_others_habilidade.lua @@ -48,10 +48,11 @@ function habilidade_misc:Add (serial, nome, flag, who_nome, token, spellID, spel --alvo:AddQuantidade (1) if (spellID == "BUFF_OR_DEBUFF") then + if (spellName == "COOLDOWN") then self.counter = self.counter + 1 - --alvo + --> alvo local alvo = self.targets._NameIndexTable [nome] if (not alvo) then alvo = self.targets:PegarCombatente (serial, nome, flag, true) @@ -60,11 +61,6 @@ function habilidade_misc:Add (serial, nome, flag, who_nome, token, spellID, spel end alvo.total = alvo.total + 1 - elseif (spellName == "BUFF_UPTIME_IN" or spellName == "DEBUFF_UPTIME_IN") then - self.actived = true - self.activedamt = self.activedamt + 1 - self.actived_at = _detalhes._tempo - elseif (spellName == "BUFF_UPTIME_REFRESH") then if (self.actived_at and self.actived) then self.uptime = self.uptime + _detalhes._tempo - self.actived_at @@ -78,18 +74,6 @@ function habilidade_misc:Add (serial, nome, flag, who_nome, token, spellID, spel return self.shadow:Add (serial, nome, flag, who_nome, token.shadow, spellID, spellName) end - elseif (spellName == "DEBUFF_UPTIME_REFRESH") then - if (self.actived_at and self.actived) then - self.uptime = self.uptime + _detalhes._tempo - self.actived_at - token.debuff_uptime = token.debuff_uptime + _detalhes._tempo - self.actived_at --> token = actor misc object - end - self.actived_at = _detalhes._tempo - self.actived = true - - if (self.shadow) then - return self.shadow:Add (serial, nome, flag, who_nome, token.shadow, spellID, spellName) - end - elseif (spellName == "BUFF_UPTIME_OUT") then if (self.actived_at and self.actived) then self.uptime = self.uptime + _detalhes._tempo - self.actived_at @@ -102,6 +86,34 @@ function habilidade_misc:Add (serial, nome, flag, who_nome, token, spellID, spel return self.shadow:Add (serial, nome, flag, who_nome, token.shadow, spellID, spellName) end + elseif (spellName == "BUFF_UPTIME_IN" or spellName == "DEBUFF_UPTIME_IN") then + self.actived = true + self.activedamt = self.activedamt + 1 + + 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 + + if (self.shadow) then + return self.shadow:Add (serial, nome, flag, who_nome, token.shadow, spellID, spellName) + end + + elseif (spellName == "DEBUFF_UPTIME_REFRESH") then + if (self.actived_at and self.actived) then + self.uptime = self.uptime + _detalhes._tempo - self.actived_at + token.debuff_uptime = token.debuff_uptime + _detalhes._tempo - self.actived_at + end + self.actived_at = _detalhes._tempo + self.actived = true + + if (self.shadow) then + return self.shadow:Add (serial, nome, flag, who_nome, token.shadow, spellID, spellName) + end + elseif (spellName == "DEBUFF_UPTIME_OUT") then if (self.actived_at and self.actived) then self.uptime = self.uptime + _detalhes._tempo - self.actived_at diff --git a/classes/classe_target.lua b/classes/classe_target.lua index 233dc7eb..a602b484 100644 --- a/classes/classe_target.lua +++ b/classes/classe_target.lua @@ -29,13 +29,9 @@ function alvo_da_habilidade:AddQuantidade (amt) end function _detalhes.refresh:r_alvo_da_habilidade (este_alvo, shadow) - --print (shadow) - --print (este_alvo.shadow) _setmetatable (este_alvo, alvo_da_habilidade) este_alvo.__index = alvo_da_habilidade - if (shadow ~= -1) then - este_alvo.shadow = shadow._ActorTable [shadow._NameIndexTable[este_alvo.nome]] - end + este_alvo.shadow = shadow._ActorTable [shadow._NameIndexTable [este_alvo.nome]] end function _detalhes.clear:c_alvo_da_habilidade (este_alvo) diff --git a/classes/container_combatentes.lua b/classes/container_combatentes.lua index 524aef78..ee8f6cc9 100644 --- a/classes/container_combatentes.lua +++ b/classes/container_combatentes.lua @@ -477,23 +477,21 @@ function container_combatentes:remapear() end end -local function ReparaMapa (tabela) - local mapa = {} - for i = 1, #tabela._ActorTable do - mapa [tabela._ActorTable[i].nome] = i - end - tabela._NameIndexTable = mapa -end - function _detalhes.refresh:r_container_combatentes (container, shadow) - _setmetatable (container, _detalhes.container_combatentes) - container.__index = _detalhes.container_combatentes - container.funcao_de_criacao = container_combatentes:FuncaoDeCriacao (container.tipo) - ReparaMapa (container) - - if (shadow ~= -1) then + --> reconstrói meta e indexes + _setmetatable (container, _detalhes.container_combatentes) + container.__index = _detalhes.container_combatentes + container.funcao_de_criacao = container_combatentes:FuncaoDeCriacao (container.tipo) + + --> repara mapa + local mapa = {} + for i = 1, #container._ActorTable do + mapa [container._ActorTable[i].nome] = i + end + container._NameIndexTable = mapa + + --> seta a shadow container.shadow = shadow - end end function _detalhes.clear:c_container_combatentes (container) diff --git a/classes/container_habilidades.lua b/classes/container_habilidades.lua index 35eabe72..7a042922 100644 --- a/classes/container_habilidades.lua +++ b/classes/container_habilidades.lua @@ -112,14 +112,13 @@ function container_habilidades:FuncaoDeCriacao (tipo) end function _detalhes.refresh:r_container_habilidades (container, shadow) - _setmetatable (container, _detalhes.container_habilidades) - container.__index = _detalhes.container_habilidades - local func_criacao = container_habilidades:FuncaoDeCriacao (container.tipo) - container.funcao_de_criacao = func_criacao - - if (shadow ~= -1) then + --> reconstrói meta e indexes + _setmetatable (container, _detalhes.container_habilidades) + container.__index = _detalhes.container_habilidades + local func_criacao = container_habilidades:FuncaoDeCriacao (container.tipo) + container.funcao_de_criacao = func_criacao + --> seta a shadow container.shadow = shadow - end end function _detalhes.clear:c_container_habilidades (container) diff --git a/classes/container_historico.lua b/classes/container_historico.lua index 1fb35bf1..f76009aa 100644 --- a/classes/container_historico.lua +++ b/classes/container_historico.lua @@ -72,8 +72,10 @@ function historico:adicionar (tabela) end self.tabelas[2] = self.tabelas[2] + self.tabelas[3] - self.tabelas[2].is_trash = true + _detalhes.tabela_overall = _detalhes.tabela_overall - self.tabelas[3] + self.tabelas[2].is_trash = true + --> remover _table_remove (self.tabelas, 3) _detalhes:SendEvent ("DETAILS_DATA_SEGMENTREMOVED", nil, nil) @@ -97,15 +99,8 @@ function historico:adicionar (tabela) --> diminuir quantidades no overall _detalhes.tabela_overall = _detalhes.tabela_overall - combat_removed - _detalhes.tabela_overall.start_time = _detalhes.tabela_overall.start_time + (combat_removed.end_time-combat_removed.start_time) - - local amt_mortes = #combat_removed.last_events_tables --> quantas mortes teve nessa luta - if (amt_mortes > 0) then - for i = #_detalhes.tabela_overall.last_events_tables, #_detalhes.tabela_overall.last_events_tables-amt_mortes, -1 do - _table_remove (_detalhes.tabela_overall.last_events_tables, #_detalhes.tabela_overall.last_events_tables) - end - end - + --_detalhes.tabela_overall.start_time = _detalhes.tabela_overall.start_time + (combat_removed.end_time-combat_removed.start_time) + --> verificar novamente a time machine for _, jogador in ipairs (combat_removed [1]._ActorTable) do --> damage if (jogador.timeMachine) then diff --git a/core/control.lua b/core/control.lua index 3ec4254a..7b6b6e24 100644 --- a/core/control.lua +++ b/core/control.lua @@ -331,6 +331,7 @@ end --> verifica memoria + _detalhes:FlagActorsOnCommonFight() --fight_component _detalhes:CheckMemoryAfterCombat() else @@ -651,6 +652,60 @@ end end end + + local fight_component = function (energy_container, misc_container, name) + local on_energy = energy_container._ActorTable [energy_container._NameIndexTable [name]] + if (on_energy) then + on_energy.fight_component = true + end + local on_misc = misc_container._ActorTable [misc_container._NameIndexTable [name]] + if (on_misc) then + on_misc.fight_component = true + end + end + + function _detalhes:FlagActorsOnCommonFight() + + local damage_container = _detalhes.tabela_vigente [1] + local healing_container = _detalhes.tabela_vigente [2] + local energy_container = _detalhes.tabela_vigente [3] + local misc_container = _detalhes.tabela_vigente [4] + + for class_type, container in _ipairs ({damage_container, healing_container}) do + + for _, actor in _ipairs (container._ActorTable) do + if (actor.grupo) then + if (class_type == 1 or class_type == 2) then + for _, target_actor in _ipairs (actor.targets._ActorTable) do + local target_object = container._ActorTable [container._NameIndexTable [target_actor.nome]] + if (target_object) then + target_object.fight_component = true + fight_component (energy_container, misc_container, target_actor.nome) + end + end + if (class_type == 1) then + for damager_actor, _ in _pairs (actor.damage_from) do + local target_object = container._ActorTable [container._NameIndexTable [damager_actor]] + if (target_object) then + target_object.fight_component = true + fight_component (energy_container, misc_container, damager_actor) + end + end + elseif (class_type == 2) then + for healer_actor, _ in _pairs (actor.healing_from) do + local target_object = container._ActorTable [container._NameIndexTable [healer_actor]] + if (target_object) then + target_object.fight_component = true + fight_component (energy_container, misc_container, healer_actor) + end + end + end + end + end + end + + end + end function _detalhes:AtualizarJanela (instancia, _segmento) if (_segmento) then --> apenas atualizar janelas que estejam mostrando o segmento solicitado diff --git a/core/meta.lua b/core/meta.lua index d94b274f..91697afd 100644 --- a/core/meta.lua +++ b/core/meta.lua @@ -691,7 +691,7 @@ t = _actor.last_event + _detalhes.intervalo_coleta end - if (not _actor.grupo and not _actor.boss and not _actor.boss_fight_component and t < _tempo) then + if (not _actor.grupo and not _actor.boss and not _actor.fight_component and not _actor.boss_fight_component and t < _tempo) then local owner = _actor.owner if (owner) then local owner_actor = _combate (tipo, owner.nome) diff --git a/core/parser.lua b/core/parser.lua index 18f38a7e..5bcb0b0c 100644 --- a/core/parser.lua +++ b/core/parser.lua @@ -366,6 +366,7 @@ este_alvo = este_jogador.targets._ActorTable [este_alvo] end este_alvo.total = este_alvo.total + amount + este_alvo.shadow.total = este_alvo.shadow.total + amount --> actor spells table local spell = este_jogador.spell_tables._ActorTable [spellid] @@ -633,6 +634,7 @@ --> target amount este_alvo.total = este_alvo.total + cura_efetiva + este_alvo.shadow.total = este_alvo.shadow.total + cura_efetiva end if (overhealing > 0) then @@ -726,6 +728,10 @@ elseif (tipo == "DEBUFF") then + --if (who_name == "Ditador") then + -- print (spellname, alvo_name, "IN") + --end + if (_in_combat) then ------------------------------------------------------------------------------------------------ @@ -865,6 +871,10 @@ elseif (tipo == "DEBUFF") then + --if (who_name == "Ditador") then + -- print (spellname, alvo_name, "REFRESH") + --end + if (_in_combat) then ------------------------------------------------------------------------------------------------ --> buff uptime @@ -982,6 +992,10 @@ --> recording debuffs applied by player elseif (tipo == "DEBUFF") then + --if (who_name == "Ditador") then + -- print (spellname, alvo_name, "OUT") + --end + if (_in_combat) then ------------------------------------------------------------------------------------------------ --> buff uptime @@ -1066,7 +1080,7 @@ este_jogador.debuff_uptime_targets.shadow = shadow.debuff_uptime_targets este_jogador.debuff_uptime_spell_tables.shadow = shadow.debuff_uptime_spell_tables end - + ------------------------------------------------------------------------------------------------ --> add amount @@ -1368,7 +1382,8 @@ if (not spell) then spell = este_jogador.cooldowns_defensive_spell_tables:PegaHabilidade (spellid, true, token) end - return spell:Add (alvo_serial, alvo_name, alvo_flags, who_name, token, "BUFF", "COOLDOWN") + + return spell:Add (alvo_serial, alvo_name, alvo_flags, who_name, token, "BUFF_OR_DEBUFF", "COOLDOWN") end @@ -1561,6 +1576,7 @@ if (not spell) then spell = este_jogador.spellcast_spell_tables:PegaHabilidade (spellid, true, token) end + return spell:Add (alvo_serial, alvo_name, alvo_flags, who_name, token) end diff --git a/core/plugins_statusbar.lua b/core/plugins_statusbar.lua index 130e16bb..e9f71898 100644 --- a/core/plugins_statusbar.lua +++ b/core/plugins_statusbar.lua @@ -360,7 +360,7 @@ do -- handle event "COMBAT_PLAYER_ENTER" function PDps:PlayerEnterCombat() for index, child in _ipairs (PDps.childs) do - if (child.enabled and child.instance:GetSegment() == 0) then + if (child.enabled and (child.instance:GetSegment() == 0 or child.instance:GetSegment() == -1)) then child.tick = _detalhes:ScheduleRepeatingTimer ("PluginDpsUpdate", 1, child) end end @@ -413,6 +413,8 @@ do local dps = _math_floor (total / combatTime) + --print (total, combatTime, dps) + local textStyle = child.options.textStyle if (textStyle == 1) then child.text:SetText (_detalhes:ToK (dps)) diff --git a/core/timemachine.lua b/core/timemachine.lua index f3372754..122cc955 100644 --- a/core/timemachine.lua +++ b/core/timemachine.lua @@ -37,9 +37,9 @@ for tipo, tabela in _pairs (self.tabelas) do for nome, jogador in _ipairs (tabela) do if (jogador) then - --print (jogador) --> jogador é a referência da tabela classe_damage - local ultima_acao = jogador:UltimaAcao()+3 + local ultima_acao = jogador.last_event+3 + if (ultima_acao > _tempo) then --> okey o jogador esta dando dps if (jogador.on_hold) then --> o dps estava pausado, retornar a ativa jogador:HoldOn (false) @@ -102,7 +102,7 @@ if (not timeMachine.ligada) then return end - + local esta_tabela = timeMachine.tabelas [self.tipo] _table_insert (esta_tabela, self) self.timeMachine = #esta_tabela @@ -152,26 +152,25 @@ -- inicia o tempo no shadow do objeto -------------------------------------------------------------------------------- - -- eu nao sei se a shadow esta iniciando agora sou esta apenas reabrindo - -- tbm nao sei se a shadow esta reabrindo normalmente ou se esta reabrindo devido a combate menor de 4 segundos - - -- verificar se a shadow esta com TEMPO FINALIZADO - -- SE ESTIVER significa que a shadow esta sendo reaberta if (shadow.end_time) then - -- reabrir o tempo da shadow - -- eu tenho o tempo da abertura do combate atual, e o inicio e fim do tempo da shadow - -- tempo do inicio da shadow = tempo de abertura ATUAL menos tempo de combate da shadow local subs = shadow.end_time - shadow.start_time shadow.start_time = tempo - subs shadow.end_time = nil -- o tempo foi aberto retirando o end_time + --if (self.nome == "Ditador") then print ("shadow ja itnha end_time") end + else -- pela minha logica se nao tiver end_time significa que precisa apenas gravar o tempo de inicio -- a shadow foi recém criada e esta abrindo o tempo pela primeira vez + if (shadow.start_time == 0) then --> ja esta em um combate shadow.start_time = tempo + --if (self.nome == "Ditador") then print ("shadom sem end_time com start_time == 0") end + else + --if (self.nome == "Ditador") then print ("shadom sem end_time") end end + end end @@ -194,6 +193,7 @@ --> diz se o dps deste jogador esta em pausa function _detalhes:HoldOn (pausa) + --if (self.nome == "Ditador") then print ("colocando em hold on") end if (pausa == nil) then return self.on_hold --retorna se o dps esta aberto ou fechado para este jogador elseif (pausa) then --> true diff --git a/locales/Details-enUS.lua b/locales/Details-enUS.lua index 575f7539..3891d579 100644 --- a/locales/Details-enUS.lua +++ b/locales/Details-enUS.lua @@ -4,7 +4,7 @@ if not Loc then return end -------------------------------------------------------------------------------------------------------------------------------------------- -- \n\n|cFFFFFF00-|r - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v1.6.0|r\n\n|cFFFFFF00-|r Added debuff uptime at misc attribute.\n\n|cFFFFFF00-|r Disabled attributes now have a darkness effect over sword menu.\n\n|cFFFFFF00-|r Fixed a issue were sometimes you need to /reload before change a talent.\n\n|cFFFFFF00v1.5.3|r\n\n|cFFFFFF00-|r Fixed a issue with report data during combat lockdown.\n\n|cFFFFFF00-|r Improved pet owner recognition and added a ignore list if couldn't find his owner.\n\n|cFFFFFF00-|r Added an option to display only frags on enemy players.\n\n|cFFFFFF00-|r Added class colors for frags.\n\n|cFFFFFF00v1.5.2|r\n\n|cFFFFFF00-|r Fixed a issue were turning off buff uptime was disabling healing done too.\n\n|cFFFFFF00-|r Avoidance statistics will not be recorded for pets, ungrouped players and monsters.\n\n|cFFFFFF00-|r Fixed a issue were sometimes buff uptime was taking too long to save data on logout.\n\n|cFFFFFF00v1.5.1|r\n\n|cFFFFFF00-|r Fixed a issue with report data were sometimes wasn't working.\n\n|cFFFFFF00v1.5.0|r\n\n|cFFFFFF00-|r Buff Uptime was been implemented over Miscellaneous attribute.\n\n|cFFFFFF00-|r Death Logs now also display cooldowns and last cooldown used.\n\n|cFFFFFF00-|r Added this window showing the latest changes.\n\n|cFFFFFF00-|r Fixed the issue were sometimes the instance stops to update when clicking on the attribute name over sword menu.\n\n|cFFFFFF00-|r Disabling Healing now shutdown the absorbs too, disabling auras doesn't interrupt absorbs any more.\n\n|cFFFFFF00-|r Friendly Fire now only track players which is inside a group.\n\n|cFFFFFF00-|r Fixed a issue were pet damage on target isn't added to owner target.\n\n|cFFFFFF00-|r Fixed a bug were refreshing a cooldown isn't counting.\n\n|cFFFFFF00-|r Added absorbs for shammy and monk 2P tier 16.\n\n|cFFFFFF00-|r Added slash command 'worldboss' and 'updates'.\n\n" + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v1.6.1|r\n\n|cFFFFFF00-|r Fixed:\n- a issue with debuff uptime.\n- overall data dps and hps for overall data on micro display.\n- many bugs involving sword and book menus.\n- garbage collector erasing actors with interactions with your group members.\n\n|cFFFFFF00-|r overall data now always use the combat data for measure dps and hps.\n\n|cFFFFFF00v1.6.0|r\n\n|cFFFFFF00-|r Added debuff uptime at misc attribute.\n\n|cFFFFFF00-|r Disabled attributes now have a darkness effect over sword menu.\n\n|cFFFFFF00-|r Fixed a issue were sometimes you need to /reload before change a talent.\n\n|cFFFFFF00v1.5.3|r\n\n|cFFFFFF00-|r Fixed a issue with report data during combat lockdown.\n\n|cFFFFFF00-|r Improved pet owner recognition and added a ignore list if couldn't find his owner.\n\n|cFFFFFF00-|r Added an option to display only frags on enemy players.\n\n|cFFFFFF00-|r Added class colors for frags.\n\n|cFFFFFF00v1.5.2|r\n\n|cFFFFFF00-|r Fixed a issue were turning off buff uptime was disabling healing done too.\n\n|cFFFFFF00-|r Avoidance statistics will not be recorded for pets, ungrouped players and monsters.\n\n|cFFFFFF00-|r Fixed a issue were sometimes buff uptime was taking too long to save data on logout.\n\n|cFFFFFF00v1.5.1|r\n\n|cFFFFFF00-|r Fixed a issue with report data were sometimes wasn't working.\n\n|cFFFFFF00v1.5.0|r\n\n|cFFFFFF00-|r Buff Uptime was been implemented over Miscellaneous attribute.\n\n|cFFFFFF00-|r Death Logs now also display cooldowns and last cooldown used.\n\n|cFFFFFF00-|r Added this window showing the latest changes.\n\n|cFFFFFF00-|r Fixed the issue were sometimes the instance stops to update when clicking on the attribute name over sword menu.\n\n|cFFFFFF00-|r Disabling Healing now shutdown the absorbs too, disabling auras doesn't interrupt absorbs any more.\n\n|cFFFFFF00-|r Friendly Fire now only track players which is inside a group.\n\n|cFFFFFF00-|r Fixed a issue were pet damage on target isn't added to owner target.\n\n|cFFFFFF00-|r Fixed a bug were refreshing a cooldown isn't counting.\n\n|cFFFFFF00-|r Added absorbs for shammy and monk 2P tier 16.\n\n|cFFFFFF00-|r Added slash command 'worldboss' and 'updates'.\n\n" Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails:|r " --> color and details name diff --git a/locales/Details-ptBR.lua b/locales/Details-ptBR.lua index 22c7ad7f..f609888b 100644 --- a/locales/Details-ptBR.lua +++ b/locales/Details-ptBR.lua @@ -3,7 +3,7 @@ if not Loc then return end -------------------------------------------------------------------------------------------------------------------------------------------- - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v1.6.0|r\n\n|cFFFFFF00-|r Adicionado tempo de debuff no atributo miscelanea.\n\n|cFFFFFF00-|r Atributos desativados agora ficam escurecidos no menu da espada.\n\n|cFFFFFF00-|r Corrigido um problema aonde algumas vezes era necessario dar /reload para trocar um talento.\n\n|cFFFFFF00v1.5.3|r\n\n|cFFFFFF00-|r Corrigido problema ao reportar durante o combate.\n\n|cFFFFFF00-|r Melhorado a reconhecimento dos donos de ajudantes.\n\n|cFFFFFF00-|r Adicionada uma opcao para mostrar apenas frags em cima de jogadores inimigos.\n\n|cFFFFFF00-|r Adicionado cor e icone aos frags.\n\n|cFFFFFF00v1.5.2|r\n\n|cFFFFFF00-|r Corrigido problema onde desativando o tempo dos buffs estava desativando tambem a cura feita.\n\n|cFFFFFF00-|r Estatisticas de Avoidance nao seram mais capturadas para pessoas foram do grupo, monstros ou ajudantes.\n\n|cFFFFFF00-|r Corrigido problema onde as vezes estava demorando muito para salvar o tempo dos buffs ao sair do jogo.\n\n|cFFFFFF00v1.5.1|r\n\n|cFFFFFF00-|r Corrigido problema ao reportar o Dps onde as vezes nao mostrava nenhum jogador.\n\n|cFFFFFF00v1.5.0|r\n\n|cFFFFFF00-|r Buff Uptime foi implementado no atributo miscelanea.\n\n|cFFFFFF00-|r Cooldowns usados agora aparecem nos registros da morte.\n\n|cFFFFFF00-|r Implementado esta janela mostrando as atualizacoes.\n\n|cFFFFFF00-|r Corrigido problema onde algumas vezes clicando no nome do atributo fazia a instancia parar de atualizar.\n\n|cFFFFFF00-|r Desativando a cura agora para as absorcoes tambem. Desligando as Auras nao interrompe as absorcoes. \n\n|cFFFFFF00-|r Fogo Amigo agora conta apenas jogadores dentro do grupo.\n\n|cFFFFFF00-|r Corrigido problema onde o dano feito por um ajudando nao estava contando no alvo do dono.\n\n|cFFFFFF00-|r Corrigido problema onde a atualizacao de um cooldown nao estava sendo contada.\n\n|cFFFFFF00-|r Adicionada as magias de absorcao para 2P tier 16.\n\n|cFFFFFF00-|r Adicionado os comandos de barra 'worldboss' e 'updates'.\n\n|cFFFFFF00-|r Corrigido problema ao reportar onde algumas vezes nao estava funcionando." + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v1.6.1|r\n\n|cFFFFFF00-|r Corrigido:\n- problema com o tempo de debuffs.\n- dps dos dados gerais e o dps no micro display .\n- varios bugs envolvendo o menu da espada e do livro.\n- o coletor de lixo nao ira mais apagar jogadores com vinculo a membros do grupo.\n\n|cFFFFFF00-|r dados gerais agora sempre ira usar o tempo do combate para medir dps e hps.\n\n|cFFFFFF00v1.6.0|r\n\n|cFFFFFF00-|r Adicionado tempo de debuff no atributo miscelanea.\n\n|cFFFFFF00-|r Atributos desativados agora ficam escurecidos no menu da espada.\n\n|cFFFFFF00-|r Corrigido um problema aonde algumas vezes era necessario dar /reload para trocar um talento.\n\n|cFFFFFF00v1.5.3|r\n\n|cFFFFFF00-|r Corrigido problema ao reportar durante o combate.\n\n|cFFFFFF00-|r Melhorado a reconhecimento dos donos de ajudantes.\n\n|cFFFFFF00-|r Adicionada uma opcao para mostrar apenas frags em cima de jogadores inimigos.\n\n|cFFFFFF00-|r Adicionado cor e icone aos frags.\n\n|cFFFFFF00v1.5.2|r\n\n|cFFFFFF00-|r Corrigido problema onde desativando o tempo dos buffs estava desativando tambem a cura feita.\n\n|cFFFFFF00-|r Estatisticas de Avoidance nao seram mais capturadas para pessoas foram do grupo, monstros ou ajudantes.\n\n|cFFFFFF00-|r Corrigido problema onde as vezes estava demorando muito para salvar o tempo dos buffs ao sair do jogo.\n\n|cFFFFFF00v1.5.1|r\n\n|cFFFFFF00-|r Corrigido problema ao reportar o Dps onde as vezes nao mostrava nenhum jogador.\n\n|cFFFFFF00v1.5.0|r\n\n|cFFFFFF00-|r Buff Uptime foi implementado no atributo miscelanea.\n\n|cFFFFFF00-|r Cooldowns usados agora aparecem nos registros da morte.\n\n|cFFFFFF00-|r Implementado esta janela mostrando as atualizacoes.\n\n|cFFFFFF00-|r Corrigido problema onde algumas vezes clicando no nome do atributo fazia a instancia parar de atualizar.\n\n|cFFFFFF00-|r Desativando a cura agora para as absorcoes tambem. Desligando as Auras nao interrompe as absorcoes. \n\n|cFFFFFF00-|r Fogo Amigo agora conta apenas jogadores dentro do grupo.\n\n|cFFFFFF00-|r Corrigido problema onde o dano feito por um ajudando nao estava contando no alvo do dono.\n\n|cFFFFFF00-|r Corrigido problema onde a atualizacao de um cooldown nao estava sendo contada.\n\n|cFFFFFF00-|r Adicionada as magias de absorcao para 2P tier 16.\n\n|cFFFFFF00-|r Adicionado os comandos de barra 'worldboss' e 'updates'.\n\n|cFFFFFF00-|r Corrigido problema ao reportar onde algumas vezes nao estava funcionando." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetalhes:|r " --> color and details name diff --git a/plugins/Details_RaidInfo-SiegeOfOrgrimmar/SiegeOfOrgrimmar.lua b/plugins/Details_RaidInfo-SiegeOfOrgrimmar/SiegeOfOrgrimmar.lua index 7a8149b8..cfa3bbc5 100644 --- a/plugins/Details_RaidInfo-SiegeOfOrgrimmar/SiegeOfOrgrimmar.lua +++ b/plugins/Details_RaidInfo-SiegeOfOrgrimmar/SiegeOfOrgrimmar.lua @@ -93,9 +93,6 @@ local siege_of_orgrimmar = { --Sha of Pride [72791] = true, --lingering corruption - --[] = true, -- - --[] = true, -- - --[] = true, -- --Galakras --[72367] = true, --dragonmaw tidal shaman @@ -126,6 +123,53 @@ local siege_of_orgrimmar = { [71773] = true, -- krokron warshaman [71770] = true, -- krokron iron blade --[71715] = true, -- orgrimmar faithful -- also is used in nazgrim encounter + + --> malkorok + [72728] = true, --korkron blood axe + [72784] = true, --korkron gunner + [72903] = true, --korkron siegemaster + [72744] = true, --korkron skullspliter + [72768] = true, --korkron warwolf + [72770] = true, --korkron darkfarseer + + --> spoils of pandaria + [73904] = true, --korkron iron sentinel + [73742] = true, --thresher turret + [73767] = true, --korkron shrederer + [73775] = true, --war master kragg + [73152] = true, --storeroom guard + + --> blackfuse + [73539] = true, --korkron den mother + [73541] = true, --korkron wolf puppy + [73194] = true, --korkron iron scorpion + -- + [72981] = true, --aggron + [72964] = true, --gorodan + [72986] = true, --shanna sparkfizz + [73091] = true, --blackfuse sellsword + [73095] = true, --blackfuse enginer + + --> thok + --73195 --krokon jailer + [73188] = true, --captive cave bat + [73184] = true, --starved yeti + [73185] = true, --enraged mushan beast + [73223] = true, --pterrodax + + --> paragons + [72954] = true, --korthik guard + [72929] = true, --srathik amber master + [73012] = true, --klaxxi skirmisher + [72927] = true, --kovok + + --> garrosh + [73414] = true, --korkron reaper + [73452] = true, --harbinger of y'shaarj + [73415] = true, --ichor of y'shaarj + + + }, encounters = { @@ -570,6 +614,7 @@ local siege_of_orgrimmar = { [144918] = {0x40, 0x80}, --> Cutter Laser [144498] = {0x8, 0x200}, --> Explosive Tar [144327] = {}, --> Ricochet + [144919] = {}, --> Tar Explosion }, continuo = { @@ -604,7 +649,8 @@ local siege_of_orgrimmar = { 144485, --> Shock Pulse 144154, --> Demolisher Cannons 144918, --> Cutter Laser - 144498 --> Explosive Tar + 144498, --> Explosive Tar + 144919, } } },