Sub Main
/declare HighHPID int outer 0
/declare highhppct int outer 99
/echo Version 1.5
/while (1) {
/if (${Me.XTarget}==0) /end
/if (!${Target.ID}) /target id ${Me.XTarget[1].ID}
/call HighHP
/if (!${Me.Combat} || ${Target.ID} == ${HighHPID}) {
/attack on
/pet attack
/pet swarm
}
/delay 1
}
/end
Sub HighHP
/declare x int local 0
/declare LowHP int local ${Target.PctHPs}
/declare LowHPID int local ${Target.ID}
/declare HighHP int local 0
/for x 1 to ${Me.XTarget}
/if (${Me.XTarget[${x}].PctHPs}<${LowHP}) {
/varset LowHP ${Me.XTarget[${x}].PctHPs}
/varset LowHPID ${Target.ID}
}
/if (${Me.XTarget[${x}].PctHPs}>${HighHP}) {
/varset HighHP ${Me.XTarget[${x}].PctHPs}
/varset HighHPID ${Me.XTarget[${x}].ID}
}
/next x
/declare HPDiff int local 0
/varcalc HPDiff ${HighHP}-${LowHP}
/if (${HPDiff}>=2 && ${Target.ID}!=${HighHPID}) {
/target id ${HighHPID}
/delay 2s ${Target.ID}==${HighHPID}
}
/retur