ID:178256
 
I got problems with this, I tried using the walk_towards command but no luck there. I tried using this bit of code:

proc/Wander()
while(src) //While the mob is still here...
if(P in oview(5)) //If there is a PC in the area, as set with the P var above....
step_towards(src,P) //Step towards the PC
for(P in oview(1)) //If the mob is in its view of 1...
break
for(P in oview(2))
break
for(P in oview(3))
break
for(P in oview(4))
break //All these for() procs make it so when the mob is chasing you, and someone else gets closer to the mob then you are, it will stop chasing you and attack the other person. Also it makes it so you can code in that the mob will do stuff at different ranges. Its a great way to prevent types of Kiting (A.K.A. running away from the mob while another attacks it)
else //Else, in other words if the if statement or statements stated above is false...
step_rand(src) //Step randomly once.
sleep(10) //Wait one second
for(P in oview(5)) //But if a PC appears in sight of it...
break
sleep(5) //Dont do anything for 0.5 seconds
spawn(5)
Wander() //Create a loop that continues the proc over and over again untill the mob is deleted.

sorry about the comments I deleated this out my project so I had to take it out of the original. If somebody could help me out on this that would be great!