> 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/event/mossmerchant.md).

# MossMerchant.dat

Moss Merchant event: schedules the wandering gamble NPC and defines the items players can gamble on. Each listed item has per-option table indices and a gamble weight.

## File Location

```
Data/Event/MossMerchant.dat
```

Loaded once at GameServer startup. Gated by [Event.dat](/docs/gameserver/event-dat.md#moss-merchant) `MossMerchantEvent`. Changes require a restart.

## Sections

### Section 0 - Schedule

```
0
//Year   Month   Day   DoW   Hour   Minute   Second
*        *       *     *     2      0        0
...
end
```

Each row is one spawn time. Wildcard `*` means "any". Event.dat `MossMerchantEventTime` controls how long Moss stays per spawn (in seconds).

### Section 1 - Gamble Item Pool

```
1
//Index   Group   Option0 Option1 Option2 Option3 Option4 Option5 Option6   GambleRate   Comment
5         0       9 9 9 9 9 9 9                                              1633         //Blade
...
end
```

Each row is one item Moss offers to gamble on. When a player gambles within a `Group`, one row with that group is drawn by `GambleRate` weight, then its `Option0-6` indices are used to roll the final item attributes.

| Column       | Effect                                                                                        |
| ------------ | --------------------------------------------------------------------------------------------- |
| `Index`      | Item index from [Item.xml](/docs/data/item/item.md)                                           |
| `Group`      | Item group (weapon class, armor slot, etc.) - must match the gamble slot the player requested |
| `Option0`    | Rate-table index passed to Option0 (base item level roll)                                     |
| `Option1`    | Rate-table index for skill option; cleared if the item has no skill                           |
| `Option2`    | Rate-table index for Luck roll                                                                |
| `Option3`    | Rate-table index for additional option (+4/+8/+12 etc.)                                       |
| `Option4`    | Rate-table index for excellent option roll                                                    |
| `Option5`    | Rate-table index for set (Ancient) option roll                                                |
| `Option6`    | Rate-table index for socket slot roll                                                         |
| `GambleRate` | Selection weight for this row within its `Group`. Higher = more likely to be drawn            |
| `Comment`    | Inline `//Name` - ignored at load, kept for editor readability                                |

Option column values index into [ItemOptionRate.xml](/docs/data/item/itemoptionrate.md) rate tables, not option levels directly.

## Cross-File Dependencies

| Value              | Related in                                                                             |
| ------------------ | -------------------------------------------------------------------------------------- |
| Enable flag        | [Event.dat](/docs/gameserver/event-dat.md#moss-merchant) `MossMerchantEvent`           |
| Spawn duration     | [Event.dat](/docs/gameserver/event-dat.md#moss-merchant) `MossMerchantEventTime`       |
| `Index`            | [Item.xml](/docs/data/item/item.md)                                                    |
| `Option0-6`        | [ItemOptionRate.xml](/docs/data/item/itemoptionrate.md)                                |
| Item slot behavior | [LuckyItem.xml](/docs/data/item/luckyitem.md) when gamble results produce Luck options |

Moss Merchant NPC itself is spawned in code on map Elbeland at a fixed coordinate and is not defined in any XML shop file.

## Common Issues

* **Moss never appears** - `MossMerchantEvent = 0` in Event.dat, or all section 0 rows have past times for the day
* **Gamble never selects an item** - `GambleRate` sums to zero for the requested `Group`, or no rows match that `Group`
* **Rolled item has no options** - `Option0-6` values point to missing rows in ItemOptionRate.xml
* **Moss spawns but leaves instantly** - `MossMerchantEventTime` in Event.dat too low
