From 2f01ca3f1b26b39f7ea57812f05582ada97b8483 Mon Sep 17 00:00:00 2001 From: Bluewhale1337 <295648290+Bluewhale1337@users.noreply.github.com> Date: Wed, 5 Aug 2026 22:18:40 +0200 Subject: [PATCH] feat: improve shaman weapon buff detection by validating specific enchant names via tooltip scanning --- HealBot_Controller_Aura.lua | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/HealBot_Controller_Aura.lua b/HealBot_Controller_Aura.lua index 9dee3c1..9c92095 100644 --- a/HealBot_Controller_Aura.lua +++ b/HealBot_Controller_Aura.lua @@ -33,9 +33,29 @@ end function HealBot_CheckShamanWeaponBuff(spellName) local hasMainHandEnchant, _, _, hasOffHandEnchant = GetWeaponEnchantInfo() - if hasMainHandEnchant or hasOffHandEnchant then - return true + if not (hasMainHandEnchant or hasOffHandEnchant) then return false end + + HealBot_ScanTooltip:SetOwner(UIParent, "ANCHOR_NONE") + local slots = {} + if hasMainHandEnchant then table.insert(slots, 16) end + if hasOffHandEnchant then table.insert(slots, 17) end + + for _, slot in ipairs(slots) do + HealBot_ScanTooltip:ClearLines() + HealBot_ScanTooltip:SetInventoryItem("player", slot) + for i = 1, HealBot_ScanTooltip:NumLines() do + local textObj = getglobal("HealBot_ScanTooltipTextLeft" .. i) + if textObj then + local text = textObj:GetText() + if text and string.find(text, spellName) then + HealBot_ScanTooltip:Hide() + return true + end + end + end end + + HealBot_ScanTooltip:Hide() return false end @@ -104,7 +124,7 @@ function HealBot_CheckBuffs(unit) end if not hasIt then - if myClass == "SHAMAN" and UnitIsUnit(unit, "player") and string.find(spellName, " Weapon") then + if myClass == HEALBOT_SHAMAN and UnitIsUnit(unit, "player") and string.find(spellName, " Weapon") then hasIt = HealBot_CheckShamanWeaponBuff(spellName) end end