From d494c1dfef849210fff67cd346cf5ea34e66b9cb Mon Sep 17 00:00:00 2001 From: Alessandro Barbieri Date: Tue, 2 Jun 2026 20:30:31 +0200 Subject: [PATCH 01/14] add MP5 from items only in classic --- Modules/Data/MP5.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Modules/Data/MP5.lua b/Modules/Data/MP5.lua index 5ea8de85..ce00298f 100755 --- a/Modules/Data/MP5.lua +++ b/Modules/Data/MP5.lua @@ -97,9 +97,10 @@ function Data:GetMP5WhileCasting() local castingModifier, mp5BuffBonus, periodicMana = Data:GetMP5FromBuffs() castingModifier = min(1,castingModifier + _MP5:GetTalentModifier() + Data:GetSetBonusModifierMP5()) -- capped at 100% - local mp5Items = Data:GetMP5FromItems() - casting = (casting * 5) + mp5Items + mp5BuffBonus * castingModifier + periodicMana - + casting = (casting * 5) + mp5BuffBonus * castingModifier + periodicMana + if ECS.IsClassic then + casting = casting + Data:GetMP5FromItems() + end return DataUtils:Round(casting, 2) end @@ -107,9 +108,10 @@ end function Data:GetMP5OutsideCasting() local mp5FromSpirit = Data:GetMP5FromSpirit() local _, mp5BuffBonus, periodicMana = Data:GetMP5FromBuffs() - local mp5FromItems = Data:GetMP5FromItems() - - local totalMP5 = mp5FromSpirit + mp5FromItems + mp5BuffBonus + periodicMana + local totalMP5 = mp5FromSpirit + mp5BuffBonus + periodicMana + if ECS.IsClassic then + totalMP5 = totalMP5 + Data:GetMP5FromItems() + end return DataUtils:Round(totalMP5, 2) end From cf07fd04a8cbb4c69c72b2c314bad3b1e88b6aeb Mon Sep 17 00:00:00 2001 From: Alessandro Barbieri Date: Tue, 2 Jun 2026 22:27:33 +0200 Subject: [PATCH 02/14] Refactor GetMP5FromSpirit to use GetUnitManaRegenRateFromSpirit --- Modules/Data/MP5.lua | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Modules/Data/MP5.lua b/Modules/Data/MP5.lua index ce00298f..84f9e2fc 100755 --- a/Modules/Data/MP5.lua +++ b/Modules/Data/MP5.lua @@ -78,12 +78,7 @@ local lastManaReg = 0 ---@return number function Data:GetMP5FromSpirit() - local base, _ = GetManaRegen() -- Returns mana reg per 1 second (including talent and buff modifiers) - if base < 1 then - base = lastManaReg - end - lastManaReg = base - + local base = GetUnitManaRegenRateFromSpirit("player") return DataUtils:Round(base * 5, 2) end From 30da78d6a78446aef8ac9425f0c822bfa101d63e Mon Sep 17 00:00:00 2001 From: Alessandro Barbieri Date: Tue, 2 Jun 2026 22:32:10 +0200 Subject: [PATCH 03/14] remove unused variable --- Modules/Data/MP5.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/Modules/Data/MP5.lua b/Modules/Data/MP5.lua index 84f9e2fc..02175dc0 100755 --- a/Modules/Data/MP5.lua +++ b/Modules/Data/MP5.lua @@ -74,8 +74,6 @@ function _MP5:GetMP5ValueOnItems() return mp5 end -local lastManaReg = 0 - ---@return number function Data:GetMP5FromSpirit() local base = GetUnitManaRegenRateFromSpirit("player") From 25ab01909249afff97caff07acef6a4307efc254 Mon Sep 17 00:00:00 2001 From: Alessandro Barbieri Date: Tue, 2 Jun 2026 22:33:25 +0200 Subject: [PATCH 04/14] Add GetUnitManaRegenRateFromSpirit to luacheckrc --- .luacheckrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.luacheckrc b/.luacheckrc index 2e903fee..7aec53ce 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -1497,6 +1497,7 @@ stds.ecs = { "GetUICameraInfo", "GetUITextureKitInfo", "GetUnitHealthModifier", + "GetUnitManaRegenRateFromSpirit", "GetUnitMaxHealthModifier", "GetUnitPowerModifier", "GetUnitSpeed", From 0283a059b29469e7ec48a9f550e1e978a0c1695c Mon Sep 17 00:00:00 2001 From: Alessandro Barbieri Date: Tue, 2 Jun 2026 22:56:34 +0200 Subject: [PATCH 05/14] more mp5 fixes --- Modules/Data/MP5.lua | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Modules/Data/MP5.lua b/Modules/Data/MP5.lua index 02175dc0..f80e77bf 100755 --- a/Modules/Data/MP5.lua +++ b/Modules/Data/MP5.lua @@ -84,9 +84,7 @@ end ---@return number function Data:GetMP5WhileCasting() local _, casting = GetManaRegen() -- Returns mana reg per 1 second (including talent and buff modifiers) - if casting < 0.1 then - casting = 0 - end + casting = math.max(0,casting) local castingModifier, mp5BuffBonus, periodicMana = Data:GetMP5FromBuffs() castingModifier = min(1,castingModifier + _MP5:GetTalentModifier() + Data:GetSetBonusModifierMP5()) -- capped at 100% @@ -99,9 +97,9 @@ end ---@return number function Data:GetMP5OutsideCasting() - local mp5FromSpirit = Data:GetMP5FromSpirit() + local base, _ = GetManaRegen() local _, mp5BuffBonus, periodicMana = Data:GetMP5FromBuffs() - local totalMP5 = mp5FromSpirit + mp5BuffBonus + periodicMana + local totalMP5 = (base * 5) + mp5BuffBonus + periodicMana if ECS.IsClassic then totalMP5 = totalMP5 + Data:GetMP5FromItems() end From ee9bea20970b17e0968a10e32c8767e71be59a64 Mon Sep 17 00:00:00 2001 From: Alessandro Barbieri Date: Wed, 3 Jun 2026 00:55:46 +0200 Subject: [PATCH 06/14] manually calculate spirit regen in classic --- Modules/Data/MP5.lua | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Modules/Data/MP5.lua b/Modules/Data/MP5.lua index f80e77bf..5b665df6 100755 --- a/Modules/Data/MP5.lua +++ b/Modules/Data/MP5.lua @@ -76,8 +76,25 @@ end ---@return number function Data:GetMP5FromSpirit() - local base = GetUnitManaRegenRateFromSpirit("player") - return DataUtils:Round(base * 5, 2) + local regen = 0 + if ECS.IsClassic then + local _, spirit, _, _ = UnitStat("unit", LE_UNIT_STAT_SPIRIT) + if spirit < 50 then + regen = 0.25 * spirit + else + if classId == Data.PRIEST or classId == Data.MAGE then + regen = (12.5 + spirit/4)/2 + elseif classId == Data.DRUID and (not DataUtils:IsShapeshifted()) then + regen = (15 + spirit/4.5)/2 + else + regen = (15 + spirit/5)/2 + end + end + else + -- GetUnitManaRegenRateFromSpirit uses TBC formula in classic + regen = GetUnitManaRegenRateFromSpirit("player") + end + return DataUtils:Round(regen * 5, 2) end -- Get mana regen while casting From 19c6c349b05f737934424a8abc9d642bb337b710 Mon Sep 17 00:00:00 2001 From: Alessandro Barbieri Date: Wed, 3 Jun 2026 00:58:10 +0200 Subject: [PATCH 07/14] luacheck --- Modules/Data/MP5.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Data/MP5.lua b/Modules/Data/MP5.lua index 5b665df6..143d2ee0 100755 --- a/Modules/Data/MP5.lua +++ b/Modules/Data/MP5.lua @@ -76,7 +76,7 @@ end ---@return number function Data:GetMP5FromSpirit() - local regen = 0 + local regen if ECS.IsClassic then local _, spirit, _, _ = UnitStat("unit", LE_UNIT_STAT_SPIRIT) if spirit < 50 then From 501ece5e880f55eeb5103fe14cebb2242dc080bf Mon Sep 17 00:00:00 2001 From: Alessandro Barbieri Date: Wed, 3 Jun 2026 00:58:55 +0200 Subject: [PATCH 08/14] Add LE_UNIT_STAT_SPIRIT to .luacheckrc --- .luacheckrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.luacheckrc b/.luacheckrc index 7aec53ce..8d8ff494 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -2768,6 +2768,7 @@ stds.ecs = { "WOW_PROJECT_WRATH_CLASSIC", "-----------------------------------------------------> Enums", "LE_EXPANSION_BURNING_CRUSADE", + "LE_UNIT_STAT_SPIRIT", "-----------------------------------------------------> GlobalStrings", "CLOSE", "DEFENSE", From c15adc39b62cee2cbe30d82012628a65f8fdcd4e Mon Sep 17 00:00:00 2001 From: Alessandro Barbieri Date: Wed, 3 Jun 2026 01:38:25 +0200 Subject: [PATCH 09/14] Fix UnitStat call to use 'player' instead of 'unit' --- Modules/Data/MP5.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Data/MP5.lua b/Modules/Data/MP5.lua index 143d2ee0..418b3e74 100755 --- a/Modules/Data/MP5.lua +++ b/Modules/Data/MP5.lua @@ -78,7 +78,7 @@ end function Data:GetMP5FromSpirit() local regen if ECS.IsClassic then - local _, spirit, _, _ = UnitStat("unit", LE_UNIT_STAT_SPIRIT) + local _, spirit, _, _ = UnitStat("player", LE_UNIT_STAT_SPIRIT) if spirit < 50 then regen = 0.25 * spirit else From 97cfb4192243631eef9264103120830708a00b09 Mon Sep 17 00:00:00 2001 From: Alessandro Barbieri Date: Thu, 4 Jun 2026 01:46:40 +0200 Subject: [PATCH 10/14] Add PowerRegenPercentModifier data --- Modules/Data/Constants.lua | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/Modules/Data/Constants.lua b/Modules/Data/Constants.lua index 66fa6185..40045ef4 100755 --- a/Modules/Data/Constants.lua +++ b/Modules/Data/Constants.lua @@ -284,6 +284,46 @@ Data.Aura = { [25894] = (ECS.IsClassic and 1 or nil), -- Greater Blessing of Wisdom rank 1 [25918] = (ECS.IsClassic and 1 or nil), -- Greater Blessing of Wisdom rank 2 }, + PowerRegenPercentModifier = { + [Enum.PowerType.Energy] = { + [13750] = 1, -- Adrenaline Rush + [58427] = 0.3, -- Overkill + [66203] = -1, -- Steam Blast + [69470] = -1, -- Heat Drain + [70385] = -1, -- Abomination Vehicle Power Drain + [72242] = -1, -- Zero Power + [1231381] = 0.26, -- Feral Dedication + }, + [Enum.PowerType.Mana] = { + [5419] = (ECS.IsTBC and -0.11 or nil), -- Travel Form (Passive) + [5421] = (ECS.IsTBC and -0.11 or nil), -- Aquatic Form (Passive) + [12051] = (ECS.IsClassic and 15 or nil), -- Evocation + [18371] = (ECS.IsClassic and 0.5 or nil), -- Soul Siphon + [24705] = (ECS.IsClassic and 0.25 or nil), -- Invocation of the Wickerman + [27747] = -1, -- Steam Tank Passive + [29166] = ((not ECS.IsWotlk) and 4 or nil), -- Innervate + [33948] = (ECS.IsTBC and -0.11 or nil), -- Flight Form (Passive) + [34754] = (ECS.IsWotlk and 0.16 or nil), -- Holy Concentration + [40121] = (ECS.IsTBC and -0.11 or nil), -- Swift Flight Form (Passive) + [42514] = 1, -- Arcane Surge + [49307] = 1, -- Full Mana Regen + [51623] = 5, -- Sholazar Guardian Heartbeat + [63724] = 0.32, -- Holy Concentration + [63725] = 0.5, -- Holy Concentration + [456195] = 4, -- Innervate + [468466] = 1, -- Unmaking the Simulacrum + }, + [Enum.PowerType.RuneBlood] = { + [50469] = -0.5, -- Rhythm of the Fallen + [50779] = 1, -- Blood Rune Mastery + }, + [Enum.PowerType.RuneFrost] = { + [50469] = -0.5, -- Rhythm of the Fallen + }, + [Enum.PowerType.RuneUnholy] = { + [50469] = -0.5, -- Rhythm of the Fallen + }, + }, SpellCrit = { [24907] = ((not ECS.IsClassic) and 5 or nil), -- Moonkin Aura [29177] = 6, -- Elemental Devastation Rank 2 From 2458c3bd0565071158e414734f4d25864c336bae Mon Sep 17 00:00:00 2001 From: Alessandro Barbieri Date: Thu, 4 Jun 2026 01:56:59 +0200 Subject: [PATCH 11/14] wip --- Modules/Data/MP5.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Modules/Data/MP5.lua b/Modules/Data/MP5.lua index 418b3e74..ab4d6c98 100755 --- a/Modules/Data/MP5.lua +++ b/Modules/Data/MP5.lua @@ -103,9 +103,9 @@ function Data:GetMP5WhileCasting() local _, casting = GetManaRegen() -- Returns mana reg per 1 second (including talent and buff modifiers) casting = math.max(0,casting) - local castingModifier, mp5BuffBonus, periodicMana = Data:GetMP5FromBuffs() - castingModifier = min(1,castingModifier + _MP5:GetTalentModifier() + Data:GetSetBonusModifierMP5()) -- capped at 100% - casting = (casting * 5) + mp5BuffBonus * castingModifier + periodicMana + local modifier, mp5BuffBonus, periodicMana = Data:GetMP5FromBuffs() + -- castingModifier = min(1,castingModifier + _MP5:GetTalentModifier() + Data:GetSetBonusModifierMP5()) -- capped at 100% + casting = (casting * 5) * (1 + modifier) + mp5BuffBonus + periodicMana if ECS.IsClassic then casting = casting + Data:GetMP5FromItems() end @@ -115,8 +115,8 @@ end ---@return number function Data:GetMP5OutsideCasting() local base, _ = GetManaRegen() - local _, mp5BuffBonus, periodicMana = Data:GetMP5FromBuffs() - local totalMP5 = (base * 5) + mp5BuffBonus + periodicMana + local modifier, mp5BuffBonus, periodicMana = Data:GetMP5FromBuffs() + local totalMP5 = (base * 5) * (1 + modifier) + mp5BuffBonus + periodicMana if ECS.IsClassic then totalMP5 = totalMP5 + Data:GetMP5FromItems() end @@ -137,7 +137,7 @@ function Data:GetMP5FromBuffs() bonus = bonus + (Data.Aura.MP5[aura.spellId] or 0) bonus = bonus + (Data.Aura.PercentageMp5[aura.spellId] or 0) * maxmana periodic = periodic + (Data.Aura.PeriodicallyGiveMana[aura.spellId] or 0) - mod = mod + (Data.Aura.AllowCastingManaRegeneration[aura.spellId] or 0) -- assuming buffs stacking, to be investigated + mod = mod + (Data.Aura.PowerRegenPercentModifier[Enum.PowerType.Mana][aura.spellId] or 0) if Data.Aura.IsLightningShield[aura.spellId] and Data:IsSetBonusActive(Data.setNames.THE_EARTHSHATTERER, 8) then bonus = bonus + 15 -- 15 MP5 from Shaman T3 8 piece bonus when Lightning Shield is active end From 49ed92977849847dff4dc02f59bd9e1e8db1840b Mon Sep 17 00:00:00 2001 From: Alessandro Barbieri Date: Fri, 5 Jun 2026 01:19:42 +0200 Subject: [PATCH 12/14] wip --- Modules/Data/MP5.lua | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/Modules/Data/MP5.lua b/Modules/Data/MP5.lua index ab4d6c98..b1b205fb 100755 --- a/Modules/Data/MP5.lua +++ b/Modules/Data/MP5.lua @@ -78,6 +78,7 @@ end function Data:GetMP5FromSpirit() local regen if ECS.IsClassic then + -- GetUnitManaRegenRateFromSpirit uses TBC formula in classic local _, spirit, _, _ = UnitStat("player", LE_UNIT_STAT_SPIRIT) if spirit < 50 then regen = 0.25 * spirit @@ -91,41 +92,43 @@ function Data:GetMP5FromSpirit() end end else - -- GetUnitManaRegenRateFromSpirit uses TBC formula in classic regen = GetUnitManaRegenRateFromSpirit("player") end - return DataUtils:Round(regen * 5, 2) + return DataUtils:Round(regen * 5, 1) end -- Get mana regen while casting ---@return number function Data:GetMP5WhileCasting() - local _, casting = GetManaRegen() -- Returns mana reg per 1 second (including talent and buff modifiers) - casting = math.max(0,casting) - + -- Returns mana reg per 1 second (including talent and buff casting modifiers) + local _, casting = GetManaRegen() local modifier, mp5BuffBonus, periodicMana = Data:GetMP5FromBuffs() -- castingModifier = min(1,castingModifier + _MP5:GetTalentModifier() + Data:GetSetBonusModifierMP5()) -- capped at 100% - casting = (casting * 5) * (1 + modifier) + mp5BuffBonus + periodicMana + casting = casting * 5 if ECS.IsClassic then + -- mp5 from items isn't accounted in classic casting = casting + Data:GetMP5FromItems() end - return DataUtils:Round(casting, 2) + casting = casting * modifier + mp5BuffBonus + periodicMana + return DataUtils:Round(casting, 1) end ---@return number function Data:GetMP5OutsideCasting() local base, _ = GetManaRegen() local modifier, mp5BuffBonus, periodicMana = Data:GetMP5FromBuffs() - local totalMP5 = (base * 5) * (1 + modifier) + mp5BuffBonus + periodicMana + local totalMP5 = base * 5 if ECS.IsClassic then + -- mp5 from items isn't accounted in classic totalMP5 = totalMP5 + Data:GetMP5FromItems() end - return DataUtils:Round(totalMP5, 2) + local totalMP5 = totalMP5 * modifier + mp5BuffBonus + periodicMana + return DataUtils:Round(totalMP5, 1) end ---@return number, number, number function Data:GetMP5FromBuffs() - local mod = 0 + local mod = 1 local bonus = 0 local periodic = 0 local maxmana = UnitPowerMax("player", Enum.PowerType.Mana) @@ -163,7 +166,7 @@ function Data:GetMP5FromBuffs() end i = i + 1 until (not aura) - return min(mod,1), bonus, periodic + return max(mod,0), bonus, periodic end ---@return number From e12e31e5954a04c856d6a917dec5303f9888513d Mon Sep 17 00:00:00 2001 From: Alessandro Barbieri Date: Fri, 5 Jun 2026 01:25:26 +0200 Subject: [PATCH 13/14] wip --- Modules/Data/MP5.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/Data/MP5.lua b/Modules/Data/MP5.lua index b1b205fb..37971557 100755 --- a/Modules/Data/MP5.lua +++ b/Modules/Data/MP5.lua @@ -106,7 +106,7 @@ function Data:GetMP5WhileCasting() -- castingModifier = min(1,castingModifier + _MP5:GetTalentModifier() + Data:GetSetBonusModifierMP5()) -- capped at 100% casting = casting * 5 if ECS.IsClassic then - -- mp5 from items isn't accounted in classic + -- in classic GetManaRegen doesn't account for mp5 from items casting = casting + Data:GetMP5FromItems() end casting = casting * modifier + mp5BuffBonus + periodicMana @@ -119,10 +119,10 @@ function Data:GetMP5OutsideCasting() local modifier, mp5BuffBonus, periodicMana = Data:GetMP5FromBuffs() local totalMP5 = base * 5 if ECS.IsClassic then - -- mp5 from items isn't accounted in classic + -- in classic GetManaRegen doesn't account for mp5 from items totalMP5 = totalMP5 + Data:GetMP5FromItems() end - local totalMP5 = totalMP5 * modifier + mp5BuffBonus + periodicMana + totalMP5 = totalMP5 * modifier + mp5BuffBonus + periodicMana return DataUtils:Round(totalMP5, 1) end From f04073373bc6132deaa62e05b5ecfc1fd2322024 Mon Sep 17 00:00:00 2001 From: Alessandro Barbieri Date: Fri, 5 Jun 2026 01:28:53 +0200 Subject: [PATCH 14/14] wip --- Modules/Data/MP5.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Modules/Data/MP5.lua b/Modules/Data/MP5.lua index 37971557..ede12066 100755 --- a/Modules/Data/MP5.lua +++ b/Modules/Data/MP5.lua @@ -106,8 +106,8 @@ function Data:GetMP5WhileCasting() -- castingModifier = min(1,castingModifier + _MP5:GetTalentModifier() + Data:GetSetBonusModifierMP5()) -- capped at 100% casting = casting * 5 if ECS.IsClassic then - -- in classic GetManaRegen doesn't account for mp5 from items - casting = casting + Data:GetMP5FromItems() + -- in classic GetManaRegen doesn't account for mp5 from items nor buffs + casting = casting + Data:GetMP5FromItems() + mp5BuffBonus end casting = casting * modifier + mp5BuffBonus + periodicMana return DataUtils:Round(casting, 1) @@ -119,10 +119,10 @@ function Data:GetMP5OutsideCasting() local modifier, mp5BuffBonus, periodicMana = Data:GetMP5FromBuffs() local totalMP5 = base * 5 if ECS.IsClassic then - -- in classic GetManaRegen doesn't account for mp5 from items - totalMP5 = totalMP5 + Data:GetMP5FromItems() + -- in classic GetManaRegen doesn't account for mp5 from items nor buffs + totalMP5 = totalMP5 + Data:GetMP5FromItems() + mp5BuffBonus end - totalMP5 = totalMP5 * modifier + mp5BuffBonus + periodicMana + totalMP5 = totalMP5 * modifier + periodicMana return DataUtils:Round(totalMP5, 1) end