From e088ae4029a1b942c5adc549e2c50714c7bf2f6e Mon Sep 17 00:00:00 2001 From: Jrc13245 Date: Mon, 10 Nov 2025 18:02:59 -0500 Subject: [PATCH 1/6] new weapon imbue check conditionals --- Conditionals.lua | 55 ++++++++++++++++++++++++++++++++++++++++++++++++ Utility.lua | 12 +++++------ 2 files changed, 61 insertions(+), 6 deletions(-) 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) From b18ad521de266f0bd18d2659468227211da565ad Mon Sep 17 00:00:00 2001 From: Jrc13245 Date: Mon, 10 Nov 2025 18:05:23 -0500 Subject: [PATCH 2/6] readme update --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 4f6ce40..4ec847a 100644 --- a/README.md +++ b/README.md @@ -326,6 +326,7 @@ The system includes pre-configured durations for 329+ debuffs across all classes | mybuffcount | [mybuffcount:>=X]
[mybuffcount:<=X] | | | If the player has more or less auras present than X.| | queuedspell | [queuedspell]
[queuedspell:X] | | * | if the player has any or a specific spell queued with nampower. | | onswingpending | [onswingpending] | | * | If the player has a on swing spell pending.| +| mhimbue/ohimbue | [mhimbue:Flametongue]
[ohimbue] | | * | If the player has weapon imbue on their mh/oh.| ### Unit Based ### The default @unitid is usually @target if you don't specify one From 84f5d63be8c7c4b3a2817661b82212c54e879d45 Mon Sep 17 00:00:00 2001 From: Jrc13245 Date: Mon, 10 Nov 2025 19:09:01 -0500 Subject: [PATCH 3/6] fix new conditionals --- Conditionals.lua | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Conditionals.lua b/Conditionals.lua index 9af1225..175c167 100644 --- a/Conditionals.lua +++ b/Conditionals.lua @@ -1948,19 +1948,19 @@ CleveRoids.Keywords = { return And(conditionals.mybuffcount,function (v) return CleveRoids.ValidatePlayerAuraCount(v.bigger, v.amount) end) end, - mhimbue = function(value) - return CleveRoids.ValidateWeaponImbue("mh", value) - end, + mhimbue = function(conditionals) + return CleveRoids.ValidateWeaponImbue("mh", conditionals.value) + end - nomhimbue = function(value) - return not CleveRoids.ValidateWeaponImbue("mh", value) - end, + nomhimbue = function(conditionals) + return not CleveRoids.ValidateWeaponImbue("mh", conditionals.value) + end - ohimbue = function(value) - return CleveRoids.ValidateWeaponImbue("oh", value) - end, + ohimbue = function(conditionals) + return CleveRoids.ValidateWeaponImbue("oh", conditionals.value) + end - noohimbue = function(value) - return not CleveRoids.ValidateWeaponImbue("oh", value) + noohimbue = function(conditionals) + return not CleveRoids.ValidateWeaponImbue("oh", conditionals.value) end } From 4920675a3aa0bf182649ac084b5ae39546313b67 Mon Sep 17 00:00:00 2001 From: Jrc13245 Date: Mon, 10 Nov 2025 19:38:44 -0500 Subject: [PATCH 4/6] fix errors --- Extensions/Tooltip/Generic.lua | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Extensions/Tooltip/Generic.lua b/Extensions/Tooltip/Generic.lua index 426d607..3eb6479 100644 --- a/Extensions/Tooltip/Generic.lua +++ b/Extensions/Tooltip/Generic.lua @@ -198,21 +198,30 @@ function CleveRoids.IndexActionSlot(slot) CleveRoids.ClearSlot(CleveRoids.reactiveSlots, slot) CleveRoids.ClearSlot(CleveRoids.actionSlots, slot) else - local actionType, _, name, rank = CleveRoids.GetActionButtonInfo(slot) + -- 1.12.1 API: GetActionInfo + local actionType, id, subType = GetActionInfo(slot) + local name, rank + + if actionType == "spell" then + name, rank = GetSpellName(id, BOOKTYPE_SPELL) + elseif actionType == "item" then + name = GetItemInfo(id) + end + if name then local reactiveName = CleveRoids.reactiveSpells[name] and name - local actionSlotName = name..(rank and ("("..rank..")") or "") + local actionSlotName = name .. (rank and ("(" .. rank .. ")") or "") if reactiveName then if not CleveRoids.reactiveSlots[reactiveName] then CleveRoids.reactiveSlots[reactiveName] = slot CleveRoids.reactiveSlots[slot] = reactiveName end - elseif not reactiveName then + else CleveRoids.ClearSlot(CleveRoids.reactiveSlots, slot) end - if actionType == "SPELL" or actionType == "ITEM" then + if actionType == "spell" or actionType == "item" then if not CleveRoids.actionSlots[actionSlotName] then CleveRoids.actionSlots[actionSlotName] = slot CleveRoids.actionSlots[slot] = actionSlotName From 914d9ab916a283c273b5012a4f3cfba3ab502319 Mon Sep 17 00:00:00 2001 From: Jrc13245 Date: Mon, 10 Nov 2025 19:45:44 -0500 Subject: [PATCH 5/6] fix errors ddue to missing comma --- Conditionals.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Conditionals.lua b/Conditionals.lua index 175c167..f2d12cb 100644 --- a/Conditionals.lua +++ b/Conditionals.lua @@ -1950,15 +1950,15 @@ CleveRoids.Keywords = { mhimbue = function(conditionals) return CleveRoids.ValidateWeaponImbue("mh", conditionals.value) - end + end, nomhimbue = function(conditionals) return not CleveRoids.ValidateWeaponImbue("mh", conditionals.value) - end + end, ohimbue = function(conditionals) return CleveRoids.ValidateWeaponImbue("oh", conditionals.value) - end + end, noohimbue = function(conditionals) return not CleveRoids.ValidateWeaponImbue("oh", conditionals.value) From 1b1d4fe94b2b101e14abe802589b4c187b24f66d Mon Sep 17 00:00:00 2001 From: Jrc13245 Date: Mon, 10 Nov 2025 19:59:13 -0500 Subject: [PATCH 6/6] revert some changes --- Extensions/Tooltip/Generic.lua | 50 +++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/Extensions/Tooltip/Generic.lua b/Extensions/Tooltip/Generic.lua index 3eb6479..0029301 100644 --- a/Extensions/Tooltip/Generic.lua +++ b/Extensions/Tooltip/Generic.lua @@ -192,36 +192,55 @@ function CleveRoids.ClearSlot(slots, slot) slots[slot] = nil end +-- Local helper for 1.12.1: safely get action button info via tooltip +function CleveRoids.GetActionButtonInfo(slot) + if not CleveRoidsActionTooltip then + CreateFrame("GameTooltip", "CleveRoidsActionTooltip", UIParent, "GameTooltipTemplate") + end + + local tooltip = CleveRoidsActionTooltip + tooltip:SetOwner(UIParent, "ANCHOR_NONE") + tooltip:ClearLines() + tooltip:SetAction(slot) + + local name, rank + local text = _G["CleveRoidsActionTooltipTextLeft1"] + if text then name = text:GetText() end + local text2 = _G["CleveRoidsActionTooltipTextLeft2"] + if text2 then + local maybeRank = text2:GetText() + -- Rank lines usually start with "Rank" + if maybeRank and string.find(maybeRank, "Rank") then + rank = maybeRank + end + end + + -- Determine if it's an item or spell based on texture (heuristic) + local tex = GetActionTexture(slot) + local actionType = tex and "SPELL" or "ITEM" + + return actionType, tex, name, rank +end + function CleveRoids.IndexActionSlot(slot) if not HasAction(slot) then CleveRoids.Actions[slot] = nil CleveRoids.ClearSlot(CleveRoids.reactiveSlots, slot) CleveRoids.ClearSlot(CleveRoids.actionSlots, slot) else - -- 1.12.1 API: GetActionInfo - local actionType, id, subType = GetActionInfo(slot) - local name, rank - - if actionType == "spell" then - name, rank = GetSpellName(id, BOOKTYPE_SPELL) - elseif actionType == "item" then - name = GetItemInfo(id) - end - + local actionType, _, name, rank = CleveRoids.GetActionButtonInfo(slot) if name then local reactiveName = CleveRoids.reactiveSpells[name] and name - local actionSlotName = name .. (rank and ("(" .. rank .. ")") or "") - + local actionSlotName = name..(rank and ("("..rank..")") or "") if reactiveName then if not CleveRoids.reactiveSlots[reactiveName] then CleveRoids.reactiveSlots[reactiveName] = slot CleveRoids.reactiveSlots[slot] = reactiveName end - else + elseif not reactiveName then CleveRoids.ClearSlot(CleveRoids.reactiveSlots, slot) end - - if actionType == "spell" or actionType == "item" then + if actionType == "SPELL" or actionType == "ITEM" then if not CleveRoids.actionSlots[actionSlotName] then CleveRoids.actionSlots[actionSlotName] = slot CleveRoids.actionSlots[slot] = actionSlotName @@ -229,7 +248,6 @@ function CleveRoids.IndexActionSlot(slot) end end end - CleveRoids.TestForActiveAction(CleveRoids.GetAction(slot)) CleveRoids.SendEventForAction(slot, "ACTIONBAR_SLOT_CHANGED", slot) end