> For the complete documentation index, see [llms.txt](https://axiomemu.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://axiomemu.gitbook.io/docs/data/quest/questobjective.md).

# QuestObjective.txt

Objectives for each quest: how many of which monster to kill, which items to collect (with drop-rate override and monster filter), or how much money the player must surrender. A quest can have multiple objectives keyed by `Number`.

## File Location

```
Data/Quest/QuestObjective.txt
```

Loaded once at GameServer startup. Changes require a restart.

## Format

```
//Number Type Index Quantity Level Option1 Option2 Option3 NewOption DropMinLevel DropMaxLevel ItemDropRate RequireIndex RequireState DW DK FE MG DL SU RF
0 2 0 10000 0 0 0 0 0 * * * 0 0 1 1 1 0 0 1 0
end
```

Terminated by `end`.

## Columns

| Column                            | Type       | Effect                                                                                                                                                    |
| --------------------------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Number`                          | int        | Objective slot within the quest (0-4). Kill-count objectives use this slot to track progress per monster                                                  |
| `Type`                            | 0, 1, 2, 4 | Objective kind. See [Type values](#type-values)                                                                                                           |
| `Index`                           | int        | Target ID - meaning depends on `Type`                                                                                                                     |
| `Quantity`                        | int        | Target amount. For items the required count in inventory, for money the zen amount, for monsters the kill count                                           |
| `Level`                           | int        | Required item +level (item objectives only)                                                                                                               |
| `Option1` / `Option2` / `Option3` | int        | Required item options (item objectives only)                                                                                                              |
| `NewOption`                       | int        | Required excellent option bitmask (item objectives only)                                                                                                  |
| `DropMinLevel`                    | int or `*` | Lower bound of the monster-level range that drops the target item, or `-1` to switch to exact monster-class matching                                      |
| `DropMaxLevel`                    | int or `*` | Upper bound of the monster-level range. When `DropMinLevel` is `-1`, this column is instead read as a monster Class ID and only that class drops the item |
| `ItemDropRate`                    | int or `*` | Drop-rate override out of 10000 (1 = 0.01%). Rolled on every kill that passes the monster filter                                                          |
| `RequireIndex`                    | int        | Quest this objective belongs to. Must match a `Quest.txt` `Index`                                                                                         |
| `RequireState`                    | 0-3        | Required quest state for this objective row to be active. `1` means the objective applies while the quest is accepted                                     |
| `DW` ... `RF`                     | 0-2        | Per-class gate. `0` hides the objective for that class, `1` requires base class, `2` requires first class change or higher                                |

`*` is stored as `-1` and disables the corresponding check.

### Type Values

| Value | Meaning                                                                                                                                                                                                                                                                                                                |
| ----- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `0`   | Empty slot. Skipped entirely                                                                                                                                                                                                                                                                                           |
| `1`   | Collect items. `Index` = item ID, `Quantity` = count required in inventory, `Level` = required +level, `Option1/2/3` and `NewOption` filter specific item variants. The drop filter (`DropMinLevel`, `DropMaxLevel`, `ItemDropRate`) governs when matching monsters drop the quest item while this objective is active |
| `2`   | Surrender money. `Index` is ignored, `Quantity` = zen amount. Deducted from the character when the quest advances                                                                                                                                                                                                      |
| `4`   | Kill monsters. `Index` = monster Class ID, `Quantity` = kill count. Progress is tracked per `Number` slot and persisted through DataServer                                                                                                                                                                             |

## Kill-Count Tracking

Kill counts are stored in a per-character array of five slots. When the player accepts a quest, the server initialises one slot per `Type == 4` objective using the objective's `Number` as the slot index. The server also remembers a single `QuestKillCountIndex` - the quest whose kill counts are currently loaded - so only one kill-count quest can be active at a time.

## Item Drop Filter

For item objectives, a monster drops the quest item only if:

* `DropMinLevel == -1` and the monster's Class ID equals `DropMaxLevel`, or
* `DropMinLevel != -1` and the monster's level is within `DropMinLevel`..`DropMaxLevel` inclusive

When the filter passes, the server rolls against `ItemDropRate` out of 10000. In party play the server iterates party members and uses the first eligible one.

## Cross-File Dependencies

| Attribute                                                       | Related in                                                                           |
| --------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| `RequireIndex`                                                  | [Quest.txt](/docs/data/quest.md)                                                     |
| `Index` for Type 1                                              | [Item.xml](/docs/data/item/item.md)                                                  |
| `Index` for Type 4 and `DropMaxLevel` when `DropMinLevel == -1` | [Monster.xml](/docs/data/monster/monster.md)                                         |
| Monster-level filter source                                     | [Monster.xml](/docs/data/monster/monster.md) `Level` column                          |
| Drop-rate scaling                                               | [Common.dat](/docs/gameserver/common-dat.md#item-drop-settings) `ItemDropRate_AL0-3` |
| Map context for kill objectives                                 | [MapManager](/docs/data/mapmanager.md)                                               |

## Common Issues

* **Item never drops for the quest** - `ItemDropRate` is `0`, the monster is outside the level range, or the monster Class ID does not match when `DropMinLevel == -1`
* **Kill count does not advance** - `Index` is not the monster's Class ID, or the quest state is not `1`, or `Number` collides with another objective of the same quest
* **Money deducted but quest not advancing** - other objectives on the same quest are still short, or a `Type 2` row is missing for that class column
* **Objectives visible for the wrong class** - per-class column is non-zero for a class that should not see the objective; `0` hides it completely
* **Kill count resets unexpectedly** - the player accepted another kill-count quest, overwriting `QuestKillCountIndex` (only one kill-count quest can be tracked at a time)
