Loot

From PSwiki
Jump to navigation Jump to search

You can get loot through a number of methods:

1) Through quests, we have the possibility to reward players items or money. See Give script directive. At the moment this cannot be randomized.

2) Harvesting loot items from Hunt Locations and Natural Resources, which spawn items on the ground or allow you to dig for items. At the moment this cannot be randomized. Only quality changes when harvesting.

2.1) Special chests, declared as 'CONSUMABLE' . This is the current list of items:

  • Hardened crate
  • Adorned Crate
  • Sturdy Chest
  • Metal Chest
  • Reinforced Chest
  • Wide Chest
  • Ancient Chest
  • Jeweled Chest

These have a special consume script stored in item_stats.consume_script which is pointing to a progression event . This can be the legacy 'treasure_chest' script looking at the base price and scaling rewards accordingly, OR it can be a new script using the LootSetOp which points to loot_rules.id.

For Procedural Dungeon Generation we added a new feature. The chests are generated with a defined item_quality, which will determine the loot rule to use. In psScheduleItem::CreateItem() we set the quality, and then the consume script (treasure_chest_rnd_loot) uses the quality to determine the loot rules.

3) Killing creatures will allow players to loot. Loot is defined in characters.npc_addl_loot_category_id field, which points to loot_rules.id , and then to loot_rule_details table. Here we can control the list of items and the % of chance to be random.

4) Buy from merchants. Any item present in the inventory of a NPC in a bulk slot can be bought is the NPC is a merchant. This is defined in table merchant_item_categories where all item categories are listed for this NPC.

5) Generated events:

  • may spawn chests or puzzles providing rewards. in this case we may spawn a chest listed in point 2.1) above, but we will then specify in the event XML the traps properties.
  • may spawn creatures with special loot tables, see point 3) above
  • may spawn merchants with special goods to sell, see point 4) above

6) Main loot and furniture loot in generated dungeons