# Quest Editing

# Quest Editing

The Quests page is the main editor view. It lets you browse, create, and edit all side quests, story quests, daily quests, and weekly quests in one place.

## Quest List

The left panel shows all loaded quests. Both side quests (from `quests.json`) and story quests (from `story_quests.json`) are combined into a single list.

### Searching

Use the **search bar** at the top to filter quests by ID. The search is case-insensitive and matches anywhere in the quest ID.

### Filtering

Below the search bar, two dropdown filters let you narrow down the list:

| Filter | Options |
|--------|---------|
| **Type** | All types, Story, Side, Daily, Weekly |
| **Source** | All, Base, Custom |

### Quest List Items

Each quest entry shows:

- **Type letter** -- A color-coded letter (`S` for story, `D` for daily, etc.)
- **Quest ID** -- The full quest identifier
- **Source badge** -- `C` badge for custom quests
- **Modified indicator** -- A yellow dot if the quest has unsaved changes
- **Disabled indicator** -- `OFF` badge with strikethrough text if the quest is disabled

Click any quest to select it and open it in the editor panel on the right.

## Creating New Quests

Click the **"+ New"** button in the quest list header to open the creation dialog.

### Step 1: Enter a Quest ID

Type a unique quest ID in the text field (e.g., `side_my_new_quest`). The editor will warn you if the ID already exists.

### Step 2: Choose Side or Story

Check the **"Story Quest"** checkbox if this quest should be saved to `story_quests.json`. Leave it unchecked for side/daily/weekly quests.

### Step 3: Pick a Template or Start Blank

Choose from the available options:

| Template | Description | Pre-filled Content |
|----------|-------------|-------------------|
| **Blank Quest** | Empty quest, fill in manually | No objectives or rewards |
| **Kill Quest** | Kill a certain number of entities | 10x kills, 50 tokens |
| **Gather Quest** | Collect specific items | 10x item collection, 30 tokens |
| **Mining Quest** | Mine specific blocks | 15x blocks mined, 40 tokens |
| **Crafting Quest** | Craft specific items | 1x item crafted, 40 tokens |
| **Explore Quest** | Discover zones or travel distances | 1x zone discovered, 25 tokens |
| **Multi-Objective** | Quest with multiple objectives | Kill + collect combo, 75 tokens + items |
| **Daily Quest** | Repeatable daily quest | 5x kills, auto-reset + repeatable |
| **NPC Quest** | Quest involving NPC interaction | 1x NPC interaction, 30 tokens |

Templates give you a starting point with sensible defaults. You can modify everything after creation.

## Mod Editor Panel

When you select a quest, the right panel shows the full editor with these sections:

### Header

The header bar shows:

- **Quest ID** as the title
- **Source badge** -- "BASE" (from server defaults) or "CUSTOM" (your additions)
- **Modified badge** -- "MODIFIED" if you have made changes
- **Action buttons:**
  - **Clone to Custom** -- Creates an editable copy of a base quest (available on BASE quests only)
  - **Disable/Enable** -- Toggles a base quest off without deleting it
  - **Delete** -- Removes a custom quest entirely
  - **Generate Tiers** -- Opens the [Tier Generator](./tier-generator)

:::tip Base vs Custom
Base quests come from the server defaults and cannot be edited directly. To modify a base quest, click **"Clone to Custom"** to create an editable copy. The custom version will override the base version at runtime.
:::

### General Section

Edit the core quest properties:

| Field | Description | Options |
|-------|-------------|---------|
| **ID** | Unique quest identifier | Read-only for base quests |
| **Type** | Quest category | `story`, `side`, `daily`, `weekly` |
| **Category** | Gameplay category | Free text (e.g., `combat`, `gathering`, `mining`) |
| **Difficulty** | Difficulty level | `easy`, `medium`, `hard`, `legendary` |
| **Icon Item** | Item ID shown as quest icon | e.g., `Weapon_Sword_Iron` |

### Objectives Section

Lists all quest objectives with controls to add, edit, and remove them. See [Objectives & Rewards](./objectives-rewards) for details.

### Rewards Section

Lists all quest rewards with controls to add, edit, and remove them. See [Objectives & Rewards](./objectives-rewards) for details.

### NPC Assignment Section

Shows which NPCs handle this quest's dialog phases:

- **Accept NPC** -- The NPC that offers the quest to the player
- **Turn-in NPC** -- The NPC that completes the quest (or "QuestBook" if no NPC has a complete dialog)
- **Split NPC indicator** -- Shown when different NPCs handle accept and turn-in

A warning badge appears on story/side quests that have no NPC assigned.

Click **"+ Assign NPC"** (or **"Change Assignment"**) to open the [Assignment Modal](#assigning-npcs-to-quests). You can assign a single NPC to all phases, or use **Split NPC mode** to assign different NPCs for accept and turn-in.

When assigning, you can also enter **default dialog text** (EN + DE) directly in the modal -- the editor creates the i18n keys and values automatically.

### Prerequisites Section

Shows prerequisite quest IDs that must be completed before this quest becomes available. Displayed as read-only badges.

### Options Section

Shows quest behavior flags when present:

- **auto_start** -- Quest starts automatically when prerequisites are met
- **sequential** -- Objectives must be completed in order
- **repeatable** -- Quest can be completed more than once
- **hidden** -- Quest is not shown in the quest book until discovered

## Cloning Quests

The **"Clone to Custom"** button (available on base quests) creates an exact copy with the same ID. The clone is marked as a custom quest and becomes fully editable. At runtime, the custom version overrides the base version.

This is the recommended workflow for modifying existing server quests without losing the original.

## Next Steps

- [Objectives & Rewards](./objectives-rewards) -- Deep dive into objective types and reward configuration
- [Tier Generator](./tier-generator) -- Create difficulty variants from any quest
- [NPC Profiles](./npc-profiles) -- Assign quest givers and edit NPC dialogs