The .obj File

An object is any item in the game, be it unmovable rock, the fountain in market square, or that nice sword Everyman the Barbarian has. Everything the mud needs to know about objects can be found in the .obj file, except for where they actually are.

Here is an example object, followed by a line-by-line breakdown:


#2200
sword example~
an example sword~
An example sword lies on the ground, exampling.
~

~
5 64 8193
0 3 1 10
5 1000 100
E
sword example~
It looks very shiny and polished, as if someone is taking care to try to make a good example.
~

A
1 1


The line-by-line breakdown:

#2200
The vnum of the object. See the section on virtual numbers in the Basics part of this Handbook.
sword example~
The namelist of the object: what words can be used to manipulate the object. In this case, either of the words 'sword' or 'example' can be used in conjunction with a wield, drop, take, etc.
an example sword~
Short desc. This is seen when the object is the target of a command: 'You wield an example sword.', 'You give an example sword to...'.
An example sword lies on the ground, exampling.
~
The long description. This is what a player sees if the object is lying in a room by itself.
~
This is the action description, and is NOT used at all. Just a tilde by itself for this field.
5 64 8193
The first number is what type of object this is... a weapon. See Object Types below.
The second number is the object's flags. See Object Flags below.
The final number is the wear flags of the item, a flag that tells the mud where the item can be worn on a player or mob. See Wear Flags below.
0 3 1 10
These are the object's values. What each number means is completely dependant on what Type of object it is. See Object Values below.
5 1000 100
The first number is the weight of the object.
The second field is the value of the object, in gold coins.
The final field is rent value of the object, or how much it costs to rent this item per day, in gold coins.
E
sword example~
It looks very shiny and polished, as if someone is taking care to try to make a good example.
~
This is an extra description, and behaves EXACTLY like the extra descriptions of rooms. The reader is referred to that section for more information.
A
1 1
These are 'applies' of the weapon... the 'A' signifying that an apply is forthcoming. The second digit is the type of apply, and the third how much the apply is worth (either positive or negative). See Applies below.

Descriptions

The short desc and long desc are similar to those of rooms, as well as the placement of tildes.


Object Types

The value of this field can be found in the list below...

  1. Light
  2. Scroll
  3. Wand
  4. Staff
  5. Weapon
  6. * Fireweapon -- not implemented in standard Diku
  7. * Missile -- not implemented in standard Diku
  8. Treasure
  9. Armour
  10. Potion
  11. Worn
  12. Other
  13. Trash
  14. * Trap -- not implemented in standard Diku
  15. Container
  16. * Note -- not implemented in standard Diku
  17. Drink Container
  18. Key
  19. Food
  20. Money
  21. * Pen -- not implemented in standard Diku
  22. Boat

Object Flags

The following chart gives values and explanations of all the object flags...

        1       Glow    - item glows
        2       Hum     - item hums
        4       * Dark  - Not Implemented
        8       * Lock  - Not Implemented
        16      * Evil  - Not Implemented
        32      Invis   - item is invisible
        64      Magic   - item has a magic aura
        128     Nodrop  - item cannot be dropped
        256     Bless   - item is blessed
        512     A-Good  - not usable by good aligned.
        1024    A-Evil  - not usable by evil aligned.
        2048    A-Neut  - not usable by neutral aligned.

Wear Flags

These flags are handled the same way as the flags mentioned in the Basics section of this Handbook. The chart is fairly self-explanatory.

        #       Where Wear      Notes
        1       Take            - item is takeable (IMPORTANT!)
        2       Finger
        4       Neck
        8       Body
        16      Head
        32      Legs
        64      Feet
        128     Hands
        256     Arms
        512     Shield
        1024    About body
        2048    Waist
        4096    Wrist
        8192    Wield
        16384   Hold
        32768   * Throw         - not implemented

Object Values

The four numbers consisting of the 'item values' are different for each type of item. Below the meanings of these numbers are broken down by each type. Zeroes refer to fields not used, while letters are explained for each section...

(please note this is basically lifted verbatim from the Diku-docs. Credits to the original author(s), and no disrespect intended.)

LIGHT (1)
Value[0]: -
Value[1]: -
Value[2]: Number of hours the light can be used for. Zero hours means that the light has gone out. A negative number will create an eternal light source.
Value[3]: -
SCROLL (2)
Value[0]: Level of the spell on the scroll.
Value[1]: Which spell (see Spell ID's below for more information on this)
Value[2]: Which spell (unused spells should be set to -1)
Value[3]: Which spell
WAND (3)
Value[0]: Level of spell in wand.
Value[1]: Max Charges (1..X)
Value[2]: Charges Left
Value[3]: Which spell in wand (see Spell ID's below for more information)
STAFF (4)
Value[0]: Level of spell in staff.
Value[1]: Max Charges (1..X)
Value[2]: Charges Left
Value[3]: Which spell in staff (see below for more information)
WEAPON (5)
Value[0]: -
Value[1]: Number of dice to roll for damage
Value[2]: Size of dice to roll for damage
Value[3]: The weapon type. Type is one of:
         NUMBER  CATEGORY   Message type
            2  : Slash         "whip/whips"
            3  : Slash         "slash/slashes"
            6  : Bludgeon      "crush/crushes"
            7  : Bludgeon      "pound/pounds"
           11  : Pierce        "pierce/pierces"
TREASURE (8)
Value[0]: -
Value[1]: -
Value[2]: -
Value[3]: -
ARMOUR (9)
Value[0]: The effective AC. A positive value is a bonus, a negative is a penalty.
Value[1]: -
Value[2]: -
Value[3]: -
POTION (10)
Value[0]: Level of the spell in the potion.
Value[1]: Which spell (see Spell ID's below for more information)
Value[2]: Which spell (unused values should be set to -1)
Value[3]: Which spell
WORN (11)
Value[0]: Protection from cold.
Value[1]: Protection from heat.
Value[2]: -
Value[3]: -
OTHER (12)
Value[0]: -
Value[1]: -
Value[2]: -
Value[3]: -
TRASH (13)
Value[0]: -
Value[1]: -
Value[2]: -
Value[3]: -
CONTAINER (15)
Value[0]: Maximum weight the container can contain.
Value[1]: Container flags:
           CLOSEABLE     1
           PICKPROOF     2
           CLOSED        4
           LOCKED        8
Value[2]: The key vnum of the container. No lock = -1.
Value[3]: - (Internal use for Corpses that must "rot".)
DRINK CONTAINER (17)
Value[0]: Maximum drink-units the drink-container can contain.
Value[1]: Number of drink-units that are left in the container.
Value[2]: The type of liquid in the drink-container, one of:
              Type       nr.    Drunkness   Fullness   Thirst
              WATER      0      0           1           10
              BEER       1      3           2            5
              WINE       2      5           2            5
              ALE        3      2           2            5
              DARKALE    4      1           2            5
              WHISKY     5      6           1            4
              LEMONADE   6      0           1            8
              FIREBREATH 7      10          0            0
              LOCALSPC   8      3           3            3
              SLIME      9      0           4           -8
              MILK       10     0           3            6
              TEA        11     0           1            6
              COFFE      12     0           1            6
              BLOOD      13     0           2           -1
              SALTWATER  14     0           1           -2
              COKE       15     0           1            5
The above values for drunkness/fullness/thirst are used per four "units" drunk. The values are expressed in HOURS!
Example: Dragon empties a bottle (say 7 units) of saltwater. His Drunkness is not changed ((7/4)*0). His Fullness increases by ((7/4)*1) hours. His Thirst increases by ((7/4)*-2) hours, thus making him More thirsty.
The hours above are numbers between 0 and 24. 24 hours is maximum for drunkness/fullness/thirst, when the hours are zero for any of drunkness, fullness, or thirst, the person will be sober, hungry, or thirsty, respectively.
Value[3]: if this value is non-zero, then the drink is poisoned.
KEY (18)
Value[0]: The key-type. This value should be the same as the object number.
Value[1]: -
Value[2]: -
Value[3]: -
FOOD (19)
Value[0]: The number of hours, that this food will fill the stomach.
Value[1]: -
Value[2]: -
Value[3]: If this value is non-zero, the food is poisoned.
MONEY (20)
Value[0]: The number of gold coins "in the pile of coins".
Value[1]: -
Value[2]: -
Value[3]: -
ITEM_BOAT (22)
Value[0]: -
Value[1]: -
Value[2]: -
Value[3]: -

Spell ID Numbers

Due to the calculations performed in the damage routines of a standard mud, the following must be kept in mind; spells are more powerful when cast at the lowest level capable of casting the spell, compared to higher levels casting the same spells.

An Example: The Mighty Eeyore is a 7th level mage, and has just earned the spell 'shocking grasp'. This spell will do the most damage while Eeyore is 7th level. When Eeyore becomes 8th level, the damage caused by this spell will dramatically reduce, and 9th level will reduce it even more.

Please keep this in mind when choosing spells, and the level of the spells in a particular item.

Below is a chart (lifted from the original Diku-docs, mostly) that gives the id# and usage of each spell...

                      ID #   POTION  SCROLL WAND   STAFF
ARMOUR                  1      Y       Y      Y      N
TELEPORT                2      Y       Y      Y      Y
BLESS                   3      Y       Y      Y      N
BLINDNESS               4      Y       Y      Y      Y
BURNING_HANDS           5      N       N      N      N
CALL_LIGHTNING          6      Y       Y      N      Y
CHARM_PERSON            7      N       Y      N      Y
CHILL_TOUCH             8      N       N      N      N
CLONE                   9      Y       Y      Y      N
COLOUR_SPRAY           10      N       Y      Y      N

CONTROL_WEATHER        11      N       N      N      N
CREATE_FOOD            12      N       Y      N      N
CREATE_WATER           13      N       N      N      N
CURE_BLIND             14      Y       N      N      Y
CURE_CRITIC            15      Y       N      N      Y
CURE_LIGHT             16      Y       N      N      Y
CURSE                  17      Y       Y      N      Y
DETECT_EVIL            18      Y       N      N      Y
DETECT_INVISIBLE       19      Y       N      N      Y
DETECT_MAGIC           20      Y       N      N      Y

DETECT_POISON          21      Y       Y      N      N
DISPEL_EVIL            22      Y       Y      Y      Y
EARTHQUAKE             23      N       Y      N      Y
ENCHANT_WEAPON         24      N       Y      N      N
ENERGY_DRAIN           25      Y       Y      Y      Y
FIREBALL               26      N       Y      Y      N
HARM                   27      Y       N      N      Y
HEAL                   28      Y       N      N      Y
INVISIBLE              29      Y       Y      Y      Y
LIGHTNING_BOLT         30      N       Y      Y      N

LOCATE_OBJECT          31      N       N      N      N
MAGIC_MISSILE          32      N       Y      Y      N
POISON                 33      Y       N      N      Y
PROTECT_FROM_EVIL      34      Y       Y      Y      Y
REMOVE_CURSE           35      Y       Y      N      Y
SANCTUARY              36      Y       Y      N      Y
SHOCKING_GRASP         37      N       N      N      N
SLEEP                  38      Y       Y      Y      Y
STRENGTH               39      Y       Y      N      Y
SUMMON                 40      N       N      N      N

VENTRILOQUATE          41      N       N      N      N
WORD_OF_RECALL         42      Y       Y      Y      Y
REMOVE_POISON          43      Y       N      N      Y
SENSE_LIFE             44      Y       N      N      Y

IDENTIFY              *53*     N       Y      N      N

Applies

An item apply is a particular effect the item has upon the holder/wielder/wearer's statistics. There can be a maximum of two applies on an item, each requiring their own 'A' flag to let the mud know that there is more than one apply. Thus, a sword that added one to a character's strength, and -10 to his hitpoints would be:

        A
        1 1
        A
        13 -10

The first value is the type of apply, the second the value. Below is a list of the different types of applies, and their values.

        1       Strength
        2       Dex
        3       Int
        4       Wis
        5       Con
        6       Gender          - Internal use only... do not use.
        7       Class           - Internal use only... do not use.
        8       Level           - Internal use only... do not use.
        9       Age
        10      Weight
        11      Height
        12      Mana            - adds to max value
        13      Hitpoints       - adds to max value
        14      Move points     - adds to max value
        15      Gold            - Internal use only... do not use.
        16      Experience      - Internal use only... do not use.
        17      Armour Class
        18      Hitroll         - bonus/penalty to hit
        19      Damage roll     - bonus/penalty to damage done by user
        20      Anti-Para       - bonus/penalty to resistance roll
        21      Anti-Rod        - bonus/penalty to resistance roll
        22      Anti-Petrify    - bonus/penalty to resistance roll
        23      Anti-Breath     - bonus/penalty to resistance roll
        24      Anti-Spell      - bonus/penalty to resistance roll (most used)

Object Archetype

#vnum
namelist~
short desc~
long desc~
~
<object type> <object flag> <wear flag>
<object values (four digits)>
<weight> <value> <rent cost>
E
keywords~
Extra desc
~
A
<apply type> <apply amount>

Tips And Observations


[Next] On to the next section
[Back] Back to the previous section
Back to the Builders' Handbook contents

[C.A.W.] Back to the C.A.W. Homepage

Alex Fletcher
Last modified: June 24th, 1996