mirror of
https://github.com/Bluewhale1337/HealBotBlue.git
synced 2026-09-11 18:00:20 +00:00
added ClassicAPI integration for enhanced distance checking, healing bonuses, and Focus unit support - overrides some functionality of other integrations
This commit is contained in:
@@ -14,6 +14,14 @@ function HealBot_Range_Check(unit, range)
|
|||||||
end
|
end
|
||||||
if ( unit == "player" ) then
|
if ( unit == "player" ) then
|
||||||
return_val = 1;
|
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
|
elseif HealBot_Integrations_UnitXP_Active then
|
||||||
local inSight = UnitXP("inSight", "player", unit)
|
local inSight = UnitXP("inSight", "player", unit)
|
||||||
if inSight then
|
if inSight then
|
||||||
|
|||||||
@@ -564,7 +564,12 @@ function HealBot_SpiBonus(spell)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function HealBot_GetBonus()
|
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
|
if UnitClass("player") == "PALADIN" then
|
||||||
local ironRank = HealBot_GetTalentRank("Ironclad")
|
local ironRank = HealBot_GetTalentRank("Ironclad")
|
||||||
if ironRank > 0 then
|
if ironRank > 0 then
|
||||||
|
|||||||
@@ -258,6 +258,7 @@ HealBot_ConfigDefaults = {
|
|||||||
HealBot_Integrations_UnitXP = 0,
|
HealBot_Integrations_UnitXP = 0,
|
||||||
HealBot_Integrations_Nampower = 0,
|
HealBot_Integrations_Nampower = 0,
|
||||||
HealBot_Integrations_SuperWoW = 0,
|
HealBot_Integrations_SuperWoW = 0,
|
||||||
|
HealBot_Integrations_ClassicAPI = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
HealBot_Config = {};
|
HealBot_Config = {};
|
||||||
|
|||||||
@@ -1,5 +1,17 @@
|
|||||||
HealBot_Integrations_UnitXP_Active = false;
|
HealBot_Integrations_UnitXP_Active = false;
|
||||||
HealBot_Integrations_Nampower_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()
|
function HealBot_Integrations_Toggle()
|
||||||
-- UnitXP
|
-- UnitXP
|
||||||
@@ -94,4 +106,18 @@ end
|
|||||||
HealBot_Integrations_SuperWoW_Active = false;
|
HealBot_Integrations_SuperWoW_Active = false;
|
||||||
HealBot_AddDebug("SuperWoW Integration: DISABLED");
|
HealBot_AddDebug("SuperWoW Integration: DISABLED");
|
||||||
end
|
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
|
end
|
||||||
|
|||||||
+5
-5
@@ -144,8 +144,8 @@ function HealBot_Model:UpdateUnitIdentity(unit)
|
|||||||
self.units[unit].englishClass = englishClass
|
self.units[unit].englishClass = englishClass
|
||||||
self.units[unit].class = UnitClass(unit)
|
self.units[unit].class = UnitClass(unit)
|
||||||
|
|
||||||
if HealBot_Integrations_SuperWoW_Active and GetUnitGUID then
|
if (HealBot_Integrations_SuperWoW_Active or HealBot_Integrations_ClassicAPI_Active) and HealBot_GetUnitGUID then
|
||||||
local guid = GetUnitGUID(unit)
|
local guid = HealBot_GetUnitGUID(unit)
|
||||||
if guid then
|
if guid then
|
||||||
self.unitGUIDs[unit] = guid
|
self.unitGUIDs[unit] = guid
|
||||||
self.guidUnits[guid] = unit
|
self.guidUnits[guid] = unit
|
||||||
@@ -170,7 +170,7 @@ function HealBot_Model:GetUnitIDByName(name)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function HealBot_Model:PreserveStateByGUID()
|
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 = {}
|
local oldGUIDs = {}
|
||||||
for unit, guid in pairs(self.unitGUIDs) do
|
for unit, guid in pairs(self.unitGUIDs) do
|
||||||
@@ -180,7 +180,7 @@ function HealBot_Model:PreserveStateByGUID()
|
|||||||
local newUnitForGUID = {}
|
local newUnitForGUID = {}
|
||||||
-- Scan the new roster
|
-- Scan the new roster
|
||||||
for _, unit in ipairs(self.partyMembers) do
|
for _, unit in ipairs(self.partyMembers) do
|
||||||
local guid = GetUnitGUID(unit)
|
local guid = HealBot_GetUnitGUID(unit)
|
||||||
if guid then
|
if guid then
|
||||||
newUnitForGUID[guid] = unit
|
newUnitForGUID[guid] = unit
|
||||||
self.unitGUIDs[unit] = guid
|
self.unitGUIDs[unit] = guid
|
||||||
@@ -188,7 +188,7 @@ function HealBot_Model:PreserveStateByGUID()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
for _, unit in ipairs(self.raidMembers) do
|
for _, unit in ipairs(self.raidMembers) do
|
||||||
local guid = GetUnitGUID(unit)
|
local guid = HealBot_GetUnitGUID(unit)
|
||||||
if guid then
|
if guid then
|
||||||
newUnitForGUID[guid] = unit
|
newUnitForGUID[guid] = unit
|
||||||
self.unitGUIDs[unit] = guid
|
self.unitGUIDs[unit] = guid
|
||||||
|
|||||||
@@ -2,4 +2,5 @@ function HealBot_Options_Integrations_OnShow(this)
|
|||||||
HealBot_Options_Integrations_UnitXP:SetChecked(HealBot_Config.HealBot_Integrations_UnitXP);
|
HealBot_Options_Integrations_UnitXP:SetChecked(HealBot_Config.HealBot_Integrations_UnitXP);
|
||||||
HealBot_Options_Integrations_Nampower:SetChecked(HealBot_Config.HealBot_Integrations_Nampower);
|
HealBot_Options_Integrations_Nampower:SetChecked(HealBot_Config.HealBot_Integrations_Nampower);
|
||||||
HealBot_Options_Integrations_SuperWoW:SetChecked(HealBot_Config.HealBot_Integrations_SuperWoW);
|
HealBot_Options_Integrations_SuperWoW:SetChecked(HealBot_Config.HealBot_Integrations_SuperWoW);
|
||||||
|
HealBot_Options_Integrations_ClassicAPI:SetChecked(HealBot_Config.HealBot_Integrations_ClassicAPI);
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -61,6 +61,25 @@
|
|||||||
</Scripts>
|
</Scripts>
|
||||||
</CheckButton>
|
</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>
|
</Frames>
|
||||||
<Scripts>
|
<Scripts>
|
||||||
<OnShow>
|
<OnShow>
|
||||||
|
|||||||
@@ -12,7 +12,9 @@ HealBot_Action_HealGroup = {
|
|||||||
"party4",
|
"party4",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
HealBot_Action_HealGroup = {};
|
||||||
HealBot_Action_HealTarget = {};
|
HealBot_Action_HealTarget = {};
|
||||||
|
HealBot_Action_HealFocus = {};
|
||||||
HealBot_Action_HealButtons = {};
|
HealBot_Action_HealButtons = {};
|
||||||
HealBot_Action_UnitButtons = {};
|
HealBot_Action_UnitButtons = {};
|
||||||
|
|
||||||
@@ -590,6 +592,32 @@ function HealBot_Action_PartyChanged()
|
|||||||
numHeaders = numHeaders + 1;
|
numHeaders = numHeaders + 1;
|
||||||
end
|
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
|
last = last + 40
|
||||||
local ExtraValid = numBars;
|
local ExtraValid = numBars;
|
||||||
if HealBot_Config.EmergencyHeals == 1 then
|
if HealBot_Config.EmergencyHeals == 1 then
|
||||||
@@ -985,6 +1013,7 @@ function HealBot_Action_Reset()
|
|||||||
HealBot_Action:ClearAllPoints();
|
HealBot_Action:ClearAllPoints();
|
||||||
HealBot_Action:SetPoint("TOP", "MinimapCluster", "BOTTOM", 7, 10);
|
HealBot_Action:SetPoint("TOP", "MinimapCluster", "BOTTOM", 7, 10);
|
||||||
HealBot_Action_HealTarget = {};
|
HealBot_Action_HealTarget = {};
|
||||||
|
HealBot_Action_HealFocus = {};
|
||||||
HealBot_Action_PartyChanged();
|
HealBot_Action_PartyChanged();
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -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.
|
* **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.
|
* **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.
|
* **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.
|
* **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 - 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.
|
* **Bug Fix - Combat Updates** - Fixed an issue where new party members joining mid-combat failed to append to the grid without dropping combat.
|
||||||
|
|||||||
Reference in New Issue
Block a user