[Circle] [code] Sacrifice

grond@grotl.com
Date: 11/13/96


For those that helped, here's the final version we're using.

------------------------------
ACMD (do_sacrifice)
{
     struct obj_data *obj, *next_obj;

     argument = one_argument(argument, arg);

     if (!*arg) {
          send_to_char("Sacrifice what?\r\n", ch);
          return;
     }
     if (!(obj = get_obj_in_list_vis(ch, arg, world[ch->in_room].contents))) {
          sprintf(buf, "You don't see %s %s here!\r\n", AN(arg), arg);
          send_to_char(buf, ch);
     }

     if (!IS_CORPSE(obj)) {
          sprintf(buf, "Sorry, but %s %s is not a corpse.\r\n", AN(arg), arg);
          send_to_char(buf, ch);
     }

     else {
          for (obj = world[ch->in_room].contents; obj; obj = obj->next_content)
 {
               next_obj = obj->next_content;
               if (IS_CORPSE(obj)) {
                    extract_obj(obj);
                    send_to_char("You have been rewarded for your sacrifice.\r\
n", ch);
                    GET_GOLD(ch) ++;
               }
          }
     }
}

-------------------------

You will need to add the appropriate calls in interpreter.c and in
utils.h you will need to add with the rest of the utility calls

#define IS_CORPSE(obj) ((obj) && (GET_OBJ_TYPE(obj) == ITEM_CONTAINER) \
                       && GET_OBJ_VAL(0, 3) == 1)

Thanks for the help on this silly question.

Grond

SENT FROM: GAME ROOM ON THE LAKE BBS (GROTL.COM)
YOUR PLACE FOR ONLINE ENTERTAINMENT
PHONE: (704) 664-6742


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



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