Re: [CODE]

From: Adam (tornado@BLAST.NET)
Date: 09/29/97


I was wondering I loved your code, and would like to implement something
similar to that. I was testing it out before I modified it and I got an
error in the sprinttype which the sprinttype is here:

 sprinttype(GET_OBJ_VAL(obj, 2), drinks, buf2);

it appears that the "drinks" is not valid if anybody has any idea what to
replace it with could you please respond. I have honestly never really used
the command sprinttype so I am unsure of its use.

Thanks,

Adam

----------
> From: Ulrik Sannsell <hood@ludd.luth.se>
> To: CIRCLE@post.queensu.ca
> Subject:  [CODE]
> Date: Sunday, September 28, 1997 6:19 AM
>
> Ok i got a small problem with a special procedure i wrote a while back.
> This specials idea is that every time you sip from the holy_grail it
> changes its liquid type to next in list. And when you drink from it and
> its empty it refills itself and here is where my problem is. When i
> refill the grail it changes it's liquid to the original liquid , the one
> set when object is created. Don't think there would be something wrong
> with my code but i posts it as well.
>
>  SPECIAL(holy_grail)
> {
>     struct obj_data *obj;
>     struct char_data *victim = NULL;
>     const int grail_vnum = 21;
>     int type;
>
>     /* Command is neither sip or drink. */
>     if(!(CMD_IS("sip") || CMD_IS("drink")))
>         return 0;
>
>     one_argument(argument, buf);
>     if (!generic_find(buf, FIND_OBJ_INV, ch, &victim, &obj))
>         return 0; /* Object not found */
>     if(GET_OBJ_VNUM(obj) != 21) /* Is not the grail exiting */
>         return 0;
>
>     if(CMD_IS("sip"))
>     {
>         /* Changes the contents of the grail to next type in Liquid list
> */
>         GET_OBJ_VAL(obj, 2) = GET_OBJ_VAL(obj, 2) + 1;
>         /* Make sure we don't go over NUM_LIQ_TYPES */
>         if(GET_OBJ_VAL(obj, 2) >= NUM_LIQ_TYPES)
>             GET_OBJ_VAL(obj, 2) = 0;
>         /* Print out some messages to room and character */
>         sprinttype(GET_OBJ_VAL(obj, 2), drinks, buf2);
>         sprintf(buf, "As you take a sip from $p it's contents suddenly
> changes to %s", buf2);
>         act(buf, FALSE, ch, obj, NULL, TO_CHAR);
>         act("As $n sips from $p it's contents suddenly changes", FALSE,
> ch, obj, NULL, TO_ROOM);
>         return 1;
>     }
>     else
>     {
>         /* If the grail is empty refill it */
>         if(GET_OBJ_VAL(obj, 1) == 0)
>         {
>             /* Refill it to maximum */
>             GET_OBJ_VAL(obj, 1) = GET_OBJ_VAL(obj, 0);
>             act("You see $p refill before youre very eyes. AMAZING!!",
> FALSE, ch, obj, NULL, TO_CHAR);
>             act("As $n drinks the last drop from $p it refills.", FALSE,
> ch, obj, NULL, TO_ROOM);
>             return 1;
>         }
>         else
>             return 0;
>     }
> }
>
>
> Ulrik
>
>
>      +------------------------------------------------------------+
>      | Ensure that you have read the CircleMUD Mailing List FAQ:  |
>      | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
>      +------------------------------------------------------------+


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