Skip to content

Quality ​

Inherits: DatabaseResource < Resource

Defines item quality/rarity with display properties Create instances as .tres files for each quality tier

Properties ​

ColorcolorColor.WHITE
intquality_tier1
intdrop_weight100
intmin_item_level0
floatbudget_multiplier1.0
floatroll_spread0.5
intprefixes_min0
intprefixes_max0
intsuffixes_min0
intsuffixes_max0
intsilent_min0
intsilent_max0
inteffects_min0
inteffects_max0
intsockets_min0
intsockets_max0
Array[int]socket_pool[]
floatvendor_value_multiplier1.0
NameModename_modeNameMode.AFFIXES
Array[QualityRule]rules[]
VFXSelectiondropped_vfx

Methods ​

introll_count( minimum: int, maximum: int, rng: RandomNumberGenerator )
boolis_valid()
Array[Dictionary]validate()
Stringget_id()
boolis_higher_than( other: Quality )
boolis_lower_than( other: Quality )
Stringget_quality_description()

Enumerations ​

enum NameMode ​

How the name of a generated item is made

  • AFFIXES = 0 - "Heavy Great Axe of the Monkey": the first prefix and the first suffix
  • BASE_ONLY = 1 - "Great Axe": the colour of the quality tells the rest
  • QUALITY_WORD = 2 - "Rare Great Axe": the name of the quality in front

Property descriptions ​

Color color = Color.WHITE ​

Color for UI display

int quality_tier = 1 ​

Numeric tier for sorting/comparison (1=lowest, 5=highest)

Quality Roll

int drop_weight = 100 ​

The share of this quality in the roll of an item that picks its quality (higher = more common)

int min_item_level = 0 ​

The lowest item level this quality can be rolled at (0 = any). Keeps Epic away from level 3 drops however lucky the roll

Budget

float budget_multiplier = 1.0 ​

Multiplies the stat budget of the item (Common 1, Magic 1.5, Rare 2.5 ...). See ItemBudget

float roll_spread = 0.5 ​

How unevenly the budget is split between the rolled bonuses: 0 = an even split, 1 = very uneven

Affix Slots

int prefixes_min = 0 ​

How many prefix affixes roll (picked from the affixes the item can have)

int prefixes_max = 0 ​

The most prefixes a generated item of this quality can get.

int suffixes_min = 0 ​

How many suffix affixes roll

int suffixes_max = 0 ​

The most suffixes a generated item of this quality can get.

int silent_min = 0 ​

How many silent affixes roll (affixes with no name: extra stats that do not change the name of the item)

int silent_max = 0 ​

The most silent affixes (without a name) a generated item of this quality can get.

int effects_min = 0 ​

How many effect affixes roll (affixes that give an effect)

int effects_max = 0 ​

The most effects a generated item of this quality can get.

Sockets

int sockets_min = 0 ​

Extra sockets the item gets

int sockets_max = 0 ​

The most sockets a generated item of this quality can get.

Array[int] socket_pool = [] ​

The socket types (SocketDefinition ids) an extra socket can be

Value and Name

float vendor_value_multiplier = 1.0 ​

Multiplies the vendor value of the item

NameMode name_mode = NameMode.AFFIXES ​

How the name of a generated item is made

Array[QualityRule] rules = [] ​

Custom rules for what the fields above do not cover (each QualityRule gets the item that is being generated)

Dropped Item

VFXSelection dropped_vfx ​

A visual effect shown on every item of this quality while it lies in the world (a beam of light for the rare ones). The item can have its own too: both are shown

Method descriptions ​

int roll_count( minimum: int, maximum: int, rng: RandomNumberGenerator ) ​

A random number of affixes between a minimum and a maximum (a maximum below the minimum counts as the minimum)

bool is_valid() ​

Validation

Array[Dictionary] validate() ​

Checks the settings. Gives the problems found (empty when it is fine).

String get_id() ​

Get ID from filename

bool is_higher_than( other: Quality ) ​

Helper method to check if this quality is higher than another

bool is_lower_than( other: Quality ) ​

Helper method to check if this quality is lower than another

String get_quality_description() ​

Get quality description including tier information