multi-state-machine

each AI has a variable or skill to recognize what to to

IDLE wait, walk around, what ever
ATTACK run to player, attack him, shoot at him, ...
RUNAWAY run away from player...
DIE no explanation

try something like this, it will work good and you will have very "goodlooking" results


Visit my site: www.masterq32.de