Skip to content

Instances & Resets

How dungeon and raid instances are created, saved and reset (src/game/Maps/MapPersistentStateMgr.cpp).


Map Types

map_template classifies every map via map_type:

Type Meaning Reset behaviour
0 Common/Continent (Eastern Kingdoms, Kalimdor) never resets
1 Dungeon (5-man) saves on boss kill; reset by schedule
2 Raid (40/20-man) same as dungeon with longer reset_delay
3 Battleground handled by the Battlegrounds system

(enum MapTypes, src/game/Database/DBCEnums.h; vanilla has no arena map type.)

reset_delay on the map defines the days between resets; the actual schedule lives per map in instance_reset.


Instance Saves & Binds


Scripted Instances

  • map_template.script_name binds a C++ instance script (under src/scripts/eastern_kingdoms/, src/scripts/kalimdor/, … by continent/zone).
  • Scripts store their own state via commands 37 SET_INST_DATA / 38 SET_INST_DATA64 (DB Script Tables) and can read it back in conditions (CONDITION_INSTANCE_DATA, 34).
  • Encounter statistics (kills, wipes, custom counters) stream into the logs database: instance_creature_kills, instance_wipes, instance_custom_counters.