mirror of
https://github.com/brues-code/SuperCleveRoidMacros.git
synced 2026-09-16 03:38:00 +00:00
Use ClassicAPI GetSpellBonusDamage/Healing for spell-power conditionals
Migrate the healing/*_power/spell_power conditionals off Nampower's GetSpellPower to ClassicAPI GetSpellBonusDamage(school) / GetSpellBonusHealing. Both read the same client field, so the per-school damage values are identical while dropping the Nampower v2.31 gate. Fixes healing/healingpower: GetSpellPower returns no healing value, so they were returning the 2nd school (holy spell damage) as a stand-in for +healing. GetSpellBonusHealing returns the real (derived) +healing. Prune the now-unused Nampower GetSpellPower wrapper, feature-table entry, and feature flag.
This commit is contained in:
@@ -181,6 +181,22 @@ function API.GetSpellEffectMechanics(spellID)
|
|||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Flat spell-damage bonus (spell power) for a magic school, as a number.
|
||||||
|
-- school is 1-based: 1=Physical, 2=Holy, 3=Fire, 4=Nature, 5=Frost, 6=Shadow,
|
||||||
|
-- 7=Arcane. Reads the same client field nampower's GetSpellPower does -- exact,
|
||||||
|
-- with gear/enchants/buffs/talents/set bonuses baked in.
|
||||||
|
function API.GetSpellBonusDamage(school)
|
||||||
|
return GetSpellBonusDamage(school)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Flat healing bonus (+healing), as a number. Vanilla has no healing-done field,
|
||||||
|
-- so ClassicAPI derives it from gear/enchant/buff MOD_HEALING_DONE plus
|
||||||
|
-- stat-conversion talents (e.g. Spiritual Guidance) -- exact, not a holy-damage
|
||||||
|
-- proxy.
|
||||||
|
function API.GetSpellBonusHealing()
|
||||||
|
return GetSpellBonusHealing()
|
||||||
|
end
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
-- State
|
-- State
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|||||||
+15
-13
@@ -444,24 +444,26 @@ local stat_checks = {
|
|||||||
attackpower = function() local base, pos, neg = UnitAttackPower("player"); return base + pos + neg end,
|
attackpower = function() local base, pos, neg = UnitAttackPower("player"); return base + pos + neg end,
|
||||||
rap = function() local base, pos, neg = UnitRangedAttackPower("player"); return base + pos + neg end,
|
rap = function() local base, pos, neg = UnitRangedAttackPower("player"); return base + pos + neg end,
|
||||||
rangedattackpower = function() local base, pos, neg = UnitRangedAttackPower("player"); return base + pos + neg end,
|
rangedattackpower = function() local base, pos, neg = UnitRangedAttackPower("player"); return base + pos + neg end,
|
||||||
healing = function() local _, h = CleveRoids.NampowerAPI.GetSpellPower(); return h or 0 end,
|
healing = function() return CleveRoids.ClassicAPI.GetSpellBonusHealing() or 0 end,
|
||||||
healingpower = function() local _, h = CleveRoids.NampowerAPI.GetSpellPower(); return h or 0 end,
|
healingpower = function() return CleveRoids.ClassicAPI.GetSpellBonusHealing() or 0 end,
|
||||||
|
|
||||||
-- Bonus Spell Damage by School (Nampower v2.31+ GetSpellPower)
|
-- Bonus Spell Damage by School (ClassicAPI GetSpellBonusDamage)
|
||||||
-- GetSpellPower() returns: physical, holy, fire, nature, frost, shadow, arcane
|
-- school: 1=Physical, 2=Holy, 3=Fire, 4=Nature, 5=Frost, 6=Shadow, 7=Arcane
|
||||||
arcane_power = function() return select(7, CleveRoids.NampowerAPI.GetSpellPower()) or 0 end,
|
arcane_power = function() return CleveRoids.ClassicAPI.GetSpellBonusDamage(7) or 0 end,
|
||||||
fire_power = function() return select(3, CleveRoids.NampowerAPI.GetSpellPower()) or 0 end,
|
fire_power = function() return CleveRoids.ClassicAPI.GetSpellBonusDamage(3) or 0 end,
|
||||||
frost_power = function() return select(5, CleveRoids.NampowerAPI.GetSpellPower()) or 0 end,
|
frost_power = function() return CleveRoids.ClassicAPI.GetSpellBonusDamage(5) or 0 end,
|
||||||
nature_power = function() return select(4, CleveRoids.NampowerAPI.GetSpellPower()) or 0 end,
|
nature_power = function() return CleveRoids.ClassicAPI.GetSpellBonusDamage(4) or 0 end,
|
||||||
shadow_power = function() return select(6, CleveRoids.NampowerAPI.GetSpellPower()) or 0 end,
|
shadow_power = function() return CleveRoids.ClassicAPI.GetSpellBonusDamage(6) or 0 end,
|
||||||
|
|
||||||
-- Highest spell power across all schools
|
-- Highest spell power across all schools
|
||||||
spell_power = function()
|
spell_power = function()
|
||||||
local p, h, fi, n, fr, s, a = CleveRoids.NampowerAPI.GetSpellPower()
|
local API = CleveRoids.ClassicAPI
|
||||||
if p then
|
local best = 0
|
||||||
return math.max(p, h, fi, n, fr, s, a)
|
for s = 1, 7 do
|
||||||
|
local v = API.GetSpellBonusDamage(s) or 0
|
||||||
|
if v > best then best = v end
|
||||||
end
|
end
|
||||||
return 0
|
return best
|
||||||
end,
|
end,
|
||||||
|
|
||||||
-- Defensive Stats
|
-- Defensive Stats
|
||||||
|
|||||||
+2
-14
@@ -71,7 +71,6 @@
|
|||||||
|
|
||||||
Spell Miss Events (v2.31+):
|
Spell Miss Events (v2.31+):
|
||||||
- SPELL_MISS_SELF / SPELL_MISS_OTHER - Spell miss/resist/immune/dodge/etc.
|
- SPELL_MISS_SELF / SPELL_MISS_OTHER - Spell miss/resist/immune/dodge/etc.
|
||||||
- GetSpellPower([mode]) - Player mod damage done for all 7 schools
|
|
||||||
|
|
||||||
Aura Event State Parameter (v2.32+):
|
Aura Event State Parameter (v2.32+):
|
||||||
- Buff/debuff events include 7th `state` parameter (0=added, 1=removed, 2=modified)
|
- Buff/debuff events include 7th `state` parameter (0=added, 1=removed, 2=modified)
|
||||||
@@ -364,9 +363,8 @@ API.VERSION_REQUIREMENTS = {
|
|||||||
["AuraDurationEvents"] = { 2, 30, 0 },
|
["AuraDurationEvents"] = { 2, 30, 0 },
|
||||||
["GetPlayerAuraDuration"] = { 2, 30, 0, "GetPlayerAuraDuration" },
|
["GetPlayerAuraDuration"] = { 2, 30, 0, "GetPlayerAuraDuration" },
|
||||||
|
|
||||||
-- v2.31+ - Spell miss events and spell power query
|
-- v2.31+ - Spell miss events
|
||||||
["SpellMissEvents"] = { 2, 31, 0 }, -- SPELL_MISS_SELF/OTHER events
|
["SpellMissEvents"] = { 2, 31, 0 }, -- SPELL_MISS_SELF/OTHER events
|
||||||
["GetSpellPower"] = { 2, 31, 0, "GetSpellPower" },
|
|
||||||
|
|
||||||
-- v2.32+ - Aura event state parameter and stack removal fix
|
-- v2.32+ - Aura event state parameter and stack removal fix
|
||||||
["AuraEventState"] = { 2, 32, 0 },
|
["AuraEventState"] = { 2, 32, 0 },
|
||||||
@@ -575,9 +573,8 @@ local function InitializeFeatures()
|
|||||||
f.hasAuraDurationEvents = API.HasFeature("AuraDurationEvents")
|
f.hasAuraDurationEvents = API.HasFeature("AuraDurationEvents")
|
||||||
f.hasGetPlayerAuraDuration = API.HasFeature("GetPlayerAuraDuration")
|
f.hasGetPlayerAuraDuration = API.HasFeature("GetPlayerAuraDuration")
|
||||||
|
|
||||||
-- v2.31+ Spell miss events and spell power
|
-- v2.31+ Spell miss events
|
||||||
f.hasSpellMissEvents = API.HasFeature("SpellMissEvents")
|
f.hasSpellMissEvents = API.HasFeature("SpellMissEvents")
|
||||||
f.hasGetSpellPower = API.HasFeature("GetSpellPower")
|
|
||||||
|
|
||||||
-- v2.32+ Aura event state parameter
|
-- v2.32+ Aura event state parameter
|
||||||
f.hasAuraEventState = API.HasFeature("AuraEventState")
|
f.hasAuraEventState = API.HasFeature("AuraEventState")
|
||||||
@@ -3387,15 +3384,6 @@ API.MISS_INFO = {
|
|||||||
-- SPELL POWER QUERY (v2.31+)
|
-- SPELL POWER QUERY (v2.31+)
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
-- Get spell power for all 7 damage schools (v2.31+)
|
|
||||||
-- mode: optional mode parameter passed to GetSpellPower
|
|
||||||
-- Returns: physical, holy, fire, nature, frost, shadow, arcane (or nil if unavailable)
|
|
||||||
function API.GetSpellPower(mode)
|
|
||||||
if not API.features.hasGetSpellPower or not _G.GetSpellPower then
|
|
||||||
return nil, nil, nil, nil, nil, nil, nil
|
|
||||||
end
|
|
||||||
return _G.GetSpellPower(mode)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Get duration of a spell in milliseconds (v2.38+)
|
-- Get duration of a spell in milliseconds (v2.38+)
|
||||||
-- For channeling spells: returns the channel duration.
|
-- For channeling spells: returns the channel duration.
|
||||||
|
|||||||
Reference in New Issue
Block a user