MonsterSetBase
Monster spawn locations, density, and respawn patterns
Controls where and how monsters spawn across all maps. Uses a master registry file that references per-map spawn files.
File Location
Master registry: GameServer/Data/Monster/MonsterSetBase.xml
Per-map spawns: GameServer/Data/Monster/MonsterSetBase/*.xml (one file per map)
Dependencies
Spawns reference monster stats by Class (Index)
Map loading
Server reads spawn files during map initialization
File Structure
MonsterSetBase.xml (Master Registry - NOT USED)
The main file exists for legacy/compatibility but is NOT loaded by the server. All spawns are loaded from per-map files in the MonsterSetBase/ folder.
<?xml version="1.0" ?>
<MonsterSetBase>
<!-- This file is NOT read by the server -->
<!-- All spawns come from MonsterSetBase/*.xml files -->
</MonsterSetBase>The server does NOT load MonsterSetBase.xml. It only loads files from the MonsterSetBase/ or MonsterSetBaseCS/ folder via LoadMapFolder(). Any edits to the master XML file will have no effect. Always edit the per-map files in the folder.
Per-Map Spawn Files
Each map has its own file: MonsterSetBase/000 - Lorencia.xml, MonsterSetBase/001 - Dungeon.xml, etc.
Map numbers match the game's internal map IDs (00 = Lorencia, 01 = Dungeon, 02 = Devias, etc.).
Spawn Entry Attributes
Type
int
Spawn type (see Spawn Types below)
Class
int
Monster Index from Monster.xml
Map
int
Map number (00 = Lorencia, 01 = Dungeon, etc.)
Dis
int
Roaming distance from spawn point (in tiles)
X
int
Spawn X coordinate
Y
int
Spawn Y coordinate
TX
int
Target X coordinate (Type 1/3 only) - defines spawn area with X
TY
int
Target Y coordinate (Type 1/3 only) - defines spawn area with Y
Dir
int
Facing direction (0-7, or -1 for random)
Count
int
Number of monsters to spawn (Type 1/3 only, minimum 1 if 0)
Value
int
Event identifier (Type 3 only) - used by Invasion Manager to filter spawns
Comment
string
Description (optional, for admin reference)
Spawn Types
0
Fixed
Single monster at exact X/Y, respawns at same location
NPCs, guards, stationary bosses
1
Group
Count monsters spawn randomly between (X,Y) and (TX,TY), each respawns at random location in area
Normal hunting zones
2
Spot
Single monster spawns at random location in X/Y±3 range (randomized at server start, then fixed)
Scattered individual spawns
3
Event
Count monsters for invasion events, uses Value for event filtering
Invasion Manager, White Wizard events
4
Event Fixed
Single monster for event systems, spawns at exact X/Y
Blood Castle, Devil Square, Illusion Temple
Type 0: Fixed Spawn
Spawns exactly 1 monster at X=122, Y=110
Dis="00" means monster cannot move (stuck in place)
Dir="03" faces south (0=north, 1=NE, 2=east, 3=SE, etc.)
Use for NPCs and bosses at specific locations
Type 1: Group Spawn
Spawns 7 spiders randomly within a 10-tile radius of (187,121)
TX/TY define the spawn area bounds (if different from X/Y, creates rectangular area)
Dis="10" allows monsters to roam 10 tiles from their spawn point
Dir="-1" means random facing direction
Use for normal monster packs in hunting zones
Type 2: Spot Spawn
Spawns 1 monster at a random location within X±3, Y±3 tiles
Important: Location is randomized ONCE when server starts, then becomes fixed
After death, monster respawns at the same randomized location (not re-randomized)
Good for scattered individual monsters that shouldn't cluster
Commonly used in Noria for BeetleMonster and ForestMonster
Type 3: Event Spawn (Invasion Manager)
Similar to Type 1 but controlled by Invasion Manager and event systems
Count monsters spawn randomly between (X,Y) and (TX,TY)
Value attribute is used by event systems to filter/identify spawn groups
Used by White Wizard invasions and custom event systems
NOT directly used by Blood Castle, Devil Square (they use Type 4)
Type 4: Event Fixed Spawn
Single monster at exact X/Y for event systems
Behaves like Type 0 but filtered by event code (Type 3/4 are excluded from normal spawns)
Used by Blood Castle, Devil Square, Illusion Temple, Imperial Guardian, Raklion
Event systems programmatically control when these spawns are activated
Direction Values
0
North (↑)
4
South (↓)
1
Northeast (↗)
5
Southwest (↙)
2
East (→)
6
West (←)
3
Southeast (↘)
7
Northwest (↖)
-1
Random
Important Behavior
Spawn Timing
Initial spawn: All Type 0, 1, and 2 monsters spawn when the GameServer starts and loads maps. Type 3 and 4 are skipped during normal spawn and only activated by event systems.
Respawn: After death, monsters respawn based on their RegenTime in Monster.xml. The respawn location depends on spawn type:
Type 0/4: Exact same X/Y location
Type 1/3: New random location within the spawn area
Type 2: Same randomized location (not re-randomized)
Coordinate System
Coordinates are in tiles (not pixels)
Origin (0,0) is typically top-left corner
Maximum coordinates vary by map (usually 255x255 or similar)
Invalid coordinates = monster spawns but is unreachable/invisible
Dis (Roaming Distance)
Dis="00" = Monster cannot move (stays at spawn point)
Dis="10" = Monster can wander up to 10 tiles from spawn point before AI forces return
Distance is calculated as Euclidean distance from spawn point (sqrt formula)
Too high Dis on maps with walls = monsters may appear to walk through walls when returning
NPCs should always have Dis="00" to prevent walking away
The roaming distance check uses spawn point (StartX/StartY), not the original config X/Y. For Type 2, this means the monster roams from its randomized location, not the original config coordinates.
Count Behavior
Type 1 and 3 spawn exactly Count monsters:
Count="007" spawns 7 monsters
Count="000" spawns 1 monster (zero is converted to 1 automatically)
Each monster spawns at a random point within the spawn area
When one dies, it respawns at a new random location in the same area (Type 1/3 only)
TX/TY as Spawn Area
For Type 1/3, (X,Y) and (TX,TY) define a rectangular spawn area:
If TX=X and TY=Y, spawns are clustered around that point
If TX≠X or TY≠Y, spawns are spread across the rectangle
Example: X="100" Y="100" TX="120" TY="120" = 20x20 tile spawn zone
The system tries up to 100 times to find a walkable location in the area
Event Spawn Filtering (Type 3/4)
Type 3 and 4 spawns are NOT included in the normal monster spawn during map initialization. They are filtered out and only activated by event systems:
Type 3: Invasion Manager uses the
Valueattribute to match spawn groupsType 4: Blood Castle, Devil Square, Illusion Temple, Imperial Guardian, and Raklion use
MonsterClassandMapto find specific spawns
This allows event monsters to be defined alongside normal monsters without interfering with regular gameplay.
Examples
Spawns Trainer NPC at fixed location in Lorencia, cannot move (Dis=0), faces southeast.
Spawns 7 Bull Fighters around (201,69) with 10-tile roaming range, random facing.
Spawns 50 Spiders across an 80x100 tile zone (from 140,80 to 220,180), creating a dense hunting area.
Spawns Gorgon boss at (125,125), can move 5 tiles, faces north. Respawn time controlled by Monster.xml RegenTime.
Defines gate spawn for Blood Castle event. Type 4 means it won't spawn during normal map initialization - only when Blood Castle event activates.
Each monster spawns at a randomized location (±3 tiles) when server starts. After that, each respawns at its own fixed location. Creates scattered but predictable spawns.
Per-Map Spawn Files
Each map has its own spawn file. Common maps:
00
000 - Lorencia.xml
Lorencia
01
001 - Dungeon.xml
Dungeon
02
002 - Devias.xml
Devias
03
003 - Noria.xml
Noria
04
004 - Lost Tower.xml
Lost Tower
07
007 - Atlans.xml
Atlans
08
008 - Tarkan.xml
Tarkan
11-17
011 - Blood Castle 1.xml to 017 - Blood Castle 7.xml
Blood Castle
24-29
024 - Kalima 1.xml to 029 - Kalima 6.xml
Kalima
37-39
037 - Kanturu 1.xml to 039 - Kanturu 3.xml
Kanturu
When adding spawns to a map, edit the corresponding map file (e.g., 000 - Lorencia.xml for Lorencia spawns), not the master MonsterSetBase.xml.
Common Tasks
Add Monster Spawn to Map
Find the map file (e.g.,
002 - Devias.xml)Add a new
<Monster>entrySet Type (usually 1 for monster groups)
Set Class to monster Index from Monster.xml
Set X/Y coordinates and Count
Increase Monster Density
Find existing spawn entries and increase Count:
Create Dense Hunting Zone
Add multiple spawn entries with overlapping areas:
Creates 45 Hell Hounds across overlapping zones for intense hunting.
Remove Monster from Map
Delete or comment out the spawn entry:
Move Boss Location
Change X and Y coordinates:
Common Issues
Monsters spawn inside walls. Check that X/Y coordinates are on walkable terrain. Use in-game /move command to verify coordinates are valid.
Count="000" spawns 1 monster, not 0 (only for Type 1/3). The code automatically converts Count=0 to Count=1. To disable a spawn, delete the entry or comment it out with <!-- -->.
Changes don't appear immediately. Monsters already spawned remain until they die. For immediate updates, restart the GameServer or use /reload commands if available.
Dis too high causes wall clipping. If monsters appear to walk through walls, reduce their Dis value to keep them within the intended area. The pathfinding return-to-spawn logic can cause monsters to walk through obstacles.
Type 2 spawns are unpredictable between server restarts. Each Type 2 spawn randomizes location when the server starts. Restarting the server will place the monster at a different random location within the ±3 tile range. This makes Type 2 unsuitable for precise placement needs.
Too many spawns cause lag. The server has a hard limit of MAX_MSB_MONSTER = 10000 total spawn entries across ALL maps. This counts individual spawn slots, not Count multiplier. Example: Type 1 with Count="050" creates 50 spawn slots. Monitor total spawn count when adding large groups.
LoadMapFolder behavior: The server loads all .xml files from MonsterSetBase/ or MonsterSetBaseCS/ folder (depending on server type). The master MonsterSetBase.xml file is NOT loaded - all spawns come from per-map files in the folder.
Last updated