mirror of
https://github.com/Bluewhale1337/HealBotBlue.git
synced 2026-09-12 10:10:45 +00:00
feat: improve shaman weapon buff detection by validating specific enchant names via tooltip scanning
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user