From f41ecaf9080e34678a87706bcf44b1923234e7c3 Mon Sep 17 00:00:00 2001 From: Tercio Jose Date: Thu, 27 Jul 2023 21:55:59 -0300 Subject: [PATCH] Added spellContainer:GetOrCreateSpell() this is an english alias for "PegaHabilidade" --- classes/class_damage.lua | 73 ++++- classes/container_spells.lua | 11 +- core/parser.lua | 503 +++++++++++++++++++---------------- frames/window_main.lua | 6 + functions/profiles.lua | 2 + 5 files changed, 363 insertions(+), 232 deletions(-) diff --git a/classes/class_damage.lua b/classes/class_damage.lua index 757b62fe6..33e360aae 100644 --- a/classes/class_damage.lua +++ b/classes/class_damage.lua @@ -2994,7 +2994,9 @@ end ---@param totalAmount valueamount ---@param topAmount valueamount ---@param instanceObject instance -function Details:ShowExtraStatusbar(thisLine, amount, extraAmount, totalAmount, topAmount, instanceObject) +---@param onEnterFunc function|nil +---@param onLeaveFunc function|nil +function Details:ShowExtraStatusbar(thisLine, amount, extraAmount, totalAmount, topAmount, instanceObject, onEnterFunc, onLeaveFunc) if (extraAmount and extraAmount > 0 and Details.combat_log.evoker_calc_damage) then local extraStatusbar = thisLine.extraStatusbar local initialOffset = 0 @@ -3026,10 +3028,25 @@ function Details:ShowExtraStatusbar(thisLine, amount, extraAmount, totalAmount, --extraStatusbar:SetFrameStrata("TOOLTIP") extraStatusbar:SetFrameLevel(thisLine:GetFrameLevel() + 1) + extraStatusbar.OnEnterCallback = onEnterFunc + extraStatusbar.OnLeaveCallback = onLeaveFunc + extraStatusbar:Show() end end +--when the script detect the extrastatusbar need to be show, it will call this function +local handleShowExtraStatusbar = function(thisLine, self, instance, previousData, isForceRefresh, percent, bUseAnimations, totalValue, topValue) + if (self.spec == 1473 and self.augmentedSpellsContainer) then + --prepare the extra bar to show the damage prediction to augmented evoker + Details:ShowExtraStatusbar(thisLine, self.total, self.total_extra, totalValue, topValue, instance, damageClass.PredictedAugSpellsOnEnter, damageClass.PredictedAugSpellsOnLeave) + thisLine.extraStatusbar.augmentedSpellsContainer = self.augmentedSpellsContainer + thisLine.extraStatusbar.instance = instance + else + Details:ShowExtraStatusbar(thisLine, self.total, self.total_extra, totalValue, topValue, instance) + end +end + function Details:RefreshLineValue(thisLine, instance, previousData, isForceRefresh, percent, bUseAnimations, totalValue, topValue) --[[exported]] thisLine.extraStatusbar:Hide() @@ -3061,7 +3078,7 @@ function Details:RefreshLineValue(thisLine, instance, previousData, isForceRefre Details.FadeHandler.Fader(thisLine, "out") if (self.total_extra and self.total_extra > 0) then - Details:ShowExtraStatusbar(thisLine, self.total, self.total_extra, totalValue, topValue, instance) + handleShowExtraStatusbar(thisLine, self, instance, previousData, isForceRefresh, percent, bUseAnimations, totalValue, topValue) end return self:RefreshBarra(thisLine, instance) @@ -3078,7 +3095,7 @@ function Details:RefreshLineValue(thisLine, instance, previousData, isForceRefre thisLine.last_value = percent --reseta o ultimo valor da barra if (self.total_extra and self.total_extra > 0) then - Details:ShowExtraStatusbar(thisLine, self.total, self.total_extra, totalValue, topValue, instance) + handleShowExtraStatusbar(thisLine, self, instance, previousData, isForceRefresh, percent, bUseAnimations, totalValue, topValue) end return self:RefreshBarra(thisLine, instance) @@ -3099,7 +3116,7 @@ function Details:RefreshLineValue(thisLine, instance, previousData, isForceRefre return self:RefreshBarra(thisLine, instance) else if (self.total_extra and self.total_extra > 0) then - Details:ShowExtraStatusbar(thisLine, self.total, self.total_extra, totalValue, topValue, instance) + handleShowExtraStatusbar(thisLine, self, instance, previousData, isForceRefresh, percent, bUseAnimations, totalValue, topValue) end end end @@ -3363,6 +3380,51 @@ function Details:RefreshBarra(thisLine, instance, fromResize) --[[exported]] self:SetBarLeftText(thisLine, instance, enemy, arenaEnemy, arenaAlly, UsingCustomLeftText) end + +function damageClass.PredictedAugSpellsOnEnter(self) + if (not Details.show_aug_predicted_spell_damage) then + return + end + + ---@type spellcontainer + local spellContainer = self.augmentedSpellsContainer + + GameCooltip:Preset(2) + ---@type instance + local instance = self.instance + + local combatObject = instance:GetCombat() + for spellId, spellTable in spellContainer:ListSpells() do + local spellName, _, spellTexture = GetSpellInfo(spellId) + if (spellName) then + GameCooltip:AddLine(spellName, Details:Format(spellTable.total)) + GameCooltip:AddIcon(spellTexture, 1, 1, 18, 18) + + --the damage sources are added into the targets table for reciclying + ---@type table + local sources = spellTable.targets + for sourceName, sourceAmount in pairs(sources) do + GameCooltip:AddLine(sourceName, Details:Format(sourceAmount), 1, "yellow", "yellow", 10) + local actorObject = combatObject:GetActor(1, sourceName) + if (actorObject) then + local actorIcon = Details:GetActorIcon(actorObject) + if (actorIcon) then + GameCooltip:AddIcon(actorIcon.texture, 1, 1, 18, 18, actorIcon.coords.left, actorIcon.coords.right, actorIcon.coords.top, actorIcon.coords.bottom) + else + GameCooltip:AddIcon([[Interface\COMMON\Indicator-Gray]], 1, 1, 18, 18) + end + end + end + end + end + + GameCooltip:ShowCooltip(self, "tooltip") +end + +function damageClass.PredictedAugSpellsOnLeave(self) + GameCooltip:Hide() +end + --------------------------------------------- // TOOLTIPS // --------------------------------------------- ---------TOOLTIPS BIFURCA��O @@ -6948,6 +7010,9 @@ function Details.refresh:r_atributo_damage(actorObject) --restore metatable for the spell container Details.refresh:r_container_habilidades(actorObject.spells) + if (actorObject.augmentedSpellsContainer) then + Details.refresh:r_container_habilidades(actorObject.augmentedSpellsContainer) + end end function Details.clear:c_atributo_damage (este_jogador) diff --git a/classes/container_spells.lua b/classes/container_spells.lua index d056bd86c..bdbcba1ff 100644 --- a/classes/container_spells.lua +++ b/classes/container_spells.lua @@ -45,7 +45,6 @@ local habilidade_misc = _detalhes.habilidade_misc ---@param containerType number @the container type to be created (1 damage 2 heal 3 resources 4 utility) ---@return spellcontainer function spellContainerClass:NovoContainer(containerType) - ---@type spellcontainer local spellContainer = { funcao_de_criacao = spellContainerClass:GetSpellTableFuncCreator(containerType), tipo = containerType, @@ -56,6 +55,10 @@ local habilidade_misc = _detalhes.habilidade_misc return spellContainer end + function spellContainerClass:CreateSpellContainer(containerType) + return self:NovoContainer(containerType) + end + ---get the spellTable for the passed spellId ---@param spellId number ---@return table @@ -105,8 +108,8 @@ local habilidade_misc = _detalhes.habilidade_misc return false end - function spellContainerClass:GetOrCreateSpell(spellId, bCanCreateSpellIfMissing, cleuToken) - return self:PegaHabilidade(spellId, bCanCreateSpellIfMissing, cleuToken) + function spellContainerClass:PegaHabilidade(spellId, bCanCreateSpellIfMissing, cleuToken) + return self:GetOrCreateSpell(spellId, bCanCreateSpellIfMissing, cleuToken) end ---create a new spelltable for the passed spellId @@ -115,7 +118,7 @@ local habilidade_misc = _detalhes.habilidade_misc ---@param bCanCreateSpellIfMissing boolean ---@param cleuToken string ---@return spelltable|nil - function spellContainerClass:PegaHabilidade(spellId, bCanCreateSpellIfMissing, cleuToken) + function spellContainerClass:GetOrCreateSpell(spellId, bCanCreateSpellIfMissing, cleuToken) ---@type spelltable local spellTable = self._ActorTable [spellId] diff --git a/core/parser.lua b/core/parser.lua index df4a18e9c..688d103cb 100755 --- a/core/parser.lua +++ b/core/parser.lua @@ -36,7 +36,7 @@ local parser = Details.parser --details local local cc_spell_list = detailsFramework.CrowdControlSpells - local container_habilidades = Details.container_habilidades --details local + local spellContainerClass = Details.container_habilidades --details local --localize the cooldown table from the framework local defensive_cooldowns = {} @@ -446,6 +446,15 @@ [372824] = true, --Burning Chains } + local special_buffs_spells = { + [395152] = true, + [413984] = true, + [410089] = true, + [409560] = true, + [360827] = true, + [410263] = true, + } + --damage spells to ignore local damage_spells_to_ignore = { --the damage that the warlock apply to its pet through soullink is ignored @@ -1231,7 +1240,7 @@ --amount add --~roskash - augmentation evoker damage buff - if (augmentation_cache.ebon_might[sourceSerial]) then + if (augmentation_cache.ebon_might[sourceSerial] and sourceName ~= Details.playername) then ---actor buffed with ebonmight -> list of evokers whose buffed ---@type table local currentlyBuffedWithEbonMight = augmentation_cache.ebon_might[sourceSerial] @@ -1244,23 +1253,34 @@ ---@type actor local evokerActor = damage_cache[evokerSourceSerial] - if (not evokerActor) then evokerActor = _current_damage_container:GetOrCreateActor(evokerSourceSerial, evokerSourceName, evokerSourceFlags, true) end if (evokerActor) then + local extraSpellId = 395152 + evokerActor.augmentedSpellsContainer = evokerActor.augmentedSpellsContainer or spellContainerClass:CreateSpellContainer(Details.container_type.CONTAINER_DAMAGE_CLASS) + local augmentedSpell = evokerActor.augmentedSpellsContainer._ActorTable[extraSpellId] + if (not augmentedSpell) then + augmentedSpell = evokerActor.augmentedSpellsContainer:GetOrCreateSpell(extraSpellId, true, token) + end + evokerActor.total_extra = evokerActor.total_extra or 0 + local predictedAmount = 0 if (Details.zone_type == "raid") then - evokerActor.total_extra = evokerActor.total_extra + (amount * 0.1389541) + predictedAmount = amount * 0.1389541 else - evokerActor.total_extra = evokerActor.total_extra + (amount * 0.1683245) + predictedAmount = amount * 0.1683245 end + + evokerActor.total_extra = evokerActor.total_extra + predictedAmount + augmentedSpell.total = augmentedSpell.total + predictedAmount + augmentedSpell.targets[sourceName] = (augmentedSpell.targets[sourceName] or 0) + predictedAmount end end end - if (augmentation_cache.ss[sourceSerial]) then --actor buffed with ss + if (augmentation_cache.ss[sourceSerial] and sourceName ~= Details.playername) then --actor buffed with ss --print(sourceName, "has ss buff") ---@type table local currentlyBuffedWithSS = augmentation_cache.ss[sourceSerial] @@ -1272,22 +1292,29 @@ ---@type actor local evokerActor = damage_cache[evokerSourceSerial] - - --print(evokerActor, evokerSourceSerial, evokerSourceName, evokerSourceFlags, versaBuff, sourceName) - if (not evokerActor) then evokerActor = _current_damage_container:GetOrCreateActor(evokerSourceSerial, evokerSourceName, evokerSourceFlags, true) end if (evokerActor) then + local extraSpellId = 413984 + evokerActor.augmentedSpellsContainer = evokerActor.augmentedSpellsContainer or spellContainerClass:CreateSpellContainer(Details.container_type.CONTAINER_DAMAGE_CLASS) + local augmentedSpell = evokerActor.augmentedSpellsContainer._ActorTable[extraSpellId] + if (not augmentedSpell) then + augmentedSpell = evokerActor.augmentedSpellsContainer:GetOrCreateSpell(extraSpellId, true, token) + end + versaBuff = versaBuff / 100 - evokerActor.total_extra = evokerActor.total_extra + (amount * versaBuff) - --print("added to the evoker:", (amount * versaBuff), "damage") + local predictedAmount = amount * versaBuff + evokerActor.total_extra = evokerActor.total_extra + predictedAmount + + augmentedSpell.total = augmentedSpell.total + predictedAmount + augmentedSpell.targets[sourceName] = (augmentedSpell.targets[sourceName] or 0) + predictedAmount end end end - if (spellId == 360828 and augmentation_cache.shield[sourceSerial]) then --shield + if (spellId == 360828 and augmentation_cache.shield[sourceSerial] and sourceName ~= Details.playername) then --shield ---actor buffed with the shield -> list of evokers whose buffed ---@type table local currentlyBuffedWithShield = augmentation_cache.shield[sourceSerial] @@ -1300,19 +1327,28 @@ ---@type actor local evokerActor = damage_cache[evokerSourceSerial] - if (not evokerActor) then evokerActor = _current_damage_container:GetOrCreateActor(evokerSourceSerial, evokerSourceName, evokerSourceFlags, true) end if (evokerActor) then + local extraSpellId = 360828 + evokerActor.augmentedSpellsContainer = evokerActor.augmentedSpellsContainer or spellContainerClass:CreateSpellContainer(Details.container_type.CONTAINER_DAMAGE_CLASS) + local augmentedSpell = evokerActor.augmentedSpellsContainer._ActorTable[extraSpellId] + if (not augmentedSpell) then + augmentedSpell = evokerActor.augmentedSpellsContainer:GetOrCreateSpell(extraSpellId, true, token) + end + local damageSplitted = amount / #currentlyBuffedWithShield evokerActor.total_extra = evokerActor.total_extra + damageSplitted + + augmentedSpell.total = augmentedSpell.total + damageSplitted + augmentedSpell.targets[sourceName] = (augmentedSpell.targets[sourceName] or 0) + damageSplitted end end end - if (spellId == 404908 and augmentation_cache.prescience[sourceSerial]) then --fate mirror + if (spellId == 404908 and augmentation_cache.prescience[sourceSerial] and sourceName ~= Details.playername) then --fate mirror ---actor buffed with prescience -> list of evokers whose buffed ---@type table local currentlyBuffedWithPrescience = augmentation_cache.prescience[sourceSerial] @@ -1325,13 +1361,22 @@ ---@type actor local evokerActor = damage_cache[evokerSourceSerial] - if (not evokerActor) then evokerActor = _current_damage_container:GetOrCreateActor(evokerSourceSerial, evokerSourceName, evokerSourceFlags, true) end if (evokerActor) then - evokerActor.total_extra = (evokerActor.total_extra or 0) + amount + local extraSpellId = 404908 + evokerActor.augmentedSpellsContainer = evokerActor.augmentedSpellsContainer or spellContainerClass:CreateSpellContainer(Details.container_type.CONTAINER_DAMAGE_CLASS) + local augmentedSpell = evokerActor.augmentedSpellsContainer._ActorTable[extraSpellId] + if (not augmentedSpell) then + augmentedSpell = evokerActor.augmentedSpellsContainer:GetOrCreateSpell(extraSpellId, true, token) + end + + evokerActor.total_extra = evokerActor.total_extra + amount + + augmentedSpell.total = augmentedSpell.total + amount + augmentedSpell.targets[sourceName] = (augmentedSpell.targets[sourceName] or 0) + amount end end end @@ -1348,18 +1393,27 @@ ---@type actor local evokerActor = damage_cache[evokerSourceSerial] - if (not evokerActor) then evokerActor = _current_damage_container:GetOrCreateActor(evokerSourceSerial, evokerSourceName, evokerSourceFlags, true) end if (evokerActor) then - evokerActor.total_extra = (evokerActor.total_extra or 0) + amount + local extraSpellId = 410265 + evokerActor.augmentedSpellsContainer = evokerActor.augmentedSpellsContainer or spellContainerClass:CreateSpellContainer(Details.container_type.CONTAINER_DAMAGE_CLASS) + local augmentedSpell = evokerActor.augmentedSpellsContainer._ActorTable[extraSpellId] + if (not augmentedSpell) then + augmentedSpell = evokerActor.augmentedSpellsContainer:GetOrCreateSpell(extraSpellId, true, token) + end + + evokerActor.total_extra = evokerActor.total_extra + amount + + augmentedSpell.total = augmentedSpell.total + amount + augmentedSpell.targets[sourceName] = (augmentedSpell.targets[sourceName] or 0) + amount end end end - if (spellId == 409632) then + if (spellId == 409632 and sourceName ~= Details.playername) then local breathTargets = augmentation_cache.breath_targets ---@type evokereonsbreathinfo[] @@ -1381,13 +1435,22 @@ ---@type actor local evokerActor = damage_cache[evokerSerial] - if (not evokerActor) then evokerActor = _current_damage_container:GetOrCreateActor(evokerSerial, evokerName, evokerFlags, true) end if (evokerActor) then - evokerActor.total_extra = (evokerActor.total_extra or 0) + amount + local extraSpellId = 409632 + evokerActor.augmentedSpellsContainer = evokerActor.augmentedSpellsContainer or spellContainerClass:CreateSpellContainer(Details.container_type.CONTAINER_DAMAGE_CLASS) + local augmentedSpell = evokerActor.augmentedSpellsContainer._ActorTable[extraSpellId] + if (not augmentedSpell) then + augmentedSpell = evokerActor.augmentedSpellsContainer:GetOrCreateSpell(extraSpellId, true, token) + end + + evokerActor.total_extra = evokerActor.total_extra + amount + + augmentedSpell.total = augmentedSpell.total + amount + augmentedSpell.targets[sourceName] = (augmentedSpell.targets[sourceName] or 0) + amount end end end @@ -1427,7 +1490,7 @@ --actor spells table local spellTable = sourceActor.spells._ActorTable[spellId] if (not spellTable) then - spellTable = sourceActor.spells:PegaHabilidade(spellId, true, token) + spellTable = sourceActor.spells:GetOrCreateSpell(spellId, true, token) spellTable.spellschool = spellType or school if (_current_combat.is_boss and sourceFlags and bitBand(sourceFlags, OBJECT_TYPE_ENEMY) ~= 0) then Details.spell_school_cache[spellName] = spellType or school @@ -1997,7 +2060,7 @@ --actor spells table local spell = sourceActor.spells._ActorTable[spellId] if (not spell) then - spell = sourceActor.spells:PegaHabilidade(spellId, true, token) + spell = sourceActor.spells:GetOrCreateSpell(spellId, true, token) spell.spellschool = spellType if (_current_combat.is_boss and sourceFlags and bitBand(sourceFlags, OBJECT_TYPE_ENEMY) ~= 0) then Details.spell_school_cache[spellName] = spellType @@ -2189,7 +2252,7 @@ --actor spells table local spell = sourceActor.spells._ActorTable[spellIdAbsorb] if (not spell) then - spell = sourceActor.spells:PegaHabilidade(spellIdAbsorb, true, token) + spell = sourceActor.spells:GetOrCreateSpell(spellIdAbsorb, true, token) if (_current_combat.is_boss and sourceFlags and bitBand(sourceFlags, OBJECT_TYPE_ENEMY) ~= 0) then Details.spell_school_cache[spellNameAbsorb] = spellSchoolAbsorb or 1 end @@ -2517,7 +2580,7 @@ --actor spells table local spellTable = sourceActor.spells._ActorTable[spellId] if (not spellTable) then - spellTable = sourceActor.spells:PegaHabilidade(spellId, true, token) + spellTable = sourceActor.spells:GetOrCreateSpell(spellId, true, token) if (bIsShield) then spellTable.is_shield = true end @@ -2609,7 +2672,7 @@ local spell = este_jogador.spells._ActorTable [spellid] if (not spell) then - spell = este_jogador.spells:PegaHabilidade (spellid, true, token) + spell = este_jogador.spells:GetOrCreateSpell(spellid, true, token) spell.neutral = true end @@ -2635,70 +2698,72 @@ sourceSerial = "" end - if (spellId == 395152) then --~roskash - augmentation_cache.ebon_might[targetSerial] = augmentation_cache.ebon_might[targetSerial] or {} - ---@type evokerinfo - local evokerInfo = {sourceSerial, sourceName, sourceFlags, amount} - table.insert(augmentation_cache.ebon_might[targetSerial], evokerInfo) - - elseif (spellId == 413984) then --ss - --print("ss de ", sourceName, "em:", targetName) - if (UnitExists(targetName) and not UnitIsUnit("player", targetName)) then - --print("ss validou!") - local auraName, texture, count, auraType, duration, expirationTime, sourceUnit, isStealable, nameplateShowPersonal, spellId, canApplyAura, isBossAura, isFromPlayerOrPlayerPet, nameplateShowAll, timeMod, v1, v2, v3, v4, v5 = Details:FindBuffCastedBy(targetName, spellId, sourceName) - --dumpt({auraName, texture, count, auraType, duration, expirationTime, sourceUnit, isStealable, nameplateShowPersonal, spellId, canApplyAura, isBossAura, isFromPlayerOrPlayerPet, nameplateShowAll, timeMod, v1, v2, v3, v4, v5}) - local versaGained = v1 - if (type(versaGained) == "number") then - --print("tem versa: ", versaGained) - augmentation_cache.ss[targetSerial] = augmentation_cache.ss[targetSerial] or {} - local ssInfo = {sourceSerial, sourceName, sourceFlags, versaGained} - table.insert(augmentation_cache.ss[targetSerial], ssInfo) - end - end - - elseif (spellId == 410089) then - augmentation_cache.prescience[targetSerial] = augmentation_cache.prescience[targetSerial] or {} - ---@type evokerinfo - local evokerInfo = {sourceSerial, sourceName, sourceFlags, amount} - table.insert(augmentation_cache.prescience[targetSerial], evokerInfo) - - elseif (spellId == 409560) then - local unitIDAffected = Details:FindUnitIDByUnitSerial(targetSerial) - if (unitIDAffected) then - local duration, expirationTime = Details:FindDebuffDuration(unitIDAffected, spellId, sourceName) - if (duration) then - local breathTargets = augmentation_cache.breath_targets[targetSerial] - if (not breathTargets) then - augmentation_cache.breath_targets[targetSerial] = {} - breathTargets = augmentation_cache.breath_targets[targetSerial] + if (special_buffs_spells[spellId]) then + if (spellId == 395152) then --~roskash + augmentation_cache.ebon_might[targetSerial] = augmentation_cache.ebon_might[targetSerial] or {} + ---@type evokerinfo + local evokerInfo = {sourceSerial, sourceName, sourceFlags, amount} + table.insert(augmentation_cache.ebon_might[targetSerial], evokerInfo) + + elseif (spellId == 413984) then --ss + --print("ss de ", sourceName, "em:", targetName) + if (UnitExists(targetName) and not UnitIsUnit("player", targetName)) then + --print("ss validou!") + local auraName, texture, count, auraType, duration, expirationTime, sourceUnit, isStealable, nameplateShowPersonal, spellId, canApplyAura, isBossAura, isFromPlayerOrPlayerPet, nameplateShowAll, timeMod, v1, v2, v3, v4, v5 = Details:FindBuffCastedBy(targetName, spellId, sourceName) + --dumpt({auraName, texture, count, auraType, duration, expirationTime, sourceUnit, isStealable, nameplateShowPersonal, spellId, canApplyAura, isBossAura, isFromPlayerOrPlayerPet, nameplateShowAll, timeMod, v1, v2, v3, v4, v5}) + local versaGained = v1 + if (type(versaGained) == "number") then + --print("tem versa: ", versaGained) + augmentation_cache.ss[targetSerial] = augmentation_cache.ss[targetSerial] or {} + local ssInfo = {sourceSerial, sourceName, sourceFlags, versaGained} + table.insert(augmentation_cache.ss[targetSerial], ssInfo) end + end - --evoker serial, evoker name, evoker flags, target unitID, unixtime, duration, expirationTime (GetTime + duration) - ---@type evokereonsbreathinfo - local eonsBreathInfo = {sourceSerial, sourceName, sourceFlags, unitIDAffected, time, duration, expirationTime} - table.insert(breathTargets, eonsBreathInfo) + elseif (spellId == 410089) then + augmentation_cache.prescience[targetSerial] = augmentation_cache.prescience[targetSerial] or {} + ---@type evokerinfo + local evokerInfo = {sourceSerial, sourceName, sourceFlags, amount} + table.insert(augmentation_cache.prescience[targetSerial], evokerInfo) + + elseif (spellId == 409560) then + local unitIDAffected = Details:FindUnitIDByUnitSerial(targetSerial) + if (unitIDAffected) then + local duration, expirationTime = Details:FindDebuffDuration(unitIDAffected, spellId, sourceName) + if (duration) then + local breathTargets = augmentation_cache.breath_targets[targetSerial] + if (not breathTargets) then + augmentation_cache.breath_targets[targetSerial] = {} + breathTargets = augmentation_cache.breath_targets[targetSerial] + end + + --evoker serial, evoker name, evoker flags, target unitID, unixtime, duration, expirationTime (GetTime + duration) + ---@type evokereonsbreathinfo + local eonsBreathInfo = {sourceSerial, sourceName, sourceFlags, unitIDAffected, time, duration, expirationTime} + table.insert(breathTargets, eonsBreathInfo) + end end - end - elseif (spellId == 360827) then - augmentation_cache.shield[targetSerial] = augmentation_cache.shield[targetSerial] or {} - ---@type evokerinfo - local evokerInfo = {sourceSerial, sourceName, sourceFlags, amount} - table.insert(augmentation_cache.shield[targetSerial], evokerInfo) + elseif (spellId == 360827) then + augmentation_cache.shield[targetSerial] = augmentation_cache.shield[targetSerial] or {} + ---@type evokerinfo + local evokerInfo = {sourceSerial, sourceName, sourceFlags, amount} + table.insert(augmentation_cache.shield[targetSerial], evokerInfo) - elseif (spellId == 410263) then - augmentation_cache.infernobless[targetSerial] = augmentation_cache.infernobless[targetSerial] or {} - ---@type evokerinfo - local evokerInfo = {sourceSerial, sourceName, sourceFlags} - table.insert(augmentation_cache.infernobless[targetSerial], evokerInfo) + elseif (spellId == 410263) then + augmentation_cache.infernobless[targetSerial] = augmentation_cache.infernobless[targetSerial] or {} + ---@type evokerinfo + local evokerInfo = {sourceSerial, sourceName, sourceFlags} + table.insert(augmentation_cache.infernobless[targetSerial], evokerInfo) + end end if (buffs_makeyourown[spellId]) then sourceSerial, sourceName, sourceFlags = targetSerial, targetName, targetFlags end - ------------------------------------------------------------------------------------------------ - --spell reflection + ------------------------------------------------------------------------------------------------ + --spell reflection if (reflection_spellid[spellId]) then --~reflect --this is a spell reflect aura --we save the info on who received this aura and from whom @@ -2893,7 +2958,7 @@ if (not sourceActor.cc_done) then sourceActor.cc_done = Details:GetOrderNumber() - sourceActor.cc_done_spells = container_habilidades:NovoContainer(container_misc) + sourceActor.cc_done_spells = spellContainerClass:CreateSpellContainer(container_misc) sourceActor.cc_done_targets = {} end @@ -2904,7 +2969,7 @@ --actor spells table local spellTable = sourceActor.cc_done_spells._ActorTable[spellId] if (not spellTable) then - spellTable = sourceActor.cc_done_spells:PegaHabilidade(spellId, true) + spellTable = sourceActor.cc_done_spells:GetOrCreateSpell(spellId, true) end spellTable.targets[targetName] = (spellTable.targets[targetName] or 0) + 1 spellTable.counter = spellTable.counter + 1 @@ -2913,7 +2978,7 @@ if (ownerActor) then if (not ownerActor.cc_done) then ownerActor.cc_done = Details:GetOrderNumber() - ownerActor.cc_done_spells = container_habilidades:NovoContainer(container_misc) + ownerActor.cc_done_spells = spellContainerClass:CreateSpellContainer(container_misc) ownerActor.cc_done_targets = {} end @@ -2924,7 +2989,7 @@ --actor spells table local ownerSpellTable = ownerActor.cc_done_spells._ActorTable[spellId] if (not ownerSpellTable) then - ownerSpellTable = ownerActor.cc_done_spells:PegaHabilidade(spellId, true) + ownerSpellTable = ownerActor.cc_done_spells:GetOrCreateSpell(spellId, true) end ownerSpellTable.targets[targetName] = (ownerSpellTable.targets[targetName] or 0) + 1 @@ -2981,59 +3046,61 @@ return end - if (spellid == 395152) then --~roskash - local bFound = false - augmentation_cache.ebon_might[targetSerial] = augmentation_cache.ebon_might[targetSerial] or {} + if (special_buffs_spells[spellid]) then + if (spellid == 395152) then --~roskash + local bFound = false + augmentation_cache.ebon_might[targetSerial] = augmentation_cache.ebon_might[targetSerial] or {} - for index, evokerInfo in ipairs(augmentation_cache.ebon_might[targetSerial]) do - if (evokerInfo[1] == sourceSerial) then - evokerInfo[4] = amount - bFound = true - break + for index, evokerInfo in ipairs(augmentation_cache.ebon_might[targetSerial]) do + if (evokerInfo[1] == sourceSerial) then + evokerInfo[4] = amount + bFound = true + break + end end - end - if (not bFound) then - table.insert(augmentation_cache.ebon_might[targetSerial], {sourceSerial, sourceName, sourceFlags, amount}) - end + if (not bFound) then + table.insert(augmentation_cache.ebon_might[targetSerial], {sourceSerial, sourceName, sourceFlags, amount}) + end - elseif (spellid == 413984) then --ss - if (UnitExists(targetName) and not UnitIsUnit("player", targetName)) then - local auraName, texture, count, auraType, duration, expirationTime, sourceUnit, isStealable, nameplateShowPersonal, spellId, canApplyAura, isBossAura, isFromPlayerOrPlayerPet, nameplateShowAll, timeMod, v1, v2, v3, v4, v5 = Details:FindBuffCastedBy(targetName, spellid, sourceName) - local versaGained = v1 + elseif (spellid == 413984) then --ss + if (UnitExists(targetName) and not UnitIsUnit("player", targetName)) then + local auraName, texture, count, auraType, duration, expirationTime, sourceUnit, isStealable, nameplateShowPersonal, spellId, canApplyAura, isBossAura, isFromPlayerOrPlayerPet, nameplateShowAll, timeMod, v1, v2, v3, v4, v5 = Details:FindBuffCastedBy(targetName, spellid, sourceName) + local versaGained = v1 - if (type(versaGained) == "number") then - local bFound = false - augmentation_cache.ss[targetSerial] = augmentation_cache.ss[targetSerial] or {} + if (type(versaGained) == "number") then + local bFound = false + augmentation_cache.ss[targetSerial] = augmentation_cache.ss[targetSerial] or {} - for index, evokerInfo in ipairs(augmentation_cache.ss[targetSerial]) do - if (evokerInfo[1] == sourceSerial) then - evokerInfo[4] = versaGained - bFound = true - break + for index, evokerInfo in ipairs(augmentation_cache.ss[targetSerial]) do + if (evokerInfo[1] == sourceSerial) then + evokerInfo[4] = versaGained + bFound = true + break + end end - end - if (not bFound) then - table.insert(augmentation_cache.ss[targetSerial], {sourceSerial, sourceName, sourceFlags, versaGained}) + if (not bFound) then + table.insert(augmentation_cache.ss[targetSerial], {sourceSerial, sourceName, sourceFlags, versaGained}) + end end end - end - elseif (spellid == 410089) then - local bFound = false - augmentation_cache.prescience[targetSerial] = augmentation_cache.prescience[targetSerial] or {} + elseif (spellid == 410089) then + local bFound = false + augmentation_cache.prescience[targetSerial] = augmentation_cache.prescience[targetSerial] or {} - for index, evokerInfo in ipairs(augmentation_cache.prescience[targetSerial]) do - if (evokerInfo[1] == sourceSerial) then - evokerInfo[4] = amount - bFound = true - break + for index, evokerInfo in ipairs(augmentation_cache.prescience[targetSerial]) do + if (evokerInfo[1] == sourceSerial) then + evokerInfo[4] = amount + bFound = true + break + end end - end - if (not bFound) then - table.insert(augmentation_cache.prescience[targetSerial], {sourceSerial, sourceName, sourceFlags, amount}) + if (not bFound) then + table.insert(augmentation_cache.prescience[targetSerial], {sourceSerial, sourceName, sourceFlags, amount}) + end end end @@ -3110,52 +3177,54 @@ end if (tipo == "BUFF") then - if (spellid == 395152) then --~roskash - if (augmentation_cache.ebon_might[targetSerial]) then - for index, evokerInfo in ipairs(augmentation_cache.ebon_might[targetSerial]) do - if (evokerInfo[1] == sourceSerial) then - table.remove(augmentation_cache.ebon_might[targetSerial], index) - break + if (special_buffs_spells[spellid]) then + if (spellid == 395152) then --~roskash + if (augmentation_cache.ebon_might[targetSerial]) then + for index, evokerInfo in ipairs(augmentation_cache.ebon_might[targetSerial]) do + if (evokerInfo[1] == sourceSerial) then + table.remove(augmentation_cache.ebon_might[targetSerial], index) + break + end end end - end - elseif (spellid == 413984) then - if (augmentation_cache.ss[targetSerial]) then - for index, evokerInfo in ipairs(augmentation_cache.ss[targetSerial]) do - if (evokerInfo[1] == sourceSerial) then - table.remove(augmentation_cache.ss[targetSerial], index) - break + elseif (spellid == 413984) then + if (augmentation_cache.ss[targetSerial]) then + for index, evokerInfo in ipairs(augmentation_cache.ss[targetSerial]) do + if (evokerInfo[1] == sourceSerial) then + table.remove(augmentation_cache.ss[targetSerial], index) + break + end end end - end - elseif (spellid == 410089) then - if (augmentation_cache.prescience[targetSerial]) then - for index, evokerInfo in ipairs(augmentation_cache.prescience[targetSerial]) do - if (evokerInfo[1] == sourceSerial) then - table.remove(augmentation_cache.prescience[targetSerial], index) - break + elseif (spellid == 410089) then + if (augmentation_cache.prescience[targetSerial]) then + for index, evokerInfo in ipairs(augmentation_cache.prescience[targetSerial]) do + if (evokerInfo[1] == sourceSerial) then + table.remove(augmentation_cache.prescience[targetSerial], index) + break + end end end - end - elseif (spellid == 360827) then - if (augmentation_cache.shield[targetSerial]) then - for index, evokerInfo in ipairs(augmentation_cache.shield[targetSerial]) do - if (evokerInfo[1] == sourceSerial) then - table.remove(augmentation_cache.shield[targetSerial], index) - break + elseif (spellid == 360827) then + if (augmentation_cache.shield[targetSerial]) then + for index, evokerInfo in ipairs(augmentation_cache.shield[targetSerial]) do + if (evokerInfo[1] == sourceSerial) then + table.remove(augmentation_cache.shield[targetSerial], index) + break + end end end - end - elseif (spellid == 410263) then - if (augmentation_cache.infernobless[targetSerial]) then - for index, evokerInfo in ipairs(augmentation_cache.infernobless[targetSerial]) do - if (evokerInfo[1] == sourceSerial) then - table.remove(augmentation_cache.infernobless[targetSerial], index) - break + elseif (spellid == 410263) then + if (augmentation_cache.infernobless[targetSerial]) then + for index, evokerInfo in ipairs(augmentation_cache.infernobless[targetSerial]) do + if (evokerInfo[1] == sourceSerial) then + table.remove(augmentation_cache.infernobless[targetSerial], index) + break + end end end end @@ -3189,7 +3258,7 @@ --BfA monk talent if (monk_guard_talent [sourceSerial]) then local damage_prevented = monk_guard_talent [sourceSerial] - (amount or 0) - parser:heal (token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellid, spellName, spellSchool, damage_prevented, ceil (amount or 0), 0, 0, true) + parser:heal(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellid, spellName, spellSchool, damage_prevented, ceil (amount or 0), 0, 0, true) end elseif (spellid == 388007 or spellid == 388011) then --buff: bleesing of the summer @@ -3313,7 +3382,7 @@ este_jogador.spellschool = spellschool este_jogador.damage_spellid = spellid este_jogador.debuff_uptime = 0 - este_jogador.debuff_uptime_spells = container_habilidades:NovoContainer (container_misc) + este_jogador.debuff_uptime_spells = spellContainerClass:CreateSpellContainer (container_misc) este_jogador.debuff_uptime_targets = {} end @@ -3458,7 +3527,7 @@ if (not este_jogador.debuff_uptime) then este_jogador.debuff_uptime = 0 - este_jogador.debuff_uptime_spells = container_habilidades:NovoContainer (container_misc) + este_jogador.debuff_uptime_spells = spellContainerClass:CreateSpellContainer (container_misc) este_jogador.debuff_uptime_targets = {} end @@ -3471,7 +3540,7 @@ --actor spells table local spell = este_jogador.debuff_uptime_spells._ActorTable [spellid] if (not spell) then - spell = este_jogador.debuff_uptime_spells:PegaHabilidade (spellid, true, "DEBUFF_UPTIME") + spell = este_jogador.debuff_uptime_spells:GetOrCreateSpell(spellid, true, "DEBUFF_UPTIME") end return _spell_utility_func (spell, alvo_serial, alvo_name, alvo_flags, who_name, este_jogador, "BUFF_OR_DEBUFF", in_out) @@ -3488,7 +3557,7 @@ --get actors local este_jogador = misc_cache [who_name] if (not este_jogador) then --pode ser um desconhecido ou um pet - este_jogador = _current_misc_container:GetOrCreateActor (who_serial, who_name, who_flags, true) + este_jogador = _current_misc_container:GetOrCreateActor(who_serial, who_name, who_flags, true) misc_cache [who_name] = este_jogador end @@ -3497,7 +3566,7 @@ if (not este_jogador.buff_uptime) then este_jogador.buff_uptime = 0 - este_jogador.buff_uptime_spells = container_habilidades:NovoContainer (container_misc) + este_jogador.buff_uptime_spells = spellContainerClass:CreateSpellContainer(container_misc) este_jogador.buff_uptime_targets = {} end @@ -3510,7 +3579,7 @@ --actor spells table local spell = este_jogador.buff_uptime_spells._ActorTable [spellid] if (not spell) then - spell = este_jogador.buff_uptime_spells:PegaHabilidade (spellid, true, "BUFF_UPTIME") + spell = este_jogador.buff_uptime_spells:GetOrCreateSpell(spellid, true, "BUFF_UPTIME") end return _spell_utility_func (spell, alvo_serial, alvo_name, alvo_flags, who_name, este_jogador, "BUFF_OR_DEBUFF", in_out) @@ -3768,7 +3837,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 --actor spells table local spellTable = sourceActor.spells._ActorTable[spellId] if (not spellTable) then - spellTable = sourceActor.spells:PegaHabilidade(spellId, true, token) + spellTable = sourceActor.spells:GetOrCreateSpell(spellId, true, token) end --return spell:Add (alvo_serial, alvo_name, alvo_flags, amount, who_name, powertype) @@ -3809,7 +3878,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 if (not sourceActor.cooldowns_defensive) then sourceActor.cooldowns_defensive = Details:GetOrderNumber(sourceName) sourceActor.cooldowns_defensive_targets = {} - sourceActor.cooldowns_defensive_spells = container_habilidades:NovoContainer(container_misc) + sourceActor.cooldowns_defensive_spells = spellContainerClass:CreateSpellContainer(container_misc) end --local targetActor, targetOwner = damage_cache[targetSerial] or damage_cache_pets[targetSerial] or damage_cache[targetName], damage_cache_petsOwners[targetSerial] @@ -3875,7 +3944,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 --actor spells table local spellTable = sourceActor.cooldowns_defensive_spells._ActorTable[spellId] if (not spellTable) then - spellTable = sourceActor.cooldowns_defensive_spells:PegaHabilidade(spellId, true, token) + spellTable = sourceActor.cooldowns_defensive_spells:GetOrCreateSpell(spellId, true, token) end if (_hook_cooldowns) then @@ -3891,7 +3960,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 return _spell_utility_func(spellTable, targetSerial, targetName, targetFlags, sourceName, token, "BUFF_OR_DEBUFF", "COOLDOWN") end - --serach key: ~interrupts + --serach key: ~interrupt ---comment: this function is called when a spell is interrupted ---@param token string ---@param time unixtime @@ -3939,7 +4008,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 if (not sourceActor.interrupt) then sourceActor.interrupt = Details:GetOrderNumber() sourceActor.interrupt_targets = {} - sourceActor.interrupt_spells = container_habilidades:NovoContainer(container_misc) + sourceActor.interrupt_spells = spellContainerClass:CreateSpellContainer(container_misc) sourceActor.interrompeu_oque = {} end @@ -3968,7 +4037,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 --actor spells table local spell = sourceActor.interrupt_spells._ActorTable[spellId] if (not spell) then - spell = sourceActor.interrupt_spells:PegaHabilidade(spellId, true, token) + spell = sourceActor.interrupt_spells:GetOrCreateSpell(spellId, true, token) end _spell_utility_func(spell, targetSerial, targetName, targetFlags, sourceName, token, extraSpellID, extraSpellName) @@ -3977,7 +4046,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 if (not ownerActor.interrupt) then ownerActor.interrupt = Details:GetOrderNumber(sourceName) ownerActor.interrupt_targets = {} - ownerActor.interrupt_spells = container_habilidades:NovoContainer(container_misc) + ownerActor.interrupt_spells = spellContainerClass:CreateSpellContainer(container_misc) ownerActor.interrompeu_oque = {} end @@ -4111,7 +4180,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 ---@type spelltable local spellTable = enemyActorObject.spells._ActorTable[spellId] if (not spellTable) then - spellTable = enemyActorObject.spells:PegaHabilidade(spellId, true, token) + spellTable = enemyActorObject.spells:GetOrCreateSpell(spellId, true, token) end spellTable.successful_casted = spellTable.successful_casted + 1 end @@ -4174,7 +4243,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 sourceActor.dispell_targets = {} ---@type spellcontainer - sourceActor.dispell_spells = container_habilidades:NovoContainer(container_misc) + sourceActor.dispell_spells = spellContainerClass:CreateSpellContainer(container_misc) ---@type table sourceActor.dispell_oque = {} @@ -4220,7 +4289,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 ---@type spelltable local spellTable = sourceActor.dispell_spells._ActorTable[spellId] if (not spellTable) then - spellTable = sourceActor.dispell_spells:PegaHabilidade(spellId, true, token) + spellTable = sourceActor.dispell_spells:GetOrCreateSpell(spellId, true, token) end _spell_utility_func(spellTable, targetSerial, targetName, targetFlags, sourceName, token, extraSpellID, extraSpellName) @@ -4229,7 +4298,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 if (not ownerActor.dispell) then ownerActor.dispell = Details:GetOrderNumber(sourceName) ownerActor.dispell_targets = {} - ownerActor.dispell_spells = container_habilidades:NovoContainer(container_misc) + ownerActor.dispell_spells = spellContainerClass:CreateSpellContainer(container_misc) ownerActor.dispell_oque = {} end @@ -4244,12 +4313,8 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end --serach key: ~ress - function parser:ress (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname) - - ------------------------------------------------------------------------------------------------ - --early checks and fixes - - if (bitBand(who_flags, AFFILIATION_GROUP) == 0) then + function parser:ress(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName) + if (bitBand(sourceFlags, AFFILIATION_GROUP) == 0) then return end @@ -4260,65 +4325,55 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _current_misc_container.need_refresh = true - ------------------------------------------------------------------------------------------------ - --get actors - --main actor - local este_jogador, meu_dono = misc_cache [who_name] - if (not este_jogador) then --pode ser um desconhecido ou um pet - este_jogador, meu_dono, who_name = _current_misc_container:GetOrCreateActor (who_serial, who_name, who_flags, true) - if (not meu_dono) then --se n�o for um pet, add no cache - misc_cache [who_name] = este_jogador + local sourceActor, ownerActor = misc_cache[sourceName] + if (not sourceActor) then + sourceActor, ownerActor, sourceName = _current_misc_container:GetOrCreateActor(sourceSerial, sourceName, sourceFlags, true) + if (not ownerActor) then --if not a pet, add no cache + misc_cache[sourceName] = sourceActor end end - ------------------------------------------------------------------------------------------------ - --build containers on the fly - - if (not este_jogador.ress) then - este_jogador.ress = Details:GetOrderNumber(who_name) - este_jogador.ress_targets = {} - este_jogador.ress_spells = container_habilidades:NovoContainer (container_misc) --cria o container das habilidades usadas para interromper - end - - ------------------------------------------------------------------------------------------------ - --add amount - --update last event - este_jogador.last_event = _tempo + sourceActor.last_event = _tempo - --combat ress total - _current_total [4].ress = _current_total [4].ress + 1 + --build containers on the fly + if (not sourceActor.ress) then + sourceActor.ress = Details:GetOrderNumber(sourceName) + sourceActor.ress_targets = {} + sourceActor.ress_spells = spellContainerClass:CreateSpellContainer(container_misc) --cria o container das habilidades usadas para interromper + end - if (este_jogador.grupo) then - _current_combat.totals_grupo[4].ress = _current_combat.totals_grupo[4].ress+1 + --add amount + _current_total[4].ress = _current_total[4].ress + 1 + if (sourceActor.grupo) then + _current_combat.totals_grupo[4].ress = _current_combat.totals_grupo[4].ress + 1 end --add ress amount - este_jogador.ress = este_jogador.ress + 1 + sourceActor.ress = sourceActor.ress + 1 --add battle ress - if (UnitAffectingCombat(who_name)) then - --procura a �ltima morte do alvo na tabela do combate: + if (UnitAffectingCombat(sourceName)) then + --search for the latest death of the target actor for i = 1, #_current_combat.last_events_tables do - if (_current_combat.last_events_tables [i] [3] == alvo_name) then - - local deadLog = _current_combat.last_events_tables [i] [1] + if (_current_combat.last_events_tables[i][3] == targetName) then + local deathLog = _current_combat.last_events_tables[i][1] --deathinfo index 1 = a table with the death log local jaTem = false - for _, evento in ipairs(deadLog) do - if (evento [1] and not evento[3]) then + for _, evento in ipairs(deathLog) do + if (evento[1] and not evento[3]) then jaTem = true end end if (not jaTem) then - tinsert(_current_combat.last_events_tables [i] [1], 1, { + tinsert(_current_combat.last_events_tables[i][1], 1, { 2, - spellid, + spellId, 1, time, - UnitHealth (alvo_name), - who_name + UnitHealth(targetName), + sourceName }) break end @@ -4327,21 +4382,21 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 if (_hook_battleress) then for _, func in ipairs(_hook_battleress_container) do - func (nil, token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname) + func (nil, token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, spellId, spellName) end end end --actor targets - este_jogador.ress_targets [alvo_name] = (este_jogador.ress_targets [alvo_name] or 0) + 1 + sourceActor.ress_targets[targetName] = (sourceActor.ress_targets[targetName] or 0) + 1 --actor spells table - local spell = este_jogador.ress_spells._ActorTable [spellid] + local spell = sourceActor.ress_spells._ActorTable[spellId] if (not spell) then - spell = este_jogador.ress_spells:PegaHabilidade (spellid, true, token) + spell = sourceActor.ress_spells:GetOrCreateSpell(spellId, true, token) end - return _spell_utility_func (spell, alvo_serial, alvo_name, alvo_flags, who_name, token, extraSpellID, extraSpellName) + return _spell_utility_func(spell, targetSerial, targetName, targetFlags, sourceName, token) end --serach key: ~cc @@ -4383,7 +4438,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 sourceActor.cc_break_targets = {} sourceActor.cc_break_oque = {} ---@type spellcontainer - sourceActor.cc_break_spells = container_habilidades:NovoContainer(container_misc) + sourceActor.cc_break_spells = spellContainerClass:CreateSpellContainer(container_misc) end sourceActor.last_event = _tempo @@ -4406,7 +4461,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 ---@type spelltable local spellTable = sourceActor.cc_break_spells._ActorTable[extraSpellID] if (not spellTable) then - spellTable = sourceActor.cc_break_spells:PegaHabilidade(extraSpellID, true, token) + spellTable = sourceActor.cc_break_spells:GetOrCreateSpell(extraSpellID, true, token) end return _spell_utility_func(spellTable, targetSerial, targetName, targetFlags, sourceName, token, spellId, spellName) end diff --git a/frames/window_main.lua b/frames/window_main.lua index 4ed8a7eea..448a3565b 100644 --- a/frames/window_main.lua +++ b/frames/window_main.lua @@ -4020,6 +4020,12 @@ end local onLeaveExtraStatusbar = function(self) self:SetAlpha(self.defaultAlpha) + if (self.OnLeaveCallback) then + local okay, errorText = pcall(self.OnLeaveCallback, self) + if (not okay) then + Details:Msg("Error on extra statusbar OnEnterCallback: ", errorText) + end + end end --alias diff --git a/functions/profiles.lua b/functions/profiles.lua index 28034fb9f..4506b6099 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -1370,6 +1370,8 @@ local default_global_data = { current_exp_raid_encounters = {}, installed_skins_cache = {}, + show_aug_predicted_spell_damage = false, + show_warning_id1 = true, show_warning_id1_amount = 0,