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 by Index
  • Data/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 OnPurpose
Monster.xmlMonster Index values referenced by MonsterSkill.xml
Used ByPurpose
Monster AI and combat codeLooks 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#

AttributeTypeDescription
IndexintMonster Index from Monster.xml. Entries with an Index outside 0..999 are ignored.
UnitType0..UnitType9intTrigger ID for slot N. Matched against the ID passed by the combat or AI code when the monster casts.
UnitIndex0..UnitIndex9int / *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 Number of 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#

AttributeTypeDescription
NumberintUnique skill-unit ID. Referenced by UnitIndex* in MonsterSkill.xml.
NamestringDescriptive name, up to 49 characters. Server-side only.
TargetTypeint1 = target enemies, 2 = target self or the casting monster.
ScopeTypeint / *0 = circular area, 1 = directional hitbox, * = single target. * is stored internally as -1.
ScopeValueintTile radius (for area) or hitbox length. Unused for single-target.
DelayintCast delay in milliseconds. 300 is the typical value used in shipped data.
Element0..Element4int / *Element Number from MonsterSkillElement.xml, or * for "no element".

TargetType Values#

ValueTarget
1Enemy players and monsters
2Self / allied monster (the caster's own index is used)

ScopeType Values#

ValueScope
0Circular area, ScopeValue is the radius in tiles
1Directional 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#

AttributeTypeDescription
NumberintUnique element ID. Referenced by ElementN in MonsterSkillUnit.xml.
NamestringDescriptive name, up to 49 characters.
TypeintEffect kind (see Effect Types below).
SuccessRateintSuccess chance in percent (0..100). The check is rand(0..99) > SuccessRate -> fail. Values above 100 always succeed.
ContinuanceTimeintDuration in seconds (0 or -1 = instant, >0 = lasts that many seconds).
IncAndDecTypeint / *How IncAndDecValue is applied. * stores -1 = no modification.
IncAndDecValueint / *Value applied when the element succeeds. * stores -1 = unused.
NullifiedSkillint / *Skill ID that this element cancels or blocks. * stores -1 = none.
CharacterClassintRestrict the element to a specific character class (0 = all).
CharacterLevelintMinimum character level required for the element to apply (0 = none).

Effect Types#

TypeEffect
0Stun (adds the Stern effect, optionally timed)
1Move (movement-related effect; no built-in logic in the shipped build)
2HP modification (damage, heal, or cyclical DoT / HoT)
3MP modification
4AG modification
5Defense modification (timed buff / debuff)
6Attack modification (timed buff / debuff)
7Durability reduction on the target's equipment
8Summon helper monsters
9Push / displacement
10Stat - Energy modification
11Stat - Strength modification
12Stat - Dexterity modification
13Stat - Vitality modification
14Remove buff / debuff
15Resist skill (grants resistance to a named skill)
16Immune skill (grants full immunity to a named skill)
17Teleport the target
18Double HP buff
19Poison DoT
20Normal attack effect (non-magical hit)
21Berserk (damage boost)

IncAndDecType Values#

IncAndDecType selects how IncAndDecValue is combined with the target's stat.

ValueNameMeaning
0NoneNo stat change
1Percent IncreaseAdd value percent
2Percent DecreaseSubtract value percent
11Constant IncreaseAdd value
12Constant DecreaseSubtract value
100Cycle PercentPeriodic percent change
101Cycle Percent IncreasePeriodic percent heal / buff
102Cycle Percent DecreasePeriodic percent damage / debuff
110Cycle ConstantPeriodic flat change
111Cycle Constant IncreasePeriodic flat heal
112Cycle Constant DecreasePeriodic flat damage

Notes:

  • For HP / MP / AG (Types 2 / 3 / 4) the IncAndDecType decides whether the effect is damage/drain or heal/restore.
  • Cycle variants (100..112) apply the change repeatedly for ContinuanceTime seconds (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.

Common Tasks#

Assign Skills to a Monster#

  1. Look up the monster Index in Monster.xml.
  2. Add a <Monster> entry in MonsterSkill.xml with the triggers and unit numbers you want.
  3. Reference existing Units from MonsterSkillUnit.xml or author new ones.

Create a New Skill#

  1. Author the effects in MonsterSkillElement.xml (one <Element> per effect).
  2. Author the unit in MonsterSkillUnit.xml that references those elements.
  3. 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:

  1. The combat / AI code asks for a specific UnitType trigger.
  2. The server scans the monster's 10 slots for any slot whose UnitType matches.
  3. If more than one slot matches, one is picked at random.
  4. The selected Unit's TargetType chooses who can be affected (enemy or self / ally).
  5. The ScopeType and ScopeValue decide whether the cast is single-target, area or hitbox.
  6. 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#

Last updated May 17, 2026