diff --git a/libs/StatLogic/Cata_Logic.lua b/libs/StatLogic/Cata_Logic.lua index af1ac0d..b9aa480 100644 --- a/libs/StatLogic/Cata_Logic.lua +++ b/libs/StatLogic/Cata_Logic.lua @@ -46,7 +46,7 @@ StatLogic.GenericStatMap[StatLogic.GenericStats.CR_HASTE] = { } -- Extracted from the client at GameTables/RegenMPPerSpt.txt via wow.tools.local -addon.BaseManaRegenPerSpi = { +local BaseManaRegenPerSpi = { 0.062937, 0.056900, 0.051488, 0.046267, 0.041637, 0.037784, 0.034309, 0.031172, 0.028158, 0.025460, 0.022654, 0.019904, 0.017817, 0.015771, 0.014008, 0.013650, 0.013175, 0.012832, 0.012475, 0.012073, 0.011840, 0.011494, 0.011292, 0.010990, 0.010761, 0.010546, 0.010321, 0.010151, 0.009949, 0.009740, @@ -59,6 +59,21 @@ addon.BaseManaRegenPerSpi = { 0.003345, 0.003345, 0.003345, 0.003345, 0.003345, } +local NormalManaRegenPerSpi = function() + local level = UnitLevel("player") + local _, int = UnitStat("player", 4) + local _, spi = UnitStat("player", 5) + return (0.001 / spi + BaseManaRegenPerSpi[level] * (int ^ 0.5)) * 5 +end + +local NormalManaRegenPerInt = function() + local level = UnitLevel("player") + local _, int = UnitStat("player", 4) + local _, spi = UnitStat("player", 5) + -- Derivative of regen with respect to int + return (spi * BaseManaRegenPerSpi[level] / (2 * (int ^ 0.5))) * 5 +end + -- Extracted from gtChanceToMeleeCrit.db2 or from gametables/chancetomeleecrit.txt addon.CritPerAgi = { ["WARRIOR"] = { @@ -328,12 +343,12 @@ if addon.class == "DRUID" then }, ["ADD_NORMAL_MANA_REG_MOD_SPI"] = { { - ["regen"] = addon.NormalManaRegenPerSpi, + ["regen"] = NormalManaRegenPerSpi, }, }, ["ADD_NORMAL_MANA_REG_MOD_INT"] = { { - ["regen"] = addon.NormalManaRegenPerInt, + ["regen"] = NormalManaRegenPerInt, }, }, -- Druid: Nurturing Instinct (Rank 2) - 2,14 @@ -816,12 +831,12 @@ elseif addon.class == "MAGE" then }, ["ADD_NORMAL_MANA_REG_MOD_SPI"] = { { - ["regen"] = addon.NormalManaRegenPerSpi, + ["regen"] = NormalManaRegenPerSpi, }, }, ["ADD_NORMAL_MANA_REG_MOD_INT"] = { { - ["regen"] = addon.NormalManaRegenPerInt, + ["regen"] = NormalManaRegenPerInt, }, }, -- Mage: Wizardry - Passive: 89744 @@ -884,12 +899,12 @@ elseif addon.class == "PALADIN" then }, ["ADD_NORMAL_MANA_REG_MOD_SPI"] = { { - ["regen"] = addon.NormalManaRegenPerSpi, + ["regen"] = NormalManaRegenPerSpi, }, }, ["ADD_NORMAL_MANA_REG_MOD_INT"] = { { - ["regen"] = addon.NormalManaRegenPerInt, + ["regen"] = NormalManaRegenPerInt, }, }, -- Healers: Meditation @@ -1022,12 +1037,12 @@ elseif addon.class == "PRIEST" then }, ["ADD_NORMAL_MANA_REG_MOD_SPI"] = { { - ["regen"] = addon.NormalManaRegenPerSpi, + ["regen"] = NormalManaRegenPerSpi, }, }, ["ADD_NORMAL_MANA_REG_MOD_INT"] = { { - ["regen"] = addon.NormalManaRegenPerInt, + ["regen"] = NormalManaRegenPerInt, }, }, ["ADD_MANA_REG_MOD_NORMAL_MANA_REG"] = { @@ -1214,12 +1229,12 @@ elseif addon.class == "SHAMAN" then }, ["ADD_NORMAL_MANA_REG_MOD_SPI"] = { { - ["regen"] = addon.NormalManaRegenPerSpi, + ["regen"] = NormalManaRegenPerSpi, }, }, ["ADD_NORMAL_MANA_REG_MOD_INT"] = { { - ["regen"] = addon.NormalManaRegenPerInt, + ["regen"] = NormalManaRegenPerInt, }, }, -- Druid: Elemental Precision - Rank 3/3 - 1,7 @@ -1313,12 +1328,12 @@ elseif addon.class == "WARLOCK" then }, ["ADD_NORMAL_MANA_REG_MOD_SPI"] = { { - ["regen"] = addon.NormalManaRegenPerSpi, + ["regen"] = NormalManaRegenPerSpi, }, }, ["ADD_NORMAL_MANA_REG_MOD_INT"] = { { - ["regen"] = addon.NormalManaRegenPerInt, + ["regen"] = NormalManaRegenPerInt, }, }, -- Warlock: Metamorphosis - Buff: 47241 diff --git a/libs/StatLogic/StatLogic.lua b/libs/StatLogic/StatLogic.lua index 4ab85c3..5a7f0c3 100644 --- a/libs/StatLogic/StatLogic.lua +++ b/libs/StatLogic/StatLogic.lua @@ -1656,27 +1656,6 @@ function StatLogic:GetSpellCritFromInt(int, class, level) return int * StatLogic:GetSpellCritPerInt(class, level), StatLogic.Stats.SpellCrit end -if ({ - [WOW_PROJECT_BURNING_CRUSADE_CLASSIC] = true, - [WOW_PROJECT_WRATH_CLASSIC] = true, - -- TODO: [WOW_PROJECT_CATA_CLASSIC] = true, -})[WOW_PROJECT_ID] then - addon.NormalManaRegenPerSpi = function() - local level = UnitLevel("player") - local _, int = UnitStat("player", 4) - local _, spi = UnitStat("player", 5) - return (0.001 / spi + addon.BaseManaRegenPerSpi[level] * (int ^ 0.5)) * 5 - end - - addon.NormalManaRegenPerInt = function() - local level = UnitLevel("player") - local _, int = UnitStat("player", 4) - local _, spi = UnitStat("player", 5) - -- Derivative of regen with respect to int - return (spi * addon.BaseManaRegenPerSpi[level] / (2 * (int ^ 0.5))) * 5 - end -end - ---------------------------------- -- Stat Summary Ignore Settings -- ---------------------------------- diff --git a/libs/StatLogic/TBC_Logic.lua b/libs/StatLogic/TBC_Logic.lua index ba8d5c2..8c75b0d 100644 --- a/libs/StatLogic/TBC_Logic.lua +++ b/libs/StatLogic/TBC_Logic.lua @@ -41,7 +41,7 @@ StatLogic.GenericStatMap[StatLogic.GenericStats.CR_HASTE] = { } -- Numbers reverse engineered by Whitetooth@Cenarius(US) (hotdogee [at] gmail [dot] com) -addon.BaseManaRegenPerSpi = { +local BaseManaRegenPerSpi = { 0.034965, 0.034191, 0.033465, 0.032526, 0.031661, 0.031076, 0.030523, 0.029994, 0.029307, 0.028661, 0.027584, 0.026215, 0.025381, 0.024300, 0.023345, 0.022748, 0.021958, 0.021386, 0.020790, 0.020121, 0.019733, 0.019155, 0.018819, 0.018316, 0.017936, 0.017576, 0.017201, 0.016919, 0.016581, 0.016233, @@ -51,6 +51,21 @@ addon.BaseManaRegenPerSpi = { 0.010700, 0.010522, 0.010290, 0.010119, 0.009968, 0.009808, 0.009651, 0.009553, 0.009445, 0.009327, } +local NormalManaRegenPerSpi = function() + local level = UnitLevel("player") + local _, int = UnitStat("player", 4) + local _, spi = UnitStat("player", 5) + return (0.001 / spi + BaseManaRegenPerSpi[level] * (int ^ 0.5)) * 5 +end + +local NormalManaRegenPerInt = function() + local level = UnitLevel("player") + local _, int = UnitStat("player", 4) + local _, spi = UnitStat("player", 5) + -- Derivative of regen with respect to int + return (spi * BaseManaRegenPerSpi[level] / (2 * (int ^ 0.5))) * 5 +end + -- Numbers reverse engineered by Whitetooth@Cenarius(US) (hotdogee [at] gmail [dot] com) addon.CritPerAgi = { ["WARRIOR"] = { @@ -237,12 +252,12 @@ if addon.class == "DRUID" then }, ["ADD_NORMAL_MANA_REG_MOD_SPI"] = { { - ["regen"] = addon.NormalManaRegenPerSpi, + ["regen"] = NormalManaRegenPerSpi, }, }, ["ADD_NORMAL_MANA_REG_MOD_INT"] = { { - ["regen"] = addon.NormalManaRegenPerInt, + ["regen"] = NormalManaRegenPerInt, }, }, ["ADD_NORMAL_HEALTH_REG_MOD_SPI"] = { @@ -503,12 +518,12 @@ elseif addon.class == "HUNTER" then }, ["ADD_NORMAL_MANA_REG_MOD_SPI"] = { { - ["regen"] = addon.NormalManaRegenPerSpi, + ["regen"] = NormalManaRegenPerSpi, }, }, ["ADD_NORMAL_MANA_REG_MOD_INT"] = { { - ["regen"] = addon.NormalManaRegenPerInt, + ["regen"] = NormalManaRegenPerInt, }, }, ["ADD_NORMAL_HEALTH_REG_MOD_SPI"] = { @@ -680,12 +695,12 @@ elseif addon.class == "MAGE" then }, ["ADD_NORMAL_MANA_REG_MOD_SPI"] = { { - ["regen"] = addon.NormalManaRegenPerSpi, + ["regen"] = NormalManaRegenPerSpi, }, }, ["ADD_NORMAL_MANA_REG_MOD_INT"] = { { - ["regen"] = addon.NormalManaRegenPerInt, + ["regen"] = NormalManaRegenPerInt, }, }, ["ADD_NORMAL_HEALTH_REG_MOD_SPI"] = { @@ -752,12 +767,12 @@ elseif addon.class == "PALADIN" then }, ["ADD_NORMAL_MANA_REG_MOD_SPI"] = { { - ["regen"] = addon.NormalManaRegenPerSpi, + ["regen"] = NormalManaRegenPerSpi, }, }, ["ADD_NORMAL_MANA_REG_MOD_INT"] = { { - ["regen"] = addon.NormalManaRegenPerInt, + ["regen"] = NormalManaRegenPerInt, }, }, ["ADD_NORMAL_HEALTH_REG_MOD_SPI"] = { @@ -861,12 +876,12 @@ elseif addon.class == "PRIEST" then }, ["ADD_NORMAL_MANA_REG_MOD_SPI"] = { { - ["regen"] = addon.NormalManaRegenPerSpi, + ["regen"] = NormalManaRegenPerSpi, }, }, ["ADD_NORMAL_MANA_REG_MOD_INT"] = { { - ["regen"] = addon.NormalManaRegenPerInt, + ["regen"] = NormalManaRegenPerInt, }, }, ["ADD_NORMAL_HEALTH_REG_MOD_SPI"] = { @@ -1094,12 +1109,12 @@ elseif addon.class == "SHAMAN" then }, ["ADD_NORMAL_MANA_REG_MOD_SPI"] = { { - ["regen"] = addon.NormalManaRegenPerSpi, + ["regen"] = NormalManaRegenPerSpi, }, }, ["ADD_NORMAL_MANA_REG_MOD_INT"] = { { - ["regen"] = addon.NormalManaRegenPerInt, + ["regen"] = NormalManaRegenPerInt, }, }, ["ADD_NORMAL_HEALTH_REG_MOD_SPI"] = { @@ -1216,12 +1231,12 @@ elseif addon.class == "WARLOCK" then }, ["ADD_NORMAL_MANA_REG_MOD_SPI"] = { { - ["regen"] = addon.NormalManaRegenPerSpi, + ["regen"] = NormalManaRegenPerSpi, }, }, ["ADD_NORMAL_MANA_REG_MOD_INT"] = { { - ["regen"] = addon.NormalManaRegenPerInt, + ["regen"] = NormalManaRegenPerInt, }, }, ["ADD_NORMAL_HEALTH_REG_MOD_SPI"] = { diff --git a/libs/StatLogic/Vanilla_Logic.lua b/libs/StatLogic/Vanilla_Logic.lua index c23924f..6925462 100644 --- a/libs/StatLogic/Vanilla_Logic.lua +++ b/libs/StatLogic/Vanilla_Logic.lua @@ -4,6 +4,47 @@ local StatLogic = LibStub:GetLibrary(addonName) addon.RatingBase = {} +-- Extracted from the client at GameTables/OCTRegenMP.txt via wow.tools.local +local OCTRegenMP = { + ["PALADIN"] = 0.25, + ["HUNTER"] = 0.25, + ["PRIEST"] = 0.25, + ["SHAMAN"] = 0.25, + ["MAGE"] = 0.25, + ["WARLOCK"] = 0.25, + ["DRUID"] = 0.25, +} + +-- Extracted from the client at GameTables/RegenMPPerSpt.txt via wow.tools.local +local RegenMPPerSpt = { + ["PALADIN"] = 0.100, + ["HUNTER"] = 0.100, + ["PRIEST"] = 0.125, + ["SHAMAN"] = 0.100, + ["MAGE"] = 0.125, + ["WARLOCK"] = 0.100, + ["DRUID"] = 0.100, +} + +-- Y-intercepts from commonly cited regen formulas +local RegenMPBase = { + ["PALADIN"] = 15.0, + ["HUNTER"] = 15.0, + ["PRIEST"] = 12.5, + ["SHAMAN"] = 17.0, + ["MAGE"] = 12.5, + ["WARLOCK"] = 15.0, + ["DRUID"] = 15.0, +} + +local NormalManaRegenPerSpi = function() + local _, spi = UnitStat("player", 5) + local low = OCTRegenMP[addon.class] + local high = RegenMPPerSpt[addon.class] + local base = RegenMPBase[addon.class] + return 5 * (spi > base / (low - high) and high or low) +end + addon.BaseMeleeCrit = { ["WARRIOR"] = 0.0000, ["PALADIN"] = 1.7000, @@ -130,7 +171,7 @@ if addon.class == "DRUID" then }, ["ADD_NORMAL_MANA_REG_MOD_SPI"] = { { - ["value"] = 0.5625, + ["regen"] = NormalManaRegenPerSpi, }, }, ["ADD_NORMAL_HEALTH_REG_MOD_SPI"] = { @@ -282,7 +323,7 @@ elseif addon.class == "HUNTER" then }, ["ADD_NORMAL_MANA_REG_MOD_SPI"] = { { - ["value"] = 0.5, + ["regen"] = NormalManaRegenPerSpi, }, }, ["ADD_NORMAL_HEALTH_REG_MOD_SPI"] = { @@ -412,7 +453,7 @@ elseif addon.class == "MAGE" then }, ["ADD_NORMAL_MANA_REG_MOD_SPI"] = { { - ["value"] = 0.625, + ["regen"] = NormalManaRegenPerSpi, }, }, ["ADD_NORMAL_HEALTH_REG_MOD_SPI"] = { @@ -493,7 +534,7 @@ elseif addon.class == "PALADIN" then }, ["ADD_NORMAL_MANA_REG_MOD_SPI"] = { { - ["value"] = 0.5, + ["regen"] = NormalManaRegenPerSpi, }, }, ["ADD_NORMAL_HEALTH_REG_MOD_SPI"] = { @@ -572,7 +613,7 @@ elseif addon.class == "PRIEST" then }, ["ADD_NORMAL_MANA_REG_MOD_SPI"] = { { - ["value"] = 0.625, + ["regen"] = NormalManaRegenPerSpi, }, }, ["ADD_NORMAL_HEALTH_REG_MOD_SPI"] = { @@ -731,7 +772,7 @@ elseif addon.class == "SHAMAN" then }, ["ADD_NORMAL_MANA_REG_MOD_SPI"] = { { - ["value"] = 0.5, + ["regen"] = NormalManaRegenPerSpi, }, }, ["ADD_NORMAL_HEALTH_REG_MOD_SPI"] = { @@ -839,7 +880,7 @@ elseif addon.class == "WARLOCK" then }, ["ADD_NORMAL_MANA_REG_MOD_SPI"] = { { - ["value"] = 0.5, + ["regen"] = NormalManaRegenPerSpi, }, }, ["ADD_NORMAL_HEALTH_REG_MOD_SPI"] = { diff --git a/libs/StatLogic/Wrath_Logic.lua b/libs/StatLogic/Wrath_Logic.lua index 439722d..591257b 100644 --- a/libs/StatLogic/Wrath_Logic.lua +++ b/libs/StatLogic/Wrath_Logic.lua @@ -53,7 +53,7 @@ StatLogic.GenericStatMap[StatLogic.GenericStats.CR_HASTE] = { } -- Extracted from the client at GameTables/RegenMPPerSpt.txt via wow.tools.local -addon.BaseManaRegenPerSpi = { +local BaseManaRegenPerSpi = { 0.062937, 0.056900, 0.051488, 0.046267, 0.041637, 0.037784, 0.034309, 0.031172, 0.028158, 0.025460, 0.022654, 0.019904, 0.017817, 0.015771, 0.014008, 0.013650, 0.013175, 0.012832, 0.012475, 0.012073, 0.011840, 0.011494, 0.011292, 0.010990, 0.010761, 0.010546, 0.010321, 0.010151, 0.009949, 0.009740, @@ -64,6 +64,21 @@ addon.BaseManaRegenPerSpi = { 0.005316, 0.005049, 0.004796, 0.004555, 0.004327, 0.004110, 0.003903, 0.003708, 0.003522, 0.003345, } +local NormalManaRegenPerSpi = function() + local level = UnitLevel("player") + local _, int = UnitStat("player", 4) + local _, spi = UnitStat("player", 5) + return (0.001 / spi + BaseManaRegenPerSpi[level] * (int ^ 0.5)) * 5 +end + +local NormalManaRegenPerInt = function() + local level = UnitLevel("player") + local _, int = UnitStat("player", 4) + local _, spi = UnitStat("player", 5) + -- Derivative of regen with respect to int + return (spi * BaseManaRegenPerSpi[level] / (2 * (int ^ 0.5))) * 5 +end + -- Extracted from the client at GameTables/OCTRegenHP.txt via wow.tools.local local BaseHealthRegenPerSpi = { ["WARRIOR"] = { @@ -999,12 +1014,12 @@ if addon.class == "DRUID" then }, ["ADD_NORMAL_MANA_REG_MOD_SPI"] = { { - ["regen"] = addon.NormalManaRegenPerSpi, + ["regen"] = NormalManaRegenPerSpi, }, }, ["ADD_NORMAL_MANA_REG_MOD_INT"] = { { - ["regen"] = addon.NormalManaRegenPerInt, + ["regen"] = NormalManaRegenPerInt, }, }, -- Druid: Improved Moonkin Form (Rank 3) - 1,19 @@ -1649,12 +1664,12 @@ elseif addon.class == "HUNTER" then }, ["ADD_NORMAL_MANA_REG_MOD_SPI"] = { { - ["regen"] = addon.NormalManaRegenPerSpi, + ["regen"] = NormalManaRegenPerSpi, }, }, ["ADD_NORMAL_MANA_REG_MOD_INT"] = { { - ["regen"] = addon.NormalManaRegenPerInt, + ["regen"] = NormalManaRegenPerInt, }, }, -- Hunter: Hunter vs. Wild (Rank 3) - 3,14 @@ -1803,12 +1818,12 @@ elseif addon.class == "MAGE" then }, ["ADD_NORMAL_MANA_REG_MOD_SPI"] = { { - ["regen"] = addon.NormalManaRegenPerSpi, + ["regen"] = NormalManaRegenPerSpi, }, }, ["ADD_NORMAL_MANA_REG_MOD_INT"] = { { - ["regen"] = addon.NormalManaRegenPerInt, + ["regen"] = NormalManaRegenPerInt, }, }, ["ADD_SPELL_CRIT_RATING_MOD_SPI"] = { @@ -1956,12 +1971,12 @@ elseif addon.class == "PALADIN" then }, ["ADD_NORMAL_MANA_REG_MOD_SPI"] = { { - ["regen"] = addon.NormalManaRegenPerSpi, + ["regen"] = NormalManaRegenPerSpi, }, }, ["ADD_NORMAL_MANA_REG_MOD_INT"] = { { - ["regen"] = addon.NormalManaRegenPerInt, + ["regen"] = NormalManaRegenPerInt, }, }, -- Paladin: Sheath of Light (Rank 3) - 3,24 @@ -2114,12 +2129,12 @@ elseif addon.class == "PRIEST" then }, ["ADD_NORMAL_MANA_REG_MOD_SPI"] = { { - ["regen"] = addon.NormalManaRegenPerSpi, + ["regen"] = NormalManaRegenPerSpi, }, }, ["ADD_NORMAL_MANA_REG_MOD_INT"] = { { - ["regen"] = addon.NormalManaRegenPerInt, + ["regen"] = NormalManaRegenPerInt, }, }, ["MOD_NORMAL_MANA_REG"] = { @@ -2379,12 +2394,12 @@ elseif addon.class == "SHAMAN" then }, ["ADD_NORMAL_MANA_REG_MOD_SPI"] = { { - ["regen"] = addon.NormalManaRegenPerSpi, + ["regen"] = NormalManaRegenPerSpi, }, }, ["ADD_NORMAL_MANA_REG_MOD_INT"] = { { - ["regen"] = addon.NormalManaRegenPerInt, + ["regen"] = NormalManaRegenPerInt, }, }, -- Shaman: Mental Dexterity (Rank 3) - 2,15 @@ -2487,12 +2502,12 @@ elseif addon.class == "WARLOCK" then }, ["ADD_NORMAL_MANA_REG_MOD_SPI"] = { { - ["regen"] = addon.NormalManaRegenPerSpi, + ["regen"] = NormalManaRegenPerSpi, }, }, ["ADD_NORMAL_MANA_REG_MOD_INT"] = { { - ["regen"] = addon.NormalManaRegenPerInt, + ["regen"] = NormalManaRegenPerInt, }, }, -- Warlock: Metamorphosis - Buff