added ClassicAPI integration for enhanced distance checking, healing bonuses, and Focus unit support - overrides some functionality of other integrations

This commit is contained in:
Bluewhale1337
2026-08-18 18:11:54 +02:00
parent dc2f0ca089
commit d0e027ec12
9 changed files with 96 additions and 6 deletions
+8
View File
@@ -14,6 +14,14 @@ function HealBot_Range_Check(unit, range)
end
if ( unit == "player" ) 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
+6 -1
View File
@@ -564,7 +564,12 @@ function HealBot_SpiBonus(spell)
end
function HealBot_GetBonus()
local HealBonus = HealBot_BonusScanner:GetBonus() or 0;
local HealBonus = 0;
if HealBot_Integrations_ClassicAPI_Active and GetSpellBonusHealing then
HealBonus = GetSpellBonusHealing() or 0;
else
HealBonus = HealBot_BonusScanner:GetBonus() or 0;
end
if UnitClass("player") == "PALADIN" then
local ironRank = HealBot_GetTalentRank("Ironclad")
if ironRank > 0 then
+1
View File
@@ -258,6 +258,7 @@ HealBot_ConfigDefaults = {
HealBot_Integrations_UnitXP = 0,
HealBot_Integrations_Nampower = 0,
HealBot_Integrations_SuperWoW = 0,
HealBot_Integrations_ClassicAPI = 0,
};
HealBot_Config = {};
+26
View File
@@ -1,5 +1,17 @@
HealBot_Integrations_UnitXP_Active = false;
HealBot_Integrations_Nampower_Active = false;
HealBot_Integrations_SuperWoW_Active = false;
HealBot_Integrations_ClassicAPI_Active = false;
function HealBot_GetUnitGUID(unit)
if not unit then return nil end
if HealBot_Integrations_ClassicAPI_Active and UnitGUID then
return UnitGUID(unit)
elseif HealBot_Integrations_SuperWoW_Active and GetUnitGUID then
return GetUnitGUID(unit)
end
return nil
end
function HealBot_Integrations_Toggle()
-- UnitXP
@@ -94,4 +106,18 @@ end
HealBot_Integrations_SuperWoW_Active = false;
HealBot_AddDebug("SuperWoW Integration: DISABLED");
end
-- ClassicAPI
if HealBot_Config.HealBot_Integrations_ClassicAPI == 1 then
if UnitGUID then
HealBot_Integrations_ClassicAPI_Active = true;
HealBot_AddDebug("ClassicAPI Integration: ENABLED");
else
HealBot_Integrations_ClassicAPI_Active = false;
HealBot_AddDebug("ClassicAPI Integration: DISABLED (Mod Not Found)");
end
else
HealBot_Integrations_ClassicAPI_Active = false;
HealBot_AddDebug("ClassicAPI Integration: DISABLED");
end
end
+5 -5
View File
@@ -144,8 +144,8 @@ function HealBot_Model:UpdateUnitIdentity(unit)
self.units[unit].englishClass = englishClass
self.units[unit].class = UnitClass(unit)
if HealBot_Integrations_SuperWoW_Active and GetUnitGUID then
local guid = GetUnitGUID(unit)
if (HealBot_Integrations_SuperWoW_Active or HealBot_Integrations_ClassicAPI_Active) and HealBot_GetUnitGUID then
local guid = HealBot_GetUnitGUID(unit)
if guid then
self.unitGUIDs[unit] = guid
self.guidUnits[guid] = unit
@@ -170,7 +170,7 @@ function HealBot_Model:GetUnitIDByName(name)
end
function HealBot_Model:PreserveStateByGUID()
if not HealBot_Integrations_SuperWoW_Active or not GetUnitGUID then return end
if not (HealBot_Integrations_SuperWoW_Active or HealBot_Integrations_ClassicAPI_Active) or not HealBot_GetUnitGUID then return end
local oldGUIDs = {}
for unit, guid in pairs(self.unitGUIDs) do
@@ -180,7 +180,7 @@ function HealBot_Model:PreserveStateByGUID()
local newUnitForGUID = {}
-- Scan the new roster
for _, unit in ipairs(self.partyMembers) do
local guid = GetUnitGUID(unit)
local guid = HealBot_GetUnitGUID(unit)
if guid then
newUnitForGUID[guid] = unit
self.unitGUIDs[unit] = guid
@@ -188,7 +188,7 @@ function HealBot_Model:PreserveStateByGUID()
end
end
for _, unit in ipairs(self.raidMembers) do
local guid = GetUnitGUID(unit)
local guid = HealBot_GetUnitGUID(unit)
if guid then
newUnitForGUID[guid] = unit
self.unitGUIDs[unit] = guid
+1
View File
@@ -2,4 +2,5 @@ function HealBot_Options_Integrations_OnShow(this)
HealBot_Options_Integrations_UnitXP:SetChecked(HealBot_Config.HealBot_Integrations_UnitXP);
HealBot_Options_Integrations_Nampower:SetChecked(HealBot_Config.HealBot_Integrations_Nampower);
HealBot_Options_Integrations_SuperWoW:SetChecked(HealBot_Config.HealBot_Integrations_SuperWoW);
HealBot_Options_Integrations_ClassicAPI:SetChecked(HealBot_Config.HealBot_Integrations_ClassicAPI);
end
+19
View File
@@ -61,6 +61,25 @@
</Scripts>
</CheckButton>
<CheckButton name="HealBot_Options_Integrations_ClassicAPI" inherits="OptionsCheckButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="HealBot_Options_Integrations_SuperWoW" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="5"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
getglobal(this:GetName().."Text"):SetText("Enable ClassicAPI Integration (+Healing/Focus/Distance)");
</OnLoad>
<OnClick>
HealBot_Config.HealBot_Integrations_ClassicAPI = this:GetChecked() and 1 or 0;
HealBot_Integrations_Toggle();
</OnClick>
</Scripts>
</CheckButton>
</Frames>
<Scripts>
<OnShow>
+29
View File
@@ -12,7 +12,9 @@ HealBot_Action_HealGroup = {
"party4",
};
HealBot_Action_HealGroup = {};
HealBot_Action_HealTarget = {};
HealBot_Action_HealFocus = {};
HealBot_Action_HealButtons = {};
HealBot_Action_UnitButtons = {};
@@ -589,6 +591,32 @@ function HealBot_Action_PartyChanged()
numBars = numBars + 1;
numHeaders = numHeaders + 1;
end
-- Focus
local FocusValid = numBars;
if HealBot_Integrations_ClassicAPI_Active and FocusUnit then
if HealBot_Config.ShowHeader[HealBot_Config.Current_Skin] == 1 then
HeaderPos[i + 1] = "Focus"
end
if HealBot_MayHeal("focus") then
i = i + 1;
h = h + 1;
if h < 61 then
HealBot_Action_SetHealButton(h, "focus");
local check = getglobal("HealBot_Action_HealUnit" .. h .. "Check");
check:SetChecked(0);
check.unit = "focus";
check:Show();
else
HealBot_Action_SetHealButton(i, "focus");
end
numBars = numBars + 1;
end
end
if numBars > FocusValid and HealBot_Config.ShowHeader[HealBot_Config.Current_Skin] == 1 then
numBars = numBars + 1;
numHeaders = numHeaders + 1;
end
last = last + 40
local ExtraValid = numBars;
@@ -985,6 +1013,7 @@ function HealBot_Action_Reset()
HealBot_Action:ClearAllPoints();
HealBot_Action:SetPoint("TOP", "MinimapCluster", "BOTTOM", 7, 10);
HealBot_Action_HealTarget = {};
HealBot_Action_HealFocus = {};
HealBot_Action_PartyChanged();
end
+1
View File
@@ -53,6 +53,7 @@ Default installation path: `C:\Program Files\World of Warcraft\Interface\AddOns\
* **UnitXP_SP3 Integration** - Added optional support for UnitXP's API to provide ultra-precise 3D range finding and strict Line of Sight (LoS) checks. This completely bypasses the limitations of Vanilla's 2D map coordinate distance checks.
* **Nampower Integration** - Implemented background aura tracking to map explicit HoT expiration timestamps directly from nampower. This allows for accurate real-time heal and buff tracking instead of estimating based on cast times.
* **SuperWoW Integration** - Added robust GUID-based state tracking leveraging SuperWoW's enhanced API. This tracks players by their unique IDs rather than volatile unit strings.
* **ClassicAPI Integration** - Added support for ClassicAPI to natively inject accurate +Healing bonuses, ultra-fast 3D distance checks (`UnitDistanceSquared`), and a dedicated Focus frame for pinning Main Tanks without requiring additional memory-heavy addons.
* **UI Layout** - Widened the Options UI and neatly centered elements to accommodate the new integrations tab.
* **Bug Fix - Class Colors** - Fixed a bug where class colors failed to apply to new units due to a delayed server response.
* **Bug Fix - Combat Updates** - Fixed an issue where new party members joining mid-combat failed to append to the grid without dropping combat.