MonsterSkillUnit.xml

Monster skill definitions. Each Unit picks a target mode, a scope mode, and up to 5 Elements (from MonsterSkillElement.xml) that all fire together when the monster casts the Unit.

File Location#

Data/Monster/MonsterSkillUnit.xml

Loaded once at GameServer startup. Changes require a restart.

Role in the Monster Skill Pipeline#

MonsterSkill.xml       assigns skill Units to monsters and maps them to trigger IDs
         |
         v
MonsterSkillUnit.xml   <-- this file (target mode + scope + element chain)
         |
         v
MonsterSkillElement.xml    (atomic effects)

Dependencies#

Referenced byPurpose
MonsterSkill.xmlAssigns Unit Number to monster skill slots
Depends onPurpose
MonsterSkillElement.xmlEach Element0-Element4 references an Element Number

Schema#

<MonsterSkillUnit>
    <Unit Number="..." Name="..."
          TargetType="..." ScopeType="..." ScopeValue="..."
          Delay="..."
          Element0="..." Element1="..." Element2="..." Element3="..." Element4="..." />
</MonsterSkillUnit>

Attributes#

AttributeTypeEffect
NumberintUnique Unit ID (0-199). Values outside this range are ignored at load.
NamestringHuman-readable label. Not used by logic.
TargetTypeint1 = cast on the passed-in target (enemy). 2 = redirect target to the caster (self / ally-self buffs and respawns).
ScopeTypeint or *0 = viewport scan with circular distance check. 1 = viewport scan with directional hitbox. * stores -1 and means "apply only to the single resolved target, no viewport scan".
ScopeValueintTile radius used for ScopeType="0" only (strict < compare against distance). ScopeType="1" uses a fixed hitbox shape and ignores this value. ScopeType="*" ignores it.
DelayintStored on the Unit but not consulted by the skill pipeline. The AI layer controls cast cadence via MonsterAI timers, not this field. TODO: verify whether any AI path reads Delay.
Element0-Element4int or *Element Number from MonsterSkillElement.xml. * leaves the slot empty. Empty slots skip.

Target and Scope Combinations#

TargetTypeScopeTypeWhat Happens
1*Single-target: all Elements resolve on the caller-supplied target.
10Area: viewport is scanned, every live player within ScopeValue tiles of the caster receives all Elements. The originally passed target is ignored in this branch.
11Hitbox: directional hitbox oriented from caster toward the passed target; every live player the hitbox hits receives all Elements.
2*Self/ally: target is rewritten to the caster. Elements apply to the caster.
20 or 1Self-target is rewritten to the caster first, then the scan runs against the caster's viewport. In practice used with *.

Only Units with TargetType="1" run the per-monster special attack handler that calls the combat system. TargetType="2" Units only run Element logic on the caster.

Element Chain#

When a Unit fires against a resolved target, each non-empty Element0-Element4 slot calls its Element handler in order. Every Element rolls its own SuccessRate independently; partial success is normal. A Unit with zero valid Elements still broadcasts the cast animation but has no gameplay effect beyond the attack handler's damage.

Important Behavior#

  • Only 200 Unit slots exist (Number 0-199). Entries outside this range are dropped at load.
  • TargetType does not map to "enemy vs single target". A TargetType="1" Unit can still AoE via ScopeType="0" or ScopeType="1".
  • ScopeType="0" uses a strict less-than compare, so ScopeValue="6" covers distances 0 through 5.
  • ScopeType="1" uses a skill hitbox evaluator; ScopeValue is not a radius in this branch.
  • Delay is loaded but the skill dispatcher does not read it. Cast cadence is controlled upstream by monster AI timers and per-skill cooldowns, not this field.
  • Name is free-form and never compared.
  • A Unit casts its broadcast packet first, then runs Elements. If the Unit points at invalid Elements, the cast animation still plays.

Examples#

<Unit Number="8" Name="Single Stun"
      TargetType="1" ScopeType="*" ScopeValue="0"
      Delay="300"
      Element0="1" Element1="*" Element2="*" Element3="*" Element4="*"/>

Applies Element 1 to the passed target only. No viewport scan.

Common Issues#

  • Skill hits only one target when it should splash - ScopeType="*". Set ScopeType="0" with a tile radius in ScopeValue.
  • AoE radius feels one tile short - the compare is strict <. Use ScopeValue="N+1" for an N-tile radius.
  • Self-buff hits enemies instead - TargetType must be 2 for self-application.
  • Line skill ignores ScopeValue - the hitbox branch does not use ScopeValue as a length. Hitbox shape is fixed in the engine.
  • Delay tuning has no effect - the field is not consumed by the skill dispatcher. Change cast cadence through monster AI timing (see MonsterAIUnit.xml) instead.
  • Unit does nothing on cast - all Element0-Element4 are * or point at missing Element Numbers.
  • Unit number ignored - Numbers must be 0-199.

Last updated April 21, 2026