Originally Posted by
ace99ro
if i take this line out of the cleanse code " if PQR_CustomTargetHP > 85 then " the rotation is broken
Code:
function CheckMagic(unitid)
local i = 1
local buff,_,_,count,bufftype,duration = UnitDebuff(unitid, i)
while buff do
if bufftype == "Magic" or bufftype == "Poison" or bufftype == "Disease" then return true end
i = i + 1;
buff,_,_,count,bufftype,duration = UnitDebuff(unitid, i)
end
end
local group = "party"
local members = GetNumPartyMembers()
if PQR_CustomTargetHP > 85 then
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 CheckMagic(member) then PQR_CustomTarget = member end
end
end
if CheckMagic(PQR_CustomTarget) and UnitDebuffID(PQR_CustomTarget,3010 == nil then return true end
if CheckMagic("player") and not UnitDebuffID("player", 3010 then PQR_CustomTarget = "player" return true end
end
Delete red.U forgot to remove end statement so it become unxpected end.