class DropTableCategory
chance: number?

A number from 0-1 to determine the chance for the category to drop. Defaults to 1 (100%).

entries: DropTableWeightedOption[]?

Weighted items to choose from when the category does drop.

quantity: integer?

The amount to drop. Defaults to 1.

entry: (Actor | fun(...any): Actor)?

The actual actor to drop. This or entries must not be nil.

class DropTableWeightedOption
weight: integer

The weight of the item, e.g. if there are weights of 50 and 30, the former will drop 50/80 times.

entry: Actor | fun(...any): Actor

The actual actor to drop.

quantity: integer?

The amount to drop. Defaults to 1.

class DropTable: Component

A drop table which tracks what items the actor should drop upon death.

categories: DropTableCategory[]
weights: table<DropTableCategory, table<integer, integer>>

Weights per category per entry.

__new(
    self: DropTable,
    options: DropTableCategory | DropTableCategory[]
)
getDrops(self: DropTable, rng: RNG): Actor[]

Takes an RNG and returns a table of actors from the drop table.