Skip to content
MOMU EMULATOR THE SERVER OWNER’S LIBRARYNeed a hand? Get support ↗
MOMUEMULATOR
简体中文
PRACTICAL TUTORIAL / 144 min read · Beginner

Create a normal NPC shop from start to finish

A working NPC shop has three connections: an NPC on the map, a ShopManager row, and a numbered inventory file. A shop list alone cannot spawn an NPC.

Try in the lab
Core schema source-checkedEdition 2.0 · English / 简体中文
01 / WHAT YOU WILL LEARN

The outcome to aim for

  • Connect the NPC, exact ShopManager binding and inventory as three separate dependencies.
  • Preserve all 16 inventory fields and keep price configuration separate.
  • Choose the correct reload sequence and test a purchase on the owning role.

Before you start

Choose the owning GS/GSCS, back up NPC placement, ShopManager and inventory, and choose an unused ID from 0–99.

ScopeTeaching examples and recorded structures. Application and gameplay must be verified on your deployed version.

Files you need

1Place an NPC
2Link ShopManager
3Add inventory
4Reload & buy

Understand the fields

FieldMeaning & dependencies
ShopManager: IndexUnique inventory ID; match the three-digit inventory filename prefix.
ShopManager: Npc / Map / X / YConnect the exact NPC placement to the intended inventory.
Shop: Group / IndexItem category and number.
Shop: Level / Dur / Skill / Luck / OptionItem creation settings; preserve the complete 16-column format.
Shop: ExcOpt / Anc / JoH / Oex / Socket1…5Option encodings for this shop format; copy a validated item.
ItemValue.txtPrice overrides; do not add a price column to the inventory row.
VISUAL WALKTHROUGH

One step at a time

  1. STEP 1

    Pick an unused shop index and confirm it is not used by the active profile’s extra ShopManager. Filenames require a three-digit prefix followed by space-hyphen-space, such as 026 - Test Supplies.txt.

  2. STEP 2

    Copy an existing shop inventory as a template. Keep all 16 numeric fields per item row and the final end marker. For a safe first test, use the large healing potion row below.

  3. STEP 3

    Place a valid merchant NPC under NPC in the map XML. Choose an unoccupied walkable position and use its Class and exact coordinates in ShopManager.

  4. STEP 4

    Add one ShopManager row: shop index, NPC class, map, X, Y. A fully matching position rule is preferred to a class-wide wildcard rule. Avoid duplicates using the same shop index.

  5. STEP 5

    For an existing inventory edit, use /reload shop. For a new or changed ShopManager binding, use /reload shop and then /reload monster on the affected role: the NPC stores its shop number when it spawns. Monster reload recreates spawns, so apply during maintenance.

  6. STEP 6

    For normal NPC shop prices, inspect ItemValue.txt rather than adding a nonexistent price column to the shop row. The shop grid is limited to 8×15 cells and item sizes matter.

Configuration example

TUTORIAL EXAMPLE · MERGE FRAGMENT

Keep the existing root/sections and unrelated rows. This example is not a complete original or a full replacement file.

TEACHING FRAGMENT
// Tutorial inventory: Data/Shop/030 - Tutorial Shop.txt (verify unused ID on your role/profile)
//Group Index Level Dur Skill Luck Opt ExeOpt AncOpt JoH Oex Sck1 Sck2 Sck3 Sck4 Sck5
7 2 9 255 0 1 1 0 0 0 0 0 0 0 0 0 // Pad Helm; existing distribution example
end

// Merge this NEW binding before the manager end marker, only if unused:
30 254 0 130 130

<!-- Merge into the existing NPC group; do not duplicate an existing NPC. -->
<Config Class="254" Range="0" PositionX="130" PositionY="130" Direction="3" Element="0" />
Change values and see the before/after comparison →

What changed?

The lab adds a new teaching NPC placement, a 5-value manager binding and one 16-value inventory. Its before panel has no new teaching rows; existing real rows are never inferred or replaced.

The lab names changed fields and keeps the example separate from your real configuration.

Open this demonstration

Apply the real change

Merge the NPC inside existing <NPC>, update the exact ShopManager row and keep one inventory file per ID. New/changed binding: /reload shop then /reload monster during maintenance. Inventory-only edit: /reload shop.

Find the file’s reload instructions →

Verify the result in game

If the expected result is missing, restore the backed-up files and repeat the same reload/restart before adding another change.

If something goes wrong

NPC opens the old shop

New binding was loaded but the NPC was not recreated. Reload shop, then monster during maintenance.

No NPC at the point

Inventory rows do not spawn NPCs. Check the active map XML, class and walkable coordinates.

Item missing

Check the 16 columns and inventory grid. The client item definitions must match.

Dependencies & important details

This is a coordinated three-file example, not a complete file replacement. Check quest handlers or other NPC systems if clicking the merchant opens a different interface. Socket and Excellent values use their own encodings; copy known working entries rather than guessing.

A precise ShopManager match uses NPC class, map, X and Y together. If no exact match is found, the supplied loader can fall back to a class-wide entry. This is why moving an NPC without updating its exact rule can open a different inventory.

The talk-based shop manager has 100 slots (0–99) in this build. A three-digit filename prefix does not authorize IDs above 99. The lab only offers existing merchant-class and item examples; a new shop ID must be checked against your deployed file.

The class-only fallback uses the first matching manager index. A new lower ID for the same class can change other NPCs without exact bindings. The new-shop lab blocks known occupied IDs and uses a higher teaching ID; verify every same-class merchant after applying.

Built around the supplied MOMU configuration snapshot. Reference entries flag alternate copies and unconfirmed fields. Match the guide to your deployed version; archived packages and live gameplay were not audited by publishing these pages.