feat: improve shaman weapon buff detection by validating specific enchant names via tooltip scanning

This commit is contained in:
Bluewhale1337
2026-08-05 22:18:40 +02:00
parent 45ce2a024f
commit 2f01ca3f1b
+23 -3
View File
@@ -33,9 +33,29 @@ end
function HealBot_CheckShamanWeaponBuff(spellName) function HealBot_CheckShamanWeaponBuff(spellName)
local hasMainHandEnchant, _, _, hasOffHandEnchant = GetWeaponEnchantInfo() local hasMainHandEnchant, _, _, hasOffHandEnchant = GetWeaponEnchantInfo()
if hasMainHandEnchant or hasOffHandEnchant then if not (hasMainHandEnchant or hasOffHandEnchant) then return false end
return true
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 end
HealBot_ScanTooltip:Hide()
return false return false
end end
@@ -104,7 +124,7 @@ function HealBot_CheckBuffs(unit)
end end
if not hasIt then 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) hasIt = HealBot_CheckShamanWeaponBuff(spellName)
end end
end end