[Circle] [CODE] Butcher!

From: Paul Shinn (wombat@WPI.EDU)
Date: 08/27/96


Hehehe... if you can remember, I made an embalmer spec a while back to make
bags from corpses. Now, I modified it to make a spec that can make corpses
into random edible body parts... It will be put up on the ftp site shortly.

*----------------------------*----------------------------*
| Wombat@Wpi.Edu    '99      | Saying "Drooob." makes all |
| http://www.wpi.edu/~wombat |   situations lighter...    |
*----------------------------*----------------------------*

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

Hello. This is another corpse modifying spec_proc from me, mendar. To add
this spec proc to your mud, add a butcher command to interpreter.c defined
as do_not_here, add the proto to spec_assign.c (in assign_mobs()) , as
well as the assignment itself to the mobs, and add the rest of the code
following the dotted line to the end of spec_procs.c . If you need help in
installing this, I can be reached thru the mailing list or within my mud.

  - mendar    telnet://conan.ids.net:4000/

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

#define NUM_BODY_PARTS 5

static char *headers[] =
{
  "the corpse of The ",
  "the corpse of the ",
  "the corpse of an ",
  "the corpse of An ",
  "the corpse of a ",
  "the corpse of A ",
  "the corpse of "
};

char *body_part[]=
{
  "an arm of",
  "a leg of",
  "a foot of",
  "a rib of",
  "a hand of",
  "\n"
};

char *body_word[]=
{
  "arm",
  "leg",
  "foot",
  "rib",
  "hand",
  "\n"
};

SPECIAL(butcher)
{
  struct obj_data *obj;
  char loc_buf[MAX_STRING_LENGTH]="";
  char loc_buf2[MAX_STRING_LENGTH]="";
  int i=0, len=0, total_len=0, done=FALSE, part=0;

  if(!cmd&&!FIGHTING((struct char_data *)me))
    {
      if(number(1,50)<2)
        {
          act("$n says 'Anyone have a corpse for me? I can butcher them "
              "for food!'", FALSE, me, 0, 0, TO_ROOM);
          return 1;
        }
      return 0;
    }

  if(CMD_IS("butcher"))
    {
      argument=one_argument(argument,buf);
      if(strcmp(buf,"corpse")==0)
        {
          obj=get_obj_in_list_vis(ch,"corpse",ch->carrying);
          if(!obj)
            {
              act("$N says to you 'Sorry. You don't seem to have"
                  " any corpses.'",FALSE,ch,0,me,TO_CHAR);
              return TRUE;
            }

          if(GET_GOLD(ch)<500)
            {
              act("$N says to you 'Sorry. You don't have"
                  " enough gold.'",FALSE,ch,0,me,TO_CHAR);
              return TRUE;
            }
          else
            {
              part=number(1,NUM_BODY_PARTS)-1;
              for (i = 0; (i < 7) || (!done); i++)
                {
                  len=strlen(headers[i]);
                  if(memcmp(obj->short_description,headers[i],len)==0)
                    {

                      total_len=strlen(obj->short_description);

                      strncpy(loc_buf,obj->short_description+len,
                              total_len-len);

                      free(obj->name);
                      sprintf(loc_buf2,"%s %s",body_word[part],loc_buf);
                      obj->name=str_dup(loc_buf2);

                      sprintf(loc_buf2,"%s %s lies here.",
                              body_part[part],loc_buf);
                      free(obj->description);
                      obj->description=str_dup(loc_buf2);

                      sprintf(loc_buf2,"%s %s",body_part[part],loc_buf);
                      free(obj->short_description);
                      obj->short_description=str_dup(loc_buf2);

                      GET_OBJ_TYPE(obj)=ITEM_FOOD;
                      GET_OBJ_WEAR(obj)=ITEM_WEAR_TAKE;
                      GET_OBJ_VAL(obj,0)=5; /* adjust this for fill */
                      GET_OBJ_VAL(obj,1)=0;
                      GET_OBJ_VAL(obj,2)=0; 
                      GET_OBJ_VAL(obj,3)=0; /* adjust this for poison */
                      GET_OBJ_WEIGHT(obj)=5;  /* adjust this for weight */
                      GET_OBJ_COST(obj)=500;
                      GET_OBJ_RENT(obj)=100;  /* shouldn't be rentable..
                                                 unless you make a change
                                                 to your mud to do so,
                                                 because corpses have a
                                                 vnum&rnum of -1 */
                      GET_OBJ_TIMER(obj)=-1;

                      GET_GOLD(ch)-=1000;
                      done=TRUE;

                      act("$N says to you 'Done! Enjoy your meal!'",
                          FALSE,ch,0,me,TO_CHAR);
                      return 1;
                    }
                }

              act("$N says to you 'Sorry, I can't make cuts with"
                  "this.'",FALSE,ch,0,me,TO_CHAR);
              return 1;
            }
        }

      return 0; /* if it wasn't corpse... it wasn't meant for me... */

    }

  return 0;

}

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