From e09e84b8f94a8592018b3ca1462da2243f8eb2f4 Mon Sep 17 00:00:00 2001 From: gregcarmo Date: Tue, 23 Jun 2026 02:05:08 -0300 Subject: [PATCH 1/6] TBC features: Custom trinket/enchant rules Fix: Stat Coloring - DPS and Healing trinkets - Some enchants - Exclude Sockets from recoloring - Fix GetNormalName() to GetAlias() to more easily reword and recolor on abritrary text after change on upstream --- LocaleExtra/enUS.lua | 143 +++++++++++++++++++++++++++++++++++--- Operations/RewordLine.lua | 8 +-- 2 files changed, 137 insertions(+), 14 deletions(-) diff --git a/LocaleExtra/enUS.lua b/LocaleExtra/enUS.lua index ee9de12..5e667c2 100644 --- a/LocaleExtra/enUS.lua +++ b/LocaleExtra/enUS.lua @@ -425,10 +425,141 @@ Addon:AddExtraReplacement("Average Range", Addon:AddExtraReplacement("Spellpower text", { INPUT = "damage and healing done by magical spells and effects", - OUTPUT = "Spellpower", + OUTPUT = "Spell Power", } ) +if Addon.isTBC then + Addon:AddExtraReplacement("Spell Damage and Healing Trinket", + { + INPUT = "Increases spell damage by up to (%d+) and healing by up to (%d+) for (%d+) sec%.%s*(.*)", + OUTPUT = function(damage, healing, duration, cooldown) + return "+" .. damage .. " " .. Addon.statsInfo["Spell Damage"]:GetAlias() .. " +" .. healing .. " " .. Addon.statsInfo["Healing"]:GetAlias() .. " for " .. duration .. " sec. " .. cooldown + end, + } + ) + + Addon:AddExtraReplacement("Healing and Spell Damage Trinket", + { + INPUT = "Increases healing done by spells.-by up to (%d+) and damage done by spells by up to (%d+) for (%d+) sec%.%s*(.*)", + OUTPUT = function(healing, damage, duration, cooldown) + return "+" .. healing .. " " .. Addon.statsInfo["Healing"]:GetAlias() .. " +" .. damage .. " " .. Addon.statsInfo["Spell Damage"]:GetAlias() .. " for " .. duration .. " sec. " .. cooldown + end, + } + ) + + Addon:AddExtraReplacement("Eye of the Dead Trinket", + { + INPUT = "Increases healing done by the next (%d+) spells by up to (%d+) and damage done by up to (%d+) for (%d+) sec%.%s*(.*)", + OUTPUT = function(count, healing, damage, duration, cooldown) + return "Your next " .. count .. " spells have +" .. healing .. " " .. Addon.statsInfo["Healing"]:GetAlias() .. " and +" .. damage .. " " .. Addon.statsInfo["Spell Damage"]:GetAlias() .. " for " .. duration .. " sec. " .. cooldown + end, + } + ) + + Addon:AddExtraReplacement("Spell Crit and Spell Power Enchant", + { + INPUT = "Spell Critical Strike Rating and %+([%d,]+) Spell Damage and Healing", + OUTPUT = function(power) + return Addon.statsInfo["Spell Critical Strike Rating"]:GetAlias() .. " and +" .. power .. " " .. Addon.statsInfo["Spell Power"]:GetAlias() + end, + } + ) + + Addon:AddExtraReplacement("Spell Power and Spell Hit Enchant", + { + INPUT = "Spell Power and %+([%d,]+) Spell Hit Rating", + OUTPUT = function(hit) + return Addon.statsInfo["Spell Power"]:GetAlias() .. " and +" .. hit .. " " .. Addon.statsInfo["Spell Hit Rating"]:GetAlias() + end, + } + ) + + Addon:AddExtraReplacement("Spell Haste Trinket Proc", + { + INPUT = "increase your spell haste rating by (%d+)", + OUTPUT = function(haste) + return "+" .. haste .. " " .. Addon.statsInfo["Spell Haste Rating"]:GetAlias() + end, + } + ) + + Addon:AddExtraReplacement("Physical Haste Trinket Proc", + { + INPUT = "Increases haste rating by (%d+)", + OUTPUT = function(haste) + return "+" .. haste .. " " .. Addon.statsInfo["Physical Haste Rating"]:GetAlias() + end, + }, + { + INPUT = "Increases your haste rating by (%d+)", + OUTPUT = function(haste) + return "+" .. haste .. " " .. Addon.statsInfo["Physical Haste Rating"]:GetAlias() + end, + }, + { + INPUT = "increase your haste rating by (%d+)", + OUTPUT = function(haste) + return "+" .. haste .. " " .. Addon.statsInfo["Physical Haste Rating"]:GetAlias() + end, + } + ) + + Addon:AddExtraReplacement("Spell Damage Trinket Proc", + { + INPUT = "[Gg]rants (%d+) increased spell damage", + OUTPUT = function(damage) + return "+" .. damage .. " " .. Addon.statsInfo["Spell Damage"]:GetAlias() + end, + } + ) + + Addon:AddExtraReplacement("Attack Power Trinket Proc", + { + INPUT = "[Ii]ncreases? your attack power by (%d+)", + OUTPUT = function(ap) + return "+" .. ap .. " " .. Addon.statsInfo["Attack Power"]:GetAlias() + end, + } + ) + + Addon:AddExtraReplacement("Armor Penetration Trinket Proc", + { + INPUT = "gives? you ([%d,]+) Armor Penetration", + OUTPUT = function(ap) + return "+" .. ap .. " " .. Addon.statsInfo["Armor Penetration Rating"]:GetAlias() + end, + } + ) + + Addon:AddExtraReplacement("Spell Power Trinket Proc", + { + INPUT = "[Ii]ncreases? your spell damage and healing by (%d+)", + OUTPUT = function(power) + return "+" .. power .. " " .. Addon.statsInfo["Spell Power"]:GetAlias() + end, + } + ) + + Addon:AddExtraReplacement("Tome of Fiery Redemption Proc", + { + INPUT = "you will gain up to (%d+) spell damage and healing", + OUTPUT = function(power) + return "to +" .. power .. " " .. Addon.statsInfo["Spell Power"]:GetAlias() + end, + } + ) + + Addon:AddExtraReplacement("Spirit Trinket Proc", + { + INPUT = "[Ii]ncreases? your Spirit by %+?(%d+)", + OUTPUT = function(spirit) + return "+" .. spirit .. " " .. Addon.statsInfo["Spirit"]:GetAlias() + end, + } + ) +end + -- Temp Stat Buff Addon:AddExtraReplacement("Temp Stat Buff", { @@ -443,12 +574,4 @@ Addon:AddExtraReplacement("Temp Stat Buff", INPUT = "Increases ?y?o?u?r? ([^%d]-) by up to ([%d,]+%%?) (for %d+ sec%.?)", -- Dark Iron Smoking Pipe OUTPUT = "+%2 %1 %3", } -) - - - - - - - - +) \ No newline at end of file diff --git a/Operations/RewordLine.lua b/Operations/RewordLine.lua index 958dd1e..5a52a2c 100644 --- a/Operations/RewordLine.lua +++ b/Operations/RewordLine.lua @@ -60,7 +60,7 @@ local embeddedStatLines = Addon:MakeLookupTable{ "SecondaryStat", "Enchant", "EnchantOnUse", - "Socket", +-- "Socket", "SetBonus", } @@ -69,7 +69,7 @@ local miscRewordLines = Addon:MakeLookupTable{ "SecondaryStat", "Enchant", "EnchantOnUse", - "Socket", +-- "Socket", "SetBonus", } @@ -298,8 +298,8 @@ function Addon:RewordLine(tooltip, line, tooltipData) local replacements = {} for stat, statInfo in pairs(self.statsInfo) do - if statInfo.GetNormalName then - local normalName = strLower(statInfo:GetNormalName()) + if statInfo.GetAlias then + local normalName = strLower(statInfo:GetAlias()) local capturePattern = "%+?" .. self.L["%d[%d,%.]+"] .. " *" .. self:CoverSpecialCharacters(normalName) local startI, endI = strFind(lowerText, capturePattern) while startI do From ab8b804a1d1e0aed6e2ed20d31f1272495d48d33 Mon Sep 17 00:00:00 2001 From: gregcarmo Date: Wed, 24 Jun 2026 01:35:09 -0300 Subject: [PATCH 2/6] added remaining trinket rules --- LocaleExtra/enUS.lua | 50 ++++++++++++++++++++++++++++++++++++++- Operations/RewordLine.lua | 4 ++-- 2 files changed, 51 insertions(+), 3 deletions(-) diff --git a/LocaleExtra/enUS.lua b/LocaleExtra/enUS.lua index 5e667c2..ed2c903 100644 --- a/LocaleExtra/enUS.lua +++ b/LocaleExtra/enUS.lua @@ -481,6 +481,12 @@ if Addon.isTBC then OUTPUT = function(haste) return "+" .. haste .. " " .. Addon.statsInfo["Spell Haste Rating"]:GetAlias() end, + }, + { + INPUT = "increasing spell haste rating by (%d+)", + OUTPUT = function(haste) + return "+" .. haste .. " " .. Addon.statsInfo["Spell Haste Rating"]:GetAlias() + end, } ) @@ -520,12 +526,18 @@ if Addon.isTBC then OUTPUT = function(ap) return "+" .. ap .. " " .. Addon.statsInfo["Attack Power"]:GetAlias() end, + }, + { + INPUT = "[Ii]ncreases? attack power by (%d+)", + OUTPUT = function(ap) + return "+" .. ap .. " " .. Addon.statsInfo["Attack Power"]:GetAlias() + end, } ) Addon:AddExtraReplacement("Armor Penetration Trinket Proc", { - INPUT = "gives? you ([%d,]+) Armor Penetration", + INPUT = "gives?%s+you%s+([%d,]+)%s+[Aa]rmor%s+[Pp]enetration", OUTPUT = function(ap) return "+" .. ap .. " " .. Addon.statsInfo["Armor Penetration Rating"]:GetAlias() end, @@ -558,6 +570,42 @@ if Addon.isTBC then end, } ) + + Addon:AddExtraReplacement("Dodge Trinket Proc", + { + INPUT = "Increases dodge rating by (%d+)", + OUTPUT = function(dodge) + return "+" .. dodge .. " " .. Addon.statsInfo["Dodge Rating"]:GetAlias() + end, + } + ) + + Addon:AddExtraReplacement("Defense Trinket Proc", + { + INPUT = "Increases your defense rating by (%d+)", + OUTPUT = function(defense) + return "+" .. defense .. " " .. Addon.statsInfo["Defense Rating"]:GetAlias() + end, + } + ) + + Addon:AddExtraReplacement("Attack Power Penalty Proc", + { + INPUT = "decreases your melee and ranged attack power by (%d+)", + OUTPUT = function(ap) + return "-" .. ap .. " " .. Addon.statsInfo["Attack Power"]:GetAlias() + end, + } + ) + + Addon:AddExtraReplacement("Block Value Proc", + { + INPUT = "[Ii]ncreases your shield block value by (%d+)", + OUTPUT = function(value) + return "+" .. value .. " " .. Addon.statsInfo["Block Value"]:GetAlias() + end, + } + ) end -- Temp Stat Buff diff --git a/Operations/RewordLine.lua b/Operations/RewordLine.lua index 5a52a2c..d05aada 100644 --- a/Operations/RewordLine.lua +++ b/Operations/RewordLine.lua @@ -300,7 +300,7 @@ function Addon:RewordLine(tooltip, line, tooltipData) for stat, statInfo in pairs(self.statsInfo) do if statInfo.GetAlias then local normalName = strLower(statInfo:GetAlias()) - local capturePattern = "%+?" .. self.L["%d[%d,%.]+"] .. " *" .. self:CoverSpecialCharacters(normalName) + local capturePattern = "%+?" .. self.L["%d[%d,%.]*"] .. " *" .. self:CoverSpecialCharacters(normalName) local startI, endI = strFind(lowerText, capturePattern) while startI do local isInRatingBusterAddition = false @@ -334,7 +334,7 @@ function Addon:RewordLine(tooltip, line, tooltipData) local statText = strSub(text, startI, endI) local replacementText = statText if self:GetOption("allow", "reword") then - local plus, number = strMatch(statText, "(%+?)(" .. self.L["%d[%d,%.]+"] .. ")") + local plus, number = strMatch(statText, "(%+?)(" .. self.L["%d[%d,%.]*"] .. ")") if number and strFind(number, "%d") then -- needed for dealing with false positives like title line of 103945 local defaultForm = statInfo:GetDefaultForm(number) local normalForm = statInfo:ConvertToNormalForm(defaultForm) From cb88c8159471bc71aee72883a155c237960c7272 Mon Sep 17 00:00:00 2001 From: gregcarmo Date: Wed, 24 Jun 2026 17:55:08 -0300 Subject: [PATCH 3/6] - Implemented filtering for overlapping matches and uses user colors instead of base - Added and modified a bunch of TBC trinkets and enchants to use user alias --- LocaleExtra/enUS.lua | 286 ++++++++++++++++++++++++++++++-------- Operations/RewordLine.lua | 67 ++++----- 2 files changed, 262 insertions(+), 91 deletions(-) diff --git a/LocaleExtra/enUS.lua b/LocaleExtra/enUS.lua index ed2c903..5ab0d76 100644 --- a/LocaleExtra/enUS.lua +++ b/LocaleExtra/enUS.lua @@ -422,95 +422,242 @@ Addon:AddExtraReplacement("Average Range", -- Spellpower -Addon:AddExtraReplacement("Spellpower text", +Addon:AddExtraReplacement("Spell Power Proc", { - INPUT = "damage and healing done by magical spells and effects", - OUTPUT = "Spell Power", + INPUT = "[Ii]ncreases damage and healing done by magical spells and effects by up to (%d+)", + OUTPUT = function(power) + return "+" .. power .. " " .. Addon.statsInfo["Spell Power"]:GetAlias() + end, } ) if Addon.isTBC then - Addon:AddExtraReplacement("Spell Damage and Healing Trinket", + Addon:AddExtraReplacement("Enchants", { - INPUT = "Increases spell damage by up to (%d+) and healing by up to (%d+) for (%d+) sec%.%s*(.*)", - OUTPUT = function(damage, healing, duration, cooldown) - return "+" .. damage .. " " .. Addon.statsInfo["Spell Damage"]:GetAlias() .. " +" .. healing .. " " .. Addon.statsInfo["Healing"]:GetAlias() .. " for " .. duration .. " sec. " .. cooldown + -- Spell Crit and Spell Power Enchant + INPUT = "Spell Critical Strike Rating and %+([%d,]+) Spell Damage and Healing", + OUTPUT = function(power) + return Addon.statsInfo["Spell Critical Strike Rating"]:GetAlias() .. " and +" .. power .. " " .. Addon.statsInfo["Spell Power"]:GetAlias() end, - } - ) - - Addon:AddExtraReplacement("Healing and Spell Damage Trinket", + }, { - INPUT = "Increases healing done by spells.-by up to (%d+) and damage done by spells by up to (%d+) for (%d+) sec%.%s*(.*)", - OUTPUT = function(healing, damage, duration, cooldown) - return "+" .. healing .. " " .. Addon.statsInfo["Healing"]:GetAlias() .. " +" .. damage .. " " .. Addon.statsInfo["Spell Damage"]:GetAlias() .. " for " .. duration .. " sec. " .. cooldown + -- Spell Power and Spell Hit Enchant + INPUT = "Spell Power and %+([%d,]+) Spell Hit Rating", + OUTPUT = function(hit) + return Addon.statsInfo["Spell Power"]:GetAlias() .. " and +" .. hit .. " " .. Addon.statsInfo["Spell Hit Rating"]:GetAlias() end, - } - ) - - Addon:AddExtraReplacement("Eye of the Dead Trinket", + }, { - INPUT = "Increases healing done by the next (%d+) spells by up to (%d+) and damage done by up to (%d+) for (%d+) sec%.%s*(.*)", - OUTPUT = function(count, healing, damage, duration, cooldown) - return "Your next " .. count .. " spells have +" .. healing .. " " .. Addon.statsInfo["Healing"]:GetAlias() .. " and +" .. damage .. " " .. Addon.statsInfo["Spell Damage"]:GetAlias() .. " for " .. duration .. " sec. " .. cooldown + -- Healing and Spell Damage and Mana Regen Enchant (Classic) + INPUT = "%+([%d,]+) Healing Spells and %+([%d,]+) Damage Spells and (%d+) Mana [Pp]er 5 sec%.?", + OUTPUT = function(healing, damage, mp5) + return "+" .. healing .. " " .. Addon.statsInfo["Healing"]:GetAlias() .. " +" .. damage .. " " .. Addon.statsInfo["Spell Damage"]:GetAlias() .. " +" .. mp5 .. " " .. Addon.statsInfo["Mana Regeneration"]:GetAlias() end, - } - ) - - Addon:AddExtraReplacement("Spell Crit and Spell Power Enchant", + }, { - INPUT = "Spell Critical Strike Rating and %+([%d,]+) Spell Damage and Healing", + -- Healing and Spell Damage and Mana Regen Enchant + INPUT = "%+([%d,]+) Healing and %+([%d,]+) Spell Damage and (%d+) Mana [Pp]er 5 sec%.?", + OUTPUT = function(healing, damage, mp5) + return "+" .. healing .. " " .. Addon.statsInfo["Healing"]:GetAlias() .. " +" .. damage .. " " .. Addon.statsInfo["Spell Damage"]:GetAlias() .. " and +" .. mp5 .. " " .. Addon.statsInfo["Mana Regeneration"]:GetAlias() + end, + }, + { + -- Healing, Spell Damage and Mana Regen Enchant + INPUT = "%+([%d,]+) Healing %+([%d,]+) Spell Damage and (%d+) Mana [Pp]er 5 sec%.?", + OUTPUT = function(healing, damage, mp5) + return "+" .. healing .. " " .. Addon.statsInfo["Healing"]:GetAlias() .. " +" .. damage .. " " .. Addon.statsInfo["Spell Damage"]:GetAlias() .. " and +" .. mp5 .. " " .. Addon.statsInfo["Mana Regeneration"]:GetAlias() + end, + }, + { + -- Healing, Spell Damage and Mana Regen Enchant (2) + INPUT = "%+([%d,]+) Healing and %+([%d,]+) Spell Damage and %+(%d+) Mana Regen", + OUTPUT = function(healing, damage, mp5) + return "+" .. healing .. " " .. Addon.statsInfo["Healing"]:GetAlias() .. " +" .. damage .. " " .. Addon.statsInfo["Spell Damage"]:GetAlias() .. " and +" .. mp5 .. " " .. Addon.statsInfo["Mana Regeneration"]:GetAlias() + end, + }, + { + -- Healing, Spell Damage and Stamina Enchant + INPUT = "%+([%d,]+) Healing and %+([%d,]+) Spell Damage and %+([%d,]+) Stamina", + OUTPUT = function(healing, damage, stamina) + return "+" .. healing .. " " .. Addon.statsInfo["Healing"]:GetAlias() .. " +" .. damage .. " " .. Addon.statsInfo["Spell Damage"]:GetAlias() .. " and +" .. stamina .. " " .. Addon.statsInfo["Stamina"]:GetAlias() + end, + }, + { + -- Healing, Spell Damage and Stamina Enchant (2) + INPUT = "%+([%d,]+) Healing %+([%d,]+) Spell Damage and %+([%d,]+) Stamina", + OUTPUT = function(healing, damage, stamina) + return "+" .. healing .. " " .. Addon.statsInfo["Healing"]:GetAlias() .. " +" .. damage .. " " .. Addon.statsInfo["Spell Damage"]:GetAlias() .. " and +" .. stamina .. " " .. Addon.statsInfo["Stamina"]:GetAlias() + end, + }, + { + -- Healing, Spell Damage and Stamina Enchant (Classic Spells) + INPUT = "%+([%d,]+) Healing Spells and %+([%d,]+) Damage Spells and %+([%d,]+) Stamina", + OUTPUT = function(healing, damage, stamina) + return "+" .. healing .. " " .. Addon.statsInfo["Healing"]:GetAlias() .. " +" .. damage .. " " .. Addon.statsInfo["Spell Damage"]:GetAlias() .. " and +" .. stamina .. " " .. Addon.statsInfo["Stamina"]:GetAlias() + end, + }, + { + -- Healing and Spell Damage Enchant + INPUT = "%+([%d,]+) Healing Spells and %+([%d,]+) Damage Spells", + OUTPUT = function(healing, damage) + return "+" .. healing .. " " .. Addon.statsInfo["Healing"]:GetAlias() .. " +" .. damage .. " " .. Addon.statsInfo["Spell Damage"]:GetAlias() + end, + }, + { + -- Healing and Spell Damage Enchant + INPUT = "%+([%d,]+) Healing and %+([%d,]+) Spell Damage", + OUTPUT = function(healing, damage) + return "+" .. healing .. " " .. Addon.statsInfo["Healing"]:GetAlias() .. " +" .. damage .. " " .. Addon.statsInfo["Spell Damage"]:GetAlias() + end, + }, + { + -- Spell Damage and Healing Enchant + INPUT = "%+([%d,]+) Spell Damage and %+([%d,]+) Healing", + OUTPUT = function(damage, healing) + return "+" .. damage .. " " .. Addon.statsInfo["Spell Damage"]:GetAlias() .. " +" .. healing .. " " .. Addon.statsInfo["Healing"]:GetAlias() + end, + }, + { + -- Defense Rating and Dodge Rating Enchant + INPUT = "%+([%d,]+) Defense Rating and %+([%d,]+) Dodge Rating", + OUTPUT = function(defense, dodge) + return "+" .. defense .. " " .. Addon.statsInfo["Defense Rating"]:GetAlias() .. " and +" .. dodge .. " " .. Addon.statsInfo["Dodge Rating"]:GetAlias() + end, + }, + { + -- Dodge Rating and Defense Rating Enchant + INPUT = "%+([%d,]+) Dodge Rating and %+([%d,]+) Defense Rating", + OUTPUT = function(dodge, defense) + return "+" .. dodge .. " " .. Addon.statsInfo["Dodge Rating"]:GetAlias() .. " and +" .. defense .. " " .. Addon.statsInfo["Defense Rating"]:GetAlias() + end, + }, + { + -- Attack Power and Hit Rating Enchant + INPUT = "%+([%d,]+) Attack Power and %+([%d,]+) Hit Rating", + OUTPUT = function(ap, hit) + return "+" .. ap .. " " .. Addon.statsInfo["Attack Power"]:GetAlias() .. " and +" .. hit .. " " .. Addon.statsInfo["Physical Hit Rating"]:GetAlias() + end, + }, + { + -- Hit Rating and Attack Power Enchant + INPUT = "%+([%d,]+) Hit Rating and %+([%d,]+) Attack Power", + OUTPUT = function(hit, ap) + return "+" .. hit .. " " .. Addon.statsInfo["Physical Hit Rating"]:GetAlias() .. " and +" .. ap .. " " .. Addon.statsInfo["Attack Power"]:GetAlias() + end, + }, + { + -- Spell Damage and Healing Enchant (to Spell Power) + INPUT = "%+([%d,]+) Spell Damage and Healing", OUTPUT = function(power) - return Addon.statsInfo["Spell Critical Strike Rating"]:GetAlias() .. " and +" .. power .. " " .. Addon.statsInfo["Spell Power"]:GetAlias() + return "+" .. power .. " " .. Addon.statsInfo["Spell Power"]:GetAlias() + end, + }, + { + -- Spell Penetration Enchant + INPUT = "%+([%d,]+) Spell Penetration", + OUTPUT = function(pen) + return "+" .. pen .. " " .. Addon.statsInfo["Spell Penetration"]:GetAlias() + end, + }, + { + -- Spell Critical Strike Rating Enchant + INPUT = "%+([%d,]+) Spell Critical Strike Rating", + OUTPUT = function(crit) + return "+" .. crit .. " " .. Addon.statsInfo["Spell Critical Strike Rating"]:GetAlias() + end, + }, + { + -- Spell Hit Rating Enchant + INPUT = "%+([%d,]+) Spell Hit Rating", + OUTPUT = function(hit) + return "+" .. hit .. " " .. Addon.statsInfo["Spell Hit Rating"]:GetAlias() + end, + }, + { + -- Attack Power and Critical Strike Rating Enchant + INPUT = "%+([%d,]+) Attack Power and %+([%d,]+) Critical Strike Rating", + OUTPUT = function(ap, crit) + return "+" .. ap .. " " .. Addon.statsInfo["Attack Power"]:GetAlias() .. " and +" .. crit .. " " .. Addon.statsInfo["Physical Critical Strike Rating"]:GetAlias() + end, + }, + { + -- Critical Strike Rating and Attack Power Enchant + INPUT = "%+([%d,]+) Critical Strike Rating and %+([%d,]+) Attack Power", + OUTPUT = function(crit, ap) + return "+" .. crit .. " " .. Addon.statsInfo["Physical Critical Strike Rating"]:GetAlias() .. " and +" .. ap .. " " .. Addon.statsInfo["Attack Power"]:GetAlias() + end, + }, + { + -- Mana every 5 sec. Enchant + INPUT = "%+([%d,]+) mana every 5 sec%.?", + OUTPUT = function(regen) + return "+" .. regen .. " " .. Addon.statsInfo["Mana Regeneration"]:GetAlias() end, } ) - Addon:AddExtraReplacement("Spell Power and Spell Hit Enchant", + Addon:AddExtraReplacement("Spell Damage and Healing Trinket Procs", { - INPUT = "Spell Power and %+([%d,]+) Spell Hit Rating", - OUTPUT = function(hit) - return Addon.statsInfo["Spell Power"]:GetAlias() .. " and +" .. hit .. " " .. Addon.statsInfo["Spell Hit Rating"]:GetAlias() + -- Spell Damage and Healing Trinket + INPUT = "Increases spell damage by up to (%d+) and healing by up to (%d+) for (%d+) sec%.%s*(.*)", + OUTPUT = function(damage, healing, duration, cooldown) + return "+" .. damage .. " " .. Addon.statsInfo["Spell Damage"]:GetAlias() .. " +" .. healing .. " " .. Addon.statsInfo["Healing"]:GetAlias() .. " for " .. duration .. " sec. " .. cooldown + end, + }, + { + -- Healing and Spell Damage Trinket + INPUT = "Increases healing done by spells.-by up to (%d+) and damage done by spells by up to (%d+) for (%d+) sec%.%s*(.*)", + OUTPUT = function(healing, damage, duration, cooldown) + return "+" .. healing .. " " .. Addon.statsInfo["Healing"]:GetAlias() .. " +" .. damage .. " " .. Addon.statsInfo["Spell Damage"]:GetAlias() .. " for " .. duration .. " sec. " .. cooldown + end, + }, + { + -- Eye of the Dead Trinket + INPUT = "Increases healing done by the next (%d+) spells by up to (%d+) and damage done by up to (%d+) for (%d+) sec%.%s*(.*)", + OUTPUT = function(count, healing, damage, duration, cooldown) + return "Your next " .. count .. " spells have +" .. healing .. " " .. Addon.statsInfo["Healing"]:GetAlias() .. " +" .. damage .. " " .. Addon.statsInfo["Spell Damage"]:GetAlias() .. " for " .. duration .. " sec. " .. cooldown end, } ) - - Addon:AddExtraReplacement("Spell Haste Trinket Proc", + + Addon:AddExtraReplacement("Haste Trinket Procs", { + -- Spell Haste Trinket Proc (1) INPUT = "increase your spell haste rating by (%d+)", OUTPUT = function(haste) return "+" .. haste .. " " .. Addon.statsInfo["Spell Haste Rating"]:GetAlias() end, }, { + -- Spell Haste Trinket Proc (2) INPUT = "increasing spell haste rating by (%d+)", OUTPUT = function(haste) return "+" .. haste .. " " .. Addon.statsInfo["Spell Haste Rating"]:GetAlias() end, - } - ) - - Addon:AddExtraReplacement("Physical Haste Trinket Proc", + }, { + -- Physical Haste Trinket Proc (1) INPUT = "Increases haste rating by (%d+)", OUTPUT = function(haste) return "+" .. haste .. " " .. Addon.statsInfo["Physical Haste Rating"]:GetAlias() end, }, { + -- Physical Haste Trinket Proc (2) INPUT = "Increases your haste rating by (%d+)", OUTPUT = function(haste) return "+" .. haste .. " " .. Addon.statsInfo["Physical Haste Rating"]:GetAlias() end, }, { + -- Physical Haste Trinket Proc (3) INPUT = "increase your haste rating by (%d+)", OUTPUT = function(haste) return "+" .. haste .. " " .. Addon.statsInfo["Physical Haste Rating"]:GetAlias() end, } ) - + Addon:AddExtraReplacement("Spell Damage Trinket Proc", { INPUT = "[Gg]rants (%d+) increased spell damage", @@ -520,18 +667,27 @@ if Addon.isTBC then } ) - Addon:AddExtraReplacement("Attack Power Trinket Proc", + Addon:AddExtraReplacement("Attack Power Trinket Procs", { + -- Attack Power Trinket Proc (1) INPUT = "[Ii]ncreases? your attack power by (%d+)", OUTPUT = function(ap) return "+" .. ap .. " " .. Addon.statsInfo["Attack Power"]:GetAlias() end, }, { + -- Attack Power Trinket Proc (2) INPUT = "[Ii]ncreases? attack power by (%d+)", OUTPUT = function(ap) return "+" .. ap .. " " .. Addon.statsInfo["Attack Power"]:GetAlias() end, + }, + { + -- Attack Power Penalty Proc + INPUT = "decreases your melee and ranged attack power by (%d+)", + OUTPUT = function(ap) + return "-" .. ap .. " " .. Addon.statsInfo["Attack Power"]:GetAlias() + end, } ) @@ -544,17 +700,16 @@ if Addon.isTBC then } ) - Addon:AddExtraReplacement("Spell Power Trinket Proc", + Addon:AddExtraReplacement("Spell Power Trinket Procs", { + -- Spell Power Trinket Proc INPUT = "[Ii]ncreases? your spell damage and healing by (%d+)", OUTPUT = function(power) return "+" .. power .. " " .. Addon.statsInfo["Spell Power"]:GetAlias() end, - } - ) - - Addon:AddExtraReplacement("Tome of Fiery Redemption Proc", + }, { + -- Spell damage and healing Proc INPUT = "you will gain up to (%d+) spell damage and healing", OUTPUT = function(power) return "to +" .. power .. " " .. Addon.statsInfo["Spell Power"]:GetAlias() @@ -571,38 +726,49 @@ if Addon.isTBC then } ) - Addon:AddExtraReplacement("Dodge Trinket Proc", + Addon:AddExtraReplacement("Tank Trinket Procs", { + -- Dodge Trinket Proc INPUT = "Increases dodge rating by (%d+)", OUTPUT = function(dodge) return "+" .. dodge .. " " .. Addon.statsInfo["Dodge Rating"]:GetAlias() end, - } - ) - - Addon:AddExtraReplacement("Defense Trinket Proc", + }, { + -- Defense Trinket Proc INPUT = "Increases your defense rating by (%d+)", OUTPUT = function(defense) return "+" .. defense .. " " .. Addon.statsInfo["Defense Rating"]:GetAlias() end, - } - ) - - Addon:AddExtraReplacement("Attack Power Penalty Proc", + }, { - INPUT = "decreases your melee and ranged attack power by (%d+)", - OUTPUT = function(ap) - return "-" .. ap .. " " .. Addon.statsInfo["Attack Power"]:GetAlias() + -- Block Value Proc (1) + INPUT = "[Ii]ncreases your shield block value by (%d+)", + OUTPUT = function(value) + return "+" .. value .. " " .. Addon.statsInfo["Block Value"]:GetAlias() + end, + }, + { + -- Block Value Proc (2) + INPUT = "[Ii]ncreases the block value of your shield by (%d+)", + OUTPUT = function(value) + return "+" .. value .. " " .. Addon.statsInfo["Block Value"]:GetAlias() + end, + }, + { + -- Block Rating Proc + INPUT = "Increases block rating by (%d+)", + OUTPUT = function(value) + return "+" .. value .. " " .. Addon.statsInfo["Block Rating"]:GetAlias() end, } ) - Addon:AddExtraReplacement("Block Value Proc", + Addon:AddExtraReplacement("Mana Regen Trinket Proc", { - INPUT = "[Ii]ncreases your shield block value by (%d+)", - OUTPUT = function(value) - return "+" .. value .. " " .. Addon.statsInfo["Block Value"]:GetAlias() + INPUT = "bonus%s+of%s+(%d+)%s+mana%s+regen%s+per%s+5%s+sec", + OUTPUT = function(regen) + return "+" .. regen .. " " .. Addon.statsInfo["Mana Regeneration"]:GetAlias() end, } ) diff --git a/Operations/RewordLine.lua b/Operations/RewordLine.lua index d05aada..5237b63 100644 --- a/Operations/RewordLine.lua +++ b/Operations/RewordLine.lua @@ -317,45 +317,50 @@ function Addon:RewordLine(tooltip, line, tooltipData) end end end - tblSort(replacements, function(a, b) return b[1] < a[1] end) - local highest, failed + tblSort(replacements, function(a, b) + if a[1] ~= b[1] then + return b[1] < a[1] + else + return b[2] < a[2] + end + end) + local filteredReplacements = {} + local leftmostStart for _, replacement in ipairs(replacements) do local startI, endI, stat = unpack(replacement) - if highest and endI >= highest then - failed = true + if not leftmostStart or endI < leftmostStart then + tinsert(filteredReplacements, replacement) + leftmostStart = startI end - highest = startI end - if not failed then - for _, replacement in ipairs(replacements) do - local startI, endI, stat = unpack(replacement) - local statInfo = self.statsInfo[stat] - - local statText = strSub(text, startI, endI) - local replacementText = statText - if self:GetOption("allow", "reword") then - local plus, number = strMatch(statText, "(%+?)(" .. self.L["%d[%d,%.]*"] .. ")") - if number and strFind(number, "%d") then -- needed for dealing with false positives like title line of 103945 - local defaultForm = statInfo:GetDefaultForm(number) - local normalForm = statInfo:ConvertToNormalForm(defaultForm) - local aliasForm = statInfo:Reword(normalForm, normalForm) - if plus == "" then - aliasForm = strGsub(aliasForm, "^%+", "") -- won't work in some locales - end - - replacementText = aliasForm - if self:GetOption("allow", "recolor") then - replacementText = self:MakeColorCode(statInfo.color, replacementText) - end + for _, replacement in ipairs(filteredReplacements) do + local startI, endI, stat = unpack(replacement) + local statInfo = self.statsInfo[stat] + + local statText = strSub(text, startI, endI) + local replacementText = statText + if self:GetOption("allow", "reword") then + local plus, number = strMatch(statText, "(%+?)(" .. self.L["%d[%d,%.]*"] .. ")") + if number and strFind(number, "%d") then -- needed for dealing with false positives like title line of 103945 + local defaultForm = statInfo:GetDefaultForm(number) + local normalForm = statInfo:ConvertToNormalForm(defaultForm) + local aliasForm = statInfo:Reword(normalForm, normalForm) + if plus == "" then + aliasForm = strGsub(aliasForm, "^%+", "") -- won't work in some locales end - else - if self:GetOption("allow", "recolor") then - replacementText = self:MakeColorCode(statInfo.color, replacementText) + + replacementText = aliasForm + if self:GetOption("allow", "recolor") and self:GetOption("doRecolor", stat) then + replacementText = self:MakeColorCode(self:GetOption("color", stat), replacementText) end end - - text = strSub(text, 1, startI-1) .. replacementText .. strSub(text, endI+1) + else + if self:GetOption("allow", "recolor") and self:GetOption("doRecolor", stat) then + replacementText = self:MakeColorCode(self:GetOption("color", stat), replacementText) + end end + + text = strSub(text, 1, startI-1) .. replacementText .. strSub(text, endI+1) end end From 1d61f4b3acd2dfe19c341b4bbfa7fefe02d2ff80 Mon Sep 17 00:00:00 2001 From: gregcarmo Date: Sun, 28 Jun 2026 01:19:19 -0300 Subject: [PATCH 4/6] crit enchant added --- LocaleExtra/enUS.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/LocaleExtra/enUS.lua b/LocaleExtra/enUS.lua index 5ab0d76..c633028 100644 --- a/LocaleExtra/enUS.lua +++ b/LocaleExtra/enUS.lua @@ -566,6 +566,13 @@ if Addon.isTBC then return "+" .. crit .. " " .. Addon.statsInfo["Spell Critical Strike Rating"]:GetAlias() end, }, + { + -- Critical Strike Rating Enchant + INPUT = "%+([%d,]+) Critical Strike Rating", + OUTPUT = function(crit) + return "+" .. crit .. " " .. Addon.statsInfo["Physical Critical Strike Rating"]:GetAlias() + end, + }, { -- Spell Hit Rating Enchant INPUT = "%+([%d,]+) Spell Hit Rating", From 159e5ea0e31d9a8d6373241fe39f881fe260380f Mon Sep 17 00:00:00 2001 From: gregcarmo Date: Mon, 29 Jun 2026 19:12:40 -0300 Subject: [PATCH 5/6] added more meta enchants to reword/recolor --- LocaleExtra/enUS.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/LocaleExtra/enUS.lua b/LocaleExtra/enUS.lua index c633028..004dfc0 100644 --- a/LocaleExtra/enUS.lua +++ b/LocaleExtra/enUS.lua @@ -559,6 +559,13 @@ if Addon.isTBC then return "+" .. pen .. " " .. Addon.statsInfo["Spell Penetration"]:GetAlias() end, }, + { + -- All Resistances Enchant + INPUT = "%+([%d,]+) All Resistances", + OUTPUT = function(resist) + return "+" .. resist .. " " .. Addon.statsInfo["All Resistance"]:GetAlias() + end, + }, { -- Spell Critical Strike Rating Enchant INPUT = "%+([%d,]+) Spell Critical Strike Rating", @@ -580,6 +587,13 @@ if Addon.isTBC then return "+" .. hit .. " " .. Addon.statsInfo["Spell Hit Rating"]:GetAlias() end, }, + { + -- Dodge Rating Enchant + INPUT = "%+([%d,]+) Dodge Rating", + OUTPUT = function(dodge) + return "+" .. dodge .. " " .. Addon.statsInfo["Dodge Rating"]:GetAlias() + end, + }, { -- Attack Power and Critical Strike Rating Enchant INPUT = "%+([%d,]+) Attack Power and %+([%d,]+) Critical Strike Rating", @@ -600,6 +614,13 @@ if Addon.isTBC then OUTPUT = function(regen) return "+" .. regen .. " " .. Addon.statsInfo["Mana Regeneration"]:GetAlias() end, + }, + { + -- Mana Regen and Healing Enchant + INPUT = "%+([%d,]+) Mana Regen and %+([%d,]+) Healing", + OUTPUT = function(regen, healing) + return "+" .. regen .. " " .. Addon.statsInfo["Mana Regeneration"]:GetAlias() .. " and +" .. healing .. " " .. Addon.statsInfo["Healing"]:GetAlias() + end, } ) From dfd046f9c2f5a7eece9c438aac42d7ac68e34d3e Mon Sep 17 00:00:00 2001 From: gregcarmo Date: Tue, 30 Jun 2026 13:49:45 -0300 Subject: [PATCH 6/6] prevent enchant consumables from getting recolored/reworded, only recolor/reword when applied to item --- Operations/RewordLine.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Operations/RewordLine.lua b/Operations/RewordLine.lua index 5237b63..38282cc 100644 --- a/Operations/RewordLine.lua +++ b/Operations/RewordLine.lua @@ -73,6 +73,10 @@ local miscRewordLines = Addon:MakeLookupTable{ "SetBonus", } +local function IsPermanentEnchantText(text) + return strFind(text, "[Pp]ermanent") or strFind(text, "[Dd]auerhaft") or strFind(text, "영구") or strFind(text, "永久") or strFind(text, "[Пп]остоянн") +end + function Addon:RewordLine(tooltip, line, tooltipData) local isRatingBusterActive = RatingBuster and RatingBuster.ProcessLine and true or false @@ -90,7 +94,7 @@ function Addon:RewordLine(tooltip, line, tooltipData) text, line.rewordRight = unpack(cache, 1, 2) else - if not line.stat and miscRewordLines[line.type] and self:GetOption("doReword", "Miscellaneous") then + if not line.stat and miscRewordLines[line.type] and not IsPermanentEnchantText(text) and self:GetOption("doReword", "Miscellaneous") then -- localeExtra replacements if self:GetOption("allow", "reword") then for _, definition in ipairs(self:GetExtraReplacements()) do @@ -281,7 +285,7 @@ function Addon:RewordLine(tooltip, line, tooltipData) end end - if not line.stat and embeddedStatLines[line.type] and (self:GetOption("allow", "reword") or self:GetOption("allow", "recolor")) then + if not line.stat and embeddedStatLines[line.type] and not IsPermanentEnchantText(text) and (self:GetOption("allow", "reword") or self:GetOption("allow", "recolor")) then -- rename and recolor stats in the middle of non-stat lines local lowerText = strLower(text)