Skip to content

Commit

Permalink
Cata: Add Spell Power to Character Stats
Browse files Browse the repository at this point in the history
But only on Cata, as the api is rather awkward and on retail it's
equivalent to int.

Fixes: #5558
  • Loading branch information
InfusOnWoW committed Dec 15, 2024
1 parent d206cc2 commit 791fc0e
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions WeakAuras/Prototypes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 791fc0e

Please sign in to comment.