Re: Oasis oedit Level Tags on Equipment

From: Daniel Koepke (dkoepke@CALIFORNIA.COM)
Date: 05/12/98


On Tue, 12 May 1998, Quinn ShadowStalker wrote:

->I was wondering how I would implement level tags (level restricitions) on
->equipment.

<grumble> Let's see, this would qualify as the millionth time someone
has went through this _very_ basic thing on the list.

Add a variable to obj_flag_data and obj_file_elem called "int level;"
This will be used for the minimum level of the object.  Add a
GET_OBJ_LEVEL macro to utils.h,

  #define GET_OBJ_LEVEL(obj) ((obj)->obj_flags.level)

In db.c go to parse_object() and find the line,

  (retval = sscanf(line, " %d %s %s", t, f1, f2)) != 3) {

and add,

  (retval = sscanf(line, " %d %s %s %d", t, f1, f2, t+1)) < 3) {

and then after the "obj_proto[i].obj_flags.wear_flags =
asciiflag_conv(f2);" add,

  obj_proto[i].obj_flags.level = (retvall > 3 ? t[1] : 0);

Then add the GET_LEVEL checks to wherever you want to restrict using
the object.  Say, you want them to not be able to equip the object.
Go to equip_char() and then where you see "invalid_class(ch, obj)"
add, "|| GET_LEVEL(ch) < GET_OBJ_LEVEL(obj)".

I'll spare everyone the talk about why I don't like level restrictions
like this on objects -- especially on non-weapons.

-dak


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



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