=== Acknowledgement This document contains information from 'database.doc', 'dbsup.doc', and 'values.doc', part of the original Diku mud release and copyrighted by the Diku folks. See their 'license.doc'. Some of these updates have been provided by information sent to me my Rusty MooseHeadMud. === Overview of Areas An area is one piece of the world. Each area is defined in a separate file. All of our area files have the extension '.are', but you can call your area files anything you want. Because each area is defined in one file, it is easy to incorporate new areas into Merc, or to send Merc areas to others for use. All of our areas may be freely distributed, as long as the internal notices (such as those on plaques, signs, graffiti, or tombstones) are kept. If you write new areas, and would like to contribute them back to Merc, just e-mail to one of the addresses above. As you can see from typing 'areas' in the game, we credit the original authors whenever we can find them. Although the format of Merc areas is (mostly) compatible with other Diku muds, Merc ignores many of the fields in the area files, generating its own values based on mobile and object levels. We adopted this policy in order to maintain balance between areas originally written by many different authors. === Sections of an Area An area file contains the following sections: #AREA required #HELPS #MOBILES required (#MOBOLD) (required) *old style of mobiles #OBJECTS required (#OBJOLD) (required) *old style of objects #ROOMS required #RESETS required #SHOPS #SPECIALS #$ required The sections with "required" next to them are those sections which I deem necessary for an area to be implemented on DLL. The (required) is in paraentheses in case you wish to write an area in the old format. It should be noted that an area may contain new AND old format mobiles and/or objects. An area is a collection of sections starting with #AREA until the next #AREA. All of our area files (except 'help.are') contain just one #AREA section, which is at the top of the file. The file 'proto.are' contains a prototype for developing new area files. Each of the sections contains its own format. For #MOBILES, #OBJECTS, #ROOMS, and #RESETS, this format is upward compatible with the original Diku formats for tinyworld.mob, tinyworld.obj, tinyworld.wld, and tinyworld.zon, respectively. The #HELPS, #SHOPS, and #SPECIALS sections have new formats. === Memory Usage In order to simplify the code, the Merc server has a fixed maximum size on strings in the area database. This size is defined at the beginning of 'db.c' 'db.c' with a '#define' statement. As distributed, this size is: #define MAX_STRING 1048576 This size is 10% larger than needed for the areas we distribute. Thus, you can add about 4 more areas without touching the server at all. The server will tell you when the string table overflows, and you can simply increase the maximum limit and recompile. The immortal 'memory' command will show you memory usage from within the game. There is no other limit on area sizes or memory usage. We decided to use a fixed size because it simplifies our job. It also allows significant performance improvements: compare our load time and memory usage versus other Diku muds with the same quantity of areas. === Data Types All of the data in an area file (even the section headers) consists of a series of values. Each value has a specific type. The server parses the file by reading in data values one at a time according to the types it expects. Blank characters (spaces, tabs, new lines, carriage returns) at the beginning of a data value are always ignored (this includes strings). Thus, you can format the area files whatever way suits your taste and your needs. The individual types are: 'letter', 'word', 'string', 'number', and 'to_eol'. A 'letter' is a single non-blank character. A 'word' is a sequence of non-blank characters terminated by a blank. A 'string' is a seqence of non-tilde characters terminated by a tilde. A tilde is this character: '~'. Thus, strings may contain blanks, and may be multiple lines long. There is no limit on the length of an individual string; however, all strings go into a common memory pool whose size is fixed when the server is compiled. A 'number' is a decimal number with an optional leading '-' or '+'. The '|' character may be used in any number: '1|64|1048576' has the value 1048641. The individual values separated by '|' are added together, so '5|6' is 11, not 7. The components need not be powers of 2. This feature is extremely useful for defining bit vectors, such as the ACT_* and AFF_* bits for mobiles, but is not restricted to bit vectors: any number may use the '|' construction. A 'to_eol' is all the characters from the current position to the end of the current input line. It is used for parsing comments at the ends of lines. In the syntax description below, indicates a value to be read of the indicated type. A backslash '\' indicates that the file format itself has only one line, but several lines are used in this description to fit within 80 columns. Braces '{ ... }' are used to enclose elements. They are NOT literal parts of the file format, but a way of indicating that the enclosed elements may be repeated zero or more times. Braces at the same level of indentation indicate that the parallel elements may be present in any order. All other characters in the syntax description are literal characters. The file 'merc.h' lists the meanings of most of the flags and values. The section useful to area builders is set off by big comments; you can't miss it. The file 'const.c' contains the spell list with slot numbers, and the file 'special.c' contains the list of special procedures. Mobiles, objects, and rooms are identified by vnum (virtual number). The range of vnum's is 1 to 32767. Vnum's must be unique (for that particular kind of vnum). Vnums do not have to be in increasing order. Typically an area uses the same range of vnum's for mobile vnum's, object vnum's, and room vnum's, starting with a multiple of 100. This facilitates adding the area into an existing set of areas. === The #AREA section The syntax of this section is: #AREA The 'area-name' can be any string. The 'areas' command provides a list of areas, so it's worth while to follow the standard Merc format for this string: #AREA { 5 35} Merc Prototype for New Area~ The first two numbers are recommended level range. The name is the name of the original author of the area. The last phrase is the name of the area. === The #HELPS section The syntax of this section is: #HELPS { } 0 $~ The 'level' number is the minimum character level needed to read this section. This allows for immortal-only help text. The 'keywords' are a set of keywords for this help text. The 'help-text' is the help text itself. Normally when a player uses 'help', both the keywords and the help-text are shown. If the 'level' is negative, however, the keywords are suppressed. This allows the help file mechanism to be used for certain other commands, such as the initial 'greetings' text. If a 'help-text' begins with a leading '.', the leading '.' is stripped off. This provides for an escape mechanism from the usual leading-blank stripping of strings, so that picturesque greeting screens may be used. === The #MOBOLD/#MOBILES section The syntax of #MOBOLD mobiles are: #MOBOLD { # d + d + { A } { D /*not yet implemented*/ } } #0 The syntax of #MOBILES mobiles are: #MOBILES { # d + d + d + { A } { D /*not yet implemented*/ /*but will be soon*/ } } #0 #MOBILE format example: #3011 Hassan~ Hassan~ Hassan is here, waiting to dispense some justice. ~ Big. Very big. Stupid. Very stupid. Hassan, the guardian of the Darklands, towers over you. He's over 12 feet tall, every inch of it muscle. It would be a Bad Thing to commit a crime in his presence. ~ giant~ BTV CDFJZ 1000 M 40 30 1d1+2999 1d1+499 4d4+30 8 -20 -20 -20 -10 ACDEFHIKLNOT ABP CD 0 8 8 1 0 0 0 H 0 { A 10 /* this is done on all pcs or mobs 10 and under */ $n kicks $N in the shin.~ $n kicks you in the shin.~ A -1 /* this is done on anyone who didn't fit the $n shakes $N's hand.~ * previous condition (all over 10th) $n shakes your hand.~ */ } { D 10 /* for 10th level and under */ $n pushes $N out of the room.~ $n gives you a light shove out of the room.~ D 40 /* for 10th to 40th level */ $n waves goodbye to $N.~ $n waves goodbye to you.~ D -1 /for anyone over 40th level */ $n wipes the sweat off his brow as $N leaves the room.~ You see $n nervously wipe sweat off his forehead.~ } The 'vnum' is the virtual number of the mobile. The 'keywords' are words which can be used in commands to identify the mobile. The 'short-description' is the description used by the 'act' function and other functions to identify the mobile. The 'long-description' is the description used when a character walks in the room and the mobile is visible. The 'description' is the longest description. It is used when a character explicitly looks at the mobile. The 'act-flags' define how the mobile acts, and the 'affected-flags' define more attributes of the mobile. /* * ACT bits for mobs. * Used in #MOBILES. */ #define ACT_IS_NPC (A) /* Auto set for mobs */ #define ACT_SENTINEL (B) /* Stays in one room */ #define ACT_SCAVENGER (C) /* Picks up objects */ #define ACT_AGGRESSIVE (F) /* Attacks PC's */ #define ACT_STAY_AREA (G) /* Won't leave area */ #define ACT_WIMPY (H) /* Flees when bleeding */ #define ACT_PET (I) /* Auto set for pets */ #define ACT_TRAIN (J) /* Can train PC's */ #define ACT_PRACTICE (K) /* Can practice PC's */ #define ACT_UNDEAD (O) #define ACT_CLERIC (Q) #define ACT_MAGE (R) #define ACT_THIEF (S) #define ACT_WARRIOR (T) #define ACT_NOALIGN (U) #define ACT_NOPURGE (V) #define ACT_IS_HEALER (aa) #define ACT_GAIN (bb) #define ACT_UPDATE_ALWAYS (cc) The 'alignment' of the mobile ranges from -1000 to +1000. Keep in mind that certain spells ('protection' and 'dispel evil') give characters fighting evil monsters an advantage, and that experience earned is influenced by alignment. The literal letter 'S' or 'M' must be present after the alignment. In the original Diku mob format, 'S' stands for simple. We have added 'M' type mobiles, 'M' stands for modified. The 'level' is typically a number from 1 to 51, although there is no upper limit. *** For the #MOBOLD style mobiles *** The 'hitroll', 'armor', 'hitnodice, 'hitsizedice', 'hitplus', 'damnodice', 'damsizedice', 'damroll', 'gold', 'exp', 'position', and 'position' fields are present for compatibility with original Diku mud, but their values are ignored. Merc generates these values internally based on the level of the mobile. *** For #MOBILES style mobiles *** The 'hitroll' is the mobiles bonus to-hit. The 'hitdicenum'd'hitdicetype'+'hitdicebonus' determines the number of hit points a mobile has. The 'hitdicenum' is the number of dice. The 'hitdicetype' is the size of the dice. The 'hitdicebonus' is the bonus added to the hit points. The 'manadicenum'd'manadicetype'+'manadicebonus' determines the amount of mana a mobile has. The 'manadicenum' is the number of dice. The 'manadicetype' is the size of the dice. The 'manadicebonus' is the bonus added to the mana points. The 'damdicenum'd'damdicetype'+'damdicebonus' determines the amount of damage a mobile has. The 'damdicenum' is the number of dice. The 'damdicetype' is the size of the dice. The 'damdicebonus' is the bonus added to the damage. The 'damage-type' is a number that indicates the type of damage caused with hand-to-hand fighting. Only one of the following is needed. damage types: slice 1 slashing punch 17 bash stab 2 piercing wrath 18 energy slash 3 slashing magic 19 energy whip 4 slashing divine power 20 holy claw 5 slashing cleave 21 slash blast 6 bash scratch 22 pierce pound 7 bash peck 23 pierce crush 8 bash peck 24 bash grep 9 slash chop 25 slash bite 10 pierce sting 26 pierce pierce 11 pierce smash 27 bash suction 12 bash shocking bite 28 lightning beating 13 bash flaming bite 29 fire digestion 14 acid freezing bite 30 cold charge 15 bash acidic bite 31 acid slap 16 bash chomp 32 pierce The 'ac-pierce' is the armor verses piercing type weapons. The 'ac-bash' is the armor verses bashing type weapons. The 'ac-slash' is the armor verses slashing type weapons. The 'ac-exotic' is the armor verses exotic type weapons? /***NOTE: the AC is multiplied by 10 when it is read in so a value of ***/ /***-200 would compute to an ac-type of -2000, be wise when setting these. ***/ 'Offense-flags' /* OFF bits for mobiles */ OFF_AREA_ATTACK (A) OFF_RESCUE (L) OFF_BACKSTAB (B) OFF_TAIL (M) OFF_BASH (C) OFF_TRIP (N) OFF_BERSERK (D) OFF_CRUSH (O) OFF_DISARM (E) ASSIST_ALL (P) OFF_DODGE (F) ASSIST_ALIGN (Q) OFF_FADE (G) ASSIST_RACE (R) OFF_FAST (H) ASSIST_PLAYERS (S) OFF_KICK (I) ASSIST_GUARD (T) OFF_KICK_DIRT (J) ASSIST_VNUM (U) OFF_PARRY (K) /* IMM bits for mobs */ IMM_SUMMON (A) IMM_ACID (K) IMM_CHARM (B) IMM_POISON (L) IMM_MAGIC (C) IMM_NEGATIVE (M) IMM_WEAPON (D) IMM_HOLY (N) IMM_BASH (E) IMM_ENERGY (O) IMM_PIERCE (F) IMM_MENTAL (P) IMM_SLASH (G) IMM_DISEASE (Q) IMM_FIRE (H) IMM_DROWNING (R) IMM_COLD (I) IMM_LIGHT (S) IMM_LIGHTNING (J) /* RES bits for mobs */ RES_CHARM (B) RES_ACID (K) RES_MAGIC (C) RES_POISON (L) RES_WEAPON (D) RES_NEGATIVE (M) RES_BASH (E) RES_HOLY (N) RES_PIERCE (F) RES_ENERGY (O) RES_SLASH (G) RES_MENTAL (P) RES_FIRE (H) RES_DISEASE (Q) RES_COLD (I) RES_DROWNING (R) RES_LIGHTNING (J) RES_LIGHT (S) /* VULN bits for mobs */ VULN_MAGIC (C) VULN_NEGATIVE (M) VULN_WEAPON (D) VULN_HOLY (N) VULN_BASH (E) VULN_ENERGY (O) VULN_PIERCE (F) VULN_MENTAL (P) VULN_SLASH (G) VULN_DISEASE (Q) VULN_FIRE (H) VULN_DROWNING (R) VULN_COLD (I) VULN_LIGHT (S) VULN_LIGHTNING (J) VULN_WOOD (X) VULN_ACID (K) VULN_SILVER (Y) VULN_POISON (L) VULN_IRON (Z) The 'gold' is the amount of gold the mobs gets when loaded. The 'exp' the amount of experience the mobile is worth (not used). The 'start-position' the starting position of the mobile. The 'default-position' is the position the mobile is put in after a fight. #define POS_DEAD 0 #define POS_MORTAL 1 #define POS_INCAP 2 #define POS_STUNNED 3 #define POS_SLEEPING 4 #define POS_RESTING 5 #define POS_SITTING 6 #define POS_FIGHTING 7 #define POS_STANDING 8 The 'sex' value may be 0 for neither, 1 for male, and 2 for female. The 'form-flag' is the type of body the mobile has. FORM_ANIMAL (G) FORM_WORM (R) FORM_SENTIENT (H) FORM_BLOB (S) FORM_UNDEAD (I) FORM_MAMMAL (V) FORM_CONSTRUCT (J) FORM_BIRD (W) FORM_MIST (K) FORM_REPTILE (X) FORM_INTANGIBLE (L) FORM_SNAKE (Y) FORM_BIPED (M) FORM_DRAGON (Z) FORM_CENTAUR (N) FORM_AMPHIBIAN (aa) FORM_INSECT (O) FORM_FISH (bb) FORM_SPIDER (P) FORM_COLD_BLOOD (cc) FORM_CRUSTACEAN (Q) The 'part-flag' is the body parts that can be left behind when a mobile is killed. Choose a combination of the following. /* body parts */ PART_HEAD (A) PART_EAR (J) PART_ARMS (B) PART_EYE (K) PART_LEGS (C) PART_LONG_TONGUE (L) PART_HEART (D) PART_EYESTALKS (M) PART_BRAINS (E) PART_TENTACLES (N) PART_GUTS (F) PART_FINS (O) PART_HANDS (G) PART_WINGS (P) PART_FEET (H) PART_TAIL (Q) PART_FINGERS (I) /* for combat */ PART_CLAWS (U) PART_SCALES (X) PART_FANGS (V) PART_TUSKS (Y) PART_HORNS (W) The 'size' relates the physical size of a mobile. T : SIZE_TINY S : SIZE_SMALL M : SIZE_MEDIUM L : SIZE_LARGE H : SIZE_HUGE G : SIZE_GIANT default : SIZE_MEDIUM The 'material' is the type of material the body is composed of. FORM_EDIBLE (A) FORM_POISON (B) FORM_MAGICAL (C) FORM_INSTANT_DECAY (D) FORM_OTHER (E) /* defined by material bit */ The optional 'A' sections and 'D' sections come after the main data. The mobile must be type 'M' to utilized the arrive/depart fields. An 'A' section ('Arrive-action') contains: A 'level' which determines what the maximum level this 'arrive-action this will be performed on' (eg. level=10 would work only on a mob/pc who is level 10 and under.) The -1 is used for all levels. Note: Put the lower level arrive-actions first before the higher ones and -1 would be last (default). Only the first match will be executed. The 'arrive-msg-to-room' is a string that contains the message to be sent to all in the room when a pc or mobile fitting the level restrictions enters. The '$n' depicts where the name of the mobile will be. The '$N' is where the name of the victim will be. The 'arrive-msg-to-victim' is a string that contains the message to be sent to only the victim when he/she arrives into the room. The '$n' depicts where the name of the mobile will be. The 'depart-msg-to-room' is a string that contains the message to be sent to all in the room when the victim leaves the room. The '$n' depicts where the name of the mobile will be. The '$N' is where the name of the victim will be. The 'depart-msg-to-victim' is a string that contains the message to be sent to only the victim when he/she leaves the room. The '$n' depicts where the name of the mobile will be. === The #OBJOLD/#OBJECTS section The syntax of this section is: #OBJOLD { # { E } { A } } #0 #OBJECTS { # { E } { A } } #0 The 'vnum' is the virtual number of the object. The 'keywords' are words which can be used in commands to identify the object. The 'short-description' is the description used by the 'act' function and other functions to identify the object. The first character of the short-description should be lower case, because this description is used in the middle of sentences. The 'long-description' is the description used when a character walks in the room and the object is visible. The 'material' is not used but put something that is meaningful since we will try to implement in the near future (eg 'wood' for a table). The 'item-type' is the type of the item (weapon, armor, potion, et cetera), as follows: ITEM_LIGHT 1 ITEM_CONTAINER 15 ITEM_SCROLL 2 ITEM_DRINK_CON 17 ITEM_WAND 3 ITEM_KEY 18 ITEM_STAFF 4 ITEM_FOOD 19 ITEM_WEAPON 5 ITEM_MONEY 20 ITEM_TREASURE 8 ITEM_BOAT 22 ITEM_ARMOR 9 ITEM_CORPSE_NPC 23 ITEM_POTION 10 ITEM_CORPSE_PC 24 ITEM_FURNITURE 12 ITEM_FOUNTAIN 25 ITEM_TRASH 13 ITEM_PILL 26 The 'extra-flags' describe more attributes of the object. More than one may be chosen. ITEM_GLOW 1 (A) ITEM_NODROP 128 (H) ITEM_HUM 2 (B) ITEM_BLESS 256 (I) ITEM_DARK 4 (C) ITEM_ANTI_GOOD 512 (J) ITEM_LOCK 8 (D) ITEM_ANTI_EVIL 1024 (K) ITEM_EVIL 16 (E) ITEM_ANTI_NEUTRAL 2048 (L) ITEM_INVIS 32 (F) ITEM_NOREMOVE 4096 (M) ITEM_MAGIC 64 (G) ITEM_METAL 131072 (R) /* * >>>IMPORTANT - Make sure all heavy metal armor has the metal flag<<< * I don't think that DARK, LOCK, and EVIL do anything, but * I'm not sure. If you use it and it crashes the MUD, I'll be sure * to let you know.... */ The 'wear-flags' describe whether the item can be picked up, and if so, what bodily locations can wear it. The wear-flags are: ITEM_TAKE 1 (A) ITEM_WEAR_ARMS 256 (I) ITEM_WEAR_FINGER 2 (B) ITEM_WEAR_SHIELD 512 (J) ITEM_WEAR_NECK 4 (C) ITEM_WEAR_ABOUT 1024 (K) ITEM_WEAR_BODY 8 (D) ITEM_WEAR_WAIST 2048 (L) ITEM_WEAR_HEAD 16 (E) ITEM_WEAR_WRIST 4096 (M) ITEM_WEAR_LEGS 32 (F) ITEM_WIELD 8192 (N) ITEM_WEAR_FEET 64 (G) ITEM_HOLD 16384 (O) ITEM_WEAR_HANDS 128 (H) /* * Lights should be ITEM_TAKE only */ The interpretation of the five 'value' numbers depends upon the type of the object. Interpretations are given below. === Meaning of Value Numbers by Item Type In the values below, 'sn' is a spell, indexed by slot number. A zero or negative sn means 'no spell'. 01 ITEM_LIGHT value[0] unused value[1] unused value[2] hours of light available, 0 is dead, -1 is infinite value[3] unused 02 ITEM_SCROLL value[0] level value[1] sn 1 value[2] sn 2 value[3] sn 3 03 ITEM_WAND value[0] level value[1] max charges value[2] current charges value[3] sn 04 ITEM_STAFF value[0] level value[1] max charges value[2] current charges value[3] sn 05 ITEM_WEAPON value[0] unused value[1] unused value[2] unused value[3] weapon type: 01 slice 02 stab 03 slash 04 whip 05 claw 06 blast 07 pound 08 crush 09 grep 10 bite 11 pierce 12 suction 08 ITEM_TREASURE value[0] unused value[1] unused value[2] unused value[3] unused 09 ITEM_ARMOR value[0] unused value[1] unused value[2] unused value[3] unused 10 ITEM_POTION value[0] level value[1] sn 1 value[2] sn 2 value[3] sn 3 12 ITEM_FURNITURE value[0] unused value[1] unused value[2] unused value[3] unused 13 ITEM_TRASH value[0] unused value[1] unused value[2] unused value[3] unused 15 ITEM_CONTAINER value[0] weight capacity value[1] flags: 1 closeable, 2 pickproof, 4 closed, 8 locked value[2] key vnum value[3] unused 17 ITEM_DRINK_CON value[0] capacity value[1] current quantity value[2] liquid number (see 'liq_table' in const.c) value[3] if non-zero, drink is poisoned 18 ITEM_KEY value[0] unused value[1] unused value[2] unused value[3] unused 19 ITEM_FOOD value[0] hours of food value value[1] unused value[2] unused value[3] if non-zero, food is poisoned 20 ITEM_MONEY value[0] value in gold pieces value[1] unused value[2] unused value[3] unused 22 ITEM_BOAT value[0] unused value[1] unused value[2] unused value[3] unused 23 ITEM_CORPSE_NPC value[0] unused value[1] unused value[2] unused value[3] unused 24 ITEM_CORPSE_PC value[0] unused value[1] unused value[2] unused value[3] unused 25 ITEM_FOUNTAIN value[0] unused value[1] unused value[2] unused value[3] unused 26 ITEM_PILL value[0] level value[1] sn 1 value[2] sn 2 value[3] sn 3 The 'weight' of the object is just that in pounds. The 'Cost' is how much the item is worth. This is used at shops. The 'condition' is what condition the item is in based on a percent. ('P') : 100% Perfect ('G') : 90 Good ('A') : 75 Awful ('W') : 50 Worn ('D') : 25 Disrepair ('B') : 10 Broken ('R') : 0 Ruined default: 100 Perfect The optional 'E' sections and 'A' sections come after the main data. An 'E' section ('extra description') contains a keyword-list and a string associated with those keywords. This description string is used when a character looks at a word on the keyword list. An 'A' section ('apply') contains an apply-type and an apply-value. When a character uses this object as equipment (holds, wields, or wears it), then the value of 'apply-value' is added to the character attribute identified by 'apply-type'. Not all 'apply-types' are implemented; you have to read the function 'affect_modify' in handler.c to see exactly which ones are. APPLY_NONE 0 APPLY_MOVE 14 APPLY_STR 1 APPLY_AC 17 APPLY_DEX 2 APPLY_HITROLL 18 APPLY_INT 3 APPLY_DAMROLL 19 APPLY_WIS 4 APPLY_SAVING_PARA 20 APPLY_CON 5 APPLY_SAVING_ROD 21 APPLY_SEX 6 APPLY_SAVING_PETRI 22 APPLY_MANA 12 APPLY_SAVING_BREATH 23 APPLY_HIT 13 APPLY_SAVING_SPELL 24 An object may have an unlimited number of 'E' and 'A' sections. === The #ROOMS section The syntax of this section is: #ROOMS { # { D } { E } S } #0 The 'vnum' is the virtual number of the room. === Vnum Assignments === The 'name' is the name of the room. The 'description' is the long multi-line description of the room. The 'area' is obsolete and unused. Rooms belong to whatever area was most recently defined with #AREA. The 'room-flags' describe more attributes of the room. ROOM_DARK A ROOM_NO_SUN B ROOM_NO_MOB C ROOM_INDOORS D ROOM_PRIVATE J ROOM_SAFE K ROOM_SOLITARY L ROOM_PET_SHOP M ROOM_NO_RECALL N ROOM_IMP_ONLY O ROOM_GODS_ONLY P ROOM_HEROES_ONLY Q ROOM_NEWBIES_ONLY R ROOM_LAW S ROOM_DEATH T ROOM_BLACK U ROOM_WHITE V ROOM_FOG W ROOM_NO_TELEPORT X The 'sector-type' identifies the type of terrain. This affects movement cost through the room. Certain sector types (air and boat) require special capabilities to enter. SECT_INSIDE 0 SECT_WATER_SWIM 6 SECT_CITY 1 SECT_WATER_NOSWIM 7 SECT_FIELD 2 SECT_UNUSED 8 SECT_FOREST 3 SECT_AIR 9 SECT_HILLS 4 SECT_DESERT 10 SECT_MOUNTAIN 5 SECT_MAX 11 Unlike mobiles and objects, rooms don't have any keywords associated with them. One may not manipulate a room in the same way one manipulates a mobile or object. The optional 'D' sections and 'E' sections come after the main data. A 'D' section contains a 'door' in the range from 0 to 5: 0 north 1 east 2 south 3 west 4 up 5 down A 'D' command also contains a 'description' for that direction, and 'keywords' for manipulating the door. 'Doors' include not just real door, but any kind of exit from the room. The 'locks' value is 0 for an unhindered exit, 1 for a door, and 2 for a pick-proof door. The 'key' value is the vnum of an object which locks and unlocks the door. Lastly, 'to_room' is the vnum of the room to which this door leads. You must specify two 'D' sections, one for each side of the door. If you specify just one then you'll get a one-way exit. An 'E' section (extended description) contains a 'keywords' string and a 'description' string. As you might guess, looking at one of the words in 'keywords' yields the 'description' string. The 'S' at the end marks the end of the room. It is not optional. === The #RESETS section The syntax of this section is: #RESETS { * } { M <:number> \ } { O <:number> <:number> \ } { P <:number> <:number> \ } { G <:number> <:number> \ } { E <:number> <:number> \ } { D <:number> \ } { R <:number> \ } S To reset an area, the server executes each command in the list of reset commands once. Each area is reset once when the server loads, and again periodically as it ages. An area is reset if it is at least 3 area-minutes old and is empty of players, or if it is 15 area-minutes old. At the 14 area-minute mark, each (awake) player in the area is warned of the impending reset. These values are coded into the function 'reset_area' in 'db.c'. An 'area-minute' varies between 30 and 90 seconds of real time, with an average of 60 seconds. The variation defeats area timekeepers. The 'resets' section contains a series of single lines. The backslashes and line splitting above are for readability; they are not part of the file format. Because of the end-of-line comments, this section is not as free-format as other sections. The reset commands are: * comment M read a mobile O read an object P put object in object G give object to mobile E equip object to mobile D set state of door R randomize room exits S stop (end of list) The '*' lines contain comments. The 'S' line is the last line of the section. Every other command contains four numbers (three for the 'G' command). The first number if 0 means it will always execute, if 1 will only execute if the previous command was successful. The next three (or two) numbers are interpreted as follows: For the 'M' command, the second number is the vnum of a mobile to load. The third number is the limit of how many of this mobile may be present in the world. The fourth number is the vnum of the room where the mobile is loaded. For the 'O', 'P', 'G', and 'E' commands, the second number is the vnum of an object to load. The third number is ignored. For the 'O' command, the fourth number is the vnum of the room where the object is loaded. The object is not loaded if the target room already contains any objects with this vnum. The object is also not loaded if any players are present in the area. For the 'P' command, the fourth number is the vnum of a container object where the object will be loaded. The actual container used is the most recently loaded object with the right vnum; for best results, there should be only one such container in the world. The object is not loaded if no container object exists, or if someone is carrying it, or if it already contains one of the to-be-loaded object. For the 'G' command, there is no fourth number. If the most recent 'M' command succeeded (e.g. the mobile limit wasn't exceeded), the object is given to that mobile. If the most recent 'M' command failed (due to hitting mobile limit), then the object is not loaded. For the 'E' command, the fourth number is an equipment location. If the most recent 'M' command succeeded, that mobile is equipped with the object. If the most recent 'M' command failed, then the object is not loaded. WEAR_NONE -1 WEAR_HANDS 9 WEAR_LIGHT 0 WEAR_ARMS 10 WEAR_FINGER_L 1 WEAR_SHIELD 11 WEAR_FINGER_R 2 WEAR_ABOUT 12 WEAR_NECK_1 3 WEAR_WAIST 13 WEAR_NECK_2 4 WEAR_WRIST_L 14 WEAR_BODY 5 WEAR_WRIST_R 15 WEAR_HEAD 6 WEAR_WIELD 16 WEAR_LEGS 7 WEAR_HOLD 17 WEAR_FEET 8 MAX_WEAR 18 All objects have a level limit, which is computed by inheritance from the most recently read 'M' command (whether it succeeded or not) in 'area_update' in 'db.c'. As distributed, an object's level equals the mobile level minus 2, clipped to the range 0 to 51. For the 'D' command, the second number is the vnum of a room. The third number is a door number from 0 to 5. The fourth number indicates how to set the door: 0 for open and unlocked; 1 for closed and unlocked; 2 for closed and locked. Room exits must be coherent: if room 1 has an exit to room 2, and room 2 has an exit in the reverse direction, that exit must go back to room 1. This doesn't prevent one-way exits; room 2 doesn't HAVE to have an exit in the reverse direction. For the 'R' command, the second number is the vnum of a room. The third number is a door number. When this command, the doors from 0 to the indicated door number are shuffled. The room will still have the same exits leading to the same other rooms as before, but the directions will be different. Thus, a door number of 4 makes a two-dimensional maze room; a door number of 6 makes a three-dimensional maze room. Use of both the 'D' and 'R' commands on the same room will yield unpredicatable results. Any line (except an 'S' line) may have a comment at the end. === The #SHOPS section The syntax of this section is: #SHOPS { \ \ \ \ \ } 0 Like the #RESETS section, the #SHOPS section has one command per line. The 'keeper' is the vnum of the mobile who is the shopkeeper. All mobiles with that vnum will be shopkeepers. The 'trade-0' through 'trade-5' numbers are item types which the shopkeeper will buy. Unused slots should have a '0' in them; for instance, a shopkeeper who doesn't buy anything would have five zeroes. The 'profit-buy' number is a markup for players buying the item, in percentage points. 100 is nominal price; 150 is 50% markup, and so on. The 'profit-sell' number is a markdown for players selling the item, in percentage points. 100 is nominal price; 75 is a 25% markdown, and so on. The buying markup should be at least 100, and the selling markdown should be at most 100. The 'open-hour' and 'close-hour' numbers define the hours when the shopkeeper will do business. For a 24-hour shop, these numbers would be 0 and 23. Everything beyond 'close-hour' to the end of the line is taken to be a comment. Note that there is no room number for a shop. Just load the shopkeeper mobile into the room of your choice, and make it a sentinel. Or, for a roving shopkeeper, just make it non-sentinel. The objects a shopkeeper sells are exactly those loaded by 'G' reset commands for that shopkeeper. These items replenish automatically. If a player sells an object to a shopkeeper, the shopkeeper will keep it for resale if he, she, or it doesn't already have an identical object. These items do not replenish. === The #SPECIALS section The syntax of this section is: #SPECIALS { * } { M } S Like the #RESETS section, the #SPECIALS section has one command per line. This section defines special functions (spec-fun's) for mobiles. A spec-fun is a C function which gives additional behavior to all mobiles with a given vnum, such as the peripatetic mayor or the beholder casting spells in combat. See 'special.c' for a list of available spec-fun's. The 'M' command assigns 'spec-fun' to all mobiles of with virtual number 'mob-vnum'. All spec-fun's are assigned by name. An 'M' line may have a comment at the end. Every three seconds, the server function 'mobile_update' examines every mobile in the game. If the mobile has an associated spec-fun, then 'mobile_update' calls that spec-fun with a single parameter, the 'ch' pointer for that mob. The spec-fun returns TRUE if the mobile did something, or FALSE if it did not. If the spec-fun returns TRUE, then further activity by that mobile is suppressed. To add a new special function: (1) Add a DECLARE_SPEC_FUN line to the top of 'special.c'. (2) Add a line for translating the ascii name of the function into a function pointer to the function 'spec_lookup' in 'special.c'. (3) Write the spec-fun and add it to 'special.c'. Note that Merc special functions take a single parameter, rather than the three parameters of Diku. If you have an Ansi C compiler, you're protected against accidental mismatches. (4) Assign the spec-fun by writing an appropriate line into the #SPECIALS section in an area file. Any number of mobs may have the same spec-fun. === The #$ section The syntax of this section is: #$ This section marks the end of an area file. If you concatenate several area files into one, remember to delete the terminating '#$' from all but the last file. Conversely, if you split area files, remember to terminate each new file with a '#$'. === Slot Numbers These slot numbers are used in magical objects to indicate spells. Save files do not use slot numbers; they use names instead. 0 NULL 70 acid blast 1 armor 3 bless 4 blindness 5 burning hands 6 call lightning 63 cause critical 62 cause light 64 cause serious 82 change sex 7 charm person 8 chill touch 10 colour spray 57 continual light 11 control weather 12 create food 80 create spring 13 create water 14 cure blindness 15 cure critical 16 cure light 43 cure poison 61 cure serious 17 curse 18 detect evil 44 detect hidden 19 detect invis 20 detect magic 21 detect poison 22 dispel evil 59 dispel magic 23 earthquake 24 enchant weapon 25 energy drain 72 faerie fire 73 faerie fog 26 fireball 65 flamestrike 56 fly 83 gate 39 giant strength 27 harm 28 heal 53 identify 77 infravision 29 invis 58 know alignment 30 lightning bolt 31 locate object 32 magic missile 69 mass invis 74 pass door 33 poison 34 protection 81 refresh 35 remove curse 36 sanctuary 67 shield 37 shocking grasp 38 sleep 66 stone skin 40 summon 2 teleport 41 ventriloquate 68 weaken 42 word of recall 200 acid breath 201 fire breath 202 frost breath 203 gas breath 204 lightning breath