NPC Fall Death and Muzzle Flash Shadows

I was wondering if someone could code NPC’s so that if they fall a certain distance, they’ll die before they hit the ground. And if someone could code it so that muzzle flashes cast shadows like in Left 4 Dead 1 and 2.