feat: add debuff visual indicators, overlays, and improve range checking logic

This commit is contained in:
Bluewhale1337
2026-11-08 16:52:11 +01:00
parent fca88016f2
commit f1919ca9a9
20 changed files with 676 additions and 379 deletions
+47 -33
View File
@@ -35,43 +35,57 @@ function HealBot_Range_Check(unit, range)
if ( unit and (unit == "player" or UnitIsUnit(unit, "player") or string.find(unit, "^Test")) ) then
return_val = 1;
elseif HealBot_Integrations_ClassicAPI_Active and UnitDistanceSquared and UnitInLineOfSight then
local inSight = UnitInLineOfSight("player", unit)
if inSight then
local distSq = UnitDistanceSquared(unit)
if distSq and distSq <= (range * range) then
return_val = 1;
end
end
elseif HealBot_Integrations_UnitXP_Active then
local inSight = UnitXP("inSight", "player", unit)
if inSight then
local dist = UnitXP("distanceBetween", "player", unit, "Gaussian")
if dist and dist <= range then
return_val = 1;
end
end
elseif ( UnitIsVisible(unit) == 1 ) then
local tx, ty = GetPlayerMapPosition(unit)
local dist
if tx > 0 or ty > 0 then
local px, py = GetPlayerMapPosition("player")
dist = math.sqrt((px - tx)^2 + (py - ty)^2)
if dist > _scale and (px > 0 or py > 0) then
if ( CheckInteractDistance(unit, 4) ) then
_scale = dist
else
local checked = false
if HealBot_Integrations_ClassicAPI_Active and UnitDistanceSquared and UnitInLineOfSight then
local inSight = UnitInLineOfSight(unit)
if inSight == nil then inSight = UnitInLineOfSight("player", unit) end
if inSight ~= nil then
checked = true
if inSight then
local distSq = UnitDistanceSquared(unit)
if distSq and distSq <= (range * range) then
return_val = 1;
end
end
end
if dist <= (_scale * range / 27) then
return_val = 1
end
if not checked and HealBot_Integrations_UnitXP_Active then
local inSight = UnitXP("inSight", "player", unit)
if inSight ~= nil then
checked = true
if inSight then
local dist = UnitXP("distanceBetween", "player", unit, "Gaussian")
if dist and dist <= range then
return_val = 1;
end
end
end
else
if ( HealBot_Config.QualityRange == 1 ) or range <= 27 then
if ( CheckInteractDistance(unit, 4) ) then
return_val = 1;
end
end
if not checked and ( UnitIsVisible(unit) == 1 ) then
local tx, ty = GetPlayerMapPosition(unit)
local dist
if tx > 0 or ty > 0 then
local px, py = GetPlayerMapPosition("player")
dist = math.sqrt((px - tx)^2 + (py - ty)^2)
if dist > _scale and (px > 0 or py > 0) then
if ( CheckInteractDistance(unit, 4) ) then
_scale = dist
end
end
if dist <= (_scale * range / 27) then
return_val = 1
end
else
return_val = 1;
if ( HealBot_Config.QualityRange == 1 ) or range <= 27 or unit == "target" then
if ( CheckInteractDistance(unit, 4) ) then
return_val = 1;
end
else
return_val = 1;
end
end
end
end