Re: [code] do_title

From: Patrick J. Dughi (dughi@IMAXX.NET)
Date: 04/08/98


> I wanted to make title allow you to specify a character to put in
> place of your name, so you could put your name anywhere in your title.
> (Hi, I'm $n would say on who "Hi, I'm Bob"

       1. player types "title I am $n"

       2. in do_title or whathave you, you parse the argument you get..
          argument="i am $n".
       3. Cheap easy way to do it off the top of my head, that doesn't use
          anything particularly complex (and therefore is probably
          inefficient..

     char oneword[MAX_STRING_LENGTH];
     buf = '\0';
     while(argument=one_argument(argument, oneword)) {
       if(!strcmp(oneword,"$n")) {
         sprintf(buf2,"%s ",GET_NAME(ch));
         strcat(buf,buf2);
       } else {
         sprintf(buf2,"%s ", oneword);
         strcat(buf,buf2);
       }
     }

     set_title(ch, buf);


                Huzzah. And you're done.


                Mailer code, etc, blahblah.

In Other news:

        Hey - anyone ever change their mud around so it _is_ more d&d
like.. simple example - make scrolls, wands, staves, etc wizard & cleric
only?  How many thieves and fighters are _really_ going to be going around
reciting scrolls of fireball, or healing themselves in the middle of
battle with a wand or scroll. Its bad enough that invisiblity serves
almost no purpose on any mud since players can get potions of detect
invis, and the higher level monsters pay it no heed usually.  Same goes
for recent conversation over scrolls of identification.. shouldn't only
mages be able to use these..etc...

                                        PjD


     +------------------------------------------------------------+
     | 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/15/00 PST