Defense Abilities

Defense abilities provide bosses with damage mitigation, healing, scaling, and debuff mechanics. Each ability is configured as a behavior entry in the entity JSON with a code and attributes object.

💡 Most abilities use a stages array, allowing different configurations at different health thresholds. The boss activates the first stage whose whenHealthRelBelow condition is met.

Common Properties

These properties are shared by most boss abilities and can be included in any stage configuration:

PropertyTypeDescription
whenHealthRelBelowfloatHealth fraction threshold (0.0—1.0) to activate this stage
cooldownSecondsfloatCooldown between ability uses
windupMsintWindup delay in milliseconds before ability executes
animationstringAnimation to play during ability
soundstringSound asset path (without sounds/ prefix)
soundRangefloatSound audible range (default: 24)
soundStartMsintDelay before sound plays
soundVolumefloatSound volume multiplier (default: 1.0)
loopSoundstringLooping sound during ability
loopSoundIntervalMsintInterval for loop sound (default: 900ms)

Defense Strategy

Combine multiple defense abilities to create boss phases that punish greedy damage:

graph TD
    A[100% HP] --> B[Combat opens]
    B --> C[90% HP: Intoxication Aura
constant area pressure] C --> D[70% HP: Despair
slow players + debuff] D --> E[50% HP: Cast Phase
heal + reduced damage] E --> F[40% HP: Growth Ritual
full heal + size/speed up] F --> G[30% HP: Damage Shield
survive burst] G --> H[20% HP: Invulnerability
desperation window] H --> I[10% HP: Damage Shield
repeatable — final stand]

bossdamageshield

EntityBehaviorBossDamageShield — Boss activates a shield reducing incoming damage.

PropertyTypeDefaultDescription
whenHealthRelBelowfloat1.0Health threshold
shieldMsint2500Shield duration
windupMsint0Windup
cooldownSecondsfloat0Cooldown
repeatableboolfalseCan repeat while conditions met
immobileDuringShieldboolfalseBoss cannot move during shield
lockYawDuringShieldboolfalseLock rotation during shield
incomingDamageMultiplierfloat0.5Damage multiplier during shield
{
  "code": "bossdamageshield",
  "attributes": {
    "whenHealthRelBelow": 0.3,
    "shieldMs": 5000,
    "windupMs": 200,
    "cooldownSeconds": 25,
    "repeatable": true,
    "incomingDamageMultiplier": 0.2
  }
}

bossdespair

EntityBehaviorBossDespair — Boss applies a despair debuff reducing player effectiveness.

PropertyTypeDefaultDescription
whenHealthRelBelowfloat1.0Health threshold
cooldownSecondsfloat0Cooldown
radiusfloat15Effect radius
durationMsint5000Debuff duration
walkSpeedMultfloat0.7Walk speed multiplier
{
  "code": "bossdespair",
  "attributes": {
    "whenHealthRelBelow": 0.5,
    "cooldownSeconds": 30,
    "radius": 20,
    "durationMs": 8000,
    "walkSpeedMult": 0.5
  }
}

bossintoxicationaura

EntityBehaviorBossIntoxicationAura — Boss creates an aura that intoxicates players.

PropertyTypeDefaultDescription
whenHealthRelBelowfloat1.0Health threshold
radiusfloat10Aura radius
damagePerSecondfloat1Damage per second
{
  "code": "bossintoxicationaura",
  "attributes": {
    "whenHealthRelBelow": 1.0,
    "radius": 12,
    "damagePerSecond": 2
  }
}

bossoxygendrainaura

EntityBehaviorBossOxygenDrainAura — Boss drains oxygen from nearby players.

PropertyTypeDefaultDescription
whenHealthRelBelowfloat1.0Health threshold
radiusfloat12Aura radius
drainPerSecondfloat5Oxygen drain per second
{
  "code": "bossoxygendrainaura",
  "attributes": {
    "whenHealthRelBelow": 0.6,
    "radius": 15,
    "drainPerSecond": 8
  }
}

bossdamageinvulnerability

EntityBehaviorBossDamageInvulnerability — Boss becomes invulnerable to damage for a duration.

PropertyTypeDefaultDescription
whenHealthRelBelowfloat1.0Health threshold
invulnerabilityMsint2000Duration
cooldownSecondsfloat0Cooldown
{
  "code": "bossdamageinvulnerability",
  "attributes": {
    "whenHealthRelBelow": 0.2,
    "invulnerabilityMs": 4000,
    "cooldownSeconds": 30
  }
}

bossdamagesourceimmunity

EntityBehaviorBossDamageSourceImmunity — Boss is immune to specific damage sources.

PropertyTypeDefaultDescription
immuneDamageTypesarray[]List of immune damage types
immuneDamageSourcesarray[]List of immune damage sources
{
  "code": "bossdamagesourceimmunity",
  "attributes": {
    "immuneDamageTypes": ["Fire", "Poison"],
    "immuneDamageSources": ["Fall"]
  }
}

bossdynamicsscaling

EntityBehaviorBossDynamicScaling — Boss HP scales with nearby player count. *(DISABLED)*

PropertyTypeDefaultDescription
baseHealthMultfloat1.6Base health multiplier
hpPerPlayerfloat0.30HP added per player
maxMultiplierfloat4.0Maximum multiplier
regenPerPlayerfloat0.2Regen per player per second
playerDetectionRangeint60Detection range
{
  "code": "bossdynamicsscaling",
  "attributes": {
    "baseHealthMult": 2.0,
    "hpPerPlayer": 0.5,
    "maxMultiplier": 5.0,
    "regenPerPlayer": 0.3,
    "playerDetectionRange": 80
  }
}

bosscastphase

EntityBehaviorBossCastPhase — Boss enters a casting phase: heals over time and takes reduced damage.

PropertyTypeDefaultDescription
whenHealthRelBelowfloat1.0Health threshold
castMsint8000Cast phase duration
healPerSecondfloat0Heal per second
healRelPerSecondfloat0Relative heal per second (fraction)
incomingDamageMultiplierfloat0.5Incoming damage multiplier
animationstringnullCasting animation
loopSoundstringnullLooping sound during cast
loopSoundRangefloat24Loop sound range
loopSoundIntervalMsint900Loop sound interval
windupSoundstringnullWindup sound
windupSoundRangefloat24Windup sound range
windupSoundStartMsint0Windup sound delay
{
  "code": "bosscastphase",
  "attributes": {
    "whenHealthRelBelow": 0.3,
    "castMs": 10000,
    "healPerSecond": 5,
    "incomingDamageMultiplier": 0.25,
    "animation": "cast",
    "loopSound": "game:effect/darkmagic"
  }
}

bossgrowthritual

EntityBehaviorBossGrowthRitual — Boss grows in size, speed and damage. Heals to full health.

PropertyTypeDefaultDescription
whenHealthRelBelowfloat1.0Health threshold
sizeMultiplierfloat1.5Size multiplier
speedMultiplierfloat1.0Walk speed multiplier
damageMultiplierfloat1.3Damage multiplier
animationstringnullGrowth animation
lightningFlashboolfalseLightning flash effect
{
  "code": "bossgrowthritual",
  "attributes": {
    "whenHealthRelBelow": 0.4,
    "sizeMultiplier": 2.0,
    "speedMultiplier": 1.3,
    "damageMultiplier": 1.5,
    "lightningFlash": true
  }
}

Complete Entity Example

A boss that uses layered defense abilities for a 3-phase encounter:

{
  "code": "yourmod:fortress-guardian",
  "server": {
    "behaviors": [
      { "code": "health", "maxhealth": 2000 },
      { "code": "bosshuntcombatmarker" },
      { "code": "bossnametag", "attributes": { "displayName": "Fortress Guardian" } },
      {
        "code": "bossintoxicationaura",
        "attributes": {
          "whenHealthRelBelow": 1.0,
          "radius": 12,
          "damagePerSecond": 2
        }
      },
      {
        "code": "bossdespair",
        "attributes": {
          "whenHealthRelBelow": 0.7,
          "cooldownSeconds": 30,
          "radius": 18,
          "durationMs": 6000,
          "walkSpeedMult": 0.5
        }
      },
      {
        "code": "bosscastphase",
        "attributes": {
          "whenHealthRelBelow": 0.5,
          "castMs": 8000,
          "healPerSecond": 8,
          "incomingDamageMultiplier": 0.25,
          "animation": "cast",
          "loopSound": "game:effect/darkmagic"
        }
      },
      {
        "code": "bossgrowthritual",
        "attributes": {
          "whenHealthRelBelow": 0.4,
          "sizeMultiplier": 1.8,
          "speedMultiplier": 1.2,
          "damageMultiplier": 1.4,
          "lightningFlash": true
        }
      },
      {
        "code": "bossdamageshield",
        "attributes": {
          "whenHealthRelBelow": 0.3,
          "shieldMs": 5000,
          "cooldownSeconds": 20,
          "repeatable": true,
          "incomingDamageMultiplier": 0.2,
          "immobileDuringShield": true
        }
      },
      {
        "code": "bossdamageinvulnerability",
        "attributes": {
          "whenHealthRelBelow": 0.2,
          "invulnerabilityMs": 3000,
          "cooldownSeconds": 45
        }
      }
    ]
  }
}

💡 Pair defense abilities with combat abilities (see Combat Abilities) so the boss isn't just a damage sponge — it should hit back while defending.

bossabsorb

EntityBehaviorBossAbsorb — Boss activates a shield that absorbs N hits without taking damage. After absorbing all hits — AoE explosion. If duration expires first — shield drops harmlessly.

PropertyTypeDefaultDescription
whenHealthRelBelowfloat1.0Health threshold
cooldownSecondsfloat0Cooldown
maxTargetRangefloat30Target range
absorbHitCountint5Hits absorbed before explosion
absorbDurationSecfloat6Shield duration
explosionDamagefloat20Explosion damage
explosionRadiusfloat8Explosion radius
soundstringeffect/reverbhitExplosion sound
soundRangefloat32Sound range
{
  "code": "bossabsorb",
  "attributes": {
    "whenHealthRelBelow": 0.5,
    "cooldownSeconds": 25,
    "maxTargetRange": 25,
    "absorbHitCount": 7,
    "absorbDurationSec": 8,
    "explosionDamage": 25,
    "explosionRadius": 10
  }
}

bossarena

EntityBehaviorBossArena — Creates a ring boundary around the boss's activation position. Players who cross the boundary take damage + get pushed back. Arena does not move with the boss.

PropertyTypeDefaultDescription
whenHealthRelBelowfloat1.0Health threshold
cooldownSecondsfloat0Cooldown
maxTargetRangefloat30Target range
arenaRadiusfloat12Arena radius
arenaDurationSecfloat20Arena duration
boundaryDpsfloat8Damage per second outside boundary
soundstringeffect/translocate-activeActivation sound
soundRangefloat32Sound range
{
  "code": "bossarena",
  "attributes": {
    "whenHealthRelBelow": 0.6,
    "cooldownSeconds": 30,
    "maxTargetRange": 25,
    "arenaRadius": 15,
    "arenaDurationSec": 25,
    "boundaryDps": 10
  }
}

bossdebuff

EntityBehaviorBossDebuff — Applies a debuff to a target player. Supports blind, disarm, and silence.

PropertyTypeDefaultDescription
whenHealthRelBelowfloat1.0Health threshold
cooldownSecondsfloat0Cooldown
maxTargetRangefloat30Target range
debuffTypestringblindDebuff type: blind, disarm, silence
durationSecfloat3Debuff duration
soundstringeffect/translocate-activeSound
soundRangefloat24Sound range

💡 - blind — drastically reduces view distance and ranged accuracy - disarm — sets alegacyvsquest:disarmed flag (blocks weapon damage) - silence — sets alegacyvsquest:silenced flag (blocks item use)

{
  "code": "bossdebuff",
  "attributes": {
    "whenHealthRelBelow": 0.5,
    "cooldownSeconds": 15,
    "maxTargetRange": 20,
    "debuffType": "blind",
    "durationSec": 5
  }
}

bossmimicattack

EntityBehaviorBossMimicAttack — Boss enters a mirror state reflecting damage back to attackers. Boss still takes reduced damage during mirror.

PropertyTypeDefaultDescription
whenHealthRelBelowfloat1.0Health threshold
cooldownSecondsfloat0Cooldown
maxTargetRangefloat30Target range
mirrorDurationSecfloat3Mirror duration
reflectPercentfloat0.8Damage reflected (0.8 = 80%)
soundstringeffect/translocate-activeSound
soundRangefloat24Sound range
{
  "code": "bossmimicattack",
  "attributes": {
    "whenHealthRelBelow": 0.5,
    "cooldownSeconds": 20,
    "maxTargetRange": 25,
    "mirrorDurationSec": 4,
    "reflectPercent": 0.75
  }
}

bossretaliation

EntityBehaviorBossRetaliation — Reactive ability. On receiving damage, boss absorbs incoming damage over a window. After reaching a threshold or when the window expires, releases it as an AoE burst.

PropertyTypeDefaultDescription
whenHealthRelBelowfloat1.0Health threshold
cooldownSecondsfloat0Cooldown
maxTargetRangefloat30Target range
damageThresholdfloat16Damage to absorb before retaliating
retaliationMultiplierfloat0.6Retaliation damage = absorbed * this
retaliationRadiusfloat6Burst radius
windowDurationSecfloat4Absorption window
soundstringeffect/reverbhitBurst sound
soundRangefloat32Sound range
{
  "code": "bossretaliation",
  "attributes": {
    "whenHealthRelBelow": 0.5,
    "cooldownSeconds": 25,
    "maxTargetRange": 25,
    "damageThreshold": 20,
    "retaliationMultiplier": 0.7,
    "retaliationRadius": 8,
    "windowDurationSec": 5
  }
}

bossvulnerabilitywindow

EntityBehaviorBossVulnerabilityWindow — After specified abilities complete, the boss takes increased damage for a configurable duration. Visual: golden aura particles.

PropertyTypeDefaultDescription
damageMultiplierfloat2.0Incoming damage multiplier during window
durationSecondsfloat2.5Vulnerability duration
cooldownSecondsfloat0Cooldown between windows
triggerAbilitiesstring[][]Ability codes that trigger vulnerability (e.g. bossbloodprice, bosscastphase)

💡 Other abilities call OnAbilityCompleted() on this behavior to trigger the window. Common pairings: - bossbloodprice — after healing threshold, boss becomes vulnerable - bosscastphase — after casting completes, boss becomes vulnerable - bossintermissiondispel — after intermission ends, boss becomes vulnerable

{
  "code": "bossvulnerabilitywindow",
  "attributes": {
    "damageMultiplier": 2.5,
    "durationSeconds": 3.0,
    "cooldownSeconds": 5,
    "triggerAbilities": ["bossbloodprice", "bosscastphase"]
  }
}

Press ESC to close