FANDOM


Zone FilesEdit

Zone files are the files that control how areas are configured and how they reset. They integrate the mobiles, objects, and rooms to create an inhabited world.

A zone file contains certain initial information (specified below), followed by a series of reset commands. Each time a zone is reset, the server executes all the commands in order from beginning to end. All zones are reset when the server first boots, and periodically reset again while the game is running.

The Format of a Zone FileEdit

 #<virtual number>

<zone name>~

<top room number> <lifespan> <reset mode>

{zero or more zone commands}

S

Lines starting with * are considered comments and ignored. Zone commands themselves may also be followed by a comment delimited by a single *. The zone's commands must then be terminated by the literal letter S.


Virtual NumberEdit

An arbitrary number used to identify the zone. Zone numbers are traditionally the room numbers of the zone divided by 100; for example, Midgaard, which consists of rooms 3000 through 3099, is zone 30.


Zone NameEdit

A label given to the zone so that it can be identified in system logs.


Top Room NumberEdit

The highest numbered room belonging to this zone. A room with virtual number V belongs to zone N if TopRoom(zone N-1) < V <= TopRoom(zone N) for all N > 0. Rooms belong to zone 0 if their number is between 0 and the top of zone 0.


LifespanEdit

The number of real-time minutes between zone resets for this zone. When the age of the zone (measured in minutes since the last time that zone has been reset) reaches the zone's lifespan, the zone is queued for reset. The zone is then reset when it reaches the front of the queue, and the conditions of the Reset Mode (see below) are satisfied.


Reset ModeEdit

Can take one of three values (0, 1, or 2):

0Edit

Never reset the zone. In this case, the age of the zone is never updated, and it will never be queued for reset. Thus, the value of the Lifespan is effectively ignored.

1Edit

Reset the zone only after it reaches its Lifespan and after the zone becomes deserted, i.e. as soon as there are no players located within the zone (checked once every minute). This can make a zone more ``fair because it will keep the hard mobs from reappearing in the zone until everyone leaves, but on a busy MUD it can prevent a zone from ever being reset since the zone may never stay empty for more than one minute.

2Edit

Reset the zone as soon as it reaches its Lifespan, regardless of who or what is in it. This is the most commonly used Reset Mode.

Zone CommandsEdit

Each command consists of a letter or "flag", identifying the command-type, followed by three or four numeric arguments.


Function Flag
Load a monster and place it into a room. M
Percentile load a monster and place it into a room. W
Load an object and place it into a room. O
Percentile load an object and place it into a room. X
Load an object and give it to the last monster loaded. G
Percentile load an object and give it to the last monster loaded. Y
Load an object into the equipment list of a monster. E
Percentile load an object and place it into the equipment list of a monster. Z
Load one object into another object. P
Percentile load an object and place it into another object. Q
Load a door. D


The first argument, common to all the commands, is called the ``if-flag". If the if-flag for a command is 1, that command is only executed if the command immediately before it was executed as well. If the if-flag is 0, the command is always executed. If-flags are useful for things like equipping mobiles--you don't want to try to equip a mobile that has not been loaded.  



Commands that load mobiles and objects also include a ``max existing argument. This specifies the maximum number of copies of the mobile or object that are allowed to exist in the entire world at once. If the number currently existing is greater than or equal to the ``max existing limit, the command is not executed. unctionFlagLoad a monster and place it into a room.MPercentile load a monster and place it into a room.WLoad an object and place it into a room.OPercentile load an object and place it into a room.XLoad an object and give it to the last monster loaded.GPercentile load an object and give it to the last monster loaded.YLoad an object into the equipment list of a monster.EPercentile load an object and place it into the equipment list of amonster.ZLoad one object into another object.PPercentile load an object and place it into another object.QLoad a door. D

For example, from the Trog Caves and Outpost .zon file, the following snippet:

W 0 4452 1 4408 90 Protector

Z 1 4494 5 17 80      Sword of the Protector  (80% load rate)

Z 5 4436 1 17 25      Sword of the Protector (25% x 80% load rate) 

The first line  loads the Protector (mob 4452) into room 4408 with a 90% probability.  The next line attempts to load a mag flag version (green glow) of the Protector's Sword, but only if the previous load command was successful, there are less than five of these swords in the game, and a random number is of a value 80 or less.  The next line fires if the previous mob load was successful, there are less than one sword in the game, and a random number is of a value 25 or less.

The valid zone-reset commands are M, O, G, E, P, D, and R.




M: Load a MobileEdit

Format: M <if-flag> <mob vnum> <max existing> <room vnum>

Mob vnum is the vnum of the mob to be loaded. Room vnum is the vnum of the room in which the mob should be placed. The mob will be loaded into the room.

O: Load an ObjectEdit

Format: O <if-flag> <obj vnum> <max existing> <room vnum>

Obj vnum is the vnum of the obj to be loaded. Room vnum is the vnum of the room in which the obj should be placed. The object will be loaded and left lying on the ground.


G: Give Object to MobileEdit

Format: G <if-flag> <obj vnum> <max existing>
Obj vnum is the vnum of the obj to be given. The object will be loaded and placed in the inventory of the last mobile loaded with an `M command.
This command will usually be used with an if-flag of 1, since attempting to give an object to a non-existing mobile will result in an error.

E: Equip Mobile With ObjectEdit

Format: E <if-flag> <obj vnum> <max existing> <equipment position>

Obj vnum is the vnum of the obj to be equipped. The object will be loaded and added to the equipment list of the last mobile loaded with an M command. Equipment Position should be one of the following:

          0    Used as light

          1    Worn on right finger

          2    Worn on left finger

          3    First object worn around neck

          4    Second object worn around neck

          5    Worn on body

          6    Worn on head

          7    Worn on legs

          8    Worn on feet

          9    Worn on hands

          10   Worn on arms

          11   Worn as shield

          12   Worn about body

          13   Worn around waist

          14   Worn around right wrist

          15   Worn around left wrist

          16   Wielded as a weapon

          17   Held

This command will usually be used with an if-flag of 1, since attempting to give an object to a non-existing mobile will result in an error.

W: Load MobileEdit

Format: W <if-flag> <obj vnum> <max existing> <equipment position> <chance in 100>


Y: Equip Mobile With Object (Percentage)Edit

Format: Y <if-flag> <obj vnum> <max existing> <equipment position> <chance in 100>
A Y object is a DEMI+ object.
Obj vnum is the vnum of the obj to be equipped. If a random number is rolled the satisfies the load rate (n/100) specified in the zone load command, the object will be loaded and added to the equipment list of the last mobile loaded with an M command.
Equipment Position should be one of the following: (see table above).

Z: Add Object to Mobile Inventory (Percentage) Edit

Format: Z <if-flag> <obj vnum> <max existing> <chance in 100>
Obj vnum is the vnum of the obj to be placed in a mob's inventory if the load percentage is satisfied.
If a random number is rolled the satisfies the load rate (n/100) specified in the zone load command, the object will be added to the inventory of the last mobile loaded to the zone with an M command.

P: Put Object in ObjectEdit

Format: P <if-flag> <obj vnum 1> <max existing> <obj vnum 2>
An object with Obj Vnum 1 will be loaded, and placed inside of the copy of Obj Vnum 2 most recently loaded.
This command will usually be used with an if-flag of 1, since attempting to put an object inside of a non-existing object will result in an error.

Q: Put Object in Object Edit

Format: Q <if-flag> <obj vnum 1> <max existing> <obj vnum 2> <load rate>
An object with Obj Vnum 1 will be loaded, and placed inside of the copy of Obj Vnum 2 most recently loaded upon the additional satisfaction of the random percentage chance indicated.
This command will usually be used with an if-flag of 1, since attempting to put an object inside of a non-existing object will result in an error.

D: Set the State of a DoorEdit

Format: D <if-flag> <room vnum> <exit num> <state>
Room vnum is the virtual number of the room with the door to be set. Exit num being one of:
          0    North

          1    East

          2    South

          3    West

          4    Up

          5    Down
State being one of:
          0    Open

          1    Closed

          2    Closed and locked
Care should be taken to set both sides of a door correctly. Closing the north exit of one room does not automatically close the south exit of the room on the other side of the door.

R: Remove Object from RoomEdit

Format: R <if-flag> <room vnum> <obj vnum>
If an object with vnum Obj Vnum exists in the room with vnum Room Vnum, it will be removed from the room and purged.