Page 1 of 1

Looking for Player HP's

Posted: Sat May 01, 2004 5:31 pm
by Quadzer
How can I cycle through all the Players ( No NPC's ) with in a certain radius and check them for low HP's?

Thanks for any and all help.

Posted: Sat May 01, 2004 6:58 pm
by s16z
spawn NearestSpawn[n,search]: The nth nearest spawn matching this search

So do something like

Code: Select all

/declare I int inner
/declare PlayerID inner

/for I 1 to 100 step 1
     | We do this to account for people moving around changing the 
     | nearest spawn before we can do something about it.
     /varset PlayerID ${NearestSpawn[${I},pc radius 100].ID}

     /if (${Spawn[PlayerID].ID} && ${Spawn[PlayerID].PctHPs}<40) {
         | Change the 40 to whatever percent you need
         | Add lines to do whatever you want to do to them here, example:
         /target id ${PlayerID}
         /cast "Complete Heal"
     }

 /next I

Thanks

Posted: Sat May 01, 2004 9:20 pm
by Quadzer
Loaded it up, Seams to work Great. Can't wait to battle test it.

Posted: Sat May 01, 2004 10:20 pm
by Quadzer
Ok I could not get what you had to work just as you had it. And here is what I came up with.

I could not get the radius check to work in the first line.

/declare I int inner
/declare PlayerID int inner

/for I 1 to 72 step 1

/varset PlayerID ${NearestSpawn[${I},pc].ID}
/if (${PlayerID}==0) /return
/if (${Spawn[${PlayerID}].PctHPs}<90 && ${Spawn[${PlayerID}].Distance}<200) {
/target id ${PlayerID}
/cast "Supernal Remedy"
/delay 5s
}
/next I

Posted: Sat May 01, 2004 10:35 pm
by dok
in many situations, most actually, hps aren't sent to the client unless you're grouped or have that person/mob targetted. Many people that have their bot setup to heal people out of group put the /target in before the check and a small delay for hps to update, etc.

Posted: Mon May 10, 2004 9:03 am
by Chill
Hey I just took a look at what you had and added a few things. Looks very nice and smoothe to me btw. Gonna addapt it to my druid I think for when she gets bored at raids =D

1) Used SpellCast.inc to take care of things like fizzles, interrupts, and spells not being ready.
2) Moved the target statement up and added a small delay to allow hps to update
3) Added in an extra check so you can use a bigger heal if appropriate.

Code: Select all

| Simple Heal Macro

#Include SpellCast.inc 

/declare I int inner 
/declare PlayerID int inner 

/for I 1 to 72 step 1 

   /varset PlayerID ${NearestSpawn[${I},pc].ID} 
   /target id ${PlayerID} 
   /delay 2s
   /if (${Spawn[${PlayerID}].PctHPs}<60 && ${Spawn[${PlayerID}].Distance}<200) /call cast "Supernal Light"
   /delay 2 
   /if (${Spawn[${PlayerID}].PctHPs}<90 && ${Spawn[${PlayerID}].Distance}<200) /call cast "Supernal Remedy"
/next I

/return