> For the complete documentation index, see [llms.txt](https://axiomemu.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://axiomemu.gitbook.io/docs/data/event/imperialguardian.md).

# ImperialGuardian.dat

Imperial Guardian event: party-run dungeon whose tier is picked from the current day of the week. Per-instance timing, default/support monster AI unit references, and a 60-row monster stat multiplier table keyed by the party's highest level tier.

## File Location

```
Data/Event/ImperialGuardian.dat
```

Loaded once at GameServer startup. Gated by [Event.dat](/docs/gameserver/event-dat.md#imperial-guardian) `ImperialGuardianEvent`. Changes require a restart.

## Sections

### Section 0 - Timing

```
0
//NotifyTime   EventTime   CloseTime
1              10          1
end
```

Minutes.

* `NotifyTime` - pre-wave preparation window (used by every WAIT state).
* `EventTime` - per-stage combat window (used by every PLAY state).
* `CloseTime` - post-run cleanup window before the instance returns to empty.

### Section 1 - AI Unit References

```
1
//DefaultMonsterAIUnitNumber   SupportMonsterAIUnitNumber
72                             73
end
```

Two AI units used by IG monsters. Must exist in [MonsterAIUnit.xml](/docs/data/monster/monsteraiunit.md).

### Section 2 - Per-Index Monster Stats

Scaling table keyed by row index. The server picks a row from `((HighestLevel - 1) / 10)` where `HighestLevel` is the highest combined Level + MasterLevel among the party on entry (capped at 600).

```
2
//Index   Level   MaxLife   DamageMin   DamageMax   Defense   AttackRate   DefenseRate
0         45      10.00     3.00        3.00        3.00      5.00         5.00
1         46      10.00     4.00        4.00        4.00      6.00         6.00
...
end
```

Index 0-59 in the shipped template. Each non-level column is a multiplier applied to the base monster stat, then scaled again by Event.dat `ImperialGuardianDifficultRate` (percent).

| Column                    | Effect                                            |
| ------------------------- | ------------------------------------------------- |
| `Index`                   | Row ID (picked by the party's highest level tier) |
| `Level`                   | Monster level override for the row                |
| `MaxLife`                 | HP multiplier                                     |
| `DamageMin` / `DamageMax` | Damage range multipliers                          |
| `Defense`                 | Defense multiplier                                |
| `AttackRate`              | Hit rate multiplier                               |
| `DefenseRate`             | Dodge rate multiplier                             |

## Entry Rules

Entry goes through the Jerry The Adviser NPC and enforces:

* Event enabled in Event.dat.
* Character level at least 15 to talk to the NPC.
* Inventory carries the day's entry token. On Sunday the server looks for item (14,109); on any other day it looks for item (14,102) + dayOfWeek. If neither is present the server also accepts fallback tickets: item (13,127) on Sunday, item (13,126) on any other day.
* No Imperial Guardian instance currently running (only one active instance at a time).
* All four IG map servers (69-72) are online.
* PK level below 4 unless `PKLimitFree` is set in Event.dat.

On success, the day's ticket loses one durability and the character (and every party member) is moved to the instance gate `307 + level * 5`.

## Tier Selection

The tier is resolved from `GetLocalTime().wDayOfWeek`:

| Day                 | Level    | Map                               |
| ------------------- | -------- | --------------------------------- |
| Sunday              | 3 (hard) | MAP\_IMPERIAL\_GUARDIAN4 (map 72) |
| Monday, Thursday    | 0        | MAP\_IMPERIAL\_GUARDIAN1 (map 69) |
| Tuesday, Friday     | 1        | MAP\_IMPERIAL\_GUARDIAN2 (map 70) |
| Wednesday, Saturday | 2        | MAP\_IMPERIAL\_GUARDIAN3 (map 71) |

Formula: `level = (dayOfWeek == 0) ? 3 : ((dayOfWeek - 1) % 3)`. Map = `MAP_IMPERIAL_GUARDIAN1 + level`.

## Party Layout

* Up to 5 members per run (party-based; solo entry is allowed and creates a single-player instance).
* On entry the whole party (or the solo player) is moved to the tier gate; no further joins once the instance is live.

## Wave Structure

Each run alternates WAIT (spawn/prep) and PLAY (combat) states and uses `NotifyTime` for WAIT and `EventTime` for PLAY:

* Levels 0-2: three PLAY stages (PLAY1, PLAY2, PLAY3). The stage-3 boss is day-of-week based (one of six side bosses mapped from `dayOfWeek`).
* Level 3 (Sunday, hard): four PLAY stages (PLAY1-PLAY4) ending with the main boss fight at stage 4.

On successful clear the last stage, each member receives XP: `10000 * ((HighestLevel - 1) / 10)` for levels 0-2, `15000 * ((HighestLevel - 1) / 10)` for level 3; that value is then multiplied by the per-account-level `AddEventExperienceRate`.

## Boss Drops

* Side boss drops use `ITEM_BAG_IMPERIAL_GUARDIAN_SIDE_BOSS1-5`, picked by `((HighestLevel - 1) / 100)` (clamped 0-4).
* Level 3 main boss drops use `ITEM_BAG_IMPERIAL_GUARDIAN_MAIN_BOSS1-5`, picked the same way.
* Side-boss kills also drop one day-specific token per participant (item (14,102)+dayOfWeek on Mon-Sat).

## Cross-File Dependencies

| Value                                             | Related in                                                                 |
| ------------------------------------------------- | -------------------------------------------------------------------------- |
| Enable flag                                       | [Event.dat](/docs/gameserver/event-dat.md) `ImperialGuardianEvent`         |
| Final difficulty scale                            | [Event.dat](/docs/gameserver/event-dat.md) `ImperialGuardianDifficultRate` |
| AI units                                          | [MonsterAIUnit.xml](/docs/data/monster/monsteraiunit.md)                   |
| Monster definitions (gates, bosses, support mobs) | [Monster.txt](/docs/data/monster/monster.md)                               |
| Reward bags 88-97 (side + main boss)              | [EventItemBag](/docs/data/eventitembag.md)                                 |
| Maps 69-72                                        | [MapManager.xml](/docs/data/mapmanager.md)                                 |

## Common Issues

* **Boss too hard or too easy** - adjust `ImperialGuardianDifficultRate` in Event.dat first; tune per-index rows only when specific tiers stay off.
* **AI unit missing** - section 1 references a unit number not in MonsterAIUnit.xml; the main and support AI both fail to attach.
* **Wrong tier opens** - tier is driven by server local time's day of week; verify the server time zone, not the client's.
* **Entry silently fails** - the day-of-week ticket (item 14,102+day, or 14,109 on Sunday) or a fallback Invitation (item 13,126 / 13,127) must be present; the NPC rejects players below Level 15.
* **Only one instance at a time** - the system serializes IG runs globally; new entries are rejected while another run is active.
