From 6758b06f47f7ccac7f56d5e0a26521748f76c019 Mon Sep 17 00:00:00 2001 From: Alessandro Barbieri Date: Sun, 1 Feb 2026 01:56:19 +0100 Subject: [PATCH 1/2] wip --- Modules/Data/Constants.lua | 12 ++++++ Modules/Data/DataUtils.lua | 2 +- Modules/Data/General.lua | 81 ++++++++++++++++++++++++++++++++++++++ Modules/Data/Melee.lua | 25 ------------ 4 files changed, 94 insertions(+), 26 deletions(-) diff --git a/Modules/Data/Constants.lua b/Modules/Data/Constants.lua index a465ef8..0ec192f 100755 --- a/Modules/Data/Constants.lua +++ b/Modules/Data/Constants.lua @@ -336,6 +336,18 @@ Data.Aura = { [25894] = ((ECS.IsTBC or ECS.IsWotlk) and nil or 1), -- Greater Blessing of Wisdom rank 1 [25918] = ((ECS.IsTBC or ECS.IsWotlk) and nil or 1), -- Greater Blessing of Wisdom rank 2 }, + ReduceTargetArmor = { + [37174] = (ECS.IsTBC and 1000 or nil), -- Perceived Weakness + [37482] = (ECS.IsTBC and 600 or nil), -- Exploited Weakness + [40477] = (ECS.IsTBC and 300 or nil), -- Forceful Strike + [42976] = (ECS.IsTBC and 400 or nil), -- Executioner + [43817] = (ECS.IsTBC and 1000 or nil), -- Focused Assault + [47216] = 1092, -- Piercing Fangs + [54678] = 50000, -- Brute Force + [461252] = 2000, -- Shadowflame Fury + [1231894] = 1000, -- Ferocity of the Crocolisk + [1231896] = 500, -- Brilliance of Mr. Bigglesworth + }, SpellCrit = { [24907] = ((ECS.IsTBC or ECS.IsWotlk) and 5 or nil), -- Moonkin Aura [29177] = 6, -- Elemental Devastation Rank 2 diff --git a/Modules/Data/DataUtils.lua b/Modules/Data/DataUtils.lua index 664e8b0..c1c0739 100644 --- a/Modules/Data/DataUtils.lua +++ b/Modules/Data/DataUtils.lua @@ -142,4 +142,4 @@ function DataUtils:GetSocketedGemsFromItemLink(itemLink) return nil end -return DataUtils +return DataUtils \ No newline at end of file diff --git a/Modules/Data/General.lua b/Modules/Data/General.lua index 3239565..01536b6 100644 --- a/Modules/Data/General.lua +++ b/Modules/Data/General.lua @@ -3,6 +3,8 @@ local Data = ECSLoader:ImportModule("Data") ---@type DataUtils local DataUtils = ECSLoader:ImportModule("DataUtils") +local _, _, classId = UnitClass("player") +local playerLevel = UnitLevel("player") ---@return string function Data:GetMovementSpeed() @@ -20,4 +22,83 @@ function Data:GetMovementSpeed() currentSpeed = currentSpeed / 7 * 100 return DataUtils:Round(currentSpeed, 0) .. "%" +end + +---@return string +function Data:GetArmorPenetrationFlat() + local armorPenetration = 0 + + if classId == Data.ROGUE and not ECS.IsWotlk then + if C_SpellBook.IsSpellKnown(14173) then -- Serrated Blades 3/3 + armorPenetration = armorPenetration + playerLevel * 5 + elseif C_SpellBook.IsSpellKnown(14172) then -- Serrated Blades 2/3 + armorPenetration = armorPenetration + playerLevel * 3.4 + elseif C_SpellBook.IsSpellKnown(14171) then -- Serrated Blades 1/3 + armorPenetration = armorPenetration + playerLevel * 1.6 + end + end + + local i = 1 + repeat + local aura = C_UnitAuras.GetBuffDataByIndex("player", i) + if aura and aura.spellId then + armorPenetration = armorPenetration + (Data.Aura.ReduceTargetArmor[aura.spellId] or 0) + if not ECS.IsWotlk then + if aura.spellId == 26481 then + armorPenetration = armorPenetration + 200 * aura.applications -- Insight of the Qiraji + elseif aura.spellId == 21153 then + armorPenetration = armorPenetration + 700 * aura.applications -- Bonereaver's Edge + elseif aura.spellId == 38307 then + armorPenetration = armorPenetration + 435 * aura.applications -- The Dark of Night + end + end + end + i = i + 1 + until (not aura) + + return DataUtils:Round(armorPenetration, 2) .. "%" +end + +---@return string +function Data:GetArmorPenetrationPercentage() + local armorPenetration = GetArmorPenetration() + + if ECS.IsWotlk then + if classId == Data.WARRIOR then + local _, isActive = GetShapeshiftFormInfo(1) + if isActive then + armorPenetration = armorPenetration + 10 -- 10% from Battle Stance + end + -- TODO: mace specialization + elseif classId == Data.ROGUE then + if C_SpellBook.IsSpellKnown(14173) then -- Serrated Blades 3/3 + armorPenetration = armorPenetration + 9 + elseif C_SpellBook.IsSpellKnown(14172) then -- Serrated Blades 2/3 + armorPenetration = armorPenetration + 6 + elseif C_SpellBook.IsSpellKnown(14171) then -- Serrated Blades 1/3 + armorPenetration = armorPenetration + 3 + end + -- TODO: mace specialization + elseif classId == Data.DEATHKNIGHT then + if C_SpellBook.IsSpellKnown(61278) then -- Blood Gorged 5/5 + armorPenetration = armorPenetration + 10 + elseif C_SpellBook.IsSpellKnown(61277) then -- Blood Gorged 4/5 + armorPenetration = armorPenetration + 8 + elseif C_SpellBook.IsSpellKnown(61276) then -- Blood Gorged 3/5 + armorPenetration = armorPenetration + 6 + elseif C_SpellBook.IsSpellKnown(61275) then -- Blood Gorged 2/5 + armorPenetration = armorPenetration + 4 + elseif C_SpellBook.IsSpellKnown(61274) then -- Blood Gorged 1/5 + armorPenetration = armorPenetration + 2 + end + end + end + + return DataUtils:Round(armorPenetration, 2) .. "%" +end + +---@return number +function Data:GetArmorPenetrationRating() + local armorPenetrationRating = GetCombatRating(CR_ARMOR_PENETRATION) + return DataUtils:Round(armorPenetrationRating, 0) end \ No newline at end of file diff --git a/Modules/Data/Melee.lua b/Modules/Data/Melee.lua index e0f36cc..13e50f1 100755 --- a/Modules/Data/Melee.lua +++ b/Modules/Data/Melee.lua @@ -246,31 +246,6 @@ function Data:GetExpertiseRating() return DataUtils:Round(expertiseRating, 0) end ----@return string -function Data:GetArmorPenetration() - local armorPenetration = GetArmorPenetration() - - if ECS.IsWotlk and classId == Data.WARRIOR then - local _, isActive = GetShapeshiftFormInfo(1) - if isActive then - armorPenetration = armorPenetration + 10 -- 10% from Battle Stance - end - end - - if classId == Data.DEATHKNIGHT then - local _, _, _, _, points, _, _, _ = GetTalentInfo(1, 24) - armorPenetration = armorPenetration + points * 2 -- 0-10% Blood Gorged - end - - return DataUtils:Round(armorPenetration, 2) .. "%" -end - ----@return number -function Data:GetArmorPenetrationRating() - local armorPenetrationRating = GetCombatRating(CR_ARMOR_PENETRATION) - return DataUtils:Round(armorPenetrationRating, 0) -end - ---@return number function Data:GetMeleeHasteRating() local hasteRating = GetCombatRating(CR_HASTE_MELEE) From a1fed2ad7f2ca90fc8a8a515d21fb0d46e7cb95b Mon Sep 17 00:00:00 2001 From: Alessandro Barbieri Date: Sat, 14 Feb 2026 16:08:30 +0100 Subject: [PATCH 2/2] wipperoni --- Modules/Data/Data.lua | 9 ++------- Modules/Data/General.lua | 42 ++++++++++++---------------------------- Modules/Data/Melee.lua | 27 +------------------------- Modules/Profile.lua | 4 ---- 4 files changed, 15 insertions(+), 67 deletions(-) diff --git a/Modules/Data/Data.lua b/Modules/Data/Data.lua index cd21bcc..6f193eb 100755 --- a/Modules/Data/Data.lua +++ b/Modules/Data/Data.lua @@ -30,13 +30,8 @@ dataFunctionRefs = { end end, ["ExpertiseRating"] = function() return ECS.IsClassic and 0 or Data:GetExpertiseRating() end, - ["MeleeArmorPenetration"] = function() - if ECS.IsWotlk then - return Data:GetArmorPenetration() - else - return 0 - end - end, + ["MeleeArmorPenetrationFlat"] = function() return Data:GetArmorPenetrationFlat() end, + ["MeleeArmorPenetrationPercentage"] = function() return ECS.IsWotlk and Data:GetArmorPenetrationPercentage() or 0 end, ["MeleeArmorPenetrationRating"] = function() return ECS.IsWotlk and Data:GetArmorPenetrationRating() or 0 end, ["MeleeHitRating"] = function() return ECS.IsClassic and 0 or Data:MeleeHitRating() end, ["MeleeHitBonus"] = function() return Data:MeleeHitBonus() end, diff --git a/Modules/Data/General.lua b/Modules/Data/General.lua index a6f9476..cbc65d5 100644 --- a/Modules/Data/General.lua +++ b/Modules/Data/General.lua @@ -24,18 +24,12 @@ function Data:GetMovementSpeed() return DataUtils:Round(currentSpeed, 0) .. "%" end ----@return string +---@return number function Data:GetArmorPenetrationFlat() local armorPenetration = 0 if classId == Data.ROGUE and not ECS.IsWotlk then - if C_SpellBook.IsSpellKnown(14173) then -- Serrated Blades 3/3 - armorPenetration = armorPenetration + playerLevel * 5 - elseif C_SpellBook.IsSpellKnown(14172) then -- Serrated Blades 2/3 - armorPenetration = armorPenetration + playerLevel * 3.4 - elseif C_SpellBook.IsSpellKnown(14171) then -- Serrated Blades 1/3 - armorPenetration = armorPenetration + playerLevel * 1.6 - end + armorPenetration = armorPenetration + playerLevel * 5/3 * DataUtils:GetActiveTalentSpell({14171,14172,14173}) -- Serrated Blades end local i = 1 @@ -56,14 +50,15 @@ function Data:GetArmorPenetrationFlat() i = i + 1 until (not aura) - return DataUtils:Round(armorPenetration, 2) .. "%" + return DataUtils:Round(armorPenetration, 2) end ---@return string function Data:GetArmorPenetrationPercentage() - local armorPenetration = GetArmorPenetration() + local armorPenetration = 0 if ECS.IsWotlk then + armorPenetration = GetArmorPenetration() if classId == Data.WARRIOR then local _, isActive = GetShapeshiftFormInfo(1) if isActive then @@ -71,26 +66,10 @@ function Data:GetArmorPenetrationPercentage() end -- TODO: mace specialization elseif classId == Data.ROGUE then - if C_SpellBook.IsSpellKnown(14173) then -- Serrated Blades 3/3 - armorPenetration = armorPenetration + 9 - elseif C_SpellBook.IsSpellKnown(14172) then -- Serrated Blades 2/3 - armorPenetration = armorPenetration + 6 - elseif C_SpellBook.IsSpellKnown(14171) then -- Serrated Blades 1/3 - armorPenetration = armorPenetration + 3 - end + armorPenetration = armorPenetration + 3 * DataUtils:GetActiveTalentSpell({14171,14172,14173}) -- Serrated Blades -- TODO: mace specialization elseif classId == Data.DEATHKNIGHT then - if C_SpellBook.IsSpellKnown(61278) then -- Blood Gorged 5/5 - armorPenetration = armorPenetration + 10 - elseif C_SpellBook.IsSpellKnown(61277) then -- Blood Gorged 4/5 - armorPenetration = armorPenetration + 8 - elseif C_SpellBook.IsSpellKnown(61276) then -- Blood Gorged 3/5 - armorPenetration = armorPenetration + 6 - elseif C_SpellBook.IsSpellKnown(61275) then -- Blood Gorged 2/5 - armorPenetration = armorPenetration + 4 - elseif C_SpellBook.IsSpellKnown(61274) then -- Blood Gorged 1/5 - armorPenetration = armorPenetration + 2 - end + armorPenetration = armorPenetration + 2 * DataUtils:GetActiveTalentSpell({61274,61275,61276,61277,61278}) -- Blood Gorged end end @@ -99,6 +78,9 @@ end ---@return number function Data:GetArmorPenetrationRating() - local armorPenetrationRating = GetCombatRating(CR_ARMOR_PENETRATION) - return DataUtils:Round(armorPenetrationRating, 0) + local arpen = 0 + if ECS.IsWotlk then + arpen = GetCombatRating(CR_ARMOR_PENETRATION) + end + return arpen end \ No newline at end of file diff --git a/Modules/Data/Melee.lua b/Modules/Data/Melee.lua index 5fa29e9..910e695 100755 --- a/Modules/Data/Melee.lua +++ b/Modules/Data/Melee.lua @@ -220,30 +220,6 @@ function Data:GetExpertiseRating() return DataUtils:Round(expertiseRating, 0) end ----@return string -function Data:GetArmorPenetration() - local armorPenetration = GetArmorPenetration() - - if ECS.IsWotlk and classId == Data.WARRIOR then - local _, isActive = GetShapeshiftFormInfo(1) - if isActive then - armorPenetration = armorPenetration + 10 -- 10% from Battle Stance - end - end - - if classId == Data.DEATHKNIGHT then - armorPenetration = armorPenetration + 2 * DataUtils:GetActiveTalentSpell({61274,61275,61276,61277,61278}) -- Blood Gorged - end - - return DataUtils:Round(armorPenetration, 2) .. "%" -end - ----@return number -function Data:GetArmorPenetrationRating() - local armorPenetrationRating = GetCombatRating(CR_ARMOR_PENETRATION) - return DataUtils:Round(armorPenetrationRating, 0) -end - ---@return number function Data:GetMeleeHasteRating() local hasteRating = GetCombatRating(CR_HASTE_MELEE) @@ -254,5 +230,4 @@ end function Data:GetMeleeHasteBonus() local hasteBonus = GetCombatRatingBonus(CR_HASTE_MELEE) return DataUtils:Round(hasteBonus, 2) .. "%" -end - +end \ No newline at end of file diff --git a/Modules/Profile.lua b/Modules/Profile.lua index 57bc2ba..1fc0623 100755 --- a/Modules/Profile.lua +++ b/Modules/Profile.lua @@ -113,7 +113,6 @@ local function GetDefaultStatsProfile() }, penetration = { display = true, - isTbcOnly = true, refName = "MeleeArmorPenetration", text = "Armor Pen.", textColor = colors.ATTACK_SPEED_SECONDARY, @@ -121,7 +120,6 @@ local function GetDefaultStatsProfile() }, penetrationRating = { display = true, - isTbcOnly = true, refName = "MeleeArmorPenetrationRating", text = "Armor Pen. Rating", textColor = colors.ATTACK_SPEED_SECONDARY, @@ -226,7 +224,6 @@ local function GetDefaultStatsProfile() }, penetration = { display = true, - isTbcOnly = true, refName = "RangedArmorPenetration", text = "Armor Pen.", textColor = colors.ATTACK_SPEED_SECONDARY, @@ -234,7 +231,6 @@ local function GetDefaultStatsProfile() }, penetrationRating = { display = true, - isTbcOnly = true, refName = "RangedArmorPenetrationRating", text = "Armor Pen. Rating", textColor = colors.ATTACK_SPEED_SECONDARY,