diff --git a/src/AuraTable/AuraTable.lua b/src/AuraTable/AuraTable.lua index 28239d7..eb11940 100644 --- a/src/AuraTable/AuraTable.lua +++ b/src/AuraTable/AuraTable.lua @@ -422,4 +422,21 @@ function AuraTable:HasAnyDispelableAura(spell) return false end +-- Loop over a units auras +---@param cb fun(spellId: number): boolean | nil +---@return boolean +function AuraTable:ForEach(cb) + for _, auras in pairs(self:GetUnitAuras()) do + for _, aura in pairs(auras) do + if aura:IsUp() then -- Handle expired and non refreshed dropoffs not coming in UNIT_AURA + cb(aura.spellId) + else + self:RemoveInstanceID(aura:GetAuraInstanceID()) + end + end + end + + return false +end + return AuraTable diff --git a/src/ContentUtils/ContentUtils.lua b/src/ContentUtils/ContentUtils.lua index e550ece..7fa1dd9 100644 --- a/src/ContentUtils/ContentUtils.lua +++ b/src/ContentUtils/ContentUtils.lua @@ -11,6 +11,8 @@ local ContentUtils = { interruptList = {}, ---@type TankBusterList tankBusterList = {}, + ---@type ImportantAuraList + importantAuras = {}, ---@type BigWigsBars bars = {}, isBigWigsEnabled = false @@ -71,6 +73,9 @@ end local _interruptList = Tinkr:require("scripts/bastion/ContentUtils/lists/interrupt-list", Bastion) ---@type TankBusterList local _tankBusterList = Tinkr:require("scripts/bastion/ContentUtils/lists/tank-buster-list", Bastion) +---@type ImportantAuraList +local _importantAuraList = Tinkr:require("scripts/bastion/ContentUtils/lists/important-aura-list", Bastion) + ---@return ContentUtils function ContentUtils:New() @@ -78,7 +83,7 @@ function ContentUtils:New() self.interruptList = _interruptList self.tankBusterList = _tankBusterList - + self.importantAuras = _importantAuraList if BigWigsLoader then print("BigWigs Enabled!") self.isBigWigsEnabled = true @@ -182,4 +187,15 @@ function ContentUtils:CastingTankBuster(unit, timeUntilCast) return nil end +---@param friend Unit +---@return ImportantAura | nil +function ContentUtils:HasImportantAura(friend) + local traits = nil + friend:GetAuras():ForEach(function(spellId) + local auraTraits = self.importantAuras[spellId] + if auraTraits then traits = auraTraits end + end) + return traits +end + return ContentUtils diff --git a/src/ContentUtils/lists/dispel-list.lua b/src/ContentUtils/lists/dispel-list.lua deleted file mode 100644 index e69de29..0000000 diff --git a/src/ContentUtils/lists/group-wide-list.lua b/src/ContentUtils/lists/group-wide-list.lua deleted file mode 100644 index 1ebd5c2..0000000 --- a/src/ContentUtils/lists/group-wide-list.lua +++ /dev/null @@ -1,2 +0,0 @@ ----@alias GroupWide { shouldDampen: boolean, shouldDiffuse: boolean, shouldFort: boolean, shouldBubble: boolean, shouldKarma: boolean } ----@alias GroupWideList table> diff --git a/src/ContentUtils/lists/important-aura-list.lua b/src/ContentUtils/lists/important-aura-list.lua new file mode 100644 index 0000000..0e8babc --- /dev/null +++ b/src/ContentUtils/lists/important-aura-list.lua @@ -0,0 +1,193 @@ +---@alias ImportantAura { isMagicDispel: boolean | nil, isPoisonDispel: boolean | nil, isDiseaseDispel: boolean | nil, isDiffusable: boolean | nil } +---@alias ImportantAuraList table + +---@type ImportantAuraList +local _ImportantAuraList = { + -- Primal Chill + [372682] = { + isMagicDispel = true + }, + -- Primal Chill + [373589] = { + isMagicDispel = true + }, + -- Rolling Thunder + [392641] = { + isMagicDispel = true + }, + -- Burning Touch + [373869] = { + isMagicDispel = true, + isDiffusable = true + }, + -- Shock Blast + [392924] = { + isMagicDispel = true, + isDiffusable = true + }, + -- Storm Slam + [381515] = { + isMagicDispel = true + }, + -- Thunder Clap + [386028] = { + isMagicDispel = true + }, + -- Tempest + [386025] = { + isMagicDispel = true, + isDiffusable = true + }, + -- Frightful Roar + [386063] = { + isMagicDispel = true + }, + -- Bloodcurdling Shout + [373395] = { + isMagicDispel = true + }, + -- Conductive Strike + [376827] = { + isMagicDispel = true + }, + -- Storm Shock + [381530] = { + isMagicDispel = true + }, + -- Mystic Vapors + [387564] = { + isMagicDispel = true, + isDiffusable = true + }, + -- Erratic Growth + [375602] = { + isMagicDispel = true + }, + -- Crystaline Rupture + [370766] = { + isMagicDispel = true + }, + -- Waking Bane + [386546] = { + isMagicDispel = true + }, + -- Waking Bane + [386549] = { + isMagicDispel = true + }, + -- Forbiden Knowledge + [371352] = { + isMagicDispel = true + }, + -- Icy Bindings + [377488] = { + isMagicDispel = true + }, + -- Absolute Zero + [396722] = { + isMagicDispel = true + }, + -- Dragon Strike + [384978] = { + isMagicDispel = true, + isDiffusable = true + }, + -- Monotonous Lecture + [388392] = { + isMagicDispel = true + }, + -- Thunderstrike + [215429] = { + isMagicDispel = true + }, + -- Seal Magic + [209404] = { + isMagicDispel = true + }, + -- Mana Fang + [209516] = { + isMagicDispel = true, + isDiffusable = true + }, + -- Suppress + [209413] = { + isMagicDispel = true, + }, + -- Bewitch + [211470] = { + isMagicDispel = true, + isDiffusable = true + }, + -- Impending Doom + [397907] = { + isMagicDispel = true + }, + -- Withering Soul + [208165] = { + isMagicDispel = true + }, + -- Criple + [214690] = { + isMagicDispel = true + }, + -- Carrion Swarm + [214688] = { + isMagicDispel = true + }, + -- Shadow Word: Frailty + [152819] = { + isMagicDispel = true, + isDiffusable = true + }, + -- Tainted Ripple + [397878] = { + isMagicDispel = true + }, + -- Haunting Scream + [395859] = { + isMagicDispel = true, + }, + -- Throw Torch + [114803] = { + isMagicDispel = true, + isDiffusable = true + }, + -- Sleepy Soliloquy + [395872] = { + isMagicDispel = true, + }, + -- Serpent Strike + [106823] = { + isMagicDispel = true, + }, + -- Necrotic Burst + [156718] = { + isDiseaseDispel = true + }, + -- Plague Spit + [153524] = { + isDiseaseDispel = true + }, + -- Death Venom + [156717] = { + isPoisonDispel = true + }, + -- Lasher Toxin + [389033] = { + isPoisonDispel = true + }, + -- Touch of Nothingness + [106113] = { + isMagicDispel = true, + }, + -- Arcane Lockdown + [207278] = { + isDiffusable = true + }, + -- Hinder + [215204] = { + isDiffusable = true + } +} + +return _ImportantAuraList \ No newline at end of file