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¶
- When a group kills a save-triggering encounter, an entry is created in
instanceand binds are recorded for: - each player →
character_instance - the group →
group_instance - Bound players re-enter the same instance id until it resets.
- Per-instance creature/object respawn state persists in
creature_respawn/gameobject_respawn, keyed by instance.
Scripted Instances¶
map_template.script_name binds a C++ instance script (undersrc/scripts/eastern_kingdoms/,src/scripts/kalimdor/, … by continent/zone).- Scripts store their own state via commands 37
SET_INST_DATA/ 38SET_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.