Re: [NEWBIE] [CODE] Spec_procs.c

From: John Evans (evansj@HI-LINE.NET)
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.
>

I'm in a good mood, and this sound like something neat to code, so here
it is. :) I haven't tested it fully, but it seems fairly straightforward.
Keep in mind that this is all mailer code and may not work at all. :)

As far as coding special procedures.... There really isn't a helpfile or
much documentation on HOW to do it other than the existing code.
Unforunately, RTFC on spec_procs in kinda hard for the first time around
coder.

Maybe I'll spend some time and make a spec_proc.doc for future bpls.
Anyone out there think that that would be handy to have in existance or
just a waste of time. (Please refrain from the snide remarks about it's
only good IF it is read. I realize that some people skip the docs and hit
the list with dumb Q's, but this way we can tell them RTFM or RTFD

Anyways.... Here's the proc. :) Enjoy it and all I ask is that you give
me credit for it somewhere in the MUD. (Like in lib/text/credits) Heck,
you should really give credit to the authors of any and all snippets and
patches that you use just to be nice about it and all.  :)

SPECIAL(mob_tele)
{
  if (IS_NPC(ch) || !CMD_IS("say"))
    return 0;

  skip_spaces(&argument);

  if (!*argument)
    return 0;

  if (str_cmp(argument, "teleport"))
    return 0;

  act("$n points at $N and $E suddenly vanishes!",
      FALSE, me, 0, ch, TO_NOTVICT);
  act("You point at $N and $E suddenly vanishes!",
      FALSE, me, 0, ch, TO_CHAR);
  act("$n points at you!", FALSE, me, 0, ch, TO_VICT);

  char_from_room(ch);
  char_to_room(ch, 3001); /* take them to the stock mortal start room */

  look_at_room(ch, FALSE);
  act("$n suddenly appears in the room.", TRUE, ch, 0, 0, TO_ROOM);

  return 1;
}

John Evans <evansj@hi-line.net>

May the source be with you.


     +------------------------------------------------------------+
     | 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