From 494aced5bd6363810957583c9c5d5166df17aa1e Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Mon, 27 Jul 2026 22:44:13 -0500 Subject: [PATCH] Resolve [mhimbue:Name] via enchant DBC, not tooltip scan CheckWeaponImbueByName now resolves the applied temp-enchant ID to its localized name via ClassicAPI (C_Item.GetEnchantInfo) and matches that directly -- exact and locale-clean, replacing the green-text tooltip heuristics for named enchants (poisons, oils, Mongoose, Windfury). Only nameless enchants (sharpening/weightstones, no DBC name) fall through to the tooltip scan, so no regression. --- Conditionals.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Conditionals.lua b/Conditionals.lua index e614a6a..197c866 100644 --- a/Conditionals.lua +++ b/Conditionals.lua @@ -4752,6 +4752,19 @@ function CleveRoids.CheckWeaponImbueByName(slot, imbueName) return true -- No name to check end + -- Fast path: resolve the applied temp-enchant's ID -> localized name via + -- ClassicAPI (SpellItemEnchantment.dbc) and match that directly -- exact, + -- locale-clean, no green-text tooltip heuristics. Only nameless enchants + -- (e.g. sharpening stones, which show "+N Weapon Damage" and carry no DBC + -- name) return nil here and fall through to the tooltip scan below. + local _, _, _, enchantID = CleveRoids.ClassicAPI.GetWeaponEnchant(slot) + local enchantName = enchantID and CleveRoids.ClassicAPI.GetEnchantName(enchantID) + if enchantName then + local nlower = GetLowerNormalizedName(enchantName) + local want = GetLowerNormalizedName(imbueName) + return nlower == want or string.find(nlower, want, 1, true) ~= nil + end + -- Create tooltip scanner if needed if not CleveRoidsTooltip then CreateFrame("GameTooltip", "CleveRoidsTooltip", nil, "GameTooltipTemplate")