feat: implement robust spell failure detection, talent-based healing calculations, and improved incoming heal synchronization.

This commit is contained in:
Bluewhale1337
2026-07-12 19:44:50 +02:00
parent d0d6a39fb9
commit ff97414bb1
7 changed files with 77 additions and 41 deletions
+5 -1
View File
@@ -284,12 +284,16 @@ do
spellName = HealBot_ScanTooltipTextLeft1 and HealBot_ScanTooltipTextLeft1:GetText()
end
HealBot_CastFailed = false
orig(slot, checkCursor, onSelf)
if autoSelfCast then
SetCVar("autoSelfCast", autoSelfCast)
end
if spellName and HealBot_AnnounceCast then
if spellName and not HealBot_CastFailed then
HealBot_CastingSpell = spellName
HealBot_CastingTarget = mouseover
HealBot_Process_HealValue(spellName, mouseover)
HealBot_AnnounceCast(spellName, mouseover)
end
end
+1 -1
View File
@@ -1,6 +1,6 @@
## Interface: 11200
## Title: HealBotBlue
## Version: 1.4.0
## Version: 1.4.1
## Author: Bluewhale
## Notes: Adds panel with skinable bars for healing and decursive
## SavedVariables: HealBot_Config
+1
View File
@@ -70,6 +70,7 @@ function HealBot_OnEvent_AddonMsg(this, addon_id, inc_msg, dist_target, sender_i
local tmpTest, unitname, heal_val
tmpTest, tmpTest, unitname, heal_val = string.find(inc_msg, ">> (%a+) <<=>> (.%d+) <<" );
if heal_val then
if sender_id == UnitName("player") then return end
if not HealBot_HealsIn[unitname] then
HealBot_HealsIn[unitname] = 0;
end
+7 -4
View File
@@ -196,9 +196,9 @@ local HealBot_EventHandlers = {
-- Legacy pass-throughs
["CHAT_MSG_ADDON"] = function(this, arg1, arg2, arg3, arg4) HealBot_OnEvent_AddonMsg(this, arg1, arg2, arg3, arg4) end,
["SPELLCAST_START"] = function(this, arg1, arg2) HealBot_OnEvent_SpellcastStart(this, arg1, arg2) end,
["SPELLCAST_STOP"] = function(this) HealBot_OnEvent_SpellcastStop(this) end,
["SPELLCAST_INTERRUPTED"] = function(this) HealBot_OnEvent_SpellcastStop(this) end,
["SPELLCAST_FAILED"] = function(this) HealBot_OnEvent_SpellcastStop(this) end,
["SPELLCAST_STOP"] = function(this) HealBot_OnEvent_SpellcastStop(this, "SPELLCAST_STOP") end,
["SPELLCAST_INTERRUPTED"] = function(this) HealBot_OnEvent_SpellcastStop(this, "SPELLCAST_INTERRUPTED") end,
["SPELLCAST_FAILED"] = function(this) HealBot_OnEvent_SpellcastStop(this, "SPELLCAST_FAILED") end,
["PLAYER_REGEN_DISABLED"] = function(this) HealBot_OnEvent_PlayerRegenDisabled(this) end,
["PLAYER_REGEN_ENABLED"] = function(this) HealBot_OnEvent_PlayerRegenEnabled(this) end,
["BAG_UPDATE_COOLDOWN"] = function(this, arg1) HealBot_OnEvent_BagUpdateCooldown(this, arg1) end,
@@ -473,8 +473,11 @@ function HealBot_OnEvent_SpellcastStart(this, spell, duration)
end
end
function HealBot_OnEvent_SpellcastStop(this)
function HealBot_OnEvent_SpellcastStop(this, eventName)
HealBot_IsCasting = false;
if eventName == "SPELLCAST_FAILED" then
HealBot_CastFailed = true;
end
HealBot_StopCasting();
HealBot_RecalcHeals();
if HealBot_IamRessing then
+45 -24
View File
@@ -127,26 +127,8 @@ function HealBot_AnnounceCast(spell, target)
end
end
function HealBot_StartCasting(spell, target, ttype)
HealBot_CastSpellByName(spell);
HealBot_CastingSpell = spell;
HealBot_CastingTarget = target;
if ( SpellCanTargetUnit(target) ) then
SpellTargetUnit(target);
ttype = "fired";
elseif SpellIsTargeting() then
SpellTargetUnit(target);
SpellStopTargeting()
elseif ttype == "direct" then
if ( CheckInteractDistance(target, 4) ) then
ttype = "fired";
end
end
HealBot_AnnounceCast(spell, target)
if ttype == "fired" and HealBot_Spells[spell] then
if HealBot_Spells[spell].CastTime > 1 then
function HealBot_Process_HealValue(spell, target)
if HealBot_Spells[spell] and HealBot_Spells[spell].CastTime > 1 then
HealBot_HealValue = HealBot_Spells[spell].HealsDur;
-- Apply dynamic Preservation bonus
@@ -169,19 +151,58 @@ function HealBot_StartCasting(spell, target, ttype)
end
end
end
local uname = UnitName(target)
if uname then
HealBot_SendAddonMessage(HEALBOT_ADDON_ID, ">> " .. uname .. " <<=>> " .. HealBot_HealValue .. " << ");
if not HealBot_HealsIn[uname] then
HealBot_HealsIn[uname] = 0;
end
HealBot_HealsIn[uname] = HealBot_HealsIn[uname] + HealBot_HealValue;
HealBot_RecalcHeals(HealBot_FindUnitID(uname));
end
end
end
HealBot_SendAddonMessage(HEALBOT_ADDON_ID, ">> " .. UnitName(target) .. " <<=>> " .. HealBot_HealValue .. " << ");
function HealBot_StartCasting(spell, target, ttype)
HealBot_CastFailed = false;
HealBot_CastSpellByName(spell);
if ( SpellCanTargetUnit(target) ) then
SpellTargetUnit(target);
ttype = "fired";
elseif SpellIsTargeting() then
SpellTargetUnit(target);
SpellStopTargeting()
elseif ttype == "direct" then
if ( UnitIsUnit(target, "player") or CheckInteractDistance(target, 4) ) then
ttype = "fired";
end
end
if ttype == "fired" and HealBot_Spells[spell] then
if not HealBot_CastFailed then
HealBot_CastingSpell = spell;
HealBot_CastingTarget = target;
HealBot_Process_HealValue(spell, target);
HealBot_AnnounceCast(spell, target);
end
end
end
function HealBot_StopCasting()
if HealBot_CastingTarget then
if HealBot_HealsIn[UnitName(HealBot_CastingTarget)] then
if HealBot_HealValue > 0 then
HealBot_SendAddonMessage(HEALBOT_ADDON_ID, ">> " .. UnitName(HealBot_CastingTarget) .. " <<=>> " .. 0 - HealBot_HealValue .. " << ");
HealBot_HealValue = 0;
local uname = UnitName(HealBot_CastingTarget)
if uname then
HealBot_SendAddonMessage(HEALBOT_ADDON_ID, ">> " .. uname .. " <<=>> " .. 0 - HealBot_HealValue .. " << ");
if HealBot_HealsIn[uname] then
HealBot_HealsIn[uname] = HealBot_HealsIn[uname] - HealBot_HealValue;
if HealBot_HealsIn[uname] < 0 then
HealBot_HealsIn[uname] = 0;
end
HealBot_RecalcHeals(HealBot_FindUnitID(uname));
end
end
HealBot_HealValue = 0;
end
end
HealBot_CastingSpell = nil;
+1 -1
View File
@@ -1,4 +1,4 @@
HEALBOT_VERSION = "1.4";
HEALBOT_VERSION = "1.4.1";
-------------
-- ENGLISH --
+7
View File
@@ -37,6 +37,13 @@ Default installation path: `C:\Program Files\World of Warcraft\Interface\AddOns\
### Change Log
**v1.4.1**
* **Talent-based Healing Calculations:** Implemented dynamic spell healing calculations for Druid, Priest, and Paladin classes based on talents.
* **Modifier Key Polling:** Replaced MODIFIER_STATE_CHANGED event with polling in HealBot_OnUpdate to track modifier keys reliably.
* **Incoming Heals Fix:** Fixed a bug where incoming heals failed to broadcast or show on the UI due to synchronous GCD fails and `CheckInteractDistance` limitations in the 1.12 API.
* **Hovercast Incoming Heals:** Added full support for processing and displaying incoming heals when using action bar hovercasting.
* **Zero-latency Self-Heals:** Incoming heals for the local player now process instantly with zero latency and no network reliance, ensuring they function even when playing solo.
**v1.4**
* **Extra Frame support for pets and familiars added:** Togglable from healing tab - Extra frames option selected & pets selected from dropdown.
* **Customizable Health Text:** Added a new dropdown in the Healing Options tab that allows users to choose how health text is displayed on unit frames (`Name Only`, `Health Percentage`, `Real Health`, or `Health Deficit`). Includes a smart truncation algorithm to preserve critical health numbers even if the unit name is too long.