Anyone see the problem with this code below? Tried it in debug mode and it stops the rotation but gets no lua error. Just looking for a way to remove curse as a mage.
Code:
function CheckCurse(unitid)
local i = 1
local buff,_,_,count,bufftype,duration = UnitDebuff(unitid, i)
while buff do
if bufftype == "Curse" then return true end
i = i + 1;
buff,_,_,count,bufftype,duration = UnitDebuff(unitid, i)
end
end
PQR_CustomTarget = "player"
local group = "party"
local members = GetNumPartyMembers()
if GetNumRaidMembers() > 0 then
group = "raid"
members = GetNumRaidMembers()
end
for i = 1, members, 1 do
local member = group..tostring(i)
if UnitInRange(member)
and UnitIsCharmed(member) == nil
and UnitIsDeadOrGhost(member) == nil
and PQR_IsOutOfSight(member) == false then
if CheckCursemember) then PQR_CustomTarget = member end
end
end
if CheckCurse(PQR_CustomTarget) and UnitDebuffID(PQR_CustomTarget,30108) == nil then return true end
if CheckMagic(PQR_CustomTarget) and UnitDebuffID(PQR_CustomTarget,34941) == nil then return true end