lootGenAPI
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in miliseconds.
main.tsx
https://roramigator--0c8c641626d911f0a5b3569c3dd06744.web.val.run
The Loot Generator API creates random loot items by combining:
- 30 adjectives
- 29 materials
- 15 item types
resulting in 13,050 possible 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
.
You can expand the lists or adjust the 0.6 multiplier to control rarity.