Re: [OLC] [Newbie] A command for use on obj amd mobsonly inthier OLC zone

From: Francis Hotchkiss (fhotch@buffnet.net)
Date: 11/28/98


> From: Phillip A Ames <kirk47@JUNO.COM>
[SNIP]
> Simple, what you need to do is multiply their olc zone by 100, like this:
>
> int min_vnum = GET_OLC_ZONE(ch) * 100;
> int max_vnum = min_vnum + 99;
>
> So if they had an olc of 8, min_vnum would be 800, and max_vnum would be
> 899.  Then you'd just need a check to see if the vnum of the object/mob
> was > max_vnum or < min_vnum, something like this in this chunk of code:
>

  This will work for *most* zones in circle based muds. Although most zones
are 100 rooms large, it is only a custom, as the code actually allows a
zone to be any size it needs to be. One of the imp's on my mud even has a
maze zone that is around 1027 rooms.
  The absolute best way would be to get the players zone number, then check
the zone table for the top vnum of that zone. Ex:
  int i, first = 0, last = 0;

  first = GET_OLC_ZONE(ch) * 100;
  for (i = 0; i <= top_of_zone_table; i++) {
    if (zone_table[i].number == GET_OLC_ZONE(ch)) {
      last = zone_table[i].top;
      break;
    }
  }

Well good luck with your code. :)

-Astaroth
Head Coder and Co-Owner of GatewayMUD
(gatewaymud.dyn.ml.org port 5000)

PS: I've created some code that some people may find useful. It is an
improved version of the rlist, mlist, and olist commands. This version has
all of those as subcommands of on ACMD(), and it also has the capabilities
to list out DG triggers and AutoQuest quests. It also uses the above
method.
  I would have posted it to the list, but the list has a limit of 200 lines
for
e-mails :(  If you'd like a copy just e-mail me and I'll send it to you. :)


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