Re: how do i make level restricted rooms.

From: Daniel Koepke (dkoepke@CALIFORNIA.COM)
Date: 04/30/98


On Thu, 30 Apr 1998, Tony Robbins wrote:

->He has a point.  We've seen object minlevels, it might be kinda nifty to
->add a world spec type thing to do something like:

Here, it's simple Mailer Code(tm) and not exactly what you specified,
but it's quick and easy:

To room_data add "int level;"

In db.c:parse_room() find:
  if (!get_line(fl, line) || sscanf(line, " %d %s %d ", t, flags,
      t + 2) != 3) {
and change it to,
  if (!get_line(fl, line) || (i = sscanf(line, " %d %s %d %d ", t,
      flags, t + 2, t + 3)) < 3 || i > 4) {

Just below that you'll see,
  world[room_nr].room_flags = asciiflag_conv(flags);
  world[room_nr].sectory_type = t[2];
add,
  world[room_nr].level = (i == 4 ? t[3] : 0);

In act.movement.c:do_simple_move(), after,
  if (need_specials_check && special(ch, dir + 1, ""))
    return 0;
add,
  if (!IS_NPC(ch) && world[EXIT(ch, dir)->to_room].level >
      GET_LEVEL(ch)) {
    send_to_char("You don't belong in there.\r\n", ch);
    return 0;
  }

In act.wizard.c:find_target_room() find,
  if (GET_LEVEL(ch) < LVL_GRGOD) {
and before it add,
  if (GET_LEVEL(ch) < world[location].level) {
    send_to_char("You aren't godly enough to go there.\r\n", ch);
    return 0;
  }

Finally in do_show() find the reference to GODROOM,
  if (ROOM_FLAGGED(i, ROOM_GODROOM))
and change it to,
  if (ROOM_FLAGGED(i, ROOM_GODROOM) || world[i].level >= LVL_GRGOD)

I think that's all...ROOM_GODROOM will still work as it always did,
but you might consider changing it given this new feature.

-dak : Remember, it's Mailer Code(tm)


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