Object Zone Commands

(See also Zone Section in this guide)

There are several commands used with objects:

E equip a mob with an object O < if-flag> <obj vnum > <%repop> <room vnum>
P put an object inside another (already loaded) object P < if-flag> <obj vnum > <%repop> <container vnum>
L Load a portal L < if-flag><load room vnum ><portal obj vnum> <destination room vnum>
A Activate a portal A< if-flag><load room vnum > <door state> <key vnum>

 

If flags

There are two possible values here, 0 and 1.

0 Do this command whether or not any previous commands have successfully completed
1 This command will only be performed if a previous command completed successfully.  Which command the mud looks at depends on the type of command being attempted.
Give and Equip are only performed if the preceding Mobload command was successful. 
Example: 

M 0 6710 1 6714  Load 1 copy of Henrietta                     
E 1 6709 1 5     Henrietta's favorite     dress    
E 1 6745 50 8    black velvet slippers    
G 1 6647 100     Recall scroll to sell             
G 1 6695 100     Potion to sell             
G 1 6739 100     Potion to sell             
G 1 6740 100
            Potion to sell     

If Henrietta was successfully loaded (which will happen only if there isn't already a Henrietta around somewhere), then there is a 1% chance she will be equipped with her dress, a 50% chance she will get to wear her slippers, and a 100% chance she will be given the things that she sells.  If she is not loaded, none of those other items will be loaded.
Put depends on the previous O bjectLoad command.  If if didn't load the container, then the Put command will not be executed.  If the container is marked with the "nosweep" command, then in effect, the item has a one time chance of being loaded into the container ... at reboot.  (be sure to read %repop below)
ObjectLoad ... I don't know what the if flag depends on for the O command.  Most likely the previous command, whatever it was, if anything.

%repop

Percent repop needs some discussion, as the concept can be confusing.

Every zone has a certain lifespan.  (See the Zone Docs.)  When the lifespan has completed, it is reset.  A piece of code called the Zone Sweeper goes through the zone room by room, cleaning up, then the zone commands contained in the zone file are executed one by one.

The zone sweeper will remove every object in the zone except:

objects in the same room as a player at the time of the sweep
objects marked with the "no sweep" flag
objects in containers marked with the "no sweep " flag
player corpses (which are automatically marked with the "no sweep " flag)
objects in player corpses

After the zone sweeper is complete, each zone command is executed one by one. 

If you have a rare item that is to be equipped by your mob infrequently, let's see how the load commands affect the availability.

Example:

M 0 6717 3 6700         gold dragon #1        
E 1 6718 3 1           ornate gold ring    
E 1 6761 100 6         dragon crown 50mr

M 0 6717 3 6701        gold dragon #2
E 1 6761 100 6         dragon crown 50mr
M 0 6717 3 6702        gold dragon #3
E 1 6761 100 6         dragon crown 50mr

The above code loads 3 gold dragons in 3 different rooms.  They will all wander around their home stomping ground.  Each will wear a dragon crown 100% of the time.   Three percent of the time, the first dragon loaded will be given a gold ring to wear as well.  If any of the dragons are killed, the first mob load command will succeed, and the dragon has a 3% chance of being loaded with the ring.

Let's look at a different scenario.

M 0 6717 3 6700        gold dragon #1        
E 1 6761 100 6         dragon crown 50mr

M 0 6717 3 6701        gold dragon #2
E 1 6761 100 6         dragon crown 50mr
M 0 6717 3 6702        gold dragon #3
E 1 6718 3 1           ornate gold ring    
E 1 6761 100 6         dragon crown 50mr

In this case, it's the last dragon loaded who gets the opportunity to wear the ring.   All three of the dragons have to have been killed for this dragon to be loaded, making the item potentially much more rare.

Rare items should be coded 5%, average items (e.g. potions that contain spells one can have cast by a bot) should be 100%, keys should be 100%, other items may be 50 or 100%. This value will be reviewed by the EQ group before a zone is implemented.

ZRESET

This immortal command is very useful in testing.  It is unknown whether it invokes the zone sweeper, however it will reset the zone as if %repop for EVERY ITEM were 100%.  When you are ready to test your zone, zreset it, then check every object to be sure it loaded correctly. 

Did you load the right object?  (it's easy to mistype a vnum)
Did you load the object in the right position? (The mud won't check wear flags)
Are there any alignment problems preventing the mob from wearing the item?

 
Equipment Position  

Think of these as zone wear flags.

code position code position code position
0 Light 6 Head 12 Body
1 Right finger 7 Legs 13 Waist
2 Left finger 8 Feet 14 Right wrist
3 Neck (1) 9 Hands 15 Left wrist
4 Neck (2) 10 Arms 16 Weapon
5 Body 11 Shield 17 Held

Portals


The two zone commands should be used together.

load room Room where the portal will be dropped.  Remember to add the "nosweep" flag for the portal.  Unless you want to make the room on the other side of the portal only occasionally available ...
destination room The room on the other side of the portal
door state
0 open
1 closed
2 closed & locked
key vnum the vnum of the object that will unlock the portal

 

The portal will  load with the values set in these commands regardless of what is in the OBJ file,  so be sure that they correspond (unless the intention is to have otherwise!).