Re: [NEWBIE] [CODE] Retreat

From: Richard Glover (
Date: 02/10/99

The search_block() function is handy for this.  It's mostly why the
constants in contants.c are set up with a '\n' at the end.

  int door;

  if ((door = search_block(arg, dirs, FALSE)) == -1) {
    send_to_char("That's not a direction.\r\n", ch);

  do_simple_move(ch, door, TRUE);

Where arg is the argument after "retreat".  'door' will now have a value of
the direction that the player should retreat.  You should perform other
checks such as CAN_GO.  Take a look at do_flee for other things.


-----Original Message-----
From: Beau Perrizo <>
To: <>
Date: Tuesday, February 09, 1999 11:31 PM
Subject: Re:  [NEWBIE] [CODE] Retreat

>     I have been trying for some time to code a retreat skill which will
>a player to choose the direction which he/she wishes to go when fleeing
>combat.  My problem is getting the argument working so that if you type
>retreat n it goes north, and retreat s goes south.  I haven't figured out
>quite how to do it and I was wondering if anyone could point me towards
>existing code which might help.  I should add that my C skill is rather low
>the present time.  Any help will be greatly appreciated.

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  |

This archive was generated by hypermail 2b30 : 12/15/00 PST