Skip to content

LootEntry ​

Inherits: Resource

One line of a loot table: an item, an amount of a currency, or another loot table.

Properties ​

EntryTypeentry_typeEntryType.ITEM
intitem_id0
intcurrency_id0
inttable_id0
intweight10
intmin_quantity1
intmax_quantity1
boolcan_duplicatefalse
floatchance100.0
intmin_level0
intmax_level0

Methods ​

boolfits_level( item_level: int )
intget_target_id()
Stringget_key()

Enumerations ​

enum EntryType ​

What the entry gives

  • ITEM = 0 - An item (item_id)
  • CURRENCY = 1 - An amount of a currency (currency_id, between the minimum and the maximum quantity)
  • TABLE = 2 - The drops of another loot table (table_id): "a boss drops its own table and the common table of the zone"

Property descriptions ​

EntryType entry_type = EntryType.ITEM ​

What the line gives: an item, a currency or another loot table.

int item_id = 0 ​

ITEM: the item

int currency_id = 0 ​

CURRENCY: the currency

int table_id = 0 ​

TABLE: the loot table

int weight = 10 ​

Higher weight = more likely among the random entries of the table (not used by guaranteed entries)

int min_quantity = 1 ​

The least that drops.

int max_quantity = 1 ​

The most that drops.

bool can_duplicate = false ​

The same item can be picked again in the same roll

float chance = 100.0 ​

The chance (percent) that the entry gives anything once it is picked (a guaranteed entry of 50 gives half the time)

int min_level = 0 ​

The lowest item level this entry drops at (0 = any): the Dragon Scale never drops from level 5 loot

int max_level = 0 ​

The highest item level this entry drops at (0 = any): the Rusty Sword stops dropping at level 20

Method descriptions ​

bool fits_level( item_level: int ) ​

Can the entry drop at this item level?

int get_target_id() ​

What the entry points at, for a check that it points at something

String get_key() ​

Does the entry drop the same thing every time it is picked (same id as another entry of the table is a duplicate)?