proc/Wander(var/mob/Player/M)
while(src)
if(M in oview(5)) //if a Player comes in 5 steps pf him
step_towards(src,M) //Chase him!
for(M in oview(1)) //here you can define some stuff
break //if you want your NPC to shoot make it so
for(M in oview(2)) //these are saying if the Player is within 1,2,3,4 blocks do nothing
break
for(M in oview(3))
break
else
step_rand(src) //if no NPC is 5 blocks or less away walk around
sleep(10) //stop for 1 second
for(M in oview(4)) //.......
break
sleep(5)
spawn(5)
Wander()//Wonder again...
Bump(mob/Player/M)
if(M.player == 1) //If the NPC bumps you
if(!istype(src,M))
MFight(M)//Fight You!
else
return
Bump(mob/Player/Allies/M)
if(M.player == 1) //If the NPC bumps you
if(!istype(src,M))
MFight(M)//Fight You!
else
return
else
return
Having a problem trying to find a way to change the src to look for usr and other mob types without the proc trying to include turfs and objs
runtime error: undefined variable /turf/tree/var/player
proc name: Bump (/mob/Enemies/Bump)
source file: Monsters.dm,197
usr: Dark Warrior (/mob/Enemies/Dark_Warrior)
src: Dark Warrior (/mob/Enemies/Dark_Warrior)
call stack:
Dark Warrior (/mob/Enemies/Dark_Warrior): Bump(the tree (4,4,16) (/turf/tree))