From b7c2b6c7a12abc8d060eedd6e2dd6cee4e0e4bad Mon Sep 17 00:00:00 2001 From: Tercio Jose Date: Sat, 20 Jan 2024 14:28:25 -0300 Subject: [PATCH] Release Candidate 1 --- Libs/LibOpenRaid/GetPlayerInformation.lua | 72 +-- Libs/LibOpenRaid/LibOpenRaid.lua | 52 +- classes/class_damage.lua | 70 ++- classes/class_resources.lua | 548 +++++++++++----------- classes/class_utility.lua | 9 +- core/control.lua | 3 + core/parser.lua | 61 ++- functions/dungeon.lua | 24 +- functions/spec_augmentation.lua | 134 +++++- 9 files changed, 599 insertions(+), 374 deletions(-) diff --git a/Libs/LibOpenRaid/GetPlayerInformation.lua b/Libs/LibOpenRaid/GetPlayerInformation.lua index 174f2c46..b55de1a9 100644 --- a/Libs/LibOpenRaid/GetPlayerInformation.lua +++ b/Libs/LibOpenRaid/GetPlayerInformation.lua @@ -802,50 +802,52 @@ do --make new namespace openRaidLib.AuraTracker = {} - function openRaidLib.AuraTracker.ScanCallback(aura) - local unitId = openRaidLib.AuraTracker.CurrentUnitId - local thisUnitAuras = openRaidLib.AuraTracker.CurrentAuras[unitId] - - local auraInfo = C_UnitAuras.GetAuraDataByAuraInstanceID(unitId, aura.auraInstanceID) - if (auraInfo) then - local spellId = auraInfo.spellId - if (spellId) then - thisUnitAuras[spellId] = true - openRaidLib.AuraTracker.AurasFoundOnScan[spellId] = true + do if (false) then --do not load this section as it isn't in use + function openRaidLib.AuraTracker.ScanCallback(auraInfo) + if (auraInfo) then + local spellId = auraInfo.spellId + if (spellId) then + local unitId = openRaidLib.AuraTracker.CurrentUnitId + local thisUnitAuras = openRaidLib.AuraTracker.CurrentAuras[unitId] + thisUnitAuras[spellId] = true + openRaidLib.AuraTracker.AurasFoundOnScan[spellId] = true + end end end - end - function openRaidLib.AuraTracker.ScanUnitAuras(unitId) - local batchCount = nil - local usePackedAura = true - openRaidLib.AuraTracker.CurrentUnitId = unitId + function openRaidLib.AuraTracker.ScanUnitAuras(unitId) + local maxCount = nil + local bUsePackedAura = true + openRaidLib.AuraTracker.CurrentUnitId = unitId - openRaidLib.AuraTracker.AurasFoundOnScan = {} - AuraUtil.ForEachAura(unitId, "HELPFUL", batchCount, openRaidLib.AuraTracker.ScanCallback, usePackedAura) + openRaidLib.AuraTracker.AurasFoundOnScan = {} - local thisUnitAuras = openRaidLib.AuraTracker.CurrentAuras[unitId] - for spellId in pairs(thisUnitAuras) do - if (not openRaidLib.AuraTracker.AurasFoundOnScan[spellId]) then - --aura removed - openRaidLib.internalCallback.TriggerEvent("unitAuraRemoved", unitId, spellId) + --code of 'ForEachAura' has been updated to use the latest API available + AuraUtil.ForEachAura(unitId, "HELPFUL", maxCount, openRaidLib.AuraTracker.ScanCallback, bUsePackedAura) + + local thisUnitAuras = openRaidLib.AuraTracker.CurrentAuras[unitId] + for spellId in pairs(thisUnitAuras) do + if (not openRaidLib.AuraTracker.AurasFoundOnScan[spellId]) then + --aura removed + openRaidLib.internalCallback.TriggerEvent("unitAuraRemoved", unitId, spellId) + end end end - end - --run when the open raid lib loads - function openRaidLib.AuraTracker.StartScanUnitAuras(unitId) - openRaidLib.AuraTracker.CurrentAuras = { - [unitId] = {} - } + --run when the open raid lib loads + function openRaidLib.AuraTracker.StartScanUnitAuras(unitId) --this function isn't getting called (was called from Entering World event) + openRaidLib.AuraTracker.CurrentAuras = { + [unitId] = {} --storing using the unitId as key, won't work for any other unit other than the "player" + } - local auraFrameEvent = CreateFrame("frame") - auraFrameEvent:RegisterUnitEvent("UNIT_AURA", unitId) + local auraFrameEvent = CreateFrame("frame") + auraFrameEvent:RegisterUnitEvent("UNIT_AURA", unitId) - auraFrameEvent:SetScript("OnEvent", function() - openRaidLib.AuraTracker.ScanUnitAuras(unitId) - end) - end + auraFrameEvent:SetScript("OnEvent", function() + openRaidLib.AuraTracker.ScanUnitAuras(unitId) + end) + end + end end --test case: local debugModule = {} @@ -854,7 +856,6 @@ do --print("aura removed:", unitId, spellId, spellName) end openRaidLib.internalCallback.RegisterCallback("unitAuraRemoved", debugModule.AuraRemoved) - end @@ -899,7 +900,6 @@ do local casterName = Ambiguate(casterString, "none") return openRaidLib.AuraTracker.FindBuffDuration(targetName, casterName, spellId) end - end diff --git a/Libs/LibOpenRaid/LibOpenRaid.lua b/Libs/LibOpenRaid/LibOpenRaid.lua index 3b1cf944..e36cc47a 100644 --- a/Libs/LibOpenRaid/LibOpenRaid.lua +++ b/Libs/LibOpenRaid/LibOpenRaid.lua @@ -43,7 +43,8 @@ if (WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE and not isExpansion_Dragonflight()) t end local major = "LibOpenRaid-1.0" -local CONST_LIB_VERSION = 122 + +local CONST_LIB_VERSION = 124 if (LIB_OPEN_RAID_MAX_VERSION) then if (CONST_LIB_VERSION <= LIB_OPEN_RAID_MAX_VERSION) then @@ -132,6 +133,9 @@ end local CONST_USE_DEFAULT_SCHEDULE_TIME = true + -- Real throttle is 10 messages per 1 second, but we want to be safe due to fact we dont know when it actually resets + local CONST_COMM_BURST_BUFFER_COUNT = 9 + local GetContainerNumSlots = GetContainerNumSlots or C_Container.GetContainerNumSlots local GetContainerItemID = GetContainerItemID or C_Container.GetContainerItemID local GetContainerItemLink = GetContainerItemLink or C_Container.GetContainerItemLink @@ -485,25 +489,33 @@ end ---@field channel string ---@type {}[] - local commScheduler = {} + local commScheduler = {}; + local commBurstBufferCount = CONST_COMM_BURST_BUFFER_COUNT; + local commServerTimeLastThrottleUpdate = GetServerTime(); + do --if there's an old version that already registered the comm ticker, cancel it if (LIB_OPEN_RAID_COMM_SCHEDULER) then - LIB_OPEN_RAID_COMM_SCHEDULER:Cancel() + LIB_OPEN_RAID_COMM_SCHEDULER:Cancel(); end - --make the lib throttle the comms to one per second - local newTickerHandle = C_Timer.NewTicker(1, function() - for i = #commScheduler, 1, -1 do - local commData = commScheduler[i] - if (commData) then - sendData(commData.data, commData.channel) - table.remove(commScheduler, i) - return - end + local newTickerHandle = C_Timer.NewTicker(0.05, function() + local serverTime = GetServerTime(); + + -- Replenish the counter if last server time is not the same as the last throttle update + -- Clamp it to CONST_COMM_BURST_BUFFER_COUNT + commBurstBufferCount = math.min((serverTime ~= commServerTimeLastThrottleUpdate) and commBurstBufferCount + 1 or commBurstBufferCount, CONST_COMM_BURST_BUFFER_COUNT); + commServerTimeLastThrottleUpdate = serverTime; + + -- while (anything in queue) and (throttle allows it) + while(#commScheduler > 0 and commBurstBufferCount > 0) do + -- FIFO queue + local commData = table.remove(commScheduler, 1); + sendData(commData.data, commData.channel); + commBurstBufferCount = commBurstBufferCount - 1; end - end) + end); LIB_OPEN_RAID_COMM_SCHEDULER = newTickerHandle end @@ -531,8 +543,8 @@ end if (bit.band(flags, CONST_COMM_SENDTO_GUILD)) then --send to guild if (IsInGuild()) then - local commData = {data = dataEncoded, channel = "GUILD"} - table.insert(commScheduler, commData) + --Guild has no 10 msg restriction so send it directly + sendData(dataEncoded, "GUILD"); end end else @@ -588,9 +600,9 @@ end end local result, errortext = xpcall(callback, geterrorhandler(), unpack(payload)) - if (not result) then - sendChatMessage("openRaidLib: error on scheduler:", tickerObject.scheduleName, tickerObject.stack) - end + --if (not result) then + -- sendChatMessage("openRaidLib: error on scheduler:", tickerObject.scheduleName, tickerObject.stack) + --end return result end @@ -601,7 +613,7 @@ end local newTimer = C_Timer.NewTimer(time, triggerScheduledTick) newTimer.payload = payload newTimer.callback = callback - newTimer.stack = debugstack() + --newTimer.stack = debugstack() return newTimer end @@ -621,7 +633,7 @@ end local newTimer = openRaidLib.Schedules.NewTimer(time, callback, ...) newTimer.namespace = namespace newTimer.scheduleName = scheduleName - newTimer.stack = debugstack() + --newTimer.stack = debugstack() newTimer.isUnique = true local registeredUniqueTimers = openRaidLib.Schedules.registeredUniqueTimers diff --git a/classes/class_damage.lua b/classes/class_damage.lua index bb81e88d..ac6fd3fb 100644 --- a/classes/class_damage.lua +++ b/classes/class_damage.lua @@ -3481,6 +3481,7 @@ function damageClass.PredictedAugSpellsOnEnter(self) local CONST_SPELLID_EBONMIGHT = 395152 local CONST_SPELLID_PRESCIENCE = 410089 local CONST_SPELLID_BLACKATTUNEMENT = 403264 + local CONST_SPELLID_BLISTERING_SCALES = 360827 ---@type actor[] local augmentationEvokers = {} @@ -3565,7 +3566,7 @@ function damageClass.PredictedAugSpellsOnEnter(self) GameCooltip:AddLine("", "") GameCooltip:AddIcon("", nil, nil, 1, 1) - for i = 1, #augmentationEvokers do + for i = 1, #augmentationEvokers do --black attunement local actorObject = augmentationEvokers[i] if (actorObject:Name() == actorName) then local buffUptimeSpellContainer = actorObject:GetSpellContainer("buff") @@ -3589,6 +3590,26 @@ function damageClass.PredictedAugSpellsOnEnter(self) GameCooltip:AddIcon(spellIcon, nil, nil, iconSize, iconSize, iconBorderInfo.L, iconBorderInfo.R, iconBorderInfo.T, iconBorderInfo.B) end end + + local spellTable = buffUptimeSpellContainer:GetSpell(CONST_SPELLID_BLISTERING_SCALES) + if (spellTable) then + local uptime = spellTable.uptime + local spellName, _, spellIcon = _GetSpellInfo(CONST_SPELLID_BLISTERING_SCALES) + local uptimePercent = uptime / combatTime * 100 + + if (uptime <= combatTime) then + local minutes, seconds = math.floor(uptime / 60), math.floor(uptime % 60) + if (minutes > 0) then + GameCooltip:AddLine(spellName, minutes .. "m " .. seconds .. "s" .. " (" .. format("%.1f", uptimePercent) .. "%)") + Details:AddTooltipBackgroundStatusbar(false, uptimePercent, true, "limegreen") + else + GameCooltip:AddLine(spellName, seconds .. "s" .. " (" .. format("%.1f", uptimePercent) .. "%)") + Details:AddTooltipBackgroundStatusbar(false, uptimePercent, true, "limegreen") + end + + GameCooltip:AddIcon(spellIcon, nil, nil, iconSize, iconSize, iconBorderInfo.L, iconBorderInfo.R, iconBorderInfo.T, iconBorderInfo.B) + end + end end end end @@ -3645,7 +3666,7 @@ function damageClass.PredictedAugSpellsOnEnter(self) if (evokerObject) then GameCooltip:AddLine("Prescience Uptime by Amount of Applications") - local prescienceData = evokerObject.cleu_prescience_time --real time + local prescienceData = evokerObject.cleu_prescience_time if (prescienceData) then prescienceData = prescienceData.stackTime @@ -3667,6 +3688,51 @@ function damageClass.PredictedAugSpellsOnEnter(self) end end end + + --iterate among all the actors and find which one are healers, then get the amount of mana the evoker restored for that healer + ---@type actorcontainer + local resourcesContainer = combatObject:GetContainer(DETAILS_ATTRIBUTE_ENERGY) + local manaRestoredToHealers = {} + + for index, actorObject in resourcesContainer:ListActors() do + if (actorObject.spec == 1473) then --this is an aug evoker + local spellContainer = actorObject:GetSpellContainer("spell") + --local spellContainer = actorObject.spells + if (spellContainer) then + local sourceOfMagic = spellContainer:GetSpell(372571) + if (sourceOfMagic) then + for targetName, restoredAmount in pairs(sourceOfMagic.targets) do + manaRestoredToHealers[#manaRestoredToHealers+1] = {targetName, restoredAmount} + end + end + end + end + end + + if (#manaRestoredToHealers > 0) then + GameCooltip:AddLine(" ") + GameCooltip:AddIcon(" ", 1, 1, 10, 10) + GameCooltip:AddLine("Mana Restored to Healers:") + + table.sort(manaRestoredToHealers, Details.Sort2) + + for i = 1, math.min(10, #manaRestoredToHealers) do + local targetName, restoredAmount = unpack(manaRestoredToHealers[i]) + local targetActorObject = combatObject(DETAILS_ATTRIBUTE_ENERGY, targetName) + + if (targetActorObject) then + local targetClass = targetActorObject:GetActorClass() + local targetName = detailsFramework:AddClassColorToText(targetName, targetClass) + targetName = detailsFramework:AddClassIconToText(targetName, targetName, targetClass) + + GameCooltip:AddLine(targetName, Details:Format(restoredAmount)) + + local spellIcon = GetSpellTexture(372571) + GameCooltip:AddIcon(spellIcon, nil, nil, iconSize, iconSize, iconBorderInfo.L, iconBorderInfo.R, iconBorderInfo.T, iconBorderInfo.B) + Details:AddTooltipBackgroundStatusbar(false, 100, true, "dodgerblue") + end + end + end end GameCooltip:AddLine("feature under test, can't disable atm") diff --git a/classes/class_resources.lua b/classes/class_resources.lua index 4cd0d3f8..afcda3ee 100644 --- a/classes/class_resources.lua +++ b/classes/class_resources.lua @@ -63,11 +63,11 @@ local keyName function atributo_energy:NovaTabela (serial, nome, link) --constructor - + local alphabetical = _detalhes:GetOrderNumber(nome) - + local _new_energyActor = { - + last_event = 0, tipo = class_type, @@ -84,10 +84,10 @@ function atributo_energy:NovaTabela (serial, nome, link) targets = {}, spells = container_habilidades:NovoContainer (container_energy), } - + detailsFramework:Mixin(_new_energyActor, Details222.Mixins.ActorMixin) setmetatable(_new_energyActor, atributo_energy) - + return _new_energyActor end @@ -117,8 +117,8 @@ end function _detalhes:ContainerSortResources (container, amount, keyName2) keyName = keyName2 _table_sort (container, _detalhes.SortKeySimpleResources) - - if (amount) then + + if (amount) then for i = amount, 1, -1 do --de tr�s pra frente if (container[i][keyName] < 1) then amount = amount-1 @@ -126,7 +126,7 @@ function _detalhes:ContainerSortResources (container, amount, keyName2) break end end - + return amount end end @@ -195,37 +195,37 @@ local function RefreshBarraResources (tabela, barra, instancia) end function atributo_energy:AtualizarResources (whichRowLine, colocacao, instancia) - + local esta_barra = instancia.barras [whichRowLine] - + if (not esta_barra) then print("DEBUG: problema com "..whichRowLine.." "..colocacao) return end - + self._refresh_window = RefreshBarraResources - + local tabela_anterior = esta_barra.minha_tabela esta_barra.minha_tabela = self self.minha_barra = whichRowLine esta_barra.colocacao = colocacao - + local total = instancia.showing.totals.resources - + local combat_time = instancia.showing:GetCombatTime() local rps = _math_floor(self.resource / combat_time) - + local formated_resource = SelectedToKFunction (_, self.resource) local formated_rps = _cstr ("%.2f", self.resource / combat_time) - + local porcentagem - + if (instancia.row_info.percent_type == 1) then porcentagem = _cstr ("%.1f", self.resource / total * 100) elseif (instancia.row_info.percent_type == 2) then porcentagem = _cstr ("%.1f", self.resource / instancia.top * 100) end - + local bars_show_data = instancia.row_info.textR_show_data local bars_brackets = instancia:GetBarBracket() local bars_separator = instancia:GetBarSeparator() @@ -241,7 +241,7 @@ function atributo_energy:AtualizarResources (whichRowLine, colocacao, instancia) else porcentagem = porcentagem .. "%" end - + local rightText = formated_resource .. bars_brackets[1] .. formated_rps .. " r/s" .. bars_separator .. porcentagem .. bars_brackets[2] if (UsingCustomRightText) then esta_barra.lineText4:SetText(_string_replace (instancia.row_info.textR_custom_text, formated_resource, formated_rps, porcentagem, self, instancia.showing, instancia, rightText)) @@ -252,16 +252,16 @@ function atributo_energy:AtualizarResources (whichRowLine, colocacao, instancia) esta_barra.lineText4:SetText(rightText) end end - + esta_barra.lineText1:SetText(colocacao .. ". " .. self.nome) esta_barra.lineText1:SetSize(esta_barra:GetWidth() - esta_barra.lineText4:GetStringWidth() - 20, 15) - + esta_barra:SetValue(100) - + if (esta_barra.hidden or esta_barra.fading_in or esta_barra.faded) then Details.FadeHandler.Fader(esta_barra, "out") end - + --texture color actor_class_color_r, actor_class_color_g, actor_class_color_b = self:GetBarColor() self:SetBarColors(esta_barra, instancia, actor_class_color_r, actor_class_color_g, actor_class_color_b) @@ -285,24 +285,24 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex if (#showing._ActorTable < 1) then --n�o h� barras para mostrar return _detalhes:HideBarsNotInUse(instancia, showing), "", 0, 0 end - + local total = 0 instancia.top = 0 - + local sub_atributo = instancia.sub_atributo local conteudo = showing._ActorTable local amount = #conteudo local modo = instancia.modo - - if (sub_atributo == 5) then + + if (sub_atributo == 5) then --showing resources - + keyName = "resource" - + if (modo == modo_ALL) then amount = _detalhes:ContainerSortResources (conteudo, amount, "resource") instancia.top = conteudo[1].resource - + for index, player in ipairs(conteudo) do if (player.resource >= 1) then total = total + player.resource @@ -310,50 +310,50 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex break end end - + elseif (modo == modo_GROUP) then _table_sort (conteudo, _detalhes.SortKeyGroupResources) - + for index, player in ipairs(conteudo) do if (player.grupo) then --� um player e esta em grupo if (player.resource < 1) then --dano menor que 1, interromper o loop amount = index - 1 break end - + total = total + player.resource else amount = index-1 break end end - + instancia.top = conteudo [1].resource end showing:remapear() - if (exportar) then + if (exportar) then return total, keyName, instancia.top, amount end - + if (total < 1) then instancia:EsconderScrollBar() return _detalhes:EndRefresh (instancia, total, tabela_do_combate, showing) end - + tabela_do_combate.totals.resources = total - + instancia:RefreshScrollBar (amount) - + local whichRowLine = 1 local barras_container = instancia.barras - + for i = instancia.barraS[1], instancia.barraS[2], 1 do conteudo[i]:AtualizarResources (whichRowLine, i, instancia) whichRowLine = whichRowLine+1 end - + --beta, hidar barras n�o usadas durante um refresh for�ado if (forcar) then if (instancia.modo == 2) then --group @@ -362,34 +362,34 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex end end end - + return _detalhes:EndRefresh (instancia, total, tabela_do_combate, showing) - + end - + power_type = power_table [sub_atributo] - + keyName = "received" - + if (sub_atributo == 6) then keyName = "alternatepower" end - + if (exportar) then - if (type(exportar) == "boolean") then + if (type(exportar) == "boolean") then --keyName = "received" else keyName = exportar.key - modo = exportar.modo + modo = exportar.modo end else --keyName = "received" end - + if (modo == modo_ALL) then - + _table_sort (conteudo, sort_energyalternate) - + if (keyName == "alternatepower") then for i = amount, 1, -1 do if (conteudo[i].alternatepower < 1) then @@ -398,7 +398,7 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex break end end - + total = tabela_do_combate.totals [class_type] ["alternatepower"] instancia.top = conteudo[1].alternatepower else @@ -411,23 +411,23 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex break end end - + total = tabela_do_combate.totals [class_type] [power_type] instancia.top = conteudo[1].received end - + elseif (modo == modo_GROUP) then if (keyName == "alternatepower") then - + _table_sort (conteudo, sort_alternateenergy_group) - + for index, player in ipairs(conteudo) do if (player.grupo) then if (player.alternatepower < 1) then amount = index - 1 break end - + total = total + player.alternatepower else amount = index-1 @@ -437,9 +437,9 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex instancia.top = conteudo[1].alternatepower else - + _table_sort (conteudo, sort_energy_group) - + for index, player in ipairs(conteudo) do if (player.grupo) then if (player.received < 1) then @@ -449,7 +449,7 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex amount = index - 1 break end - + total = total + player.received else amount = index-1 @@ -462,10 +462,10 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex showing:remapear() - if (exportar) then + if (exportar) then return total, keyName, instancia.top, amount end - + if (amount < 1) then --n�o h� barras para mostrar instancia:EsconderScrollBar() return _detalhes:EndRefresh (instancia, total, tabela_do_combate, showing) --retorna a tabela que precisa ganhar o refresh @@ -480,16 +480,16 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex local bars_brackets = instancia:GetBarBracket() local bars_separator = instancia:GetBarSeparator() local baseframe = instancia.baseframe - + local use_animations = _detalhes.is_using_row_animations and (not baseframe.isStretching and not forcar and not baseframe.isResizing) - + if (total == 0) then total = 0.00000001 end local myPos local following = instancia.following.enabled - + if (following) then if (using_cache) then local pname = _detalhes.playername @@ -503,30 +503,30 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex myPos = showing._NameIndexTable [_detalhes.playername] end end - + local combat_time = instancia.showing:GetCombatTime() UsingCustomLeftText = instancia.row_info.textL_enable_custom_text UsingCustomRightText = instancia.row_info.textR_enable_custom_text - + local use_total_bar = false if (instancia.total_bar.enabled) then use_total_bar = true - + if (instancia.total_bar.only_in_group and (not IsInGroup() and not IsInRaid())) then use_total_bar = false end end - + if (instancia.bars_sort_direction == 1) then --top to bottom - + if (use_total_bar and instancia.barraS[1] == 1) then - + whichRowLine = 2 local iter_last = instancia.barraS[2] if (iter_last == instancia.rows_fit_in_window) then iter_last = iter_last - 1 end - + local row1 = barras_container [1] row1.minha_tabela = nil row1.lineText1:SetText(Loc ["STRING_TOTAL"]) @@ -535,22 +535,22 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex else row1.lineText4:SetText(_detalhes:ToK2 (total) .. " (" .. _detalhes:ToK (total / combat_time) .. ")") end - + row1:SetValue(100) local r, g, b = unpack(instancia.total_bar.color) row1.textura:SetVertexColor(r, g, b) - + row1.icone_classe:SetTexture(instancia.total_bar.icon) row1.icone_classe:SetTexCoord(0.0625, 0.9375, 0.0625, 0.9375) - + Details.FadeHandler.Fader(row1, "out") - + if (following and myPos and myPos+1 > instancia.rows_fit_in_window and instancia.barraS[2] < myPos+1) then for i = instancia.barraS[1], iter_last-1, 1 do --vai atualizar s� o range que esta sendo mostrado conteudo[i]:RefreshLine(instancia, barras_container, whichRowLine, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --inst�ncia, index, total, valor da 1� barra whichRowLine = whichRowLine+1 end - + conteudo[myPos]:RefreshLine(instancia, barras_container, whichRowLine, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --inst�ncia, index, total, valor da 1� barra whichRowLine = whichRowLine+1 else @@ -566,7 +566,7 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex conteudo[i]:RefreshLine(instancia, barras_container, whichRowLine, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --inst�ncia, index, total, valor da 1� barra whichRowLine = whichRowLine+1 end - + conteudo[myPos]:RefreshLine(instancia, barras_container, whichRowLine, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --inst�ncia, index, total, valor da 1� barra whichRowLine = whichRowLine+1 else @@ -576,36 +576,36 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex end end end - + elseif (instancia.bars_sort_direction == 2) then --bottom to top - + if (use_total_bar and instancia.barraS[1] == 1) then - + whichRowLine = 2 local iter_last = instancia.barraS[2] if (iter_last == instancia.rows_fit_in_window) then iter_last = iter_last - 1 end - + local row1 = barras_container [1] row1.minha_tabela = nil row1.lineText1:SetText(Loc ["STRING_TOTAL"]) - + if (instancia.use_multi_fontstrings) then instancia:SetInLineTexts(row1, "", _detalhes:ToK2 (total), _detalhes:ToK (total / combat_time)) else row1.lineText4:SetText(_detalhes:ToK2 (total) .. " (" .. _detalhes:ToK (total / combat_time) .. ")") end - + row1:SetValue(100) local r, g, b = unpack(instancia.total_bar.color) row1.textura:SetVertexColor(r, g, b) - + row1.icone_classe:SetTexture(instancia.total_bar.icon) row1.icone_classe:SetTexCoord(0.0625, 0.9375, 0.0625, 0.9375) - + Details.FadeHandler.Fader(row1, "out") - + if (following and myPos and myPos+1 > instancia.rows_fit_in_window and instancia.barraS[2] < myPos+1) then conteudo[myPos]:RefreshLine(instancia, barras_container, whichRowLine, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --inst�ncia, index, total, valor da 1� barra whichRowLine = whichRowLine+1 @@ -634,13 +634,13 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex end end end - + end - + if (use_animations) then instancia:PerformAnimations (whichRowLine-1) end - + if (forcar) then if (instancia.modo == 2) then --group for i = whichRowLine, instancia.rows_fit_in_window do @@ -656,22 +656,22 @@ end function atributo_energy:RefreshLine(instancia, barras_container, whichRowLine, lugar, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) local esta_barra = instancia.barras[whichRowLine] --pega a refer�ncia da barra na janela - + if (not esta_barra) then print("DEBUG: problema com "..whichRowLine.." "..lugar) return end - + local tabela_anterior = esta_barra.minha_tabela - + esta_barra.minha_tabela = self esta_barra.colocacao = lugar - + self.minha_barra = esta_barra self.colocacao = lugar local esta_e_energy_total = self [keyName] --total de dano que este jogador deu - + -- local porcentagem = esta_e_energy_total / total * 100 local porcentagem if (percentage_type == 1) then @@ -692,7 +692,7 @@ function atributo_energy:RefreshLine(instancia, barras_container, whichRowLine, else porcentagem = porcentagem .. "%" end - + local rightText = formated_energy .. bars_brackets[1] .. porcentagem .. bars_brackets[2] if (UsingCustomRightText) then esta_barra.lineText4:SetText(_string_replace (instancia.row_info.textR_custom_text, formated_energy, "", porcentagem, self, instancia.showing, instancia, rightText)) @@ -703,27 +703,27 @@ function atributo_energy:RefreshLine(instancia, barras_container, whichRowLine, esta_barra.lineText4:SetText(rightText) end end - + if (esta_barra.mouse_over and not instancia.baseframe.isMoving) then --precisa atualizar o tooltip gump:UpdateTooltip (whichRowLine, esta_barra, instancia) end actor_class_color_r, actor_class_color_g, actor_class_color_b = self:GetBarColor() - + return self:RefreshBarra2 (esta_barra, instancia, tabela_anterior, forcar, esta_porcentagem, whichRowLine, barras_container, use_animations) end function atributo_energy:RefreshBarra2 (esta_barra, instancia, tabela_anterior, forcar, esta_porcentagem, whichRowLine, barras_container, use_animations) - + --primeiro colocado if (esta_barra.colocacao == 1) then if (not tabela_anterior or tabela_anterior ~= esta_barra.minha_tabela or forcar) then esta_barra:SetValue(100) - + if (esta_barra.hidden or esta_barra.fading_in or esta_barra.faded) then Details.FadeHandler.Fader(esta_barra, "out") end - + return self:RefreshBarra(esta_barra, instancia) else return @@ -731,40 +731,40 @@ function atributo_energy:RefreshBarra2 (esta_barra, instancia, tabela_anterior, else if (esta_barra.hidden or esta_barra.fading_in or esta_barra.faded) then - + if (use_animations) then esta_barra.animacao_fim = esta_porcentagem else esta_barra:SetValue(esta_porcentagem) esta_barra.animacao_ignorar = true end - + Details.FadeHandler.Fader(esta_barra, "out") - + if (instancia.row_info.texture_class_colors) then esta_barra.textura:SetVertexColor(actor_class_color_r, actor_class_color_g, actor_class_color_b) end if (instancia.row_info.texture_background_class_color) then esta_barra.background:SetVertexColor(actor_class_color_r, actor_class_color_g, actor_class_color_b) end - + return self:RefreshBarra(esta_barra, instancia) - + else --agora esta comparando se a tabela da barra � diferente da tabela na atualiza��o anterior if (not tabela_anterior or tabela_anterior ~= esta_barra.minha_tabela or forcar) then --aqui diz se a barra do jogador mudou de posi��o ou se ela apenas ser� atualizada - + if (use_animations) then esta_barra.animacao_fim = esta_porcentagem else esta_barra:SetValue(esta_porcentagem) esta_barra.animacao_ignorar = true end - + esta_barra.last_value = esta_porcentagem --reseta o ultimo valor da barra - + return self:RefreshBarra(esta_barra, instancia) - + elseif (esta_porcentagem ~= esta_barra.last_value) then --continua mostrando a mesma tabela ent�o compara a porcentagem --apenas atualizar if (use_animations) then @@ -773,23 +773,23 @@ function atributo_energy:RefreshBarra2 (esta_barra, instancia, tabela_anterior, esta_barra:SetValue(esta_porcentagem) end esta_barra.last_value = esta_porcentagem - + return self:RefreshBarra(esta_barra, instancia) end end end - + end function atributo_energy:RefreshBarra(esta_barra, instancia, from_resize) - + local class, enemy, arena_enemy, arena_ally = self.classe, self.enemy, self.arena_enemy, self.arena_ally - + if (from_resize) then actor_class_color_r, actor_class_color_g, actor_class_color_b = self:GetBarColor() end - + --icon self:SetClassIcon (esta_barra.icone_classe, instancia, class) @@ -803,9 +803,9 @@ function atributo_energy:RefreshBarra(esta_barra, instancia, from_resize) self:SetBarColors(esta_barra, instancia, actor_class_color_r, actor_class_color_g, actor_class_color_b) --left text self:SetBarLeftText (esta_barra, instancia, enemy, arena_enemy, arena_ally, UsingCustomLeftText) - + esta_barra.lineText1:SetSize(esta_barra:GetWidth() - esta_barra.lineText4:GetStringWidth() - 20, 15) - + end --------------------------------------------- // TOOLTIPS // --------------------------------------------- @@ -821,20 +821,20 @@ local resource_bg_coords = {.6, 0.1, 0, 0.64453125} function atributo_energy:ToolTip (instancia, numero, barra, keydown) if (instancia.sub_atributo <= 4) then return self:ToolTipRegenRecebido (instancia, numero, barra, keydown) - + elseif (instancia.sub_atributo == 5) then --resources local resource_string = _detalhes.resource_strings [self.resource_type] if (resource_string) then local icon = _detalhes.resource_icons [self.resource_type] - + GameCooltip:AddLine(resource_string, floor(self.resource) .. " (" .. _cstr ("%.2f", self.resource / instancia.showing:GetCombatTime()) .. " per second)", 1, "white") GameCooltip:AddIcon (icon.file, 1, 1, 16, 16, unpack(icon.coords)) GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], resource_bg_coords, resource_bg_color, true) - + return true end - + end end @@ -850,35 +850,35 @@ local reset_tooltips_table = function() local t = energy_tooltips_table [i] t[1], t[2], t[3] = "", 0, "" end - + for k, v in pairs(energy_tooltips_hash) do energy_tooltips_hash [k] = nil end end function atributo_energy:ToolTipRegenRecebido (instancia, numero, barra, keydown) - + reset_tooltips_table() - + 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 powertype = self.powertype local tabela_do_combate = instancia.showing - local container = tabela_do_combate [class_type] + local container = tabela_do_combate [class_type] local total_regenerado = self.received local name = self.nome - + --spells: local i = 1 - + for index, actor in ipairs(container._ActorTable) do if (actor.powertype == powertype) then - + for spellid, spell in pairs(actor.spells._ActorTable) do local on_self = spell.targets [name] if (on_self) then @@ -898,15 +898,15 @@ function atributo_energy:ToolTipRegenRecebido (instancia, numero, barra, keydown end end end - + end end - + i = i - 1 _table_sort (energy_tooltips_table, _detalhes.Sort2) - + _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_SPELLS"], headerColor, i, [[Interface\HELPFRAME\ReportLagIcon-Spells]], 0.21875, 0.78125, 0.21875, 0.78125) - + local ismaximized = false if (keydown == "shift" or TooltipMaximizedMethod == 2 or TooltipMaximizedMethod == 3) then GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_shift]], 1, 2, _detalhes.tooltip_key_size_width, _detalhes.tooltip_key_size_height, 0, 1, 0, 0.640625, _detalhes.tooltip_key_overlay2) @@ -916,32 +916,32 @@ function atributo_energy:ToolTipRegenRecebido (instancia, numero, barra, keydown GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_shift]], 1, 2, _detalhes.tooltip_key_size_width, _detalhes.tooltip_key_size_height, 0, 1, 0, 0.640625, _detalhes.tooltip_key_overlay1) _detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha) end - + local max = i if (max > 3) then max = 3 end - + if (ismaximized) then max = 99 end local icon_size = _detalhes.tooltip.icon_size - local icon_border = _detalhes.tooltip.icon_border_texcoord - + local icon_border = _detalhes.tooltip.icon_border_texcoord + for o = 1, math.min (i, max) do local spell = energy_tooltips_table [o] - + if (spell [2] < 1) then break end - + local nome_magia, _, icone_magia = _GetSpellInfo(spell [1]) GameCooltip:AddLine(nome_magia, FormatTooltipNumber (_, spell [2]).." (".._cstr("%.1f", (spell [2]/total_regenerado) * 100).."%)") GameCooltip:AddIcon (icone_magia, nil, nil, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) _detalhes:AddTooltipBackgroundStatusbar (false, spell [2] / energy_tooltips_table [1][2] * 100) end - + --players reset_tooltips_table() i = 1 @@ -959,15 +959,15 @@ function atributo_energy:ToolTipRegenRecebido (instancia, numero, barra, keydown t[1], t[2], t[3] = actor.nome, on_self, actor.classe i = i + 1 end - + end end - + i = i - 1 _table_sort (energy_tooltips_table, _detalhes.Sort2) - + _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_PLAYERS"], headerColor, i, [[Interface\HELPFRAME\HelpIcon-HotIssues]], 0.21875, 0.78125, 0.21875, 0.78125) - + local ismaximized = false if (keydown == "ctrl" or TooltipMaximizedMethod == 2 or TooltipMaximizedMethod == 4) then GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_ctrl]], 1, 2, _detalhes.tooltip_key_size_width, _detalhes.tooltip_key_size_height, 0, 1, 0, 0.640625, _detalhes.tooltip_key_overlay2) @@ -977,27 +977,27 @@ function atributo_energy:ToolTipRegenRecebido (instancia, numero, barra, keydown GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_ctrl]], 1, 2, _detalhes.tooltip_key_size_width, _detalhes.tooltip_key_size_height, 0, 1, 0, 0.640625, _detalhes.tooltip_key_overlay1) _detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha) end - + max = i if (max > 3) then max = 3 end - + if (ismaximized) then max = 99 end - + for o = 1, math.min (i, max) do - + local source = energy_tooltips_table [o] - + if (source [2] < 1) then break end - + GameCooltip:AddLine(source [1], FormatTooltipNumber (_, source [2]).." (".._cstr("%.1f", (source [2] / total_regenerado) * 100).."%)") _detalhes:AddTooltipBackgroundStatusbar() - + local classe = source [3] if (not classe) then classe = "UNKNOW" @@ -1007,7 +1007,7 @@ function atributo_energy:ToolTipRegenRecebido (instancia, numero, barra, keydown else GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\classes_small", nil, nil, icon_size.W, icon_size.H, _unpack(_detalhes.class_coords [classe])) end - + end --player generators @@ -1019,10 +1019,10 @@ function atributo_energy:ToolTipRegenRecebido (instancia, numero, barra, keydown end table.sort (allGeneratorSpells, _detalhes.Sort2) - + _detalhes:AddTooltipSpellHeaderText (self.nome .. " Generators", headerColor, #allGeneratorSpells, [[Interface\HELPFRAME\HelpIcon-HotIssues]], 0.21875, 0.78125, 0.21875, 0.78125) _detalhes:AddTooltipHeaderStatusbar (r, g, b, 1) - + for i = 1, #allGeneratorSpells do local thisGenerator = allGeneratorSpells [i] local spellName, _, spellIcon = GetSpellInfo(thisGenerator[1].id) @@ -1030,15 +1030,15 @@ function atributo_energy:ToolTipRegenRecebido (instancia, numero, barra, keydown GameCooltip:AddIcon (spellIcon, nil, nil, icon_size.W, icon_size.H, .1, .9, .1, .9) _detalhes:AddTooltipBackgroundStatusbar() end - + --auto regen overflow _detalhes:AddTooltipSpellHeaderText (self.nome .. " Auto Regen Overflow", headerColor, 1, [[Interface\CHARACTERFRAME\Disconnect-Icon]], 0.3, 0.7, 0.3, 0.7) _detalhes:AddTooltipHeaderStatusbar (r, g, b, 1) - + GameCooltip:AddLine("Auto Regen Overflow", FormatTooltipNumber (_, self.passiveover) .. " ( " .. _cstr ("%.1f", self.passiveover / (self.passiveover + self.total) * 100) .. "%)") GameCooltip:AddIcon ([[Interface\COMMON\Indicator-Red]], nil, nil, icon_size.W, icon_size.H) _detalhes:AddTooltipBackgroundStatusbar() - + return true end @@ -1067,19 +1067,19 @@ function atributo_energy:MontaInfoRegenRecebido() local barras = breakdownWindowFrame.barras1 local barras2 = breakdownWindowFrame.barras2 local barras3 = breakdownWindowFrame.barras3 - + local instancia = breakdownWindowFrame.instancia local tabela_do_combate = instancia.showing - local container = tabela_do_combate [class_type] - + local container = tabela_do_combate [class_type] + local total_regenerado = self.received local my_name = self.nome local powertype = self.powertype - + --spells: local i = 1 - + for index, actor in ipairs(container._ActorTable) do if (actor.powertype == powertype) then @@ -1103,29 +1103,29 @@ function atributo_energy:MontaInfoRegenRecebido() end end end - + end end - + i = i - 1 _table_sort (energy_tooltips_table, _detalhes.Sort2) - - + + local amt = i - + if (amt < 1) then return true end - + gump:JI_AtualizaContainerBarras (amt) local max_ = energy_tooltips_table [1][2] - + for index, tabela in ipairs(energy_tooltips_table) do - + if (tabela [2] < 1) then break end - + local barra = barras [index] if (not barra) then @@ -1135,10 +1135,10 @@ function atributo_energy:MontaInfoRegenRecebido() end self:FocusLock(barra, tabela[1]) - + local spellname, _, spellicon = _GetSpellInfo(tabela [1]) local percent = tabela [2] / total_regenerado * 100 - + self:UpdadeInfoBar(barra, index, tabela[1], spellname, tabela[2], _detalhes:comma_value (tabela[2]), max_, percent, spellicon, true) barra.minha_tabela = self @@ -1148,9 +1148,9 @@ function atributo_energy:MontaInfoRegenRecebido() if (self.detalhes and self.detalhes == barra.show) then self:MontaDetalhes (self.detalhes, barra) end - + end - + --players: reset_tooltips_table() @@ -1169,82 +1169,82 @@ function atributo_energy:MontaInfoRegenRecebido() t[1], t[2], t[3] = actor.nome, on_self, actor.classe i = i + 1 end - + end end - + i = i - 1 _table_sort (energy_tooltips_table, _detalhes.Sort2) - + local amt_fontes = i gump:JI_AtualizaContainerAlvos (amt_fontes) - + local max_fontes = energy_tooltips_table[1][2] - + local barra for index, tabela in ipairs(energy_tooltips_table) do - + if (tabela [2] < 1) then break end - + barra = breakdownWindowFrame.barras2 [index] - + if (not barra) then barra = gump:CriaNovaBarraInfo2 (instancia, index) barra.textura:SetStatusBarColor(1, 1, 1, 1) end - + if (index == 1) then barra.textura:SetValue(100) else barra.textura:SetValue(tabela[2]/max_fontes*100) end - + barra.lineText1:SetText(index..instancia.divisores.colocacao..tabela[1]) barra.lineText4:SetText(_detalhes:comma_value (tabela[2]) .. " (" .. _cstr("%.1f", tabela[2]/total_regenerado * 100) .. ")") - + if (barra.mouse_over) then --atualizar o tooltip if (barra.isAlvo) then - GameTooltip:Hide() + GameTooltip:Hide() GameTooltip:SetOwner(barra, "ANCHOR_TOPRIGHT") if (not barra.minha_tabela:MontaTooltipAlvos (barra, index)) then return end GameTooltip:Show() end - end + end barra.minha_tabela = self - + --print("nome_inimigo = ", tabela [1]) barra.nome_inimigo = tabela [1] barra:Show() - end + end end function atributo_energy:MontaDetalhesRegenRecebido (nome, barra) - + reset_tooltips_table() - + local barras = breakdownWindowFrame.barras3 local instancia = breakdownWindowFrame.instancia local tabela_do_combate = breakdownWindowFrame.instancia.showing local container = tabela_do_combate [class_type] - + local total_regenerado = self.received - + local spellid = nome local who_name = self.nome - + --who is regenerating with the spell -> nome - + --spells: local i = 1 - + for index, actor in ipairs(container._ActorTable) do if (actor.powertype == powertype) then local spell = actor.spells._ActorTable [spellid] @@ -1262,27 +1262,27 @@ function atributo_energy:MontaDetalhesRegenRecebido (nome, barra) end end end - + i = i - 1 - + if (i < 1) then return end - + _table_sort (energy_tooltips_table, _detalhes.Sort2) local max_ = energy_tooltips_table [1][2] - + local lastIndex = 1 local barra for index, tabela in ipairs(from) do - + if (tabela [2] < 1) then break end lastIndex = index - + barra = barras [index] if (not barra) then --se a barra n�o existir, criar ela ent�o @@ -1291,7 +1291,7 @@ function atributo_energy:MontaDetalhesRegenRecebido (nome, barra) end barra.show = tabela[1] - + if (index == 1) then barra.textura:SetValue(100) else @@ -1300,15 +1300,15 @@ function atributo_energy:MontaDetalhesRegenRecebido (nome, barra) barra.lineText1:SetText(index .. "." .. tabela [1]) barra.lineText4:SetText(_detalhes:comma_value (tabela[2]) .." (" .. _cstr("%.1f", tabela[2] / total_regenerado * 100) .."%)") - + barra.textura:SetStatusBarColor(_unpack(_detalhes.class_colors [tabela[3]])) barra.icone:SetTexture("Interface\\AddOns\\Details\\images\\classes_small") - + barra.icone:SetTexCoord(_unpack(_detalhes.class_coords [tabela[3]])) barra:Show() --mostra a barra - - if (index == 15) then + + if (index == 15) then break end end @@ -1323,23 +1323,23 @@ function atributo_energy:MontaTooltipAlvos (esta_barra, index) local instancia = breakdownWindowFrame.instancia local tabela_do_combate = instancia.showing - local container = tabela_do_combate [class_type] - + local container = tabela_do_combate [class_type] + local total_regenerado = self.received local my_name = self.nome - + reset_tooltips_table() - + -- actor nome - + local actor = container._ActorTable [container._NameIndexTable [esta_barra.nome_inimigo]] - + --print("Mouse Over", actor, esta_barra.nome_inimigo, self.tipo) - + if (actor) then --spells: local i = 1 - + for spellid, spell in pairs(actor.spells._ActorTable) do local on_self = spell.targets [my_name] if (on_self) then @@ -1352,23 +1352,23 @@ function atributo_energy:MontaTooltipAlvos (esta_barra, index) i = i + 1 end end - + i = i - 1 _table_sort (energy_tooltips_table, _detalhes.Sort2) - + --print(i, #energy_tooltips_table) - + for index, spell in ipairs(energy_tooltips_table) do if (spell [2] < 1) then break end - + local spellname, _, spellicon = _GetSpellInfo(spell [1]) GameTooltip:AddDoubleLine(spellname .. ": ", _detalhes:comma_value (spell [2]) .. " (" .. _cstr ("%.1f", (spell [2] / total_regenerado) * 100).."%)", 1, 1, 1, 1, 1, 1) GameTooltip:AddTexture(spellicon) end end - + return true end @@ -1404,24 +1404,24 @@ end --print("add total:", combat_table.totals [class_type] [self.powertype], self.total) if (self.powertype and combat_table.totals [class_type] [self.powertype]) then combat_table.totals [class_type] [self.powertype] = combat_table.totals [class_type] [self.powertype] + self.total - + if (self.grupo) then combat_table.totals_grupo [class_type] [self.powertype] = combat_table.totals_grupo [class_type] [self.powertype] + self.total end end end - + --restaura e liga o ator com a sua shadow durante a inicializa��o - + function atributo_energy:r_onlyrefresh_shadow (actor) - + --criar uma shadow desse ator se ainda n�o tiver uma local overall_energy = _detalhes.tabela_overall [3] local shadow = overall_energy._ActorTable [overall_energy._NameIndexTable [actor.nome]] - if (not shadow) then + if (not shadow) then shadow = overall_energy:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true) - + shadow.classe = actor.classe shadow:SetSpecId(actor.spec) shadow.grupo = actor.grupo @@ -1430,46 +1430,46 @@ end shadow.boss = actor.boss shadow.boss_fight_component = actor.boss_fight_component shadow.fight_component = actor.fight_component - + end - + --restaura a meta e indexes ao ator _detalhes.refresh:r_atributo_energy (actor, shadow) shadow.powertype = actor.powertype - + if (actor.resource) then shadow.resource = (shadow.resource or 0) + actor.resource shadow.resource_type = actor.resource_type end - + --targets - for target_name, amount in pairs(actor.targets) do + for target_name, amount in pairs(actor.targets) do shadow.targets [target_name] = 0 end - + --spells - for spellid, habilidade in pairs(actor.spells._ActorTable) do + for spellid, habilidade in pairs(actor.spells._ActorTable) do local habilidade_shadow = shadow.spells:PegaHabilidade (spellid, true, "SPELL_ENERGY", false) --spell targets - for target_name, amount in pairs(habilidade.targets) do + for target_name, amount in pairs(habilidade.targets) do habilidade_shadow.targets [target_name] = 0 end end return shadow end - + function atributo_energy:r_connect_shadow (actor, no_refresh, combat_object) - + local host_combat = combat_object or _detalhes.tabela_overall - + --criar uma shadow desse ator se ainda n�o tiver uma local overall_energy = host_combat [3] local shadow = overall_energy._ActorTable [overall_energy._NameIndexTable [actor.nome]] - if (not shadow) then + if (not shadow) then shadow = overall_energy:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true) - + shadow.classe = actor.classe shadow:SetSpecId(actor.spec) shadow.grupo = actor.grupo @@ -1478,58 +1478,58 @@ end shadow.boss = actor.boss shadow.boss_fight_component = actor.boss_fight_component shadow.fight_component = actor.fight_component - + end - + --restaura a meta e indexes ao ator if (not no_refresh) then _detalhes.refresh:r_atributo_energy (actor, shadow) end - + --pets (add unique pet names) for _, petName in ipairs(actor.pets) do DetailsFramework.table.addunique (shadow.pets, petName) end - + --total das energias (captura de dados) shadow.total = shadow.total + actor.total shadow.received = shadow.received + actor.received shadow.alternatepower = shadow.alternatepower + actor.alternatepower - + if (not actor.powertype) then --print("actor without powertype", actor.nome, actor.powertype) actor.powertype = 1 end - + shadow.powertype = actor.powertype - + if (actor.resource) then shadow.resource = (shadow.resource or 0) + actor.resource shadow.resource_type = actor.resource_type end - + --total no combate overall (captura de dados) host_combat.totals[3] [actor.powertype] = host_combat.totals[3] [actor.powertype] + actor.total - + if (actor.grupo) then host_combat.totals_grupo[3][actor.powertype] = host_combat.totals_grupo[3][actor.powertype] + actor.total end --targets - for target_name, amount in pairs(actor.targets) do + for target_name, amount in pairs(actor.targets) do shadow.targets [target_name] = (shadow.targets [target_name] or 0) + amount end - + --spells - for spellid, habilidade in pairs(actor.spells._ActorTable) do + for spellid, habilidade in pairs(actor.spells._ActorTable) do local habilidade_shadow = shadow.spells:PegaHabilidade (spellid, true, "SPELL_ENERGY", false) - + habilidade_shadow.total = habilidade_shadow.total + habilidade.total habilidade_shadow.counter = habilidade_shadow.counter + habilidade.counter - + --spell targets - for target_name, amount in pairs(habilidade.targets) do + for target_name, amount in pairs(habilidade.targets) do habilidade_shadow.targets [target_name] = (habilidade_shadow.targets [target_name] or 0) + amount end @@ -1554,7 +1554,7 @@ function _detalhes.clear:c_atributo_energy (este_jogador) este_jogador.__index = nil este_jogador.links = nil este_jogador.minha_barra = nil - + _detalhes.clear:c_container_habilidades (este_jogador.spells) end @@ -1563,7 +1563,7 @@ atributo_energy.__add = function(tabela1, tabela2) if (not tabela1.powertype) then tabela1.powertype = tabela2.powertype end - + if (tabela1.resource) then tabela1.resource = tabela1.resource + (tabela2.resource or 0) end @@ -1572,27 +1572,27 @@ atributo_energy.__add = function(tabela1, tabela2) tabela1.total = tabela1.total + tabela2.total tabela1.received = tabela1.received + tabela2.received tabela1.alternatepower = tabela1.alternatepower + tabela2.alternatepower - + --targets - for target_name, amount in pairs(tabela2.targets) do + for target_name, amount in pairs(tabela2.targets) do tabela1.targets [target_name] = (tabela1.targets [target_name] or 0) + amount end - + --spells - for spellid, habilidade in pairs(tabela2.spells._ActorTable) do + for spellid, habilidade in pairs(tabela2.spells._ActorTable) do local habilidade_tabela1 = tabela1.spells:PegaHabilidade (spellid, true, "SPELL_ENERGY", false) - + habilidade_tabela1.total = habilidade_tabela1.total + habilidade.total habilidade_tabela1.counter = habilidade_tabela1.counter + habilidade.counter - + --spell targets - for target_name, amount in pairs(habilidade.targets) do + for target_name, amount in pairs(habilidade.targets) do habilidade_tabela1.targets [target_name] = (habilidade_tabela1.targets [target_name] or 0) + amount end end - + return tabela1 end @@ -1601,7 +1601,7 @@ atributo_energy.__sub = function(tabela1, tabela2) if (not tabela1.powertype) then tabela1.powertype = tabela2.powertype end - + if (tabela1.resource) then tabela1.resource = tabela1.resource - (tabela2.resource or 0) end @@ -1610,24 +1610,24 @@ atributo_energy.__sub = function(tabela1, tabela2) tabela1.total = tabela1.total - tabela2.total tabela1.received = tabela1.received - tabela2.received tabela1.alternatepower = tabela1.alternatepower - tabela2.alternatepower - + --targets - for target_name, amount in pairs(tabela2.targets) do + for target_name, amount in pairs(tabela2.targets) do if (tabela1.targets [target_name]) then tabela1.targets [target_name] = tabela1.targets [target_name] - amount end end - + --spells - for spellid, habilidade in pairs(tabela2.spells._ActorTable) do + for spellid, habilidade in pairs(tabela2.spells._ActorTable) do local habilidade_tabela1 = tabela1.spells:PegaHabilidade (spellid, true, "SPELL_ENERGY", false) - + habilidade_tabela1.total = habilidade_tabela1.total - habilidade.total habilidade_tabela1.counter = habilidade_tabela1.counter - habilidade.counter - + --spell targets - for target_name, amount in pairs(habilidade.targets) do + for target_name, amount in pairs(habilidade.targets) do if (habilidade_tabela1.targets [target_name]) then habilidade_tabela1.targets [target_name] = habilidade_tabela1.targets [target_name] - amount end diff --git a/classes/class_utility.lua b/classes/class_utility.lua index d36ed427..c1cb187b 100644 --- a/classes/class_utility.lua +++ b/classes/class_utility.lua @@ -1535,8 +1535,9 @@ function _detalhes:CatchRaidBuffUptime(sOperationType) if (auraName) then if (UnitExists(unitCaster)) then local bBuffIsPlacedOnTarget = Details.CreditBuffToTarget[spellId] - if (UnitIsUnit(unitCaster, unitId) or bBuffIsPlacedOnTarget) then - if (bBuffIsPlacedOnTarget and not UnitIsUnit(unitCaster, unitId)) then + local bUnitIsTheCaster = UnitIsUnit(unitCaster, unitId) + if (bUnitIsTheCaster or bBuffIsPlacedOnTarget) then + if (bBuffIsPlacedOnTarget and not bUnitIsTheCaster) then --could be prescince, ebom might or power infusion; casted on a target instead of the caster local sourceSerial = UnitGUID(unitCaster) local sourceName = Details:GetFullName(unitCaster) @@ -1546,9 +1547,9 @@ function _detalhes:CatchRaidBuffUptime(sOperationType) local targetFlags = 0x514 local targetFlags2 = 0x0 local spellName = auraName - --print(targetName, "already had", spellName, "at first of a combat") Details.parser:buff("SPELL_AURA_APPLIED", time(), sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, 0x4, "BUFF", 0) - else + + elseif (bUnitIsTheCaster) then local playerGUID = UnitGUID(unitId) if (playerGUID) then local playerName = Details:GetFullName(unitId) diff --git a/core/control.lua b/core/control.lua index f68caaa7..a61ccb54 100644 --- a/core/control.lua +++ b/core/control.lua @@ -297,6 +297,7 @@ Details:Msg("(debug) |cFFFFFF00started a new combat|r|cFFFF7700", Details.encounter_table and Details.encounter_table.name or "") --local from = debugstack(2, 1, 0) --print("from:", from) + DetailsParserDebugFrame:Show() end local segmentsTable = Details:GetCombatSegments() @@ -474,6 +475,8 @@ function Details:SairDoCombate(bossKilled, bIsFromEncounterEnd) if (Details.debug) then Details:Msg("(debug) |cFFFFFF00ended a combat|r|cFFFF7700", Details.encounter_table and Details.encounter_table.name or "") + else + DetailsParserDebugFrame:Hide() end ---@type combat diff --git a/core/parser.lua b/core/parser.lua index 4c56cb9d..250e9f2d 100755 --- a/core/parser.lua +++ b/core/parser.lua @@ -1300,13 +1300,13 @@ --~roskash - augmentation evoker damage buff if (augmentation_cache.ebon_might[sourceSerial] or (ownerActor and augmentation_cache.ebon_might[ownerActor.serial])) then --get the serial number of the player who did the damage, in case of a pet or minion use the owner serial - local thisSourceSerial = augmentation_cache.ebon_might[sourceSerial] and sourceSerial or ownerActor.serial + local thisSourceSerial = (augmentation_cache.ebon_might[sourceSerial] and sourceSerial) or ownerActor.serial ---actor buffed with ebonmight -> list of evokers whose buffed ---@type table - local currentlyBuffedWithEbonMight = augmentation_cache.ebon_might[thisSourceSerial] + local evokersWhoBuffedThisPlayer = augmentation_cache.ebon_might[thisSourceSerial] - for i, evokerInfo in ipairs(currentlyBuffedWithEbonMight) do + for i, evokerInfo in ipairs(evokersWhoBuffedThisPlayer) do ---@cast evokerInfo evokerinfo ---@type serial, actorname, controlflags local evokerSourceSerial, evokerSourceName, evokerSourceFlags, attributedGained = unpack(evokerInfo) @@ -1331,7 +1331,7 @@ local tierPieceMultiplier = 1 --bHasFourPieces and 1.08 or 1 local evokerItemLevel = gearCache[evokerSourceSerial] and gearCache[evokerSourceSerial].ilevel or 400 evokerItemLevel = max(evokerItemLevel, 400) - local itemLevelMultiplier = 1 + ((evokerItemLevel - 400) * 0.006) + local itemLevelMultiplier = 1 -- + ((evokerItemLevel - 400) * 0.006) local predictedAmount = 0 if (Details.zone_type == "raid") then --0x410b @@ -1346,7 +1346,10 @@ augmentedSpell.total = augmentedSpell.total + predictedAmount augmentedSpell.targets[sourceName] = (augmentedSpell.targets[sourceName] or 0) + predictedAmount - --DetailsParserDebugFrame:BlinkIcon(extraSpellId, 1) + if (Details.debug) then + DetailsParserDebugFrame:BlinkIcon(extraSpellId, 1) + DetailsParserDebugFrame.AllTexts[1]:SetText("Evokers Buffed: " .. #evokersWhoBuffedThisPlayer .. " (" .. floor(predictedAmount / amount * 100) .. "%)") + end end end end @@ -1386,7 +1389,9 @@ augmentedSpell.total = augmentedSpell.total + predictedAmount augmentedSpell.targets[sourceName] = (augmentedSpell.targets[sourceName] or 0) + predictedAmount - --DetailsParserDebugFrame:BlinkIcon(extraSpellId, 2) + if (Details.debug) then + --DetailsParserDebugFrame:BlinkIcon(extraSpellId, 2) + end end end end @@ -1423,7 +1428,9 @@ augmentedSpell.total = augmentedSpell.total + damageSplitted augmentedSpell.targets[sourceName] = (augmentedSpell.targets[sourceName] or 0) + damageSplitted - --DetailsParserDebugFrame:BlinkIcon(extraSpellId, 3) + if (Details.debug) then + --DetailsParserDebugFrame:BlinkIcon(extraSpellId, 3) + end end end end @@ -1460,7 +1467,9 @@ augmentedSpell.total = augmentedSpell.total + fateMirror_plus_Prescience augmentedSpell.targets[sourceName] = (augmentedSpell.targets[sourceName] or 0) + fateMirror_plus_Prescience - --DetailsParserDebugFrame:BlinkIcon(extraSpellId, 4) + if (Details.debug) then + --DetailsParserDebugFrame:BlinkIcon(extraSpellId, 4) + end end end end @@ -1495,7 +1504,9 @@ augmentedSpell.total = augmentedSpell.total + amount augmentedSpell.targets[sourceName] = (augmentedSpell.targets[sourceName] or 0) + amount - --DetailsParserDebugFrame:BlinkIcon(extraSpellId, 5) + if (Details.debug) then + --DetailsParserDebugFrame:BlinkIcon(extraSpellId, 5) + end end end end @@ -5406,6 +5417,8 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end Details:SendEvent("COMBAT_ENCOUNTER_START", nil, ...) + + Details222.CacheKeystoneForAllGroupMembers() end --ENCOUNRTER_END @@ -5763,6 +5776,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 local keystoneLevels = {} Details.KeystoneLevels = keystoneLevels --save the keystone level for each of the 5 party members + local saveGroupMembersKeystoneLevel = function() wipe(keystoneLevels) local libOpenRaid = LibStub("LibOpenRaid-1.0", true) @@ -5788,6 +5802,13 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end end + function Details222.CacheKeystoneForAllGroupMembers() + local _, instanceType, difficultyID = GetInstanceInfo() + if (instanceType == "party") then + saveGroupMembersKeystoneLevel() + end + end + function Details.parser_functions:CHALLENGE_MODE_COMPLETED(...) --~complete ~finish ~mythic ~m+ Details222.MythicPlus.WorldStateTimerEndAt = time() @@ -7309,34 +7330,46 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end end ---[=[ +--[= local detailsParserDebugFrame = CreateFrame("frame", "DetailsParserDebugFrame", UIParent) detailsParserDebugFrame:SetSize(100, 200) DetailsFramework:ApplyStandardBackdrop(detailsParserDebugFrame) detailsParserDebugFrame:SetPoint("left", UIParent, "left", 2, 350) detailsParserDebugFrame.AllIcons = {} ---detailsParserDebugFrame:Hide() +detailsParserDebugFrame.AllTexts = {} local iconSize = 40 +detailsParserDebugFrame:Hide() + local spellIcon1 = detailsParserDebugFrame:CreateTexture(nil, "overlay") spellIcon1:SetSize(iconSize, iconSize) spellIcon1:SetPoint("topleft", detailsParserDebugFrame, "topleft", 2, -5) +local text1 = detailsParserDebugFrame:CreateFontString(nil, "overlay", "GameFontNormal") +text1:SetPoint("left", spellIcon1, "right", 2, 0) local spellIcon2 = detailsParserDebugFrame:CreateTexture(nil, "overlay") spellIcon2:SetSize(iconSize, iconSize) spellIcon2:SetPoint("topleft", spellIcon1, "bottomleft", 0, -2) +local text2 = detailsParserDebugFrame:CreateFontString(nil, "overlay", "GameFontNormal") +text2:SetPoint("left", spellIcon2, "right", 2, 0) local spellIcon3 = detailsParserDebugFrame:CreateTexture(nil, "overlay") spellIcon3:SetSize(iconSize, iconSize) spellIcon3:SetPoint("topleft", spellIcon2, "bottomleft", 0, -2) +local text3 = detailsParserDebugFrame:CreateFontString(nil, "overlay", "GameFontNormal") +text3:SetPoint("left", spellIcon3, "right", 2, 0) local spellIcon4 = detailsParserDebugFrame:CreateTexture(nil, "overlay") spellIcon4:SetSize(iconSize, iconSize) spellIcon4:SetPoint("topleft", spellIcon3, "bottomleft", 0, -2) +local text4 = detailsParserDebugFrame:CreateFontString(nil, "overlay", "GameFontNormal") +text4:SetPoint("left", spellIcon4, "right", 2, 0) local spellIcon5 = detailsParserDebugFrame:CreateTexture(nil, "overlay") spellIcon5:SetSize(iconSize, iconSize) spellIcon5:SetPoint("topleft", spellIcon4, "bottomleft", 0, -2) +local text5 = detailsParserDebugFrame:CreateFontString(nil, "overlay", "GameFontNormal") +text5:SetPoint("left", spellIcon5, "right", 2, 0) tinsert(detailsParserDebugFrame.AllIcons, spellIcon1) tinsert(detailsParserDebugFrame.AllIcons, spellIcon2) @@ -7344,6 +7377,12 @@ tinsert(detailsParserDebugFrame.AllIcons, spellIcon3) tinsert(detailsParserDebugFrame.AllIcons, spellIcon4) tinsert(detailsParserDebugFrame.AllIcons, spellIcon5) +tinsert(detailsParserDebugFrame.AllTexts, text1) +tinsert(detailsParserDebugFrame.AllTexts, text2) +tinsert(detailsParserDebugFrame.AllTexts, text3) +tinsert(detailsParserDebugFrame.AllTexts, text4) +tinsert(detailsParserDebugFrame.AllTexts, text5) + function detailsParserDebugFrame:BlinkIcon(spellId, iconId) local spellName, _, spellIcon = GetSpellInfo(spellId) local icon = self.AllIcons[iconId] diff --git a/functions/dungeon.lua b/functions/dungeon.lua index 7e52a098..12154b23 100644 --- a/functions/dungeon.lua +++ b/functions/dungeon.lua @@ -525,26 +525,32 @@ local updateKeysStoneLevel = function() local unitKeystoneInfo = libOpenRaid.GetKeystoneInfo(unitId) --print("Unit Exists:", unitBanner.unitName, unitId, "updating keystone level", unitKeystoneInfo) if (unitKeystoneInfo) then - if (instanceInfo) then - ---@type details_instanceinfo - local thisInstanceInfo = Details:GetInstanceInfo(unitKeystoneInfo.mapID) - unitBanner.DungeonTexture:SetTexture(thisInstanceInfo.iconLore) - end + --if (instanceInfo) then + -- ---@type details_instanceinfo + -- local thisInstanceInfo = Details:GetInstanceInfo(unitKeystoneInfo.mapID) + -- unitBanner.DungeonTexture:SetTexture(thisInstanceInfo.iconLore) + --end --unitBanner.LevelFontString:SetText(unitKeystoneInfo.level) --print("setting player", unitBanner.unitName, "keystone level to", unitKeystoneInfo.level) local oldKeystoneLevel = Details.KeystoneLevels[Details:GetFullName(unitId)] + if (oldKeystoneLevel and oldKeystoneLevel >= 2) then if (unitKeystoneInfo.level > oldKeystoneLevel) then - --unitBanner.LevelUpFrame.Text:SetText("") - --unitBanner.LevelUpFrame:SetAlpha(1) - --unitBanner.LevelUpFrame.Anim:Play() - C_Timer.After(0.5, function() unitBanner.LevelUpTextFrame.PlayAnimations(unitKeystoneInfo.level) end) + ---@type details_instanceinfo + local instanceInfo = Details:GetInstanceInfo(unitKeystoneInfo.mapID) + + if (instanceInfo) then + unitBanner.DungeonTexture:SetTexture(instanceInfo.iconLore) + else + unitBanner.DungeonTexture:SetTexture([[Interface\ICONS\INV_Misc_QuestionMark]]) + end + --this character had its keystone upgraded --unitBanner.flashTexture:Flash() --print("keystone upgraded for", Details:GetFullName(unitId), unitKeystoneInfo.level, "old was:", oldKeystoneLevel) diff --git a/functions/spec_augmentation.lua b/functions/spec_augmentation.lua index 7c76c657..91a38395 100644 --- a/functions/spec_augmentation.lua +++ b/functions/spec_augmentation.lua @@ -47,6 +47,91 @@ eventListener:RegisterEvent("COMBAT_PLAYER_LEAVING", function(eventName, combatO --close the time on the current amount of prescience stacks the evoker have ---@type combat local combat = Details:GetCurrentCombat() + + local amountOfAugEvokers = 0 + + ---@type actorcontainer + local damageContainer = combat:GetContainer(DETAILS_ATTRIBUTE_DAMAGE) + ---@type actor[] + local players = {} + ---@type actor + local augEvokerObject + + for index, actorObject in damageContainer:ListActors() do + --check the specId to know if the actor has the augmentation specId + if (actorObject.spec == 1473) then + amountOfAugEvokers = amountOfAugEvokers + 1 + players[#players+1] = actorObject + augEvokerObject = actorObject + + elseif (actorObject:IsPlayer()) then + players[#players+1] = actorObject + end + end + + --print("players", #players, "amountOfAugEvokers:", amountOfAugEvokers, augEvokerObject and augEvokerObject:Name() or "nil") + + if (amountOfAugEvokers == 1 and augEvokerObject) then + local breathOfEonsDamage = 0 + local infernoBlessingDamage = 0 + local fateMirrorDamage = 0 + local blisteringScalesDamage = 0 + + for i = 1, #players do + ---@actor + local playerObject = players[i] + local spellContainer = playerObject:GetSpellContainer("spell") + + local breathOfEons = spellContainer:GetSpell(CONST_SPELLID_EONS_BREATH) + local infornoBlessing = spellContainer:GetSpell(CONST_SPELLID_INFERNOBLESS) + local blisteringScales = spellContainer:GetSpell(CONST_SPELLID_TANK_SHIELD) + local fateMirror = spellContainer:GetSpell(CONST_SPELLID_SS) + + if (breathOfEons and breathOfEons.total >= 1) then + breathOfEonsDamage = breathOfEonsDamage + breathOfEons.total + end + + if (infornoBlessing and infornoBlessing.total >= 1) then + infernoBlessingDamage = infernoBlessingDamage + infornoBlessing.total + end + + if (blisteringScales and blisteringScales.total >= 1) then + blisteringScalesDamage = blisteringScalesDamage + blisteringScales.total + end + + if (fateMirror and fateMirror.total >= 1) then + fateMirrorDamage = fateMirrorDamage + fateMirror.total + end + end + + local augmentedSpellContainer = augEvokerObject.augmentedSpellsContainer + + if (breathOfEonsDamage > 0) then + local bCanCreateSpellIfMissing = true + local breathOfEonsSpell = augmentedSpellContainer:GetOrCreateSpell(CONST_SPELLID_EONS_BREATH, bCanCreateSpellIfMissing, "SPELL_DAMAGE") + breathOfEonsSpell.total = breathOfEonsDamage + end + + if (infernoBlessingDamage > 0) then + local bCanCreateSpellIfMissing = true + local infernoBlessingSpell = augmentedSpellContainer:GetOrCreateSpell(CONST_SPELLID_INFERNOBLESS, bCanCreateSpellIfMissing, "SPELL_DAMAGE") + infernoBlessingSpell.total = infernoBlessingDamage + end + + if (blisteringScalesDamage > 0) then + local bCanCreateSpellIfMissing = true + local blisteringScalesSpell = augmentedSpellContainer:GetOrCreateSpell(CONST_SPELLID_TANK_SHIELD, bCanCreateSpellIfMissing, "SPELL_DAMAGE") + blisteringScalesSpell.total = blisteringScalesDamage + end + + if (fateMirrorDamage > 0) then + local bCanCreateSpellIfMissing = true + local fateMirrorSpell = augmentedSpellContainer:GetOrCreateSpell(CONST_SPELLID_SS, bCanCreateSpellIfMissing, "SPELL_DAMAGE") + fateMirrorSpell.total = fateMirrorDamage + end + end + + --[=[ ---@type actorcontainer local damageContainer = combat:GetContainer(DETAILS_ATTRIBUTE_MISC) --print(1, "COMBAT_PLAYER_LEAVING", next(augmentationCache.prescience_stacks)) @@ -65,6 +150,7 @@ eventListener:RegisterEvent("COMBAT_PLAYER_LEAVING", function(eventName, combatO actorObject.prescience_stack_data_by_timeline = DetailsFramework.table.copy({}, stackInfo.stackTime) end + --]=] end) ---@class details_evoker_presciencetimeline : table @@ -156,6 +242,7 @@ function augmentationFunctions.OnAugmentationBuffUpdate(eventName, ...) elseif (eventName == "TIMELINE_READY") then --not in use --if true then return end --timelineTable is an indexed table with all the timeline events + --[=[ ---@type details_auratimeline[] local timelineTable = ... @@ -247,6 +334,7 @@ function augmentationFunctions.OnAugmentationBuffUpdate(eventName, ...) evokerUtilityObject.prescience_stack_data_by_timeline = DetailsFramework.table.copy({}, evokerPrescienceStackInfo.stackTime) end end + --]=] end end @@ -256,14 +344,23 @@ function augmentationFunctions.BuffIn(token, time, sourceSerial, sourceName, sou end if (spellId == 395152) then --ebom might on third parties - local auraName, texture, count, auraType, duration, expirationTime, sourceUnit, isStealable, nameplateShowPersonal, spellId, canApplyAura, isBossAura, isFromPlayerOrPlayerPet, nameplateShowAll, timeMod, v1, v2, v3, v4, v5 = Details:FindBuffCastedByUnitName(targetName, spellId, sourceName) + local auraName, texture, count, auraType, duration, expirationTime, sourceUnit, isStealable, nameplateShowPersonal, _, canApplyAura, isBossAura, isFromPlayerOrPlayerPet, nameplateShowAll, timeMod, v1, v2, v3, v4, v5 = Details:FindBuffCastedByUnitName(targetName, spellId, sourceName) local attributeGained = v2 + --unit already have the buff from this evoker if (type(attributeGained) == "number") then + if (augmentationCache.ebon_might[targetSerial]) then + for index, evokerInfo in ipairs(augmentationCache.ebon_might[targetSerial]) do + if (evokerInfo[1] == sourceSerial) then + evokerInfo[4] = attributeGained + return + end + end + end + augmentationCache.ebon_might[targetSerial] = augmentationCache.ebon_might[targetSerial] or {} local evokerInfo = {sourceSerial, sourceName, sourceFlags, attributeGained} table.insert(augmentationCache.ebon_might[targetSerial], evokerInfo) - --print("ebom might added, cache:", Details.augmentation_cache, #augmentationCache.ebon_might[targetSerial]) end elseif (spellId == 413984) then --ss @@ -347,26 +444,30 @@ end function augmentationFunctions.BuffRefresh(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, spellschool, tipo, amount) if (spellId == 395152) then - local bFound = false - augmentationCache.ebon_might[targetSerial] = augmentationCache.ebon_might[targetSerial] or {} + if (augmentationCache.ebon_might[targetSerial]) then + for index, evokerInfo in ipairs(augmentationCache.ebon_might[targetSerial]) do + if (evokerInfo[1] == sourceSerial) then + local auraName, texture, count, auraType, duration, expirationTime, sourceUnit, isStealable, nameplateShowPersonal, auraSpellId, canApplyAura, isBossAura, isFromPlayerOrPlayerPet, nameplateShowAll, timeMod, v1, v2, v3, v4, v5 = Details:FindBuffCastedByUnitName(targetName, spellId, sourceName) + local attributeGained = v2 - for index, evokerInfo in ipairs(augmentationCache.ebon_might[targetSerial]) do - if (evokerInfo[1] == sourceSerial) then - local auraName, texture, count, auraType, duration, expirationTime, sourceUnit, isStealable, nameplateShowPersonal, auraSpellId, canApplyAura, isBossAura, isFromPlayerOrPlayerPet, nameplateShowAll, timeMod, v1, v2, v3, v4, v5 = Details:FindBuffCastedByUnitName(targetName, spellId, sourceName) - local attributeGained = v2 - - if (type(attributeGained) == "number") then - evokerInfo[4] = attributeGained - bFound = true - break + if (type(attributeGained) == "number") then + evokerInfo[4] = attributeGained + return + end end end - end - if (not bFound) then local auraName, texture, count, auraType, duration, expirationTime, sourceUnit, isStealable, nameplateShowPersonal, auraSpellId, canApplyAura, isBossAura, isFromPlayerOrPlayerPet, nameplateShowAll, timeMod, v1, v2, v3, v4, v5 = Details:FindBuffCastedByUnitName(targetName, spellId, sourceName) local attributeGained = v2 if (type(attributeGained) == "number") then + Details222.DebugMsg("Ebon Might Refreshed!, but the evoker was not found in the cache (1), adding:", sourceName, sourceSerial, targetName, targetSerial) + table.insert(augmentationCache.ebon_might[targetSerial], {sourceSerial, sourceName, sourceFlags, attributeGained}) + end + else + local auraName, texture, count, auraType, duration, expirationTime, sourceUnit, isStealable, nameplateShowPersonal, auraSpellId, canApplyAura, isBossAura, isFromPlayerOrPlayerPet, nameplateShowAll, timeMod, v1, v2, v3, v4, v5 = Details:FindBuffCastedByUnitName(targetName, spellId, sourceName) + local attributeGained = v2 + if (type(attributeGained) == "number") then + Details222.DebugMsg("Ebon Might Refreshed!, but the evoker was not found in the cache (2), adding:", sourceName, sourceSerial, targetName, targetSerial) table.insert(augmentationCache.ebon_might[targetSerial], {sourceSerial, sourceName, sourceFlags, attributeGained}) end end @@ -421,12 +522,9 @@ function augmentationFunctions.BuffOut(token, time, sourceSerial, sourceName, so if (spellId == 395152) then --ebon might if (augmentationCache.ebon_might[targetSerial]) then - --print("tinha buff", targetName, targetSerial) for index, evokerInfo in ipairs(augmentationCache.ebon_might[targetSerial]) do if (evokerInfo[1] == sourceSerial) then - --print("ebom might finished, removing from cache:", Details.augmentation_cache, #augmentationCache.ebon_might[targetSerial]) table.remove(augmentationCache.ebon_might[targetSerial], index) - --print("ebom might finished, removing from cache:", Details.augmentation_cache, #augmentationCache.ebon_might[targetSerial]) break end end