35 lines
1.3 KiB
Markdown
35 lines
1.3 KiB
Markdown
# Loot data
|
|
|
|
`schema.sql` and the dungeon seed files are the authoritative loot source.
|
|
Runtime TypeScript does not contain boss-to-item mappings.
|
|
|
|
Generate and validate the browser assets with:
|
|
|
|
```powershell
|
|
npm run loot:generate
|
|
```
|
|
|
|
The command loads the SQL into SQLite, checks foreign keys and boss coverage,
|
|
then writes:
|
|
|
|
- `src/game/generated/lootCatalog.json` for the game runtime.
|
|
- `public/data/loot-catalog.json` for a future browser UI.
|
|
- `public/data/healer-man-loot.sqlite` for direct SQL queries.
|
|
|
|
The stable loot-browser query surface is the `boss_loot_browser` view:
|
|
|
|
```sql
|
|
SELECT boss_name, item_name, quality, inventory_slot, weight
|
|
FROM boss_loot_browser
|
|
WHERE dungeon_id = 'wailing-caverns'
|
|
ORDER BY boss_name, item_name;
|
|
```
|
|
|
|
`source_item_level` preserves the original content data. `item_stat` stores the
|
|
original 3.3.5a item attributes and ratings, while `item_weapon` stores its
|
|
damage school, damage range, and speed. Dropped item instances use the killing
|
|
player's level so the same boss table remains relevant across the game's full
|
|
progression range; scaling preserves the source item's stat distribution.
|
|
Older saved items, including saves from the retired Power/Stamina/Armor model,
|
|
are migrated deterministically from the authored item template when loaded.
|