# Streak System

Since version 2.0.0 Quests has a **real quest streak**: the number of days in a row on which a player finished at least one daily quest. Milestones can pay a lootbag and tokens. Both parts are **off by default** and have to be switched on.

---

## Switching it on

| What | Option | Admin window |
|------|--------|--------------|
| Count the streak | `streak.enabled` (default `true`) | Rewards & economy → "Count the streak" |
| Show the streak in the Questbook | `streak.questStreak` (default `false`) | Features → "Show the quest streak in the questbook" |
| Pay milestone rewards | `streak.rewardsEnabled` (default `false`, needs `questStreak`) | Features → "Pay streak rewards" |

When the streak is shown, the Questbook has a **streak box** in its navigation and the Chronicle shows the longest streak.

---

## How a day counts

- A **streak day** is a daily period (from one daily reset to the next) in which the player finished at least one daily quest. Finishing more dailies on the same day does not count twice.
- With `cumulative: false` the streak is classic: one missed day breaks it.
- With `cumulative: true` (default, "Count leniently") up to `gracePeriodDays` missed days in a row are forgiven. Missed days do not count, but the streak only breaks after a longer gap. With the default of 7, a player can pause for up to a week.

```json
"streak": {
  "enabled": true,
  "cumulative": true,
  "gracePeriodDays": 7,
  "questStreak": false,
  "rewardsEnabled": false,
  "milestones": [
    { "days": 7,  "lootbagId": "streak_reward_7",  "tier": "bronze" },
    { "days": 14, "lootbagId": "streak_reward_14", "tier": "silver" },
    { "days": 21, "lootbagId": "streak_reward_21", "tier": "gold" },
    { "days": 28, "lootbagId": "streak_reward_28", "tier": "platinum" }
  ]
}
```

`gracePeriodWindow` is only used by the old login counter and has no effect on the quest streak.

---

## Milestones

When `rewardsEnabled` is on, a player who reaches a milestone gets:

- The milestone's **lootbag** (`lootbagId`). Items that do not fit wait as pending rewards. A bag ID that does not exist pays nothing; the admin window warns about missing bags.
- The **tokens of its tier** from `economy.tokenEarnings`:

| Tier | Option | Default |
|------|--------|---------|
| `bronze` | `streakBronze` | 5 tokens |
| `silver` | `streakSilver` | 10 tokens |
| `gold` | `streakGold` | 15 tokens |
| `platinum` | `streakPlatinum` | 20 tokens |

Each milestone is paid **once per player**, even if the streak breaks and is built up again. The admin window allows up to 12 milestones.

:::note
The shipped milestone bags `streak_reward_7`, `streak_reward_14`, `streak_reward_21` and `streak_reward_28` are not part of the shipped lootbag data yet. Until you create them (or pick other bags), these milestones only pay tokens.
:::

---

## Admin tools

- `/ksquestadmin setstreak <player> <days>` sets the streak as if today was a streak day. No milestone rewards are paid.
- The Players tool of the [admin window](./admin-panel#players) has **Set streak** for online and offline players.