UODiamondCodex

Treasures (Treasure Maps) System

A classic treasure-hunting loop: unroll a map to reveal random coordinates, navigate with compass hints, dig at the spot with a pickaxe, and fight through a trapped/guarded chest to claim leveled loot. Source: UOD - System Treasures.scp.

How it works

1. Rolled mapi_treasure_map_rolled: on @dclick it rolls a random grass coordinate and a level {1..5}, then converts into an unrolled map (i_treasure_map_unrolled) storing tag.x, tag.y, tag.level, and tag.bywho (the roller's UID). If the rolled tile isn't grass it fails.

2. Unrolled mapi_treasure_map_unrolled (type=t_map): clicking shows the level and who unrolled it (GMs also see the coordinates). Double-clicking:

  • Reminds you to equip a pickaxe (layer 1 must be i_pickaxe) and that only tag.bywho may dig.
  • If you are within ±5 tiles of tag.x/tag.y, holding a pickaxe, and are the rightful digger, it plays the dig animation and spawns an i_treasure_chest (linked to you, carrying more2 = level).
  • Otherwise it gives directional hints (Go West/East/North/South).

3. The dug chesti_treasure_chest (MORE=3): only the linked player can open it. Each double-click (while more>0) triggers a random trap/guardian event, decrementing more:

Roll Effect
1,2,3,5,9,10 Spawns i_potion_lavabomb explosives around you
4,7,8 Summons a wave of daemons / dragons / balrons / bandits (tied via i_tempsummon)
6 Poisons and damages all nearby characters (forchars 20)

Once more reaches 0, opening spawns the level-appropriate loot container t_treasure_chest_<level> (1–5) with a 13-minute decay warning, and removes itself.

Loot templatest_treasure_chest_1t_treasure_chest_5 scale with level: rising gold, magic loot/goodie tiers (poor → meager → average → rich → filthy-rich/loaded), reagents, potions, magic wands, and colored random items.

d_tmaps is a decorative map-display gump plotting the player's position.

Commands / player-facing usage

No .commands; interaction is by double-clicking maps and chests. Requires an equipped pickaxe to dig. Only the person who unrolled the map (tag.bywho) can dig it and open the resulting chest.

Key definitions

DEFNAME Role
i_treasure_map_rolled Unrolls into a coordinate map (random grass spot, level 1–5)
i_treasure_map_unrolled Navigable map; digs the chest when you're on the spot
i_treasure_chest The dug chest; runs more trap events then spawns loot
t_treasure_chest_1..5 TEMPLATE loot containers per treasure level
i_tempsummon Ties summoned guardians to the chest
tag.bywho UID allowed to dig/open; tag.level = difficulty

Note: Distinct from the landscape-spawned Treasure Chests system. This one is driven by treasure maps and the digging skill loop.