Room Flags Reference

Complete reference for room behavior flags

This document provides comprehensive information about all room flags (ROOM_*) used in LuminariMUD. Room flags control various mechanics, restrictions, and behaviors of rooms throughout the game world.


Overview

Room flags are bitflags defined in src/structs.h (lines 225-271) and are checked throughout the codebase using the ROOM_FLAGGED() macro. There are currently 42 room flags (indices 0-41) that control everything from movement restrictions to magical effects.

Usage Pattern:

if (ROOM_FLAGGED(room_rnum, ROOM_FLAGNAME)) {
    // Flag is set, apply restrictions/effects
}

Movement & Access Restrictions

ROOM_TUNNEL (Index: 8) Movement

Effect: Limits the number of characters that can be in the room simultaneously.

  • Maximum occupants determined by CONFIG_TUNNEL_SIZE
  • Prevents mounted characters from entering
  • Blocks formations and grouped movement when full
  • Used for narrow passages, tunnels, and chokepoints

Code References: movement.c:545, 551 | desc_engine.c:683

ROOM_SINGLEFILE (Index: 20) Movement

Effect: Forces characters to move through the room one at a time in combat situations.

  • Prevents backstab and other flanking abilities
  • Limits positioning-based combat mechanics
  • Used for narrow corridors and single-file passages

Code References: movement.c:306, 914 | fight.c:216, 7895, 12269, 13997 | 20+ additional checks

ROOM_FLY_NEEDED (Index: 18) Movement

Effect: Characters must be flying to remain in the room; non-flying characters fall.

  • Triggers falling mechanics for grounded characters
  • Objects without support also fall
  • Used for aerial rooms, cliff edges, and suspended platforms

Code References: movement_falling.c:47, 72 | craft.c:664, 700

ROOM_CLIMB_NEEDED (Index: 32) Movement

Effect: Requires a skill check to enter the room.

  • Difficulty based on zone minimum level
  • Used for cliffs, mountains, and vertical obstacles

Code References: movement.c:570 | craft.c:666, 702

ROOM_NOFLY (Index: 26) Movement

Effect: Prevents flying creatures from entering the room.

  • Forces grounded movement
  • Used in low-ceiling areas and confined spaces

Code References: movement.c:501

ROOM_PRIVATE (Index: 9) Movement

Effect: Limits room to 2 occupants maximum.

  • Additional occupants cannot enter or teleport in
  • Staff can override this restriction
  • Used for private meeting rooms and intimate spaces

Code References: movement.c:1249 | act.wizard.c:268, 347 | spells.c:299

ROOM_STAFFROOM (Index: 10) Movement

Effect: Only staff (LVL_STAFF+) can enter this room.

  • Hard block on entry for non-staff
  • Used for immortal areas and staff lounges

Code References: movement.c:563


Magic Restrictions

ROOM_NOMAGIC (Index: 7) Magic

Effect: Completely prevents all magic from functioning in the room.

  • Blocks spell casting by caster or victim in the room
  • Exception: Weapon poison (CAST_WEAPON_POISON) still works
  • Affects both offensive and beneficial magic
  • Strongest magic restriction available

Code References: spell_parser.c:540, 547, 3046 | fight.c:8518, 8522, 8639 | magic.c:12643

ROOM_NOTELEPORT (Index: 21) Magic

Effect: Prevents teleportation into or out of the room.

  • Blocks dimension door, teleport, and similar spells
  • Blocks both incoming and outgoing teleportation
  • Used for secured areas and restricted zones

Code References: spells.c:314, 2199-2398 | act.other.c:808, 896, 11637

ROOM_NOSUMMON (Index: 24) Magic

Effect: Prevents summoning spells from targeting this room.

  • Blocks summoning creatures to or from the room
  • Used for protected sanctuaries and anti-summoning zones

Code References: spells.c:2912-2913

ROOM_NORECALL (Index: 19) Magic

Effect: Prevents recall/return spells from working.

  • Blocks escape via recall magic
  • Used in dungeons and combat zones where escape should be prevented

Code References: spells.c:2200-2399 (8 matches)


Combat & PvP Restrictions

ROOM_PEACEFUL (Index: 4) Combat

Effect: Prevents all forms of combat and aggressive actions.

  • Blocks physical attacks (hit, backstab, etc.)
  • Blocks offensive spells and abilities
  • Prevents grappling and combat maneuvers
  • Blocks domain powers and offensive class abilities
  • Used in safe zones, towns, and newbie areas

Code References: fight.c:1509, 5370, 12251, 12259 | spells.c:698, 756, 881, 916, 1319, 1810, 2569, 2598 | grapple.c:218 | domain_powers.c:76, 818, 903, 988, 1073, 1156

ROOM_DEATH (Index: 1) Combat

Effect: Kills characters or deals severe damage when entering/remaining in room.

  • Used for death traps and hazardous zones
  • NPCs avoid entering death rooms
  • Teleportation into death rooms is blocked
  • Staff can bypass with appropriate level

Code References: act.informative.c:1263, 1475 | movement.c:1256 | mob_act.c:400 | spells.c:302

ROOM_SOUNDPROOF (Index: 5) Combat

Effect: Blocks sound-based abilities and prevents communication.

  • Blocks tells, shouts, and speech-based communication
  • Prevents bardic performances from functioning
  • Blocks sound-based spells (exception for psionics)
  • Staff can override (LVL_STAFF+)

Code References: act.comm.c:465, 473, 810, 984 | bardic_performance.c:264 | spell_parser.c:1770 | act.social.c:275


Environmental Effects

ROOM_INDOORS (Index: 3) Environment

Effect: Marks room as indoors for various game mechanics.

  • Affects weather exposure
  • Influences light calculations (indoor rooms don't go dark at night)
  • Affects outdoor-only abilities and effects
  • Used for buildings, caves, and sheltered areas

Code References: utils.c:823, 911 | movement.c:1372 | vessels_rooms.c:40-96, 190-191, 606

ROOM_REGEN (Index: 17) Environment

Effect: Doubles natural regeneration rates for HP, mana, and movement.

  • Minimum regen of 2 before doubling (2 becomes 4, etc.)
  • Stacks with other regen bonuses
  • Used for healing sanctuaries and rest areas

Code References: limits.c:595 | spell_prep.c:3778

ROOM_NOHEAL (Index: 25) Environment

Effect: Prevents natural healing and regeneration.

  • Blocks HP regeneration tick
  • Similar to Blackmantle spell effect
  • Used for cursed areas and unholy ground

Code References: limits.c:622


Vision & Perception

ROOM_DARK (Index: 0) Vision

Effect: Forces the room to be dark regardless of other conditions.

  • Overrides normal light calculations
  • Can be temporarily removed/added by darkness/light spells
  • Requires light source or darkvision to see
  • Stacks with ROOM_MAGICDARK for absolute darkness

Code References: utils.c:3594, 3656, 3697 | act.informative.c:1282-1383 | magic.c:12654, 12658 | mud_event.c:169

ROOM_MAGICDARK (Index: 22) Vision

Effect: Creates magical darkness that penetrates normal light sources.

  • Overrides mundane light sources
  • Only defeated by magical light or certain abilities
  • When combined with ROOM_DARK, creates absolute darkness
  • Used for shadow magic zones and deep darkness effects

Code References: utils.c:3596, 3643, 3697 | act.informative.c:1205, 1211, 1296, 8463

ROOM_MAGICLIGHT (Index: 23) Vision

Effect: Creates magical light that prevents the room from being dark.

  • Overrides normal darkness conditions
  • Cannot be defeated by normal darkness
  • Used for magically illuminated areas

Code References: utils.c:3626

ROOM_FOG (Index: 27) Vision

Effect: Creates fog that obscures vision and limits visibility.

  • Hides room descriptions and contents from mortal characters
  • Limits automap functionality
  • Reduces scan range and visibility
  • Staff (LVL_IMMORT+) can see through fog
  • Can be removed by gust of wind spell

Code References: act.informative.c:1199, 1259, 1447, 1550, 1572, 8458, 8617, 8977 | spells.c:515, 519 | utils.c:917, 3699

ROOM_NOTRACK (Index: 6) Vision

Effect: Prevents tracking abilities from working through this room.

  • Blocks track skill usage
  • Breaks pathfinding algorithms
  • NPCs won't track players through these rooms
  • Used for anti-tracking zones and rivers

Code References: movement_tracks.c:256 | graph.c:59 | mob_act.c:383


Special Room Types

ROOM_HOUSE (Index: 11) Special

Effect: Marks room as part of a player house.

  • Integrates with house ownership system
  • Restricts entry to house owners and guests
  • Enables house crash-save functionality
  • Used with ROOM_HOUSE_CRASH for persistence

Code References: house.c:296, 444, 626, 663, 665, 714, 849, 904 | handler.c:2212-2213, 2247-2248

ROOM_ATRIUM (Index: 13) Special

Effect: Marks room as a house atrium (entry point).

  • Entry point for player houses
  • Special restrictions on entering houses apply
  • Managed by house system automatically

Code References: house.c:446, 628, 657, 678, 682 | movement.c:520 | hsedit.c:168, 206, 224, 230

ROOM_WORLDMAP (Index: 16) Special

Effect: Marks room as part of the overworld/wilderness map system.

  • Enables special worldmap automap display
  • Used for wilderness travel system
  • Affects routing and navigation commands

Code References: act.informative.c:8554 | asciimap.c:729 | routing.c:290 | act.wizard.c:10211

ROOM_VEHICLE (Index: 40) Special

Effect: Marks room as part of a vehicle or vessel.

  • Allows vehicle movement through this room
  • Used for ship interiors, wagons, etc.
  • Required for directional vehicle navigation
  • Integrates with vessel system

Code References: vessels_rooms.c:40-103, 188-189 | vessels_src.c:282, 301, 368, 384, 505-506

ROOM_HARVEST_NODE (Index: 38) Special

Effect: Marks room as a resource harvesting location.

  • Enables gathering/harvesting of materials
  • Integrates with crafting system
  • Used for mining nodes, herb gardens, etc.

Code References: crafting_new.c:531

ROOM_PLAYER_SHOP (Index: 35) Special

Effect: Marks room as a player-run shop.

  • Enables player merchant functionality
  • Integrates with player economy system
Note: Limited code references suggest this may be partially implemented or planned feature.

ROOM_ROAD (Index: 39) Special

Effect: Marks room as a road or path.

  • May affect travel speed or mount usage
  • Used for road networks and travel routes
Note: No direct code references found; likely used by zone builders for thematic purposes or planned features.

System & Administrative Flags

ROOM_HOUSE_CRASH (Index: 12) System

Effect: Marks that items in this house room should be saved.

  • Auto-set when items are modified in house rooms
  • Triggers house save-to-disk operations
  • Cleared after successful save
  • Used for house persistence system
Warning: System flag - do not manually set!

Code References: house.c:296, 714 | handler.c:2213, 2248 | hsedit.c:211

ROOM_OLC (Index: 14) System

Effect: Marks room as being edited in the Online Level Creator (OLC).

  • Used by building/editing system
  • Prevents certain cleanup operations
  • Temporary flag during world editing
Warning: System flag - managed by OLC system!

Code References: act.wizard.c:5581, 5587

ROOM_BFS_MARK (Index: 15) System

Effect: Temporary flag used by pathfinding algorithms.

  • Marks rooms as visited during Breadth-First Search
  • Automatically cleared after pathfinding completes
  • Should never be permanently set on rooms
  • Internal system flag
Warning: Never manually set this flag!

Code References: graph.c:59 | act.wizard.c:5581

ROOM_GENDESC (Index: 34) System

Effect: Indicates room description should be generated dynamically.

  • Used with procedural generation systems
  • Allows for dynamic room descriptions
Note: Limited code references suggest this is a specialized builder flag.

ROOM_NOMOB (Index: 2) System

Effect: Prevents NPCs from entering this room.

  • NPCs won't pathfind through or enter these rooms
  • Used to keep certain areas mob-free

Code References: mob_act.c:399


Size Restrictions

ROOM_SIZE_TINY (Index: 30) Size

Effect: Marks room as extremely small.

  • May restrict large creatures from entering
  • Used for mouse holes, small tunnels, etc.
Note: Limited code references suggest this is primarily a builder/thematic flag.

ROOM_SIZE_DIMINUTIVE (Index: 31) Size

Effect: Marks room as very small.

  • May restrict entry based on creature size
  • Used for pixie homes, tiny passages, etc.
Note: Limited code references suggest this is primarily a builder/thematic flag.

ROOM_AIRY (Index: 28) Size

Effect: Marks room as having an airy, open quality.

  • May affect wind-based spells or effects
  • Thematic flag for open, breezy areas
Note: No direct code references found; likely thematic or planned feature.

Zone Features

ROOM_RANDOM_TRAP (Index: 36) Zone Feature

Effect: Forces a random trap to always generate in this room.

  • Overrides normal trap generation probability
  • Guarantees trap presence on zone reset
  • Used for specific trap encounters

Code References: traps_new.c:547, 575-576 | db.c:5431

ROOM_RANDOM_CHEST (Index: 37) Zone Feature

Effect: Marks room as eligible for random treasure chest spawning.

  • Integrates with random treasure system
  • Used for treasure hunt mechanics
Note: Limited code references suggest this may be a planned or partially implemented feature.

ROOM_HASTRAP (Index: 33) Zone Feature

Effect: Indicates the room contains a trap.

  • May be set by trap generation system
  • Used for trap detection and disarmament
Note: Limited code references suggest integration with trap system.

ROOM_OCCUPIED (Index: 29) Zone Feature

Effect: Marks room as occupied or reserved.

  • Purpose unclear from code analysis
  • May relate to instance or phasing systems
Note: No direct code references found; may be planned feature.

ROOM_DOCKABLE (Index: 41) Zone Feature

Effect: Marks room as a valid docking location for vessels.

  • Intended for ship docking mechanics
  • Part of vessel system
Note: No code references found; likely planned feature for vessel system expansion.

Complete Flag Reference

Index Flag Name Primary Purpose Category
0ROOM_DARKForces darknessVision
1ROOM_DEATHDeath trapHazard
2ROOM_NOMOBNPC restrictionMovement
3ROOM_INDOORSIndoor roomEnvironment
4ROOM_PEACEFULNo combatCombat
5ROOM_SOUNDPROOFBlocks soundPerception
6ROOM_NOTRACKBlocks trackingPerception
7ROOM_NOMAGICNo magicMagic
8ROOM_TUNNELOccupancy limitMovement
9ROOM_PRIVATE2 person limitMovement
10ROOM_STAFFROOMStaff onlyAccess
11ROOM_HOUSEPlayer houseSpecial
12ROOM_HOUSE_CRASHHouse save flagSystem
13ROOM_ATRIUMHouse entranceSpecial
14ROOM_OLCBeing editedSystem
15ROOM_BFS_MARKPathfinding tempSystem
16ROOM_WORLDMAPWilderness mapSpecial
17ROOM_REGENDouble regenEnvironment
18ROOM_FLY_NEEDEDMust flyMovement
19ROOM_NORECALLNo recallMagic
20ROOM_SINGLEFILEOne at a timeMovement
21ROOM_NOTELEPORTNo teleportMagic
22ROOM_MAGICDARKMagical darknessVision
23ROOM_MAGICLIGHTMagical lightVision
24ROOM_NOSUMMONNo summoningMagic
25ROOM_NOHEALNo healingEnvironment
26ROOM_NOFLYFlying blockedMovement
27ROOM_FOGFog obscurementVision
28ROOM_AIRYAiry atmosphereEnvironment
29ROOM_OCCUPIEDOccupied statusSpecial
30ROOM_SIZE_TINYTiny sizeSize
31ROOM_SIZE_DIMINUTIVEDiminutive sizeSize
32ROOM_CLIMB_NEEDEDRequires climbingMovement
33ROOM_HASTRAPContains trapZone Feature
34ROOM_GENDESCGenerated descSystem
35ROOM_PLAYER_SHOPPlayer shopSpecial
36ROOM_RANDOM_TRAPRandom trap spawnZone Feature
37ROOM_RANDOM_CHESTRandom chest spawnZone Feature
38ROOM_HARVEST_NODEHarvest locationSpecial
39ROOM_ROADRoad/pathEnvironment
40ROOM_VEHICLEVehicle roomSpecial
41ROOM_DOCKABLEDocking locationSpecial

Usage Guidelines

For Builders

Stacking Flags

Many flags can be combined for compound effects:

Common Combinations

Flags to Avoid Setting Manually

  • ROOM_BFS_MARK (system temporary flag)
  • ROOM_HOUSE_CRASH (auto-set by house system)
  • ROOM_OLC (OLC system flag)

For Developers

Checking Flags

// Standard check
if (ROOM_FLAGGED(room_rnum, ROOM_PEACEFUL)) {
    // Peaceful room logic
}

// Multiple flags
if (ROOM_FLAGGED(room, ROOM_DARK) && ROOM_FLAGGED(room, ROOM_MAGICDARK)) {
    // Absolute darkness
}

Modifying Flags

// Set flag
SET_BIT_AR(ROOM_FLAGS(room), ROOM_DARK);

// Remove flag
REMOVE_BIT_AR(ROOM_FLAGS(room), ROOM_DARK);

// Check if set
if (IS_SET_AR(ROOM_FLAGS(room), ROOM_DARK)) {
    // Flag is set
}

Common Patterns

Safe Zones: Typically use ROOM_PEACEFUL to prevent combat. Consider adding ROOM_NORECALL for dungeons where escape should be limited.

Darkness: Use ROOM_DARK for natural darkness, ROOM_MAGICDARK for magical darkness that resists light sources.

Movement Restrictions:

Magic Control:


Code References

Primary Files:


Notes