Monster Skill System
The monster skill system is split across three files that work together to define monster special abilities. Each file has its own loader and its own index range.
File Locations#
Data/Monster/MonsterSkill.xml- binds skill units to monsters byIndexData/Monster/MonsterSkillUnit.xml- defines skill-unit behaviour (target / scope / delay / elements)Data/Monster/MonsterSkillElement.xml- defines the individual effects applied by a skill unit
Dependencies#
| Depends On | Purpose |
|---|---|
| Monster.xml | Monster Index values referenced by MonsterSkill.xml |
| Used By | Purpose |
|---|---|
| Monster AI and combat code | Looks up skill units when a monster casts |
System Overview#
The three files form a chain:
Monster (Index 304 - Witch Queen)
|-- MonsterSkill.xml binds Index 304 to skill units
Skill Unit (Number 1)
|-- MonsterSkillUnit.xml binds the unit to element numbers
Skill Element (Number 1)
|-- MonsterSkillElement.xml defines the actual effect
A monster entry has up to 10 skill unit slots in the loader. The shipped data only authors six (UnitType0..UnitType5); missing attributes default to 0 and produce an unbound slot. Each skill unit can combine up to 5 skill elements in a single cast.
MonsterSkill.xml#
Binds up to 10 (UnitType, UnitIndex) pairs to a single monster Index.
Monster Entry Attributes#
| Attribute | Type | Description |
|---|---|---|
Index | int | Monster Index from Monster.xml. Entries with an Index outside 0..999 are ignored. |
UnitType0..UnitType9 | int | Trigger ID for slot N. Matched against the ID passed by the combat or AI code when the monster casts. |
UnitIndex0..UnitIndex9 | int / * | Skill unit Number from MonsterSkillUnit.xml. * stands for "no unit"; the loader converts it to 0 which also fails the unit lookup. |
Skill Slots#
Each monster has 10 slots numbered 0..9 in the loader. Each slot holds:
- UnitType - the trigger ID the AI or combat code asks for. Slot 0 is used by the generic monster combat path as the default attack.
- UnitIndex - the
Numberof a unit in MonsterSkillUnit.xml. An unbound or missing unit silently disables the slot.
Example Entry#
<Monster Index="304"
UnitType0="Witch Queen" UnitIndex0="0"
UnitType1="4" UnitIndex1="0"
UnitType2="1" UnitIndex2="*"
UnitType3="*" UnitIndex3="*"
UnitType4="*" UnitIndex4="*"
UnitType5="*" UnitIndex5="*"/>
Witch Queen (Index 304):
- Slot 0: trigger 0 (the label "Witch Queen" parses as 0) -> UnitIndex 0 (unit 0 is not defined in the shipped data, so this slot is effectively empty)
- Slot 1: trigger 4 -> UnitIndex 0 (same as above)
- Slot 2: trigger 1 ->
*disabled - Slots 3..5 disabled, slots 6..9 unauthored and therefore unbound
MonsterSkillUnit.xml#
Defines skill behaviour: who it targets, how the scope is resolved, how long the cast animation takes, and which elements are applied.
Unit Attributes#
| Attribute | Type | Description |
|---|---|---|
Number | int | Unique skill-unit ID. Referenced by UnitIndex* in MonsterSkill.xml. |
Name | string | Descriptive name, up to 49 characters. Server-side only. |
TargetType | int | 1 = target enemies, 2 = target self or the casting monster. |
ScopeType | int / * | 0 = circular area, 1 = directional hitbox, * = single target. * is stored internally as -1. |
ScopeValue | int | Tile radius (for area) or hitbox length. Unused for single-target. |
Delay | int | Cast delay in milliseconds. 300 is the typical value used in shipped data. |
Element0..Element4 | int / * | Element Number from MonsterSkillElement.xml, or * for "no element". |
TargetType Values#
| Value | Target |
|---|---|
| 1 | Enemy players and monsters |
| 2 | Self / allied monster (the caster's own index is used) |
ScopeType Values#
| Value | Scope |
|---|---|
| 0 | Circular area, ScopeValue is the radius in tiles |
| 1 | Directional hitbox, ScopeValue and the caster's facing are used |
* (stored as -1) | Single target (the direct target of the cast) |
Example Unit#
<Unit Number="1" Name="Monster Skill Unit"
TargetType="1" ScopeType="0" ScopeValue="6"
Delay="300"
Element0="1" Element1="*" Element2="*" Element3="*" Element4="*"/>
Skill Unit 1:
- Targets enemies
- Circular area, 6-tile radius
- 300 ms cast delay
- Applies Element 1 only
MonsterSkillElement.xml#
Defines individual effects (damage, debuffs, buffs, status effects) that a skill unit can apply.
Element Attributes#
| Attribute | Type | Description |
|---|---|---|
Number | int | Unique element ID. Referenced by ElementN in MonsterSkillUnit.xml. |
Name | string | Descriptive name, up to 49 characters. |
Type | int | Effect kind (see Effect Types below). |
SuccessRate | int | Success chance in percent (0..100). The check is rand(0..99) > SuccessRate -> fail. Values above 100 always succeed. |
ContinuanceTime | int | Duration in seconds (0 or -1 = instant, >0 = lasts that many seconds). |
IncAndDecType | int / * | How IncAndDecValue is applied. * stores -1 = no modification. |
IncAndDecValue | int / * | Value applied when the element succeeds. * stores -1 = unused. |
NullifiedSkill | int / * | Skill ID that this element cancels or blocks. * stores -1 = none. |
CharacterClass | int | Restrict the element to a specific character class (0 = all). |
CharacterLevel | int | Minimum character level required for the element to apply (0 = none). |
Effect Types#
| Type | Effect |
|---|---|
| 0 | Stun (adds the Stern effect, optionally timed) |
| 1 | Move (movement-related effect; no built-in logic in the shipped build) |
| 2 | HP modification (damage, heal, or cyclical DoT / HoT) |
| 3 | MP modification |
| 4 | AG modification |
| 5 | Defense modification (timed buff / debuff) |
| 6 | Attack modification (timed buff / debuff) |
| 7 | Durability reduction on the target's equipment |
| 8 | Summon helper monsters |
| 9 | Push / displacement |
| 10 | Stat - Energy modification |
| 11 | Stat - Strength modification |
| 12 | Stat - Dexterity modification |
| 13 | Stat - Vitality modification |
| 14 | Remove buff / debuff |
| 15 | Resist skill (grants resistance to a named skill) |
| 16 | Immune skill (grants full immunity to a named skill) |
| 17 | Teleport the target |
| 18 | Double HP buff |
| 19 | Poison DoT |
| 20 | Normal attack effect (non-magical hit) |
| 21 | Berserk (damage boost) |
IncAndDecType Values#
IncAndDecType selects how IncAndDecValue is combined with the target's stat.
| Value | Name | Meaning |
|---|---|---|
| 0 | None | No stat change |
| 1 | Percent Increase | Add value percent |
| 2 | Percent Decrease | Subtract value percent |
| 11 | Constant Increase | Add value |
| 12 | Constant Decrease | Subtract value |
| 100 | Cycle Percent | Periodic percent change |
| 101 | Cycle Percent Increase | Periodic percent heal / buff |
| 102 | Cycle Percent Decrease | Periodic percent damage / debuff |
| 110 | Cycle Constant | Periodic flat change |
| 111 | Cycle Constant Increase | Periodic flat heal |
| 112 | Cycle Constant Decrease | Periodic flat damage |
Notes:
- For HP / MP / AG (Types 2 / 3 / 4) the
IncAndDecTypedecides whether the effect is damage/drain or heal/restore. - Cycle variants (100..112) apply the change repeatedly for
ContinuanceTimeseconds (DoT / HoT). Non-cycle variants apply once.
Example Element#
<Element Number="1" Name="Monster Skill Element"
Type="0" SuccessRate="50" ContinuanceTime="3"
IncAndDecType="*" IncAndDecValue="*"
NullifiedSkill="*"
CharacterClass="0" CharacterLevel="0"/>
Element 1:
- Type 0 = stun
- 50% success chance
- 3-second duration
- No stat modification
- Affects all classes and levels
Skill System Examples#
<!-- MonsterSkill.xml -->
<Monster Index="305"
UnitType0="Blue Golem" UnitIndex0="0"
UnitType1="5" UnitIndex1="*"
UnitType2="*" UnitIndex2="*"
UnitType3="*" UnitIndex3="*"
UnitType4="*" UnitIndex4="*"
UnitType5="*" UnitIndex5="*"/>
<!-- MonsterSkillUnit.xml -->
<Unit Number="5" Name="Monster Skill Unit"
TargetType="1" ScopeType="*" ScopeValue="0"
Delay="300"
Element0="3" Element1="*" Element2="*" Element3="*" Element4="*"/>
<!-- MonsterSkillElement.xml -->
<Element Number="3" Name="MP Drain"
Type="3" SuccessRate="50" ContinuanceTime="10"
IncAndDecType="2" IncAndDecValue="50"
NullifiedSkill="*"
CharacterClass="0" CharacterLevel="0"/>
Blue Golem casts Unit 5 on a single target. Element 3 has a 50% chance to drain 50% of the target's MP for 10 seconds.
<!-- MonsterSkill.xml -->
<Monster Index="361"
UnitType0="Nightmare" UnitIndex0="0"
UnitType1="18" UnitIndex1="1"
UnitType2="19" UnitIndex2="30"
UnitType3="20" UnitIndex3="2"
UnitType4="21" UnitIndex4="*"
UnitType5="*" UnitIndex5="*"/>
<!-- MonsterSkillUnit.xml -->
<Unit Number="1" TargetType="1" ScopeType="1" ScopeValue="6" Delay="300" Element0="31"/>
<Unit Number="2" TargetType="2" ScopeType="*" ScopeValue="0" Delay="300" Element0="32" Element1="33"/>
<Unit Number="30" TargetType="2" ScopeType="*" ScopeValue="0" Delay="300" Element0="29" Element1="30"/>
Nightmare boss binding:
- Slot 0: trigger 0 (default attack) - unit 0 is unbound
- Slot 1: trigger 18 -> Unit 1 (directional hitbox, 6 tiles)
- Slot 2: trigger 19 -> Unit 30 (self / ally buff)
- Slot 3: trigger 20 -> Unit 2 (self / ally buff)
- Slot 4: trigger 21 -> no unit assigned
The engine or boss-phase code decides when to ask for triggers 18 / 19 / 20.
<!-- MonsterSkillUnit.xml -->
<Unit Number="46" Name="Healing"
TargetType="2" ScopeType="*" ScopeValue="0"
Delay="300"
Element0="60" Element1="*" Element2="*" Element3="*" Element4="*"/>
<!-- MonsterSkillElement.xml -->
<Element Number="60" Name="Heal"
Type="2" SuccessRate="100" ContinuanceTime="0"
IncAndDecType="1" IncAndDecValue="10"
NullifiedSkill="*"
CharacterClass="0" CharacterLevel="0"/>
Targets self / ally (TargetType=2). Element 60 is an instant Type 2 (HP) effect with a Percent Increase of 10 - restores 10% HP on success.
<!-- MonsterSkillUnit.xml -->
<Unit Number="28" Name="Multi-Debuff"
TargetType="1" ScopeType="*" ScopeValue="0"
Delay="300"
Element0="8" Element1="1" Element2="*"/>
<!-- MonsterSkillElement.xml -->
<Element Number="8" Name="Defense Down"
Type="5" SuccessRate="30" ContinuanceTime="10"
IncAndDecType="2" IncAndDecValue="10"/>
<Element Number="1" Name="Stun"
Type="0" SuccessRate="50" ContinuanceTime="3"/>
Rolls each element independently. 30% chance to apply a 10% defense reduction for 10 seconds, plus a 50% chance to stun for 3 seconds.
Common Tasks#
Assign Skills to a Monster#
- Look up the monster
Indexin Monster.xml. - Add a
<Monster>entry in MonsterSkill.xml with the triggers and unit numbers you want. - Reference existing Units from MonsterSkillUnit.xml or author new ones.
Create a New Skill#
- Author the effects in MonsterSkillElement.xml (one
<Element>per effect). - Author the unit in MonsterSkillUnit.xml that references those elements.
- Bind the unit to one or more monsters in MonsterSkill.xml.
Disable a Monster's Skill#
Set UnitIndex* to * for the slot you want to disable:
<!-- Before -->
<Monster Index="340" UnitType0="Dark Elf" UnitIndex0="30"/>
<!-- After (disabled) -->
<Monster Index="340" UnitType0="Dark Elf" UnitIndex0="*"/>
Make a Skill More Reliable#
Increase SuccessRate on the relevant element:
<!-- Before: 50% chance -->
<Element Number="1" SuccessRate="50" .../>
<!-- After: 90% chance -->
<Element Number="1" SuccessRate="90" .../>
Increase Duration#
Raise ContinuanceTime on timed or cycle elements:
<!-- Before: 3 seconds -->
<Element Number="1" ContinuanceTime="3" .../>
<!-- After: 10 seconds -->
<Element Number="1" ContinuanceTime="10" .../>
Important Behavior#
Success Roll#
The server rolls rand(0..99) and fails the element if that roll is strictly greater than SuccessRate. So SuccessRate="50" gives a 50% chance. Values above 100 always succeed.
Skill Execution Order#
When a monster casts a skill:
- The combat / AI code asks for a specific
UnitTypetrigger. - The server scans the monster's 10 slots for any slot whose
UnitTypematches. - If more than one slot matches, one is picked at random.
- The selected Unit's
TargetTypechooses who can be affected (enemy or self / ally). - The
ScopeTypeandScopeValuedecide whether the cast is single-target, area or hitbox. - Each target in scope is visited once, and every element in the unit is rolled independently against that target.
How UnitType Triggers Work#
UnitType is a trigger ID, not a human-readable label. The engine and boss scripts pass specific IDs when they want a particular skill. Authoring a new UnitType value in the XML without matching code that actually asks for that ID will never fire the skill.
Multiple Elements Per Unit#
A unit with several elements applies each element independently, so all, some or none may succeed on a given target:
<Unit Element0="1" Element1="3" Element2="5"/>
This can apply stun, slow and defense reduction together if each roll passes.
Wildcard Values#
* means "none" or "disabled":
UnitIndex="*"- slot disabled (loader resolves to no unit)Element0="*"- no element in this slot (stored internally as -1)IncAndDecType="*"/IncAndDecValue="*"/NullifiedSkill="*"- not used
Delay Timing#
Delay is the cast delay in milliseconds.
- 0 = instant
- 300 = typical value in shipped data
- 1000+ = slow cast that gives players time to react
Common Issues#
Related Files#
- Monster.xml - monster Index values bound by this file
- MonsterSetBase/ - where the monsters themselves spawn
- KanturuMonsterSetBase.xml - Kanturu event spawns
- MonsterAIGroup.xml - AI groupings that use these monsters
- MonsterAIUnit.xml - per-monster AI unit settings
- MonsterAIRule.xml - AI rules
- MonsterAIElement.xml - AI element actions
- MonsterAIAutomata.xml - AI state machines
- Skill.txt - base skill catalogue referenced when
NullifiedSkillis set