Rewards #

The Rewards system powers weighted random rolls of rewards content. Rewards catalogs are defined in the content system and do not require additional plugin code beyond the typical instanced item plugin.

Rewards tables have a particular structure that provides a lot of flexibility while avoiding the need for plugin code.

Structure Breakdown #

Let’s take a look at each piece of the rewards system.

Reward #

Describes an item to grant and a range how many to grant.

 {
    "id": "gold_coins_reward", // reward id
    "catalogId": "gold_coins", // item to grant
    "count": {
      "min": 10,               // range to grant, selected randomly
      "max": 100
    }
  }

Reward Bag #

A list of potential rewards to choose from. Picked by weighted random roll.

 {
    "id": "rare-fire-bag",
    "name": "Rare Fire Bag",
    "rewards": [
      {
        "rewardId": "fire-shard",
        "weight": 50
      },
      {
        "rewardId": "rare-fire-shard",
        "weight": 10
      }
    ]
  }

Reward Slot #

A list of potential bags to choose from, which is picked by weighted random roll. Having two levels of nesting with slots and bags enables many complex rewards and loot systems while avoiding the complexity of infinite nesting.

 {
    "id": "fire-materials-slot",
    "noOpPercentage": 0.0, // chance to skip the slot altogether
                           // as percentage from (0.0 - 1.0)
    "slotEntries": [
      {
        "rewardBagId": "common-fire-bag", // common fire materials
        "weight": 50
      },
      {
        "rewardBagId": "rare-fire-bag", // common or rare materials
        "weight": 25
      },
      {
        "rewardBagId": "common-ice-bag", // common ice materials
        "weight": 50
      }
    ]
  }

Reward Table #

A list of slots. Each slot is rolled independently.

{
  "id": "fire-enemy-table",
  "name": "Fire Enemy Table",
  "rewardSlotIds": [
    "common-enemy-materials-slot", // stuff all monsters drop
    "common-enemy-materials-slot", // another common drop

    "fire-materials-slot",         // fire enemy materials

    "winter-event-slot"            // special materials added during             
                                   // event
  ],
  "guaranteedRewardIds": [
    "gold-coins-reward",           // always drop some gold
    "medium-xp-reward"             // always grant some xp
  ]
}