mirror of
https://github.com/Bluewhale1337/HealBotBlue.git
synced 2026-09-10 09:20:21 +00:00
Fix: Removed current form caching as druid to prevent being locked into current form - now querries form on each spellcast via API. Another attempt to resolve CDC colouring issues.
This commit is contained in:
+16
-2
@@ -190,8 +190,22 @@ end
|
||||
|
||||
-- HealBot_UnitClass: Returns English class string for a unit.
|
||||
function HealBot_UnitClass(unit)
|
||||
local playerClass, englishClass = UnitClass(unit);
|
||||
return englishClass;
|
||||
local locClass, enClass = UnitClass(unit)
|
||||
if enClass then return string.upper(enClass) end
|
||||
|
||||
-- Fallback for Vanilla 1.12 where enClass is nil
|
||||
if locClass == HEALBOT_DRUID then return "DRUID"
|
||||
elseif locClass == HEALBOT_HUNTER then return "HUNTER"
|
||||
elseif locClass == HEALBOT_MAGE then return "MAGE"
|
||||
elseif locClass == HEALBOT_PALADIN then return "PALADIN"
|
||||
elseif locClass == HEALBOT_PRIEST then return "PRIEST"
|
||||
elseif locClass == HEALBOT_ROGUE then return "ROGUE"
|
||||
elseif locClass == HEALBOT_SHAMAN then return "SHAMAN"
|
||||
elseif locClass == HEALBOT_WARLOCK then return "WARLOCK"
|
||||
elseif locClass == HEALBOT_WARRIOR then return "WARRIOR"
|
||||
end
|
||||
|
||||
return locClass
|
||||
end
|
||||
|
||||
---- HealBot_UnitAffected moved to HealBot_Controller_Aura.lua
|
||||
|
||||
@@ -186,7 +186,7 @@ function HealBot_OnEvent_UnitAura(this, unit)
|
||||
local trackedTextures = {}
|
||||
|
||||
while true do
|
||||
local debuff, tmp, debuff_type = UnitDebuff(unit, i)
|
||||
local debuff, tmp, debuff_type = UnitDebuff(unit, i, 1)
|
||||
if debuff then
|
||||
local mapped_type = nil
|
||||
if debuff_type then
|
||||
@@ -238,6 +238,20 @@ function HealBot_OnEvent_UnitAura(this, unit)
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if HealBot_Config.CDCShowAllDebuffs == 1 then
|
||||
local k = 1
|
||||
while true do
|
||||
local debuff = UnitDebuff(unit, k)
|
||||
if not debuff then break end
|
||||
if not trackedTextures[debuff] and iconCount < 10 then
|
||||
iconCount = iconCount + 1
|
||||
HealBot_UnitIcons[unit][iconCount] = debuff
|
||||
trackedTextures[debuff] = true
|
||||
end
|
||||
k = k + 1
|
||||
end
|
||||
end
|
||||
|
||||
local b = 1
|
||||
while true do
|
||||
|
||||
@@ -298,8 +298,11 @@ function HealBot_CastSpellOnFriend(spell, target)
|
||||
local targetEnemy = UnitCanAttack("player", "target");
|
||||
local oldTarget = UnitName("target");
|
||||
|
||||
if HealBot_UnitClass("player") == "DRUID" and HealBot_ActiveShapeshiftStance and HealBot_Config.AutoUnshift == 1 then
|
||||
CastShapeshiftForm(HealBot_ActiveShapeshiftStance);
|
||||
if HealBot_UnitClass("player") == "DRUID" and HealBot_Config.AutoUnshift == 1 then
|
||||
local currentForm = HealBot_GetShapeshiftForm()
|
||||
if currentForm then
|
||||
CastShapeshiftForm(currentForm);
|
||||
end
|
||||
end
|
||||
|
||||
if oldTarget ~= UnitName(target) then
|
||||
@@ -496,7 +499,7 @@ function HealBot_GetHealSpell(unit, pattern)
|
||||
if UnitOnTaxi("player") then return nil end;
|
||||
if HealBot_Config.ProtectPvP == 1 and UnitIsPVP(unit) and not UnitIsPVP("player") then return nil end
|
||||
if HealBot_UnitClass("player") == "DRUID" then
|
||||
if HealBot_ActiveShapeshiftStance and HealBot_Config.AutoUnshift ~= 1 then return nil end;
|
||||
if HealBot_GetShapeshiftForm() and HealBot_Config.AutoUnshift ~= 1 then return nil end;
|
||||
end
|
||||
|
||||
-- Handle Inline Scripts
|
||||
@@ -829,11 +832,9 @@ function HealBot_Generic_Patten(matchStr, matchPattern)
|
||||
return tmpTest, _HealsMin, _HealsMax;
|
||||
end
|
||||
|
||||
HealBot_ActiveShapeshiftStance = nil;
|
||||
|
||||
-- HealBot_UpdateShapeshiftForm: Internal utility: HealBot_UpdateShapeshiftForm
|
||||
function HealBot_UpdateShapeshiftForm()
|
||||
HealBot_ActiveShapeshiftStance = HealBot_GetShapeshiftForm();
|
||||
-- Deprecated, state is pulled in real-time on cast
|
||||
end
|
||||
|
||||
-- HealBot_GetShapeshiftForm: Detects active druid form to prevent invalid casts.
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ HealBot_ConfigDefaults = {
|
||||
ShowDebuffWarning = 0,
|
||||
SoundDebuffWarning = 0,
|
||||
SoundDebuffPlay = 1,
|
||||
CDCMonitor = 1,
|
||||
CDCMonitor = 2,
|
||||
PanelAnchorX = -1,
|
||||
PanelAnchorY = -1,
|
||||
CDCBarColour = {
|
||||
|
||||
Reference in New Issue
Block a user