diff --git a/Conditionals.lua b/Conditionals.lua index 360f6c8..9af1225 100644 --- a/Conditionals.lua +++ b/Conditionals.lua @@ -793,6 +793,45 @@ function CleveRoids.ValidatePlayerDebuff(args) return CleveRoids.ValidateAura("player", args, false) end +function CleveRoids.ValidateWeaponImbue(slot, imbueName) + -- Check if weapon has enchant + local hasMainEnchant, mainExpiration, mainCharges, hasOffEnchant, offExpiration, offCharges = GetWeaponEnchantInfo() + + local hasEnchant = (slot == "mh" and hasMainEnchant) or (slot == "oh" and hasOffEnchant) + if not hasEnchant then return false end + + -- If no specific imbue requested, just return enchant exists + if not imbueName or imbueName == "" then return true end + + -- Create tooltip scanner if needed + if not CleveRoidsTooltip then + CreateFrame("GameTooltip", "CleveRoidsTooltip", nil, "GameTooltipTemplate") + end + + -- Scan weapon tooltip + CleveRoidsTooltip:SetOwner(UIParent, "ANCHOR_NONE") + CleveRoidsTooltip:ClearLines() + CleveRoidsTooltip:SetInventoryItem("player", slot == "mh" and 16 or 17) + + -- Look for green text (temporary enchant) + for i = 1, CleveRoidsTooltip:NumLines() do + local text = _G["CleveRoidsTooltipTextLeft"..i] + if text then + local line = text:GetText() + local r, g, b = text:GetTextColor() + -- Green text indicates temporary enchant + if line and g > 0.8 and r < 0.2 and b < 0.2 then + -- Normalize and compare + line = string.lower(line) + imbueName = string.lower(string.gsub(imbueName, "_", " ")) + return string.find(line, imbueName, 1, true) ~= nil + end + end + end + + return false +end + -- TODO: Look into https://github.com/Stanzilla/WoWUIBugs/issues/47 if needed function CleveRoids.GetCooldown(name, ignoreGCD) if not name then return 0 end @@ -1907,5 +1946,21 @@ CleveRoids.Keywords = { mybuffcount = function(conditionals) return And(conditionals.mybuffcount,function (v) return CleveRoids.ValidatePlayerAuraCount(v.bigger, v.amount) end) + end, + + mhimbue = function(value) + return CleveRoids.ValidateWeaponImbue("mh", value) + end, + + nomhimbue = function(value) + return not CleveRoids.ValidateWeaponImbue("mh", value) + end, + + ohimbue = function(value) + return CleveRoids.ValidateWeaponImbue("oh", value) + end, + + noohimbue = function(value) + return not CleveRoids.ValidateWeaponImbue("oh", value) end } diff --git a/Utility.lua b/Utility.lua index eb89341..2d9d101 100644 --- a/Utility.lua +++ b/Utility.lua @@ -515,12 +515,12 @@ lib.durations = lib.durations or { [1824] = 9, -- Rake (Rank 3) [9904] = 9, -- Rake (Rank 4) - [1079] = 8, -- Rip (Rank 1) - base duration (scales with combo points) - [9492] = 8, -- Rip (Rank 2) - [9493] = 8, -- Rip (Rank 3) - [9752] = 8, -- Rip (Rank 4) - [9894] = 8, -- Rip (Rank 5) - [9896] = 8, -- Rip (Rank 6) + [1079] = 10, -- Rip (Rank 1) - base duration (scales with combo points) + [9492] = 10, -- Rip (Rank 2) + [9493] = 10, -- Rip (Rank 3) + [9752] = 10, -- Rip (Rank 4) + [9894] = 10, -- Rip (Rank 5) + [9896] = 10, -- Rip (Rank 6) [2908] = 15, -- Soothe Animal (Rank 1) [8955] = 15, -- Soothe Animal (Rank 2)