builder.txt

emud/doc/builder.txt · 209.3 KB

From the archive emud-3.0.tar.gz

Download the archive   « Back to the archive contents

                               Storms of Times
                                                         _________
                                             __  __,----'         `-----.__
                      __                      \\/====-____          ___,-' `
                       \\          _/_/_/     /||\\       `---.____/
                ______---\       _- /   \/    |||  \\           _,'`
          __,--'   ,--'||\-_    /,--_/--.|-   |`\.  \\        ,'
       _,'      ,-'    |  \\`.  ` */ /==/-   /  ||   `\.     /
     .'       ,'       |   \\ \_**  /==/-   /   ||      \   /
    / _____  /   __    |     \\**-_/==/|- _/   ,//       \ /
   ,-'     `-|--'  `--_ \     ***-/===| \-_-===-'     _ _/`
                       `-| **** *|====|  \_      __,-- '
             ..          '* *** *|====|    \_  _,              /\
           ...             *** * \=====\__   \/                 \__  _
         ...             ***-' _/'\=,-' ____-'`-_                  `== \
     ()  *.   ()|       ** //--\   ///--\`._     `-                  _\ \
      #_/    /#_|   ()  /           \=======\      `----.________,--- __/
      #     / #    /#_/           __--======`)  \-._______________,---
     ###     / \  / #       |    //,--' `==--___ |-------'
    #####   /  /   / \     O##<_        //,--   -\
                  /  /       \

Emud ver 2.3 (Updated by Scandum - December 2002)
==============================================================================

Word from me (Scandum)

    This document was originally written by Chaos and Order for Mortal Realms.
    Emud, a clone of mortal realms, is still for 80% compatible with the
    source this document was written for.  So except for a couple of changes
    this guide is an exact duplicate of the MrMud 1.4 builder document.
    It should be significantly accurater than the original version though.
    (At least, so I hope)

Greetings future area creator!

    We (Chaos and me, Order) have put together this collection of documents as
    both references and instructions to building areas.  Below is a list of the
    documents in the order which we recommend reading, along with a brief
    description of each.

diku_bld.txt

    The official handbook for creating Diku areas as created by the
    Curious Area Workshop, it is included in the Emud Area Package because
    it does a decent job of describing all of the basics of area building.
    This document has been modified to the Emud configuration.

mob_prog.txt

    The instruction document that describes how to implement mob programs.
    This does NOT describe how to make special programs in C for mobiles,
    but details the functions and triggers used in programming mobiles from
    the area file.  This is the only method of support that can be given
    to creators for making mobiles do special functions.

emud.txt
    the latest set of values used by Emud.  Updates to this document set will
    be contained in this file and the online builder help file.

spells.txt

    the list of spells and the numbers necessary for specifying the spells in
    creating scrolls, potions, pills, scrolls staffs, wands and mobile progs.

holygrove.are

    An example area, with mobile programs.

Don't be afraid to create, Scandum, the Dude of Fire

==============================================================================

Emud now uses OLC which I believe to be short for Online Creation. This means
you can create your entire area online using a build char on the test mud.
If you wish you can skip most sections, and only pay attention to the part
describing object and mobile programs. If you want more information you can
read it all, it might come in handy when you know what you're doing, and
should make using the OLC engine a little easier.

Also there is a help file online on the test mud, type: help builder, and
you will enter it.

==============================================================================

diku_bld.txt

                           The Builder's Handbook
                                (version 1.0)
                                     By

                                  Builder_5

                       (of the Curious Area Workshop)

                      (Modified by Scandum on 9/12/01)


TABLE OF CONTENTS

1.  Overview
2.  Terminology
3.  Basics
4.  The #AREA, #HELPS, and #ROOMS section
5.  The #MOBILES section
6.  The #OBJECTS section
7.  The #SHOPS section
8.  The #RESETS section
9.  Putting it all together
10. Credits


1.  Overview

    This document is meant to be a basic tutorial to building areas for Emud.
    Readers of this Handbook should have at least have some experience with
    Emud or Diku muds, and will understand the basic concepts of armor, levels,
    and the et cetera.

    Nowadays, many mud-admins express the wish to have an entirely unique world.
    Unfortunately, building is time consuming and requires no mean amount of
    skill, with the added 'bonus' of being hard to learn; the standard mud-docs
    that get bandied about are somewhat vague on certain subjects, and were
    originally intended as a reference guide rather than a learning document.
    I hope to make this Handbook a 'cookbook' of sorts -- an explanation of the
    how's and what's of building a Emud based area for the non-coding inclined.

    This document is a tutorial for building in the standard Emud release 2.2.
    Most (95% or so) muds have changed or added to the information, but still
    follow the basic format.  Reading this document should prepare you for most
    Diku muds you will encounter out on the net.

    The Curious Area Workshops highly recommends that every builder understands
    the nuts and bolts of building, even if they have access to one of the
    mud-area editors available out there.  Being able to build with an editor
    is nice, but the knowledge of how the nuts and bolts of building actually
    works is of great value when things go wrong.  We cannot emphasize this
    enough, but we will attempt to refrain from preaching it in the rest of
    this document.



2. Terminology

Here are some common terms used in builing, and this handbook:

Desc:    Short for 'description'.
Db:      Database.  The files that make up the 'world' of a mud.
Flag:    A bit-vector that tells the mud that a particular monster,
         object, or room has a certain quality.
Mob:     Mobile.  A monster.
Obj:     Object.
Tilde:   This is a tilde: ~ .  It signifies the end of a line or
         a field in some of the database files.
Vnum:    An object, monster, or room's unique identification number.
         Stands for 'Virtual Number'.
Zone:    Used synonimously with 'area'.




3. Basics

For all examples, the area under creation will be known as 'handbook' or
'example area'.  It is assumed that the builder has access to some standard
type of text editor and knows how to use it.

*** FILES

For each area, one file must be created for inclusion into the dikumud's db:

  handbook.are

This file includes the various sections of:

  #AREA
  #HELPS
  #MOBILES
  #OBJECTS
  #ROOMS
  #SHOPS
  #RESETS


*** FLAGS

    Simply put, a flag tells the mud that there is something 'special' about a
    mob, room, or object.  In the sections below, lists of flags will be given
    with a number, a bitvector, next to it.  For example, here is the list of
    room flags that will appear below in the #ROOMS section:

ROOM_DARK           1
ROOM_NO_MOB         4
ROOM_INDOORS        8
ROOM_PRIVATE      512
ROOM_SAFE        1024
ROOM_SOLITARY    2048
ROOM_PET_SHOP    4096
ROOM_NO_RECALL   8192


    Now, for example, you are building a room.  Deciding that this room is a
    small section of tunnel, you would choose the flags:

DARK (1)  and  INDOORS (8)

    These numbers are the important part.  When the mud looks at the .wld file,
    it looks for _one_ number in a certain particular spot for each room's flags.
    Therefore, to give one room _two_ flags, you ADD the bitvectors together
    and place that number in the flags spot of that room's data.
    Thus for this example:

INDOORS + DARK = 9

    Another simple format can be each number separated by a '|' symbol.
    The '|' symbol is an logic OR symbol.

INDOORS + DARK = 1|8

    The final format is to use the names of the flags in replace of the
    numbers.  This system is MUCH easier to read, but may not be compatible
    with some of the mud-editors.

INDOORS + DARK = ROOM_INDOORS|ROOM_DARK


    How does this work, though?

    The bitvectors are in binary...the number you arrived at when you added
    can only be reached by one combination of adding those numbers together
    (you're not allowed to use a flag or number more than once).

    Thus, if your number was: 524 you would know that it was PRIVATE (512)
    (the highest number that will go into 522)

    522-512 = 10

    INDOORS (8) is the next highest number that will go into it.

    10-8 = 2

    NO_MOB (2) is the last one:  2-2 = 0  (no more flags).


    It should be obvious that the list is not complete.  The blank spots are
    flags the are not used but exist for backward compatiblity.  PLEASE do not
    use any of these.  The game may use some of them for temporary values, and
    their use may jeopardize the system.


*** Zone Number

    Each area must have its own unique number.  Usually, the imp of your
    particular mud will assign this to you.  This number is used as part
    of all your area's virtual numbers. (see below).

    The system that nearly all mud administrators like is the QQ format.
    This system places the symbols 'QQ' in replace of any zone number.  The
    administrators will later assign a number in replace of the QQs.


*** Virtual Numbers

    Every Mob, Obj and Room must have its own Virtual Number for the mud
    to identify it with.  Each number must be unique among its own type.

    For example, If I made the Sword of Cheezy Destruction, I may decide to
    make it item number 2200 of my zone.  The first two digits
    are the zone number (above) of my area, the second two identify which
    item it is in that area.

    These first two numbers will be assigned by the system administrators.
    The first two numbers should be replaced by 'QQ'.  Therefore the format
    you would write for the item number is QQ00.


    However, I can have a mobile with number 2200 as well.  A room #2200 too.
    The number must be unique among all others of its type (rooms, objs, mobs)
    But does not need to be unique in regards to other types of db's.

    Emud admins do not allow using any object or mobile that does not solely
    exist in the zone of the creator.  So all referenced objects or mobiles
    should start with the QQs.

    If your area has more than 100 rooms then continue using the 'QQ' method,
    but change the value to 'QR' for rooms 100-199, and 'QS' for rooms 200-299,
    etc...


*** Strings

    A string holds the actual data of the text sent to the player, such as a
    mobile's name, or a room description.  Strings can range in size from zero
    length to the MAX_STRING_LENGTH.  Emud systems are 20,000 bytes allowed per
    string in a description, and 2,000 for names and short descriptions.  All
    strings end in the tilde '~' symbol.  Placing a return after the text, but
    before the tilde will display the return to the player.

    Custom color may be added to certain strings.  Room descriptions, mobiles
    descriptions, object descriptions, and extra descriptions may all have
    custom color.  Adding color is as simple as adding a pair of matching 
    brackets, with three digits between them.  The three numbers are the
    parameters of the color change request.

    Format:    '{abc}'           with a,b,c being parameters.

    Parameter 'a':  VT102 code.
                       0 - Dim
                       1 - Bold
                       3 - Restore color to text default regardless of b,c
                       4 - Reverse
                       5 - Underline
                       7 - Flashing

    (All VT102 systems support Dim, Bold, and Restore)

    Parameter 'b':  Foreground color
    Parameter 'c':  Background color
                       0 - Black
                       1 - Red
                       2 - Green
                       3 - Yellow
                       4 - Blue
                       5 - Purple
                       6 - Cyan
                       7 - White

    Example:
    The small {130}dog{300} sits by the {114}cat{300}.~

    This example starts with normal colors.  'dog' is bold, yellow on black.
    The 'cat.' ends up being blue background, with red text.
    (be aware to reset after using a background color like in the example)


4.1  The #AREA section

    The #AREA section has very few lines but sets up the entire file.

*** Area Name

#AREA <area name>~

example: #AREA Sanitorium~


*** Author Name

#AUTHORS <author names>~

example: #AUTHORS Gregorius~


*** Reset Message

    This message will echo through the area every repop.

#RESETMSG <reset message>~

example: #RESETMSG <You hear the patter of little feet.~


***  Level Range

     This is a very arbitrary set of numbers that the creator must decide on.
     This field must contain exactly 4 numbers between 0 and 99

#RANGES <low_soft> <hi_soft> <low_hard> <hi_hard>

Example: #RANGES 40 60 1 95


*** Temperature (optional)

    This is the daily temperature scale in Fahrenheit.  The winter and summer
    lows are for night temperature, with the daily adding to it.  To reverse
    the seasons, simply switch out winter and summer temps.
    The 'Wetness Scale' is a number from 0 to 10.  0 is a desert.  10 is a
    tropical rain forest.  5 is the default value.
    Leaving this optional parameter off uses defualt settings for weather.

#TEMPERATURE <winter low> <summer low> <daily change> <wetness scale>

Example #TEMPRATURE 0 80 20 4


*** Flags (optional)

    These flags count for the entire area.

#FLAGS <area flags>

example: #FLAGS AFLAG_NORECALL|AFLAG_NOTELEPORT|AFLAG_NORIP
example: #FLAGS AFLAG_NOCASTLE|AFLAG_NOGOHOME|AFLAG_NODEBUG

AFLAG_NODEBUG

    Use this flag if you have rooms that are non-standard.  Usually this
    flag is not necessary.
    A non-standard room is one where when you leave room A north to room B.
    Then you leave room B south.  While trying to get to A, you actually
    end up at room C.

AFLAG_NOTELEPORT

    This stops a player from teleporting or rifting into the area.

AFLAG_NORECALL

    This stops a player from being able to use the recall spell in the area.

AFLAG_NORIP

    This stops a player from being able to cast the rip spell in the area.

AFLAG_NOCASTLE

    This stops a player from being able to build a castle in the area.

AFLAG_NOGOHOME

    This stops a player from being able to use the gohome command in the area.


4.2  The #HELPS section

    This section allows the addition of new help listings.
    Entire help menus may be created.

    Begin this section with:

#HELPS

    End this section with:

0 $~

***  Help Archetype

<level> <name list>~
<text of help and special menu pointers>
~

example:

5 SWORD CUTLASS "LONG SWORD"~
{300}
  The sword is a very strong weapon
  But you may find stronger ones.

  {120}(A) {050}Information on Knives
  {120}(B) {050}Information on Spoons

  {120}(-) {050}Return
{a}knife
{b}spoon
{-}cuttlery
~
*** Level

    This is the level the player must be to be able to read this help.
    Use 0 if you wish everyone to read it.

*** Name List

    This field is a list of keywords that will reference the help text.
    These may be odd encoded numbers for menu use only, or simple ones
    that the player may enter help on directly.
    This field should be in all capital letters.
    Use " " to cluster multiple words for a search string.

*** Body

    The body has several special encoded features.
    The first is that all initial spaces and returns are removed unless
    the body start with a '.' a color code works just as well though.

*** Menus

    The menu stucture shown above has two sections.  The first section, where
    the options are surrounded by '(' and ')' is the display section.
    The display section is shown with the rest of the body text.
    The actual decoded menu section is a line that starts with '{'.
    Once a menu option is trapped, the following letter is the option
    that the user must pick, followed by '}'.
    The following letters are what the menu item will reference in the
    help system.
    These menu items may point to any other item in the help db.
    Please use only lower case letters for the menu system, since this
    feature is case sensitive, and most people select menus by lower case.


4.3  The #ROOMS section

    The #ROOMS section contains all the information necessary for the
    mud to make all the rooms of your area, link the exits together, and
    all the other little things concerned with the 'where's' of an area.
    The file simply consists of all the rooms in sequential order by their
    virtual number.  Here is a sample room for this section's example:

    This section in the .are file will always start first with this line:

#ROOMS

    This section in the .are file will always end with with this line:

#0

*** ROOM ARCHETYPE

(the <'s and >'s are used to offset values, and should be ignored)


<#vnum>
<room name>~
<room description>~
<area number> <room flags> <sector type>

F <vnum to fall to> <slope of cliff> <amount of feet>

E
<extra name list>~
<extra description>~

D<exit direction>
<exit description>~
<door name>~
<door flags> <key number> <vnum of connect room>

S

---example follows this line---

#QQ00
The First Room~
You are standing in the first room of this area.  Many rooms are sure to
follow, soon to be chock-filled with adventure, danger, romance, and Giant
Green Photosynthetic Death Gerbils from Morovia.
There is a sign hanging from the east wall here, and a large steel grate bars
the way to the north.
~
QQ ROOM_INDOORS|ROOM_NO_MOB SECT_INSIDE
DDIR_NORTH
You spot the Second Room to the north, behind a large steel grate.~
grate steel~
1 QQ00 QQ01
E
sign~
The sign says:

        WELCOME TO THE FIRST ROOM!
~
S

---example precedes this line---


  Now to explain what each part means, line by line:

#QQ00

  The virtual number of this room:
  Totally unique, no other room in the db will have this number after the
  adminstrators assign a value for the QQ.

The First Room~

  room name:
  the 'title' of the room.  This is typically not more than 5-6 words long.
  Note the tilde marking the end of this field.

You are standing .. the way to the north.
~
  room description:
  This is what a player sees if he or she types 'look' in that room.
  What is in this section is up to your own, personal taste.
  More about the various description types can be found below.
  Note the tilde marking the end of this field.

  Advise:
  Try to describe the room without telling the one reading it how they feel.
  Imagine yourself playing a vampire who according to the area creator:

  You feel shivers running down your spine as you see blood dripping down the
  wall.
  -or the other way around-
  You start to drool as you see delicous sparkling red blood dripping down
  the wall.

  Another advise would be not to describe the area as if the person walks
  through it from room A to Z, Venturing through some areas from room Z to A
  one gets the feeling they're walking backwards. as in:
  Before you leads a hallway northwards (while you just came in from the north)


QQ ROOM_INDOORS SECT_INSIDE

  The first number is the zone number of this room; what zone should
  the mud consider this room to be in for game purposes.  Please see
  'zone numbers' in section 3 of this handbook.

  The second number is the room flag value.  Please see 'flags' in
  section 3 of this handbook, and Room Flags below.

  The Third number is the sector type.  Please see 'sector types' below.

  Be aware the mud translates these flags to bitvectors, emud prefers
  their builders to use these flags instead of numbers. You can however
  use numbers, since it only takes a couple of seconds to convert them
  to flags with the proper tool.

DDIR_NORTH

  An exit to direction north.  The section on 'Exits' below will
  shed more light on this subject.

You spot the Second Room ...

  Exit description:
  What a player would see if they typed 'look north'.
  Note the tilde marking the end of this field.

grate steel~

  door name:
  What words can be used to manipulate the door.  These two words can be
  used in conjunction with open, close, pick, and look commands, etc.


1 QQ00 QQ01

  The first number is the door flag, 1 being: is_door
  This and the other numbers will be explained more fully under 'Exits' below.

  The second number is the key number. the virtual number of the object that
  can be used to lock or unlock this door.

  The third number is the vnum of what room this exit leads to.


E
  Tells the mud there is an extra description coming.

sign~

  extra name list:
  The words that can be used to look at the extra description.
  (i.e. 'look sign')  Note the tilde ending the field.

The sign says:...

  The text of the extra description.  Again, note the placement of the tilde.


S

  End-of-Room character.


Now, for more explanations...

*** DESCRIPTIONS

Descriptions are fairly self explanatory.

- Short Descriptions
  These are the short descriptions a player can see.
  They should be kept to half a line long.

  The short description of a room is mostly called: room name


- Descriptions
  These are the multi-line descriptions of rooms. When creating a description
  keep in mind to keep each line under 80 characters unless you use color
  codes. Clues to the Extra Descriptions should be included in the room
  description, if not elsewhere.


- Extra Descriptions

  An extra description, of which there can be many for each room, is
  something else specific to look at, not normally seen just by typing
  look, or entering the room.  An extra desc is started by an
  E  (a seperate E for each extra desc in the room),
  followed by the keywords that can be used to look at this description on
  the next line, each separated by a space, followed by a tilde.
  Then, the description itself, followed by a tilde.

E
keywords~
You spot the keywords.  They look important!
~


*** ROOM FLAGS

Please consult the section on flags in section 3 for how bitvectors are added
and used.  Briefly, add each flag that you want for a particular room.
Seperate them with the | (pipe) symbol.

ROOM_DARK                1
ROOM_SMOKE               2
ROOM_NO_MOB              4   wandering mobiles can't enter the room
ROOM_INDOORS             8
ROOM_NO_GOHOME          32
ROOM_BANK              256
ROOM_PRIVATE           512   only two players at a time
ROOM_SAFE             1024
ROOM_SOLITARY         2048   only one player at a time
ROOM_PET_SHOP         4096   place to buy pets
ROOM_NO_RECALL        8192
ROOM_BLOCK           32768   room blocked from entrance
ROOM_NO_SAVE         65536
ROOM_MORGUE         131072   in this room are PC corpses sold
ROOM_ALTAR_N       1572864   able to set death room
ROOM_ALLOW_WAR     2097152
ROOM_ALLOW_GLA     4194304
ROOM_ALLOW_MAR     6291456
ROOM_ALLOW_NIN     8388608
ROOM_ALLOW_DRU    10485760
ROOM_ALLOW_SOR    12582912
ROOM_ALLOW_SHA    14680064
ROOM_NOTE_BOARD  134217728
ROOM_NO_CASTLE   268435456
ROOM_NO_RIP      536870912
ROOM_ALLOW_WLC  1073741824

These are complete for Emud v2.2.


*** SECTOR TYPES

The 'sector type' of a room controls how many movement points it costs to
enter that room.  This is not a flag type item: choose one, and use the
value...

SECT_INSIDE                   0
SECT_CITY                     1
SECT_FIELD                    2    (allows castles to be build)
SECT_FOREST                   3    (allows castles to be build)
SECT_HILLS                    4    (allows castles to be build)
SECT_MOUNTAIN                 5    (allows castles to be build)
SECT_WATER_SWIM               6
SECT_WATER_NOSWIM             7    (Requires a boat)
SECT_UNUSED                   8
SECT_AIR                      9    (Requires fly spell)
SECT_DESERT                  10
SECT_LAVA                    11    (Requires Fire breath spell)
SECT_INN                     12    (Heals the player while not on the game)
SECT_ETHEREAL                13    (Requires Ethereal Travel spell)
SECT_ASTRAL                  14    (Requires Astral Projection spell)
SECT_UNDERWATER              15    (Requires Breath water spell)
SECT_LEY_LINES               16    (Something undefined...)

*** EXITS

Exits use the letter D and a number, compass, rather than the letter
abbreviations that most mudders are used to for compass directions.
Hence:
      (north)
         0                            4 (up)
         |                          /
(west) 3-+-1 (east)               +
         |                      /
         2                    5 (down)
      (south)

DIR_NORTH                     0
DIR_EAST                      1
DIR_SOUTH                     2
DIR_WEST                      3
DIR_UP                        4
DIR_DOWN                      5

Most muds use: D4 but DDIR_UP to make an upward direction works too for
emud.  Each exit starts with its own direction field, and contains an
exit description and door keyword list, (both of which can be left blank
with a tilde), and a fourth line containing a door type, key number,
and exit-to-room number.  Rooms without exits need no direction fields
and the etc...this section may be safely ignored.

The exit description is used for when a player types look <direction>.
This should in most cases be a vague description of what the next room
might be, and is followed by a tilde on a line by itself.  Each exit
starts with its own direction field, and contains a door keyword list
and The next field is the door keyword list, used for manipulative
door actions, such as open, close, pick, etc.  These words are
separated by a space, and are followed by a tilde on the same line.

The door type can be the following values:

                 0   Standard hallway without door
EX_ISDOOR        1
EX_CLOSED        2
EX_LOCKED        4   Does not necessarily require a key */
EX_HIDDEN        8   cannot be seen without detect hidden
EX_PICKPROOF    32   only greater pick will open door
EX_BASHPROOF    64   cannot be bashed open
EX_MAGIC_PROOF 128   cannot be dissolved with unbarring ways

The key number is simply the vnum of the key that can open the door.
A door without a keyhole is represented by a -1 in this spot.

The exit-to-room number is the vnum of the room where the exit leads to.
Use the QQ system here.  If the room connects to an outside room leave a
ZZZZ here, with an extra description of where the room should connect.
Try to make geographical correct outside connections.

Please note that adding a description for the door itself is usually done
under the 'extra descriptions' part of the room db.


*** Falls  -  For Air and Cliffs

    Rooms that characters may fall from have a section designated with the
    letter 'F'.  This is followed by the room that they fall into, and the
    distance of the fall.

F <room to fall into> <slope of cliff> <distance of fall in feet>

    This modifier for a room takes into play the skill of CLIMB and flying.
    The only special case is where the sector type is SECT_AIR.  This special
    case will check to see if the character is flying, or immediately damage
    them.  All other sector types are considered cliffs, and will check both
    dexterity and the climb skill.  Flying does not affect any aspect of the
    non-air types of sectors, with the assumption that.. dunno..

    it's a weird world we mud in :)


    The Marauder class has the climb ability that greatly increases the chance
    of safety for players in a cliff modified room.  The only other modifier is
    dexterity.  The longer a player stays on a cliff, the higher the likelyhood
    that they will fall.  The slope of a cliff is defined as 0 for a slight
    incline, to 10 for a vertical cliff face.  This number is ignored for
    SECT_AIR.  When a player falls, two things happen.  They are damaged by the
    amount defined by an equation based on how many feet the fall was.  And
    they are transfered to the room pointed to by the "room to fall into"
    field.

    An area creator can use this to make a dangerous section for players to
    cross, such as a path up a mountain.  This gives them a chance to fall back
    down the path.  The SECT_AIR is quite dangerous, in that losing fly causes
    an instant fall.  A trick that can be used to simulate a rocky terrain is
    to have a fall of a few feet, and make the fall room point to itself.

    Be aware that more creative tumbles can be created with a mobile program.


*** TIPS and OBSERVATIONS

    Make a master plan before you start building, that might prevent having to
    delete or rewrite several parts of your area.

    For a working door, the rooms on each side must have matching doors
    and doorflags.  Also the #RESETS section must have the associated close
    door command to close, lock, or reopen the door every repop.



5. The #MOBILES section

The #MOBILES section contains everything the mud needs to know about the mobs,
except for where they are and what they're holding.  Each mob in the file is
in sequential vnum order.

Mobiles may also contain some form of mob_prog.  These programs make the
mobile appear more life-like, and can be used to set up puzzles or quests.
Mob_progs allowing a quest are a "must" for every emud area. Mob_progs are
described later in this text.

This section in the .are file will always start first with this line:
#MOBILES

This section in the .are file will always end with with this line:
#0

*** ARCHETYPE MOB (simple)

<#vnum>
<name list>~
<short description>~
<long description>~
<description>~
<actions>
<affects>
<alignment> S
<level> <body part> <attack part> <hitpoints ?d?+?> <damage ?d?+?>
<gold> <race>
<loaded position> <default position> <sex>
[mob program]

Here's a sample mob:


---example follows this line---
#QQ00
mob example~
the Example Mob~
An example mob stands here, completely clueless.~
The example mob looks indistinct, as if it hasn't been completely fleshed
out yet.
~
131072|194|65536 8 100 S
1 4 16|8 1d6+2 1d4+0
10 2
7 7 0
---example precedes this line---

The following is the same example with the ascii version of the flags.

---example follows this line---
#QQ00
mob example~
the Example Mob~
An example mob stands here, completely clueless.~
The example mob looks indistinct, as if it hasn't been completely fleshed
out yet.
~
ACT_RACE|ACT_WIMPY|ACT_SCAVENGER|ACT_BODY
AFF_DETECT_INVIS 100 S
1 BODY_EYE BODY_TORSO|BODY_HIP 1d6+2 1d4+0
10 RACE_ELF
POS_STANDING POS_STANDING SEX_NEUTRAL
---example precedes this line---

  Now, to explain, line-by-line:

#QQ00

  The vnum of the mob.  Read the section on Virtual Numbers in part 3 of
  this document for more information.

mob example~

  The namelist of this mob: what words can be used to interact with this mob.
  For instance, 'kill mob' or 'kill example' would both be valid for this mob.
  Note the tilde following the field.

the Example Mob~

  The short desc of the mob.  Used in messages such as:
  "You poke the Example Mob."
  "the Example Mob pounds you!"

  This is the last time we'll note the tilde following the description.

An example mob stands...
~

  The long desc of the mob.  Used as part of a room description when a player
  enters or looks in a room.

The example mobs looks...
~

  This is the description of the mob; what a player sees when typing:
  'look' at the mob.

194 8 100 S

  The first number is the ACTION flag of the mob, which tell the mud how the
  mob should act.

  The second number is the AFFECTION flag, which tells the mud about any
  special abilities the mob might have.  Both these flag values work as per
  the section 'FLAGS' in part 3 of this handbook.
  See 'ACTION & AFFECTION FLAGS' below for more on both of these.

  The third number is the alignment of the mob, ranging from 1000 (good) to
  -1000 (evil).

  The 'S' stands for simple mob.  This feature is not used in Emud,
  and is left there as a placeholder.  Always use an 'S' here.
  This feature is used for backward compatibility.

1 20 10 1d6+2 1d4+0

  Field one is the mob's level.

  The second field is the body parts that can fall off when the mob dies.

  The third field is the body parts that attack.

  Field four is the mobs hit points.  There is more on Hitpoints and damage
  below in the aptly named 'HITPOINTS and DAMAGE'.

  The fifth field is how much damage a mob does with its bare hands.

10 2

  The first number is how much gold pieces this mob is carrying.

  The second field was used for exp on DIKU and Merc games, we ignore
  exp in files, and allow this field to define the race of the mobile
  if the action flags include ACT_RACE.

7 7 0

  The first and second number are the mob's loading and default position,
  respectively.  There is a section below: 'POSITIONS' that will explain
  more.

  The final number is the mob's gender; 0 is neuter, 1 is male, 2 is female.



*** DESCRIPTIONS

    Descriptions are done much the same way as those in the section in 'Rooms',
    earlier in this handbook.  The reader is encouraged to go back and reread
    that section if necessary.  However, the placement of tilde's is still very
    important.

- Name list~          name of the mobile

- Short description~  shown when interacting with the mobile

- Long description~   shown when typing 'look' in the room the mob stands.

- Description~        shown when you look at the mobile.



*** ACTION & AFFECTION FLAGS

    Action flags tell the mud how a mob behaves, and affection flags control
    the special qualities of a mob.  These flags are added together as
    described in 'FLAGS', in part 3 of this handbook.

    Remeber that the flags can be referenced as the flag name itself.  Below
    is a listing of flags for each type, with descriptions of what each does:

Action Flags

ACT_SENTINEL         2   Stays in one room
ACT_SCAVENGER        4   Picks up objects
ACT_DRUNK            8   Talks drunk
ACT_AGGRESSIVE      32   Attacks PC's
ACT_WIMPY          128   Flees when hurt
ACT_TRAIN          512   Can train PC's
ACT_PRACTICE      1024   Can practice PC's
ACT_WEAK          2048   Cannot carry anything
ACT_SMART         4096   Can say, normal can't
ACT_ONE_FIGHT     8192   Disapears after fight.
ACT_NO_ORDER     16384   Cannot be ordered.
ACT_BODY         65536   Allows body parts to function.
ACT_RACE        131072   Allows race to be defined.
ACT_UNDEAD      262144   Does not create corpse on death.



Affection Flags

AFF_INVISIBLE            2  The mobile is invisible.
AFF_DETECT_INVIS         8  The mobile can see invisible players.
AFF_SANCTUARY          128  The mobile is affected by the spell sanctuary.
AFF_FAERIE_FIRE        256  The mobile is affected by the spell faeire fire.
AFF_UNDERSTAND        2048  The mobile can understand anyone.
AFF_SNEAK            32768  The mobile is sneaking, players to not see it move.
AFF_HIDE             65536  The mobile is hiding.
AFF_FLYING          524288  The mobile is flying always.
AFF_PASS_DOOR      1048576  The mobile can walk through locked doors.
AFF_STEALTH        2097152  The mobile can hide and sneak continually.
AFF_CLEAR          4194304  The mobile can walk through thick vegetation.
AFF_HUNT           8388608  The mobile chases fleeing characters, if possible.
AFF_TONGUES       16777216  Allows the mobiles to speak all languages.
AFF_ETHEREAL      33554432  Makes the mobile absolutely invisible to system


*** Note:
    Please remember not to use any combination of values that will
    select a bit outside of those shown.  Although combining valid
    bits are allowed.


*** Simple/Complex

    The 'S' at the end of the affects field is a placeholder that is
    ignored by Emud.  It should always be an 'S'.  Originally it was to
    select Simple or Complex mobiles in Diku muds.  It is here to support
    backward compatibility.


*** BODY PARTS

    This field was used by Thac0 on Merc and Diku muds, but is ignored
    on Emud.  Therefore it can be used by a different value.  But you must
    give a flag to tell Emud that this is a valid field.  This flag is
    ACT_BODY, and should obviously go in the Action Flags field.  If the
    ACT_BODY flag is not set, then body parts will be ignored.

    We advise selecting one or two body parts on all mobiles.

    Body parts are the parts that can be chopped off when the mobile dies.
    They will not show up elsewhere except in attack parts.  Body parts
    might give a slightly different version than attack parts, as in
    BODY_MOUTH, which is a jaw bone in body parts, and a bite in attack
    parts.  Any combination of body parts may be used, and it does not
    necessarily have to match the attack parts.  Only one is selected when
    the body part is chopped off with a 25% chance that the body part will
    even fall off.  It is not suggested to select two arms, as this will
    cause an error, only one is required.

    Below are the flags and spams for body parts listed.

BODY_HEAD       $n's head slowly falls off.
BODY_MOUTH      $n's jaw drops to the floor.
BODY_EYE        $n's eyeball pops out.
BODY_TORSO      $n is broken into pieces.
BODY_HIP        $n falls to pieces.
BODY_LEG        $n kicks $s leg off.
BODY_ARM        $n's arm seems to have been unattached.
BODY_WING       $n is flying nowhere.
BODY_TAIL       $n can no longer wag $s tail.
BODY_TENTICLE   $n's tenticle gushes bloody.
BODY_HORN       $n's horn bumps you as it falls to the floor.
BODY_CLAW       The claw of $n gets clipped.
BODY_HAND       $n gives you the finger, right before losing $s hand.
BODY_FOOT       $n stumbles, as $s foot falls off.



***  ATTACK PARTS

    This field was originally AC on Diku and Merc muds.  This field is
    normally ignored on Emud, but with the ACT_BODY flag selected, the
    field becomes the attack parts of the mobile.  Attack parts is how
    the mobile attacks.  The different kinds of attacks from various body
    parts do not affect damage, as it only changes what is printed when the
    attack takes place.  This feature is required, but is there to give
    the mobiles the correct forms of bare-hand attacks.
    Attack parts use the same field values as that of the body parts.
    Mobiles with weapons will always override the different kinds of
    body attacks.

    Note:  AC, or Armor Class is computed by the game itself, and is
    dependant on the level of the mobile.  If the mobile is should
    normally be wearing armor, the armor will add 2/3 of it's normal
    AC bonus.  If the mobile is not weaing armor, and is normally
    supposed to be wearing armor, then the AC of the mobile is
    1/3 of the value of the armor less than the normal AC for a
    mobile of the same level.

Below are the flags and spams for attack parts listed.

BODY_HEAD       head butt
BODY_MOUTH      bite
BODY_EYE        evil-eye
BODY_TORSO      shoulder slam
BODY_HIP        hip slam
BODY_LEG        knee
BODY_ARM        elbow slam
BODY_WING       flap
BODY_TAIL       tail slap
BODY_TENTICLE   tenticle whip
BODY_HORN       horn jab
BODY_CLAW       claw
BODY_HAND       punch
BODY_FOOT       kick



*** HITPOINTS and DAMAGE

    The functions of hitpoints and damage are arrayed randomly by the
    mud, as a function of imaginary dice and bonuses.  These always
    follow the form xdy+z, where x is the imaginary amount of dice, y is
    how many sides these dice have, and z is a constant being added to the
    final total.

    For example, our example mob had hitpoints of 1d6+2: a random
    number between 1 and 6, then add 2, for a range of 3-8.  Another mob
    might have 10d10+150 for a range of 160-250.  Damage is calculated the
    same way.

    These fields must follow the form xdy+z, even if z equals 0!
    For instance, our example mob does 1d4+0 damage with its bare hands...
    Leaving any of these fields blank will cause errors for the load
    procedure.

    One more important thing to know about damage: this is the
    mob's damage with its fists/claws/what-have-you.  If the mobile is
    wielding a weapon, the mobile will do it's basic damage plus one-half
    of the damage of the weapon wielded.

Standards and Measures

    These are the suggested strengths of mobs.


    level 60 mobs or lower :

    minimum hitpoints : 10 + level * level * 0.5
    maximum hitpoints : 20 + level * level * 1.5

    minimum damage    :  2 + level * 0.5
    maximum damage    :  5 + level * 3.0


    level 61 mobs and higher :

    minimum hitpoints : level * level * 0.7
    maximum hitpoints : level * level * 1.5

    minimum damage    : level * 0.7
    maximum damage    : level * 3.00

These values are checked with the areacheck tool by the emud admins.


*** GOLD

   This is simply the amount of gold that the mobile is carrying when it
   is loaded.  All mobiles can carry some amount of gold.

   maximum gold       : level*1500


*** RACE

    This field was previously used for exp for the mobile, but Emud calculates
    exp based on the level of the mobile.  This leaves the field open for more
    important things:  Race.  The creator must define the ACT_RACE bit in the
    action flags, and then use one of the RACE_ types in this field.  This will
    fix the mobile as to what language it speaks and understands.  It will also
    allow mobprogs to be used based on race.  You must pick a race which is one
    of the basic 29, even if the mobile should be something outside of those
    defined.  Just pick the closest one.


*** POSITION

    A mob always has two position numbers: its loading position,
    and its default position.  A mob will be loaded into its loading
    position initially, and after fighting, will return to its default
    position.  Note that these do not have to be the same, but usually
    are.

    The valid positions are:

POS_SLEEPING  4
POS_RESTING   5
POS_FIGHTING  6
POS_STANDING  7

    There are a few more positions than these, but are not used
    except during fighting, which the mud takes care of automatically.

*** GENDER

    This is the sex of the mobile, and has only three possible values:

SEX_NEUTRAL      0
SEX_MALE         1
SEX_FEMALE       2


*** TIPS and OBSERVATIONS

    Mobs wander around by default.  Remember to include the 'Sentinel'
    Action flag for stationary mobs!

    Freak mobs can be simulated by loading them sitting and agressive,
    with a default position of standing.  After being attacked, they will
    wander around instead of sitting back down!  Other interesting things
    can be done with the position values as well...

    Don't forget to add the 'smart' Action flag if you want your mob to
    talk. Neither add 'smart' to all mobs, unless you want a boar to
    shout for revenge when it tries to get back at an attacker.



6.  The #OBJECTS section

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 #OBJECTS section,
except for where they actually are.

This section in the .are file will always start first with this line:
#OBJECTS

This section in the .are file will always end with with this line:
#0


*** OBJECT ARCHETYPE

<#vnum>
<name list>~
<short description>~
<long description>~
<description>~
<item type>
<item flags>
<wear locations>
<value0> <value1> <value2> <value3>
<weight> <cost> <level>
[obj program]

E
<extra name list>~
<extra description>~

A <apply type> <apply amount>
The night has begun.

C
<attack message>~
<classes that may use weapon>


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

---example follows this line---
#QQ00
sword example~
an example sword~
An example sword lies on the ground, examping.~
It looks very shiny and polished, as if someone is taking care to try to
make a good example.
~
5
64|16384 8193
0 3 1 10
5 1000 10
E
example~
This is a rather boring example.
~
A 1 1

C
slash~
1
---example precedes this line---

The following is the same object using the ascii flags system:
---example follows this line---
#QQ00
sword example~
an example sword~
An example sword lies on the ground, examping.~
It looks very shiny and polished, as if someone
is taking care to try to make a good example.
~
ITEM_TYPE_WEAPON
ITEM_FLAG_MAGIC|ITEM_FLAG_LEVEL
ITEM_WEAR_WIELD|ITEM_WEAR_WIELD
0 3 1 10
5 1000 10
E
example~
This is a rather boring example.
~
A APPLY_STR 1

C
slash~
FLAG_CLASS_WARRIOR
---example precedes this line---

    Note:
    In the file, and amount of spaces or returns can separate different
    fields, so the extra return and spacing in the above example is valid.


*** Field by Field Breakdown

    The following is a list of each of the fields of the Object format.


*** Vnum

#QQ00

    This is identical to the method of the mobile vnum.
    This number may be the same as a room or mobile, but no other
    object may have this number.
    See the section on virtual numbers in Part 3 of this Handbook.


*** Name list

sword example~

    The 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.
    This field requires a '~' or tilde at the end of the line.

    For use with mob_progs and obj_progs all names are appended
    with a special name starting with 'I' and followed by the
    vnum of the object.  This is used to specifically point to
    a particular key, if the player has several keys.
    ex:   item vnum is 9775,   added keyword is 'I9775'


*** Short description

an example sword~

    This is seen when the object is the target of a command:
    'You wield an example sword.'  'You give an example sword to...'.


*** Long description

An example sword lies on the ground, examping.
~

    This is what a player sees if the object is lying in a room by itself.


*** Description

It looks very shiny and polished, as if someone
is taking care to try to make a good example.
~

    In Emud, this field is used as the default "look" at the item,
    for example, if you did "look sword" while holding this item.
    Diku used this field for an action, and Merc ignored it.


*** Object Type

5
    This number is what type of object this is...a weapon.  See
    'OBJECT TYPES' below.


*** OBJECT TYPES

ITEM_TYPE_LIGHT               1
ITEM_TYPE_SCROLL              2
ITEM_TYPE_WAND                3
ITEM_TYPE_STAFF               4
ITEM_TYPE_WEAPON              5
ITEM_TYPE_TREASURE            8
ITEM_TYPE_ARMOR               9
ITEM_TYPE_POTION             10
ITEM_TYPE_FURNITURE          12
ITEM_TYPE_TRASH              13
ITEM_TYPE_CONTAINER          15
ITEM_TYPE_DRINK_CON          17
ITEM_TYPE_KEY                18
ITEM_TYPE_FOOD               19
ITEM_TYPE_MONEY              20
ITEM_TYPE_BOAT               22
ITEM_TYPE_FOUNTAIN           25
ITEM_TYPE_PILL               26
ITEM_TYPE_AMMO               30

*** Object Flags

64|16384

    This determines what is affecting the object.  Also note the
    ITEM_FLAG_LEVEL is required on Emud.  This is a flag that lets
    the field of the level work.  If this flag is not set, the level
    field is ignored, and item level might be calculated incorrect.


*** OBJECT FLAGS

ITEM_FLAG_GLOW                1
ITEM_FLAG_HUM                 2
ITEM_FLAG_DARK                4
ITEM_FLAG_LOCK                8
ITEM_FLAG_EVIL               16
ITEM_FLAG_INVIS              32
ITEM_FLAG_MAGIC              64  /* Auto set if any affects exist */
ITEM_FLAG_NODROP            128
ITEM_FLAG_ANTI_GOOD         512
ITEM_FLAG_ANTI_EVIL        1024
ITEM_FLAG_ANTI_NEUTRAL     2048
ITEM_FLAG_NOREMOVE         4096
ITEM_FLAG_INVENTORY        8192
ITEM_FLAG_LEVEL           16384  /* Absolutely required on Emud */
ITEM_FLAG_AUTO_ENGRAVE    65536  /* This item is engraved to first to get */


*** Wear Flags
8193

    This flag tells the mud where the item can be worn on a player
    or mob.  An object may be flagged to be worn is several places,
    such as a band that can go around the wrist and the waist.

*** WEAR FLAGS

ITEM_WEAR_TAKE                1  /* Required for the player to get object */
ITEM_WEAR_FINGER              2
ITEM_WEAR_NECK                4
ITEM_WEAR_BODY                8
ITEM_WEAR_HEAD               16
ITEM_WEAR_LEGS               32
ITEM_WEAR_FEET               64
ITEM_WEAR_HANDS             128
ITEM_WEAR_ARMS              256
ITEM_WEAR_SHIELD            512
ITEM_WEAR_ABOUT            1024
ITEM_WEAR_WAIST            2048
ITEM_WEAR_WRIST            4096
ITEM_WEAR_WIELD            8192
ITEM_WEAR_HOLD            16384

*** Object Values

0 3 1 10

    These are the object's values.  What each number means is completely
    dependant on what Type of object it is.

*** 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 dikudocs.
    Credits to the original authors, and no disrespect intended.

ITEM_LIGHT (1)
Value[0]: Not Used
Value[1]: Not Used
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.  Eternal lights should not be easily obtained.
Value[3]: Not Used

ITEM_SCROLL (2)
Value[0]: Level of the spell on the scroll.
Value[1]: Which spell (see list in spells.txt)
Value[2]: Which spell
Value[3]: Which spell
          The values(1-3) are three (or less) different spells, mixed 'on'
          the scroll.  Unused spells should be set to -1.

ITEM_WAND (3)
Value[0]: Level of spell in wand.
Value[1]: Max Charges
Value[2]: Charges Left
Value[3]: Which spell in wand (see list in spells.txt)

ITEM_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 list in spells.txt)

ITEM_WEAPON (5)
Value[0]: Type of ammo shot by the weapon (0 if not a range weapon)
Value[1]: Number of dice to roll for damage (keep this number low)
Value[2]: Size of dice to roll for damage
Value[3]: The weapon type. Type is one of:

          NAME          NUMBER CATEGORY   Message type
          --------------------------------------------------------------------
          WEAPON_SLICE     1  : Slice      Slice
          WEAPON_STAB      2  : Stab       Stab   (throw, backstab)
          WEAPON_SLASH     3  : Slash      Slash
          WEAPON_WHIP      4  : Whip       Whip
          WEAPON_CLAW      5  : Claw       Claw
          WEAPON_BLAST     6  : Blast      Blast
          WEAPON_POUND     7  : Pound      Pound  (throw)
          WEAPON_CRUSH     8  : Crush      Crush  (throw)
          WEAPON_GREP      9  : Grep       Grep
          WEAPON_BITE     10  : Bite       Bite
          WEAPON_PIERCE   11  : Pierce     Pierce (throw, backstab)

          To make a ranged weapon, you must also create ammo for it.
          A ranged weapon is defined by including the vnum of the ammo
          in Value[0] of the weapon.  If a '0' is used here, it is not
          a shooting weapon.

ITEM_TREASURE (8)
Value[0]: -
Value[1]: -
Value[2]: -
Value[3]: -

ITEM_ARMOR (9)
Value[0]: The effective AC. >0 enhances the AC. <0 reduces AC.
Value[1]: -
Value[2]: -
Value[3]: -

ITEM_POTION (10)
Value[0]: Level of the spell in the potion.
Value[1]: Which spell (Listed in spells.txt)
Value[2]: Which spell
Value[3]: Which spell
          Unused spells should be set to -1.

          Eg.
          Value 0 : 30  (Level)
          Value 1 : 27  (Harm)
          Value 2 : 17  (Curse)
          Value 3 : -1  (no-spell)

ITEM_FURNITURE (12)
Value[0]: -
Value[1]: -
Value[2]: -
Value[3]: -

ITEM_TRASH (13)
Value[0]: -
Value[1]: -
Value[2]: -
Value[3]: -

ITEM_CONTAINER (15)
Value[0]: Maximum weight the container can contain.
Value[1]: Container flags:
          CONT_CLOSEABLE     1
          CONT_PICKPROOF     2
          CONT_CLOSED        4
          CONT_LOCKED        8
Value[2]: The item-number of the object which can open the object. -1 means
          no lockability.
Value[3]: -

ITEM_DRINKCON (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:

          NAME          NUMBER    DRUNKNESS   FULLNESS     THIRST
          --------------------------------------------------------------------
          LIQ_WATER        0          0           0         10
          LIQ_BEER         1          2           0          5
          LIQ_WINE         2          5           0          5
          LIQ_ALE          3          2           1          5
          LIQ_DARKALE      4          1           1          5
          LIQ_WHISKY       5          6           0          3
          LIQ_LEMONADE     6          0           0          8
          LIQ_FIREBRT      7         10           0          0
          LIQ_LOCALSPC     8          3           0          3
          LIQ_SLIME        9          0           1         -6
          LIQ_MILK        10          0           2          6
          LIQ_TEA         11          0           0          6
          LIQ_COFFE       12          0           0          6
          LIQ_BLOOD       13          0           3         -1
          LIQ_SALTWATER   14          0           0         -3
          LIQ_COKE        15          0           0          6

          The above values for drunkness/fullness/thirst are used per
          four "units" drunk. The values are expressed in HOURS!

          Example:
          Dragon drinks 7 times milk
          His Drunkness is not changed: (7*0) hours
          His Fullness increases by:    (7*2) hours
          His Thirst increases by:      (7*6) hours

          The hours above are numbers between 0 and 24. 24 hours is
          maximum for drunkness/fullness/thirst. When hours are zero
          for any drunkness/fullness/thirst the person will be
          sober, hungry, or thirsty respectively.

Value[3]: if this value is non-zero, then the drink is poisoned.
          NOT_POISONED  0
          POISONED      1

ITEM_KEY (18)
Value[0]: The key-type. This value must match the lock-type the door
          that the key can open (if the vnum of the key doesn't match
          the lock-type that is).
Value[1]: -
Value[2]: -
Value[3]: -

ITEM_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.
          NOT_POISONED  0
          POISONED      1

ITEM_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]: -

ITEM_FOUNTAIN (22)
Value[0]: -
Value[1]: -
Value[2]: -
Value[3]: -

ITEM_PILL (22)
Value[0]: Level of the spell in the potion.
Value[1]: Which spell (Listed in spells.txt)
Value[2]: Which spell
Value[3]: Which spell

ITEM_AMMO (22)
Value[0]: Ammunition type (matches Value[0] of weapon that will shoot it)
Value[1]: Damage          (amount of damage caused by the ammo when it hits)
Value[2]: Speed           (4/second, keep numbers high (20 for fast arrows))
Value[3]: Effective range (number between 1 and 5)

          To create a ranged weapon with ammo, the weapon must also be
          created.  This is done by adding the vnum of the ammo to Value[0]
          of the weapon.


*** Object Weight

5

    The weight of the object.


*** Value

1000

    The value of the object, in gold coins.


*** Level

10

    This is the level of the object.  It is only valid if the
    ITEM_FLAG_LEVEL flag is valid.  Emud requires this field to be
    used.  Level is calculated by the game otherwise, to support
    backward compatibily.

*** Extra Descriptions

E
sword example~
This is a rather boring example.
~

    This is an extra description, and behaves EXACTLY like the extra
    descriptions of rooms.  The reader is referred to Part 4 of this
    Handbook for more information.

*** APPLIES

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.

    An item apply is a particular effect the item has upon the
    holder/wielder/wearer's statistics.  There can be a maximum of three
    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 APPLY_STR   1
    A APPLY_HIT -10

    Below is a list of the different types of applies, and their values.

APPLY_NONE                    0
APPLY_STR                     1
APPLY_DEX                     2
APPLY_INT                     3
APPLY_WIS                     4
APPLY_CON                     5
APPLY_SEX                     6
APPLY_MANA                   12
APPLY_HIT                    13
APPLY_MOVE                   14
APPLY_AC                     17
APPLY_HITROLL                18
APPLY_DAMROLL                19
APPLY_SAVING_PARA            20
APPLY_SAVING_ROD             21
APPLY_SAVING_PETRI           22
APPLY_SAVING_BREATH          23
APPLY_SAVING_SPELL           24


*** Combat Usages

C
whack~
FLAG_CLASS_WARRIOR

    This is a system to change the default statement made when a weapon hits
    an opponent.  It also allows you to specifically define which classes can
    use the weapon, even if that class cannot normally wield the type of
    weapon defined by weapon type.  The creator should use the weapon type
    field (value 3) to set up weapons for backstabbing, shooting, throwing,
    etc.  All npc's can wield the item if any class is defined.
    Class selection method will default to the normal method if no classes
    are selected (Put a '0' in the field).

    The weapon defined in the example will 'whack' the opponent, and can be
    wielded by warriors.

    List of flags of classes

FLAG_CLASS_WARRIOR           1
FLAG_CLASS_GLADIATOR         2
FLAG_CLASS_MARAUDER          4
FLAG_CLASS_NINJA             8
FLAG_CLASS_DRUID            16
FLAG_CLASS_SORCERER         32
FLAG_CLASS_SHAMAN           64
FLAG_CLASS_WARLOCK         128

    Please note that FLAG_CLASS_ values are not the same as CLASS_ values



*** Object Programs

    Object programs are based on intercepting user commands, and substituting
    new ones with actions outside of normal game operation.  Several programs
    may be included on each object.  These programs, used in combination with
    mob_progs can lead to very complex systems of commands.  Object programs
    can also trigger off of basic time increments, damaging others, getting
    damaged, wearing or removing the object with the program.  They cannot
    trigger off of things that the player sees, or text on the screen.

    Trigger off things seen on the screen is limited to mob_progs, and will
    not be included in object programs, due to operational speed problems.

    Object programs start with a 'P' similar to object extra descriptions.
    Following the 'P' is a number describing the index value of the program,
    for branching operations to reference.

    An object will usually have a group of small 'programs' or execution units
    that do individual commands.  There is always a 'Trigger' that will start
    the program, and a 'response' that does some form of action.  The trigger
    need not be related to the response.  This also means that the response
    does not know why it was triggered, and responses cannot be based on them.
    Ex: An object may not give back the same amount of hit points to the player
    if a damaged trigger was used, but it may give back some fixed amount,
    because it knows that the player was hit.

    In programs with the same index, execution of a command will start with
    the first one that gets triggered regardless of the index number.  But
    the system will then flow through to any subsequent program with the same
    index number.  This will allow the programs to do several routines on one
    trigger.

*** IMPORTANT:  Each program set must have a unique index number.

    Object programs basically follow the format of trigger followed by
    response.  Each type of obj_prog trigger has a special format:

    Normal command intercept:

P <reference number>
TRIGGER <percentage> <game command>
{responses}

    Percentage is the chance that the command will be intercepted.
    Game command is the command you wish to intercept.


    TRIG_UNKNOWN

P <reference number>
TRIG_UNKNOWN <percentage> <unknown command>
{responses}

    Unknown command is either a social command, or something new that would
    not be a normal command, such as "polish" or "brush".


    TRIG_VOID

P <reference number>
TRIG_VOID
{responses}

    This is generally used as the end effect of a branching response.


    TRIG_TICK

P <reference number>
TRIG_TICK <percentage>
{responses}

    This is triggered once every 4 seconds of real time.  It can be used to make
    the player do things they did not intend to do.  Or occasionally modify
    stats, or any other time based reaction.


    TRIG_HIT

P <reference number>
TRIG_HIT <percentage>
{responses}

    This trigger is called every time the player with the object is hit in a
    non magical way.  This can be used to make objects that heal the player
    every time they are hit, or objects that scream whenever they are damaged.



    TRIG_DAMAGE

P <reference number>
TRIG_DAMAGE <percentage>
{responses}

    This is called every time a player damages another character, either a
    mobile, or player in a non magical way.  It can be used to create objects
    that say something or any other response to the damage given.


    TRIG_WEAR

    This is called everytime the object with the program is worn. It can be
    used to make a magical weapon greet its new owner.


    TRIG_REMOVE

    This is called everytime the object with the program is removed. It can
    be used to remove a disguise that was set upon wearing.


    TRIG_ROOM_COMMAND

    This is called everytime a player uses defined command in the room in
    which the object lies. You can use ethereal objects if needed, it's
    the result that counts.


    TRIG_ROOM_UNKNOWN

    This is called everytime a player uses defined keyword in the room in
    which the object lies.


    TRIG_SACRIFICE

    This is called when a player sacrifises the object with the program.


*** RESPONSES

    Each type of obj_prog response has a special format.  The only time a
    tilde is required is after a string is used.  Commands such as OPROG_APPLY
    should not have a tilde after them.


    OPROG_ECHO

P 1
TRIG_UNKNOWN 100 EXAMPLE
OPROG_ECHO
bla bla bla bla~

    These lines are given to the user only.  Be sure to include the tilde.


    OPROG_GOD_COMMAND

P 1
TRIG_UNKNOWN 100 EXAMPLE
OPROG_GOD_COMMAND
say Greetings&
smile self&
say the name is $I, Sir $I~

    These commands are given at the trust level of 98.  This means that the
    user is able to perform god commands for the duration of the object
    program.  Several commands may be used, and separated by the '&' symbol.

    The '$' allows you to print player related information:
    $i name of the player
    $I name and title of the player
    $m him her it  (based on player sex)
    $s his her its
    $e he  she it
    $o short description of the object

    Always use 'self' to refer to the player when the name doesn't need to
    be printed.

    All mobile program commands can be used.

    It should be noticed that objects can use quest bits to their fullest by
    allowing objects to read and write both the object's and the player's
    quest bits.

    Example:

OPROG_GOD_COMMAND
mpmset self long A small turtle named $ stands here.~

    This would set the description that others see when entering the
    room the player is in, very similar to the skill disguise.  To
    reset the string to normal game operation, use:

OPROG_GOD_COMMAND
mpmset self long null



    OPROG_GOD_ARGUMENT

P 1
TRIG_COMMAND 100 flee
OPROG_GOD_ARGUMENT
say beam me up scotty!&
mpecho {170}$I starts to fade and waves goodbye at $s friends.&
mpgoto ~

    This command allows the use of one command, but the inclusion of an
    argument.  This allows special commands like GOTO to let the user pick
    a destination.  It makes sure that the user cannot put any multi-line
    commands so they will be limited to the one command given.  This is used
    to give the player the full advantage of the god command.  Use this
    only under permission of the game administrators. $I will print the
    player's name and honorific, the $s prints his/her/its based on gender.
    Example of the above program executed by a player named Neophyte.

    Sword Master Neophyte says 'beam me up scotty!'
    Sword Master Neophyte starts to fade and waves goodbye at his friends.



    OPROG_APPLY <APPLY_TYPE> <AMOUNT>

P 1
TRIG_TICK 100
OPROG_APPLY OAPPLY_HIT 25

    This command is executed to change one of several stats of the player that
    has the current object.  These will only affect the current stats, and
    never the maximum, as most other object affects to.  It is allowed to
    make the amount either positive or negative.

    Apply types:

    OAPPLY_HIT       - Applies to current hit points.
    OAPPLY_MOVE      - Applies to current movement points.
    OAPPLY_MANA      - Applies to current mana points.
    OAPPLY_ALIGNMENT - Applies to current alignment.


    OPROG_JUNK

P 1
TRIG_HIT 100
OPROG_ECHO
Your shield shatters into a million pieces!~
P 1
TRIG_VOID
OPROG_JUNK

    This command will destoy the item that is executing the program.  This is
    the only bug free method unlike sacrifice, eat, or mpjunk


    OPROG_IF_HAS_OBJECT <VNUM> <TRUE DESTINATION> <FALSE DESTINATION>

P 1
TRIG_UNKNOWN 100 EXAMPLE
OPROG_IF_HAS_OBJECT 21 2 3
P 2
TRIG_VOID
OPROG_ECHO
I have the object with vnum: 21~
P 3
TRIG_VOID
OPROG_ECHO
I do not have the object with vnum: 21~

    This command will branch successfully if the player has the object in
    either inventory or equipment, but not in a container.
    In this case the P 2 will be jumped to if the if check is true.
    If the if check is false P 3 will be called.

    Do aknowledge you can only jump to a higher reference number.
    if a lower number is given than the if check itself the program will
    be aborted.


    OPROG_IF

    OPROG_IF <IF CHECK> <OPERATOR> <VALUE> <TRUE DEST.> <FALSE DEST.>

    Available IF CHECKS:

    OIF_WEAR_LOC           - wear location  (-1 if not worn)
    OIF_USER_CLASS         - user class
    OIF_USER_POSITION      - user position
    OIF_USER_GOLD          - user gold
    OIF_USER_ROOM_NUM      - user room number
    OIF_RANDOM_PERCENT     - random percent
    OIF_USER_WHICH_GOD     - user follows which god
    OIF_USER_ALIGNMENT     - user alignment
    OIF_USER_LEVEL         - user level
    OIF_USER_RACE          - user race
    OIF_USER_PERCENT_MOVE  - user move percent
    OIF_USER_PERCENT_HITPT - user hitpoints percent
    OIF_USER_PERCENT_MANA  - user mana percent
    OIF_USER_SEX           - user gender
    OIF_USER_AREA          - The first room number of user's area
    OIF_USER_SECTOR        - The sector type the user is in
    OIF_TIME_OF_DAY        - The hour of day in game time
    OIF_MCLASS_WARRIOR     - The amount of war levels
    OIF_MCLASS_GLADIATOR   - The amount of Gla levels
    OIF_MCLASS_MARAUDER    - The amount of Mar levels
    OIF_MCLASS_NINJA       - The amount of nin levels
    OIF_MCLASS_DRUID       - The amount of dru levels
    OIF_MCLASS_SORCERER    - The amount of sor levels
    OIF_MCLASS_SHAMAN      - The amount of sha levels
    OIF_MCLASS_WARLOCK     - The amount of wlc levels

    OIF_WEATHER            - ( 0 = Clear, 1 = Cloudy, 2 = Raining, 3 = Storm )

    OPERATOR

    <   - Less than
    >   - Greater than
    =   - Equal to
    !   - Not equal to

    VALUE

    The value is a number that the check variable is compared against.

    True destination is the obj_prog index (the one listed after the 'P')
    that the branch will continue when the if check is true.

    False destination is the obj_prog index that is executed when the if
    check is false.

    If the destination number is not found, then the branch will not be
    successful, and the program will stop.  This can be used for branches
    that are not necessary to the operation of the program.

    When using 0 as the destination number the program will always abord.
    It's suggested to use 0 so an area admin won't waste time looking for
    a non existant destination number.


    OPROG_QUEST_SET <OFFSET> <NUMBITS> <VALUE>

P 1
TRIG_UNKNOWN 100 EXAMPLE
OPROG_QUEST_SET 0 4 15

    This is a method of setting the value of the quest bits on an object.
    The offset is the starting bit number of the grouped quest numbers.
    The numbits are the amount of bits involved with the defined value.
    The value is the desired value of the set.

    OPROG_QUEST_ADD <OFFSET> <NUMBITS> <VALUE>

P 1
TRIG_WEAR 100
OPROG_QUEST_ADD 4 4 1

    This is a method of adding a value to the quest bits of an object.
    The offset is the starting bit number of the grouped quest numbers.
    The numbits are the amount of bits involved with the defined value.
    The value is the desired increment being added to the quest bits.

    The number inside the defined bit range will never overflow to higher
    bits, or go below zero.  The value may be negative to subtract.
    This can be used to make items that have limited lifespan.

    In this example the value will go when wearing several times to :

    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7 8 and so on.



    OPROG_PLAYER_QUEST_IF <OFFSET> <NUMBITS> <OPERATOR> <VALUE> <TRUE> <FALSE>
    OPROG_OBJECT_QUEST_IF <OFFSET> <NUMBITS> <OPERATOR> <VALUE> <TRUE> <FALSE>

P 1
TRIG_UNKNOWN 100 TEST
OPROG_PLAYER_QUEST_IF 0 1 = 1
OPROG_ECHO
Your first bit has value 1~

    The quest if check allows branching to other obj_progs.
    The offset is the starting bit number of the grouped quest numbers.
    The numbits are the amount of bits involved with the defined value.
    The quest bits checked will be those of the area the object belongs to.

    Operator:

        <   - Less than
        >   - Greater than
        =   - Equal to
        !   - Not equal to

     The value is a number that the check variable is compared against.
     True destination is the program index (the one listed after the 'P') that
     the branch will continue when the if check is true.
     False destination is the obj_prog index that is executed when the if
     check is false.
     If the destination number is not found or goes backwards, then the branch
     will not be successful, and the program will stop.  This can be used for
     branches that are not necessary to the operation of the program. It's
     good practise to branch to 0 in this case, which will always abord the
     program.


**  Example Programs:

P 1
TRIG_COMMAND 45 say
OPROG_GOD_COMMAND
mpechoat self {160}You are occasionally tongue tied.&
mpechoaround self $n tries to speak but $e seems tongue tied.~
P 2
TRIG_UNKNOWN 100 HOME
OPROG_IF OIF_WEAR_LOC = WEAR_NONE 3 4
P 3
TRIG_VOID
OPROG_ECHO
You must wear the example object (with program) to go home.~
P 4
TRIG_VOID
OPROG_GOD_COMMAND
mpechoaround self {030}$I says 'I'm going home!'&
mpgoto 9755&
say I'm home!~


Explanation:

The first section of the program is a simple command trigger.  45% of the time
that the user tries to use the 'say' command, it will not be functional, and
the user will see the response that he is tongue tied. The mpechoaround will
send the same message to everyone but the user standing in the same room.

The rest of the program checks when the user types the unknown command
'HOME'.  If that is typed, then the If Check checks for the wear location of
the object.  If the wear location equals WEAR_NONE (item is not worn),
then the command continues with program 3.  If the item is worn, then the
program will continue with program 4.

The next program has a void trigger, and can only be reached by the previous
branch statement.  The user is messaged to wear the object.

The final program has a void trigger too.
Faking that the player says he is going home,
then to 'mpgoto', a mob command, the location of 9755, which is the square
in the city of Roterodamum.
Then the user is forced to say: I'm home!


Notes on obj_progs:

It can easily be seen that there is a very large amount of room for
improvement on object_programs of this type.  This system has been set
up because obj_programs are searched MANY more times than mob_progs,
and require a significantly longer amount of CPU time to process than
mob_progs.  Therefore a tokenized method was developed instead of the
interpreted system of the mob_progs.  Essentially the format in the .are
file is the same that the database system saves all the information.
Using this tokenized system is at least 4 times faster for the CPU than
an interpreted based system.

More complex object programs can be realized by asking the Emud implementors
to add new types of triggers and responses.  This system is relatively new,
and has not been fully tested for CPU usage, but early tests show that the
response time is such that 50 people having 20 items with complex programs
each, should not noticeably degrade system performance.  For the sake of
safety, both the commands of 'save' and 'quit' are removed from those allowed
in obj_prog responses.  Be very careful with using the god commands, as they
can permanently change the statistics of players, rooms, and just about
anything in the game.

*** Important:

    It is allowable to delete the item as a final command.

    The JUNK command will always automatically terminate object programs,
    regardless if the object program continues.


QUEST BITS:

    This is generally a very complex system to initially understand, therefore
    The following is a detailed description of how quest bits work.

    Quest bits are used in 3 places.

    -Each player has a set of quest bits for each area, so that a player may
     be on several quests, and each area has it's own set, without worrying
     about other areas.
    -Each mobile has one set of quest bits. (not saved during crashes)
    -Each item has one set of quest bits.

    It should generally be considered that you should not allow modifications
    of quest bits by an something from one area to another.  As each set of
    quest bits are defined completely by the area creator.

    Quest bits are used to allow the area creator the ability to define their
    own set of variables that are constant for that individual, object, or
    mobile.

    This means that once the value is set, it is saved throughout the game,
    and allows various states, or steps in a quest to be marked.  The
    definition of a quest is the ability of the game to know how far a player
    has gotten in an area regardless if they come back to the game several
    days later.

    Each set of quest bits is really a set of user definable 128 bits.
    Some knowledge of binary numbers helps in decifering this system
    completely, but is not necessary.

    The offset is always the starting point of where the defined value is.
    The amount of bits defines the totaly range of the values used.

    With basic binary system, the amount of bits define an exponential range:

    1 bit - 2 values
    2     - 4
    3     - 8
    4     - 16
    5     - 32
    6     - 64
    7     - 128
    8     - 256

Ex. Say a creator wants to have 4 states on an object.  The first being the
    initial state, the second when a player hits a mobile, the third when
    the player goes to sleep, and the fourth when he wakes up.
    The area creator wants an object that poisons the player when he attacks
    a mobile, and damages them when the player wakes up.  The player is
    even informed that when he wakes up next, he will be hurting very bad.
    Since there are only 4 states, only 2 bits are required.

    Be aware that's only 2 out of 128 bits, this means you can pick the
    first available bits, but also the last available bits.

    Below we'll see some asci art showing the first 32 bits, be aware that
    the first bit has the location: 0, and bit 32 has location: 31

    In this example we'll only use the 5th and 6th bit, they're at
    locations: 4 and 5


       30  28  26  24  22  20  18  16  14  12  10 9 8 7 6 5 4 3 2 1 0
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X| | |X|X|X|X|
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      ("X" indicates an unused bit)

    A bit has either value 0 or 1 which allows you to make 4 values:

    00  =  0  (initial state)
    01  =  1  (player has hit mobile)
    10  =  2  (players has gone to sleep)
    11  =  3  (player has woken up)

    If this is clear to you we'll once again concentrate on how to read
    and how to write these bits.

    Reading the bits:

    OPROG_OBJECT_QUEST_IF 4 2 = 3 6 8

    Freely translated:

    start reading at bit 4  +  read 2 bits
    if equals : 3 --> true:  branch to program 6
                      false: branch to program 8

    Writing goes almost the same way :

    To set the bits to have the value 2 -->

    OPROG_QUEST_SET 4 2 2


    Now what if you don't understand a single bit of the above? This is
    possible if you're not familiar with computer science. In that case
    you can use a set amount of values that always work. In that case we
    suggest you always use the format to remember 16 steps of a player's
    or object's quest bits:

    OPROG_QUEST_SET 0 4 <value ranging from 0 to 15)

    OPROG_OBJECT_QUEST_IF 0 4 = <value ranging from 0 to 15)

    The object starts with a value of 0

    use OPROG_QUEST_SET 0 4 2  to set quest to 2
    use OPROG_OBJECT_QUEST_IF 0 4 = 5  to see if the quest equals 5

    This will work for any value ranging from 0 to 15, thus there is
    no huge need to know how stuff exactly works, as long as you can
    use it.



*** TIPS and OBSERVATIONS

    Items with applies to stats over +3 should be very rare on most muds,
    and hard to get.

    A lot of small items make an area more interesting than a few incredibly
    powerful items, for the most part.  This is very subjective, however.
    Items that are too powerful may be changed by the game administrators,
    which usually annoys the administrator more. The better the area, and
    the quest you've written, the better the objects.

    Remember to put take wear-flags on almost everything.  It's easier to
    put a take wear-flag on everything, and take off the ones you don't
    need (like fountains and such).

    don't feel limited to items players consider 'useful', such as weapons
    and armor.  A giant (untakeable) monolith, and other strange and odd
    items can add a lot of atmosphere to an area.

    The ITEM_FLAG_INVENTORY has very special purposes and should not be used
    for normal items.  An object that is flagged as inventory will follow the
    player, even in  death.

    A mobile that is killed with an object that has an inventory type item will
    automatically delete the item.  This is useful for creating objects that
    the player desires, but cannot get.  An object with this flag can be given
    to the player by a mobile with mob_progs, or picked up off the ground.



7.  The #SHOPS section

    The #SHOPS section tells the mud each shop the kind of items it deals
    in.  It also tells the profit margins, and the hours open.  Usually all
    the numbers are on one line.

*** Shop Archetype

<Mob vnum> <type1> <type2> <type3> <type4> <type5> <%sell> <%buy> <open> <close>

*** Mob Vnum

    This is the mobile that works in the shop.

*** Type

    These five values are the ITEM_TYPE numbers that the shop deals in.
    The shop will only buy or sell these types of items.  Leaving a '0' in
    any of the slots will allow the shop to deal in less than five types of
    items, but a shop may never deal in more than five.

*** %Sell

    This is the percent of the normal value of an object when the shopkeeper
    sells it to a player.  Usually around 100.  This number is limited by
    the system and can only be 100 or higher.

*** %Buy

    This is the percent of the normal value of an object when the shopkeeper
    buys it from a player.  Usually around 50.  This number is also limited
    by the system and can only be 100 or less.

*** Hour Open

    This field is a number from 0 to 23 that is the hour that the shop opens.

*** Hour Close
    This field is a number from 0 to 23 that is the hour that the shop opens.

*** Note:
    Comments may be added after the Hour Closed following a ';'.
    The comments can only be as long as the screen length.

*** Note:
    Shops on Emud can be browsed through during off hours, but nothing
    can be bought there.  All shops are considered safe rooms at all
    times, even in off hours.


8.  The #RESETS section

    The #RESETS section tells the mud where everything goes, from the
    goblin in the pit to what the knight is wielding and putting the
    fountain in the square.  This section is simple a list of commands.

    The zone commands tell the mud exactly how to reset a zone,
    from mobs to objects, to closing doors.  Each command is given its own
    line, one after the other, until the end of the file.  Comments can be
    added for clarity's sake example:    ; big guy with sword

    Areas reset based on the average of all the levels of the mobiles in
    the area.  Low level areas take about 5 minutes to reset, and high
    level areas take about 15 minutes.  This number is fixed and continuous
    regardless of how many players are in the area.

*** Standard Fields

<if-flag>  An if flag tells the mud to look at the previous command.
           If the if-flag is 0, the mud will try to execute the command
           regardless of the previous command.  If the if-flag is any
           other than a zero (one is most commonly used), then that
           particular command will only execute if the command immediately
           preceding it did as well.

           This is useful for objects loaded onto mobs; you don't want
           to load a shield on a guard that didn't get loaded, for example.
           All in all it doesn't matter much.

<max #>    This is the maximum number of whatever this is can exist in the
           mud.  If on a mob command, this will do nothing.
           On an object command, this limits how many of this object are
           available in the game.  For items not limited, it is common to
           put a very high number in this slot, 100 should do in most cases.
           For something like recall scrolls you can settle for 999


*** List of all Commands

M <if-flag>  <mob vnum> <maximum> <room vnum>
G <if-flag>  <obj vnum> <maximum>
E <if-flag>  <obj vnum> <maximum> <wear location>

O <if-flag>  <obj vnum> <maximum> <room vnum>
P <if-flag>  <obj vnum> <maximum> <container vnum>

D <if-flag> <room vnum> <exit direction> <door flag>

R <if-flag> <room vnum> <last exit to randomize>


*** M <if-flag>  <mob vnum> <maximum> <room vnum>

    The M reset loads a mobiles to a certain place in the mud.


*** G <if-flag>  <obj vnum> <maximum>

    The G reset loads an object and gives it to a mobile loaded in the
    reset immediately previous.  Note that this is different from
    the E reset below, in that the E reset loads an object and makes
    the mob equip it.  A G reset object stays in the mob's inventory.

    To make a unique item the <maximum> should be 1.  Generally this means
    that the object will not load if any others exist in the game.  There
    is a basic 20% chance that the object will load anyways when the mobile
    resets.  A mobile will reset after it is killed on the next area reset.

*** E <if-flag>  <obj vnum> <maximum> <wear location>


    The E reset loads an object and makes the mob loaded in the reset
    immediately previous to this one equip it.

    Where equipment position is _one_ of the following:

    WEAR_LIGHT               0    WEAR_HANDS               9
    WEAR_FINGER_L            1    WEAR_ARMS               10
    WEAR_FINGER_R            2    WEAR_SHIELD             11
    WEAR_NECK_A              3    WEAR_ABOUT              12
    WEAR_NECK_B              4    WEAR_WAIST              13
    WEAR_BODY                5    WEAR_WRIST_L            14
    WEAR_HEAD                6    WEAR_WRIST_R            15
    WEAR_LEGS                7    WEAR_WIELD              16
    WEAR_FEET                8    WEAR_HOLD               17


*** O <if-flag>  <obj vnum> <maximum> <room vnum>

    The O reset loads an object into a room.  This is mostly used for
    unowned or immovable objects.

    To make a unique item the <maximum> should be 1.  Generally this means
    that the object will not load if any others exist in the game.  There
    is a basic 20% chance that the object will load anyways when the area
    resets.

*** P <if-flag>  <obj vnum> <maximum> <container vnum>

    The P reset loads an object, and places it into another object
    (container-type) that was previously loaded.


*** D <if-flag> <room vnum> <exit direction> <door flag>

    The D reset can open, close, or close and lock a door every repop,

    Where door flag is _one_ of the following:

    DOOR_OPEN                0
    DOOR_CLOSED              1
    DOOR_CLOSED_LOCKED       2

    Where exit direction is one of the following:

    DIR_NORTH                0    DIR_WEST                 3
    DIR_EAST                 1    DIR_UP                   4
    DIR_SOUTH                2    DIR_DOWN                 5


*** R <if-flag> <room vnum> <last exit to randomize>

    The R reset randomizes the specified exits in a room.

    Where <last exit to randomize> is the number equivalent of the first
    exit in the room to not randomize.  For example:

R 0 6495 3

    would randomize the north(0), east(1), and south(2) doors of the room with
    the vnum 6495.  Swapping only those three exits.


*** TIPS and OBSERVATIONS

    Remember, a functioning door is a door from both sides, and needs to
    be closed from both sides.  Thus, 2 door resets for each door.

    The P reset gets confused if you try to load multiple objects
    into multiple containers IF the containers are all the same
    object.
    The solution is to copy the container over into the #OBJECTS section
    with a different vnum however many different containers you need.



9.  Putting it all together.

    This section is simply composed of building tips for novice
    builders.  This is very subjective, and based on the experiences of
    the builders at the Curious Area Workshop.  Not all these techniques
    may be of use to your average builder.


    Absolutely, positively use the AREACHECK utility.

    The areacheck utility comes with the utilites section of
    documents that goes along with this document.  The
    areacheck will normally allow the area to start right up
    unless you have doors specified wrong, or have problems
    with obj_progs or mob_progs.  Areacheck does a VERY good
    job of checking syntax, such as numbers that are off or
    spacing that is wrong.  It also checks the syntax or
    spelling of all the text versions of flags.


    Learn to build without an area editor first.

    Its a lot easier to troubleshoot when you understand what
    exactly goes on with all those numbers in those files...

    This is very important because most area editors are designed
    for Merc or Diku areas.  They are actually fine for making
    a framework for the area, but realize that MANY differences
    crop up in creating Emud areas.  And the creator must then
    use a text editor to finish out the area. Also the editors
    tend to make little errors, crashing the area editor and
    leaving one without advanced knowledge helpless.


    Do it on paper first.  Do it big.

    Having a map to work from helps a LOT when doing exits, and
    provides a visual impetus to getting all those tedious bits done.


    Do the #ROOMS section first.

    The #ROOMS section almost always takes the longest.  Once past that
    long fight, the #MOBILES and the rest will come easier.


    Save Mobile programs and Object programs till the very end.

    It is simpler to create obj_progs and mob_progs when all the
    mobiles and objects are in place, and the rooms are finished.

    BE aware that you might end up redoing alot of rooms, mobiles
    and objects because you want certain things in your quest which
    you make up while working on it. Therefor it is suggested to
    think very well about the quest you want to make. Write it down
    in steps. Then build your area such way that you can implement
    all the mobile and object programs without having to make heavy
    changes.

    Your #RESETS file will always be wrong on the first try.

    -Get used to it.

    Your mobile and object programs will suck and work badly on the
    first try.

    -Keep working on them till they work as you desire.


    For random mob distribution, use this method:

    (this was contributed by Locke of CthulhuMUD)

    Make a room, with exits to all the places that you would like mobs
    to come out of, in all 6 directions.  Load all mobs to be randomly
    distributed in this room, and they'll choose and walk out themselves!
    (if they're not sentinel).

    For a big area, several of these 'mob chutes' can be connected
    for a bubble-sort effect.


    An area will take twice as long as you think it will to build.

    a certain boredom sets in sometimes.  just set it aside for
    awhile if this happens; its better to build when you want to
    then turn out something uninspired.  If you plan on using
    obj_progs or mob_progs then the area will take four times
    as long as you expect.   If you plan on using quest bits, then
    count of it taking much longer than you expect, with several
    errors.

    Mobile and object programs are a MUST however, once you learn
    how to use them properly you'll be able to create an area
    unparalised by areas without progs.


    Be fair with the items:

    Good items should be hard to get.  Lousy items should require
    much less effort.  Give the ordinary stuff to the mobs to wear,
    and reserve the good stuff as a reward for the cool quest you'll
    hopefully write.

    Always remember that items and objects can easily get out of
    scale, and all areas can and probably will be modified by the
    implementors of a Emud system.  This is to be expected, so
    don't get too put out.

    Contributions to this section are welcome, and will be added with
    proper credits.



10.  Credits


Special Thanks to Tarkin of NaVieMUD and MJPrime of AlbertMUD for
invaluble help in writing this Handbook.

Extra Special Thanks to all the Players of NaVie (128.213.5.14 4001),
for all the help during the Buggies & Bounties competitions.

Builder_5
11/11/93
ftp.cs.odu.edu \pub\caw

Modifications for MrMud v1.2 written on (incredibly) 11/11/94
   David Bills    (Chaos on Mortal Realms - hydrogen.ee.utulsa.edu 4321)
   Doug Michael   (Order on Mortal Realms - hydrogen.ee.utulsa.edu 4321)

Modifications for Emud v2.2 written on 12/12/01
   Scandum        (Demise on Storms of Time     - minas-2.demon.nl 4321)


===============================================================================
FILE: "mob_prog.txt"

=== MOBprograms

    MOBprograms are a way to make your mobiles more interesting.  This
    basic version has enough to get things going, and should be quite
    readable and understandable and more to the point, extendable. The
    remainder of this document describes MOBprograms and gives a couple
    trivial examples.

Table of Contents:

    The Basic Idea
    MOBprogram Syntax
    Associating MOBprograms With A Mobile
    Trigger Types
    Variables
    Control Flow Syntax
    Operators
    If_Checks In Control Flow
    MOBcommands Of Interest
    Regarding CPU Slowdown
    Miscellaneous Information
    Credits


-------------------------------The Basic Idea----------------------------------

    Ever wonder why most muds either seem dead or overcrowded? The answer
    is probably partially due to the fact that the mobiles never do anything
    but wait to be slaughtered.  Unless someone has gone to great lengths
    and added many special procedures, most mobiles have no idea you are in
    the room with them and rarely listen to what you say. The typical Midgaard
    mayor wanders happily along even when the populace pokes him, waves his
    City Key about, unlocks his gates, or frenchs his secretary, etc. So a way
    to give the mobiles a bit more spirit would be neat.

                              -Enter Mob Prog-

    The backbone of the MOBprograms shall be called triggers from this point
    on.  Essentially, they are procedure calls placed in sneaky places in
    the mud code which provide the context for what is going on around the
    mobile.  So, if something happens in the mobile's room and a trigger is
    activated, then a list of commands is sent to the interpreter in the
    mobile's name, thus making her/it/him do an appropriate something.

    Since knowing the appropriate response for every mobile to every
    possible trigger is not easy, this command list shouldnt be a rigid
    script, but needs to be somehow unique for the mobile and the situation.
    However, in order to know the situation, a mobile needs to know more
    about the trigger than that it just happened.  So, we have to include
    some sort of variables as well to set the context appropriately.

    As most implementors know, most area creators are not versed in coding,
    but usually have great ideas. Therefore, whatever system is used needs
    to be quite simple.  This is not to demean creators in anyway.  Simply,
    it is useless to have a powerful system, if the only person able to write
    anything is someone who finds C coding in general to be exciting and non
    frustrating.

    If that is going to be the case, then stick to the special procedures,
    since there is no bound to what a complex special procedure can accomplish.
    Yet, from experience working on several muds, most admins and implementors
    prefer not to be writing one shot spec_procs to satisfy the needs of their
    creators.  And not to be demeaning toward implementors, area creators who
    never wrote a c program have constructed mobile programs being far more
    complex and entertaining than 99% of the spec_procs.

    Thus, the basic idea:  let mobiles react to a myriad of mud
    events/situations by having them perform a list of commands which can be
    tailored to the moment through a simple and unintimidating scheme usable
    by any creator.


------------------------------MOBprogram Syntax--------------------------------

    The simplest way to describe any syntax is by example, so here goes.
    First, define the notation: anything contained in braces {} is required,
    anything in brackets [] is optional, anything in quotes "" is a case
    insensitive literal, NL refers to a required new-line. The meanings of
    the labels used will be described following the syntax diagram.

">" {trigger_type} " " {argument_list} "~" NL
{program_command_1} NL
{program_command_2} NL
{program_command_3} NL
     .   .   .
{program_command_N} NL
"~" NL

=== Explainations

    A TRIGGER_TYPE is one of the available triggers.
    A PROGRAM_COMMAND can be any legal mud command, or a control flow command.
    The ARGUMENT_LIST depends upon the trigger, but it is always parsed into
    the system as a character string.

    This is an example of ONE MOBProgram block for a mob.

--------------------Associating MOBprograms With A Mobile----------------------

    There is only one way for the mud to associate the program with the
    mobile.  The result is a link list of mob_programs which are
    attached to the mobile_prototype.  This is done at boot time, and so only
    one copy is kept, regardless of how many instances of the mobile are
    running about.

    In the #MOBILES section of your area files, at the end of the
    mobile's block (i.e. on the line following the typical position/default
    position/sex line), append any number of MOBprograms blocks
    (using the syntax above) followed by a line starting with one '|' (pipe).
    Example provided:  holygrove.are


-----------------------------Trigger Types----------------------------------

    Triggers are fairly easy to add, but this basic list should hold for
    most needs. Their names, argument list syntaxes, and translation into
    more articulate english are given below:


*** act_prog [p] <ARGUMENT>

    The argument is a list of keywords separated by spaces. If the first
    word is the character 'p' by itself then the rest of the word list is
    considered to be a phrase.  The trigger is activated whenver a keyword
    (or the phrase) is contained in the act() message. Both the phrase and
    keywords are case insensitive.

    This is the most general trigger.  It applies to almost every event
    which happens in the mud.  Anytime the function act() is called with
    a message to be delivered TO_CHAR,TO_VICT,TO_ROOM, etc. the act can be
    triggered.  Basically this will trigger on almost everything you'll
    ever want (and some things you wont as well). Do aknowledge only players
    can trigger an act_prog, mobs will be ignored.

    Example

    >act_prog p pokes you in the ribs.~
    This trigger will only be activated if a mobile receives a message
    in which the above five words are found in the exact order and
    spacing given. Note that the period is needed because the words
    must be found on their own. This eliminates confusion when the
    keyword is 'hi' and a message with the word 'this' is being checked.


*** speech_prog <ARGUMENT>

    The argument is the same as for an act_prog.  This works best when only
    one word is used as the argument, as several can cause the mob_prog to
    trigger several times in a row.

    Example

    >speech_prog the dog~
    The previous example is faulty, because it would trigger twice if the
    player said the words 'the' and 'dog' in the same sentence.

    Correct Example: >speech_prog dog~

    This is only triggered when the keyword is contained in a message which
    has been said by a PC in the same room as the mob.

    The PC restriction is not necessary, but makes infinite loops between
    two talking mobiles impossible. It also makes it impossible for two
    NPC's to stand and discuss the weather however.


*** rand_prog <NUMBER>

    The argument is a number betweeen 1 and 100 inclusive.

    This trigger is checked at each PULSE_MOBILE and if the argument is
    greater than a percentage roll the trigger is activated. This
    will happen even if there is no PC in the room with the mob.

    It is useful to give mobiles a bit of a personality. For instance
    a janitor who stops to spit tobacco, or complain about the hours,
    or wonder why there are no woman janitors on muds, or a fido which
    barks or growls or pees on the curb is much more alive than one
    which just sits there scavenging.

    If the $r Variable is used in the body of the trigger the trigger
    will only execute if there is a player in the room.
    To allow a mobile to work with both $r and without players in the
    room use 1 rand_prog having the $r part, and one rand_prog or a
    time_prog taking care of other stuff.  Only 1 rand_prog can trigger
    at each time.


*** fight_prog <NUMBER>

    The argument is a percentage like in rand_prog.

    Useful for giving mobiles combat attitude.  It is checked every
    PULSE_VIOLENCE when the mobile is fighting.  Can be used to cast
    spells, curse at the opponent, or whatever. Only the first successful
    one will be processed to save time.  Also, this means that the
    mobile wont get lucky and 1. curse, cast a fireball and 2. spit on the
    player, cast another fireball in the same pulse.


*** hitprcnt_prog <NUMBER>

    The argument is a percentage.

    Is activated at each PULSE_VIOLENCE when the mobile is fighting. It
    checks to see if the hitpoints of the mobile are below the given
    percentage.  Multiple hitprcnt_progs should be listed in increasing
    order of percent since a 40% will always be activated before a 20%
    and, only the first successful hitprcnt trigger is performed.

*** greet_prog <NUMBER>

    Again a percentage argument.

    Whenever someone enters the room with the mobile, and the mobile saw
    the person enter, this is checked. Good for shopkeepers who want
    to welcome customers, or for pseudo-aggressive mobiles which need to
    discriminate on who they attack.


*** all_greet_prog <NUMBER>

    Again a percentage argument.

    Like greet_prog, but it can be triggered even if the mobile didnt
    see the arrival (stealth, invis). Most useful for faking teleport
    rooms (if your mobiles can transfer) or for impassable guardians.

    Neith

Showing the first 100 KB of 209.3 KB. Download the archive for the full file.

Site Stats

Snippets: 1791
Codebases: 571