[CODE][NEWBIE]Prolly last question on obj table..

From: Peter d (death_comes_to_all@hotmail.com)
Date: 08/25/02


Hi!
thanx for previous help..
now i just need to fix one last thing..
i made two more funtkions, one that sets level for types.. like armor's ac..
and weapons dam dice..
the other function adds the two first functions into one..

GET_OBJ_LEVEL(OLC_OBJ(d)) = change_level_for_object(d);
i don't know exactly where to put this to make it set after i edited
values.. like num dam dice, and size dam dice..

this is the second function, shortened it a little..

int change_level_for_types(struct descriptor_data *d)
{
        int min_lev = 0;

   switch (GET_OBJ_TYPE(OLC_OBJ(d)))
        {
      case ITEM_WEAPON:
        if (GET_OBJ_VAL(OLC_OBJ(d), 2) != 0 && GET_OBJ_VAL(OLC_OBJ(d), 3) !=
0)
                min_lev += GET_OBJ_VAL(OLC_OBJ(d), 2) * GET_OBJ_VAL(OLC_OBJ(d),
3);
         break;
      case ITEM_ARMOR:
        if (GET_OBJ_WEAR(OLC_OBJ(d)) = ITEM_WEAR_BODY &&
GET_OBJ_VAL(OLC_OBJ(d), 1) != 0)
                {
            if (GET_OBJ_VAL(OLC_OBJ(d), 1) == 1)
                min_lev += 1;
            else if (GET_OBJ_VAL(OLC_OBJ(d), 1) == 2)
                min_lev += 2;
            else if (GET_OBJ_VAL(OLC_OBJ(d), 1) == 3)

[Snip]....

else if (GET_OBJ_VAL(OLC_OBJ(d), 1) == 8)
                min_lev += 75;
            else
                min_lev += GET_OBJ_VAL(OLC_OBJ(d), 1) * 12;
         }
         break;
      }
      return min_lev;
}

and this is the third function, the combine function..
int change_level_for_object(struct descriptor_data *d)
{
        int min_lev = 0;

   if (change_level_for_stats(d) != 0)
        min_lev += change_level_for_stats(d);

   else if (change_level_for_types(d) != 0)
        min_lev += change_level_for_types(d);

   if (min_lev < 0)
        min_lev = 0;

   else if (min_lev > 106)
        min_lev = 106;

   return min_lev;
}
help.. it works with the applies.. that i posted earlier.. but not with the
new types function... help?





_________________________________________________________________
MSN Hotmail är världens populäraste e-posttjänst. Skaffa dig ett eget konto
du också: http://www.hotmail.com

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT