way to do that.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3698 c06c8d41-db1a-0410-9941-cceddc491573
V2LAHZJVKBRUAKHRXZZTHOAAHKHUS4CWWZICYEJHTDI6IA7X4LUQC
const int radius = 9;
int monster = -1;
int ystart = you.y_pos - 9, xstart = you.x_pos - 9;
int yend = you.y_pos + 9, xend = you.x_pos + 9;
if ( xstart < 0 ) xstart = 0;
if ( ystart < 0 ) ystart = 0;
if ( xend >= GXM ) xend = GXM;
if ( ystart >= GYM ) yend = GYM;
monster = mgrd[posx][posy];
monsters *mon = &menv[monster];
if (mons_species(mon->type) == MONS_ORC
&& mon->attitude == ATT_FRIENDLY
&& (mon->flags & MF_ATT_CHANGE_ATTEMPT))
monsters *monster = &menv[targ_monst];
if (mons_species(monster->type) == MONS_ORC
&& monster->attitude == ATT_FRIENDLY
&& (monster->flags & MF_ATT_CHANGE_ATTEMPT))