This is a Slash'em port of Darshan Shaligram's Pet ranged attack patch for nethack. It allows pet to use their ranged attacks, plus add timeout on some monsters intrinsics and a few new spells for monsters to use.
You'll need to add the three following lines in your include/config.h:
#define MONSTER_TIMERS /* Some monster intrinsics can time out */
#define PET_RANGED_ATTACKS /* Pets can use ranged attacks */
#define NEW_MONSTER_SPELLS/* Monsters get to use more spells */

Actually, I did not see where these options are used in the code, but since they're in the original patch, I kept them.