Loot

From Cithare Wiki
Jump to navigation Jump to search

The Cithare plugin allows for randomized generation of loot in premade maps. This article describes the algorithm used for loot generation.

Loot lists

Cithare has four in-built loot lists for different rarities - in order of ascending rarity: common, uncommon, rare and epic. Each contains a list of items, which are associated with an amount and weight, and two probabilities - ignore chance and upgrade chance. The purpose of each is elucidated further. Up-to-date loot lists can be found here.

Algorithm

All loot containers (chests, double chests, their trapped variants, barrels, dispensers and droppers, etc.) are manually assigned a set amount of loot slots for each rarity. This is done using the Map Wand tool during map creation. When loot is generated, a following procedure is done for each item slot:

  • Ignore chance roll - First, the game rolls for whether this slot is skipped. Probability of this is determined by the ignore chance value from the appropriate loot list.
  • Upgrade chance roll - A similar procedure is repeated with the upgrade chance of the current loot list. If a slot is upgraded, the game generates an item from the list above the current one.
    • If a slot is upgraded, it rolls for upgraded again before the actual generation. This way, a slot can upgrade its rarity several times.
    • If an epic slot is upgraded, instead of changing rarity, another epic slot is created. It rolls for upgrade as well.
      • This process is interrupted if current container is full.
  • Item generation - Once all upgrading is resolved, the game randomly generates an item stack from the appropriate loot list according to its weight. If the size of the stack (or other property of the item) is randomized (which is the case for most stackable loot items), the amount is generated here as well.

Once all loot slots in a container are resolved, the contents of the container are randomly scrambled (this affects only position in the container).

Notes

Not all containers on the map have randomly generated loot.

There are almost no epic slots placed on the map. Most epic items in the game are upgrades from rare slots.

There is a rare slot in a barrel under each bridge. Each flag has at least one (usually more) rare slots in containers around it.

Only block containers can contain loot. Entities such as Minecart chests or Boat chests cannot be used in the loot system.