Skip to content

NPC services are not gated by shoptype.dat #3285

Closed

Description

@erwan-joly

shoptype.dat says which services each NPC offers, and the server ignores it. Today any NPC that opens the upgrade window allows every upgrade operation, and n_run with a probability window opens any WindowType at any NPC. A client that sends n_run 60 <window> next to a food seller can upgrade, rarify or sum there.

What the file holds

  • The header lists about 100 service ids. Examples: 1 weapons, 2 armour, 3 gloves and boots, 4 upgrade, 6 rarify, 12 resistance sum, 13 alchemy production, 20 SP card upgrade, 23 cellon, 41 family warehouse, 45 SP perfection, 78 bank, 89 fishing shop, 93 SP wings fusion, 94 partner SP fusion, 96 fairy upgrade, 97 fairy rarify.
  • Each data row is shopType service1 … service6, preceded by a comment naming the NPC. 125 rows in all.
  • The shop type is the ShopType byte on the NPC's shop line, which NosCore already stores in Shop.ShopType.
  • Checks against what we know:
    • 48 → 41 (family warehouse) matches FamilyShopService.ShopType.
    • 7 → 11 12 13 20 45 94 is the alchemist (SP upgrade and perfection).
    • 16 → 2 12 is the armour seller with the resistance sum.

Proposed

  1. Parse shoptype.dat into a table: shop type → service ids, with an enum for the service ids in NosCore.Data.
  2. Map each upgrade operation and probability window to the service that unlocks it, confirming each pair in the client.
  3. Refuse an operation when the NPC whose dialog is open does not offer that service.
  4. FamilyShopService.ShopType then becomes a lookup of service 41 instead of a constant.

The decoded table is in the project's .dat audit notes.

Activity

  1. erwan-joly commented on Nov 15, 2026

    @erwan-joly
    CollaboratorAuthor

    Taking this one (Fix open bug tickets thread).


    Generated by Claude Code

  2. erwan-joly commented on Nov 15, 2026

    @erwan-joly
    CollaboratorAuthor

    Working on this. The parser now imports shoptype.dat into a ShopTypeService table, and an NpcServiceCatalog checks the open NPC's shop type before an up_gr runs (equipment upgrade 4, rarify 6, resistance sum 12, SP card upgrade 20, SP perfection 45) and before the family manager's extension shop opens (41). Client test and PR to follow.


    Generated by Claude Code

  3. added 6 commits that reference this issue on Nov 15, 2026
    5f7aebc
    3230c60
    51cd92e
    e3c0eaf
    e4bc3b6
    533c921
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions