[Circle] [CODE]:Embalmer/Taxidermist from Merc.

From: Paul Shinn (wombat@WPI.EDU)
Date: 07/29/96


Hello all. Because of the sheer comedic value this spec has, I have
'ported' it from Merc. I will put a copy on ftp2.circlemud.orc soon,
but for those of you who are too lazy to go there (like me...), here
it is. Please direct all flames, comments, bug reports, etc. to me at
wombat@conan.ids.net or wombat@wpi.edu .

--

This is a spec_proc 'ported' from a Merc taxidermist spec_proc. What this
spec_proc does is allow a player (for the price of 1000 coins) to change
those useless corpses into handy bags. Unfortunately, the bags can't sur-
vive renting, because the spec just edits the obj, and the obj retains
it's vnum and rnum of -1. If you have implemented a way to save objs and
their descriptions along with the player, you can edit this to read in a
blank obj and edit the attributes of the obj, or whatever. Below is a list
of changes needed in code. A player will have to type -> 'embalm corpse'
to make the bag. Pretty hilarious in a pkill mud. Unfortunately, I cannot
cite the mud I code in as a place to see this spec in action, because we
don't have a mob we want to assign this to yet. This proc was created for
circle3.0bpl11, but should work with little or no change at all for any
stock version of CircleMud3.0 .

     - Mendar of Alvoria. (telnet://conan.ids.net:4000)

In interpreter.c, you need to add this line to the master list of
commands. In stock circle, it should go right before the entry for
the embrace social.

  { "embalm"   , POS_STANDING, do_not_here , 1, 0 },


In spec_proc.c, you need to add all of the rest of the lines here (the
headers struct and the specproc itself). Also, in spec_assign.c, you need
to add the prototype just like the other specprocs and assign this spec to
the mob of your choice.

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 "
};

SPECIAL(embalmer)
{
  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;

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

  if(CMD_IS("embalm"))
    {
      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)<1000)
            {
              act("$N says to you 'Sorry. You don't have"
                  " enough gold.'",FALSE,ch,0,me,TO_CHAR);
              return TRUE;
            }
          else
            {
              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,"bag skin %s",loc_buf);
                      obj->name=str_dup(loc_buf2);

                      sprintf(loc_buf2,"A bag of %s skin lies"
                                       " here",loc_buf);
                      free(obj->description);
                      obj->description=str_dup(loc_buf2);

                      sprintf(loc_buf2,"a bag made from %s skin",loc_buf);
                      free(obj->short_description);
                      obj->short_description=str_dup(loc_buf2);

                      GET_OBJ_TYPE(obj)=ITEM_CONTAINER;
                      GET_OBJ_WEAR(obj)=ITEM_WEAR_TAKE;
                      GET_OBJ_VAL(obj,0)=100; /* adjust this for capacity */
                      GET_OBJ_WEIGHT(obj)=5;  /* adjust this for weight */
                      GET_OBJ_COST(obj)=1000;
                      GET_OBJ_RENT(obj)=200;  /* 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 new bag.'",
                          FALSE,ch,0,me,TO_CHAR);
                      return 1;
                    }
                }

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

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

    }

  return 0;

}


*--------------------------------*--------------------------------*
| Wombat@Wpi.Edu  '99   <EE>     |   A Marshmellow coating does   |
| http://www.wpi.edu/~wombat     |      not a problem solve.      |
*--------------------------------*--------------------------------*




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