Builders » Guide

Building mobiles

Mobiles (mobs / NPCs) populate your rooms. This guide covers medit — keywords, descriptions, stats auto-calc, flags, position, spec procs, and the difference between sentinel and wandering mobs.

Last updated: 2026-05-18

📥 Download as Markdown

Building mobiles

A mobile (mob, NPC) is anything that walks, fights, or stands around in your zone other than players. You build them with medit.

Open the editor

medit 3001        Open mob vnum 3001 (or create if new)

If creating new, the editor seeds default fields. Otherwise it loads the prototype.

-- Mob Number:  [3001]
1) Sex: male
2) Keywords: baker
3) S-Desc: the Baker
4) L-Desc:- The Baker stands here, wiping flour from his face.
5) D-Desc:- He's a fat, friendly-looking baker with many scars.
6) Position  : standing
7) Default   : standing
8) Attack    : hit
9) Stats Menu…
A) NPC Flags : SENTINEL ISNPC
B) AFF Flags : (none)
R) Race      : humanoid
D) SubRace   : human
C) Class     : magic user
I) Size      : medium
P) SpecProcs : Set.
S) Script    : Not Set.
W) Copy mob
X) Delete mob
Q) Quit

Descriptions — the three you must write

Keywords (2)

Space-separated. These are what players type to target the mob (look baker, kill baker). Lowercase. Include all reasonable synonyms — baker man midgaard lets look midgaard, look man, and look baker all work.

Short description (3)

Appears every time the mob acts — “the Baker says hello”, “you hit the Baker”. Always start lowercase (“the Baker” not “The Baker”) since it follows a verb. No period at the end.

Convention: the <adjective> <noun>, e.g. the surly dwarf, a haggard wizard, Lord Goren. Unique mobs can drop the article.

Long description (4)

The line a player sees as they walk into the room — describes what the mob is doing. Multi-line is fine.

  • Good: The Baker stands here, wiping flour from his face.
  • Good: A goblin scout creeps along the wall, looking nervously over its shoulder.
  • Bad: the Baker (uses short desc instead — boring)
  • Bad: Description of mob (placeholder leaked)

End with a period.

Detail description (5)

Shown when a player looks at the mob. Multi-line. This is your space to flesh out appearance, mannerisms, what they’re carrying, anything memorable. 3-6 lines typically.

Stats sub-menu (9)

1) Level:       [13]      AdmLevel:  [0]
2) Auto Set Stats (based on level)

Hit Points  (xdy+z):
3) HP NumDice:  [2]
4) HP SizeDice: [12]
5) HP Addition: [160]
6) BHD NumDice:  [2]
7) BHD SizeDice: [7]
8) DamRoll:      [1]

A) Armor Class: [2]
B) Exp Points:  [16000]
C) Gold:        [1534]
D) Hitroll:    [8]
E) Alignment:  [-700]

Level

Mob level (1-100 typical). Influences XP award + drives default stats if you Auto Set.

Auto Set Stats (2)

Use this first when you create a new mob. It computes HP / BHD / AC / XP / gold from level using class-balanced tables. Then tune individual fields if needed.

Don’t use Auto Set after you’ve spent time hand-tuning — it’ll overwrite everything.

HP dice — NumDice d SizeDice + Addition

Mob’s HP on load is NdS+A. E.g. 2d12+160 means 162-184 HP.

BHD dice — bare-hand damage

What the mob deals per swing without a weapon. Same NdS+A formula. 2d7+1 = 3-15 damage.

AC + Hitroll + DamRoll

  • AC lower = harder to hit. -10 is the floor.
  • Hitroll is added to the mob’s THAC0 calculation — higher = better attacker.
  • DamRoll is added to bare-hand damage (after dice).

Alignment

-1000 (max evil) to +1000 (max good). 0 is neutral. Affects:

  • Paladin/cleric reactions to the mob
  • Alignment-tagged spell effects
  • Player alignment drift on kill

Saving throws (e-spec fields)

Five SavingX: values (Para / Rod / Petri / Breath / Spell). Lower = better saves. Defaults are derived from level (warrior save table). Override per-mob if you want a particularly resistant or vulnerable creature.

Position (6) and Default (7)

PositionEffect
STANDINGMost mobs.
SITTINGCan’t attack until standing.
RESTINGLike sitting.
SLEEPINGCan’t perceive most things until woken.
MORTALLYW, INCAP, STUNNED, DEADDamaged states — almost always set to STANDING for new mobs.

Default position is where the mob returns to when not actively doing anything (e.g. after combat). Sleeping default is good for “sleeping guard” archetypes; combat will set them STANDING, then they return to SLEEPING after.

NPC flags (A)

FlagWhat it does
SENTINELMob doesn’t wander. Stays in its load room.
SCAVENGERPicks up dropped objects.
ISNPCAuto-set. Don’t toggle.
AWAREAware of backstabs (can’t be backstabbed).
AGGRESSIVEAttacks PCs on sight. Use sparingly outside dungeons.
STAY_ZONEWon’t leave its zone when wandering.
WIMPYFlees at low HP.
MEMORYRemembers attackers — hunts them on next encounter.
HELPERJoins fights against PCs attacking allies.
NOCHARMCan’t be charmed.
NOSUMMONCan’t be summoned.
NOSLEEPCan’t be put to sleep.
NOBASHCan’t be bashed.
NOBLINDCan’t be blinded.
MULTHIT0One extra swing per round (75% gated by AFF_SLOW).
MULTHIT1Two extra swings (one always-on 75%, one slow-gated 50%).
SPECThe mob has a spec proc attached (the P menu).
NOSUMMONABLECan’t be summoned by mortals.

When to use AGGR

AGGRESSIVE is the most-misused flag. Reserve it for:

  • Wild predators (wolves, bears) — appropriate
  • Dungeon guardians at intentional difficulty waypoints
  • Quest-mob “boss” encounters

Don’t aggr-flag city guards (use COMMAND triggers instead), shopkeepers, or wandering encounter mobs outside dungeons.

Sentinel by default

Most named NPCs should be SENTINEL. Wandering NPCs are visual noise in cities and break shop/quest expectations. Reserve wandering for:

  • Wildlife (wolves, deer)
  • Patrols (guard sergeants on patrol routes)
  • Wandering encounter mobs in dungeons (where the dungeon design expects it)

AFF flags (B)

Permanent affect flags carried by the mob. Common ones:

FlagEffect
DETECT_INVISSees invisible characters.
SANCTUARYHalf damage taken (boss flag).
FLYHovers — exits with sector FLYING accessible.
WATERWALKCan cross WATER_NOSWIM.
INFRAVISIONSees in the dark.
INVISIBLEPlayers need detect_invis to see them.

Use sparingly — every AFF flag is one more layer for players to handle.

Race / Class / Size

Mostly cosmetic at the prototype level, but they drive:

  • Skill grants if you use the class system for the mob
  • Save throw progressions
  • Magic resist tables for some races
  • Combat-damage scaling for some sizes

Match the mob’s archetype. Don’t lie — a dragon should have race dragon, not humanoid.

Spec procs (P)

For mobs that need C-side logic — banking, shopkeeping, area attacks, special combat behaviors. See the Spec procs reference and the full catalog for every named proc.

Common procs you’ll attach

ProcPurposeKey fields
Shop_keeperRun a buy/sell shop (pairs with .shp)freq 100, term 1
Mob_ReceptionistInn rent receptionistfreq 100, term 1, num1 = surcharge
Mob_cryogenicistCryo-rent receptionistfreq 100, term 1
PostmasterMail dispatchfreq 100, term 1
QuestmasterQuest accept/info handlerfreq 100, term 1
Training_masterSkill/spell trainer (practice)freq 100, term 1
Mob_warrior / Mob_cleric / Mob_magic_user / Mob_thiefClass-flavored combat AIfreq 100, term 0
Mob_paladin / Mob_antipaladin / Mob_vampireMore combat AI variantsfreq 100, term 0
Area_attackAoE strike each roundfreq 30-50, term 0, num1 = damage
Quest_block_n (+ other 9 directions)Block a direction until quest donefreq 100, term 1, num1 = quest vnum
Load_mob_on_deathSpawn a follow-up mob on deathfreq 100, term 0 (DEATH), num1 = mob vnum, num2 = chance
Load_item_on_deathDrop a specific item on deathfreq 100, term 0 (DEATH), num1 = obj vnum, num2 = chance
Explode_on_deathDamage everyone in room on deathfreq 100, term 0 (DEATH), num1 = damage
Master / SlaveLink two mobs as master/followerfreq 100, term 1, num1 = paired vnum
Resist_damageStackable damage resistancefreq 100, term 0 (COMBAT), num1 = damage type, num2 = %
Reflect_damageReflect damage back to attackerfreq 50, term 0 (COMBAT), num1 = % reflected
Heal_from_damageNPC heals from a damage typefreq 100, term 0 (COMBAT), num1 = type, num2 = % converted
CowardFlees aggressively at low HPfreq 100, term 0
Assist_mobJoins ally fights against PCsfreq 100, term 0
Hate_mage / Hate_cleric / Hate_bard / Hate_weaklingAggro toward classfreq 100, term 0

Attach flow

medit <vnum>
P                              open spec proc menu
N                              insert new
<pick the proc by number>
<set freq>                     usually 100; 25-50 for probabilistic combat procs
<set run_type>                 leave 0 to use the registry's default
<set term>                     1 for command-handler procs; 0 for stackable
<set num1..num5>               per the proc — see examples below
<set internal>                 for combat procs: a resist_types[] index
Q → y                          save the mob

The SPEC NPC flag is auto-set when you save a mob with a non-empty proc list.

Worked examples

Example 1 — A shopkeeper

The Midgaard baker (vnum 3001) sells bread.

medit 3001
P → N → Shop_keeper
  freq 100, term 1, num1..5 = 0
Q → y

Then create the shop in sedit <shop-vnum> with the baker’s vnum as the keeper. The Shop_keeper proc routes buy / sell / list / value to that shop.

Example 2 — An inn receptionist with a surcharge

medit 3050                                  (the innkeeper)
A                                            (NPC flags)
   ensure SENTINEL is set
P → N → Mob_Receptionist
  freq 100, term 1
  num1 = 50    (50-gold surcharge on top of per-item rent)
Q → y

Players who say rent to this mob pay base rent + 50 gold daily surcharge.

Example 3 — A quest-blocking guard

A guard blocks the north exit until quest 8000 is done.

medit 8050                                   (the gate guard)
A                                            (NPC flags)
   set SENTINEL
P → N → Quest_block_n
  freq 100, term 1
  num1 = 8000  (the prereq quest vnum)
Q → y

Players who haven’t completed quest 8000 get a refusal message when they try north. Players who completed it walk through.

Example 4 — A combat NPC with AoE

A goblin shaman who burns the whole party.

medit 9001                                   (goblin shaman)
A                                            (NPC flags)
   set ISNPC, AGGR
P → N → Mob_magic_user                       (cast offensive spells)
  freq 100, term 0
P → N → Area_attack                          (additional AoE)
  freq 30, term 0
  num1 = 12                                  (12 dam per AoE)
  internal = 2                                (resist_types[2] = Fire)
Q → y

Two procs stack. Each combat round, the magic-user AI fires (always) and the area attack has a 30% chance to add a fire-typed AoE on top.

Example 5 — Boss with spawns on death

A dragon that spawns two dragonlings when killed.

medit 9100                                   (dragon)
P → N → Load_mob_on_death
  freq 100, term 0
  num1 = 9101                                (dragonling vnum)
  num2 = 100                                 (100% chance)
P → N → Load_mob_on_death
  freq 100, term 0
  num1 = 9101
  num2 = 100
P → N → Load_item_on_death
  freq 100, term 0
  num1 = 9500                                (a dragon scale obj)
  num2 = 80                                  (80% chance to drop)
Q → y

Three death procs — when the dragon dies, two dragonlings spawn (each 100% chance) and a dragon scale drops 80% of the time.

Example 6 — Boss with stackable damage modifiers

A fire elemental that’s immune to fire and reflects half of physical damage.

medit 9200                                   (fire elemental boss)
P → N → Resist_damage
  freq 100, term 0
  num1 = 2                                   (resist_types[2] = Fire)
  num2 = 100                                 (100% — full immunity)
P → N → Reflect_damage
  freq 50, term 0
  num1 = 50                                  (50% reflected)
Q → y

Fire spells do 0 damage. Physical attacks have a 50% chance to send half the damage back to the attacker.

Example 7 — Master + slave pair

A wizard who controls a familiar.

On the wizard (the master):

medit 7050                                   (the wizard)
P → N → Master
  freq 100, term 1
  num1 = 7051                                (the familiar's vnum)
Q → y

On the familiar (the slave):

medit 7051                                   (the familiar)
P → N → Slave
  freq 100, term 1
  num1 = 7050                                (the wizard's vnum)
Q → y

The familiar follows the wizard around. If the wizard dies, the slave proc reacts (typically the familiar flees or transforms — depends on proc semantics).

Example 8 — Two procs working together: cleric with hatred

A holy cleric who hates mages on sight.

medit 4100                                   (the holy cleric)
P → N → Mob_cleric                           (heals self, harms attackers)
  freq 100, term 0
P → N → Hate_mage                            (aggro toward mages)
  freq 100, term 0
P → N → Cast_heal_on_group                   (party heals each round)
  freq 100, term 0
Q → y

Three stacked procs: standard cleric combat AI, mage-hatred (aggros mages on sight), and group-heal (heals nearby allies each round).

Combat proc tips

  • freq works as probability per combat round for COMBAT procs. 100 = always; 30 = once every ~3 rounds.
  • term is almost always 0 for COMBAT procs so multiple effects layer.
  • internal = resist_types[] index for damage-typed procs. Common values: 1=Physical, 2=Fire, 3=Cold, 4=Electric, 6=Magic, 7=Divine.
  • The total dispatcher cost scales with the number of attached procs — five stacked combat procs on a busy mob is fine; fifty isn’t.

Reading existing procs

To copy a working mob’s proc setup:

medit <known-good-vnum>           (e.g. the prod baker)
P                                  see the list
E → <line>                         examine each field
Q                                  exit without saving

Then replicate the values on your new mob. Most procs have stable num1..5 conventions across mobs that use them.

When to use a trigger instead

If your behavior can be expressed as conditional dialogue, scripted reactions, or quest logic — use a DG trigger instead. Spec procs are right for:

  • Performance-critical combat (procs are native C function calls)
  • Tight integration with the damage pipeline (resist routing, reflect, heal-from)
  • Standard service patterns (shop, postmaster, receptionist) where the proc already exists

Spec procs are wrong for:

  • Custom dialogue (“if the player says X, respond Y”) — use a SPEECH trigger
  • Quest scripting beyond simple direction blocks — use COMMAND / RECEIVE triggers
  • Anything you want to edit without recompiling — triggers are runtime-editable

Listing what’s already on a mob

In-game:

stat mob <vnum>           shows attached spec procs in the stat block
medit <vnum> → P          full editing view

Most procs require their num1..num5 to be set for specific things (Slave needs num1=master vnum, etc.). When in doubt, look at an existing mob using the proc as a reference.

Scripts (S)

DG triggers attached by vnum. The trigger must exist first (trigedit). Mob triggers are the right tool for: greetings, quest responses, scripted dialogue, conditional behavior. They’re easier to maintain than spec procs and editable in-game. See Triggers.

Save + test

Qy saves to memory. If CONFIG_OLC_SAVE is on, also writes to lib/world/mob/<zone>.mob.

Once saved:

load mob 3001              Spawn the mob next to you
stat mob 3001              View its prototype data
mset 3001 hp 250           Tweak the live instance

Walk through a real interaction:

  1. Aggro check — don’t attack me if I shouldn’t be attacked
  2. Trigger fires — does the mob say what I expect?
  3. Spec proc fires — does the bank actually accept deposits?
  4. Combat — does it use weapons / spells / specials correctly?
  5. Death — drops the right loot, awards the expected XP, fires the death trigger if any?

See also