Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local group = "party"
- local target1 = group.tostring(1)
- local target2 = group.tostring(2)
- local target3 = group.tostring(3)
- local target4 = group.tostring(4)
- local target5 = group.tostring(5)
- local lowest = "NUL"
- local target1hp = 100 * ( UnitHealth(target1) + incomingheal ) / UnitHealthMax(target1)
- local target2hp = 100 * ( UnitHealth(target2) + incomingheal ) / UnitHealthMax(target2)
- local target3hp = 100 * ( UnitHealth(target3) + incomingheal ) / UnitHealthMax(target3)
- local target4hp = 100 * ( UnitHealth(target4) + incomingheal ) / UnitHealthMax(target4)
- local target5hp = 100 * ( UnitHealth(target5) + incomingheal ) / UnitHealthMax(target5)
- local lowesthp = 100
- -- Check --
- if
- UnitExists(target1)
- and
- UnitInRange(target1)
- and
- UnitIsCharmed(target1) == nil
- and
- UnitIsDeadOrGhost(target1) == nil
- and
- PQR_IsOutOfSight(target1) == false
- then
- if
- target1hp < 80
- and
- target1hp < lowesthp
- then
- lowest = target1
- lowesthp = target1hp
- end
- end
- -- Check 2 --
- if
- UnitExists(target2)
- and
- UnitInRange(target2)
- and
- UnitIsCharmed(target2) == nil
- and
- UnitIsDeadOrGhost(target2) == nil
- and
- PQR_IsOutOfSight(target2) == false
- then
- if
- target2hp < 80
- and
- target2hp < lowesthp
- then
- lowest = target2
- lowesthp = target2hp
- end
- end
- -- Check 3 --
- if
- UnitExists(target3)
- and
- UnitInRange(target3)
- and
- UnitIsCharmed(target3) == nil
- and
- UnitIsDeadOrGhost(target3) == nil
- and
- PQR_IsOutOfSight(target3) == false
- then
- if
- target3hp < 80
- and
- target3hp < lowesthp
- then
- lowest = target3
- lowesthp = target3hp
- end
- end
- -- Check 4 --
- if
- UnitExists(target4)
- and
- UnitInRange(target4)
- and
- UnitIsCharmed(target4) == nil
- and
- UnitIsDeadOrGhost(target4) == nil
- and
- PQR_IsOutOfSight(target4) == false
- then
- if
- target4hp < 80
- and
- target4hp < lowesthp
- then
- lowest = target4
- lowesthp = target1hp
- end
- end
- -- Check 5 --
- if
- UnitExists(target5)
- and
- UnitInRange(target5)
- and
- UnitIsCharmed(target5) == nil
- and
- UnitIsDeadOrGhost(target5) == nil
- and
- PQR_IsOutOfSight(target5) == false
- then
- if
- target5hp < 80
- and
- target5hp < lowesthp
- then
- lowest = target5
- lowesthp = target5hp
- end
- end
- if
- lowesthp > 80
- then
- lowest = "NUL"
- end
- PQR_CustomTarget = lowest
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement