CastleDeepEvent.dat

Castle Deep event (also known internally as Loren Deep): schedule of daily run start times, spawn group selection rates, when each group spawns within a run, and the monster placements per group and stage.

File Location#

Data/Event/CastleDeepEvent.dat

Loaded once at GameServer startup. Gated by Event.dat CastleDeepEvent. Changes require a restart.

Sections#

Section 0 - Schedule#

0
//Year   Month   Day   DoW   Hour   Minute   Second
*        *       *     *     4      0        0
*        *       *     *     12     0        0
*        *       *     *     20     0        0
end

Each row is one scheduled run. * is a wildcard (matches any value); concrete numbers pin the run to that field. The shipped template uses wildcards on Year/Month/Day/DoW with fixed Hour/Minute/Second, producing three daily runs at 04:00, 12:00, and 20:00.

Section 1 - Group Spawn Rates#

1
//Group   SpawnRate
1         50
2         50
end
ColumnEffect
GroupSpawn group ID (referenced by sections 2 and 3)
SpawnRatePercent chance this group is picked when rolled (0-100)

At the start of each run, the GameServer loops through the group list and rolls rand() % 100 < SpawnRate per entry, repeating until one group is chosen. Groups listed earlier have priority when multiple rolls succeed. If all entries fail, the loop repeats until one hits, so at least one SpawnRate must be above zero.

Section 2 - Group Spawn Timing#

2
//Index   Group   SpawnMinute
1         1       0
1         2       10
1         3       20
...
end

Controls when within a run each stage's monsters spawn.

ColumnEffect
IndexThe active group picked in section 1 is matched against this column
GroupStage ID within the selected group; spawns advance stage 1, 2, 3 ...
SpawnMinuteMinutes after run start when this stage spawns

At each tick, the server spawns the stage whose Index equals the active group and whose Group equals the current stage counter, once (CastleDeepEventTime - RemainingMinutes) equals SpawnMinute.

Section 3 - Monster Spawns#

3
//Index   Group   Monster   Count   X      Y      TX      TY
1         1       39        15     60     28     132     73
...
end
ColumnEffect
IndexActive-group match (section 1 selection)
GroupStage match (section 2 Group)
MonsterMonster class index
CountNumber to spawn
X, YSpawn rectangle top-left corner
TX, TYSpawn rectangle bottom-right corner

Monsters spawn at random walkable positions inside the (X,Y)-(TX,TY) rectangle. All Castle Deep monsters spawn on the Castle Siege map (map 30), not on Kalima. They are tagged with a dedicated attribute so the ClearMonster pass at run end removes only Castle Deep entities.

Cross-File Dependencies#

ValueRelated in
Enable flagEvent.dat CastleDeepEvent
Run duration (minutes)Event.dat CastleDeepEventTime
Monster class indicesMonster.xml
Map 30 (Castle Siege; host map for Castle Deep spawns)MapManager.xml

Common Issues#

  • Nothing spawns at the scheduled time - section 3 has no rows matching the active Index/Group combination, or section 2's SpawnMinute exceeds CastleDeepEventTime
  • Run starts but never ends - CastleDeepEventTime is zero in Event.dat
  • Event always picks the same group - one SpawnRate dominates; reduce it or raise the other
  • Monsters spawn outside the map - X/Y/TX/TY rectangle extends past the Castle Siege playable area; check MapManager terrain bounds
  • Event collides with Castle Siege - section 0 times overlap with the active CS battle window; stagger the hours

Last updated April 21, 2026