Section 4:    #OBJECTS

Here's how an object is formatted:

  1. #[vnum]
  2. name list~
  3. short description~
  4. long description~
  5. material~
  6. [item type] [extra flags] [wear flags]
  7. [V0] [V1] [V2] [V3] [V4]
  8. [level] [weight] [cost] [condition]
  9. A [location] [modifier]
  10. R [wear flag] [applies] [modifier]
  11. F [affect immune resist vulnerability] [location] [modifier] [bits]
  12. I [damagetype] [modifier]
  13. T [trigger] [program vnum] [argument]~
  14. C message~
  15. E
    [extended object description keyword]~
  16. [extended object description text]
    ~

Note that everything listed under [level] [weight] [cost] [condition] is optional, but in the case of the extended object descriptions, highly recommended. >:) You also might consult the hints for creating objects section at the end of this document.

Below is an example of an object we'll use throughout this document. It is a part of Shamrock's Cafe, found at the end of the builder's docs:

#28
floatstone stone rock luminescent light object~
a luminescent floatstone~
A small, glowing rock floats here.~
stone~
light AGY APz
0 0 -1 0 0
10 1 2500 P
A 2 3
A 28 3
A 17 -5
E
floatstone stone rock luminescent light object~
The floatstone is rounded and smooth, an irregular ball-shaped rock that
fits just in the palm of a man's hand. The stone glows a bright, yellowish
green, neither burning nor heated, and never loses its intensity, even in
the presense of other bright lights.
~

Here's the breakdown of the object format:

  1. #[vnum]

    The vnum is the number used to reference your object. There may only be one object of any given vnum at one time. (See our discussion of vnums in the introduction to the #AREAS area header.)

  2. name list~

    This is the list of names by which a player may reference the object. In the example of the floatstone given above, the names list is this:

    floatstone stone rock luminescent light object~

    Do not forget to put a tilde (~) at the end of the list.

  3. short description~

    This is the short description of the object. Players see it when they use, pick up or wear the object. Examples include: a luminescent floatstone, a short sword named 'Nightbringer', a scale mail coif, etc. The first letter of this line short be lowercase ("a luminescent floatstone", not "A luminescent floatstone"), unless the object has a proper name (e.g., "Excalibur", not "excalibur"). Do not forget to put a tilde (~) at the end of the line.

  4. long description~

    This is the description players see when the object is on the ground. To use the example above:

    A small, glowing rock floats here.~

    The first letter of the long description should be an uppercase letter (e.g. "M", not "m"). Do not forget to put a tilde (~) at the end of the line.

  5. material~

    This is the substance from which the object is mostly composed, for example, a sword might have material steel~, and a cloak might have material wool~. Dawn of the Ages offers an extensive list of materials which you can use. If you must define a new material type in your area, go ahead, but please make a note of this to the person to whom you submit the area. You will find the list of material types already defined on Dawn here. Don't forget to end the material type with a tilde (~).

  6. [item type] [extra flags] [wear flags]

    [item type]

    Item type determines what kind of object you are creating. Many of the item types have no practical purpose aside from determining the shops at which players may sell their goods. For example, a jeweler might buy only jewelry, not gems or treasure. Below we list the item types used by Dawn. An asterisk (*) beside the name of the item type indicates the item has special values, examples of which can be found here.

    Item Types
    armor*boatbuckler*
    clothingcontainer*drink*
    food*fountain*furniture*
    geminstrument*jewelry
    keylight*map
    money*pill*portal*
    potion*ring*scroll*
    sheath*staff*trash
    treasuretrophywand*
    warp_stoneweapon*

    [extra flags]

    Extra flags provide visual effects and control how players may use the object. Click here to view the table of extra flags that you may use on Dawn. The floatstone above has extra flags of AGY, meaning it is a glowing, magic light that is burn-proof.

    [wear flags]

    Wear flags determine where an object may be worn. Note that if you want a player to be able to pick up the object you should flag it "A" (for "take") in addition to any other wear flags. Leaving off the "take" flag but flagging the object wearable will make it impossible for a player to pick up the object should the player drop it. So, for example, if you wish to make a ring that can be picked up and worn on the finger you need to flag the ring "AB". Note that items cannot have multiple wear locations ("take" does not count as a wear location -- it only determines if the item can be picked up).

    AtakeKaboutbody
    BfingerLwaist
    CneckMwrist
    DbodyNwield
    EheadOhold
    FlegsPlight
    GfeetQfloat
    HhandsSsheath
    IarmsTtattoo
    JshieldUquiver

    In addition, wear flags will determine which races can use the object. Just set a flag for each race you want using your object. Remember that you need to set the "z"-flag (all) if every race can use your item. If you set no flag at all, nobody can use your object, which might make sense for fountains, but not for swords.

    ahigh-manmlizard-manyorc
    bhumannminotaurzall
    cdark-manocherubim0nord
    dsun-elf (no longer used)phalf-elf1tenebrian
    ewood-elfqwulven2ogre
    fhigh-elfrskaven3genie
    gdark-elfscrimson-elf4troll
    hkhazadtlokatean5daemon
    imountain-dwarfuhalfling6grey-elf
    jcave-dwarfvgnome7nymph
    kmoon-elf (no longer used)watlantean8shapeshifter
    lcentaurxtitan9celestial

  7. [V0] [V1] [V2] [V3] [V4]

    Items marked with an asterisk (*) in the [type] section above have special values that must be given in the area file. To see these items, go back up to the [type] section; to see the values themselves, click here.

    Items not marked with an asterisk (*) have no special settings and a zero (0) must be placed in each slot. Below is an example of an item with no special values:

    #3043 
    staff protection~ 
    a staff of protection~ 
    An enchanted staff of protection sits on the floor.~ 
    silver~ 
    treasure G AB 
    0 0 0 0 0  <--------------- ([V0] through [V4] slots held with zeroes)
    8 10 640 P 
    
  8. [level] [weight] [cost] [condition]

    [level]

    Level determines the level a character must be to use an object. Higher level items should be more powerful, and lower level correspondingly less powerful.

    [weight]

    Weight determines how heavy an object is, which factors into how much a player may carry. Dawn reads the number in this slot as tenths (1/10) of pounds, so a three pound dagger will have an entry of 30.

    [cost]

    Cost determines how much money a player can get for selling an item to a shop (although shops almost always buy for less than they sell) or how much a shop will charge the player for the item. When in doubt concerning an item sold in a shop, overprice it; when in doubt concerning an item that players can find in an area, underprice it.

    [condition]

    The fourth slot in this row is "condition", which is not implemented, and should be set to P. Setting it to anything other than P can cause the area not to boot.

  9. A [location] [modifier]

    Applies determines the attribute the item will affect. It is set up like so:

    A [location] [modifier]

    [location] is the type of affect being placed on the item. [modifier] is a positive or negative number that will increase or decrease the location in question.

    Below is a listing of the locations used on Dawn:

    1Strength21Saves vs elemental
    2Dexterity22Saves vs mental
    3Intelligence23Saves vs force
    4Wisdom24Saves vs godly
    5Constitution25Spells_affect
    6Sex*26Charisma
    9Age27Appearance
    10Height28Quickness
    11Weight29Saves vs. paralyze
    12Mana30Modify-resistance
    13Hitpoints31Flee chance**
    14Movement32Alignment
    17AC33Prayer_affect
    18Hitroll34Regeneration rate
    19Damroll35Morale**
    20Saves vs. all magic

    * The only modifier to be used for "sex" is 1, and it results in a random change of sex.

    ** Not used.

    Here's an example of attributes:

    A 2 3
    A 28 3
    A 17 -5

    The above are the affects of a floatstone, which adds three (3) points to a player's dexterity, three (3) points to a player's quickness, and five (5) points to her armor class.

  10. R [wear flag] [applies] [modifier]

    Race applies are much like applies above, but differ slightly in that they allow you to apply object attributes to specific races. Here's how you set it up:

    R [wear flag] [applies] [modifier]

    [wear flag] is the very same one you used above, only you use the wear flag that corresponds to the race you want the apply to affect. [applies] is the same flag as what you see above. [modifier] is a positive or negative number that will increase or decrease the location in question.

    Here's an example of how race applies are used:

    R v 13 3
    R v 19 5

    The above race applies will affect both a gnome's hit points by 3 and his damroll by 5.

  11. F [affect immune resist vulnerability] [location] [modifier] [bits]

    Flags are written this way:

    F [affect immune resist vulnerability] [location] [modifier] [bits]

    Flags let you place permanent affect bits as well as immunity, resistance and vulnerability bits on an item. Note that you may also specify a location here (or 0 if none) so that spells with two effects can be done (like a ring of haste would have a dex modifier in addition to the bit).

    A listing of affects can be found here. Below are three examples of what you can do with flags:

    F A 25 5 Dsaves+5 and DET_INVISIBLE
    F A 0 0 CDEFGa true sight item
    F I 0 0 CDimmune to weapons and magic! :)

    For obvious reasons, be VERY careful in creating permanent affected items. A permanent sanctuary item, for instance, would be of questionable balance and an implementor will likely strip the item from your area unless you have some extreme justification for the affect.

  12. I [damagetype] [modifier]

    The damagetype modifier is written like this:

    I [damagetype] [modifier]

    [damagetype] is the kind of damage a player becomes resistant to or vulnerable to when wearing this object. The damagetype is referred to by a number associated with the damagetype, a list of which follows below:

    bash        1     sound       13
    pierce      2     
    slash       3     disease     14
                      poison      15
    fire        4     blindness   16
    ice         5     energy      17
    water       6     light       18
    electricity 7     dark        19
    air         8     summon      28
    earth       9     
    acid        10    holy        20
                      unholy      21
    charm       11    bless       22
    psionic     12    curse       23
    

    [modifier] is the modifier for that damagetype, making the player resistant or vulnerable by that amount. Use the guidelines in the hints section for resistances and vulnerabilities when applying this to your item.

  13. T [trigger] [program vnum] [argument]~

    Object triggers are very much like mobile triggers (see the discussion of triggers in the mobiles section), only we apply them to objects. The trigger sets up a program, which is activated when the condition stated by the trigger becomes true. The setup for object triggers is exactly the same as for mobile triggers:

    T [trigger] [program_name] [argument]~

    The explanation is the same as well:

    The TRIGGER is a single word, see below for explanations.
    The PROGRAM_NAME is the MOBprogram called.
    The ARGUMENT is the argument that triggers the event.

    Here is an example:

    T wear objDamageHim 100~

    When a player wears the object this trigger is on, a mobprogram called objDamageHim activates and plays out the mobprogram. We place object programs in the same location as mobprograms, and we construct them the same way.

    A list of triggers follows:

    TriggerArgumentWhat must happen to activate trigger
    drink_afterPERCENTchance to activate the program after the player drinks from a container
    drink_beforePERCENTchance to activate the program before the player drinks from a container
    dropPERCENTchance to activate the program when the player drops the object
    eat_afterPERCENTchance to activate the program after the player eats food
    eat_beforePERCENTchance to activate the program before the player eats food
    examinePERCENTchance to activate the program when the player examines the object
    quaff_beforePERCENTchance to activate the program before the player quaffs a potion
    removePERCENTchance to activate the program when the player removes the object
    takePERCENTchance to activate the program when the player takes the object from the ground
    wearPERCENTchance to activate the program when the player wears the object

    Now for more information:

    DRINK_AFTER / DRINK_BEFORE / EAT_AFTER / EAT_BEFORE / QUAFF_BEFORE
    Keywords: 'drink_after' 'drink_before' 'eat_after' 'eat_before' 'quaff_before'
    Argument: number

    The argument is a number between 0 and 100, inclusive. In other words, this is a percentage.

    NOTE: each of these triggers is activated anytime the player performs the required action. In other words, if a mud of beer has a 'DRINK_BEFORE' trigger on it, the trigger will set off just before the player drinks from the mug.

    DROP
    Keyword: 'drop'
    Argument: number

    Another percentage argument.

    NOTE: this trigger is activated anytime the player drops the object with this trigger on it.

    EXAMINE
    Keyword: 'examine'
    Argument: number

    Another percentage argument.

    NOTE: this trigger is activated anytime the player examines the object with this trigger on it.

    REMOVE
    Keyword: 'remove'
    Argument: number

    Another percentage argument.

    NOTE: this trigger is activated anytime the player removes the object with this trigger on it.

    TAKE
    Keyword: 'take'
    Argument: number

    Another percentage argument.

    NOTE: this trigger is activated anytime the player takes from the ground the object with this trigger on it. It is called after the object is removed from the ground but before it is added to the player's inventory.

    WEAR
    Keyword: 'wear'
    Argument: number

    Another percentage argument.

    NOTE: this trigger is activated anytime the player wears the object with this trigger on it.

  14. C message~

    This is an optional message, which, when the item crumbles, gives a message different from the standard message. An example of such a message might be what you would see if a dagger made of ice crumbles:

    C The dagger melts back into the ground.~

    Do not forget the tilde (~) at the end.

  15. E
    [extended object description keyword]~
    [extended object description text]
    ~

    Here's an example:

    E
    floatstone stone rock luminescent light object~
    The floatstone is rounded and smooth, an irregular ball-shaped rock that
    fits just in the palm of a man's hand. The stone glows a bright, yellowish
    green, neither burning nor heated, and never loses its intensity, even in
    the presense of other bright lights.
    ~
    

    E signifies the start of an extra description. 'floatstone stone rock luminescent light object' are the keywords that a player will see when she 'examine'(s) the object (here, the floatstone). That is, typing 'examine light' or 'examine floatstone' or the other two keywords will yield the output of 'The floatstone is rounded and smooth....' For further examples, see the section dealing with extra desciptions in #ROOMS.

Hints for creating objects

When making objects in an area, you might want to keep the following hints in mind: