Added hunter bloodlust detection (Primal Rage)

This commit is contained in:
Tercio Jose
2022-11-23 19:20:09 -03:00
parent de7f984425
commit 10136d78f4
5 changed files with 248 additions and 307 deletions
@@ -89,6 +89,7 @@ LIB_OPEN_RAID_BLOODLUST = {
[80353] = true, --timewarp (mage)
[90355] = true, --ancient hysteria (hunter)
[309658] = true, --current exp drums (letherwork)
[264667] = true, --primal rage (hunter)
--need to get the 30% haste buff from evokers
}
+191 -191
View File
@@ -2,7 +2,7 @@
local _detalhes = _G._detalhes
local _tempo = time()
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--local pointers
local _
@@ -14,9 +14,9 @@
local _bit_band = bit.band --lua local
local wipe = table.wipe --lua local
local _time = time --lua local
local _InCombatLockdown = InCombatLockdown --wow api local
local atributo_damage = _detalhes.atributo_damage --details local
local atributo_heal = _detalhes.atributo_heal --details local
local atributo_energy = _detalhes.atributo_energy --details local
@@ -48,32 +48,32 @@
end
tabela._NameIndexTable = mapa
end
--reaplica as tabelas no overall
function _detalhes:RestauraOverallMetaTables()
local is_in_instance = select(1, IsInInstance())
local combate = _detalhes.tabela_overall
combate.overall_refreshed = true
combate.hasSaved = true
combate.__call = _detalhes.call_combate
_detalhes.refresh:r_combate (combate)
_detalhes.refresh:r_container_combatentes (combate [class_type_dano])
_detalhes.refresh:r_container_combatentes (combate [class_type_cura])
_detalhes.refresh:r_container_combatentes (combate [class_type_e_energy])
_detalhes.refresh:r_container_combatentes (combate [class_type_misc])
_detalhes.refresh:r_container_combatentes (combate [5]) --ghost container
local todos_atributos = {combate [class_type_dano]._ActorTable, combate [class_type_cura]._ActorTable, combate [class_type_e_energy]._ActorTable, combate [class_type_misc]._ActorTable}
for class_type, atributo in ipairs(todos_atributos) do
for _, esta_classe in ipairs(atributo) do
for _, esta_classe in ipairs(atributo) do
local nome = esta_classe.nome
if (is_in_instance and _detalhes.remove_realm_from_name) then
@@ -83,24 +83,24 @@
else
esta_classe.displayName = nome
end
if (class_type == class_type_dano) then
_detalhes.refresh:r_atributo_damage (esta_classe)
elseif (class_type == class_type_cura) then
_detalhes.refresh:r_atributo_heal (esta_classe)
elseif (class_type == class_type_e_energy) then
_detalhes.refresh:r_atributo_energy (esta_classe)
elseif (class_type == class_type_misc) then
_detalhes.refresh:r_atributo_misc (esta_classe)
end
end
end
for class_type, atributo in ipairs(todos_atributos) do
for _, esta_classe in ipairs(atributo) do
if (esta_classe.ownerName) then --nome do owner
@@ -108,14 +108,14 @@
end
end
end
end
--reaplica indexes e metatables
function _detalhes:RestauraMetaTables()
_detalhes.refresh:r_atributo_custom()
--container de pets e histrico
_detalhes.refresh:r_container_pets (_detalhes.tabela_pets)
_detalhes.refresh:r_historico (_detalhes.tabela_historico)
@@ -126,42 +126,42 @@
local overall_cura = combate_overall [class_type_cura] --heal atalho
local overall_energy = combate_overall [class_type_e_energy] --energy atalho
local overall_misc = combate_overall [class_type_misc] --misc atalho
local tabelas_do_historico = _detalhes.tabela_historico.tabelas --atalho
--recupera meta function
for _, combat_table in ipairs(tabelas_do_historico) do
combat_table.__call = _detalhes.call_combate
end
for i = #tabelas_do_historico-1, 1, -1 do
local combat = tabelas_do_historico [i]
combat.previous_combat = tabelas_do_historico [i+1]
end
--tempo padrao do overall
local overall_saved = combate_overall.overall_refreshed
if (not overall_saved) then
combate_overall.start_time = GetTime()
combate_overall.end_time = GetTime()
end
local is_in_instance = select(1, IsInInstance())
--inicia a recuperao das tabelas e montagem do overall
if (#tabelas_do_historico > 0) then
for index, combate in ipairs(tabelas_do_historico) do
combate.hasSaved = true
--recupera a meta e indexes da tabela do combate
_detalhes.refresh:r_combate (combate, combate_overall)
--aumenta o tempo do combate do overall, seta as datas e os combates armazenados
if (not overall_saved and combate.overall_added) then
if (not overall_saved and combate.overall_added) then
if (combate.end_time and combate.start_time) then
combate_overall.start_time = combate_overall.start_time - (combate.end_time - combate.start_time)
end
@@ -178,30 +178,30 @@
_detalhes.tabela_overall.overall_enemy_name = "-- x -- x --"
end
end
combate_overall.segments_added =combate_overall.segments_added or {}
local date_start, date_end = combate:GetDate()
tinsert(combate_overall.segments_added, {name = combate:GetCombatName(true), elapsed = combate:GetCombatTime(), clock = date_start})
end
--recupera a meta e indexes dos 4 container
_detalhes.refresh:r_container_combatentes (combate [class_type_dano], overall_dano)
_detalhes.refresh:r_container_combatentes (combate [class_type_cura], overall_cura)
_detalhes.refresh:r_container_combatentes (combate [class_type_e_energy], overall_energy)
_detalhes.refresh:r_container_combatentes (combate [class_type_misc], overall_misc)
--ghost container
if (combate[5]) then
_detalhes.refresh:r_container_combatentes (combate [5], combate_overall [5])
end
--tabela com os 4 tabelas de jogadores
local todos_atributos = {combate [class_type_dano]._ActorTable, combate [class_type_cura]._ActorTable, combate [class_type_e_energy]._ActorTable, combate [class_type_misc]._ActorTable}
for class_type, atributo in ipairs(todos_atributos) do
for _, esta_classe in ipairs(atributo) do
local nome = esta_classe.nome
if (is_in_instance and _detalhes.remove_realm_from_name) then
@@ -211,7 +211,7 @@
else
esta_classe.displayName = nome
end
local shadow
if (class_type == class_type_dano) then
@@ -227,14 +227,14 @@
else
shadow = atributo_heal:r_onlyrefresh_shadow (esta_classe)
end
elseif (class_type == class_type_e_energy) then
if (combate.overall_added and not overall_saved) then
shadow = atributo_energy:r_connect_shadow (esta_classe)
else
shadow = atributo_energy:r_onlyrefresh_shadow (esta_classe)
end
elseif (class_type == class_type_misc) then
if (combate.overall_added and not overall_saved) then
shadow = atributo_misc:r_connect_shadow (esta_classe)
@@ -245,7 +245,7 @@
end
end
--reconstri a tabela dos pets
for class_type, atributo in ipairs(todos_atributos) do
for _, esta_classe in ipairs(atributo) do
@@ -254,28 +254,28 @@
end
end
end
end
--fim
end
--restaura last_events_table
local primeiro_combate = tabelas_do_historico [1] --primeiro combate
if (primeiro_combate) then
primeiro_combate [1]:ActorCallFunction (atributo_damage.r_last_events_table)
primeiro_combate [2]:ActorCallFunction (atributo_heal.r_last_events_table)
end
local segundo_combate = tabelas_do_historico [2] --segundo combate
if (segundo_combate) then
segundo_combate [1]:ActorCallFunction (atributo_damage.r_last_events_table)
segundo_combate [2]:ActorCallFunction (atributo_heal.r_last_events_table)
end
end
function _detalhes:DoInstanceCleanup()
--normal instances
for _, esta_instancia in ipairs(_detalhes.tabela_instancias) do
@@ -293,7 +293,7 @@
end
--erase all widgets frames
esta_instancia.scroll = nil
esta_instancia.baseframe = nil
esta_instancia.bgframe = nil
@@ -306,29 +306,29 @@
esta_instancia.grupada_pos = nil
esta_instancia.agrupado = nil
esta_instancia._version = nil
esta_instancia.h_baixo = nil
esta_instancia.h_esquerda = nil
esta_instancia.h_direita = nil
esta_instancia.h_cima = nil
esta_instancia.break_snap_button = nil
esta_instancia.alert = nil
esta_instancia.StatusBar = nil
esta_instancia.consolidateFrame = nil
esta_instancia.consolidateButtonTexture = nil
esta_instancia.consolidateButton = nil
esta_instancia.lastIcon = nil
esta_instancia.firstIcon = nil
esta_instancia.menu_attribute_string = nil
esta_instancia.wait_for_plugin_created = nil
esta_instancia.waiting_raid_plugin = nil
esta_instancia.waiting_pid = nil
end
--unused instances
for _, esta_instancia in ipairs(_detalhes.unused_instances) do
@@ -345,7 +345,7 @@
}
end
--erase all widgets frames
--erase all widgets frames
esta_instancia.scroll = nil
esta_instancia.baseframe = nil
esta_instancia.bgframe = nil
@@ -358,23 +358,23 @@
esta_instancia.grupada_pos = nil
esta_instancia.agrupado = nil
esta_instancia._version = nil
esta_instancia.h_baixo = nil
esta_instancia.h_esquerda = nil
esta_instancia.h_direita = nil
esta_instancia.h_cima = nil
esta_instancia.break_snap_button = nil
esta_instancia.alert = nil
esta_instancia.StatusBar = nil
esta_instancia.consolidateFrame = nil
esta_instancia.consolidateButtonTexture = nil
esta_instancia.consolidateButton = nil
esta_instancia.lastIcon = nil
esta_instancia.firstIcon = nil
esta_instancia.menu_attribute_string = nil
esta_instancia.wait_for_plugin_created = nil
esta_instancia.waiting_raid_plugin = nil
esta_instancia.waiting_pid = nil
@@ -388,20 +388,20 @@
tinsert(combats, _detalhes.tabela_overall)
overall_added = true
end
for index, combat in ipairs(combats) do
for index, container in ipairs(combat) do
for index, container in ipairs(combat) do
for index, esta_classe in ipairs(container._ActorTable) do
esta_classe.owner = nil
end
end
end
if (overall_added) then
tremove(combats, #combats)
end
end
function _detalhes:DoClassesCleanup()
local combats = _detalhes.tabela_historico.tabelas or {}
local overall_added
@@ -409,14 +409,14 @@
tinsert(combats, _detalhes.tabela_overall)
overall_added = true
end
for index, combat in ipairs(combats) do
for class_type, container in ipairs(combat) do
for class_type, container in ipairs(combat) do
for index, esta_classe in ipairs(container._ActorTable) do
esta_classe.displayName = nil
esta_classe.minha_barra = nil
if (class_type == class_type_dano) then
_detalhes.clear:c_atributo_damage (esta_classe)
elseif (class_type == class_type_cura) then
@@ -426,16 +426,16 @@
elseif (class_type == class_type_misc) then
_detalhes.clear:c_atributo_misc (esta_classe)
end
end
end
end
if (overall_added) then
tremove(combats, #combats)
end
end
function _detalhes:DoContainerCleanup()
local combats = _detalhes.tabela_historico.tabelas or {}
local overall_added
@@ -443,19 +443,19 @@
tinsert(combats, _detalhes.tabela_overall)
overall_added = true
end
for index, combat in ipairs(combats) do
_detalhes.clear:c_combate (combat)
for index, container in ipairs(combat) do
_detalhes.clear:c_container_combatentes (container)
end
end
if (overall_added) then
tremove(combats, #combats)
end
end
function _detalhes:DoContainerIndexCleanup()
local combats = _detalhes.tabela_historico.tabelas or {}
local overall_added
@@ -463,32 +463,32 @@
tinsert(combats, _detalhes.tabela_overall)
overall_added = true
end
for index, combat in ipairs(combats) do
for index, container in ipairs(combat) do
_detalhes.clear:c_container_combatentes_index (container)
end
end
if (overall_added) then
tremove(combats, #combats)
end
end
--limpa indexes, metatables e shadows
function _detalhes:PrepareTablesForSave()
_detalhes.clear_ungrouped = true
--clear instances
_detalhes:DoInstanceCleanup()
_detalhes:DoClassesCleanup() --aumentou 1 combat
_detalhes:DoContainerCleanup() --aumentou 1 combat
--clear combats
local tabelas_de_combate = {}
local historico_tabelas = _detalhes.tabela_historico.tabelas or {}
--remove os segmentos de trash
for i = #historico_tabelas, 1, -1 do
local combate = historico_tabelas [i]
@@ -496,7 +496,7 @@
table.remove (historico_tabelas, i)
end
end
--remove os segmentos > que o limite permitido para salvar
if (_detalhes.segments_amount_to_save and _detalhes.segments_amount_to_save < _detalhes.segments_amount) then
for i = _detalhes.segments_amount, _detalhes.segments_amount_to_save+1, -1 do
@@ -505,20 +505,20 @@
end
end
end
--tabela do combate atual
local tabela_atual = _detalhes.tabela_vigente or _detalhes.combate:NovaTabela (_, _detalhes.tabela_overall)
--limpa a tabela overall
if (_detalhes.overall_clear_logout) then
_detalhes.tabela_overall = nil
_detalhes_database.tabela_overall = nil
else
local _combate = _detalhes.tabela_overall
_combate.previous_combat = nil
local todos_atributos = {_combate [class_type_dano] or {}, _combate [class_type_cura] or {}, _combate [class_type_e_energy] or {}, _combate [class_type_misc] or {}}
for class_type, _tabela in ipairs(todos_atributos) do
local conteudo = _tabela._ActorTable
@@ -530,17 +530,17 @@
while (_iter.data) do --search key: ~deletar ~apagar
local can_erase = true
if (_iter.data.grupo or _iter.data.boss or _iter.data.boss_fight_component or _iter.data.pvp_component or _iter.data.fight_component) then
can_erase = false
else
local owner = _iter.data.owner
if (owner) then
if (owner) then
local owner_actor = _combate [class_type]._NameIndexTable [owner.nome]
if (owner_actor) then
if (owner_actor) then
local owner_actor = _combate [class_type]._ActorTable [owner_actor]
if (owner_actor) then
if (owner_actor) then
if (owner.grupo or owner.boss or owner.boss_fight_component or owner.fight_component) then
can_erase = false
end
@@ -548,8 +548,8 @@
end
end
end
if (can_erase) then
if (can_erase) then
_table_remove(conteudo, _iter.index)
_iter.cleaned = _iter.cleaned + 1
_iter.data = conteudo [_iter.index]
@@ -558,7 +558,7 @@
_iter.data = conteudo [_iter.index]
end
end
if (_iter.cleaned > 0) then
ReconstroiMapa (_tabela)
end
@@ -566,38 +566,38 @@
end
end
end
for _, _tabela in ipairs(historico_tabelas) do
tabelas_de_combate [#tabelas_de_combate+1] = _tabela
end
for tabela_index, _combate in ipairs(tabelas_de_combate) do
--limpa a tabela do grafico
if (_detalhes.clear_graphic) then
if (_detalhes.clear_graphic) then
_combate.TimeData = {}
end
--limpa a referencia do ultimo combate
_combate.previous_combat = nil
local container_dano = _combate [class_type_dano] or {}
local container_cura = _combate [class_type_cura] or {}
local container_e_energy = _combate [class_type_e_energy] or {}
local container_misc = _combate [class_type_misc] or {}
local todos_atributos = {container_dano, container_cura, container_e_energy, container_misc}
local IsBossEncounter = _combate.is_boss
if (IsBossEncounter) then
if (_combate.pvp) then
IsBossEncounter = false
end
end
if (not _combate.is_mythic_dungeon_segment) then
for class_type, _tabela in ipairs(todos_atributos) do
local conteudo = _tabela._ActorTable
--Limpa tabelas que no estejam em grupo
@@ -606,21 +606,21 @@
if (_detalhes.clear_ungrouped) then
--no deleta dummies e actors de fora do grupo
--if (not _detalhes.clear_ungrouped) then
local _iter = {index = 1, data = conteudo[1], cleaned = 0} --._ActorTable[1] para pegar o primeiro index
while (_iter.data) do --search key: ~deletar ~apagar
local can_erase = true
if (_iter.data.grupo or _iter.data.boss or _iter.data.boss_fight_component or IsBossEncounter or _iter.data.pvp_component or _iter.data.fight_component) then
can_erase = false
else
local owner = _iter.data.owner
if (owner) then
if (owner) then
local owner_actor = _combate [class_type]._NameIndexTable [owner.nome]
if (owner_actor) then
if (owner_actor) then
local owner_actor = _combate [class_type]._ActorTable [owner_actor]
if (owner_actor) then
if (owner_actor) then
if (owner.grupo or owner.boss or owner.boss_fight_component or owner.fight_component) then
can_erase = false
end
@@ -628,63 +628,63 @@
end
end
end
if (can_erase) then
if (can_erase) then
if (not _iter.data.owner) then --pet
local myself = _iter.data
if (myself.tipo == class_type_dano or myself.tipo == class_type_cura) then
_combate.totals [myself.tipo] = _combate.totals [myself.tipo] - myself.total
if (myself.tipo == class_type_dano or myself.tipo == class_type_cura and _combate.totals [myself.tipo] and myself.total) then
_combate.totals [myself.tipo] = _combate.totals [myself.tipo] - (myself.total or 0)
if (myself.grupo) then
_combate.totals_grupo [myself.tipo] = _combate.totals_grupo [myself.tipo] - myself.total
_combate.totals_grupo [myself.tipo] = _combate.totals_grupo [myself.tipo] - (myself.total or 0)
end
elseif (myself.tipo == class_type_e_energy) then
_combate.totals [myself.tipo] [myself.powertype] = _combate.totals [myself.tipo] [myself.powertype] - myself.total
elseif (myself.tipo == class_type_e_energy and _combate.totals [myself.tipo] and _combate.totals [myself.tipo] [myself.powertype] and myself.total) then
_combate.totals [myself.tipo] [myself.powertype] = _combate.totals [myself.tipo] [myself.powertype] - (myself.total or 0)
if (myself.grupo) then
_combate.totals_grupo [myself.tipo] [myself.powertype] = _combate.totals_grupo [myself.tipo] [myself.powertype] - myself.total
_combate.totals_grupo [myself.tipo] [myself.powertype] = _combate.totals_grupo [myself.tipo] [myself.powertype] - (myself.total or 0)
end
elseif (myself.tipo == class_type_misc) then
if (myself.cc_break) then
_combate.totals [myself.tipo] ["cc_break"] = _combate.totals [myself.tipo] ["cc_break"] - myself.cc_break
if (myself.cc_break and _combate.totals[myself.tipo] and _combate.totals [myself.tipo] and _combate.totals [myself.tipo] ["cc_break"]) then
_combate.totals [myself.tipo] ["cc_break"] = _combate.totals [myself.tipo] ["cc_break"] - (myself.cc_break or 0)
if (myself.grupo) then
_combate.totals_grupo [myself.tipo] ["cc_break"] = _combate.totals_grupo [myself.tipo] ["cc_break"] - myself.cc_break
_combate.totals_grupo [myself.tipo] ["cc_break"] = _combate.totals_grupo [myself.tipo] ["cc_break"] - (myself.cc_break or 0)
end
end
if (myself.ress) then
_combate.totals [myself.tipo] ["ress"] = _combate.totals [myself.tipo] ["ress"] - myself.ress
if (myself.ress and _combate.totals [myself.tipo] and _combate.totals [myself.tipo] ["ress"]) then
_combate.totals [myself.tipo] ["ress"] = _combate.totals [myself.tipo] ["ress"] - (myself.ress or 0)
if (myself.grupo) then
_combate.totals_grupo [myself.tipo] ["ress"] = _combate.totals_grupo [myself.tipo] ["ress"] - myself.ress
_combate.totals_grupo [myself.tipo] ["ress"] = _combate.totals_grupo [myself.tipo] ["ress"] - (myself.ress or 0)
end
end
--no precisa diminuir o total dos buffs e debuffs
if (myself.cooldowns_defensive) then
_combate.totals [myself.tipo] ["cooldowns_defensive"] = _combate.totals [myself.tipo] ["cooldowns_defensive"] - myself.cooldowns_defensive
if (myself.cooldowns_defensive and _combate.totals [myself.tipo] and _combate.totals [myself.tipo] ["cooldowns_defensive"]) then
_combate.totals [myself.tipo] ["cooldowns_defensive"] = _combate.totals [myself.tipo] ["cooldowns_defensive"] - (myself.cooldowns_defensive or 0)
if (myself.grupo) then
_combate.totals_grupo [myself.tipo] ["cooldowns_defensive"] = _combate.totals_grupo [myself.tipo] ["cooldowns_defensive"] - myself.cooldowns_defensive
_combate.totals_grupo [myself.tipo] ["cooldowns_defensive"] = _combate.totals_grupo [myself.tipo] ["cooldowns_defensive"] - (myself.cooldowns_defensive or 0)
end
end
if (myself.interrupt) then
_combate.totals [myself.tipo] ["interrupt"] = _combate.totals [myself.tipo] ["interrupt"] - myself.interrupt
if (myself.interrupt and _combate.totals [myself.tipo] and _combate.totals [myself.tipo] ["interrupt"]) then
_combate.totals [myself.tipo] ["interrupt"] = _combate.totals [myself.tipo] ["interrupt"] - (myself.interrupt or 0)
if (myself.grupo) then
_combate.totals_grupo [myself.tipo] ["interrupt"] = _combate.totals_grupo [myself.tipo] ["interrupt"] - myself.interrupt
_combate.totals_grupo [myself.tipo] ["interrupt"] = _combate.totals_grupo [myself.tipo] ["interrupt"] - (myself.interrupt or 0)
end
end
if (myself.dispell) then
_combate.totals [myself.tipo] ["dispell"] = _combate.totals [myself.tipo] ["dispell"] - myself.dispell
if (myself.dispell and _combate.totals [myself.tipo] and _combate.totals [myself.tipo] ["dispell"]) then
_combate.totals [myself.tipo] ["dispell"] = _combate.totals [myself.tipo] ["dispell"] - (myself.dispell or 0)
if (myself.grupo) then
_combate.totals_grupo [myself.tipo] ["dispell"] = _combate.totals_grupo [myself.tipo] ["dispell"] - myself.dispell
_combate.totals_grupo [myself.tipo] ["dispell"] = _combate.totals_grupo [myself.tipo] ["dispell"] - (myself.dispell or 0)
end
end
if (myself.dead) then
_combate.totals [myself.tipo] ["dead"] = _combate.totals [myself.tipo] ["dead"] - myself.dead
if (myself.dead and _combate.totals [myself.tipo] and _combate.totals [myself.tipo] ["dead"]) then
_combate.totals [myself.tipo] ["dead"] = _combate.totals [myself.tipo] ["dead"] - (myself.dead or 0)
if (myself.grupo) then
_combate.totals_grupo [myself.tipo] ["dead"] = _combate.totals_grupo [myself.tipo] ["dead"] - myself.dead
_combate.totals_grupo [myself.tipo] ["dead"] = _combate.totals_grupo [myself.tipo] ["dead"] - (myself.dead or 0)
end
end
end
end
end
_table_remove(conteudo, _iter.index)
@@ -695,43 +695,43 @@
_iter.data = conteudo [_iter.index]
end
end
if (_iter.cleaned > 0) then
ReconstroiMapa (_tabela)
end
end
end
end
end --end is mythic dungeon segment
end
--panic mode
if (_detalhes.segments_panic_mode and _detalhes.can_panic_mode) then
if (_detalhes.tabela_vigente.is_boss) then
_detalhes.tabela_historico = _detalhes.historico:NovoHistorico()
end
end
--clear all segments on logoff
if (_detalhes.data_cleanup_logout) then
_detalhes.tabela_historico = _detalhes.historico:NovoHistorico()
_detalhes.tabela_overall = nil
_detalhes_database.tabela_overall = nil
end
--clear customs
_detalhes.clear:c_atributo_custom()
--clear owners
_detalhes:DoOwnerCleanup()
--cleaer container indexes
_detalhes:DoContainerIndexCleanup()
end
function _detalhes:reset_window (instancia)
if (instancia.segmento == -1) then
instancia.showing[instancia.atributo].need_refresh = true
@@ -752,7 +752,7 @@
end
end
end
function _detalhes:CheckMemoryPeriodically()
if (_detalhes.next_memory_check <= time() and not _InCombatLockdown() and not _detalhes.in_combat and not UnitAffectingCombat("player")) then
_detalhes.next_memory_check = time() + _detalhes.intervalo_memoria - 3
@@ -772,15 +772,15 @@
if (not forcar) then
if (_detalhes.ultima_coleta + _detalhes.intervalo_coleta > _detalhes._tempo + 1) then
return
elseif (_detalhes.in_combat or _InCombatLockdown() or _detalhes:IsInInstance()) then
_detalhes:ScheduleTimer("IniciarColetaDeLixo", 5)
elseif (_detalhes.in_combat or _InCombatLockdown() or _detalhes:IsInInstance()) then
_detalhes:ScheduleTimer("IniciarColetaDeLixo", 5)
return
end
else
if (type(forcar) ~= "boolean") then
if (forcar == 1) then
if (_detalhes.in_combat or _InCombatLockdown()) then
_detalhes:ScheduleTimer("IniciarColetaDeLixo", 5, forcar)
_detalhes:ScheduleTimer("IniciarColetaDeLixo", 5, forcar)
return
end
end
@@ -794,23 +794,23 @@
_detalhes:Msg("(debug) collecting garbage.")
end
end
local memory = GetAddOnMemoryUsage ("Details")
--reseta o cache do parser
_detalhes:ClearParserCache()
--limpa barras que no esto sendo usadas nas instncias.
for index, instancia in ipairs(_detalhes.tabela_instancias) do
for index, instancia in ipairs(_detalhes.tabela_instancias) do
if (instancia.barras and instancia.barras [1]) then
for i, barra in ipairs(instancia.barras) do
for i, barra in ipairs(instancia.barras) do
if (not barra:IsShown()) then
barra.minha_tabela = nil
end
end
end
end
--faz a coleta nos 4 atributos
local damage = atributo_damage:ColetarLixo (lastevent)
local heal = atributo_heal:ColetarLixo (lastevent)
@@ -818,28 +818,28 @@
local misc = atributo_misc:ColetarLixo (lastevent)
local limpados = damage + heal + energy + misc
--refresh nas janelas
if (limpados > 0) then
_detalhes:InstanciaCallFunction(_detalhes.reset_window)
end
_detalhes:ManutencaoTimeMachine()
--print cache states
--if (_detalhes.debug) then
-- _detalhes:Msg("(debug) removed: damage "..damage.." heal "..heal.." energy "..energy.." misc "..misc)
--end
--elimina pets antigos
_detalhes:LimparPets()
if (not _detalhes.in_combat) then
_detalhes:ClearCCPetsBlackList()
end
--reseta cache de specs
_detalhes:ResetSpecCache()
--wipa container de escudos
wipe(_detalhes.escudos)
@@ -851,38 +851,38 @@
--local memory2 = GetAddOnMemoryUsage ("Details")
--_detalhes:Msg("(debug) memory before: "..memory.." memory after: "..memory2)
end
end
--combates Normais
local function FazColeta (_combate, tipo, intervalo_overwrite)
local conteudo = _combate [tipo]._ActorTable
local _iter = {index = 1, data = conteudo[1], cleaned = 0}
local _tempo = _time()
--local links_removed = 0
--do not collect things in a mythic+ dungeon segment
if (_combate.is_mythic_dungeon_trash or _combate.is_mythic_dungeon_run_id or _combate.is_mythic_dungeon_segment) then
return 0
end
while (_iter.data) do
local _actor = _iter.data
local can_garbage = false
local t
if (intervalo_overwrite) then
if (intervalo_overwrite) then
t = _actor.last_event + intervalo_overwrite
else
t = _actor.last_event + _detalhes.intervalo_coleta
end
if (t < _tempo and not _actor.grupo and not _actor.boss and not _actor.fight_component and not _actor.boss_fight_component) then
if (t < _tempo and not _actor.grupo and not _actor.boss and not _actor.fight_component and not _actor.boss_fight_component) then
local owner = _actor.owner
if (owner) then
if (owner) then
local owner_actor = _combate (tipo, owner.nome)
if (not owner.grupo and not owner.boss and not owner.boss_fight_component) then
can_garbage = true
@@ -896,31 +896,31 @@
if (not _actor.owner) then --pet
_actor:subtract_total (_combate)
end
_iter.cleaned = _iter.cleaned+1
if (_actor.tipo == 1 or _actor.tipo == 2) then
_actor:DesregistrarNaTimeMachine()
end
end
_table_remove(conteudo, _iter.index)
_iter.data = conteudo [_iter.index]
else
_iter.index = _iter.index + 1
_iter.data = conteudo [_iter.index]
end
end
--if (_detalhes.debug) then
-- _detalhes:Msg("- garbage collect:", tipo, "actors removed:",_iter.cleaned)
--end
if (_iter.cleaned > 0) then
ReconstroiMapa (_combate [tipo])
_combate [tipo].need_refresh = true
end
return _iter.cleaned
end
@@ -928,7 +928,7 @@
function _detalhes:ColetarLixo (tipo, lastevent)
--print("fazendo coleta...")
local _tempo = _time()
local limpados = 0
@@ -940,26 +940,26 @@
end
end
tabelas_de_combate [#tabelas_de_combate+1] = _detalhes.tabela_vigente
--faz a coleta em todos os combates para este atributo
for _, _combate in ipairs(tabelas_de_combate) do
for _, _combate in ipairs(tabelas_de_combate) do
limpados = limpados + FazColeta (_combate, tipo, lastevent)
end
--limpa a tabela overall para o atributo atual (limpa para os 4, um de cada vez atravs do ipairs)
local _overall_combat = _detalhes.tabela_overall
local _overall_combat = _detalhes.tabela_overall
local conteudo = _overall_combat [tipo]._ActorTable
local _iter = {index = 1, data = conteudo[1], cleaned = 0} --._ActorTable[1] para pegar o primeiro index
while (_iter.data) do
local _actor = _iter.data
local can_garbage = false
if (not _actor.grupo and not _actor.owner and not _actor.boss_fight_component and not _actor.fight_component) then
can_garbage = true
end
if (can_garbage) then --no h referncias a este objeto
if (not _actor.owner) then --pet
@@ -968,7 +968,7 @@
--apaga a referncia deste jogador na tabela overall
_iter.cleaned = _iter.cleaned+1
_table_remove(conteudo, _iter.index)
_iter.data = conteudo [_iter.index]
@@ -985,7 +985,7 @@
ReconstroiMapa (_overall_combat [tipo])
limpados = limpados + _iter.cleaned
end
if (limpados > 0) then
_detalhes:InstanciaCallFunction(_detalhes.ScheduleUpdate)
_detalhes:RefreshMainWindow(-1)
+1 -1
View File
@@ -2649,7 +2649,7 @@
------------------------------------------------------------------------------------------------
--buff uptime
if (LIB_OPEN_RAID_BLOODLUST and LIB_OPEN_RAID_BLOODLUST[spellid]) then
if (LIB_OPEN_RAID_BLOODLUST and LIB_OPEN_RAID_BLOODLUST[spellid]) then --~bloodlust
if (_detalhes.playername == alvo_name) then
_current_combat.bloodlust = _current_combat.bloodlust or {}
_current_combat.bloodlust[#_current_combat.bloodlust+1] = _current_combat:GetCombatTime()
+55 -55
View File
@@ -1,4 +1,4 @@
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
local _detalhes = _G._detalhes
@@ -14,14 +14,14 @@ function _detalhes:ApplyBasicKeys()
--we are not in debug mode
self.debug = false
--connected to realm channel
self.is_connected = false
--who is
self.playername = UnitName ("player")
self.playerserial = UnitGUID("player")
--player faction and enemy faction
self.faction = UnitFactionGroup ("player")
if (self.faction == PLAYER_FACTION_GROUP[0]) then --player is horde
@@ -31,26 +31,26 @@ function _detalhes:ApplyBasicKeys()
self.faction_against = PLAYER_FACTION_GROUP[0] --horde
self.faction_id = 1
end
self.zone_type = nil
_detalhes.temp_table1 = {}
--combat
self.encounter = {}
self.in_combat = false
self.combat_id = 0
--instances (windows)
self.solo = self.solo or nil
self.raid = self.raid or nil
self.solo = self.solo or nil
self.raid = self.raid or nil
self.opened_windows = 0
self.default_texture = [[Interface\AddOns\Details\images\bar4]]
self.default_texture_name = "Details D'ictum"
self.class_coords_version = 1
self.class_colors_version = 1
self.school_colors = {
[1] = {1.00, 1.00, 0.00},
[2] = {1.00, 0.90, 0.50},
@@ -61,9 +61,9 @@ function _detalhes:ApplyBasicKeys()
[64] = {1.00, 0.50, 1.00},
["unknown"] = {0.5, 0.75, 0.75, 1}
}
--load default profile keys
for key, value in pairs(_detalhes.default_profile) do
for key, value in pairs(_detalhes.default_profile) do
if (type(value) == "table") then
local ctable = Details.CopyTable(value)
self [key] = ctable
@@ -71,7 +71,7 @@ function _detalhes:ApplyBasicKeys()
self [key] = value
end
end
--end
return true
@@ -84,7 +84,7 @@ end
function _detalhes:LoadGlobalAndCharacterData()
--check and build the default container for character database
--it exists?
if (not _detalhes_database) then
_detalhes_database = Details.CopyTable(_detalhes.default_player_data)
@@ -92,7 +92,7 @@ function _detalhes:LoadGlobalAndCharacterData()
--load saved values
for key, value in pairs(_detalhes.default_player_data) do
--check if key exists, e.g. a new key was added
if (_detalhes_database [key] == nil) then
if (type(value) == "table") then
@@ -100,7 +100,7 @@ function _detalhes:LoadGlobalAndCharacterData()
else
_detalhes_database [key] = value
end
elseif (type(_detalhes_database [key]) == "table") then
if (type(_detalhes.default_player_data [key]) == "string") then
print("|cFFFFAA00Details!|r error 0x8538, report on discord", key, _detalhes_database [key], _detalhes.default_player_data [key])
@@ -115,23 +115,23 @@ function _detalhes:LoadGlobalAndCharacterData()
end
end
end
--copy the key from saved table to details object
if (type(value) == "table") then
_detalhes [key] = Details.CopyTable(_detalhes_database [key])
else
_detalhes [key] = _detalhes_database [key]
end
end
--check and build the default container for account database
if (not _detalhes_global) then
_detalhes_global = Details.CopyTable(_detalhes.default_global_data)
end
for key, value in pairs(_detalhes.default_global_data) do
for key, value in pairs(_detalhes.default_global_data) do
--check if key exists
if (_detalhes_global [key] == nil) then
if (type(value) == "table") then
@@ -139,7 +139,7 @@ function _detalhes:LoadGlobalAndCharacterData()
else
_detalhes_global [key] = value
end
elseif (type(_detalhes_global [key]) == "table") then
if (type(_detalhes.default_global_data [key]) == "string") then
@@ -164,7 +164,7 @@ function _detalhes:LoadGlobalAndCharacterData()
end
end
end
--copy the key from saved table to details object
if (type(value) == "table") then
_detalhes [key] = Details.CopyTable(_detalhes_global [key])
@@ -173,7 +173,7 @@ function _detalhes:LoadGlobalAndCharacterData()
end
end
--end
return true
end
@@ -198,14 +198,14 @@ function _detalhes:LoadCombatTables()
_detalhes.tabela_historico = _detalhes_database.tabela_historico or _detalhes.historico:NovoHistorico()
-- overall
_detalhes.tabela_overall = _detalhes.combate:NovaTabela()
-- pets
_detalhes.tabela_pets = _detalhes.container_pets:NovoContainer()
if (_detalhes_database.tabela_pets) then
_detalhes.tabela_pets.pets = Details.CopyTable(_detalhes_database.tabela_pets)
end
_detalhes:UpdateContainerCombatentes()
--if the core revision was incremented, reset all combat data
if (_detalhes_database.last_realversion and _detalhes_database.last_realversion < _detalhes.realversion) then
--details was been hard upgraded
@@ -214,7 +214,7 @@ function _detalhes:LoadCombatTables()
_detalhes.tabela_vigente = _detalhes.combate:NovaTabela (_, _detalhes.tabela_overall)
_detalhes.tabela_pets = _detalhes.container_pets:NovoContainer()
_detalhes:UpdateContainerCombatentes()
_detalhes_database.tabela_historico = nil
_detalhes_database.tabela_overall = nil
else
@@ -239,38 +239,38 @@ function _detalhes:LoadCombatTables()
else
_detalhes.tabela_overall = _detalhes.combate:NovaTabela()
end
--re-build all indexes and metatables
_detalhes:RestauraMetaTables()
--get last combat table
local historico_UM = _detalhes.tabela_historico.tabelas[1]
if (historico_UM) then
_detalhes.tabela_vigente = historico_UM --significa que elas eram a mesma tabela, ento aqui elas se tornam a mesma tabela
else
_detalhes.tabela_vigente = _detalhes.combate:NovaTabela (_, _detalhes.tabela_overall)
end
--need refresh for all containers
for _, container in ipairs(_detalhes.tabela_overall) do
for _, container in ipairs(_detalhes.tabela_overall) do
container.need_refresh = true
end
for _, container in ipairs(_detalhes.tabela_vigente) do
for _, container in ipairs(_detalhes.tabela_vigente) do
container.need_refresh = true
end
--erase combat data from the database
_detalhes_database.tabela_vigente = nil
_detalhes_database.tabela_historico = nil
_detalhes_database.tabela_pets = nil
-- double check for pet container
if (not _detalhes.tabela_pets or not _detalhes.tabela_pets.pets) then
_detalhes.tabela_pets = _detalhes.container_pets:NovoContainer()
end
_detalhes:UpdateContainerCombatentes()
end
end
@@ -284,13 +284,13 @@ function _detalhes:LoadConfig()
_detalhes.plugin_database = _detalhes_database.plugin_database or {}
--startup
--set the nicktag cache host
_detalhes:NickTagSetCache (_detalhes_database.nick_tag_cache)
--count data
_detalhes:CountDataOnLoad()
--solo e raid plugin
if (_detalhes_database.SoloTablesSaved) then
if (_detalhes_database.SoloTablesSaved.Mode) then
@@ -300,11 +300,11 @@ function _detalhes:LoadConfig()
_detalhes.SoloTables.Mode = 1
end
end
--switch tables
_detalhes.switch.slots = _detalhes_global.switchSaved.slots
_detalhes.switch.table = _detalhes_global.switchSaved.table
if (_detalhes.switch.table) then
for i = 1, #_detalhes.switch.table do
if (not _detalhes.switch.table [i]) then
@@ -312,31 +312,31 @@ function _detalhes:LoadConfig()
end
end
end
--last boss
_detalhes.last_encounter = _detalhes_database.last_encounter
--buffs
_detalhes.savedbuffs = _detalhes_database.savedbuffs
_detalhes.Buffs:BuildTables()
--initialize parser
_detalhes.capture_current = {}
for captureType, captureValue in pairs(_detalhes.capture_real) do
for captureType, captureValue in pairs(_detalhes.capture_real) do
_detalhes.capture_current [captureType] = captureValue
end
--row animations
_detalhes:SetUseAnimations()
--initialize spell cache
_detalhes:ClearSpellCache()
_detalhes:ClearSpellCache()
--version first run
if (not _detalhes_database.last_version or _detalhes_database.last_version ~= _detalhes.userversion) then
_detalhes.is_version_first_run = true
end
--profile
local unitname = UnitName ("player")
@@ -438,25 +438,25 @@ end
--count logons, tutorials, etc
function _detalhes:CountDataOnLoad()
--basic
if (not _detalhes_global.got_first_run) then
_detalhes.is_first_run = true
end
--tutorial
self.tutorial = self.tutorial or {}
self.tutorial.logons = self.tutorial.logons or 0
self.tutorial.logons = self.tutorial.logons + 1
self.tutorial.unlock_button = self.tutorial.unlock_button or 0
self.tutorial.version_announce = self.tutorial.version_announce or 0
self.tutorial.main_help_button = self.tutorial.main_help_button or 0
self.tutorial.alert_frames = self.tutorial.alert_frames or {false, false, false, false, false, false}
self.tutorial.main_help_button = self.tutorial.main_help_button + 1
self.character_data = self.character_data or {logons = 0}
self.character_data.logons = self.character_data.logons + 1
-60
View File
@@ -388,66 +388,6 @@ function SlashCmdList.DETAILS (msg, editbox)
instance1.baseframe:SetPoint("bottomleft", RightChatDataPanel, "topleft", 1, 1)
instance2.baseframe:SetPoint("bottomright", RightChatToggleButton, "topright", -1, 1)
elseif (msg == "addcombat") then
local combat = _detalhes.combate:NovaTabela (true, _detalhes.tabela_overall, 1)
local self = combat[1]:PegarCombatente (UnitGUID("player"), UnitName ("player"), 1297, true)
self.total = 100000
self.total_without_pet = 100000
if (not _detalhes.um___) then
_detalhes.um___ = 0
_detalhes.next_um = 3
end
local cima = true
_detalhes.um___ = _detalhes.um___ + 1
if (_detalhes.um___ == _detalhes.next_um) then
_detalhes.next_um = _detalhes.next_um + 3
cima = false
end
if (cima) then
local frostbolt = self.spells:PegaHabilidade (116, true, "SPELL_DAMAGE")
local frostfirebolt = self.spells:PegaHabilidade (44614, true, "SPELL_DAMAGE")
local icelance = self.spells:PegaHabilidade (30455, true, "SPELL_DAMAGE")
self.spells._ActorTable [116].total = 50000
self.spells._ActorTable [44614].total = 25000
self.spells._ActorTable [30455].total = 25000
else
local frostbolt = self.spells:PegaHabilidade (84721, true, "SPELL_DAMAGE")
local frostfirebolt = self.spells:PegaHabilidade (113092, true, "SPELL_DAMAGE")
local icelance = self.spells:PegaHabilidade (122, true, "SPELL_DAMAGE")
self.spells._ActorTable [84721].total = 50000
self.spells._ActorTable [113092].total = 25000
self.spells._ActorTable [122].total = 25000
end
combat.start_time = GetTime()-30
combat.end_time = GetTime()
combat.totals_grupo [1] = 100000
combat.totals [1] = 100000
--combat.instance_type = "raid"
--combat.is_trash = true
_detalhes.tabela_vigente = combat
_detalhes.tabela_historico:adicionar (combat)
_detalhes:InstanciaCallFunction(Details.FadeHandler.Fader, "in", nil, "barras")
_detalhes:InstanciaCallFunction(_detalhes.AtualizaSegmentos) -- atualiza o instancia.showing para as novas tabelas criadas
_detalhes:InstanciaCallFunction(_detalhes.AtualizaSoloMode_AfertReset) -- verifica se precisa zerar as tabela da janela solo mode
_detalhes:InstanciaCallFunction(_detalhes.ResetaGump) --_detalhes:ResetaGump ("de todas as instancias")
_detalhes:RefreshMainWindow(-1, true) --atualiza todas as instancias
elseif (msg == "pets") then
local f = _detalhes:CreateListPanel()