This section discusses the area format used by Grendel, common practices when building, as well as various structures and constants used in areas.
Listed below is a sample area (actually a trimmed-down version of the roads.area file that is shipped with Grendel). Attentive readers will notice that the format of the area is quite similar to the format used in the SMAUG codebase.
A Grendel area file consists of several sections: #AREA, #ROOMS, #OBJECTS, #MOBILES and #RESETS. Of these, only the #AREA section is required.
An integrated GUI area builder is currently in development, and a prototype can be found in the (highly experimental) Grendel Management Console.
Since a switch to an XML area format is planned, this section is subject to change.
Example 2. An example area
#RANGES 100 199 100 199 100 199 Hints for min/max rooms/mobiles/objects #AREA Central Ruia Name of the area Grimlord Name of the owner/builder A fresh wind blows through your hair. Message to display when area resets 35 Number of gamerounds (roughly 75 secs) between resets 8 18 0 Temp. multiplier, avg. temperature, flags (see: Table 2, “Area flags”) #ROOMS #100 Number (vnum) of room The Great Junction Name of room The wind blows through your hair as you arrive at the great junction Multiline room description of roads, the central point in Ruia. Here, 3 roads come together. To the south, the road to Southaven. To the north, the road to Gailen and Castle Pakthan. To the east, you see the Warriors School. ~ Separator 0 0 500 3 D 101 3 0 0 An exit to room #101, direction (see: Table 4, “Directions”), flags (see: (Table 5, “Exit flags”) E sign Extra description "sign" The sign says 'Southaven south'. Multiline extra description ~ Separator S End of room #100 #101 Southaven Road This road is one of the main roads leading through Ruia. It takes you from the junction to Southaven or back. The road is paved well and walking on this road is pleasant. ~ 0 0 500 3 D 100 1 0 0 D 102 3 0 0 S #102 Southaven Central Square The beautiful fountain built on the square shows the welfare of the city. Numerous little drops burst out of the fountain, falling down till they hit the little pool of water. Many people come here to sit and eat or talk. To the north, you see some shops. To the east, you see the bank. To the west you see the town hall. To the south, you can continue to the docks. ~ 0 0 500 2 D 101 1 0 0 S #END #MOBILES Mobiles (NPC's) section #100 Number (vnum) of NPC Syra Name Syra is here Short description Syra, protectress of Southaven, patrols for danger Long description 800 1 Level, sex (see Table 1, “Sexes”) 15 521 0 0 0 Armour, flags (see Table 6, “NPC flags”), gold carried, height, weight skill: Burning Hands NPC has skill "Burning Hands" skill: Magic Missile skill: Slashing Weapons skill: Second Attack > give.cod Use GMC program "give.cod" #END #OBJECTS Objects section #100 Number (vnum) of object a fountain Name a sparkling fountain Short description a $B$7sparkling$A$3 $2brew$3 fountain has been placed here Long description (note the use of coloring!) 12 none none Item type (see Table 3, “Item types and values”), bodyparts to wear object on (see the section called “Races”) 0 0 12 0 value[1..4] (see Table 3, “Item types and values”) 0 4097 0 Weight (in ounces), flags (see Table 8, “Object flags”), avg. cost #101 a robe a stained robe a robe, cluttered with dirty stains, lies here 1 body none 0 2 2 0 0 0 0 A "" 0 { apply_max_hp 20 } #END #RESETS M 100 102 1 G 101 100 0 O 100 101 1 #END $
Non-Player Characters (NPC's) are the artificially intelligent (sic) population, possibly even the core, of a mud. They are sometimes called "Mobiles", which, apart from the unfortunate name collision with certain wireless devices, wrongfully suggests that NPC's can't be forced to stay in one place.
NPC's can be quite a challenge for your players, so try to be careful when tinkering with the various values that define a NPC: balance is everything.
Start a text editor (such as Notepad), and open the file areas\area.list. Add a line with the filename of your new area to the top of the file, save the file, and reboot (or copyover) the server.
Grendel supports the formatting and sending of ANSI (color) control codes. This can be very helpful, especially when constructing objects, where the intensity of the coloring usually determines the value and worth of the object.
Example 3. Using colors
$A$0black $A$1blue $A$2green $A$3turquoise $A$4red $A$5purple $A$6yellow $A$7gray $B$0dark gray $B$1bright blue $B$2bright green $B$3bright turquoise $B$4bright red $B$5bright purple $B$6bright yellow $B$7white
Table 2. Area flags
| Identifier | Description | Bitvector | Value |
|---|---|---|---|
| AREA_NORESET | Do not reset area | BV00 | 1 |
| AREA_NOPC | No players allowed | BV01 | 2 |
| AREA_PROTO | Prototype | BV02 | 4 |
Table 3. Item types and values
| Identifier | Description | Value | Use of value[1] | Use of value[2] | Use of value[3] | Use of value[4] |
|---|---|---|---|---|---|---|
| ITEM_WEAPON | Weapon | 1 | condition | number of dice | size of dice | type of weapon (see: Table 9, “Weapon types”) |
| ITEM_ARMOR | Armor | 2 | condition | type of armor (see: Table 10, “Armor types”) | modifier | unused |
| ITEM_FOOD | Something edible | 3 | condition | poisoned | hours of value | unused |
| ITEM_DRINK | Container filled with some liquid | 4 | capacity | current quantity | liquid type (see: Table 11, “Liquids”) | poisoned |
| ITEM_LIGHT | Light (i.e. torch) | 5 | hours of light remaining (0 = out) | unused | unused | unused |
| ITEM_TRASH | Trah | 6 | unused | unused | unused | unused |
| ITEM_MONEY | Gold coins | 7 | amount | unused | unused | unused |
| ITEM_SPECIAL | Special item | 8 | unused | unused | unused | unused |
| ITEM_GEM | Magical gem | 9 | mana type (unused) | spell level | mana when charged | unused |
| ITEM_CONTAINER | Contains other objects | 10 | unused | unused | unused | unused |
| ITEM_CORPSE | Corpse of killed (N)PC | 11 | unused | unused | unused | unused |
| ITEM_FOUNTAIN | Fountain | 12 | unused | unused | liquid type (see: Table 11, “Liquids”) | unused |
| ITEM_BLOOD | Blood trail | 13 | direction of blood trail (see: Table 4, “Directions”) | unused | unused | unused |
| ITEM_PORTAL | Portal | 14 | unused | unused | unused | unused |
| ITEM_KEY | Key | 15 | unique key number | unused | unused | unused |
Table 4. Directions
| Identifier | Description | Value |
|---|---|---|
| DIR_NORTH | North | 1 |
| DIR_EAST | East | 2 |
| DIR_SOUTH | South | 3 |
| DIR_WEST | West | 4 |
| DIR_DOWN | Down | 5 |
| DIR_UP | Up | 6 |
| DIR_SOMEWHERE | Somewhere (i.e. for portals) | 7 |
Table 5. Exit flags
| Identifier | Description | Bitvector | Value |
|---|---|---|---|
| EX_ISDOOR | Exit is a door | BV00 | 1 |
| EX_CLOSED | Closed | BV01 | 2 |
| EX_LOCKED | Locked | BV02 | 4 |
| EX_PICKPROOF | Lockpick will fail | BV03 | 8 |
| EX_SECRET | Hidden exit | BV04 | 16 |
| EX_SWIM | Character needs to swim to enter | BV05 | 32 |
| EX_FLY | Character needs to fly to enter | BV06 | 64 |
| EX_CLIMB | Inclination | BV07 | 128 |
| EX_PORTAL | Portal | BV08 | 256 |
| EX_NOBREAK | Can't break door | BV09 | 512 |
| EX_NOMOB | NPC's not allowed | BV10 | 1024 |
| EX_ENTER | Use "enter" command to enter | BV11 | 2048 |
| EX_UNDERWATER | Under water | BV12 | 4096 |
Table 6. NPC flags
| Identifier | Description | Bitvector | Value |
|---|---|---|---|
| ACT_AGGRESSIVE | Aggressive (auto-attack) npc | BV02 | 4 |
| ACT_SENTINEL | Does not wander (guard) | BV03 | 8 |
| ACT_SCAVENGER | Picks up stray objects | BV04 | 16 |
| ACT_STAY_AREA | Does not wander beyond area boundaries | BV05 | 32 |
| ACT_HUNTING | Actively hunts opponents when attacked | BV06 | 64 |
| ACT_FASTHUNT | Fast hunter | BV07 | 128 |
| ACT_MOBINVIS | Invisible | BV08 | 256 |
| ACT_TEACHER | Can teach skills/spells | BV09 | 512 |
| ACT_BANKER | Banker | BV10 | 1024 |
| ACT_SPIRIT | Non-magic weapons are ineffective | BV11 | 2048 |
| ACT_NOBASH | Impossible to bash | BV12 | 4096 |
| ACT_SHOPKEEP | Shopkeeper | BV13 | 8192 |
| ACT_IMMORTAL | Immortal | BV14 | 16384 |
| ACT_PROTO | Prototype | BV31 | 2147483648 |
Table 7. Room flags
| Identifier | Description | Bitvector | Value |
|---|---|---|---|
| ROOM_DARK | Total darkness | BV00 | 1 |
| ROOM_DEATH | Deathtrap | BV01 | 2 |
| ROOM_NOMOB | Mobiles not allowed | BV02 | 4 |
| ROOM_INDOORS | Indoors | BV03 | 8 |
| ROOM_GOOD | Only good aligned players allowed | BV04 | 16 |
| ROOM_EVIL | Only evil aligned players allowed | BV05 | 32 |
| ROOM_NOCAST | Using magic not allowed | BV06 | 64 |
| ROOM_TUNNEL | Tunnel (could cause problems for larger sized characters) | BV07 | 128 |
| ROOM_PRIVATE | Mere mortals can not enter | BV08 | 256 |
| ROOM_SAFE | Fighting not allowed | BV09 | 512 |
| ROOM_SOLITARY | Only one character at a time | BV10 | 1024 |
| ROOM_NORECALL | Recall spell not allowed | BV11 | 2048 |
| ROOM_NODROPALL | Command "drop all" can not be used here | BV12 | 4096 |
| ROOM_NOSUMMON | Summon spell not allowed | BV13 | 8192 |
| ROOM_CLANSTORE | Clan store | BV14 | 16384 |
| ROOM_TELEPORT | Teleport | BV15 | 32768 |
| ROOM_NOFLOOR | No floor | BV16 | 65536 |
| ROOM_MANAROOM | Accelerated mana replenishment | BV17 | 131072 |
| ROOM_NOTRADE | Trading not allowed | BV18 | 262144 |
| ROOM_PROTO | Prototype | BV31 | 2147483648 |
Table 8. Object flags
| Identifier | Description | Bitvector | Value |
|---|---|---|---|
| OBJ_NOPICKUP | Can not be picked up (i.e. fountains) | BV00 | 1 |
| OBJ_GLOW | Object glows | BV01 | 2 |
| OBJ_HUM | Object hums | BV02 | 4 |
| OBJ_ANTI_GOOD | Can only be worn by evil-aligned characters | BV03 | 8 |
| OBJ_ANTI_EVIL | Can only be worn by good-aligned characters | BV04 | 16 |
| OBJ_LOYAL | Stays with wearer (even when killed) | BV05 | 32 |
| OBJ_NOREMOVE | Can not be removed | BV06 | 64 |
| OBJ_NODROP | Can not be dropped | BV07 | 128 |
| OBJ_CLANOBJECT | Belongs to a clan | BV08 | 256 |
| OBJ_HIDDEN | Hidden | BV09 | 512 |
| OBJ_POISON | Poisoned | BV10 | 1024 |
| OBJ_MISSILE | Missile | BV11 | 2048 |
| OBJ_NOSAC | Can not be sacrificed | BV12 | 4096 |
| OBJ_NODECAY | Does not decay | BV13 | 8192 |
| OBJ_PROTO | Prototype | BV31 | 2147483648 |
Table 9. Weapon types
| Identifier | Description | Value |
|---|---|---|
| FG_NONE | No weapon | 0 |
| FG_PUNCH | Punch (fists of fury) | 1 |
| FG_SLASH | Slashing weapon (sword) | 2 |
| FG_PIERCE | Piercing weapon (knife) | 3 |
| FG_CLEAVE | Cleaving weapon (axe) | 4 |
| FG_BLAST | Blasting weapon (missile) | 5 |
| FG_CRUSH | Concussion weapon (morningstar) | 6 |
| FG_BITE | Bite | 7 |
| FG_CLAW | Claw | 8 |
| FG_WHIP | Whip | 9 |
| FG_STAB | Alias for FG_PIERCE | 10 |
| FG_GAZE | If looks could kill... | 11 |
| FG_BREATH | Foul breath | 12 |
| FG_STING | Sting | 13 |
Table 10. Armor types
| Identifier | Description | Value |
|---|---|---|
| ARMOR_HAC | Head armor | 1 |
| ARMOR_BAC | Body armor | 2 |
| ARMOR_AAC | Arm armor | 3 |
| ARMOR_LAC | Leg armor | 4 |
Table 11. Liquids
| Identifier | Description | Value |
|---|---|---|
| LIQ_WATER | Plain H2O | 1 |
| LIQ_BEER | Beer | 2 |
| LIQ_ALE | Ale | 3 |
| LIQ_WHISKEY | Scotch | 4 |
| LIQ_VODKA | Schmirnoff | 5 |
| LIQ_WINE | Wine | 6 |
| LIQ_JUICE | OJ | 7 |
| LIQ_MILK | Milk | 8 |
| LIQ_TEA | Tea, earl gray, hot | 9 |
| LIQ_COFFEE | Coffee | 10 |
| LIQ_COLA | Coca-Cola | 11 |
| LIQ_SPECIAL | Special Brew | 12 |