# Chapters & Pools

# Chapters & Pools

Chapters define the story progression path. Pools control the rotation of daily and weekly quests. Both editors are accessible from the Mod Editor sidebar.

## Chapters

### Chapter List

The left sidebar shows all chapters in order. Each entry displays:

- **Order number** -- the chapter's position in the story sequence
- **Chapter ID** -- unique identifier
- **Quest count** -- how many quests belong to this chapter
- **Source badge** -- `C` for custom, `OFF` for disabled base chapters

### Base vs. Custom

- **BASE** chapters are read-only. Use **Clone to Custom** to create an editable copy, or **Disable** to exclude a base chapter from the server without deleting it.
- **CUSTOM** chapters are fully editable and can be deleted.

:::warning
Disabled base chapters are marked with `OFF` and shown with a strikethrough. They will be included in the export's `disabled_base_ids` list so the server skips them.
:::

### Chapter Properties

Each chapter has:

- **Title Key** -- i18n localization key for the chapter title
- **Description Key** -- i18n localization key for the chapter description

### Quest Ordering

The **Quests in Chapter** section lists all quest IDs in order. For custom chapters you can:

- **Reorder** quests using the up/down arrow buttons
- **Remove** a quest with the X button
- **Add** a quest by typing its ID in the input field and pressing Enter or clicking **+ Add**

Each quest entry shows its type (story, side, daily, weekly) with a color-coded label. If a quest ID does not match any loaded quest, it is flagged as **Not found** in red.

### Chapter Rewards

Chapters can award rewards when all their quests are completed. Reward types:

| Type | Fields |
|------|--------|
| **item** | Item ID (with autocomplete) and amount |
| **lootbag** | Lootbag ID |
| **title** | Title ID |

For custom chapters, use **+ Add Reward** to add entries and configure each reward's type and value.

### Creating a Chapter

Click **+ New** and enter a unique Chapter ID (e.g. `chapter_desert_saga`). The new chapter starts empty -- add quests and rewards after creation.

---

## Pools

Pools manage the daily and weekly quest rotation. The server randomly picks quests from these pools, weighted by the configured values.

### Daily vs. Weekly

Toggle between the **Daily** and **Weekly** tabs at the top. Each tab shows the entry count.

### Pool Table

Each pool entry displays:

| Column | Description |
|--------|-------------|
| **Quest ID** | The quest that can be selected for rotation |
| **Weight** | Relative probability (higher = more likely to be picked) |
| **Distribution** | Visual bar showing relative weight compared to the highest entry |

### Managing Entries

- **Add** -- Click **+ Add Entry**, enter a Quest ID and weight (default 100), then confirm
- **Disable** -- For base entries, click the `x` button to disable without removing. Disabled entries show `OFF` and are dimmed
- **Remove** -- Custom entries (marked `C`) can be deleted with the X button

:::tip
Weight values are relative, not percentages. An entry with weight 200 is twice as likely to be picked as one with weight 100. The visual distribution bar makes it easy to compare at a glance.
:::

### Adding a Pool Entry

1. Click **+ Add Entry**
2. Enter the **Quest ID** -- must match an existing quest
3. Set the **Weight** (1-10000)
4. Click **Add to daily pool** or **Add to weekly pool**

:::info
Duplicate Quest IDs are not allowed within the same pool. The editor will show an "Already in pool" warning if you try to add one that already exists.
:::