dbsup.doc
1 /* ************************************************************************ 2 * Copyright (C) 1990, 1991 - see 'license.doc' for complete information. * 3 ************************************************************************* */ 4 5 DATABASE SUPPLEMENTAL DOCUMENTATION 6 "dbsup.doc" 7 8 9 World File field description: 10 ============================= 11 12 Main structure notes: 13 --------------------- 14 15 #<virtual number> is: 16 A number for the given room. No two rooms may have the same number. 17 The <virtual number> must always increase when browsing down the 18 world file (but increments can be larger than one). 19 20 <name>~<NL>: 21 This name is the "title" of the room. This title is also used in special 22 procedures like: 23 "exits" 24 "brief mode" 25 26 <description>~<NL>: 27 This is the general description of the room. 28 29 <zone nr> is: 30 The number of the zone in which this room is located. This number is used 31 for resetting zones and monster zone movement. See the zone file. 32 33 <room_flags> are: 34 A bitvector consisting of the room conditions as: 35 36 DARK 1 Light must be used to see anything. 37 DEATH 2 A player 'dies' (no xp lost) when entering. 38 It is a good idea to: 39 *Have these rooms light, because then EXITS will show 40 the room title, for example "In Boiling Water". 41 *Make exits to all rooms from which one can enter the 42 death_room, then the "death cry" will be heard by 43 other members of the group considering following... 44 NO_MOB 4 No monsters may walk around in here 45 INDOORS 8 This is inside (a house,cave or dungeon for example) 46 LAWFULL 16 ??? 47 NEUTRAL 32 ??? 48 CHAOTIC 64 ??? 49 NO_MAGIC 128 Not implemented. 50 TUNNEL 256 ??? 51 PRIVATE 512 It is impossible to teleport to this room if it 52 already contains two characters. The 'teleport' 53 spell will never teleport a player into this room. 54 GODROOM 1024 Super-private room: Immortals can not 'goto' this room. 55 BFS_MARK 2048 RESERVED FOR INTERNAL USE -- do not use. 56 57 ??? means that the flag isn't used yet (and you Shouldn't use it either!) 58 59 60 <sector_type> is: 61 This determines how many movement points are used when moving through 62 a location of the type - use one of the numbers 0..7 (they are NOT the 63 movement-points used - merely indexes to a lookup-table): 64 65 SECT_INSIDE 0 Uses as if walking indoors 66 SECT_CITY 1 Uses as if walking in a city 67 SECT_FIELD 2 Uses as if walking in a field 68 SECT_FOREST 3 Uses as if walking in a forest 69 SECT_HILLS 4 Uses as if walking in hills 70 SECT_MOUNTAIN 5 Uses as if climbing in mountains 71 SECT_WATER_SWIM 6 Uses as if swimming 72 SECT_WATER_NOSWIM 7 Impossible to swim water - requires a boat 73 74 75 Direction fields: 76 ----------------- 77 78 <Exit number> is one of: 79 0 = North 80 1 = East 81 2 = South 82 3 = West 83 4 = Up 84 5 = Down 85 86 <general description><NL>~<NL>: 87 What a player will see if he types 'look <direction>' 88 89 <keyword list>~<NL>: 90 used for commands like 'open', 'close', etc. should be 'door' for ordinary 91 doors. Example: An exit from a given room leads through a cupboard. The 92 keyword list for this exit might look like this: 93 94 "cupboard door~" 95 96 97 <Door flag> [NL]: 98 99 If <Door Flag> is 1, the exit can be locked/unlocked/opened/closed/picked. 100 If it is 2, the exit can only be locked/unlocked/opened/closed. 101 If it is 0, these commands won't work. (The exit can still be closed at 102 reset, however; maybe to be opened by some special routine, like a concealed 103 handle). 104 105 The state of the doors after reset may be controlled by a command in the 106 reset-command table (see the zone file). The initial state of a door is 107 open. 108 109 <Key Number> [NL]: 110 The number of the object which can unlock/lock the door (in the direction 111 given). If a player carries/holds this object, he can lock/unlock. 112 <Key Number> == -1 means no keyhole. If <Door flag> is 0, the value of this 113 field is ignored. 114 115 <to_room> <NL>: 116 The virtual number of the room to which the exit leads. If this number is 117 -1 (NOWHERE), the exit doesn't lead anywhere. This might be useful for 118 adding an exit-description in a direction which doesn't actually lead 119 anywhere. 120 121 ** Note about doors. You must make a door in both rooms that the door 122 is set between. 123 124 Extra descriptions: 125 ------------------- 126 127 <blank separated keyword list>~<NL> is: 128 A list of the keywords that will allow the extra description to be 129 displayed. The keywords must must be seperated by blanks. 130 131 132 <description><NL>~<NL>: 133 The description that is show when a player types 'look at <keyword>' 134 and keyword matches one of the above. 135 136 137 Example of a room entry is the database: 138 ---------------------------------------- 139 140 #100 141 The Lego temple~ 142 You stand in a tiny, red temple built entirely from Lego bricks. It is, 143 sadly, not a very interesting place, and perhaps you should leave through 144 the portal which leads south to a sunny garden. 145 ~ 146 1 12 0 147 D2 148 You see the grand portal of the Lego church. Beyond is an inviting garden. 149 ~ 150 portal grand~ 151 1 2 107 152 E 153 portal~ 154 The portal is high and arched, built out of lego bricks of the finest quality. 155 ~ 156 E 157 brick~ 158 The bricks are all in bright different colours. 159 ~ 160 S 161 #101 162 . 163 . 164 . 165 166 Facts about this room is: 167 Room number 100 168 Zone number 1 169 Room Flags (8+4=12) INDOORS and NO_MOB 170 Sector Type Inside (movement loss calc only) 171 One exit (D2) to the south with 'look south' description 172 Door Flag 1 173 Key no. 2 174 Leads to room 107 175 Extra description for the portal and bricks. 176 177 ------------------------------------------------------------------------- 178 179 Monster fields description: 180 =========================== 181 182 #<virtual number><NL> is: 183 The monsters virtual number. Rules are same as for room virtual numbers. 184 185 <namelist><!NL>~<NL> 186 The space-separated name alias list. 187 188 <short description><!NL>~<NL> 189 This string will be displayed when the monster take action, for example 190 if it is "The Beastly Fido", and fido leaves south the message will be 191 "The Beastly Fido leaves south." 192 193 <long description><NL>~<NL> 194 This description is displayed when the monster is in it's "default" 195 position. When not in the default position, a message like: 196 "<short description> is sleeping here." could be displayed. 197 198 <description><NL>~<NL> 199 This will be displayed when a player looks at the monster. 200 201 <action flags>[NL] 202 203 This bitvector define how the monster behave. The bits mean: 204 205 ACT_SPEC 1 This means that there is a special programmed C 206 procedure connected to the monster. When this bit 207 is set the monster "function pointer" must be 208 assigned in the "spec_assign.c" file. 209 210 ACT_SENTINEL 2 When this bit is set the monster will NOT 211 move around in the world. 212 213 ACT_SCAVENGER 4 When this bit is set, monsters will pick up stuff 214 lying on the ground. It will pick up the most 215 expensive items first. 216 217 ACT_ISNPC 8 RESERVED FOR INTERNAL USE 218 219 ACT_NICE_THIEF 16 When this bit is set, a monster will not attack 220 a thief which has been caught in the act of 221 stealing from this monster. 222 223 ACT_AGGRESSIVE 32 When this bit is set, the monster will attack and 224 attempt to kill any player it can get it's claws on. 225 It will not attack players it can't see (for example 226 dark rooms or when player is invisible, unless the 227 monster can detect invisibility) 228 229 ACT_STAY_ZONE 64 When this bit is set, the monster will never move 230 into another zone of the world (this is good for 231 keeping your monsters in your own adventure). 232 233 ACT_WIMPY 128 When this bit is set, the monster will flee when it's 234 getting percentwise low on hitpoints. 235 If the monster is both aggressive and wimpy, then it 236 will only attack players that are NOT awake! (ie. also 237 suffering players). 238 239 ACT_AGGRESSIVE_EVIL 240 256 When this bit is set, the monster will attack players 241 with evil alignment. 242 243 ACT_AGGRESSIVE_GOOD 244 512 When this bit is set, the monster will attack players 245 with good alignment. 246 247 ACT_AGGRESSIVE_NEUTRAL 248 1024 When this bit is set, the monster will attack players 249 who are neutrally aligned. 250 251 ACT_MEMORY 2056 When this bit is set, the monster will remember 252 players who attack it, and attack the player back 253 if it sees him or her again. 254 255 <affection flags>[NL] 256 257 This is a bitvector that indicates what the monster is affected by. 258 Puff could for example be able to "detect invisible" or maybe 259 "sanctuary" (1/2 damage). A lot of these bits are meant for players 260 only (in a context with a spell), and should NOT be used when indicated. 261 The bits are: 262 263 AFF_BLIND 1 RESERVED PLAYERS 264 AFF_INVISIBLE 2 The monster is invisible 265 AFF_DETECT_EVIL 4 RESERVED PLAYERS 266 AFF_DETECT_INVISIBLE 8 The monster can see invisible players 267 (Especially good for aggressive npc's) 268 AFF_DETECT_MAGIC 16 RESERVED PLAYERS 269 AFF_SENCE_LIFE 32 RESERVED PLAYERS 270 AFF_HOLD 64 ??? DO NOT USE 271 AFF_SANCTUARY 128 The monster has sanctuary (1/2 damage) 272 AFF_GROUP 256 RESERVED PLAYERS 273 AFF_CURSE 1024 ??? DO NOT USE 274 AFF_FLAMING 2048 ??? DO NOT USE 275 AFF_POISON 4096 RESERVED PLAYERS 276 AFF_PROTECT_EVIL 8192 ??? DO NOT USE 277 AFF_PARALYSIS 16384 ??? DO NOT USE 278 AFF_MORDEN_SWORD 32768 ??? DO NOT USE 279 AFF_FLAMING_SWORD 65536 ??? DO NOT USE 280 AFF_SLEEP 131072 RESERVED PLAYERS 281 AFF_DODGE 262144 ??? DO NOT USE 282 AFF_SNEAK 524288 The message "The xxx leaves direction" will 283 not be displayed when the monster moves 284 out/in to a room. 285 AFF_HIDE 1048576 The monster will be hidden, and can only 286 be detected by a "sense life" spell 287 AFF_FEAR 2097152 ??? DO NOT USE 288 AFF_CHARM 4194304 The monster will act as charmed when a 289 "follow <player>" is entered. Note that 290 players can't force monsters to follow 291 them. 292 AFF_FOLLOW 8388608 RESERVED PLAYERS 293 AFF_WIMPY 16777216 RESERVED PLAYERS 294 AFF_INFRARED 33554432 Allows monsters to see in the dark. 295 296 <Alignment Flag>[NL] 297 298 This is the monsters alignment, read as: 299 +1000 .. +350 Good Alignment 300 +349 .. -349 Neutral Alignment 301 -350 ..-1000 Evil Alignment 302 303 <Detailed/Simple flag><NL> 304 305 This flag must be entered as a uppercase "S". S indicates that "Simple" 306 monster data follow. Anything but an S will be interpreted as if 307 "Detailed" monster data is to follow. We will NOT describe detailed 308 monsters as they are VERY detailed. 309 310 311 <Level> 312 This is the level of the monster. See "defs.doc" for guidelines when 313 setting the level. 314 315 <THAC0> 316 The monsters THAC0. 317 See the file "defs.doc" for an explanation of armour vs. THAC0, and 318 guidelines for THAC0. 319 THAC0 is an abbrevation for "To Hit Armour Class Zero". 320 321 <AC> 322 The monsters armour class. See "defs.doc" for guidelines regarding 323 armour. 324 325 <Hit Points (format is xdy+z)> 326 This defines the number of hitpoints a given monster has. If this is 327 entered into the file: 328 329 ... ... 3d8+10 ... 330 331 the monster will have 10 hitpoints plus the result of rolling 3 dice 332 with 8 side, and adding their sum. All the numbers (even zero), the 333 plus sign, and the letter 'd' MUST be entered!!! Example: 334 335 ..... 1d6+0 .... 336 337 338 <Damage (as HP)><NL> 339 This is the damage a monster will cause when it is using NO weapons 340 (the Bare hand damage). The format is exacly like the one described 341 for hit points. A thing to note about damage: 342 The number after the plus sign, is the "strength bonus". This bonus 343 will apply to any weapons used, and bare hands too. Example: 344 345 ..... 1d4+10 346 347 This monster will damage between 11 and 14 hitpoints each round. If the 348 monster picks up and wields a tiny stick which give 1d2 damage, then the 349 monster will now damage by : 1d2 + 10 points. 350 351 <Gold> 352 The amout of gold carried by the monster. 353 354 <Exp><NL> 355 The experience this monster has. Follow guidelines in "defs.doc". 356 357 <position> 358 This defines the monster's position when loaded into the game. 359 A position is one of: 360 361 POSITION_DEAD 0 DO NOT USE 362 POSITION_MORTALLYW 1 DO NOT USE 363 POSITION_INCAP 2 DO NOT USE 364 POSITION_STUNNED 3 DO NOT USE 365 POSITION_SLEEPING 4 The monster is sleeping. 366 POSITION_RESTING 5 The monster is resting. 367 POSITION_SITTING 6 The monster is sitting. 368 POSITION_FIGHTING 7 DO NOT USE. 369 POSITION_STANDING 8 The monster is standing. 370 371 372 <default position> 373 This is the position into which the monster will return after 374 a fight. This position also defines when the <long description> 375 is displayed - see above. 376 377 <sex><NL> 378 This is the monsters sex, on of: 379 380 SEX_NEUTRAL 0 381 SEX_MALE 1 382 SEX_FEMALE 2 383 384 No further explanation is needed (hopefully). 385 386 387 Object fields description: 388 ========================== 389 390 #<virtual number><NL> 391 See rules for rooms above. 392 393 <namelist>~<NL>: 394 Same as for monsters above. 395 396 <short description>~<NL> 397 This string will be displayed when the object is used. For example 398 if it is "a rubber raft", and a player drops it, then a message like: 399 "Monthy drops a rubber raft." 400 could be displayed. 401 402 <long description>~<NL> 403 This description is displayed when the object is lying on the ground. 404 For example, if it is "A furled umbrella lies here.~" then this message 405 is displayed when the umbrella is lying on the ground. 406 407 <action description>~<NL> 408 Do not use. 409 410 <type flag>[NL] 411 This defines what kind of item you are defining, it can be one of: 412 413 ITEM_LIGHT 1 Item is a light. 414 ITEM_SCROLL 2 Not yet implemented 415 ITEM_WAND 3 Not yet implemented 416 ITEM_STAFF 4 Not yet implemented 417 ITEM_WEAPON 5 Item is a weapon 418 ITEM_FIREWEAPON 6 Not yet implemented 419 ITEM_MISSILE 7 Not yet implemented 420 ITEM_TREASURE 8 Item is a treasure (not money) 421 ITEM_ARMOR 9 Item is armour. 422 ITEM_POTION 10 Not yet implemented 423 ITEM_WORN 11 ??? 424 ITEM_OTHER 12 Item is other 425 ITEM_TRASH 13 Item is trash 426 ITEM_TRAP 14 Not yet implemented 427 ITEM_CONTAINER 15 Item is a container 428 ITEM_NOTE 16 Item is a note that can be written upon (with a pen) 429 ITEM_DRINKCON 17 Item is a drink container, for example a bottle or 430 a barrel or a wine-skin. 431 A drinkcontainer whit contents must *always* have 432 two names: 1. The name of the drink, 2. the name 433 of the container, example: 434 tea cup~ 435 436 ITEM_KEY 18 Item is a key 437 ITEM_FOOD 19 Item is food. 438 ITEM_MONEY 20 Item is money. 439 ITEM_PEN 21 Item is a pen. 440 ITEM_BOAT 22 Item is a boat, which must be carried by a player if 441 the player wishes to enter NOSWIM room sector types. 442 ITEM_FOUNTAIN 23 Item is a fountain (characters can drink from it 443 without having it in inventory). 444 445 <extra flag>[NL] 446 This bitvector defines mostly special effects: 447 448 ITEM_GLOW 1 The item is glowing. 449 ITEM_HUM 2 The item is "humming"/"buzzing". 450 ITEM_DARK 4 ??? 451 ITEM_LOCK 8 ??? 452 ITEM_EVIL 16 ??? 453 ITEM_INVISIBLE 32 Item is invisible. 454 ITEM_MAGIC 64 Item will show a magical aura when 'detect magic' 455 is used. 456 ITEM_NODROP 128 Item can not be dropped (cursed for example) 457 ITEM_BLESS 256 Item is blessed. 458 ITEM_ANTI_GOOD 512 Item not usable by good people 459 ITEM_ANTI_EVIL 1024 Item not usable by evil people 460 ITEM_ANTI_NEUTRAL 2048 Item not usable by neutral people 461 ITEM_NORENT 4096 Players can not rent item 462 ITEM_NODONATE 8192 Players can not donate item 463 ITEM_NOINVIS 16384 Player can not make item invisible 464 465 <wear flag><NL> 466 This bitvector defines if items can be taken, and if they can be worn: 467 468 ITEM_TAKE 1 Item is takeable. 469 ITEM_WEAR_FINGER 2 Can be worn on a finger (rings usually) 470 ITEM_WEAR_NECK 4 Can be worn around neck. 471 ITEM_WEAR_BODY 8 Can be worn on body. 472 ITEM_WEAR_HEAD 16 Can be worn on head. 473 ITEM_WEAR_LEGS 32 Can be worn on legs. 474 ITEM_WEAR_FEET 64 Can be worn on feet 475 ITEM_WEAR_HANDS 128 Can be worn on hands (gauntlets, etc) 476 ITEM_WEAR_ARMS 256 Can be worn on arms. 477 ITEM_WEAR_SHIELD 512 Can be used as a shield. 478 ITEM_WEAR_ABOUT 1024 ??? 479 ITEM_WEAR_WAISTE 2048 Can be worn around the waiste (belt) 480 ITEM_WEAR_WRIST 4096 Can be worn on wrist (bracelets) 481 ITEM_WIELD 8192 Can be wielded and used as a weapon 482 ITEM_HOLD 16384 Item can be held in a hand. 483 ITEM_THROW 32768 Not yet implemented. 484 Item can be thrown. 485 486 <value 0> <value 1> <value 2> <value 3> <NL> 487 These values are very central. They define the ability of items based on 488 the items <Item Type>. These values are defined in "values.doc". Note that 489 if you define an item as being anything but a weapon, you shouldn't set 490 the 'wield' flag. Many similar obvious rules apply. Example of 4 values: 491 492 If the <Item Type> == ITEM_CONTAINER then the values are interpeted as: 493 494 Value[0]: Maximum weight the container can contain. 495 Value[1]: Container flags: 496 497 CLOSEABLE - 1 498 PICKPROOF - 2 499 CLOSED - 4 500 LOCKED - 8 501 502 Value[2]: The item-number of the object which can open the object. 503 -1 means no lockability. 504 Value[3]: Internal use for Corpses that must "rot". 505 506 507 <weight>[NL] 508 The weight of the item in pounds. 509 510 <value>[NL] 511 The value of the item if sold - see "defs.doc" for ideas on prices. 512 513 <cost/day><NL> 514 The cost to store the item in the reception overnight. 515 516 517 518 519 Several extra descriptions or none at all may appear. They follow the room 520 format exactly. 521 522 'E'<NL> 523 <keyword-list>~<NL> 524 Exactly as in rooms. 525 526 <extra description><NL>~<NL> 527 Exactly as in rooms. 528 529 530 531 Between zero and two "affect's" may be set on an item. The affects could 532 for example modify a characters strength, height etc. The affect only goes 533 into affect when the character wear, wield or hold the item. The affect 534 is removed when the character removes the items. 535 536 'A'<NL> 537 When items are worn using wear/wield/grab/hold commands, the 'A' will 538 allow the items to affect a characters various abilities. Currently 539 a maximum of 2 'A' are allowed. 540 541 <location>[NL] 542 <location> is one of the below numbers, indicating which ability 543 will be changed. 544 545 APPLY_NONE 0 DO NOT USE. 546 APPLY_STR 1 547 APPLY_DEX 2 548 APPLY_INT 3 549 APPLY_WIS 4 550 APPLY_CON 5 551 APPLY_SEX 6 DO NOT USE. 552 APPLY_CLASS 7 DO NOT USE. 553 APPLY_LEVEL 8 DO NOT USE. 554 APPLY_AGE 9 555 APPLY_CHAR_WEIGHT 10 556 APPLY_CHAR_HEIGHT 11 557 APPLY_MANA 12 DO NOT USE. 558 APPLY_HIT 13 The MAXIMUM number of hitpoints. 559 APPLY_MOVE 14 DO NOT USE. 560 APPLY_GOLD 15 DO NOT USE. 561 APPLY_EXP 16 DO NOT USE. 562 APPLY_AC 17 563 APPLY_ARMOR 17 Same as APPLY_AC 564 APPLY_HITROLL 18 The bonus/penalty to hit the opponent. 565 APPLY_DAMROLL 19 The bouns/penalty to damage the opponent. 566 APPLY_SAVING_PARA 20 These five are saving throws. 567 APPLY_SAVING_ROD 21 568 APPLY_SAVING_PETRI 22 569 APPLY_SAVING_BREATH 23 570 APPLY_SAVING_SPELL 24 This is the most used saving throw. 571 572 573 <modifier><NL> 574 575 The modifier is added to the APPLY_XXX ability of the character 576 when he uses an item, and is subtracted when he stops using it. 577 Take great care when using this. This is an example of an item of 578 improve strength and armour class. Example: 579 580 A 581 1 2 582 A 583 17 -2 584 585 This adds +2 to the strength, and adds -2 to the AC (thus improving it). 586 No more 'A'ffects is allowed at this time. 587 588 ------------------------------------------------------------------------- 589 590 Abbrevations: 591 ============= 592 593 <contents> indicates that the contents MUST be entered. 594 595 [contents] indicates that the contents can OPTIONALLY be entered. 596 597 <NL> is Newline (return) 598 599 ! This indicates "NOT" - for example <!NL> means NO newline (i.e. it is 600 forbidden to use newline here).