#turbo 40
Sub Main
/declare HotSpellDuration string outer 21s
/declare HotSpellTimer1 timer outer
/declare MobID[150] int outer
/declare j int outer
/declare myMob int outer
/declare MinimumHealth int outer 50
/declare NumMobs int outer 1
/declare MobAdded int outer 0
/declare MobRadius int outer 50
/declare PcId1 int outer 0
/echo PL mac starting up. Setting PC ID's
/varset PcId1 ${Spawn[pc "Insert_Your_Toon_Here"].ID}
:loop
/delay 1s
/call CheckHealth
/if (${NearestSpawn[1,NPC zradius 20].Distance}>${MobRadius}) /goto :loop
/for myMob 1 to ${SpawnCount[NPC radius ${MobRadius} zradius 20]}
/target id ${NearestSpawn[${myMob},NPC zradius 20 radius ${MobRadius}].ID}
/delay 1s ${Target.ID}==${NearestSpawn[${myMob},NPC zradius 20 radius ${MobRadius}].ID}
/if (${Target.PctHPs}<${MinimumHealth} ) {
/cast 1
}
}
/call CheckHealth
/next myMob
/doevents
/goto :loop
/return
Sub CheckHealth
/target targetable id ${PcId1}
/delay 1s ${Target.ID}==${PcId1}
/call HealTarget
/return
Sub HealTarget
/if (${Target.PctHPs} > 95) /return
/if (${Target.PctHPs} <40) {
/echo Casting patch heal on ${Target.ID}
/cast 2
/return
}
/if (${Target.PctHPs} < 70) {
/echo Casting big heal on ${Target.ID}
/cast 3
/return
}
/if (${Target.PctHPs} <95) {
/if (${Target.ID}==${PcId1} && !${HotSpellTimer1} ) {
/echo Casting HoT on ${PcId1}
/cast 4
/varset HotSpellTimer1 21s
}
/return
}
/return