- added new sub attribute: buff uptime.
- minor bug fixes when updating energy attribute. - fixed issue were changing attributes clicking directly on attribute name. - some fixes to prevent unknown pet owner name. - pet scan now is more smooth and scheduled to 1 scan per second. - disabling auras doesn't disable healing absorbs any more. - friendly fire doesn't check pets any more, only players. - fixed problem were pet damage on target isn't added to the owner target. - fixed issue with cooldown refresh which isn't tracked before. - added cooldown to death log and also the time of last cooldown used. - added command /details worldboss which runs the macro showing world boss killed. - added command /details updates showing change log window. - added absorbs for monk 2P, shammy 2P and Stolen Relic of Zuldazar trinket. - added a change log inside the addon showing latest changes.
This commit is contained in:
@@ -127,14 +127,15 @@ function combate:NovaTabela (iniciada, _tabela_overall, combatId, ...)
|
||||
e_rage = 0, --> rage
|
||||
e_energy = 0, --> energy (rogues cat)
|
||||
runepower = 0 --> runepower (dk)
|
||||
},
|
||||
},
|
||||
{--> misc
|
||||
cc_break = 0, --> armazena quantas quebras de CC
|
||||
ress = 0, --> armazena quantos pessoas ele reviveu
|
||||
interrupt = 0, --> armazena quantos interrupt a pessoa deu
|
||||
dispell = 0, --> armazena quantos dispell esta pessoa recebeu
|
||||
dead = 0, --> armazena quantas vezes essa pessia morreu
|
||||
dead = 0, --> armazena quantas vezes essa pessia morreu
|
||||
cooldowns_defensive = 0, --> armazena quantos cooldowns a raid usou
|
||||
buff_uptime = 0 --> armazena quantos cooldowns a raid usou
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,7 +154,8 @@ function combate:NovaTabela (iniciada, _tabela_overall, combatId, ...)
|
||||
interrupt = 0, --> armazena quantos interrupt a pessoa deu
|
||||
dispell = 0, --> armazena quantos dispell esta pessoa recebeu
|
||||
dead = 0, --> armazena quantas vezes essa oessia morreu
|
||||
cooldowns_defensive = 0 --> armazena quantos cooldowns a raid usou
|
||||
cooldowns_defensive = 0, --> armazena quantos cooldowns a raid usou
|
||||
buff_uptime = 0
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -521,6 +521,7 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex
|
||||
local combat_time = instancia.showing:GetCombatTime()
|
||||
atributo_damage:ContainerRefreshDps (conteudo, combat_time)
|
||||
end
|
||||
|
||||
_table_sort (conteudo, _detalhes.SortKeyGroup)
|
||||
end
|
||||
--
|
||||
@@ -541,7 +542,8 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex
|
||||
|
||||
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 (_bit_band (player.flag, DFLAG_player_group) >= 0x101) then --> é um player e esta em grupo
|
||||
if (player.grupo) then --> é um player e esta em grupo
|
||||
if (player[keyName] < 1) then --> dano menor que 1, interromper o loop
|
||||
amount = index - 1
|
||||
break
|
||||
|
||||
@@ -196,6 +196,9 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex
|
||||
keyName = "e_energy"
|
||||
elseif (sub_atributo == 4) then --> RUNEPOWER GANHO
|
||||
keyName = "runepower"
|
||||
else
|
||||
--> not sure why this is happening
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
@@ -223,9 +226,11 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex
|
||||
total = tabela_do_combate.totals [class_type] [keyName] --> pega o total de dano já aplicado
|
||||
|
||||
instancia.top = conteudo[1] [keyName]
|
||||
|
||||
|
||||
elseif (modo == modo_GROUP) then --> mostrando GROUP
|
||||
|
||||
--print ("energy", keyName)
|
||||
|
||||
_table_sort (conteudo, function (a, b)
|
||||
if (a.grupo and b.grupo) then
|
||||
return a[keyName] > b[keyName]
|
||||
@@ -239,7 +244,8 @@ function atributo_energy: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 (_bit_band (player.flag, DFLAG_player_group) >= 0x101) then --> é um player e esta em grupo
|
||||
if (player.grupo) then --> é um player e esta em grupo
|
||||
if (player[keyName] < 1) then --> dano menor que 1, interromper o loop
|
||||
amount = index - 1
|
||||
break
|
||||
|
||||
@@ -292,7 +292,8 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo
|
||||
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 (_bit_band (player.flag, DFLAG_player_group) >= 0x101) then --> é um player e esta em grupo
|
||||
if (player.grupo) then --> é um player e esta em grupo
|
||||
if (player[keyName] < 1) then --> dano menor que 1, interromper o loop
|
||||
amount = index - 1
|
||||
break
|
||||
|
||||
@@ -747,9 +747,7 @@ end
|
||||
nova_instancia.atributo = 1 --> dano
|
||||
nova_instancia.sub_atributo = 1 --> damage done
|
||||
|
||||
nova_instancia.m2_last = {
|
||||
[nova_instancia.atributo] = nova_instancia.sub_atributo
|
||||
}
|
||||
nova_instancia.sub_atributo_last = {1, 1, 1, 1, 1}
|
||||
|
||||
nova_instancia.segmento = -1 --> combate atual
|
||||
|
||||
@@ -827,6 +825,10 @@ function _detalhes:RestauraJanela (index, temp)
|
||||
self.barrasInfo.textureNameBackground = _detalhes.default_texture_name
|
||||
end
|
||||
|
||||
if (not self.sub_atributo_last) then
|
||||
self.sub_atributo_last = {1, 1, 1, 1, 1}
|
||||
end
|
||||
|
||||
local _baseframe, _bgframe, _bgframe_display, _scrollframe = gump:CriaJanelaPrincipal (self.meu_id, self)
|
||||
|
||||
self.baseframe = _baseframe
|
||||
@@ -1220,9 +1222,9 @@ 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
|
||||
--if (not sub_atributo) then
|
||||
-- sub_atributo = instancia.sub_atributo
|
||||
--end
|
||||
|
||||
--print ("DEBUG: trocando para "..atributo.." "..sub_atributo)
|
||||
|
||||
@@ -1276,6 +1278,10 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini
|
||||
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
|
||||
|
||||
@@ -1303,14 +1309,10 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini
|
||||
|
||||
atributo_changed = true
|
||||
|
||||
instancia.m2_last [instancia.atributo] = instancia.sub_atributo --> salta o último sub-atributo do atributo que esta sendo mostrado na instÇancia
|
||||
instancia.sub_atributo_last [instancia.atributo] = meu_sub_atributo
|
||||
--print ("atributo last changed:",instancia.atributo, "->", meu_sub_atributo)
|
||||
|
||||
instancia.atributo = atributo
|
||||
|
||||
local last_sub_atributo = instancia.m2_last [atributo] --> isso aqui é invalido, pois sempre vai haver um sub atributo e nao precisa conferir se ele realmente existe.
|
||||
if (not last_sub_atributo) then
|
||||
last_sub_atributo = 1
|
||||
end
|
||||
|
||||
instancia.sub_atributo = last_sub_atributo
|
||||
|
||||
--> troca icone
|
||||
@@ -1363,7 +1365,10 @@ 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.m2_last [instancia.atributo] = sub_atributo
|
||||
|
||||
instancia.sub_atributo_last [meu_atributo] = meu_sub_atributo
|
||||
--print ("atributo last changed:",meu_atributo, "->", meu_sub_atributo)
|
||||
|
||||
instancia.sub_atributo = sub_atributo
|
||||
|
||||
if (instancia.atributo == 5) then --> custom
|
||||
@@ -1388,6 +1393,7 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini
|
||||
|
||||
if (not _detalhes.initializing and not iniciando_instancia) then
|
||||
instancia:ResetaGump()
|
||||
--print ("atualizando: ", instancia.atributo, instancia.sub_atributo)
|
||||
instancia:AtualizaGumpPrincipal (true)
|
||||
end
|
||||
|
||||
@@ -1448,7 +1454,7 @@ function _detalhes:MontaAtributosOption (instancia, func)
|
||||
CoolTip:AddMenu (2, func, nil, i, o, options[o], nil, true)
|
||||
CoolTip:AddIcon (icones[i], 2, 1, 20, 20, p*(o-1), p*(o), 0, 1)
|
||||
end
|
||||
CoolTip:SetLastSelected (2, i, instancia.m2_last [i])
|
||||
CoolTip:SetLastSelected (2, i, instancia.sub_atributo_last [i])
|
||||
end
|
||||
|
||||
--> custom
|
||||
@@ -1460,10 +1466,10 @@ function _detalhes:MontaAtributosOption (instancia, func)
|
||||
CoolTip:AddMenu (2, func, nil, 5, index, custom.name, custom.icon, true)
|
||||
end
|
||||
|
||||
if (not instancia.m2_last [5]) then
|
||||
if (not instancia.sub_atributo_last [5]) then
|
||||
CoolTip:SetLastSelected (2, 5, 1)
|
||||
else
|
||||
CoolTip:SetLastSelected (2, 5, instancia.m2_last [5]+1)
|
||||
CoolTip:SetLastSelected (2, 5, instancia.sub_atributo_last [5]+1)
|
||||
end
|
||||
|
||||
CoolTip:SetLastSelected (1, atributo_ativo)
|
||||
@@ -1781,7 +1787,7 @@ function _detalhes:monta_relatorio (este_relatorio, custom)
|
||||
atributo = _detalhes.custom [self.sub_atributo].attribute
|
||||
container = self.showing [atributo]._ActorTable
|
||||
|
||||
print (total, keyName, first, atributo)
|
||||
--print (total, keyName, first, atributo)
|
||||
end
|
||||
|
||||
for i = 1, amt do
|
||||
|
||||
+246
-10
@@ -18,6 +18,12 @@ local _type = type
|
||||
--api locals
|
||||
local _GetSpellInfo = _detalhes.getspellinfo
|
||||
local GameTooltip = GameTooltip
|
||||
local _IsInRaid = IsInRaid
|
||||
local _IsInGroup = IsInGroup
|
||||
local _GetNumGroupMembers = GetNumGroupMembers
|
||||
local _UnitAura = UnitAura
|
||||
local _UnitGUID = UnitGUID
|
||||
local _UnitName = UnitName
|
||||
|
||||
local _detalhes = _G._detalhes
|
||||
local AceLocale = LibStub ("AceLocale-3.0")
|
||||
@@ -176,13 +182,27 @@ function _detalhes:ToolTipDead (instancia, morte, esta_barra)
|
||||
amt_golpes = ""
|
||||
end
|
||||
|
||||
--> [1] left text [2] right text [3] main 1 or sub 2 [...] color
|
||||
GameCooltip:AddLine ("".._cstr ("%.1f", evento[4] - hora_da_morte) .."s "..amt_golpes..nome_magia.." ("..evento[6]..")", "-".._detalhes:ToK (evento[3]).." (".. hp .."%)", 1, "white", "white")
|
||||
--> [1] icon [2] main 1 or sub 2 [3] left or right [4,5] width height [...] texcoord
|
||||
GameCooltip:AddIcon (icone_magia)
|
||||
--> [1] value [2] main 1 or sub 2 [...] color [4] glow
|
||||
GameCooltip:AddStatusBar (hp, 1, "red", true)
|
||||
|
||||
if (type (evento [1]) ~= "boolean" and evento [1] == 2) then --> last cooldown
|
||||
if (evento[3] == 1) then
|
||||
GameCooltip:AddLine (_cstr ("%.1f", evento[4] - hora_da_morte) .. "s " .. nome_magia .. " (" .. Loc ["STRING_LAST_COOLDOWN"] .. ")")
|
||||
GameCooltip:AddIcon (icone_magia)
|
||||
else
|
||||
GameCooltip:AddLine (Loc ["STRING_NOLAST_COOLDOWN"])
|
||||
end
|
||||
else
|
||||
--> [1] left text [2] right text [3] main 1 or sub 2 [...] color
|
||||
GameCooltip:AddLine ("".._cstr ("%.1f", evento[4] - hora_da_morte) .."s "..amt_golpes..nome_magia.." ("..evento[6]..")", "-".._detalhes:ToK (evento[3]).." (".. hp .."%)", 1, "white", "white")
|
||||
--> [1] icon [2] main 1 or sub 2 [3] left or right [4,5] width height [...] texcoord
|
||||
GameCooltip:AddIcon (icone_magia)
|
||||
|
||||
--> [1] value [2] main 1 or sub 2 [...] color [4] glow
|
||||
if (type (evento [1]) ~= "boolean" and evento [1] == 1) then --> cooldown
|
||||
GameCooltip:AddStatusBar (100, 1, "yellow", true)
|
||||
else
|
||||
GameCooltip:AddStatusBar (hp, 1, "red", true)
|
||||
end
|
||||
end
|
||||
|
||||
elseif (not battleress) then --> battle ress
|
||||
GameCooltip:AddLine ("+".._cstr ("%.1f", evento[4] - hora_da_morte) .."s "..nome_magia.." ("..evento[6]..")", "", 1, "white")
|
||||
GameCooltip:AddIcon ("Interface\\Glues\\CharacterSelect\\Glues-AddOn-Icons", 1, 1, nil, nil, .75, 1, 0, 1)
|
||||
@@ -269,6 +289,27 @@ function atributo_misc:ReportSingleCooldownLine (misc_actor, instancia)
|
||||
return _detalhes:Reportar (reportar, {_no_current = true, _no_inverse = true, _custom = true})
|
||||
end
|
||||
|
||||
function atributo_misc:ReportSingleBuffUptimeLine (misc_actor, instancia)
|
||||
|
||||
local barra = misc_actor.minha_barra
|
||||
|
||||
local reportar = {"Details! " .. Loc ["STRING_REPORT_SINGLE_BUFFUPTIME"] .. " " .. barra.texto_esquerdo:GetText()} --> localize-me
|
||||
reportar [#reportar+1] = "> " .. Loc ["STRING_SPELLS"] .. ":"
|
||||
|
||||
for i = 1, GameCooltip:GetNumLines() do
|
||||
local texto_left, texto_right = GameCooltip:GetText (i)
|
||||
|
||||
if (texto_left and texto_right) then
|
||||
texto_left = texto_left:gsub (("|T(.*)|t "), "")
|
||||
reportar [#reportar+1] = " "..texto_left.." "..texto_right..""
|
||||
elseif (i ~= 1) then
|
||||
reportar [#reportar+1] = "> " .. Loc ["STRING_TARGETS"] .. ":"
|
||||
end
|
||||
end
|
||||
|
||||
return _detalhes:Reportar (reportar, {_no_current = true, _no_inverse = true, _custom = true})
|
||||
end
|
||||
|
||||
function atributo_misc:DeadAtualizarBarra (morte, qual_barra, colocacao, instancia)
|
||||
|
||||
morte ["dead"] = true --> marca que esta tabela é uma tabela de mortes, usado no controla na hora de montar o tooltip
|
||||
@@ -313,7 +354,7 @@ end
|
||||
function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, exportar)
|
||||
|
||||
local showing = tabela_do_combate [class_type] --> o que esta sendo mostrado -> [1] - dano [2] - cura --> pega o container com ._NameIndexTable ._ActorTable
|
||||
|
||||
|
||||
if (#showing._ActorTable < 1) then --> não há barras para mostrar
|
||||
return _detalhes:EsconderBarrasNaoUsadas (instancia, showing)
|
||||
end
|
||||
@@ -340,6 +381,8 @@ function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, expo
|
||||
keyName = "dead"
|
||||
elseif (sub_atributo == 6) then --> DEFENSIVE COOLDOWNS
|
||||
keyName = "cooldowns_defensive"
|
||||
elseif (sub_atributo == 7) then --> BUFF UPTIME
|
||||
keyName = "buff_uptime"
|
||||
end
|
||||
else
|
||||
keyName = exportar.key
|
||||
@@ -365,6 +408,8 @@ function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, expo
|
||||
keyName = "dead"
|
||||
elseif (sub_atributo == 6) then --> DEFENSIVE COOLDOWNS
|
||||
keyName = "cooldowns_defensive"
|
||||
elseif (sub_atributo == 7) then --> BUFF UPTIME
|
||||
keyName = "buff_uptime"
|
||||
end
|
||||
|
||||
end
|
||||
@@ -445,7 +490,8 @@ function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, expo
|
||||
_table_sort (conteudo, _detalhes.SortGroupIfHaveKey)
|
||||
|
||||
for index, player in _ipairs (conteudo) do
|
||||
if (_bit_band (player.flag, DFLAG_player_group) >= 0x101) then --> é um player e esta em grupo
|
||||
--if (_bit_band (player.flag, DFLAG_player_group) >= 0x101) then --> é um player e esta em grupo
|
||||
if (player.grupo) then --> é um player e esta em grupo
|
||||
if (not player[keyName] or player[keyName] < 1) then --> dano menor que 1, interromper o loop
|
||||
amount = index - 1
|
||||
break
|
||||
@@ -470,7 +516,7 @@ function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, expo
|
||||
if (exportar) then
|
||||
return total, keyName, instancia.top
|
||||
end
|
||||
|
||||
|
||||
if (amount < 1) then --> não há barras para mostrar
|
||||
instancia:EsconderScrollBar() --> precisaria esconder a scroll bar
|
||||
return _detalhes:EndRefresh (instancia, total, tabela_do_combate, showing) --> retorna a tabela que precisa ganhar o refresh
|
||||
@@ -741,6 +787,8 @@ function atributo_misc:ToolTip (instancia, numero, barra)
|
||||
return self:ToolTipDead (instancia, numero, barra)
|
||||
elseif (instancia.sub_atributo == 6) then --> defensive cooldowns
|
||||
return self:ToolTipDefensiveCooldowns (instancia, numero, barra)
|
||||
elseif (instancia.sub_atributo == 7) then --> buff uptime
|
||||
return self:ToolTipBuffUptime (instancia, numero, barra)
|
||||
end
|
||||
end
|
||||
--> tooltip locals
|
||||
@@ -900,6 +948,142 @@ function atributo_misc:ToolTipDispell (instancia, numero, barra)
|
||||
return true
|
||||
end
|
||||
|
||||
function _detalhes:CatchRaidBuffUptime (in_or_out)
|
||||
|
||||
if (_IsInRaid()) then
|
||||
|
||||
for raidIndex = 1, _GetNumGroupMembers() do
|
||||
for buffIndex = 1, 41 do
|
||||
local name, _, _, _, _, _, _, unitCaster, _, _, spellid = _UnitAura ("raid"..raidIndex, buffIndex, nil, "HELPFUL")
|
||||
--print (name, unitCaster, "==", "raid"..raidIndex)
|
||||
if (name and unitCaster == "raid"..raidIndex) then
|
||||
|
||||
local playerName, realmName = _UnitName ("raid"..raidIndex)
|
||||
if (realmName and realmName ~= "") then
|
||||
playerName = playerName .. "-" .. realmName
|
||||
end
|
||||
|
||||
_detalhes.parser:add_buff_uptime (nil, GetTime(), _UnitGUID ("raid"..raidIndex), playerName, 0x00000417, _UnitGUID ("raid"..raidIndex), playerName, 0x00000417, spellid, name, in_or_out)
|
||||
|
||||
else
|
||||
--break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for buffIndex = 1, 41 do
|
||||
local name, _, _, _, _, _, _, unitCaster, _, _, spellid = _UnitAura ("player", buffIndex, nil, "HELPFUL")
|
||||
if (name and unitCaster == "player") then
|
||||
local playerName = _UnitName ("player")
|
||||
_detalhes.parser:add_buff_uptime (nil, GetTime(), _UnitGUID ("player"), playerName, 0x00000417, _UnitGUID ("player"), playerName, 0x00000417, spellid, name, in_or_out)
|
||||
else
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
elseif (_IsInGroup()) then
|
||||
for groupIndex = 1, _GetNumGroupMembers()-1 do
|
||||
for buffIndex = 1, 41 do
|
||||
local name, _, _, _, _, _, _, unitCaster, _, _, spellid = _UnitAura ("party"..groupIndex, buffIndex, nil, "HELPFUL")
|
||||
if (name and unitCaster == "party"..groupIndex) then
|
||||
|
||||
local playerName, realmName = _UnitName ("party"..groupIndex)
|
||||
if (realmName and realmName ~= "") then
|
||||
playerName = playerName .. "-" .. realmName
|
||||
end
|
||||
|
||||
_detalhes.parser:add_buff_uptime (nil, GetTime(), _UnitGUID ("party"..groupIndex), playerName, 0x00000417, _UnitGUID ("party"..groupIndex), playerName, 0x00000417, spellid, name, in_or_out)
|
||||
|
||||
else
|
||||
--break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for buffIndex = 1, 41 do
|
||||
local name, _, _, _, _, _, _, unitCaster, _, _, spellid = _UnitAura ("player", buffIndex, nil, "HELPFUL")
|
||||
if (name and unitCaster == "player") then
|
||||
local playerName = _UnitName ("player")
|
||||
_detalhes.parser:add_buff_uptime (nil, GetTime(), _UnitGUID ("player"), playerName, 0x00000417, _UnitGUID ("player"), playerName, 0x00000417, spellid, name, in_or_out)
|
||||
else
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
else
|
||||
for buffIndex = 1, 41 do
|
||||
local name, _, _, _, _, _, _, unitCaster, _, _, spellid = _UnitAura ("player", buffIndex, nil, "HELPFUL")
|
||||
if (name and unitCaster == "player") then
|
||||
local playerName = _UnitName ("player")
|
||||
_detalhes.parser:add_buff_uptime (nil, GetTime(), _UnitGUID ("player"), playerName, 0x00000417, _UnitGUID ("player"), playerName, 0x00000417, spellid, name, in_or_out)
|
||||
else
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local Sort2Reverse = function (a, b)
|
||||
return a[2] < b[2]
|
||||
end
|
||||
|
||||
function atributo_misc:ToolTipBuffUptime (instancia, numero, barra)
|
||||
|
||||
local owner = self.owner
|
||||
if (owner and owner.classe) then
|
||||
r, g, b = unpack (_detalhes.class_colors [owner.classe])
|
||||
else
|
||||
r, g, b = unpack (_detalhes.class_colors [self.classe])
|
||||
end
|
||||
|
||||
local meu_total = self ["buff_uptime"]
|
||||
local minha_tabela = self.buff_uptime_spell_tables._ActorTable
|
||||
|
||||
--> habilidade usada para interromper
|
||||
local buffs_usados = {}
|
||||
|
||||
local _combat_time = instancia.showing:GetCombatTime()
|
||||
|
||||
for _spellid, _tabela in _pairs (minha_tabela) do
|
||||
buffs_usados [#buffs_usados+1] = {_spellid, _tabela.uptime}
|
||||
end
|
||||
--_table_sort (buffs_usados, Sort2Reverse)
|
||||
_table_sort (buffs_usados, _detalhes.Sort2)
|
||||
|
||||
GameCooltip:AddLine (Loc ["STRING_SPELLS"].."", nil, nil, headerColor, nil, 12)
|
||||
GameCooltip:AddIcon ([[Interface\ICONS\Ability_Warrior_Safeguard]], 1, 1, 14, 14, 0.9375, 0.078125, 0.078125, 0.953125)
|
||||
GameCooltip:AddStatusBar (100, 1, r, g, b, barAlha)
|
||||
|
||||
if (#buffs_usados > 0) then
|
||||
for i = 1, _math_min (30, #buffs_usados) do
|
||||
local esta_habilidade = buffs_usados[i]
|
||||
|
||||
if (esta_habilidade[2] > 0) then
|
||||
local nome_magia, _, icone_magia = _GetSpellInfo (esta_habilidade[1])
|
||||
|
||||
local minutos, segundos = _math_floor (esta_habilidade[2]/60), _math_floor (esta_habilidade[2]%60)
|
||||
if (esta_habilidade[2] >= _combat_time) then
|
||||
GameCooltip:AddLine (nome_magia..": ", minutos .. "m " .. segundos .. "s" .. " (" .. _cstr ("%.1f", esta_habilidade[2] / _combat_time * 100) .. "%)", nil, "gray", "gray")
|
||||
GameCooltip:AddStatusBar (100, nil, 1, 0, 1, .3, false)
|
||||
elseif (minutos > 0) then
|
||||
GameCooltip:AddLine (nome_magia..": ", minutos .. "m " .. segundos .. "s" .. " (" .. _cstr ("%.1f", esta_habilidade[2] / _combat_time * 100) .. "%)")
|
||||
GameCooltip:AddStatusBar (100, 1, .1, .1, .1, .3)
|
||||
else
|
||||
GameCooltip:AddLine (nome_magia..": ", segundos .. "s" .. " (" .. _cstr ("%.1f", esta_habilidade[2] / _combat_time * 100) .. "%)")
|
||||
GameCooltip:AddStatusBar (100, 1, .1, .1, .1, .3)
|
||||
end
|
||||
|
||||
GameCooltip:AddIcon (icone_magia, nil, nil, 14, 14) --0.03125, 0.96875, 0.03125, 0.96875
|
||||
end
|
||||
end
|
||||
else
|
||||
GameCooltip:AddLine (Loc ["STRING_NO_SPELL"])
|
||||
end
|
||||
|
||||
return true
|
||||
|
||||
end
|
||||
|
||||
function atributo_misc:ToolTipDefensiveCooldowns (instancia, numero, barra)
|
||||
|
||||
local owner = self.owner
|
||||
@@ -1590,6 +1774,51 @@ atributo_misc.__add = function (shadow, tabela2)
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
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
|
||||
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)
|
||||
|
||||
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
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
if (tabela2.cooldowns_defensive) then
|
||||
|
||||
if (not shadow.cooldowns_defensive) then
|
||||
@@ -1811,6 +2040,11 @@ atributo_misc.__sub = function (tabela1, tabela2)
|
||||
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.cooldowns_defensive and tabela2.cooldowns_defensive) then
|
||||
tabela1.cooldowns_defensive = tabela1.cooldowns_defensive - tabela2.cooldowns_defensive
|
||||
end
|
||||
@@ -1821,10 +2055,12 @@ atributo_misc.__sub = function (tabela1, tabela2)
|
||||
|
||||
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
|
||||
|
||||
@@ -18,13 +18,15 @@ 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 _newMiscSpell = {
|
||||
|
||||
id = id,
|
||||
counter = 0,
|
||||
targets = container_combatentes:NovoContainer (container_misc_target)
|
||||
}
|
||||
|
||||
if (token == "SPELL_INTERRUPT") then
|
||||
if (token == "BUFF_UPTIME") then
|
||||
_newMiscSpell.uptime = 0
|
||||
_newMiscSpell.actived = false
|
||||
elseif (token == "SPELL_INTERRUPT") then
|
||||
_newMiscSpell.interrompeu_oque = {}
|
||||
elseif (token == "SPELL_DISPEL" or token == "SPELL_STOLEN") then
|
||||
_newMiscSpell.dispell_oque = {}
|
||||
@@ -43,20 +45,52 @@ end
|
||||
|
||||
function habilidade_misc:Add (serial, nome, flag, who_nome, token, spellID, spellName)
|
||||
|
||||
--local alvo = self.targets:PegarCombatente (serial, nome, flag, true)
|
||||
local alvo = self.targets._NameIndexTable [nome]
|
||||
if (not alvo) then
|
||||
alvo = self.targets:PegarCombatente (serial, nome, flag, true)
|
||||
else
|
||||
alvo = self.targets._ActorTable [alvo]
|
||||
end
|
||||
|
||||
alvo.total = alvo.total + 1
|
||||
|
||||
--alvo:AddQuantidade (1)
|
||||
if (spellID == "BUFF") then
|
||||
if (spellName == "COOLDOWN") then
|
||||
self.counter = self.counter + 1
|
||||
|
||||
--alvo
|
||||
local alvo = self.targets._NameIndexTable [nome]
|
||||
if (not alvo) then
|
||||
alvo = self.targets:PegarCombatente (serial, nome, flag, true)
|
||||
else
|
||||
alvo = self.targets._ActorTable [alvo]
|
||||
end
|
||||
alvo.total = alvo.total + 1
|
||||
|
||||
elseif (spellName == "BUFF_UPTIME_IN") then
|
||||
self.actived = true
|
||||
self.actived_at = _detalhes._tempo
|
||||
--print ("in",self.uptime)
|
||||
|
||||
elseif (spellName == "BUFF_UPTIME_REFRESH") then
|
||||
if (self.actived_at and self.actived) then
|
||||
self.uptime = self.uptime + _detalhes._tempo - self.actived_at
|
||||
token.buff_uptime = token.buff_uptime + _detalhes._tempo - self.actived_at --> token = actor misc object
|
||||
|
||||
end
|
||||
self.actived_at = _detalhes._tempo
|
||||
self.actived = true
|
||||
|
||||
if (self.shadow) then
|
||||
return self.shadow:Add (serial, nome, flag, who_nome, token.shadow, spellID, spellName)
|
||||
end
|
||||
--print ("refresh",self.uptime)
|
||||
|
||||
elseif (spellName == "BUFF_UPTIME_OUT") then
|
||||
if (self.actived_at and self.actived) then
|
||||
self.uptime = self.uptime + _detalhes._tempo - self.actived_at
|
||||
token.buff_uptime = token.buff_uptime + _detalhes._tempo - self.actived_at --> token = actor misc object
|
||||
end
|
||||
self.actived = false
|
||||
self.actived_at = nil
|
||||
|
||||
if (self.shadow) then
|
||||
return self.shadow:Add (serial, nome, flag, who_nome, token.shadow, spellID, spellName)
|
||||
end
|
||||
|
||||
--print ("out",self.uptime)
|
||||
end
|
||||
|
||||
elseif (token == "SPELL_INTERRUPT") then
|
||||
@@ -67,6 +101,15 @@ function habilidade_misc:Add (serial, nome, flag, who_nome, token, spellID, spel
|
||||
else
|
||||
self.interrompeu_oque [spellID] = self.interrompeu_oque [spellID] + 1
|
||||
end
|
||||
|
||||
--alvo
|
||||
local alvo = self.targets._NameIndexTable [nome]
|
||||
if (not alvo) then
|
||||
alvo = self.targets:PegarCombatente (serial, nome, flag, true)
|
||||
else
|
||||
alvo = self.targets._ActorTable [alvo]
|
||||
end
|
||||
alvo.total = alvo.total + 1
|
||||
|
||||
elseif (token == "SPELL_RESURRECT") then
|
||||
if (not self.ress) then
|
||||
@@ -75,6 +118,16 @@ function habilidade_misc:Add (serial, nome, flag, who_nome, token, spellID, spel
|
||||
self.ress = self.ress + 1
|
||||
end
|
||||
|
||||
--alvo
|
||||
local alvo = self.targets._NameIndexTable [nome]
|
||||
if (not alvo) then
|
||||
alvo = self.targets:PegarCombatente (serial, nome, flag, true)
|
||||
else
|
||||
alvo = self.targets._ActorTable [alvo]
|
||||
end
|
||||
alvo.total = alvo.total + 1
|
||||
|
||||
|
||||
elseif (token == "SPELL_DISPEL" or token == "SPELL_STOLEN") then
|
||||
if (not self.dispell) then
|
||||
self.dispell = 1
|
||||
@@ -87,6 +140,16 @@ function habilidade_misc:Add (serial, nome, flag, who_nome, token, spellID, spel
|
||||
else
|
||||
self.dispell_oque [spellID] = self.dispell_oque [spellID] + 1
|
||||
end
|
||||
|
||||
--alvo
|
||||
local alvo = self.targets._NameIndexTable [nome]
|
||||
if (not alvo) then
|
||||
alvo = self.targets:PegarCombatente (serial, nome, flag, true)
|
||||
else
|
||||
alvo = self.targets._ActorTable [alvo]
|
||||
end
|
||||
alvo.total = alvo.total + 1
|
||||
|
||||
|
||||
elseif (token == "SPELL_AURA_BROKEN_SPELL" or token == "SPELL_AURA_BROKEN") then
|
||||
|
||||
@@ -101,6 +164,15 @@ function habilidade_misc:Add (serial, nome, flag, who_nome, token, spellID, spel
|
||||
else
|
||||
self.cc_break_oque [spellID] = self.cc_break_oque [spellID] + 1
|
||||
end
|
||||
|
||||
--alvo
|
||||
local alvo = self.targets._NameIndexTable [nome]
|
||||
if (not alvo) then
|
||||
alvo = self.targets:PegarCombatente (serial, nome, flag, true)
|
||||
else
|
||||
alvo = self.targets._ActorTable [alvo]
|
||||
end
|
||||
alvo.total = alvo.total + 1
|
||||
end
|
||||
|
||||
if (self.shadow) then
|
||||
@@ -131,9 +203,14 @@ end
|
||||
|
||||
habilidade_misc.__sub = function (tabela1, tabela2)
|
||||
|
||||
--interrupts
|
||||
--interrupts & cooldowns
|
||||
tabela1.counter = tabela1.counter - tabela2.counter
|
||||
|
||||
--buff uptime
|
||||
if (tabela1.uptime and tabela2.uptime) then
|
||||
tabela1.uptime = tabela1.uptime - tabela2.uptime
|
||||
end
|
||||
|
||||
--ressesrs
|
||||
if (tabela1.ress and tabela2.ress) then
|
||||
tabela1.ress = tabela1.ress - tabela2.ress
|
||||
@@ -148,6 +225,6 @@ habilidade_misc.__sub = function (tabela1, tabela2)
|
||||
if (tabela1.cc_break and tabela2.cc_break) then
|
||||
tabela1.cc_break = tabela1.cc_break - tabela2.cc_break
|
||||
end
|
||||
|
||||
|
||||
return tabela1
|
||||
end
|
||||
|
||||
@@ -138,9 +138,12 @@ local read_flag_ = function (novo_objeto, shadow_objeto, dono_do_pet, serial, fl
|
||||
end
|
||||
end
|
||||
|
||||
if (_bit_band (flag, EM_GRUPO) ~= 0) then --> faz parte do grupo
|
||||
if (_bit_band (flag, EM_GRUPO) ~= 0 and novo_objeto.classe ~= "UNGROUPPLAYER") then --> faz parte do grupo
|
||||
details_flag = details_flag+0x00000100
|
||||
novo_objeto.grupo = true
|
||||
--if (nome:find ("[*]")) then
|
||||
-- print ("Objeto em grupo:", nome, "flag:", flag, "classe:", novo_objeto.classe)
|
||||
--end
|
||||
if (shadow_objeto) then
|
||||
shadow_objeto.grupo = true
|
||||
end
|
||||
|
||||
@@ -47,6 +47,10 @@ function container_pets:PegaDono (pet_serial, pet_nome, pet_flags)
|
||||
end
|
||||
dono_nome = nome
|
||||
|
||||
if (nome:find ("Unknown")) then
|
||||
--print ("owner name with Unknown: ", nome)
|
||||
end
|
||||
|
||||
--print ("Dono encontrado na raide",nome,realm)
|
||||
end
|
||||
end
|
||||
@@ -63,6 +67,7 @@ function container_pets:PegaDono (pet_serial, pet_nome, pet_flags)
|
||||
--print ("tem realm: ", realm)
|
||||
nome = nome.."-"..realm
|
||||
end
|
||||
|
||||
dono_nome = nome
|
||||
--print ("Dono encontrado na party",nome,realm)
|
||||
--print ("DEBUG Dono encontrado na party")
|
||||
@@ -107,12 +112,18 @@ function container_pets:BuscarPets()
|
||||
if (pet_serial) then
|
||||
if (not _detalhes.tabela_pets.pets [pet_serial]) then
|
||||
local nome, realm = _UnitName ("raid"..i)
|
||||
if (realm and realm ~= "") then
|
||||
nome = nome.."-"..realm
|
||||
--print ("tem realm: ", realm, nome)
|
||||
if (nome == "Unknown Entity") then
|
||||
_detalhes:SchedulePetUpdate (1)
|
||||
--print ("unknown owner name, rescheduling...")
|
||||
else
|
||||
if (realm and realm ~= "") then
|
||||
nome = nome.."-"..realm
|
||||
--print ("tem realm: ", realm, nome)
|
||||
end
|
||||
--print ("pet found: ", nome)
|
||||
--print ("bp dono encontrado na raide:",nome, realm)
|
||||
_detalhes.tabela_pets:Adicionar (pet_serial, _UnitName ("raidpet"..i), 2600, _UnitGUID ("raid"..i), nome, 0x514, true)
|
||||
end
|
||||
--print ("bp dono encontrado na raide:",nome, realm)
|
||||
_detalhes.tabela_pets:Adicionar (pet_serial, _UnitName ("raidpet"..i), 2600, _UnitGUID ("raid"..i), nome, 0x514, true)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -122,11 +133,17 @@ function container_pets:BuscarPets()
|
||||
if (pet_serial) then
|
||||
if (not _detalhes.tabela_pets.pets [pet_serial]) then
|
||||
local nome, realm = _UnitName ("party"..i)
|
||||
if (realm and realm ~= "") then
|
||||
nome = nome.."-"..realm
|
||||
if (nome == "Unknown Entity") then
|
||||
_detalhes:SchedulePetUpdate (1)
|
||||
--print ("unknown owner name, rescheduling...")
|
||||
else
|
||||
if (realm and realm ~= "") then
|
||||
nome = nome.."-"..realm
|
||||
end
|
||||
--print ("pet found: ", nome)
|
||||
--print ("bp dono encontrado no grupo:",nome, realm)
|
||||
_detalhes.tabela_pets:Adicionar (pet_serial, _UnitName ("partypet"..i), 2600, _UnitGUID ("party"..i), nome, 0x514)
|
||||
end
|
||||
--print ("bp dono encontrado no grupo:",nome, realm)
|
||||
_detalhes.tabela_pets:Adicionar (pet_serial, _UnitName ("partypet"..i), 2600, _UnitGUID ("party"..i), nome, 0x514)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -148,6 +165,19 @@ function container_pets:Adicionar (pet_serial, pet_nome, pet_flags, dono_serial,
|
||||
|
||||
end
|
||||
|
||||
local have_schedule = false
|
||||
function _detalhes:UpdatePets()
|
||||
have_schedule = false
|
||||
return container_pets:BuscarPets()
|
||||
end
|
||||
function _detalhes:SchedulePetUpdate (seconds)
|
||||
if (have_schedule) then
|
||||
return
|
||||
end
|
||||
have_schedule = true
|
||||
_detalhes:ScheduleTimer ("UpdatePets", seconds or 5)
|
||||
end
|
||||
|
||||
function _detalhes.refresh:r_container_pets (container)
|
||||
_setmetatable (container, container_pets)
|
||||
--container.__index = container_pets
|
||||
|
||||
Reference in New Issue
Block a user