-
Notifications
You must be signed in to change notification settings - Fork 53
Drop Tables
Players are rewarded for killing monsters with Item that are dropped on the floor on their death, the items dropped are selected at random from a table of options which vary depending on the type monster defeated.
Drop tables are defined inside drops.yml
chicken_drop_table: # Name of the table
type: all # How to pick from this table
drops: # List of potential drops
# Nested sub table for 100% drops
- type: all # Drop every item in this sub-table
# Default roll is 1
drops:
- id: raw_chicken # Default 100% chance to drop 1
- id: bones
# Nested sub-table for main drop
- roll: 128 # Roll a random number between 1-128
# Default type "first" stops after one drop
drops:
- id: feather
amount: 5
chance: 64 # Drop 5 feathers if roll lands between 1-64 (50% chance)
- id: feather
amount: 10-15 # Drop between 10 and 15 feathers if roll lands between 64-96 (25% chance)
chance: 32
# Drop nothing if roll lands between 96-128 (25% chance)
# Nested sub-table for rare drop
- roll: 300 # Roll between 1-300
drops:
- id: clue_scroll_easy # Drop easy clue scroll if lands on 1 (0.3% chance)
chance: 1There are two table types by default a tables type will be first.
-
all- drop every item listed -
first- drop only one item
Tables with type all will drop every item or call every sub-table listed, as such no chance parameter is required as all items have a 100% chance of being selected.
cow_guaranteed_table:
type: all
drops:
- id: cowhide
- id: raw_beef
- id: bonesMost tables however roll a random number between 0 and roll and select the first drop in the list that the cumulative chance is within.
For example take this table:
talisman_drop_table:
roll: 70
drops:
- id: air_talisman
chance: 10
- id: body_talisman
chance: 10
- id: earth_talisman
chance: 10
- id: fire_talisman
chance: 10- First we roll a random number between 0-70. Let's say 22.
- We check down the list of items starting from the top and a chance of 0
- For
air_talisman22 is not within 0-10; so we move on adding 10 to our total. - For
body_talisman22 is not within 10-20; so we move on, adding 10 to our total. - For
earth_talisman2 is within 20-30. Soearth_talismanis our selected drop.
Warning
Drops chances should never exceed the tables roll as that could mistakenly give some drops a 0% chance.
Tables can also be drops themselves allowing for nesting and control over "groups" of drops.
The following example will always drop bones and raw_rat_meat but giant_rat_bones will only have a 25% of being dropped
giant_rat_drop_table:
type: all
drops:
- drops:
- id: bones
- id: raw_rat_meat
- roll: 4
drops:
- id: giant_rat_bone
chance: 1You can specify a drop table for a monster simply by naming a table in either a <npc_id>_drop_table, or <npc_race>_drop_table format.
The more specific table name will be used first, for example the King Black Dragon will use the king_black_dragon_drop_table even though it is classified as one of the dragon race in npcs.yml, where a Green Dragon will use dragon_drop_table as a green_dragon_drop_table doesn't exist.
green_dragon:
id: 941
race: dragon
examine: "Must be related to Elvarg."
king_black_dragon:
id: 50
race: dragon
examine: "One of the biggest, meanest dragons around."