Public
HTTP (deprecated)
Readme

Loot Generator API

How It Works

Components

The Loot Generator API creates random loot items by combining:

  • 30 adjectives
  • 29 materials
  • 15 item types

resulting in 13,050 possible items.

Legendary Items

Occasionally, a rare legendary item is generated. An item becomes legendary if all three components are rare. Rarity is determined by a threshold:

Threshold = max(1,⌊log(length)×0.6⌋)

Probability of a legendary item with the default settings:

P(Legendary) = 1/13,050 ≈ 0.00766%

Only one legendary item is possible: ✨💎 Arcane Diamond Rock.

Customization

You can expand the lists or adjust the 0.6 multiplier to control rarity.

Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
roramigator-lootgenapi.web.val.run
September 1, 2024