editor defense types - magemonkeystudio/divinity GitHub Wiki

๐Ÿ›ก๏ธ Editor: Defense Types

The Defense Types editor option allows you to assign resistances to specific types of incoming damage (e.g., Fire, Poison, Slashing). These defense types are user-defined and offer flexible customization.


๐Ÿ“ Where Defense Types Are Defined

Defense types are configured in:

plugins/Divinity/item_stats/defense.yml

โžก๏ธ For setup details, see: item_stats-defense

๐Ÿ“„ Example (defense.yml)

slashing:
  priority: 100
  name: Slashing Defense
  format: ' &7Gives %value% %name%'
  block-damage-types:
  - slashing
  protection-factor: 0.7

โš™๏ธ What the Editor Lets You Modify

In the Item Generator Editor:

  • Choose which defense types can roll
  • Set chance and range for each one
  • Enable level-scaling
  • Control flat-range and rounding
  • Set minimum and maximum number of defenses per item
  • Customize lore display order

๐Ÿ“„ Example (Item Generator File)

defense-types:
  minimum: 1
  maximum: 2
  lore-format:
    - '%DEFENSE_POISON%'
    - '%DEFENSE_WATER%'
    - '%DEFENSE_WIND%'
    - ''
    - '%DEFENSE_SLASHING%'
    - '%DEFENSE_PIERCING%'
  list:
    poison:
      chance: 0.0
      scale-by-level: 1.0
      min: 0
      max: 0
      flat-range: false
      round: false
    water:
      chance: 0.0
      scale-by-level: 1.0
      min: 0
      max: 0
      flat-range: false
      round: false
    wind:
      chance: 0.0
      scale-by-level: 1.0
      min: 0
      max: 0
      flat-range: false
      round: false
    slashing:
      chance: 0.0
      scale-by-level: 1.0
      min: 0
      max: 0
      flat-range: false
      round: false
    piercing:
      chance: 0.0
      scale-by-level: 1.0
      min: 0
      max: 0
      flat-range: false
      round: false

๐Ÿงพ Explanation of Fields

Field Description
minimum / maximum Number of defense types to roll.
chance % chance for each defense type to roll.
scale-by-level Multiplies the value by the item level.
flat-range If true, no randomness โ€” uses fixed value.
round Rounds the result to whole number if true.
lore-format Controls display order in item lore.

๐Ÿ”ง Placeholders

%DEFENSE_{TYPE}%

Examples:

  • %DEFENSE_FIRE%
  • %DEFENSE_POISON%

๐Ÿงช Use Case

  • Create gear with elemental resistances
  • Balance PvE gear for specific encounters
  • Add unique mechanics like poison immunity

Return to: Item Generator Module