Skip to content

OLC Resets

Kit Oliynyk edited this page Nov 3, 2026 · 4 revisions

TL;DR: A room has an ordered list of resets. resets edits the list of the room you stand in. Order matters: a mob reset must come before the give and equip lines that belong to it, and a container must come before the items that go inside it. Use when: you place mobs and items in a room, give a mob its gear, fill a chest, mark an item as random loot, or need to know why a reset did nothing. Source of truth: plug-ins/olc/resets.cpp (the command), plug-ins/updates/update_areas.cpp (reset_room, reset chances), plug-ins/areas/xmlroom.cpp (XML forms). Verified: 2026-11-02 against dreamland_code a7c4fd10, dreamland_world a35c62ce, dreamland_areas 6a04168

The command

Resets are edited for the room you stand in. You need rights on that room's vnum.

resets
resets <index> mob <vnum> [max in world] [max in room]
resets <index> obj <vnum> <wear location>
resets <index> obj <vnum> inside <container vnum> [limit] [count]
resets <index> obj <vnum> room
resets <number> delete
resets <number> flag <flags>
resets <number> rand normal|rand_stat|rand_all
resets <number> tier <1-5>
resets <number> wear <wear location>
resets search <vnum> [normal|rand_stat|rand_all]
resets search rand_stat|rand_all
resets void

resets with no argument prints the list. Each line starts with its number. Lines for mobs and floor items (M, O) have bright numbers, lines that depend on an earlier line (G, E, P) have dim ones.

Form Result
mob <vnum> [world] [room] Adds a mob reset. world is the most copies of this mob that may exist in the world, room the most in this room. Both default to 1. The mob must exist.
obj <vnum> <wear location> Gives the item to the mob of the nearest mob line above. With the wear location none the mob carries it in the inventory (a give line). With any other location the mob wears or wields it (an equip line). ? wearloc lists the locations.
obj <vnum> inside <container> Puts the item into a container. The container must be of type container. limit is the world count above which the chance to create it drops, count is how many of this item the container is filled up to. Default 1 and 1.
obj <vnum> room Puts the item on the floor of the room (a drop line).
<number> delete Removes the line.
<number> flag <flags> Toggles reset flags: always, never (? reset_flags).
<number> rand <kind> Marks a weapon line as random loot, see Random weapons.
<number> tier <1-5> Best weapon tier of a random line.
<number> wear <location> Changes the wear location of a give or equip line. Switching between none and a real slot turns a give into an equip and back.
search <vnum> Finds every room that places that item. Add normal, rand_stat or rand_all to filter.
void Adds a random line, which shuffles the exits of the room at every reset. Only one per room. It shuffles all six exits (minDoor 0, maxDoor 6).

The <index> of an adding command is the position the new line is inserted at, counted from 0. resets 0 mob 3001 puts the line first. A number larger than the list appends it. The <number> of the other commands is the position shown in the list, counted from 1.

Examples:

resets 99 mob 3010 1 1
resets 99 obj 3011 wield
resets 99 obj 3012 none
resets 99 obj 3013 room
resets 99 obj 3014 inside 3013 5 2

The first line creates the guard. The second puts a sword in its hands, the third a purse in its pack. The fourth puts a chest on the floor, and the fifth fills the chest with items 3014.

How a reset runs

When an area resets, every room of the area runs its list from top to bottom.

Line Rule
mob Creates the mob unless the world already holds world copies of it (a world value of -1 means no check) or this room already holds room copies.
give, equip Applies to the mob created by the nearest mob line above. If that line created nothing in this pass (the limits were reached) these lines are skipped. A mob that stands there already gets its missing gear back through a separate check.
drop Creates the item on the floor, unless a copy is already on the floor of this room or the item's global limit is reached.
put Needs the container to be in the room: on the floor, inside another floor container, or carried by a mob in the room. Creates items until the container holds count of the listed vnums.
random Shuffles the exits with door numbers from minDoor up to, but not including, maxDoor. Doors are numbered 0 north, 1 east, 2 south, 3 west, 4 up, 5 down.

Conditions that apply to a whole room:

  • A line with the flag never is skipped by the periodic reset. It still runs on a forced reset: aedit reset, redit reset and the first reset at every boot. A line with the flag always is created even while a player is in the area, like every line of a dungeon area.
  • While a player is in the area, floor items (drop) and the contents of containers lying on the floor are not created, and lock states of containers are not restored. Areas with the popular or dungeon flag ignore this rule. Mobs are created either way.
  • A forced reset ignores the player check.

Rules for items that have a global limit (see OLC-Objects):

  • Nothing is created when the world already holds that many copies.
  • An item carried by a mob or placed in a container is created only while no player is in the area, and then with a 10 percent chance per reset. A forced reset into a container skips the chance.
  • Items inside a container whose world count is already at the line's limit are created with a 25 percent chance.

Every other item is created every time. Goods that a shopkeeper receives through give lines are marked as shop stock.

Area timing

An area is reset by the periodic area update, every 110 seconds, once the area has aged. A busy area (players present recently) resets when it is empty of players or old enough. An idle area resets after a longer time. Areas with the popular flag come back sooner. The first reset of every area happens at boot. aedit has a reset command, redit reset resets one room (and creates items without chance rolls).

Resets do not move or remove a mob that already stands in the world. A mob that is not in the room any more is not "replaced": the next reset creates a new one if the limits allow.

Random weapons

A weapon line can ask for a generated weapon.

rand value Meaning
normal The prototype as written.
rand_stat The weapon keeps its names. Its stats are generated.
rand_all Names and stats are generated.

tier is the best quality tier the roll may give: 1 is the best, 5 the worst, 3 the default. Setting rand on a line that has no tier sets it to 3. For a mob's wielded weapon, rand also moves the wear location from wield to sheath (and back when you set normal). The page Item-Power explains the tiers.

Resets in the area file

Each room carries its list in a <resets> element, in order. The line kinds are leaf elements:

OLC kind Element Attributes
mob <mob> vnum, limit (world), maxHere (room)
give <give> vnum
equip <equip> vnum, to (wear location name)
drop <drop> vnum
put <put> vnum (one or several vnums, the item is picked at random), in (container vnum), limit, maxHere
void <random> minDoor, maxDoor

Every element may also carry flags, rand and bestTier. See Area-Format.

Pitfalls

  • A <put> with several vnums keeps its whole list through asave and autosave. The resets listing shows the lowest vnum and the others on an or: line. resets search, oedit list and the item search find the line by any of its vnums.
  • A mob that is saved with its room is restored at boot from the saved copy. A new give or equip line will not reach it, and deleting its mob line will not remove it: OLC-Mobiles.
  • give lines of a mob that is not in the list above them do nothing and print "No Previous Mobile" in the list.
  • resets <index> obj ... inside fails if the container prototype is not of type container.
  • resets void shuffles all six exits. To shuffle only the four compass exits, set maxDoor="4" in the area file.
  • Door state resets (D) exist in the list format but the XML does not store them, and resets cannot create them.

See also: OLC-Rooms, OLC-Mobiles, OLC-Objects, Item-Power, Area-Format.

Clone this wiki locally