LOOT_D
Daemon responsible for handling the loot system, including item drops, coin drops, and automatic valuation. Called by the death sequence when an NPC is killed.
# public loot_drop
# public coin_drop
Drops coins from the source’s coin table into the source. Each coin entry is rolled independently.
# publicnomask determine_value_by_level
Calculates a coin value based on level, applying a configured variance
for randomisation. Uses COIN_VALUE_PER_LEVEL and COIN_VARIANCE
from the MUD configuration.
# protected validate_loot_entry
Validates a loot table entry before processing. Checks that the item reference is well-formed and the chance is within range.
# private drop_items
Processes and drops a single loot item into the source. Resolves the
item via process_loot_item, creates the object, auto-values it if
applicable, and moves it into the corpse.
# private process_loot_item
Recursively resolves a loot item. Handles functions (called and
re-resolved), arrays (random pick), weighted mappings
(element_of_weighted), and plain string paths.
({ path, args }) pair, or 0 on failure # private autovalue_loot_item
Sets the value of a loot item based on the source NPC’s level, if
the item has the autovalue loot property enabled.
# private drop_coins
Creates a coin object of the given type and amount, and moves it into the source.
({ currency_type, amount }) pair