I just came up with this addon and found out it doesn't seem to work anymore.
I had a look at the lua file and started tweaking some lines to try to make it work, but it didn't.
So, I'm calling you out. Please, help me update this addon!!
P.D. the author has vanished.|||For those of you who don't want to download the addon, here's the lua code.
Code:
local EnslaveFix_Old_UnitCreatureFamily, EnslaveFix_Old_HasPetUI;
function EnslaveFix_OnLoad()
this:RegisterEvent("VARIABLES_LOADED");
-- Fix only warlocks
if (UnitClass("player") == "Warlock") then
EnslaveFix_Old_HasPetUI = HasPetUI;
HasPetUI = EnslaveFix_New_HasPetUI;
EnslaveFix_Old_UnitCreatureFamily = UnitCreatureFamily;
UnitCreatureFamily = EnslaveFix_New_UnitCreatureFamily;
end
end
function EnslaveFix_New_HasPetUI()
-- Fix false being returned for enslaves
if (EnslaveFix_CheckForDebuff("pet", "Enslave Demon")) then
return true;
else
return EnslaveFix_Old_HasPetUI();
end
end
function EnslaveFix_New_UnitCreatureFamily( target )
-- Fix false being returned for enslaves
if (target == "pet" and EnslaveFix_CheckForDebuff("pet", "Enslave Demon")) then
return "Demon";
else
return EnslaveFix_Old_UnitCreatureFamily(target);
end
end
function EnslaveFix_CheckForDebuff( target, debuff_texture )
local i = 1;
local debuff = UnitDebuff(target,i);
while (debuff) do
if (string.find(debuff, debuff_texture )) then
return true;
end
i = i + 1;
debuff = UnitDebuff(target,i);
end
return false;
end
I fist tried changing UnitCreatureFamily for UnitCreatureType, then I changed Debuff with Aura, as I'm not sure if enslave demon is a buff or a debuff. Finally, I changed the name of the (presumably) debuff to the translation in the language of my client. I also changed the word "demon" to fit the language.
It didn't work.
No comments:
Post a Comment