# Mod Editor

# Mod Editor

The Mod Editor is a browser-based visual tool for creating and managing all KyuubiSoft server content. Instead of editing JSON files by hand, use the editor's forms, autocomplete and validation to build quests, NPCs, shops, achievements and more.

## Features

- **12 Editor Pages** — Quests, NPCs, Chapters, Pools, Shop, Achievements, Citizens, Lootbags, Localization, Packs, Setup Wizard, Validation
- **Import & Export** — Drag-and-drop server configs, export as ZIP with only changed files
- **Validation** — Real-time error checking with cross-reference validation
- **Autocomplete** — Item, entity and block ID suggestions from `/ksdev` exports
- **Tier Generator** — Create difficulty variants from quest templates
- **Quest Packs** — Bundle content into shareable `.questpack` files
- **Auto-Save** — Changes persist in browser localStorage
- **Diff View** — See exactly what changed before exporting

## Quick Start

### Online

Visit the Mod Editor at [modeditor.kyuubisoft.com](https://modeditor.kyuubisoft.com/).

### Local Development

```bash
cd tools/mod-editor
pnpm install
pnpm dev
```

## Workflow

1. **Import** — Drag your server's config folder into the editor, or start fresh
2. **Edit** — Use the visual editors to create and modify content
3. **Validate** — Check for errors and cross-reference issues
4. **Export** — Download a ZIP with only the files you changed
5. **Deploy** — Extract the ZIP into your server's config folder

## Editor Pages

| Page | What you edit |
|------|--------------|
| **Quests** | Side, story, daily and weekly quests with objectives and rewards |
| **NPCs** | Quest giver profiles with dialog trees |
| **Chapters** | Story chapter ordering and progression |
| **Pools** | Daily and weekly quest rotation pools |
| **Shop** | Token shop items and prices |
| **Achievements** | Achievement definitions, triggers and rewards |
| **Citizens** | NPC spawn data, skins and positions |
| **Lootbags** | Loot tables with guaranteed items and weighted pools |
| **Localization** | EN/DE translations side-by-side |
| **Packs** | Self-contained quest packs for sharing |
| **Setup Wizard** | Guided step-by-step quest creation |
| **Validation** | Error overview with cross-reference checks |

## Documentation

<DocCardList />