mirror of
https://github.com/Bluewhale1337/HealBotBlue.git
synced 2026-09-11 18:00:20 +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.
|
-- HealBot_UnitClass: Returns English class string for a unit.
|
||||||
function HealBot_UnitClass(unit)
|
function HealBot_UnitClass(unit)
|
||||||
local playerClass, englishClass = UnitClass(unit);
|
local locClass, enClass = UnitClass(unit)
|
||||||
return englishClass;
|
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
|
end
|
||||||
|
|
||||||
---- HealBot_UnitAffected moved to HealBot_Controller_Aura.lua
|
---- HealBot_UnitAffected moved to HealBot_Controller_Aura.lua
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ function HealBot_OnEvent_UnitAura(this, unit)
|
|||||||
local trackedTextures = {}
|
local trackedTextures = {}
|
||||||
|
|
||||||
while true do
|
while true do
|
||||||
local debuff, tmp, debuff_type = UnitDebuff(unit, i)
|
local debuff, tmp, debuff_type = UnitDebuff(unit, i, 1)
|
||||||
if debuff then
|
if debuff then
|
||||||
local mapped_type = nil
|
local mapped_type = nil
|
||||||
if debuff_type then
|
if debuff_type then
|
||||||
@@ -239,6 +239,20 @@ function HealBot_OnEvent_UnitAura(this, unit)
|
|||||||
end
|
end
|
||||||
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
|
local b = 1
|
||||||
while true do
|
while true do
|
||||||
local buff = UnitBuff(unit, b)
|
local buff = UnitBuff(unit, b)
|
||||||
|
|||||||
@@ -298,8 +298,11 @@ function HealBot_CastSpellOnFriend(spell, target)
|
|||||||
local targetEnemy = UnitCanAttack("player", "target");
|
local targetEnemy = UnitCanAttack("player", "target");
|
||||||
local oldTarget = UnitName("target");
|
local oldTarget = UnitName("target");
|
||||||
|
|
||||||
if HealBot_UnitClass("player") == "DRUID" and HealBot_ActiveShapeshiftStance and HealBot_Config.AutoUnshift == 1 then
|
if HealBot_UnitClass("player") == "DRUID" and HealBot_Config.AutoUnshift == 1 then
|
||||||
CastShapeshiftForm(HealBot_ActiveShapeshiftStance);
|
local currentForm = HealBot_GetShapeshiftForm()
|
||||||
|
if currentForm then
|
||||||
|
CastShapeshiftForm(currentForm);
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if oldTarget ~= UnitName(target) then
|
if oldTarget ~= UnitName(target) then
|
||||||
@@ -496,7 +499,7 @@ function HealBot_GetHealSpell(unit, pattern)
|
|||||||
if UnitOnTaxi("player") then return nil end;
|
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_Config.ProtectPvP == 1 and UnitIsPVP(unit) and not UnitIsPVP("player") then return nil end
|
||||||
if HealBot_UnitClass("player") == "DRUID" then
|
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
|
end
|
||||||
|
|
||||||
-- Handle Inline Scripts
|
-- Handle Inline Scripts
|
||||||
@@ -829,11 +832,9 @@ function HealBot_Generic_Patten(matchStr, matchPattern)
|
|||||||
return tmpTest, _HealsMin, _HealsMax;
|
return tmpTest, _HealsMin, _HealsMax;
|
||||||
end
|
end
|
||||||
|
|
||||||
HealBot_ActiveShapeshiftStance = nil;
|
|
||||||
|
|
||||||
-- HealBot_UpdateShapeshiftForm: Internal utility: HealBot_UpdateShapeshiftForm
|
-- HealBot_UpdateShapeshiftForm: Internal utility: HealBot_UpdateShapeshiftForm
|
||||||
function HealBot_UpdateShapeshiftForm()
|
function HealBot_UpdateShapeshiftForm()
|
||||||
HealBot_ActiveShapeshiftStance = HealBot_GetShapeshiftForm();
|
-- Deprecated, state is pulled in real-time on cast
|
||||||
end
|
end
|
||||||
|
|
||||||
-- HealBot_GetShapeshiftForm: Detects active druid form to prevent invalid casts.
|
-- HealBot_GetShapeshiftForm: Detects active druid form to prevent invalid casts.
|
||||||
|
|||||||
+1
-1
@@ -49,7 +49,7 @@ HealBot_ConfigDefaults = {
|
|||||||
ShowDebuffWarning = 0,
|
ShowDebuffWarning = 0,
|
||||||
SoundDebuffWarning = 0,
|
SoundDebuffWarning = 0,
|
||||||
SoundDebuffPlay = 1,
|
SoundDebuffPlay = 1,
|
||||||
CDCMonitor = 1,
|
CDCMonitor = 2,
|
||||||
PanelAnchorX = -1,
|
PanelAnchorX = -1,
|
||||||
PanelAnchorY = -1,
|
PanelAnchorY = -1,
|
||||||
CDCBarColour = {
|
CDCBarColour = {
|
||||||
|
|||||||
Reference in New Issue
Block a user