Alright, im wondering how to accurately check debuffs then stop my pet if it has a certain debuff.
First off, i know you use UnitDebuff, but where in the code would you put say:
Interface\\Icons\\Spell_Shadow_Possession?
This is what i got so far:
Code:
--Finding the spell
local findFear = "Spell_Shadow_Possession"
function Warlock_OnLoad()
if( DEFAULT_CHAT_FRAME ) then
DEFAULT_CHAT_FRAME:AddMessage("Smart Target");
end
end
function isUnitDebuffUp(sUnitname, sDebuffname)
local iIterator = 1
while (UnitDebuff(sUnitname, iIterator)) do
if (string.find(UnitDebuff(sUnitname, iIterator), sDebuffname)) then
return true
end
iIterator = iIterator + 1
end
return false
end
function isTargetDebuffUp(sDebuffname)
if not sDebuffname then dbg("isTargetDebuffUp:sBuffname empty")return false end;
return isUnitDebuffUp("target", sDebuffname)
end;
function isFeared()
if UnitIsDeadOrGhost("target") then return false end;
if UnitIsFriend("player", "target") then return false end;
return isTargetDebuffUp(findFear)
end;
function petWait()
if(isFeared() == true) then PetWait();
end
end
At first it works, but i have to press my pets atk key and fear at nearly the same time. Then it pretty much doesnt do it =/. Anyone know what may be causing this?