From 791fc0ee188ed77c086bacfd3d8b74be6f8a3686 Mon Sep 17 00:00:00 2001 From: Infus Date: Thu, 12 Dec 2024 02:14:54 +0100 Subject: [PATCH] Cata: Add Spell Power to Character Stats But only on Cata, as the api is rather awkward and on retail it's equivalent to int. Fixes: #5558 --- WeakAuras/Prototypes.lua | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index ae8c07e455..1f3383ae2b 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -1206,6 +1206,16 @@ function WeakAuras.GetEffectiveAttackPower() return base + pos + neg end +--- @type fun(): number +function WeakAuras.GetEffectiveSpellPower() + -- Straight from the PaperDoll + local spellPower = GetSpellBonusDamage(2) + for i = 3, MAX_SPELL_SCHOOLS do + spellPower = min(spellPower, GetSpellBonusDamage(i)) + end + return spellPower +end + local function valuesForTalentFunction(trigger) return function() local single_class = Private.checkForSingleLoadCondition(trigger, "class") @@ -10367,6 +10377,20 @@ Private.event_prototypes = { limit = 2 }, }, + { + name = "spellpower", + display = L["Spell Power"], + type = "number", + init = "WeakAuras.GetEffectiveSpellPower()", + store = true, + conditionType = "number", + multiEntry = { + operator = "and", + limit = 2 + }, + enable = WeakAuras.IsCataClassic(), + hidden = not WeakAuras.IsCataClassic(), + }, { type = "header", name = "tertiaryStatsHeader",