[Circle] Spec Procs + Spec Commands.

From: Patrick Dughi (dughi@imaxx.net)
Date: 02/14/00


        Sometimes it's the little things that count.  For example, there
are a few instances in which we had spec_procs that had to use the 'pull'
command.  For most of the rest of the mud though, the command is linked to
the 'do_not_here' function, with a rewarding "Huh?" message.

        The little thing though, is that players using the 'command'
function see this annoying command that doesn't do anything.  Same with
alot of newer characters.  Sometimes it even ruins the mystery surrounding
a spec_proc'ed obj/mob/room, since the command you'd otherwise have to
guess at is already there in your list.

        So, you can fix it to make spec_procs acknowledge commands that
are not in the command_interpreter list, like "pull", "play", "fire",
"push", etc..

        Open up interpreter.c, and go to command_interpreter(). Find the
line towards the bottom that contains "special(ch, cmd, line)". Change it
to "special(ch, cmd, line,arg)".  Now search for special() and change it's
definition from int special(struct char_data * ch, int cmd, char *arg) to
int special(struct char_data * ch, int cmd, char *arg,char *command);

        Now, go into structs.h and find the SPECIAL macro definition.
append the char *command as the last argument.

        Last, go into mobact.c, and find the line that reads something
like if ((mob_index[GET_MOB_RNUM(ch)].func) (ch, ch, 0, "")) .. change it
to ((mob_index[GET_MOB_RNUM(ch)].func) (ch, ch, 0, "","")).

        Now, your spec_procs are passed the actual command like "fight",
"pull", etc instead of just the number.  So, my 'pull' command is now in
my spec_procs like this;

  if(is_abbrev(command,"pull")) {
    /* then we have pull */
    send_to_char("You pull the lever.\r\n",ch);
    return 1;
  }

        Exciting, but mostly simple.  The only thing you may want to do is
to convert your existing spec_procs which perform actions on a random/time
based system to check not just for !cmd, but for !cmd && !command - else
each nonsense command in a room could potentially trigger the non-command
spec_proc functionality, like playing cards or the mayor's walking path.
For the most part though, I doubt this will be a serious problem.

                                        PjD


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



This archive was generated by hypermail 2b30 : 04/10/01 PDT