Re: Entering game wearing eq

From: Burkhard Knopf (Knopf@tlaloc.in.tu-clausthal.de)
Date: 07/13/95


Hi Fishbone

I'd suggest trying it my way ;-)

Change struct obj_file_elem to
{
   obj_num item_number;
   sh_int locate;  /* that's the <NUM_WEARS>-<wear-location> or -<bag-depth>
		      in obj file (if it's in a container) BK */
   int	value[4];
   int	extra_flags;
   int	weight;
   int	timer;
   long	bitvector;
   struct obj_affected_type affected[MAX_OBJ_AFFECT];
}
If you're running the mud on a system where int is different from sh_int
you should be able to use the old plrobjs files.


The idea is: all items in plain inventory get locate=0, all equipped items
have positive locate, all items in containers negative ones
 - if the container is in plain inventory or worn the content gets locate=-1,
   if it's already in a container then locate=-2 etc.

Looking at the store routine you'll find that items inside containers are
stored before the container;
  you should change the order of the Crash_save calls in the Crash_save
  function though to prevent it from messing up contents of containers
  inside containers to:
      Crash_save(obj->next_content, fp, locate);
      Crash_save(obj->contains, fp, MIN(0,locate)-1);

When a player enters the game all you got to do is:
 - items with positive locate are to be equipped
 - items with zero locate go to plain inventory
 - items with negative locate go to a content list first

Any of the previously filled content lists gets emptied as soon as
the locate of a loaded item is higher
 - if the new item is a container and its locate is exactly 1 higher
   than that of the content list the whole content list goes into this
   container (if the container is to be worn its locate is assumed 0 here)
 - if there are still content lists with lesser locate their containers
   are missing so those items go to plain inventory


If there's enough interest I might find the time and put it into the
submission directory of circle. (Just got to throw the things out of
objsave.c that don't belong to either circle3.0pl8 or the auto equip)

Burkhard

-- 
Burkhard Knopf                       and when they say 'take of his body'
   e-mail:                           I think I'll take from mine instead
knopf@tlaloc.in.tu-clausthal.de                     "Icicle" - Tori Amos



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