Three Zones

Halatir makes a straightforward walk through the creation of all three types of ZONEs.

Author: Halatir
Category: Building
Commands: @chzone, @create, @dig, @pemit, @set.
Functions: s().
Compatibility: CobraMUSH, PennMUSH, TinyBit, TinyMUSH, TinyMUX.

MUSHCode for Three Zones

Topic: Three Zones
Author: Halatir
Summary: Halatir makes a straightforward walk through the creation of all
three types of ZONEs.

First we create a new player and login with it. This will be the Zone Master
Player (ZMP).

> @set me=ZONE
Flag set.

Now our newly created character is a ZMP.
Let's say Martia and Heather are two players.

> @lock/zone me==*Martia|=*Heather
Locked.

After this lock is set, Martia and Heather control all objects owned by the
ZMP.
Let's take a look at the ZMP:

> ex me
ZMP(#20PenACZ)
Type: Player Flags: ENTER_OK NO_COMMAND ANSI COLOR ZONE
Owner: ZMP Zone: *NOTHING* Stuivers: 150
Zone Lock: =Martia|=Heather
Enter Lock: =ZMP(#20PenACZ)
Basic Lock: =ZMP(#20PenACZ)
Powers:
Channels: Public
Warnings checked: normal
Created: Wed Aug 12 12:37:53 1998
Home: The Beginning
Location: Great Hallway

Notice the ZONE flag and Zone Lock, which make the player a Zone Master.
Now it's time to make a Zone Master Room (ZMR).

> @dig/teleport ZMR
ZMR created with room number 153.
ZMR(#21Rnt)

And we'll lock it to some players.

> @lock/zone #21==*Joe|=*Matt
Locked.

Heather and Martia do not need to be on this lock. They are already on the ZMP
lock, which gives them control over all objects ZMP owns.

> ex here
ZMR(#21Rnt)
Type: Room Flags: NO_COMMAND TRANSPARENT
Owner: ZMP Zone: *NOTHING* Stuivers: 0
Parent: *NOTHING*
Zone Lock: =Joe|=Matt
Powers:
Warnings checked: none
Created: Wed Aug 12 12:42:57 1998
Last Modification: Wed Aug 12 12:42:57 1998
Contents:
ZMP(#20PenACZ)
No exits.

This ZMR is very similar to the Master Room (Usualy #2) of a Mush. If you put
a Thing with $-commands on it in this room, these $-commands can be used in
anywhere inside the zone. Let's create such an object and drop it in the ZMR.

> @create Zone commands
Created: Object #22.

> drop Zone commands
Dropped.

And give the object an $-command.

> &cmd.test #22=$test: @pemit %#=Test successful.
Zone commands/CMD.TEST - Set.

> @set #22=!no_command
Flag reset.

> ex Zone commands
Zone commands(#22)
Type: Thing Flags:
Owner: ZMP Zone: *NOTHING* Stuivers: 1
Parent: *NOTHING*
Powers:
Warnings checked: none
Created: Wed Aug 12 12:44:05 1998
Last Modification: Wed Aug 12 12:45:30 1998
CMD.TEST [#20]: $test: @pemit %#=Test successful.
Home: ZMR(#21Rnt)
Location: ZMR(#21Rnt)

Let's test the $-command.

> @dig/teleport Market Square
Market Square created with room number 23.
Market Square(#23Rnt)

> test
Huh? (Type "help" for help.)

The $-command didn't work. That is because the room is not part of the ZMR
zone.
So let's change that.

> @chzone here=#21
Zone changed.

Now the room is part of the ZMR zone.

> test
Test successful.

And the $-command works.

> ex here
Market Square(#23Rnt)
Type: Room Flags: NO_COMMAND TRANSPARENT
Owner: ZMP Zone: ZMR(#21Rnt) Stuivers: 0
Parent: *NOTHING*
Powers:
Warnings checked: none
Created: Wed Aug 12 12:46:20 1998
Last Modification: Wed Aug 12 12:46:20 1998
Contents:
ZMP(#20PenACZ)
No exits.

Notice 'Zone: ZMR(#21Rnt)' above.
We can add any of ZMP's rooms to the ZMR with the command @chzone.

Now let's expand with a ZMO. We can add Things and Exits to the ZMO. (Also
Rooms, but we already have a ZMR for that type of object.)

> @create ZMO
Created: Object #24.

> @lock/zone #24==*John|=*Mary
Locked.

> ex ZMO
ZMO(#24n)
Type: Thing Flags: NO_COMMAND
Owner: ZMP Zone: *NOTHING* Stuivers: 1
Parent: *NOTHING*
Zone Lock: =John|=Mary
Powers:
Warnings checked: none
Created: Wed Aug 12 12:48:39 1998
Last Modification: Wed Aug 12 12:48:39 1998
Home: Market Square(#23Rnt)
Location: ZMP(#20PenACZ)

Now for some exits.

> @dig Shop=Shop;S,Out;O
Shop created with room number 25.
Opened.
Trying to link...
Linked.
Opened.
Trying to link...
Linked.
Market Square(#23Rnt)
Obvious exits:
Shop leads to Shop.

We add the exits to the ZMO.

> @chzone Shop=#24
Zone changed.

Shop;S(#27E)
Type: Exit Flags:
Owner: ZMP Zone: ZMO(#24n) Stuivers: 0
Parent: *NOTHING*
Powers:
Warnings checked: none
Created: Wed Aug 12 12:50:12 1998
Last Modification: Wed Aug 12 12:50:12 1998
Source: Market Square(#23Rnt)
Destination: Shop(#25Rnt)

> Shop
Shop(#25Rnt)
Obvious exits:
Out leads to Market Square.

> @chzone Out=#24
Zone changed.

> ex Out
Out;O(#27E)
Type: Exit Flags:
Owner: ZMP Zone: ZMO(#24n) Stuivers: 0
Parent: *NOTHING*
Powers:
Warnings checked: none
Created: Wed Aug 12 12:50:12 1998
Last Modification: Wed Aug 12 12:50:12 1998
Source: Shop(#25Rnt)
Destination: Market Square(#23Rnt)

And, of course, we add the new Room to the ZMR.

> @chzone here=#21
Zone changed.

> ex here
Shop(#25Rnt)
Type: Room Flags: NO_COMMAND TRANSPARENT
Owner: ZMP Zone: ZMR(#21Rnt) Stuivers: 0
Parent: *NOTHING*
Powers:
Warnings checked: none
Created: Wed Aug 12 12:50:12 1998
Last Modification: Wed Aug 12 12:50:12 1998
Contents:
ZMP(#20PenACZ)
Exits:
Out;O(#26E)


Summary:

#dbref name zonelock control

#20 ZMP Heather, Martia ZMP, Heather, Martia
#21 ZMR Joe, Matt ZMP, Heather, Martia, Joe, Matt
#24 ZMO John, Mary ZMP, Heather, Martia, John, Mary

- All rooms are chzoned to ZMR.
- All things and exits are chzoned to ZMO.
- Now Joe and Matt can change attributes (descs) and flags of rooms in the ZMR
zone.
- John and Mary can change attributes and flags of exits and things in the ZMO
zone.
- ZMP owns everything, so also controls the objects on any of these zones. And
so do Heather and Martia, because they are on ZMP's zonelock.