Re: [CODE] Starting Eq

From: Lord Kyu (Sythrel@Adelphia.net)
Date: 12/24/00


James Cress wrote:
>
> I would like to adjust the starting eq for players.  Currently, new players
> are buck naked and defensless.  I've been able to set, adjust, and generally
> play with the code at will but I have not been able to track down the info I
> need to do this.  I am running 3.0 bpl17 on a Win98 machine.  It should be
> obvious but...
> _________________________________________________________________________

   This is one of Daniel's code I believe, which I might have changed a
little.  I'll go snippet form here, though I'm sure you can find the
actual thing in the archives.

// Before the init_char function add:

/* start new characters off equipped with objects for their class */
void new_eq(struct char_data *ch)
{
  int b_mage = (1 << CLASS_MAGIC_USER);
  int b_cleric = (1 << CLASS_CLERIC);
  int b_thief = (1 << CLASS_THIEF);
  int b_warrior = (1 << CLASS_WARRIOR);
  int b_class = (1 << GET_CLASS(ch));
  int inv = -1, cont = -2;

  int bag_vnum = 19;
  struct obj_data * bag;

  /* THIS IS JUST AN EXAMPLE LIST */
  int eq_list[][4] = {
  /* class(es)         ,   vnum, amt, to */
  { 0                  ,     20,   1, inv },           /*   water skin
*/
  { b_warrior          ,     22,   1, WEAR_WIELD },    /*     sword
*/
  { b_cleric           ,     23,   1, WEAR_WIELD },    /*      mace
*/
  { b_thief            ,     24,   1, WEAR_WIELD },    /*     dagger
*/
  { b_mage             ,     25,   1, WEAR_WIELD },    /*     staff
*/
  { b_warrior          ,     26,   1, WEAR_BODY },     /*   chain mail
*/
  { b_cleric | b_thief ,     27,   1, WEAR_BODY },     /* leather jerkin
*/
  { b_mage             ,     28,   1, WEAR_ABOUT },    /*      robes
*/
  { b_cleric | b_thief ,     30,   1, WEAR_ABOUT },    /*  travel cloak
*/
  { 0                  ,     10,   4, cont },          /* bread (in bag)
*/
  { -1, -1, -1, -1 } /* ALWAYS LAST */

  };

  int i, j;

  bag = read_object(bag_vnum, VIRTUAL);
  obj_to_char(bag, ch);

  for (i = 0; eq_list[i][1] >= 0; i++)
    if (!eq_list[i][0] || IS_SET(eq_list[i][0], b_class)) {
      for (j = 0; j < eq_list[i][2]; j++) {
        struct obj_data * tmp = read_object(eq_list[i][1], VIRTUAL);
        if (!tmp) break;
        if (eq_list[i][3] == cont && bag)
          obj_to_obj(tmp, bag);
        else if (eq_list[i][3] >= 0 && !GET_EQ(ch, eq_list[i][3]))
          equip_char(ch, tmp, eq_list[i][3]);
        else
          obj_to_char(tmp, ch);
    }
  }
}

// And in class.c at the bottom of do_start under the siteok everyone
thing add:

new_eq(ch);

--

   Hope this helps you out.  Again, this isn't my code, and if I
mutilated, or something is wrong with this code, feel free to correct me
in it.

--

 Lord Kyu 

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/11/01 PDT