This may be a little late, but this might help.
;Artificial Intelligence Script
;Triggers
desc = AI Penumbra Style
;Triggers
:waypointstate=0:animate=2,waypointstart
:waypointstate=3:animate=2,waypointnext
:waypointstate=4:animate=2,waypointrandom
:waypointstate=5:animate=2,waypointreverse
;start follow waypoints
:state=0:waypointstart,state=1
;if npc see you (short distance)
;delete the ';' so your npc see you earlier when no walls are in the field of view
;:state=1,plrcanbeseen:settarget,rotatetotarget,state=2
;notice player if he is 3 segements away
:state=1,plrdistwithin=300:settarget,rotatetotarget,state=2
;notice player if shoot on npc
:state=1,shotdamage=10:settarget,animate=1,rotatetotarget,state=2
:state=2:waypointstop,movetotarget,state=3
:state=3,plrdistfurther=90:rotatetoplr,movefore=2,animate=2
:state=3,plrdistfurther=500:animate=1,state=0
:state=3,plrdistwithin=90,rateoffire:rotatetoplr,setframe=8,state=4
:state=4,framebeyond=8 60,plrdistwithin=100:plraddhealth=-10,sound=audiobank\misc\sound.wav,state=5
:state=4:incframe=8,rotatetoplr
:state=4,frameatend=8:state=1
:state=5:incframe=8
:state=5,frameatend=8:state=1
;End of Script
There are some small problems with it and I'm currently trying to fix them but I can't.
This script should do what you're looking for.