diff --git a/Details.toc b/Details.toc index 207acd23a..938697a82 100644 --- a/Details.toc +++ b/Details.toc @@ -156,6 +156,7 @@ core\network.lua core\parser.lua +functions\spec_augmentation.lua functions\loaddata.lua startup.lua diff --git a/Details_Classic.toc b/Details_Classic.toc index 30af5d3d5..348dfd4cd 100644 --- a/Details_Classic.toc +++ b/Details_Classic.toc @@ -151,6 +151,7 @@ core\network.lua core\parser.lua #core\parser_timewalk.lua +functions\spec_augmentation.lua functions\loaddata.lua startup.lua diff --git a/Details_Wrath.toc b/Details_Wrath.toc index f0e1bd3d7..fcb397ba5 100644 --- a/Details_Wrath.toc +++ b/Details_Wrath.toc @@ -151,6 +151,7 @@ core\network.lua core\parser.lua #core\parser_timewalk.lua +functions\spec_augmentation.lua functions\loaddata.lua startup.lua diff --git a/Libs/LibLuaServer/LibLuaServer.lua b/Libs/LibLuaServer/LibLuaServer.lua index b19189075..52d8ef8a4 100644 --- a/Libs/LibLuaServer/LibLuaServer.lua +++ b/Libs/LibLuaServer/LibLuaServer.lua @@ -211,15 +211,16 @@ ---@alias npcid number a number that identifies a specific npc in the game. ---@alias textureid number each texture from the game client has an id. ---@alias texturepath string access textures from addons. ----@alias unixtime number ---@alias valueamount number used to represent a value, such as a damage amount, a healing amount, or a resource amount. +---@alias unixtime number a number that represents the number of seconds that have elapsed since 00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January 1970, not counting leap seconds. ---@alias timestring string refers to a string showing a time value, such as "1:23" or "1:23:45". ---@alias combattime number elapsed time of a combat or time in seconds that a unit has been in combat. +---@alias auraduration number +---@alias gametime number number of seconds that have elapsed since the start of the game session. ---@alias coordleft number ---@alias coordright number ---@alias coordtop number ---@alias coordbottom number ----@alias auraduration number ---@class _G ---@field RegisterAttributeDriver fun(statedriver: frame, attribute: string, conditional: string) diff --git a/boot.lua b/boot.lua index 9996d838c..d46004338 100644 --- a/boot.lua +++ b/boot.lua @@ -13,8 +13,8 @@ local addonName, Details222 = ... local version, build, date, tocversion = GetBuildInfo() - Details.build_counter = 11718 - Details.alpha_build_counter = 11718 --if this is higher than the regular counter, use it instead + Details.build_counter = 11770 + Details.alpha_build_counter = 11770 --if this is higher than the regular counter, use it instead Details.dont_open_news = true Details.game_version = version Details.userversion = version .. " " .. Details.build_counter @@ -115,6 +115,9 @@ Details222.ClassCache.ByGUID = {} Details222.UnitIdCache = {} Details222.Roskash = {} + Details222.SpecHelpers = { + [1473] = {}, + } Details222.Actors = {} diff --git a/classes/class_damage.lua b/classes/class_damage.lua index 33e360aae..33366a67a 100644 --- a/classes/class_damage.lua +++ b/classes/class_damage.lua @@ -202,7 +202,7 @@ function Details:IsFriendlyNpc() --[[exported]] return false end -function Details:IsEnemy() --[[exported]] +function Details:IsEnemy() --[[exported]] if (self.flag_original) then if (bitBand(self.flag_original, 0x00000060) ~= 0) then local npcId = Details:GetNpcIdFromGuid(self.serial) @@ -214,7 +214,7 @@ function Details:IsEnemy() --[[exported]] end return false end - + function Details:GetSpellList() --[[exported]] return self.spells._ActorTable end @@ -772,34 +772,34 @@ end local DTBS_search_code = [[ ---@type combat, table, instance local combatObject, instanceContainer, instanceObject = ... - + --declade the values to return local totalDamage, topDamage, amount = 0, 0, 0 - + ---@type {key1: actorname, key2: number, key3: actor}[] local damageTakenFrom = {} - + local spellId = @SPELLID@ local spellName if (spellId) then spellName = select(1, GetSpellInfo(spellId)) end - + ---@type actorcontainer local damageContainer = combatObject:GetContainer(DETAILS_ATTRIBUTE_DAMAGE) ---@type actorcontainer local healContainer = combatObject:GetContainer(DETAILS_ATTRIBUTE_HEAL) - + local bIsCustomSpell = false for _, customSpellObject in ipairs(Details.savedCustomSpells) do if (customSpellObject[1] == spellId) then bIsCustomSpell = true end end - + for index, actorObject in damageContainer:ListActors() do ---@cast actorObject actordamage - + --> handle friendly fire spell damage taken if (actorObject:IsPlayer()) then if (bIsCustomSpell) then --if the spell has been modified, check only by its spellId, as it can't get other spells with the same name @@ -810,10 +810,10 @@ end local damageActor = damageContainer:GetActor(playerName) ---@type actorheal local healingActor = healContainer:GetActor(playerName) - + if ((damageActor and damageActor:IsPlayer()) or (healingActor and healingActor:IsPlayer())) then local got - + for index, damageTakenTable in ipairs(damageTakenFrom) do if (damageTakenTable[1] == playerName) then damageTakenTable[2] = damageTakenTable[2] + friendlyFireTable.spells[spellId] @@ -824,7 +824,7 @@ end break end end - + if (not got) then ---@type {key1: actorname, key2: number, key3: actor} local damageTakenTable = {playerName, friendlyFireTable.spells[spellId], damageActor or healingActor} @@ -846,7 +846,7 @@ end local damageActor = damageContainer:GetActor(playerName) ---@type actorheal local healingActor = healContainer:GetActor(playerName) - + if ((damageActor and damageActor:IsPlayer()) or (healingActor and healingActor:IsPlayer())) then local got for index, damageTakenTable in ipairs(damageTakenFrom) do @@ -859,7 +859,7 @@ end break end end - + if (not got) then ---@type {key1: actorname, key2: number, key3: actor} local damageTakenTable = {playerName, damageAmount, damageActor or healingActor} @@ -874,20 +874,20 @@ end end end end - + --> handle regular damage taken from spells ---@type spelltable local spellTable = actorObject:GetSpell(spellId) - + if (spellTable) then for targetName, damageAmount in pairs(spellTable.targets) do local got = false - + ---@type actordamage local damageActor = damageContainer:GetActor(targetName) ---@type actorheal local healingActor = healContainer:GetActor(targetName) - + if ((damageActor and damageActor:IsPlayer()) or (healingActor and healingActor:IsPlayer())) then for index, damageTakenTable in ipairs(damageTakenFrom) do if (damageTakenTable[1] == targetName) then @@ -899,7 +899,7 @@ end break end end - + if (not got) then ---@type {key1: actorname, key2: number, key3: actor} local damageTakenTable = {targetName, damageAmount, damageActor or healingActor} @@ -911,7 +911,7 @@ end end end end - + if (not bIsCustomSpell) then for thisSpellId, spellTable in pairs(actorObject.spells._ActorTable) do if (thisSpellId ~= spellId) then --this is invalid @@ -919,12 +919,12 @@ end if (spellname == spellName) then for targetName, damageAmount in pairs(spellTable.targets) do local got = false - + ---@type actordamage local damageActor = damageContainer:GetActor(targetName) ---@type actorheal local healingActor = healContainer:GetActor(targetName) - + if ((damageActor and damageActor:IsPlayer()) or (healingActor and healingActor:IsPlayer())) then for index, damageTakenTable in ipairs(damageTakenFrom) do if (damageTakenTable[1] == targetName) then @@ -936,7 +936,7 @@ end break end end - + if (not got) then ---@type {key1: actorname, key2: number, key3: actor} local damageTakenTable = {targetName, damageAmount, damageActor or healingActor} @@ -952,15 +952,15 @@ end end end end - + table.sort(damageTakenFrom, Details.Sort2) - + for index, damageTakenTable in ipairs(damageTakenFrom) do instanceContainer:AddValue(damageTakenTable[3], damageTakenTable[2]) --actorObject, amountDamage totalDamage = totalDamage + damageTakenTable[2] --amountDamage amount = amount + 1 end - + return totalDamage, topDamage, amount ]] @@ -1116,7 +1116,7 @@ end thisLine.iconHighlight:SetTexCoord(classIcon:GetTexCoord()) thisLine.iconHighlight:SetVertexColor(classIcon:GetVertexColor()) end - + end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -3398,20 +3398,29 @@ function damageClass.PredictedAugSpellsOnEnter(self) local spellName, _, spellTexture = GetSpellInfo(spellId) if (spellName) then GameCooltip:AddLine(spellName, Details:Format(spellTable.total)) - GameCooltip:AddIcon(spellTexture, 1, 1, 18, 18) + GameCooltip:AddIcon(spellTexture, 1, 1, 14, 14) - --the damage sources are added into the targets table for reciclying + local spellsAugmented = {} + + --the damage sources are added into the targets table for recycling ---@type table local sources = spellTable.targets for sourceName, sourceAmount in pairs(sources) do + spellsAugmented[#spellsAugmented+1] = {sourceName, sourceAmount} + end + + table.sort(spellsAugmented, Details.Sort2) + + for i = 1, #spellsAugmented do + local sourceName, sourceAmount = unpack(spellsAugmented[i]) 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) + GameCooltip:AddIcon(actorIcon.texture, 1, 1, 14, 14, actorIcon.coords.left, actorIcon.coords.right, actorIcon.coords.top, actorIcon.coords.bottom) else - GameCooltip:AddIcon([[Interface\COMMON\Indicator-Gray]], 1, 1, 18, 18) + GameCooltip:AddIcon([[Interface\COMMON\Indicator-Gray]], 1, 1, 14, 14) end end end @@ -3640,7 +3649,7 @@ function damageClass:ToolTip_DamageDone (instancia, numero, barra, keydown) for i = 1, math.min(max_targets, #ActorTargetsSortTable) do local enemyTable = ActorTargetsSortTable[i] GameCooltip:AddLine(enemyTable[1], FormatTooltipNumber(_, enemyTable[2]) .." ("..format("%.1f", enemyTable[2] / ActorDamageWithPet * 100).."%)") - + local portraitTexture-- = Details222.Textures.GetPortraitTextureForNpcID(enemyTable[3]) --disabled atm if (portraitTexture) then GameCooltip:AddIcon(portraitTexture, 1, 1, icon_size.W, icon_size.H) @@ -4842,7 +4851,7 @@ end não passar nada e deixar o sistema aprender sozinho, como o sistema vai saber que precisa por uma arrow na linha? (para expandi-la) - + --]=] ------ Damage Done & Dps @@ -4980,7 +4989,7 @@ function damageClass:MontaInfoDamageDone() --I guess this fills the list of spel --output breakdownSpellDataList[#breakdownSpellDataList+1] = bkSpellData - --fill here the spellTables using the actor abilities + --fill here the spellTables using the actor abilities --all these spells belong to the current actor in the loop for spellId, spellTable in petSpellContainer:ListSpells() do local spellName, _, spellIcon = GetSpellInfo(spellId) @@ -6885,7 +6894,7 @@ damageClass.__add = function(tabela1, tabela2) if (not habilidade_tabela1[key]) then habilidade_tabela1[key] = {} end - for empowermentLevel, empowermentValue in pairs(habilidade[key]) do + for empowermentLevel, empowermentValue in pairs(habilidade[key]) do habilidade_tabela1[key][empowermentLevel] = habilidade_tabela1[key][empowermentValue] or 0 + empowermentValue end end diff --git a/core/parser.lua b/core/parser.lua index 688d103cb..07906397f 100755 --- a/core/parser.lua +++ b/core/parser.lua @@ -204,8 +204,15 @@ infernobless = {}, } + Details222.SpecHelpers[1473].augmentation_cache = augmentation_cache + local empower_cache = {} + local scale_factors = { + [256] = 3.80,--disc priest + [254] = 9.73, --hunter mm + } + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --constants local container_misc = Details.container_type.CONTAINER_MISC_CLASS @@ -1240,182 +1247,185 @@ --amount add --~roskash - augmentation evoker damage buff - if (augmentation_cache.ebon_might[sourceSerial] and sourceName ~= Details.playername) then + if (augmentation_cache.ebon_might[sourceSerial]) then ---actor buffed with ebonmight -> list of evokers whose buffed ---@type table local currentlyBuffedWithEbonMight = augmentation_cache.ebon_might[sourceSerial] for i, evokerInfo in ipairs(currentlyBuffedWithEbonMight) do ---@cast evokerInfo evokerinfo - ---@type serial, actorname, controlflags - local evokerSourceSerial, evokerSourceName, evokerSourceFlags = unpack(evokerInfo) + local evokerSourceSerial, evokerSourceName, evokerSourceFlags, attributedGained = unpack(evokerInfo) - ---@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) + if (evokerSourceSerial ~= sourceSerial) then + ---@type actor + local evokerActor = damage_cache[evokerSourceSerial] + if (not evokerActor) then + evokerActor = _current_damage_container:GetOrCreateActor(evokerSourceSerial, evokerSourceName, evokerSourceFlags, true) end - evokerActor.total_extra = evokerActor.total_extra or 0 - local predictedAmount = 0 - if (Details.zone_type == "raid") then - predictedAmount = amount * 0.1389541 - else - predictedAmount = amount * 0.1683245 - 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 + + local predictedAmount = 0 + if (Details.zone_type == "raid") then + predictedAmount = amount * 0.06947705 + else + predictedAmount = amount * 0.08416225 + end - evokerActor.total_extra = evokerActor.total_extra + predictedAmount - augmentedSpell.total = augmentedSpell.total + predictedAmount - augmentedSpell.targets[sourceName] = (augmentedSpell.targets[sourceName] or 0) + predictedAmount + evokerActor.total_extra = evokerActor.total_extra + predictedAmount + augmentedSpell.total = augmentedSpell.total + predictedAmount + augmentedSpell.targets[sourceName] = (augmentedSpell.targets[sourceName] or 0) + predictedAmount + end end end end - if (augmentation_cache.ss[sourceSerial] and sourceName ~= Details.playername) then --actor buffed with ss - --print(sourceName, "has ss buff") + if (augmentation_cache.ss[sourceSerial]) then --actor buffed with ss ---@type table local currentlyBuffedWithSS = augmentation_cache.ss[sourceSerial] for i, evokerInfo in ipairs(currentlyBuffedWithSS) do ---@cast evokerInfo evokerinfo - ---@type serial, actorname, controlflags local evokerSourceSerial, evokerSourceName, evokerSourceFlags, versaBuff = unpack(evokerInfo) - ---@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 = 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) + if (evokerSourceSerial ~= sourceSerial) then + ---@type actor + local evokerActor = damage_cache[evokerSourceSerial] + if (not evokerActor) then + evokerActor = _current_damage_container:GetOrCreateActor(evokerSourceSerial, evokerSourceName, evokerSourceFlags, true) end - versaBuff = versaBuff / 100 - local predictedAmount = amount * versaBuff - evokerActor.total_extra = evokerActor.total_extra + predictedAmount + 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 + local predictedAmount = amount * versaBuff * 0.73548755 + evokerActor.total_extra = evokerActor.total_extra + predictedAmount - augmentedSpell.total = augmentedSpell.total + predictedAmount - augmentedSpell.targets[sourceName] = (augmentedSpell.targets[sourceName] or 0) + predictedAmount + augmentedSpell.total = augmentedSpell.total + predictedAmount + augmentedSpell.targets[sourceName] = (augmentedSpell.targets[sourceName] or 0) + predictedAmount + end end end end - if (spellId == 360828 and augmentation_cache.shield[sourceSerial] and sourceName ~= Details.playername) then --shield + if (spellId == 360828 and augmentation_cache.shield[sourceSerial]) then --shield ---actor buffed with the shield -> list of evokers whose buffed ---@type table local currentlyBuffedWithShield = augmentation_cache.shield[sourceSerial] for i, evokerInfo in ipairs(currentlyBuffedWithShield) do ---@cast evokerInfo evokerinfo - ---@type serial, actorname, controlflags local evokerSourceSerial, evokerSourceName, evokerSourceFlags = unpack(evokerInfo) - ---@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) + if (evokerSourceSerial ~= sourceSerial) then + ---@type actor + local evokerActor = damage_cache[evokerSourceSerial] + if (not evokerActor) then + evokerActor = _current_damage_container:GetOrCreateActor(evokerSourceSerial, evokerSourceName, evokerSourceFlags, true) end - local damageSplitted = amount / #currentlyBuffedWithShield - evokerActor.total_extra = evokerActor.total_extra + damageSplitted + 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 + augmentedSpell.total = augmentedSpell.total + damageSplitted + augmentedSpell.targets[sourceName] = (augmentedSpell.targets[sourceName] or 0) + damageSplitted + end end end end - if (spellId == 404908 and augmentation_cache.prescience[sourceSerial] and sourceName ~= Details.playername) then --fate mirror + if (spellId == 404908 and augmentation_cache.prescience[sourceSerial]) then --fate mirror ---actor buffed with prescience -> list of evokers whose buffed ---@type table local currentlyBuffedWithPrescience = augmentation_cache.prescience[sourceSerial] for i, evokerInfo in ipairs(currentlyBuffedWithPrescience) do ---@cast evokerInfo evokerinfo - ---@type serial, actorname, controlflags local evokerSourceSerial, evokerSourceName, evokerSourceFlags = unpack(evokerInfo) + if (evokerSourceSerial ~= sourceSerial) then + ---@type actor + local evokerActor = damage_cache[evokerSourceSerial] + if (not evokerActor) then + evokerActor = _current_damage_container:GetOrCreateActor(evokerSourceSerial, evokerSourceName, evokerSourceFlags, true) + end - ---@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 = 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 - if (evokerActor) then - 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 + local fateMirror_plus_Prescience = amount + amount * 0.56848040 - evokerActor.total_extra = evokerActor.total_extra + amount + evokerActor.total_extra = evokerActor.total_extra + fateMirror_plus_Prescience - augmentedSpell.total = augmentedSpell.total + amount - augmentedSpell.targets[sourceName] = (augmentedSpell.targets[sourceName] or 0) + amount + augmentedSpell.total = augmentedSpell.total + fateMirror_plus_Prescience + augmentedSpell.targets[sourceName] = (augmentedSpell.targets[sourceName] or 0) + fateMirror_plus_Prescience + end end end end - if (spellId == 410265 and augmentation_cache.infernobless[sourceSerial] and sourceName ~= Details.playername) then + if (spellId == 410265 and augmentation_cache.infernobless[sourceSerial]) then ---@type table local currentlyBuffedWithInfernoBless = augmentation_cache.infernobless[sourceSerial] for i, evokerInfo in ipairs(currentlyBuffedWithInfernoBless) do ---@cast evokerInfo evokerinfo - ---@type serial, actorname, controlflags local evokerSourceSerial, evokerSourceName, evokerSourceFlags = unpack(evokerInfo) - ---@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 = 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) + if (evokerSourceSerial ~= sourceSerial) then + ---@type actor + local evokerActor = damage_cache[evokerSourceSerial] + if (not evokerActor) then + evokerActor = _current_damage_container:GetOrCreateActor(evokerSourceSerial, evokerSourceName, evokerSourceFlags, true) end - evokerActor.total_extra = evokerActor.total_extra + amount + if (evokerActor) then + 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 + augmentedSpell.total = augmentedSpell.total + amount + augmentedSpell.targets[sourceName] = (augmentedSpell.targets[sourceName] or 0) + amount + end end end end - if (spellId == 409632 and sourceName ~= Details.playername) then + if (spellId == 409632) then local breathTargets = augmentation_cache.breath_targets - ---@type evokereonsbreathinfo[] local evokerWithEonsApplications = breathTargets[targetSerial] @@ -1424,15 +1434,11 @@ for i = 1, #evokerWithEonsApplications do ---@type evokereonsbreathinfo local evokerInfo = evokerWithEonsApplications[i] - local appliedTime = evokerInfo[5] - local duration = evokerInfo[6] - - if (detailsFramework:IsNearlyEqual(time, appliedTime + duration, 0.05)) then - local evokerName = evokerInfo[2] - if (evokerName ~= Details.playername) then - local evokerSerial = evokerInfo[1] - local evokerFlags = evokerInfo[3] + ---@type guid, actorname, controlflags, unit, unixtime, auraduration, gametime + local evokerSerial, evokerName, evokerFlags, unitIDAffected, appliedTime, duration, expirationTime = unpack(evokerInfo) + if (evokerSerial ~= sourceSerial) then + if (detailsFramework:IsNearlyEqual(time, appliedTime + duration, 0.12)) then ---@type actor local evokerActor = damage_cache[evokerSerial] if (not evokerActor) then @@ -2699,63 +2705,7 @@ end 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 - - 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 - - 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) - end + Details222.SpecHelpers[1473].BuffIn(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, spellschool, auraType, amount) end if (buffs_makeyourown[spellId]) then @@ -2941,80 +2891,6 @@ end end - --~crowd control ~ccdone - function parser:add_cc_done(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName) - _current_misc_container.need_refresh = true - - ---@type actor - 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 - misc_cache[sourceName] = sourceActor - end - end - - sourceActor.last_event = _tempo - - if (not sourceActor.cc_done) then - sourceActor.cc_done = Details:GetOrderNumber() - sourceActor.cc_done_spells = spellContainerClass:CreateSpellContainer(container_misc) - sourceActor.cc_done_targets = {} - end - - --add amount - sourceActor.cc_done = sourceActor.cc_done + 1 - sourceActor.cc_done_targets[targetName] = (sourceActor.cc_done_targets[targetName] or 0) + 1 - - --actor spells table - local spellTable = sourceActor.cc_done_spells._ActorTable[spellId] - if (not spellTable) then - spellTable = sourceActor.cc_done_spells:GetOrCreateSpell(spellId, true) - end - spellTable.targets[targetName] = (spellTable.targets[targetName] or 0) + 1 - spellTable.counter = spellTable.counter + 1 - - --add the crowd control for the pet owner - if (ownerActor) then - if (not ownerActor.cc_done) then - ownerActor.cc_done = Details:GetOrderNumber() - ownerActor.cc_done_spells = spellContainerClass:CreateSpellContainer(container_misc) - ownerActor.cc_done_targets = {} - end - - --add amount - ownerActor.cc_done = ownerActor.cc_done + 1 - ownerActor.cc_done_targets[targetName] = (ownerActor.cc_done_targets[targetName] or 0) + 1 - - --actor spells table - local ownerSpellTable = ownerActor.cc_done_spells._ActorTable[spellId] - if (not ownerSpellTable) then - ownerSpellTable = ownerActor.cc_done_spells:GetOrCreateSpell(spellId, true) - end - - ownerSpellTable.targets[targetName] = (ownerSpellTable.targets[targetName] or 0) + 1 - ownerSpellTable.counter = ownerSpellTable.counter + 1 - end - - if (not sourceActor.classe) then - if (sourceFlags and bitBand(sourceFlags, OBJECT_TYPE_PLAYER) ~= 0) then - if (sourceActor.classe == "UNKNOW" or sourceActor.classe == "UNGROUPPLAYER") then - ---@type actor - local damageActor = damage_cache [sourceSerial] - if (damageActor and (damageActor.classe ~= "UNKNOW" and damageActor.classe ~= "UNGROUPPLAYER")) then - sourceActor.classe = damageActor.classe - else - ---@type actor - local healingActor = healing_cache[sourceSerial] - if (healingActor and (healingActor.classe ~= "UNKNOW" and healingActor.classe ~= "UNGROUPPLAYER")) then - sourceActor.classe = healingActor.classe - end - end - end - end - end - end - function parser:buff_refresh(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellid, spellName, spellschool, tipo, amount) if (not sourceName) then sourceName = names_cache[spellName] @@ -3026,6 +2902,10 @@ sourceSerial = "" end + if (special_buffs_spells[spellid]) then + Details222.SpecHelpers[1473].BuffRefresh(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellid, spellName, spellschool, tipo, amount) + end + if (tipo == "BUFF") then if (spellid == 272790 and cacheAnything.track_hunter_frenzy) then --hunter pet Frenzy spellid local miscActorObject = misc_cache[sourceName] @@ -3046,64 +2926,6 @@ return end - 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 - end - 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 - - 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 - end - end - - if (not bFound) then - table.insert(augmentation_cache.ss[targetSerial], {sourceSerial, sourceName, sourceFlags, versaGained}) - end - end - end - - 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 - end - end - - if (not bFound) then - table.insert(augmentation_cache.prescience[targetSerial], {sourceSerial, sourceName, sourceFlags, amount}) - end - end - end - if (buffs_makeyourown[spellid]) then sourceSerial, sourceName, sourceFlags = targetSerial, targetName, targetFlags end @@ -3176,60 +2998,11 @@ sourceSerial = "" end - if (tipo == "BUFF") then - 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 - - 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 - - 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 - - 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 - - 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 - end + if (special_buffs_spells[spellid]) then + Details222.SpecHelpers[1473].BuffOut(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellid, spellName, spellSchool, tipo, amount) + end + if (tipo == "BUFF") then if (buffs_makeyourown[spellid]) then sourceSerial, sourceName, sourceFlags = targetSerial, targetName, targetFlags end @@ -3350,6 +3123,80 @@ end end + --~crowd control ~ccdone + function parser:add_cc_done(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName) + _current_misc_container.need_refresh = true + + ---@type actor + 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 + misc_cache[sourceName] = sourceActor + end + end + + sourceActor.last_event = _tempo + + if (not sourceActor.cc_done) then + sourceActor.cc_done = Details:GetOrderNumber() + sourceActor.cc_done_spells = spellContainerClass:CreateSpellContainer(container_misc) + sourceActor.cc_done_targets = {} + end + + --add amount + sourceActor.cc_done = sourceActor.cc_done + 1 + sourceActor.cc_done_targets[targetName] = (sourceActor.cc_done_targets[targetName] or 0) + 1 + + --actor spells table + local spellTable = sourceActor.cc_done_spells._ActorTable[spellId] + if (not spellTable) then + spellTable = sourceActor.cc_done_spells:GetOrCreateSpell(spellId, true) + end + spellTable.targets[targetName] = (spellTable.targets[targetName] or 0) + 1 + spellTable.counter = spellTable.counter + 1 + + --add the crowd control for the pet owner + if (ownerActor) then + if (not ownerActor.cc_done) then + ownerActor.cc_done = Details:GetOrderNumber() + ownerActor.cc_done_spells = spellContainerClass:CreateSpellContainer(container_misc) + ownerActor.cc_done_targets = {} + end + + --add amount + ownerActor.cc_done = ownerActor.cc_done + 1 + ownerActor.cc_done_targets[targetName] = (ownerActor.cc_done_targets[targetName] or 0) + 1 + + --actor spells table + local ownerSpellTable = ownerActor.cc_done_spells._ActorTable[spellId] + if (not ownerSpellTable) then + ownerSpellTable = ownerActor.cc_done_spells:GetOrCreateSpell(spellId, true) + end + + ownerSpellTable.targets[targetName] = (ownerSpellTable.targets[targetName] or 0) + 1 + ownerSpellTable.counter = ownerSpellTable.counter + 1 + end + + if (not sourceActor.classe) then + if (sourceFlags and bitBand(sourceFlags, OBJECT_TYPE_PLAYER) ~= 0) then + if (sourceActor.classe == "UNKNOW" or sourceActor.classe == "UNGROUPPLAYER") then + ---@type actor + local damageActor = damage_cache [sourceSerial] + if (damageActor and (damageActor.classe ~= "UNKNOW" and damageActor.classe ~= "UNGROUPPLAYER")) then + sourceActor.classe = damageActor.classe + else + ---@type actor + local healingActor = healing_cache[sourceSerial] + if (healingActor and (healingActor.classe ~= "UNKNOW" and healingActor.classe ~= "UNGROUPPLAYER")) then + sourceActor.classe = healingActor.classe + end + end + end + end + end + end + ----------------------------------------------------------------------------------------------------------------------------------------- --MISC search key: ~buffuptime ~buffsuptime | ----------------------------------------------------------------------------------------------------------------------------------------- diff --git a/core/util.lua b/core/util.lua index 1b3548c27..42c137a53 100644 --- a/core/util.lua +++ b/core/util.lua @@ -81,6 +81,20 @@ ---@param unitSerial serial ---@return unit|nil unitId function Details:FindUnitIDByUnitSerial(unitSerial) + --target + if (UnitExists("target")) then + if (UnitGUID("target") == unitSerial) then + return "target" + end + end + + --focus + if (UnitExists("focus")) then + if (UnitGUID("focus") == unitSerial) then + return "focus" + end + end + --boss for i = 1, 9 do local unitId = Details222.UnitIdCache.Boss[i] diff --git a/functions/spec_augmentation.lua b/functions/spec_augmentation.lua new file mode 100644 index 000000000..f0a4a79b4 --- /dev/null +++ b/functions/spec_augmentation.lua @@ -0,0 +1,204 @@ + +local addonName, Details222 = ... +local Details = Details +local _ + +local UnitExists = UnitExists +local UnitIsUnit = UnitIsUnit + +local augmentationFunctions = Details222.SpecHelpers[1473] +local augmentationCache = Details222.SpecHelpers[1473].augmentation_cache + +function augmentationFunctions.BuffIn(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, spellschool, auraType, amount) + if (spellId == 395152) 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 attributeGained = v2 + + if (type(attributeGained) == "number") then + augmentationCache.ebon_might[targetSerial] = augmentationCache.ebon_might[targetSerial] or {} + local evokerInfo = {sourceSerial, sourceName, sourceFlags, attributeGained} + table.insert(augmentationCache.ebon_might[targetSerial], evokerInfo) + 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 + if (type(versaGained) == "number") then + augmentationCache.ss[targetSerial] = augmentationCache.ss[targetSerial] or {} + local ssInfo = {sourceSerial, sourceName, sourceFlags, versaGained} + table.insert(augmentationCache.ss[targetSerial], ssInfo) + end + end + + elseif (spellId == 410089) then + augmentationCache.prescience[targetSerial] = augmentationCache.prescience[targetSerial] or {} + local evokerInfo = {sourceSerial, sourceName, sourceFlags, amount} + table.insert(augmentationCache.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 = augmentationCache.breath_targets[targetSerial] + if (not breathTargets) then + augmentationCache.breath_targets[targetSerial] = {} + breathTargets = augmentationCache.breath_targets[targetSerial] + end + + --evoker serial, evoker name, evoker flags, target unitID, unixtime, duration, expirationTime (GetTime + duration) + local eonsBreathInfo = {sourceSerial, sourceName, sourceFlags, unitIDAffected, time, duration, expirationTime} + table.insert(breathTargets, eonsBreathInfo) + end + end + + elseif (spellId == 360827) then + augmentationCache.shield[targetSerial] = augmentationCache.shield[targetSerial] or {} + local evokerInfo = {sourceSerial, sourceName, sourceFlags, amount} + table.insert(augmentationCache.shield[targetSerial], evokerInfo) + + elseif (spellId == 410263) then + augmentationCache.infernobless[targetSerial] = augmentationCache.infernobless[targetSerial] or {} + local evokerInfo = {sourceSerial, sourceName, sourceFlags} + table.insert(augmentationCache.infernobless[targetSerial], evokerInfo) + end +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 {} + + 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:FindBuffCastedBy(targetName, spellId, sourceName) + local attributeGained = v2 + + if (type(attributeGained) == "number") then + evokerInfo[4] = attributeGained + bFound = true + break + 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:FindBuffCastedBy(targetName, spellId, sourceName) + local attributeGained = v2 + if (type(attributeGained) == "number") then + table.insert(augmentationCache.ebon_might[targetSerial], {sourceSerial, sourceName, sourceFlags, attributeGained}) + end + 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 + + if (type(versaGained) == "number") then + local bFound = false + augmentationCache.ss[targetSerial] = augmentationCache.ss[targetSerial] or {} + + for index, evokerInfo in ipairs(augmentationCache.ss[targetSerial]) do + if (evokerInfo[1] == sourceSerial) then + evokerInfo[4] = versaGained + bFound = true + break + end + end + + if (not bFound) then + table.insert(augmentationCache.ss[targetSerial], {sourceSerial, sourceName, sourceFlags, versaGained}) + end + end + end + + elseif (spellId == 410089) then + local bFound = false + augmentationCache.prescience[targetSerial] = augmentationCache.prescience[targetSerial] or {} + + for index, evokerInfo in ipairs(augmentationCache.prescience[targetSerial]) do + if (evokerInfo[1] == sourceSerial) then + evokerInfo[4] = amount + bFound = true + break + end + end + + if (not bFound) then + table.insert(augmentationCache.prescience[targetSerial], {sourceSerial, sourceName, sourceFlags, amount}) + end + end +end + + + +function augmentationFunctions.BuffOut(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellid, spellName, spellSchool, tipo, amount) + if (spellid == 395152) then + if (augmentationCache.ebon_might[targetSerial]) then + for index, evokerInfo in ipairs(augmentationCache.ebon_might[targetSerial]) do + if (evokerInfo[1] == sourceSerial) then + table.remove(augmentationCache.ebon_might[targetSerial], index) + break + end + end + end + + elseif (spellid == 413984) then + if (augmentationCache.ss[targetSerial]) then + for index, evokerInfo in ipairs(augmentationCache.ss[targetSerial]) do + if (evokerInfo[1] == sourceSerial) then + table.remove(augmentationCache.ss[targetSerial], index) + break + end + end + end + + elseif (spellid == 410089) then + if (augmentationCache.prescience[targetSerial]) then + for index, evokerInfo in ipairs(augmentationCache.prescience[targetSerial]) do + if (evokerInfo[1] == sourceSerial) then + table.remove(augmentationCache.prescience[targetSerial], index) + break + end + end + end + + elseif (spellid == 360827) then + if (augmentationCache.shield[targetSerial]) then + for index, evokerInfo in ipairs(augmentationCache.shield[targetSerial]) do + if (evokerInfo[1] == sourceSerial) then + table.remove(augmentationCache.shield[targetSerial], index) + break + end + end + end + + elseif (spellid == 410263) then + if (augmentationCache.infernobless[targetSerial]) then + for index, evokerInfo in ipairs(augmentationCache.infernobless[targetSerial]) do + if (evokerInfo[1] == sourceSerial) then + table.remove(augmentationCache.infernobless[targetSerial], index) + break + end + end + end + end +end \ No newline at end of file