home » builders » builder's lessons » mobile resets

Mobile resets

When the game reboots every area is reset. Over time the areas are reset again. Time between resets varies from area to area, and is defined in the #FLAGS section of the area file. For a mobile you set where (what room) it loads into, how many of the mobile loads, objects it holds in inventory and equipment it is wearing.

Mobile placement

This is how you set where the mob is to load and how many of the mob can load in the game. The syntax would be as follows:

M 0 mob-vnum limit room-vnum ; comment

An example Mobile Placement reset would be:

M 0 QQ01 1 QQ27 ; dwarf in room 27

M - This defines that it is a mobile the game is dealing with.

0 - This field isnt used but needs to be there to for the mud to load.

QQ01 - This is the vnum of a mobile to load.

1 - This is the limit of how many of this mobile may be present in the room. If for instance you put in 4 instead of 1 here, on boot up one dwarf would load. Providing he isn't killed, next repop another dwarf would load, continuing on until there are 4 all up of that vnum in that room.

QQ27 - This is the vnum of the room where the mobile is loaded.

; dwarf in room 27 - This is the comment. It is a good idea then to add comments after a ; Comments make it much easier to see what is happening in resets when reading over the area file. Especially as you are editing and adding to your area file. We require well commented resets on Forgotten Kingdoms Mud.

So in summary this reset says that it is a mobile placement reset for the mobile with the vnum of QQ01 into room QQ27 and only 1. The comment gives us the information that it is a dwarf.

Equiping a mobile

You place this line directly under the M line in resets. You must set the mobile in place before equiping it. The syntax is as follows:

E 0 obj-vnum 0 wear_loc ; comment

And expmple Equipment reset would be. Note that the M placement reset is here too. It is needed for the code to know which mob it is equipping. It makes the order that you place things in resets very important.

M 0 QQ01 1 QQ27 ; dwarf in room 27
 E 0 QQ04 10 WEAR_HEAD ; helmet on dwarf

E - This tells the game you are equipping the mobile before this line.

0 - This field is not used so should be just set to 0.

QQ04 - This is the vnum of the object that the mobile is to wear.

10 - This is the total number it allows in the game before it does not equip the mobile with that item. Due to the fact equipment can be worth quite a bit we like to keep this reset number low so as to not fill an area with a lot of equipment that is not used and just leads to players making too much money on the sale of it.

WEAR_HEAD - This tells the game where on the mobile the object is to be worn. In this case on the head. Refer to the reset wear locations listing for more information on wear mobiles can wear objects. Note that they are different from the CAN_WEAR_ locations on objects

; helmet on dwarf - After the ; a comment should be placed.

Objects in mobiles inventory

This command gives a mobile the object specified and places it in their inventory. The command works for the mobile that is listed before it. For shop keepers you need to use this command to give them what they sell. The syntax is as follows:

G 0 obj-vnum 0 ; comment

The following is an example. Note that we have used the two resets from before of our dwarf wearing a helmet.

M 0 QQ01 1 QQ27 ; dwarf in room 27
 E 0 QQ04 10 WEAR_HEAD ; helmet on dwarf
 G 0 QQ27 10 ; purse in dwarfs inventory

G - This tells the game that you are giving the mobile that preceeds it this object. You can give the mobile more than one object.

0 - This unused by the game but the 0 must be put in place for the game to load right.

QQ27 - This is the vnum of the object.

10 - This is the maximum number of that object that can be in that game before it is loaded up in that mobiles inventory. If there are 11 in the game on reseting the area then the mobile will not load up with it. If the mobile is a shop he will load up as having it in his list command, but he will tell the player that they are out of stock when they go to buy the item.

; purse in dwarfs inventory - The comment should state what the name of the item is at the very least.

A mobile can be equiped with more than on item, providing it is a unique wear location. Mobiles cannot layer what they wear. Each item would have to have its own seperate E reset. They can have more than one G reset as well.