MOB Flags Reference
Complete reference for mobile behavior flags
This document provides comprehensive information about all mobile flags (MOB_*) used in LuminariMUD. Mobile flags control NPC behaviors, abilities, restrictions, and special mechanics throughout the game world.
Overview
Mobile flags are bitflags defined in src/structs.h (lines 1131-1232) and are checked throughout the codebase using the MOB_FLAGGED() macro. There are currently 101 mobile flags (indices 0-100) that control everything from basic AI behavior to special monster abilities.
Usage Pattern:
if (MOB_FLAGGED(mob, MOB_FLAGNAME)) {
// Flag is set, apply behavior/restriction
}
Basic Behavior Flags
MOB_SPEC (Index: 0) System
Effect: Indicates the mobile has a special procedure (spec-proc) attached.
- Special procedures provide custom scripted behaviors
- Executed during mobile activity updates
- Used for quest NPCs, shopkeepers, trainers, etc.
Code References: spec_procs.c, spec_assign.c
MOB_SENTINEL (Index: 1) Behavior
Effect: Mobile will not move from its current location.
- Prevents wandering and random movement
- Mobile stays in its spawn location
- Can still be dragged/summoned by magic
- Used for stationary guards, shopkeepers, and landmark NPCs
Code References: mob_act.c:397, 419, 431 | utils.c:7171
MOB_SCAVENGER (Index: 2) Behavior
Effect: Mobile picks up items from the ground.
- Randomly collects objects in the same room
- 1 in 10 chance per update cycle
- Used for goblin looters, pack rats, etc.
Code References: mob_act.c:162
MOB_AWARE (Index: 4) Combat
Effect: Mobile cannot be backstabbed or surprise attacked.
- Prevents backstab attacks from rogues
- Blocks sneak attacks and similar abilities
- Used for alert guards, paranoid NPCs, creatures with special senses
Code References: act.offensive.c:4076, 8940
MOB_WIMPY (Index: 7) Behavior
Effect: Mobile flees when severely injured.
- Automatically flees when HP drops below threshold
- Used for cowardly creatures and civilians
- Behavior similar to player wimpy setting
Code References: fight.c:5779 | mob_act.c:196
MOB_SENTIENT (Index: 19) Classification
Effect: Marks mobile as sentient/intelligent.
- Used for intelligent creatures and humanoids
- May affect certain spell interactions
- Thematic flag for creature classification
MOB_LISTEN (Index: 34) Behavior
Effect: Mobile enters room if it hears fighting nearby.
- Responds to combat sounds in adjacent rooms
- Used for reinforcement mechanics
- Guards and aggressive creatures use this
MOB_LIT (Index: 35) Environment
Effect: Mobile emits light.
- Acts as a light source in dark rooms
- Creatures made of fire, glowing undead, etc.
- Affects visibility calculations
Aggression & Alignment Flags
MOB_AGGRESSIVE (Index: 5) Combat
Effect: Mobile automatically attacks all nearby characters.
- Attacks everyone who enters the room
- Conflicts with MOB_HELPER flag
- Used for hostile monsters and aggressive creatures
Note: When set, MOB_HELPER is automatically removed to prevent conflicts.
Code References: mob_act.c:221 | limits.c:2245 | db.c:3173-3177
MOB_AGGR_EVIL (Index: 8) Combat
Effect: Mobile attacks evil-aligned characters on sight.
- Only attacks players/NPCs with evil alignment
- Requires MOB_AGGRESSIVE to also be set
- Used for paladins, good-aligned guards
MOB_AGGR_GOOD (Index: 9) Combat
Effect: Mobile attacks good-aligned characters on sight.
- Only attacks players/NPCs with good alignment
- Requires MOB_AGGRESSIVE to also be set
- Used for demons, evil priests, undead
MOB_AGGR_NEUTRAL (Index: 10) Combat
Effect: Mobile attacks neutral-aligned characters on sight.
- Only attacks players/NPCs with neutral alignment
- Requires MOB_AGGRESSIVE to also be set
- Used for extremist NPCs
Immunity & Restriction Flags
MOB_NOCHARM (Index: 13) Immunity
Effect: Mobile cannot be charmed or mind-controlled.
- Blocks charm person, dominate, and similar spells
- Used for strong-willed creatures, undead, constructs
- Essential for boss monsters
Code References: spells.c:388 | spec_abilities.c:611, 622, 640, 1359
MOB_NOSUMMON (Index: 14) Immunity
Effect: Mobile cannot be summoned or teleported.
- Prevents summon monster spells from bringing this mob
- Blocks gate and similar effects
- Used for bosses and unique creatures
MOB_NOSLEEP (Index: 15) Immunity
Effect: Mobile cannot be put to sleep.
- Blocks sleep spells and effects
- Used for elves, undead, constructs
- Essential for creatures that don't sleep
MOB_NOBASH (Index: 16) Immunity
Effect: Mobile cannot be bashed or knocked down.
- Prevents shield bash and similar attacks
- Used for trees, huge creatures, incorporeal beings
- Affects tactical combat options
MOB_NOBLIND (Index: 17) Immunity
Effect: Mobile cannot be blinded.
- Blocks blindness spells and effects
- Used for creatures with special vision (tremorsense, blindsight)
- Oozes, creatures without eyes
MOB_NOKILL (Index: 18) Immunity
Effect: Mobile cannot be attacked by players.
- Complete immunity to player attacks
- Used for quest NPCs, essential storyline characters
- Can still be damaged by environmental effects
MOB_NODEAF (Index: 22) Immunity
Effect: Mobile cannot be deafened.
- Blocks deafness effects
- Used for creatures without hearing or magical entities
MOB_NOGRAPPLE (Index: 25) Immunity
Effect: Mobile cannot be grappled or grabbed.
- Prevents grapple combat maneuvers
- Used for incorporeal creatures, very large/small creatures
- Affects melee combat tactics
MOB_NOCONFUSE (Index: 62) Immunity
Effect: Mobile cannot be confused.
- Blocks confusion spells and effects
- Used for mindless creatures, high-intelligence beings
MOB_NOPARALYZE (Index: 97) Immunity
Effect: Mobile cannot be paralyzed.
- Blocks hold person, paralysis, and similar effects
- Used for creatures immune to paralysis
- Essential for certain creature types
MOB_NOSTEAL (Index: 37) Immunity
Effect: Mobile cannot be stolen from.
- Prevents pickpocket attempts
- Used for important NPCs, alert guards
- Protects quest items
Movement & Blocking Flags
MOB_STAY_ZONE (Index: 6) Movement
Effect: Mobile will not wander outside its home zone.
- Restricts random movement to current zone
- Prevents mobs from wandering into neighboring zones
- Used for zone-specific creatures
Directional Blocking Flags (Index: 45-54) Blocking
Effect: Mobile physically blocks movement in specific directions.
- MOB_BLOCK_N (45) - Blocks north
- MOB_BLOCK_E (46) - Blocks east
- MOB_BLOCK_S (47) - Blocks south
- MOB_BLOCK_W (48) - Blocks west
- MOB_BLOCK_NE (49) - Blocks northeast
- MOB_BLOCK_SE (50) - Blocks southeast
- MOB_BLOCK_SW (51) - Blocks southwest
- MOB_BLOCK_NW (52) - Blocks northwest
- MOB_BLOCK_U (53) - Blocks up
- MOB_BLOCK_D (54) - Blocks down
Characters cannot pass through in the blocked direction unless they meet bypass conditions.
Code References: movement.c:622-640
Blocking Exemption Flags (Index: 55-59, 90-92) Blocking
Effect: Define exemptions to directional blocking.
- MOB_BLOCK_CLASS (55) - Allows same class to pass
- MOB_BLOCK_RACE (56) - Allows same race to pass
- MOB_BLOCK_LEVEL (57) - Allows lower levels to pass
- MOB_BLOCK_ALIGN (58) - Allows same alignment to pass
- MOB_BLOCK_ETHOS (59) - Allows same ethos to pass
- MOB_BLOCK_EVIL (90) - Specifically blocks evil
- MOB_BLOCK_NEUTRAL (91) - Specifically blocks neutral
- MOB_BLOCK_GOOD (92) - Specifically blocks good
Code References: movement.c:643-661
Combat Helper Flags
MOB_MEMORY (Index: 11) Combat
Effect: Mobile remembers characters who attack it.
- Tracks attackers even after combat ends
- Will attack remembered enemies on sight
- Memory persists until mob dies or memory is cleared
- Used for intelligent creatures and guards
Code References: mob_memory.c:31 | fight.c:5154, 5475, 12301 | graph.c:411
MOB_HELPER (Index: 12) Combat
Effect: Mobile assists other NPCs fighting against players.
- Jumps into combat to help fellow NPCs
- Conflicts with MOB_AGGRESSIVE flag
- Used for pack tactics and coordinated defense
Code References: mob_act.c:190, 285, 291 | limits.c:2246
MOB_GUARD (Index: 31) Combat
Effect: Mobile protects citizens and assists them in combat.
- Specifically protects NPCs with MOB_CITIZEN flag
- More selective than MOB_HELPER
- Used for city guards and protectors
Code References: mob_act.c:285, 290, 311, 313 | missions.c:511, 633, 732
MOB_CITIZEN (Index: 32) Classification
Effect: Mobile is protected by guards.
- Guards will defend this NPC
- Used for shopkeepers, quest NPCs, civilians
- Creates natural guard/citizen relationships
Code References: mob_act.c:311, 313 | missions.c:518, 640, 739
MOB_HUNTER (Index: 33) Combat
Effect: Mobile actively tracks down and hunts enemies.
- Aggressively pursues targets across multiple rooms
- Combines with MOB_MEMORY for persistent pursuit
- Used for predators and assassins
Code References: mob_act.c:371 | fight.c:5486
MOB_MOB_ASSIST (Index: 61) Combat
Effect: Mobile will assist other mobs in its group/following.
- Enables mob-to-mob cooperation
- Used for coordinated monster groups
- Affects tactical combat
Code References: mob_act.c:303
MOB_HUNTS_TARGET (Index: 63) Combat
Effect: Mobile hunts specific target(s).
- More focused than general hunter behavior
- Used for assassination missions and bounty hunters
Companion & Summoned Creature Flags
These flags identify creatures summoned or obtained through various class abilities and spells. They affect how the creatures scale, their abilities, and special rules that apply to them.
MOB_C_ANIMAL (Index: 26) Companion
Effect: Mobile is a ranger's animal companion.
MOB_C_FAMILIAR (Index: 27) Companion
Effect: Mobile is a wizard's/sorcerer's familiar.
MOB_C_MOUNT (Index: 28) Companion
Effect: Mobile is a summoned/companion mount.
MOB_MOUNTABLE (Index: 21) Companion
Effect: Mobile can be mounted and ridden.
Code References: act.other.c:2457, 2561 | movement_cost.c:38 | evolutions.c:715
MOB_ELEMENTAL (Index: 29) Companion
Effect: Mobile is an elemental creature.
MOB_ANIMATED_DEAD (Index: 30) Companion
Effect: Mobile is animated undead.
MOB_MERCENARY (Index: 41) Companion
Effect: Mobile is a hired mercenary (only one per person).
MOB_SHADOW (Index: 43) Companion
Effect: Mobile is a shadowdancer's shadow companion.
MOB_EIDOLON (Index: 89) Companion
Effect: Mobile is a summoner's eidolon (powerful customizable companion).
MOB_RETAINER (Index: 95) Companion
Effect: Mobile is a leadership retainer/cohort.
Other Companion Flags: MOB_PLANAR_ALLY (36), MOB_C_O_T_N (85), MOB_VAMP_SPWN (86), MOB_DRAGON_KNIGHT (87), MOB_MUMMY_DUST (88), MOB_GENIEKIND (93), MOB_C_DRAGON (94)
Special Ability Flags
These flags grant NPCs special combat abilities, breath weapons, and magical powers. Many correspond to classic D&D monster abilities.
Combat Abilities
- MOB_ABIL_GRAPPLE (64) - Can perform grapple attacks
- MOB_ABIL_PETRIFY (65) - Can turn enemies to stone
- MOB_ABIL_TAIL_SPIKES (66) - Can fire tail spikes
- MOB_ABIL_LEVEL_DRAIN (67) - Can drain character levels
- MOB_ABIL_CHARM (68) - Can charm enemies
- MOB_ABIL_ENGULF (70) - Can engulf/surround enemies
- MOB_ABIL_SWALLOW (73) - Can swallow enemies whole
- MOB_ABIL_PARALYZE (77) - Can paralyze enemies
Breath Weapons
- MOB_ABIL_FIRE_BREATH (78) - Fire breath weapon
- MOB_ABIL_LIGHTNING_BREATH (79) - Lightning breath weapon
- MOB_ABIL_POISON_BREATH (80) - Poison breath weapon
- MOB_ABIL_ACID_BREATH (81) - Acid breath weapon
- MOB_ABIL_FROST_BREATH (82) - Frost/cold breath weapon
Special Powers
- MOB_ABIL_BLINK (69) - Can blink/teleport in combat
- MOB_ABIL_CAUSE_FEAR (71) - Fear aura/attack
- MOB_ABIL_CORRUPTION (72) - Corruption/disease touch
- MOB_ABIL_FLIGHT (74) - Can fly
- MOB_ABIL_POISON (75) - Poisonous attacks
- MOB_ABIL_REGENERATION (76) - Regenerates HP quickly
- MOB_ABIL_MAGIC_IMMUNITY (83) - Immune to magic
- MOB_ABIL_INVISIBILITY (84) - Naturally invisible
System & Internal Flags
MOB_ISNPC (Index: 3) System
Effect: Read-only flag automatically set on all NPCs.
CRITICAL: System flag - never manually toggle!
MOB_NOTDEADYET (Index: 20) System
Effect: Read-only flag indicating mobile is being extracted.
CRITICAL: System flag - never manually toggle!
MOB_INFO_KILL (Index: 38) System
Effect: Broadcasts message to entire game when killed (world bosses).
MOB_INFO_KILL_PLR (Index: 60) System
Effect: Broadcasts message when this mob kills a player.
MOB_AI_ENABLED (Index: 98) System
Effect: Mobile uses advanced AI for responses.
MOB_UNLIMITED_SPELL_SLOTS (Index: 100) System
Effect: Mobile has unlimited spell slots (used for powerful casters, bosses).
MOB_BUFF_OUTSIDE_COMBAT (Index: 96) System
Effect: UNUSED - Kept for backward compatibility.
Note: Do not use - no longer functional.
Complete Flag Reference
| Index |
Flag Name |
Category |
Primary Purpose |
| 0 | MOB_SPEC | System | Has special procedure |
| 1 | MOB_SENTINEL | Behavior | Won't move |
| 2 | MOB_SCAVENGER | Behavior | Picks up items |
| 3 | MOB_ISNPC | System | Is NPC (read-only) |
| 4 | MOB_AWARE | Combat | Can't be backstabbed |
| 5 | MOB_AGGRESSIVE | Combat | Attacks everyone |
| 6 | MOB_STAY_ZONE | Movement | Stays in zone |
| 7 | MOB_WIMPY | Behavior | Flees when hurt |
| 8 | MOB_AGGR_EVIL | Combat | Attacks evil |
| 9 | MOB_AGGR_GOOD | Combat | Attacks good |
| 10 | MOB_AGGR_NEUTRAL | Combat | Attacks neutral |
| 11 | MOB_MEMORY | Combat | Remembers attackers |
| 12 | MOB_HELPER | Combat | Assists other NPCs |
| 13 | MOB_NOCHARM | Immunity | Can't be charmed |
| 14 | MOB_NOSUMMON | Immunity | Can't be summoned |
| 15 | MOB_NOSLEEP | Immunity | Can't be slept |
| 16 | MOB_NOBASH | Immunity | Can't be bashed |
| 17 | MOB_NOBLIND | Immunity | Can't be blinded |
| 18 | MOB_NOKILL | Immunity | Can't be attacked |
| 19 | MOB_SENTIENT | Classification | Intelligent being |
| 20 | MOB_NOTDEADYET | System | Being extracted |
| 21 | MOB_MOUNTABLE | Companion | Can be ridden |
| 22 | MOB_NODEAF | Immunity | Can't be deafened |
| 23 | MOB_NOFIGHT | Behavior | Won't fight |
| 24 | MOB_NOCLASS | Classification | No class |
| 25 | MOB_NOGRAPPLE | Immunity | Can't be grappled |
| 26-30 | MOB_C_* / MOB_ELEMENTAL | Companion | Various companions |
| 31 | MOB_GUARD | Combat | Protects citizens |
| 32 | MOB_CITIZEN | Classification | Protected by guards |
| 33 | MOB_HUNTER | Combat | Tracks foes |
| 34 | MOB_LISTEN | Behavior | Hears fighting |
| 35 | MOB_LIT | Environment | Emits light |
| 37 | MOB_NOSTEAL | Immunity | Can't be stolen from |
| 38 | MOB_INFO_KILL | System | Broadcasts death |
| 45-54 | MOB_BLOCK_* | Blocking | Directional blocking |
| 55-59 | MOB_BLOCK_* | Blocking | Block exemptions |
| 60 | MOB_INFO_KILL_PLR | System | Broadcasts PC death |
| 61 | MOB_MOB_ASSIST | Combat | Assists other mobs |
| 62 | MOB_NOCONFUSE | Immunity | Can't be confused |
| 63 | MOB_HUNTS_TARGET | Combat | Hunts specific target |
| 64-84 | MOB_ABIL_* | Ability | Special abilities |
| 90-92 | MOB_BLOCK_* | Blocking | Alignment blocking |
| 98 | MOB_AI_ENABLED | System | Advanced AI |
| 99 | MOB_QUARTERMASTER | System | Supply orders |
| 100 | MOB_UNLIMITED_SPELL_SLOTS | System | No spell limits |
Usage Guidelines
Common Mob Archetypes
1. City Guard
MOB_SENTINEL + MOB_GUARD + MOB_MEMORY
Protects citizens, doesn't wander, remembers criminals
2. Aggressive Monster
MOB_AGGRESSIVE + MOB_MEMORY + MOB_HUNTER
Attacks on sight, pursues, remembers enemies
3. Alignment Guardian
MOB_SENTINEL + MOB_AGGRESSIVE + MOB_AGGR_EVIL (or GOOD/NEUTRAL)
Stationary guardian that attacks specific alignments
4. Pack Hunter
MOB_HELPER + MOB_MEMORY + MOB_MOB_ASSIST
Works with other mobs, remembers threats
5. Boss Monster
MOB_NOCHARM + MOB_NOSUMMON + MOB_MEMORY + relevant MOB_ABIL_*
Immune to cheap tactics, dangerous abilities
6. Ambient NPC
MOB_SENTINEL + MOB_NOKILL + MOB_NOFIGHT
Decorative NPC that can't fight and can't be attacked
Flag Conflicts & Requirements
- MOB_AGGRESSIVE conflicts with MOB_HELPER (automatically removed)
- MOB_AGGRESSIVE requires alignment aggro flags (AGGR_EVIL/GOOD/NEUTRAL) to target specific alignments
- Multiple MOB_BLOCK_* direction flags work together
For Developers
Checking Flags:
if (MOB_FLAGGED(mob, MOB_AGGRESSIVE)) {
// Mob is aggressive
}
// Multiple flag check
if (MOB_FLAGGED(mob, MOB_GUARD) && MOB_FLAGGED(mob, MOB_MEMORY)) {
// Guard with memory
}
Setting/Removing Flags:
// Set flag
SET_BIT_AR(MOB_FLAGS(mob), MOB_SENTINEL);
// Remove flag
REMOVE_BIT_AR(MOB_FLAGS(mob), MOB_AGGRESSIVE);
System Flags to Never Modify:
MOB_ISNPC (automatically set)
MOB_NOTDEADYET (extraction system)
MOB_BUFF_OUTSIDE_COMBAT (deprecated)
Code References
Primary Files:
src/structs.h (lines 1131-1232) - Flag definitions
src/mob_act.c - Mobile AI and behavior
src/fight.c - Combat interactions
src/movement.c - Movement and blocking
src/spec_abilities.c - Special abilities
src/spells.c - Spell interactions
Notes
- Mobile flags use array-based bitflags for storage
- Multiple flags can and often should be combined
- Some flags require other flags to function (e.g., MOB_AGGR_EVIL requires MOB_AGGRESSIVE)
- System flags should not be manually set by builders
- Companion flags are automatically set when creatures are summoned
- Special ability flags should match creature capabilities