Re: [NEWBIE] [CODE] Spec_procs.c

From: Daniel Koepke (dkoepke@CALIFORNIA.COM)
Date: 11/07/97


On Fri, 7 Nov 1997, Ben Britton wrote:

->Could someone give me a hint on how to code a special program so that if
->a character says something the mob will transport them to a corresponding
->location?  I've check all the documents, and the ftp sites for hints but
->came up with nothing.

Well, you can't expect specifics to show up, but there should be
enough info in tidbits to kindof piece together the special procedure
(not program).  I would think it'd go something like:

  SPECIAL(spec_teleport)
  {
    struct char_data *mob = (struct char_data *) me;
    int room_teleport = ####; /* change to equal vnum of room */

    if (IS_NPC(ch) || !CMD_IS("say"))
      return FALSE;

    skip_spaces(&argument);
    if (!*arguments)
      return FALSE;

    /* if you want what is said to show up, uncomment the next line */
    /* do_say(ch, argument, 0, 0); */

    if (!str_cmp(argument, "teleport me")) {
      act("$n rather suddenly disappears.", TRUE, ch, 0, 0, TO_ROOM);
      char_from_room(ch);
      char_to_room(ch, real_room(room_teleport));
      act("$n suddenly appears.", TRUE, ch, 0, 0, TO_ROOM);
      send_to_char("You find yourself in a new location...\r\n", ch);
    } else
      return FALSE;

    return TRUE;
  }

Standard mail code warranty and terms of use apply (e.g., it may work,
I don't necessarily care whether it does or doesn't, use it if you
want to, and give me credit for it if you want to, but you are by no
means required to).


daniel koepke / dkoepke@california.com


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



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