Re: [OLC] [Newbie] A command for use on obj amd mobs only in thier OLC zone

From: Phillip A Ames (
Date: 11/28/98

On Sat, 28 Nov 1998 01:20:16 -0500 RHS Linux User
<carnage@GAMES2.MUDSRUS.COM> writes:
>Ok my general idea was to fix the load command so that builders could
>load things within thier OLC zone.  So for say I have zone 8 and I want
>load obj 900, it ain't gonna happen cause 9 is not my zone, but if the
>was number 800 it would load.  Ok so I peared thrue olc.c and found that
>this is how OLC stops one from editing a zone thats not theirs unless
their an >imp.
> if ((GET_LEVEL(ch) < LVL_IMPL) &&
>        (zone_table[OLC_ZNUM(d)].number != GET_OLC_ZONE(ch))) {
>    send_to_char("You do not have permission to edit this zone.\r\n",
>    free(d->olc);
>    return;
>Ok so I know to make this a common check I'll have to pull out the
>free(d->olc) part, but what about defining in the structure which
>if the stuff they want to load comes from their zone?  Anyone have
>any ideas?  LAterz.

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:

if (is_abbrev(buf, "mob")) { // Begin placeholder
  if ((r_num = real_mobile(number)) < 0) {
    send_to_char("There is no monster with that number.\r\n", ch);
// Begin Addition
if(number > max_vnum || number < min_vnum){
    send_to_char("You don't have permission to load this mob.", ch);
// End addition
mob = read_mobile(r_num, REAL);
char_to_room(mob, ch->in_room);
// End placeholder

And then just do something similar to this in the object part.  Hope that


Phillip Ames    | Satisfaction is not guaranteed. | -Ferengi Rule of Acquisition #19
ICQ: 8778335    | AOL IM: Grathol

You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at
or call Juno at (800) 654-JUNO [654-5866]

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

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