aorecomp

Anarchy Online classic in the browser

git clone https://aorecomp.ubeagle.com/code/aorecomp.git


docs/npc-shops.md (7524B)


Starter NPC vendors

The original A2 verification covered the five placements below. The current population has 182 merchant definitions bound through shop_template in each zone YAML. See the expanded stock policy for current coverage, sources and specialty merchants. The finite stock descriptions below record the starter subset retained at the beginning of the expanded catalogs.

NPC Stable group Original position Catalog/price template
OT Food Provider 710/district/0/fixed/18 514.2, 11.0001, 365.3 OT Food 120973
OT Food Provider 710/district/0/fixed/19 412.7, 17.000101, 352.09998 OT Food 120973
Secondhand Peddler, Omni training 950/district/1/fixed/0 189.06712, 15.541694, 52.672432 Startup Shop 27054
Secondhand Peddler, Clan training 952/district/3/fixed/0 189.9154, 15.833457, 48.40023 Startup Shop 27054
Secondhand Peddler, Neutral training 954/district/1/fixed/0 194.15007, 3.6784623, 153.59198 Startup Shop 27054

The early route for this gate is each faction's training ground and these two reported Trade providers. Existing population YAML supplies placement and body; this change does not establish historical outfits or expand the appearance gate.

Stock policy and evidence limits

Food Providers offer QL1 Chocolate Chip Muffin 130581 and Bottle of Fresh Water 130593. Peddlers offer QL1 Treatment Laboratory 25812, Simple Nano Kit 85366, Basic Nano Recharger 25820, and the four original 100-round ammunition packages 21605, 21609, 21613 and 21601. The existing catalog and transaction mechanisms supply original item identities, charges and prices.

This finite stock selection and its assignment to NPCs are reconstruction policy. Original NPC stock lists, refresh rules and NPC-specific price modifiers have not been recovered. Original vending templates supply modifiers 426/427: OT Food uses 6/100 and Startup Shop uses 4/105. The OT Food template's ordinary faction-use criterion is retained. Stock belongs to the shared original template, so the existing OT Food machine using 120973 receives the same two food entries. The food's original use action is head text; this is not a claim of healing.

Sources are the maintained original item records (120973 in items_036.yaml, 27054 in items_000.yaml, food in items_051.yaml) and population records in zones/zone_710.yaml, zone_950.yaml, zone_952.yaml, zone_954.yaml. The maintained OFPO name/body identification uses a later observation at the matching placement. SOPD identification uses later Neutral training observations. Neither proves the 14.9.1 stock. Reopen historical stock research only with an original server stock source or a recorded NPC transaction, not another broad search for these names.

Native interaction and shared transactions

The shipped 14.9.1 kkr.dll SHA-256 is a37bc1c15053fdcc5572772309f7074c4f83baffe2faa164df40b059b7c480c0. REA/Ghidra 12.1.2 observations are retained in local/npc-vendors/native-evidence.json:

The server answers the character's TradeStart, or E-key Use (kind 0), with a connection-local vending catalog, typed (51035, NPC instance), at the NPC's position. The NPC remains the interaction target; this auxiliary object supplies the native shop catalog and pricing interface. This proxy arrangement is an implementation inferred from the observed client requirements, not a recovered server packet capture. Existing machine-side and player-side trade initialization, catalog page 111 and quote/transaction handling are shared without a second economy.

The catalog uses Mesh12=0, which selects the original pickup-box fallback. It exists only while the shop is open: completion, cancellation and range cleanup close the trade and remove the auxiliary object. The temporary box at the seller's feet is a provisional visual limitation, not an original NPC-shop presentation claim. It must not remain and block the next NPC interaction.

Bounded rendering research found that full-update attachment 0x100b25c0 explicitly enables world visibility, overriding an initial cleared flag. Parenting and model-free variants failed to open the native catalog. Initial and immediate post-creation scale updates left the model full-sized; static mesh loading can discard a scale update before resource readiness. No supported visibility-only message was established. Reopen this question with an original NPC-shop packet capture or evidence of a message that hides a registered item without changing its catalog lifetime. Attachment evidence is retained in local/npc-vendors/attachment-evidence.json, evidence ev_9295844f53cfb301b5bcd2ccb11e6a28bd022289e57dd1dcf8b8e6156f3b7211.

Admission checks the current NPC, maintained binding, visibility, life, zone and five-meter player distance at start and on every subsequent trade action. Existing player session/equipment/trade admission and item-use requirements also apply. Missing/despawned/dead/out-of-range sellers cannot commit a basket. Movement outside range also aborts the server draft: the native movement path can close the window without sending TradeAbort. This cleanup is shared with ordinary vending machines, so a hidden stale draft cannot retain offered items. Purchased items, sold ownership and credits use the existing atomic SQLite transaction, and cancellation restores the same offered identities.

Verification

Handler regressions cover all five bindings through purchase, sale and cold reload, plus rejection at start and Accept for unseen, dead, removed, unbound, non-NPC, other-zone and out-of-range sellers. The browser regression uses the original placements, controlled funds and one sale item; it is not evidence of earned progression. Run it with AO_GAME_TEST=1 go test ./server -run '^TestBrowserNPCShops$' -count=1 -timeout=12m -v. November 5 native checks passed all five original placements: right-click and E open stock with displayed prices, sale plus purchase commits once, cancellation retains ownership, reconnect replays the exact purchased identity, and ordinary movement outside range cancels the server draft. Each close also removes the auxiliary catalog from the client; subsequent NPC picking succeeds. The Go fixture verifies the same inventory and credits after a cold database reload. Retained artifacts are local/npc-vendors/20261105-094512 (Omni training) and local/npc-vendors/20261105-094608 (the other four routes).

All 104 focused server tests passed with selection ^Test(NPCShop|Shop|PlayerTrade|StaticItemUseDoesNotAliasCollidingShop|Held). This includes rejected-write/retry, item packing, original machine admission, player-trade isolation and the new seller/range checks. Output is retained in local/npc-vendors/regressions-final.log.