Originally Posted by
momo1029
is this code wrong ?? it use swiftmend whenever it's off cd even the target is full hp
if UnitBuffID(PQR_CustomTarget, 774) == nil and PQR_CustomTargetHP < 95 then return true
elseif UnitBuffID(PQR_CustomTarget, 774) ~= nil or UnitBuffID(PQR_CustomTarget, 8936) ~= nil and PQR_CustomTargetHP < 85 then CastSpellByID(18562,PQR_CustomTarget)
end
Code:
if UnitBuffID(PQR_CustomTarget, 774) ~= nil and PQR_CustomTargetHP < 95 then return true
elseif (UnitBuffID(PQR_CustomTarget, 774) ~= nil or UnitBuffID(PQR_CustomTarget, 8936) ~= nil) and PQR_CustomTargetHP < 85 then CastSpellByID(18562,PQR_CustomTarget)
end
Try that instead, as bu_ba_911 pointed out I forgot the brackets orz.
Also that first UnitBuffID(PQR_CustomTarget, 774) == nil is wrong, that'll cause it to fire off if the target doesn't have the buff.