- some fixes for last_events_table, shadow object no more have last_events.
- implemented cache for group mode. - class constructor now create new object at once, avoiding table rehashs. - fixed dps issue with cloud capture. - added a pet cache for parser. - minor parser speed up on parser removing metatables index call. - implemented new pet sync were at the end of combat, details will ask for unknow owners. - few new wallpapers. - new API: _detalhes:InstanceAlert (msg, icon, time, clickfunc). -
This commit is contained in:
@@ -58,9 +58,6 @@ function combate:NovaTabela (iniciada, _tabela_overall, combatId, ...)
|
||||
|
||||
_setmetatable (esta_tabela, combate)
|
||||
|
||||
--> debug
|
||||
esta_tabela.meu_tipo = "classe_combate"
|
||||
|
||||
--> try discover if is a pvp combat
|
||||
local who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags = ...
|
||||
if (who_serial) then --> aqui irá identificar o boss ou o oponente
|
||||
@@ -170,14 +167,16 @@ end
|
||||
function combate:TravarTempos()
|
||||
--é necessário travar o tempo em todos os atributos do combate.
|
||||
for index, container in _ipairs (self) do -- aqui ele lista os tipos de atributo listado na lista acima
|
||||
if (index ~= 3 and index ~= 4) then --> 3 é e_energy, não possui tempo // 4 é misc tbm não possui tempo
|
||||
if (index < 3) then --> 3 é e_energy, não possui tempo // 4 é misc tbm não possui tempo
|
||||
for _, jogador in _ipairs (container._ActorTable) do
|
||||
if (jogador:Iniciar()) then -- retorna se ele esta com o dps ativo
|
||||
jogador:TerminarTempo()
|
||||
jogador:Iniciar (false) --trava o dps do jogador
|
||||
jogador.last_events_table = {} --> elimina a tabela dos danos --não é mais usado desta forma
|
||||
--jogador.last_events_table = _detalhes:CreateActorLastEventTable()
|
||||
end
|
||||
end
|
||||
else
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
+91
-69
@@ -61,55 +61,49 @@ local keyName
|
||||
|
||||
function atributo_damage:NovaTabela (serial, nome, link)
|
||||
|
||||
local _new_damageActor = {}
|
||||
--> constructor
|
||||
local _new_damageActor = {
|
||||
|
||||
--> dps do objeto inicia sempre desligado
|
||||
tipo = class_type, --> atributo 1 = dano
|
||||
|
||||
total = 0,
|
||||
total_without_pet = 0,
|
||||
custom = 0,
|
||||
|
||||
damage_taken = 0, --> total de dano que este jogador levou
|
||||
damage_from = {}, --> armazena os nomes que deram dano neste jogador
|
||||
|
||||
avoidance = {["DODGE"] = 0, ["PARRY"] = 0, ["HITS"] = 0}, --> avoidance
|
||||
|
||||
dps_started = false,
|
||||
last_event = 0,
|
||||
on_hold = false,
|
||||
delay = 0,
|
||||
last_value = nil, --> ultimo valor que este jogador teve, salvo quando a barra dele é atualizada
|
||||
last_dps = 0,
|
||||
|
||||
end_time = nil,
|
||||
start_time = 0,
|
||||
|
||||
pets = {}, --> armazena os nomes dos pets já com a tag do dono: pet name <owner nome>
|
||||
|
||||
friendlyfire_total = 0,
|
||||
friendlyfire = container_combatentes:NovoContainer (container_friendlyfire),
|
||||
|
||||
--container armazenará os seriais dos alvos que o player aplicou dano
|
||||
targets = container_combatentes:NovoContainer (container_damage_target),
|
||||
|
||||
--container armazenará os IDs das habilidades usadas por este jogador
|
||||
spell_tables = container_habilidades:NovoContainer (container_damage)
|
||||
}
|
||||
|
||||
_setmetatable (_new_damageActor, atributo_damage)
|
||||
|
||||
_new_damageActor.quem_sou = "classe_damage" --> DEBUG deleta-me
|
||||
|
||||
--> grava o tempo que a tabela foi criada para o garbage collector interno
|
||||
_new_damageActor.CriadaEm = time()
|
||||
|
||||
--> dps do objeto inicia sempre desligado
|
||||
_new_damageActor.dps_started = false
|
||||
|
||||
_new_damageActor.tipo = class_type --> atributo 1 = dano
|
||||
|
||||
_new_damageActor.total = 0
|
||||
_new_damageActor.custom = 0
|
||||
_new_damageActor.total_without_pet = 0
|
||||
|
||||
_new_damageActor.damage_taken = 0 --> total de dano que este jogador levou
|
||||
_new_damageActor.damage_from = {} --> armazena os nomes que deram dano neste jogador
|
||||
|
||||
_new_damageActor.last_events_table = _detalhes:CreateActorLastEventTable()
|
||||
_new_damageActor.last_events_table.original = true
|
||||
|
||||
_new_damageActor.avoidance = {["DODGE"] = 0, ["PARRY"] = 0, ["HITS"] = 0} --> avoidance
|
||||
|
||||
_new_damageActor.last_event = 0
|
||||
_new_damageActor.on_hold = false
|
||||
_new_damageActor.delay = 0
|
||||
|
||||
_new_damageActor.last_value = nil --> ultimo valor que este jogador teve, salvo quando a barra dele é atualizada
|
||||
|
||||
_new_damageActor.end_time = nil
|
||||
_new_damageActor.start_time = 0
|
||||
|
||||
_new_damageActor.last_dps = 0
|
||||
|
||||
_new_damageActor.pets = {}
|
||||
|
||||
--_new_damageActor.friendlyfire = {} --> será criado no primeiro fogo amigo dado
|
||||
_new_damageActor.friendlyfire_total = 0
|
||||
_new_damageActor.friendlyfire = container_combatentes:NovoContainer (container_friendlyfire)
|
||||
|
||||
--container armazenará os seriais dos alvos que o player aplicou dano
|
||||
_new_damageActor.targets = container_combatentes:NovoContainer (container_damage_target)
|
||||
|
||||
--container armazenará os IDs das habilidades usadas por este jogador
|
||||
_new_damageActor.spell_tables = container_habilidades:NovoContainer (container_damage)
|
||||
|
||||
if (link) then
|
||||
if (link) then --> se não for a shadow
|
||||
_new_damageActor.last_events_table = _detalhes:CreateActorLastEventTable()
|
||||
_new_damageActor.last_events_table.original = true
|
||||
|
||||
_new_damageActor.targets.shadow = link.targets
|
||||
_new_damageActor.spell_tables.shadow = link.spell_tables
|
||||
_new_damageActor.friendlyfire.shadow = link.friendlyfire
|
||||
@@ -162,14 +156,14 @@ end
|
||||
end
|
||||
end
|
||||
|
||||
--[[ exported]] function _detalhes:IsPlayer()
|
||||
if (self.flags) then
|
||||
if (_bit_band (self.flag, 0x00000001) ~= 0) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
--[[ exported]] function _detalhes:IsPlayer()
|
||||
if (self.flags) then
|
||||
if (_bit_band (self.flag, 0x00000001) ~= 0) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, exportar)
|
||||
|
||||
@@ -186,6 +180,8 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex
|
||||
--> top actor #1
|
||||
instancia.top = 0
|
||||
|
||||
local using_cache = false
|
||||
|
||||
local sub_atributo = instancia.sub_atributo --> o que esta sendo mostrado nesta instância
|
||||
local conteudo = showing._ActorTable --> pega a lista de jogadores -- get actors table from container
|
||||
local amount = #conteudo
|
||||
@@ -245,7 +241,29 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex
|
||||
|
||||
--> organiza as tabelas
|
||||
|
||||
_table_sort (conteudo, _detalhes.SortKeyGroup, keyName)
|
||||
if (_detalhes.in_combat) then
|
||||
using_cache = true
|
||||
end
|
||||
|
||||
if (using_cache) then
|
||||
conteudo = _detalhes.cache_damage_group
|
||||
|
||||
_table_sort (conteudo, _detalhes.SortKeySimple)
|
||||
|
||||
if (conteudo[1][keyName] < 1) then
|
||||
amount = 0
|
||||
else
|
||||
instancia.top = conteudo[1][keyName]
|
||||
amount = #conteudo
|
||||
end
|
||||
|
||||
for i = 1, amount do
|
||||
total = total + conteudo[i][keyName]
|
||||
end
|
||||
else
|
||||
_table_sort (conteudo, _detalhes.SortKeyGroup)
|
||||
end
|
||||
--
|
||||
|
||||
--[[
|
||||
_table_sort (conteudo, function (a, b)
|
||||
@@ -261,25 +279,29 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex
|
||||
end)
|
||||
--]]
|
||||
|
||||
for index, player in _ipairs (conteudo) do
|
||||
if (_bit_band (player.flag, DFLAG_player_group) >= 0x101) then --> é um player e esta em grupo
|
||||
if (player[keyName] < 1) then --> dano menor que 1, interromper o loop
|
||||
amount = index - 1
|
||||
if (not using_cache) then
|
||||
for index, player in _ipairs (conteudo) do
|
||||
if (_bit_band (player.flag, DFLAG_player_group) >= 0x101) then --> é um player e esta em grupo
|
||||
if (player[keyName] < 1) then --> dano menor que 1, interromper o loop
|
||||
amount = index - 1
|
||||
break
|
||||
elseif (index == 1) then --> esse IF aqui, precisa mesmo ser aqui? não daria pra pega-lo com uma chave [1] nad grupo == true?
|
||||
instancia.top = conteudo[1][keyName]
|
||||
end
|
||||
|
||||
total = total + player[keyName]
|
||||
else
|
||||
amount = index-1
|
||||
break
|
||||
elseif (index == 1) then --> esse IF aqui, precisa mesmo ser aqui? não daria pra pega-lo com uma chave [1] nad grupo == true?
|
||||
instancia.top = conteudo[1][keyName]
|
||||
end
|
||||
|
||||
total = total + player[keyName]
|
||||
else
|
||||
amount = index-1
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--> refaz o mapa do container
|
||||
showing:remapear()
|
||||
if (not using_cache) then
|
||||
showing:remapear()
|
||||
end
|
||||
|
||||
if (exportar) then
|
||||
return total, keyName, instancia.top
|
||||
@@ -424,7 +446,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) then
|
||||
if ((_detalhes.time_type == 2 and self.grupo) or not _detalhes:CaptureGet ("damage")) then
|
||||
dps = damage_total / combat_time
|
||||
self.last_dps = dps
|
||||
else
|
||||
|
||||
@@ -30,73 +30,66 @@ local _recording_ability_with_buffs = false
|
||||
|
||||
--id, nome, type, miss, dano, cura, overkill, school, resisted, blocked, absorbed, critico, glacing, crushing
|
||||
function habilidade_dano:NovaTabela (id, link, token) --aqui eu não sei que parâmetros passar
|
||||
local esta_tabela = {}
|
||||
_setmetatable (esta_tabela, habilidade_dano)
|
||||
|
||||
esta_tabela.quem_sou = "classe_damage_habilidade"
|
||||
local _newDamageSpell = {
|
||||
|
||||
-- esta_tabela.jogador = serial
|
||||
total = 0, --total de dano aplicado por esta habilidade
|
||||
counter = 0, --conta quantas vezes a habilidade foi chamada
|
||||
id = id,
|
||||
school = 0,
|
||||
|
||||
--> normal
|
||||
n_min = 0,
|
||||
n_max = 0,
|
||||
n_amt = 0,
|
||||
n_dmg = 0,
|
||||
|
||||
--> criticos
|
||||
c_min = 0,
|
||||
c_max = 0,
|
||||
c_amt = 0,
|
||||
c_dmg = 0,
|
||||
|
||||
esta_tabela.total = 0 --total de dano aplicado por esta habilidade
|
||||
esta_tabela.counter = 0 --conta quantas vezes a habilidade foi chamada
|
||||
esta_tabela.id = id
|
||||
esta_tabela.school = 0
|
||||
|
||||
--> normal hits
|
||||
--esta_tabela.normal = {["min"] = 0, ["max"] = 0, ["amt"] = 0, ["dmg"] = 0}
|
||||
|
||||
esta_tabela.n_min = 0
|
||||
esta_tabela.n_max = 0
|
||||
esta_tabela.n_amt = 0
|
||||
esta_tabela.n_dmg = 0
|
||||
|
||||
--> hits criticos
|
||||
--esta_tabela.critico = {["min"] = 0, ["max"] = 0, ["amt"] = 0, ["dmg"] = 0}
|
||||
esta_tabela.c_min = 0
|
||||
esta_tabela.c_max = 0
|
||||
esta_tabela.c_amt = 0
|
||||
esta_tabela.c_dmg = 0
|
||||
--> glacing
|
||||
g_min = 0, --not sure but, glancing min and max shouldn't be necessary
|
||||
g_max = 0, --
|
||||
g_amt = 0,
|
||||
g_dmg = 0,
|
||||
|
||||
--> resisted
|
||||
r_min = 0, --not sure but, resisted min and max shouldn't be necessary
|
||||
r_max = 0, --
|
||||
r_amt = 0,
|
||||
r_dmg = 0,
|
||||
|
||||
--> blocked
|
||||
b_min = 0, --not sure but, block min and max shouldn't be necessary
|
||||
b_max = 0, --
|
||||
b_amt = 0,
|
||||
b_dmg = 0,
|
||||
|
||||
--> hit glacing
|
||||
--esta_tabela.glacing = {["min"] = 0, ["max"] = 0, ["amt"] = 0, ["dmg"] = 0}
|
||||
esta_tabela.g_min = 0
|
||||
esta_tabela.g_max = 0
|
||||
esta_tabela.g_amt = 0
|
||||
esta_tabela.g_dmg = 0
|
||||
|
||||
--informações e detalhes gerais desta habilidade
|
||||
--> obsorved
|
||||
a_min = 0, --not sure but, absorbed min and max shouldn't be necessary
|
||||
a_max = 0, --
|
||||
a_amt = 0,
|
||||
a_dmg = 0,
|
||||
|
||||
crushing = 0, --> this still exists?
|
||||
|
||||
targets = container_combatentes:NovoContainer (container_damage_target)
|
||||
}
|
||||
|
||||
--esta_tabela.resisted = {["min"] = 0, ["max"] = 0, ["amt"] = 0, ["dmg"] = 0}
|
||||
esta_tabela.r_min = 0
|
||||
esta_tabela.r_max = 0
|
||||
esta_tabela.r_amt = 0
|
||||
esta_tabela.r_dmg = 0
|
||||
|
||||
--esta_tabela.blocked = {["min"] = 0, ["max"] = 0, ["amt"] = 0, ["dmg"] = 0}
|
||||
esta_tabela.b_min = 0
|
||||
esta_tabela.b_max = 0
|
||||
esta_tabela.b_amt = 0
|
||||
esta_tabela.b_dmg = 0
|
||||
|
||||
--esta_tabela.absorbed = {["min"] = 0, ["max"] = 0, ["amt"] = 0, ["dmg"] = 0}
|
||||
esta_tabela.a_min = 0
|
||||
esta_tabela.a_max = 0
|
||||
esta_tabela.a_amt = 0
|
||||
esta_tabela.a_dmg = 0
|
||||
|
||||
esta_tabela.crushing = 0 -- ??
|
||||
|
||||
esta_tabela.targets = container_combatentes:NovoContainer (container_damage_target)
|
||||
_setmetatable (_newDamageSpell, habilidade_dano)
|
||||
|
||||
if (link) then
|
||||
esta_tabela.targets.shadow = link.targets
|
||||
_newDamageSpell.targets.shadow = link.targets
|
||||
end
|
||||
|
||||
if (token == "SPELL_PERIODIC_DAMAGE") then
|
||||
_detalhes:SpellIsDot (id)
|
||||
end
|
||||
|
||||
return esta_tabela
|
||||
return _newDamageSpell
|
||||
end
|
||||
|
||||
|
||||
|
||||
+41
-42
@@ -61,56 +61,55 @@ local div_lugar = _detalhes.divisores.colocacao
|
||||
local info = _detalhes.janela_info
|
||||
local keyName
|
||||
|
||||
|
||||
function atributo_energy:NovaTabela (serial, nome, link)
|
||||
local esta_tabela = {}
|
||||
esta_tabela.quem_sou = "classe_energy" --> DEBUG deleta-me
|
||||
|
||||
--print ("CRIANDO NOVO OBJETO")
|
||||
|
||||
_setmetatable (esta_tabela, atributo_energy)
|
||||
|
||||
--> grava o tempo que a tabela foi criada para o garbage collector interno
|
||||
esta_tabela.CriadaEm = time()
|
||||
esta_tabela.last_event = 0
|
||||
esta_tabela.tipo = class_type --> atributo 3 = e_energy
|
||||
|
||||
esta_tabela.mana = 0
|
||||
esta_tabela.e_rage = 0
|
||||
esta_tabela.e_energy = 0
|
||||
esta_tabela.runepower = 0
|
||||
esta_tabela.focus = 0
|
||||
esta_tabela.holypower = 0
|
||||
|
||||
esta_tabela.mana_r = 0
|
||||
esta_tabela.e_rage_r = 0
|
||||
esta_tabela.e_energy_r = 0
|
||||
esta_tabela.runepower_r = 0
|
||||
esta_tabela.focus_r = 0
|
||||
esta_tabela.holypower_r = 0
|
||||
--> constructor
|
||||
local _new_energyActor = {
|
||||
|
||||
esta_tabela.mana_from = {}
|
||||
esta_tabela.e_rage_from = {}
|
||||
esta_tabela.e_energy_from = {}
|
||||
esta_tabela.runepower_from = {}
|
||||
esta_tabela.focus_from = {}
|
||||
esta_tabela.holypower_from = {}
|
||||
|
||||
esta_tabela.last_value = nil --> ultimo valor que este jogador teve, salvo quando a barra dele é atualizada
|
||||
last_event = 0,
|
||||
tipo = class_type, --> atributo 3 = e_energy
|
||||
|
||||
mana = 0,
|
||||
e_rage = 0,
|
||||
e_energy = 0,
|
||||
runepower = 0,
|
||||
focus = 0,
|
||||
holypower = 0,
|
||||
|
||||
esta_tabela.pets = {}
|
||||
|
||||
--container armazenará os seriais dos alvos que o player aplicou dano
|
||||
esta_tabela.targets = container_combatentes:NovoContainer (container_energy_target)
|
||||
|
||||
--container armazenará os IDs das habilidades usadas por este jogador
|
||||
esta_tabela.spell_tables = container_habilidades:NovoContainer (container_energy)
|
||||
mana_r = 0,
|
||||
e_rage_r = 0,
|
||||
e_energy_r = 0,
|
||||
runepower_r = 0,
|
||||
focus_r = 0,
|
||||
holypower_r = 0,
|
||||
|
||||
mana_from = {},
|
||||
e_rage_from = {},
|
||||
e_energy_from = {},
|
||||
runepower_from = {},
|
||||
focus_from = {},
|
||||
holypower_from = {},
|
||||
|
||||
last_value = nil, --> ultimo valor que este jogador teve, salvo quando a barra dele é atualizada
|
||||
|
||||
pets = {},
|
||||
|
||||
--container armazenará os seriais dos alvos que o player aplicou dano
|
||||
targets = container_combatentes:NovoContainer (container_energy_target),
|
||||
|
||||
--container armazenará os IDs das habilidades usadas por este jogador
|
||||
spell_tables = container_habilidades:NovoContainer (container_energy),
|
||||
}
|
||||
|
||||
_setmetatable (_new_energyActor, atributo_energy)
|
||||
|
||||
if (link) then
|
||||
esta_tabela.targets.shadow = link.targets
|
||||
esta_tabela.spell_tables.shadow = link.spell_tables
|
||||
_new_energyActor.targets.shadow = link.targets
|
||||
_new_energyActor.spell_tables.shadow = link.spell_tables
|
||||
end
|
||||
|
||||
return esta_tabela
|
||||
return _new_energyActor
|
||||
end
|
||||
|
||||
function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, exportar)
|
||||
|
||||
@@ -15,27 +15,28 @@ local _UnitAura = UnitAura
|
||||
|
||||
local container_playernpc = _detalhes.container_type.CONTAINER_PLAYERNPC
|
||||
|
||||
--id, nome, type, miss, dano, cura, overkill, school, resisted, blocked, absorbed, critico, glacing, crushing
|
||||
function habilidade_energy:NovaTabela (id, link, token) --aqui eu não sei que parâmetros passar
|
||||
local esta_tabela = {}
|
||||
_setmetatable (esta_tabela, habilidade_energy)
|
||||
function habilidade_energy:NovaTabela (id, link, token)
|
||||
|
||||
esta_tabela.quem_sou = "classe_energy_habilidade"
|
||||
esta_tabela.id = id
|
||||
esta_tabela.counter = 0
|
||||
local _newEnergySpell = {
|
||||
|
||||
id = id,
|
||||
counter = 0,
|
||||
|
||||
mana = 0,
|
||||
e_rage = 0,
|
||||
e_energy = 0,
|
||||
runepower = 0,
|
||||
|
||||
targets = container_combatentes:NovoContainer (container_energy_target)
|
||||
}
|
||||
|
||||
esta_tabela.mana = 0
|
||||
esta_tabela.e_rage = 0
|
||||
esta_tabela.e_energy = 0
|
||||
esta_tabela.runepower = 0
|
||||
|
||||
esta_tabela.targets = container_combatentes:NovoContainer (container_energy_target)
|
||||
_setmetatable (_newEnergySpell, habilidade_energy)
|
||||
|
||||
if (link) then
|
||||
esta_tabela.targets.shadow = link.targets
|
||||
_newEnergySpell.targets.shadow = link.targets
|
||||
end
|
||||
|
||||
return esta_tabela
|
||||
return _newEnergySpell
|
||||
end
|
||||
|
||||
function habilidade_energy:Add (serial, nome, flag, amount, who_nome, powertype)
|
||||
|
||||
+69
-56
@@ -59,60 +59,54 @@ local info = _detalhes.janela_info
|
||||
local keyName
|
||||
|
||||
function atributo_heal:NovaTabela (serial, nome, link)
|
||||
local esta_tabela = {}
|
||||
esta_tabela.quem_sou = "classe_heal" --> DEBUG deleta-me
|
||||
|
||||
_setmetatable (esta_tabela, atributo_heal)
|
||||
|
||||
--> grava o tempo que a tabela foi criada para o garbage collector interno
|
||||
esta_tabela.CriadaEm = time()
|
||||
|
||||
--> dps do objeto inicia sempre desligado
|
||||
esta_tabela.iniciar_hps = false --> sera necessario isso na cura?
|
||||
|
||||
esta_tabela.tipo = class_type --> atributo 2 = cura
|
||||
|
||||
esta_tabela.total = 0
|
||||
esta_tabela.totalover = 0
|
||||
esta_tabela.custom = 0
|
||||
|
||||
esta_tabela.total_without_pet = 0 --> pet de DK cura
|
||||
esta_tabela.totalover_without_pet = 0 --> pet de DK cura
|
||||
|
||||
esta_tabela.last_events_table = _detalhes:CreateActorLastEventTable()
|
||||
esta_tabela.last_events_table.original = true
|
||||
|
||||
esta_tabela.healing_taken = 0 --> total de cura que este jogador recebeu
|
||||
esta_tabela.healing_from = {} --> armazena os nomes que deram cura neste jogador
|
||||
|
||||
esta_tabela.last_event = 0 --> mantem igual ao dano
|
||||
esta_tabela.on_hold = false --> mantem igual ao dano
|
||||
esta_tabela.delay = 0 --> mantem igual ao dano
|
||||
|
||||
esta_tabela.last_value = nil --> ultimo valor que este jogador teve, salvo quando a barra dele é atualizada
|
||||
|
||||
esta_tabela.end_time = nil
|
||||
esta_tabela.start_time = 0
|
||||
|
||||
esta_tabela.last_hps = 0 --> cura por segundo
|
||||
esta_tabela.last_value = 0
|
||||
|
||||
esta_tabela.pets = {} --cura não tem pet, okey? tem pet sim, as larvas de DK
|
||||
|
||||
esta_tabela.heal_enemy = {} --> quando o jogador cura um inimigo
|
||||
--> constructor
|
||||
local _new_healActor = {
|
||||
|
||||
--container armazenará os IDs das habilidades usadas por este jogador
|
||||
esta_tabela.spell_tables = container_habilidades:NovoContainer (container_heal)
|
||||
|
||||
--container armazenará os seriais dos alvos que o player aplicou dano
|
||||
esta_tabela.targets = container_combatentes:NovoContainer (container_heal_target)
|
||||
tipo = class_type, --> atributo 2 = cura
|
||||
|
||||
total = 0,
|
||||
totalover = 0,
|
||||
custom = 0,
|
||||
|
||||
total_without_pet = 0,
|
||||
totalover_without_pet = 0,
|
||||
|
||||
healing_taken = 0, --> total de cura que este jogador recebeu
|
||||
healing_from = {}, --> armazena os nomes que deram cura neste jogador
|
||||
|
||||
if (link) then
|
||||
esta_tabela.targets.shadow = link.targets
|
||||
esta_tabela.spell_tables.shadow = link.spell_tables
|
||||
iniciar_hps = false, --> dps_started
|
||||
last_event = 0,
|
||||
on_hold = false,
|
||||
delay = 0,
|
||||
last_value = nil, --> ultimo valor que este jogador teve, salvo quando a barra dele é atualizada
|
||||
last_hps = 0, --> cura por segundo
|
||||
|
||||
end_time = nil,
|
||||
start_time = 0,
|
||||
|
||||
pets = {}, --> nome já formatado: pet nome <owner nome>
|
||||
|
||||
heal_enemy = {}, --> quando o jogador cura um inimigo
|
||||
|
||||
--container armazenará os IDs das habilidades usadas por este jogador
|
||||
spell_tables = container_habilidades:NovoContainer (container_heal),
|
||||
|
||||
--container armazenará os seriais dos alvos que o player aplicou dano
|
||||
targets = container_combatentes:NovoContainer (container_heal_target)
|
||||
}
|
||||
|
||||
_setmetatable (_new_healActor, atributo_heal)
|
||||
|
||||
if (link) then --> se não for a shadow
|
||||
_new_healActor.last_events_table = _detalhes:CreateActorLastEventTable()
|
||||
_new_healActor.last_events_table.original = true
|
||||
|
||||
_new_healActor.targets.shadow = link.targets
|
||||
_new_healActor.spell_tables.shadow = link.spell_tables
|
||||
end
|
||||
|
||||
return esta_tabela
|
||||
return _new_healActor
|
||||
end
|
||||
|
||||
|
||||
@@ -131,6 +125,8 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo
|
||||
--> top actor #1
|
||||
instancia.top = 0
|
||||
|
||||
local using_cache = false
|
||||
|
||||
local sub_atributo = instancia.sub_atributo --> o que esta sendo mostrado nesta instância
|
||||
local conteudo = showing._ActorTable
|
||||
local amount = #conteudo
|
||||
@@ -199,16 +195,33 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo
|
||||
|
||||
elseif (instancia.modo == modo_GROUP) then --> mostrando GROUP
|
||||
|
||||
--> organiza as tabelas
|
||||
|
||||
if (_detalhes.in_combat) then
|
||||
using_cache = true
|
||||
end
|
||||
|
||||
if (using_cache) then
|
||||
conteudo = _detalhes.cache_healing_group
|
||||
|
||||
--print ("AQUI")
|
||||
--print ("::"..keyName)
|
||||
_table_sort (conteudo, _detalhes.SortKeySimple)
|
||||
|
||||
--_detalhes:DelayMsg ("==================")
|
||||
--_detalhes:DelayMsg (keyName)
|
||||
if (conteudo[1][keyName] < 1) then
|
||||
amount = 0
|
||||
else
|
||||
instancia.top = conteudo[1][keyName]
|
||||
amount = #conteudo
|
||||
end
|
||||
|
||||
for i = 1, amount do
|
||||
total = total + conteudo[i][keyName]
|
||||
end
|
||||
else
|
||||
--_table_sort (conteudo, _detalhes.SortKeyGroup)
|
||||
_detalhes.SortGroup (conteudo, keyName)
|
||||
end
|
||||
|
||||
--_table_sort (conteudo, _detalhes.SortKeyGroup)
|
||||
_detalhes.SortGroup (conteudo, keyName)
|
||||
|
||||
|
||||
--[[_table_sort (conteudo, function (a, b)
|
||||
if (a.grupo and b.grupo) then
|
||||
@@ -328,7 +341,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) then
|
||||
if ((_detalhes.time_type == 2 and self.grupo) or (not _detalhes:CaptureGet ("heal") and not _detalhes:CaptureGet ("aura"))) then
|
||||
hps = healing_total / combat_time
|
||||
self.last_hps = hps
|
||||
else
|
||||
|
||||
@@ -21,41 +21,37 @@ local _setmetatable = setmetatable
|
||||
|
||||
function habilidade_cura:NovaTabela (id, link) --aqui eu não sei que parâmetros passar
|
||||
|
||||
local esta_tabela = {}
|
||||
_setmetatable (esta_tabela, habilidade_cura)
|
||||
local _newHealSpell = {
|
||||
|
||||
total = 0,
|
||||
counter = 0,
|
||||
id = id,
|
||||
|
||||
esta_tabela.CriadaEm = time()
|
||||
esta_tabela.quem_sou = "classe_heal_habilidade"
|
||||
|
||||
-- esta_tabela.jogador = serial
|
||||
--> normal hits
|
||||
n_min = 0,
|
||||
n_max = 0,
|
||||
n_amt = 0,
|
||||
n_curado = 0,
|
||||
|
||||
--> critical hits
|
||||
c_min = 0,
|
||||
c_max = 0,
|
||||
c_amt = 0,
|
||||
c_curado = 0,
|
||||
|
||||
esta_tabela.total = 0 --total de dano aplicado por esta habilidade
|
||||
esta_tabela.counter = 0 --conta quantas vezes a habilidade foi chamada
|
||||
esta_tabela.id = id
|
||||
|
||||
--> normal hits
|
||||
absorbed = 0,
|
||||
overheal = 0,
|
||||
|
||||
targets = container_combatentes:NovoContainer (container_heal_target)
|
||||
}
|
||||
|
||||
esta_tabela.n_min = 0
|
||||
esta_tabela.n_max = 0
|
||||
esta_tabela.n_amt = 0
|
||||
esta_tabela.n_curado = 0
|
||||
_setmetatable (_newHealSpell, habilidade_cura)
|
||||
|
||||
--> critical hits
|
||||
|
||||
esta_tabela.c_min = 0
|
||||
esta_tabela.c_max = 0
|
||||
esta_tabela.c_amt = 0
|
||||
esta_tabela.c_curado = 0
|
||||
|
||||
esta_tabela.absorbed = 0
|
||||
esta_tabela.overheal = 0
|
||||
|
||||
esta_tabela.targets = container_combatentes:NovoContainer (container_heal_target)
|
||||
if (link) then
|
||||
esta_tabela.targets.shadow = link.targets
|
||||
_newHealSpell.targets.shadow = link.targets
|
||||
end
|
||||
|
||||
return esta_tabela
|
||||
return _newHealSpell
|
||||
end
|
||||
|
||||
function habilidade_cura:Add (serial, nome, flag, amount, who_nome, absorbed, critical, overhealing, is_shield)
|
||||
|
||||
@@ -1118,6 +1118,27 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini
|
||||
--print ("DEBUG: contra", instancia.showing.contra)
|
||||
end
|
||||
|
||||
if (_detalhes.cloud_process) then
|
||||
local atributo = instancia.atributo
|
||||
local time_left = (_detalhes.last_data_requested+7) - _detalhes._tempo
|
||||
|
||||
if (atributo == 1 and _detalhes.in_combat and not _detalhes:CaptureGet ("damage") and _detalhes.host_by) then
|
||||
|
||||
elseif (atributo == 2 and _detalhes.in_combat and (not _detalhes:CaptureGet ("heal") or _detalhes:CaptureGet ("aura")) and _detalhes.host_by) then
|
||||
|
||||
elseif (atributo == 3 and _detalhes.in_combat and not _detalhes:CaptureGet ("energy") and _detalhes.host_by) then
|
||||
|
||||
elseif (atributo == 4 and _detalhes.in_combat and not _detalhes:CaptureGet ("miscdata") and _detalhes.host_by) then
|
||||
|
||||
else
|
||||
time_left = nil
|
||||
end
|
||||
|
||||
if (time_left) then
|
||||
instancia:InstanceAlert (Loc ["STRING_PLEASE_WAIT"], {[[Interface\COMMON\StreamCircle]], 22, 22, true}, time_left)
|
||||
end
|
||||
end
|
||||
|
||||
_detalhes:SendEvent ("DETAILS_INSTANCE_CHANGESEGMENT", nil, instancia, segmento)
|
||||
|
||||
end
|
||||
|
||||
@@ -59,42 +59,15 @@ local info = _detalhes.janela_info
|
||||
local keyName
|
||||
|
||||
function atributo_misc:NovaTabela (serial, nome, link)
|
||||
local esta_tabela = {}
|
||||
esta_tabela.quem_sou = "classe_misc" --> DEBUG deleta-me
|
||||
|
||||
--print ("CRIANDO NOVO OBJETO")
|
||||
|
||||
_setmetatable (esta_tabela, atributo_misc)
|
||||
|
||||
--> grava o tempo que a tabela foi criada para o garbage collector interno
|
||||
esta_tabela.CriadaEm = time()
|
||||
esta_tabela.last_event = 0
|
||||
esta_tabela.tipo = class_type --> atributo 4 = misc
|
||||
|
||||
--esta_tabela.interrupt = 0 --> armazena quantos interrupt a pessoa deu
|
||||
local _new_miscActor = {
|
||||
last_event = 0,
|
||||
tipo = class_type, --> atributo 4 = misc
|
||||
pets = {} --> pets? okey pets
|
||||
}
|
||||
_setmetatable (_new_miscActor, atributo_misc)
|
||||
|
||||
--[[
|
||||
esta_tabela.cc_break = 0 --> armazena quantas quebras de CC
|
||||
esta_tabela.ress = 0 --> armazena quantos pessoas ele reviveu
|
||||
esta_tabela.dispelled = 0 --> armazena quantos dispells esta pessoa fez
|
||||
esta_tabela.dispell = 0 --> armazena quantos dispell esta pessoa recebeu
|
||||
esta_tabela.last_events_tables = 0 --> armazena quantas vezes essa oessia morreu
|
||||
--]]
|
||||
|
||||
esta_tabela.pets = {} --> pets? okey pets
|
||||
|
||||
--container armazenará os seriais dos alvos que o player aplicou dano
|
||||
--esta_tabela.targets = container_combatentes:NovoContainer (container_energy_target)
|
||||
|
||||
--container armazenará os IDs das habilidades usadas por este jogador
|
||||
--esta_tabela.spell_tables = container_habilidades:NovoContainer (container_energy)
|
||||
|
||||
if (link) then
|
||||
--esta_tabela.targets.shadow = link.targets
|
||||
--esta_tabela.spell_tables.shadow = link.spell_tables
|
||||
end
|
||||
|
||||
return esta_tabela
|
||||
return _new_miscActor
|
||||
end
|
||||
|
||||
function _detalhes:ToolTipDead (instancia, morte, esta_barra)
|
||||
|
||||
@@ -15,41 +15,29 @@ local _UnitAura = UnitAura
|
||||
local container_playernpc = _detalhes.container_type.CONTAINER_PLAYERNPC
|
||||
|
||||
function habilidade_misc:NovaTabela (id, link, token) --aqui eu não sei que parâmetros passar
|
||||
local esta_tabela = {}
|
||||
_setmetatable (esta_tabela, habilidade_misc)
|
||||
|
||||
esta_tabela.quem_sou = "classe_others_habilidade"
|
||||
|
||||
esta_tabela.id = id
|
||||
|
||||
--print ("token: " .. token)
|
||||
local _newMiscSpell = {
|
||||
|
||||
id = id,
|
||||
counter = 0,
|
||||
targets = container_combatentes:NovoContainer (container_misc_target)
|
||||
}
|
||||
|
||||
if (token == "SPELL_INTERRUPT") then
|
||||
--print ("token de interrupt")
|
||||
esta_tabela.interrompeu_oque = {}
|
||||
end
|
||||
|
||||
if (token == "SPELL_DISPEL" or token == "SPELL_STOLEN") then
|
||||
--print ("token de interrupt")
|
||||
esta_tabela.dispell_oque = {}
|
||||
end
|
||||
|
||||
if (token == "SPELL_AURA_BROKEN" or token == "SPELL_AURA_BROKEN_SPELL") then
|
||||
--print ("token de interrupt")
|
||||
esta_tabela.cc_break_oque = {}
|
||||
_newMiscSpell.interrompeu_oque = {}
|
||||
elseif (token == "SPELL_DISPEL" or token == "SPELL_STOLEN") then
|
||||
_newMiscSpell.dispell_oque = {}
|
||||
elseif (token == "SPELL_AURA_BROKEN" or token == "SPELL_AURA_BROKEN_SPELL") then
|
||||
_newMiscSpell.cc_break_oque = {}
|
||||
end
|
||||
|
||||
-- isso aqui não pode ser assim... ou pode?
|
||||
esta_tabela.counter = 0
|
||||
--esta_tabela.res = 0
|
||||
|
||||
esta_tabela.targets = container_combatentes:NovoContainer (container_misc_target)
|
||||
_setmetatable (_newMiscSpell, habilidade_misc)
|
||||
|
||||
if (link) then
|
||||
esta_tabela.targets.shadow = link.targets
|
||||
_newMiscSpell.targets.shadow = link.targets
|
||||
end
|
||||
|
||||
return esta_tabela
|
||||
return _newMiscSpell
|
||||
end
|
||||
|
||||
function habilidade_misc:Add (serial, nome, flag, who_nome, token, spellID, spellName)
|
||||
|
||||
@@ -14,12 +14,9 @@ local _setmetatable = setmetatable
|
||||
--esta tabela irá ser usada por todas os tipos? tipo dano, cura, interrupts?
|
||||
|
||||
function alvo_da_habilidade:NovaTabela (link)
|
||||
local esta_tabela = {}
|
||||
_setmetatable (esta_tabela, alvo_da_habilidade)
|
||||
|
||||
esta_tabela.quem_sou = "classe_alvo_da_habilidade"
|
||||
|
||||
esta_tabela.total = 0 --total que a habilidade fez.
|
||||
local esta_tabela = {total = 0}
|
||||
_setmetatable (esta_tabela, alvo_da_habilidade)
|
||||
|
||||
return esta_tabela
|
||||
end
|
||||
|
||||
@@ -46,26 +46,21 @@ local REACTION_HOSTILE = COMBATLOG_OBJECT_REACTION_HOSTILE or 0x00000040
|
||||
|
||||
function container_combatentes:NovoContainer (tipo_do_container, combatTable, combatId)
|
||||
|
||||
local esta_tabela = {}
|
||||
_setmetatable (esta_tabela, container_combatentes)
|
||||
local _newContainer = {
|
||||
|
||||
esta_tabela.funcao_de_criacao = container_combatentes:FuncaoDeCriacao (tipo_do_container)
|
||||
if (not esta_tabela.funcao_de_criacao) then
|
||||
print ("Debug: Container criado mas sem funcao de criacao. TIPO: ")
|
||||
print (tipo_do_container)
|
||||
print (debugstack(2))
|
||||
return
|
||||
end
|
||||
funcao_de_criacao = container_combatentes:FuncaoDeCriacao (tipo_do_container),
|
||||
|
||||
tipo = tipo_do_container,
|
||||
|
||||
combatId = combatId,
|
||||
|
||||
_ActorTable = {},
|
||||
_NameIndexTable = {}
|
||||
}
|
||||
|
||||
esta_tabela.tipo = tipo_do_container
|
||||
|
||||
esta_tabela.combatId = combatId
|
||||
|
||||
esta_tabela._ActorTable = {}
|
||||
esta_tabela._NameIndexTable = {}
|
||||
esta_tabela.meu_tipo = "container_combatentes"
|
||||
|
||||
return esta_tabela
|
||||
_setmetatable (_newContainer, container_combatentes)
|
||||
|
||||
return _newContainer
|
||||
end
|
||||
|
||||
local function get_class_ (novo_objeto, nome, flag)
|
||||
@@ -108,32 +103,6 @@ function container_combatentes:Dupe (who)
|
||||
return novo_objeto
|
||||
end
|
||||
|
||||
function container_combatentes:CriarShadow (who)
|
||||
--> o self é o container no combate_overall -- who é o objeto na tabela do historico [1 2 3]
|
||||
local mapa = self._NameIndexTable
|
||||
local conteudo = self._ActorTable
|
||||
|
||||
local novo_objeto = self.funcao_de_criacao (_, who.serial, who.nome)
|
||||
novo_objeto.nome = who.nome
|
||||
|
||||
novo_objeto.flag = who.flag
|
||||
novo_objeto.classe = who.classe
|
||||
|
||||
for _, pet in _ipairs (who.pets) do
|
||||
novo_objeto.pets [#novo_objeto.pets+1] = pet
|
||||
end
|
||||
|
||||
if (who.enemy) then
|
||||
novo_objeto.enemy = true
|
||||
end
|
||||
|
||||
self._ActorTable [#self._ActorTable+1] = novo_objeto
|
||||
self._NameIndexTable[who.nome] = #self._ActorTable
|
||||
|
||||
return novo_objeto
|
||||
|
||||
end
|
||||
|
||||
function container_combatentes:GetAmount (actorName, key)
|
||||
key = key or "total"
|
||||
local index = self._NameIndexTable [actorName]
|
||||
@@ -227,6 +196,7 @@ function container_combatentes:PegarCombatente (serial, nome, flag, criar, isOwn
|
||||
if (shadow_objeto) then
|
||||
shadow_objeto.grupo = true
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
elseif (dono_do_pet) then --> é um pet
|
||||
@@ -285,8 +255,11 @@ function container_combatentes:PegarCombatente (serial, nome, flag, criar, isOwn
|
||||
novo_objeto.shadow = shadow_objeto
|
||||
novo_objeto:CriaLink (shadow_objeto) --> criando o link
|
||||
shadow_objeto.flag = details_flag
|
||||
if (novo_objeto.grupo) then
|
||||
_detalhes.cache_damage_group [#_detalhes.cache_damage_group+1] = novo_objeto
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if (novo_objeto.classe == "UNGROUPPLAYER") then --> is a player
|
||||
if (_bit_band (flag, REACTION_HOSTILE ) ~= 0) then --> is hostile
|
||||
novo_objeto.enemy = true
|
||||
@@ -311,6 +284,9 @@ function container_combatentes:PegarCombatente (serial, nome, flag, criar, isOwn
|
||||
novo_objeto.shadow = shadow_objeto
|
||||
novo_objeto:CriaLink (shadow_objeto) --> criando o link
|
||||
shadow_objeto.flag = details_flag
|
||||
if (novo_objeto.grupo) then
|
||||
_detalhes.cache_healing_group [#_detalhes.cache_healing_group+1] = novo_objeto
|
||||
end
|
||||
end
|
||||
|
||||
if (novo_objeto.classe == "UNGROUPPLAYER") then --> is a player
|
||||
|
||||
@@ -25,18 +25,16 @@ local habilidade_misc = _detalhes.habilidade_misc
|
||||
local container_habilidades = _detalhes.container_habilidades
|
||||
|
||||
function container_habilidades:NovoContainer (tipo_do_container)
|
||||
local esta_tabela = {}
|
||||
_setmetatable (esta_tabela, container_habilidades)
|
||||
|
||||
local _newContainer = {
|
||||
funcao_de_criacao = container_habilidades:FuncaoDeCriacao (tipo_do_container),
|
||||
tipo = tipo_do_container,
|
||||
_ActorTable = {}
|
||||
}
|
||||
|
||||
esta_tabela.funcao_de_criacao = container_habilidades:FuncaoDeCriacao (tipo_do_container)
|
||||
if (not esta_tabela.funcao_de_criacao) then
|
||||
print ("DEBUG: Sem funcao de criacao para a habilidade... TIPO: ")
|
||||
print (tipo_do_container)
|
||||
end
|
||||
_setmetatable (_newContainer, container_habilidades)
|
||||
|
||||
esta_tabela.tipo = tipo_do_container
|
||||
esta_tabela._ActorTable = {}
|
||||
return esta_tabela
|
||||
return _newContainer
|
||||
end
|
||||
|
||||
function container_habilidades:Dupe (who)
|
||||
|
||||
@@ -14,11 +14,8 @@ local container_pets = _detalhes.container_pets
|
||||
local timeMachine = _detalhes.timeMachine
|
||||
|
||||
function historico:NovoHistorico()
|
||||
local esta_tabela = {}
|
||||
local esta_tabela = {tabelas = {}}
|
||||
_setmetatable (esta_tabela, historico)
|
||||
|
||||
esta_tabela.tabelas = {} --guarda as tabelas dos combates
|
||||
|
||||
return esta_tabela
|
||||
end
|
||||
|
||||
@@ -37,8 +34,26 @@ function historico:adicionar (tabela)
|
||||
_detalhes:InstanciaCallFunction (_detalhes.CheckFreeze, tamanho+1, ultima_tabela)
|
||||
end
|
||||
|
||||
--> reordena as tabelas
|
||||
--> adiciona no index #1
|
||||
_table_insert (self.tabelas, 1, tabela)
|
||||
|
||||
if (self.tabelas[2]) then
|
||||
|
||||
--> fazer limpeza na tabela
|
||||
|
||||
for index, container in ipairs (self.tabelas[2]) do
|
||||
if (index < 3) then
|
||||
for _, jogador in ipairs (container._ActorTable) do
|
||||
|
||||
--> limpeza
|
||||
jogador.last_events_table = nil
|
||||
|
||||
end
|
||||
else
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--> chama a função que irá atualizar as instâncias com segmentos no histórico
|
||||
_detalhes:InstanciaCallFunction (_detalhes.AtualizaSegmentos_AfterCombat, self)
|
||||
|
||||
@@ -136,9 +136,9 @@ function container_pets:Adicionar (pet_serial, pet_nome, pet_flags, dono_serial,
|
||||
--print ("dono nome:",d[1], "dono serial:", d[2], "dono flags:", d[3], "tempo:", d[4])
|
||||
--end
|
||||
|
||||
if (self.pets [dono_serial]) then
|
||||
--if (self.pets [dono_serial]) then
|
||||
--print ("debug: a owner is a pet, Owner: ", dono_nome, " Pet: ", pet_nome)
|
||||
end
|
||||
--end
|
||||
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user