aorecomp

Anarchy Online classic in the browser

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


docs/npc-scripts.md (9682B)


Recovered NPC conversations

The local Fandom mirror contains recorded dialogue, including introductions and quest conversations. Sixteen speakers can be linked to maintained NPC group IDs. Their Go scripts in server/gamedata/npc_scripts.go expose 164 recorded exchanges. The source transcripts are linear records: original branch graphs, availability conditions and most gameplay consequences have not been recovered. The topic menus are a reconstruction, not a recovered original conversation tree.

Sources and attribution

The 879-page SQLite mirror is ~/tmp/fandom-scraper/anarchyonline.db, SHA-256 012badc22701141d936a50ae574cdeb663cf5b02ca7c27a39ea80b64ded41b11. Dialogue text is attributed to the Anarchy Online Wiki contributors under CC-BY-SA; each registry entry retains its source article URL. The adaptation normalizes typographic punctuation to ASCII, retains narrative lines and source spellings, and reconstructs menus and farewell termination. Source typos such as Ida's spoken surname "Sculler" are retained.

Several articles bear April 2006 contributor signatures. These date the documentation, not the introduction of the dialogue. The text is not established as an exact 14.9.1 transcript. Explicit Shadowlands travel and post-Ross leadership references are omitted, along with payments, quest acceptance, hand-ins and reward actions. Other dialogue may still reflect later revisions.

Speaker YAML group ID Source article
Ida Schuller 710/district/0/fixed/23 Ida Schuller
Horatio Campbell 710/district/0/fixed/22 Horatio Campbell
Sam Cadena 550/district/8/fixed/3 Sam Cadena
Mr. Gips 545/district/1/fixed/8 Mr Gips
Eric Mendelson 600/district/7/fixed/8 Eric Mendelson
Richelieu 610/district/11/fixed/1 Richelieu
Sun Tzu 550/district/2/fixed/9 Sun Tzu
Stolt Jensenberg 565/district/13/fixed/0 Stolt Jensenberg
Zoftig Blimp 560/district/18/fixed/4 Zoftig Blimp
Tsunayoshi Smith 610/district/1/fixed/46 Tsunayoshi Smith
Kendric Kuzio 595/district/8/fixed/0 Jack quest
Susan Furor 685/district/5/fixed/0 Jack quest
Quintus Romulus 1941/district/0/fixed/179 Jack quest
Janella Gheron 1833/district/0/fixed/0 Jack quest
Robin Raag 125/district/0/fixed/218 Jack quest
Good Time Party Mixer 566/district/1/fixed/5 Living Cyber Armor

Four speaker names also resolve placeholders. AVQE matches Kendric's Adventurer role and Deep Artery Valley coordinates; DOQE matches Quintus's Doctor role in Biomare; EIQU matches Janella's Engineer role inside Cyborg Barracks; NOTC matches Robin's profession and the Smuggler's Den location behind Ash within one metre. These remain name inferences. Their placeholder appearances are retained. npc_names.yaml and the four zone records retain the evidence. The Party Mixer script is attached to the documented Newland instance; the Reet Retreat instance is not established as having this armor dialogue.

The complete extraction is retained locally at local/reports/npc-conversations.json: 24 speaker entries, 191 topic records and 410 recorded turns, including omitted and unmapped content. It also records mapping notes and additional article transcripts. This research archive is not loaded by the server.

Go scripting contract

gamedata.NPCScripts[group.ID] selects an NPCScript. Its Talk function takes an empty string to start and a previously offered DialogueChoice.ID to answer. It returns Dialogue{Text, Choices}. Text may be empty (Sun Tzu has no recorded greeting); no choices ends the conversation. Recovered scripts use goodbye for recorded farewells. Unrecognized choices return an empty dialogue.

The callbacks are stateless Go functions. Each world connection owns its offered choices and current NPC; wire indexes are translated to those choice IDs. The server rechecks visibility, playfield, loading state and a ten-metre distance on every turn. That distance is a server policy, not a recovered historical rule. Inventory transactions and quest state are not part of this API yet.

Verified 14.9.1 protocol

Static verification used shipped kkr.dll, SHA-256 a37bc1c15053fdcc5572772309f7074c4f83baffe2faa164df40b059b7c480c0. The 59 retained evidence records and artifact metadata are in local/reports/npc-dialogue-protocol-evidence.json and local/reports/npc-dialogue-protocol-metadata.json.

SimpleChar activation at 0x100821d0 converts flag 0x08000000 into stat 768 (HasKnuBotData) equal to one. Default action at 0x1002c350 checks that stat and sends OpenChatWindow with two false booleans. The outer identity is the player; the nested identity is the NPC. Evidence IDs are ev_3b0a69b2fc083c0a402327c55b2989657a34cc90de80c8e469e5d01e58060287 and ev_a7c19a7ab89247d290564d7b4a8a50386b784d615766760e5dde01aadf6d9302.

After the normal N3 header/pass-on flag, every dialogue payload begins with big-endian u16(2) and NPC identity (u32 type, u32 instance).

Message Key Remaining fields
Open, both directions 0x3b132d64 Two u32 booleans; server replies 1,0
Answer, inbound 0x2103247d Zero-based i32 choice index
Append text 0x5d70532a i32 zero, u32 byte length, raw text
Answer list 0x55704d31 u32 count, repeated u32 byte length and raw text
Close, both directions 0x270a4c62 i32 reason, u32 byte length, raw text

Readers: base 0x10154d50, open 0x10155a50, answer 0x101538d0, text 0x10154960, choices 0x10153a40, close 0x10155230. Text must be 1-10,000 bytes; answer lists must contain 1-1,000 labels of 1-1,000 bytes each. Empty lists are invalid, so terminal replies send Close instead. Append text has no trailing DWORD. Close accepts empty text; server reason 5 follows CellAO.

CellAO-NightPredator at ca77f375a7dabe3be769da94e6c2a3d093344c2c provides useful secondary examples in ZoneEngine/Core/KnuBot and the three ZoneEngine/Scripts samples (InfoBot, Flappy, ItemGiver). These are emulator examples, not recovered original AO scripts. Its Trade-based start handler differs from the shipped 14.9.1 default action. Archived CellAO at 433ecc25a6229000e41a88f1b39c8fe8c3a6f216 corroborates the reply values and zero-based indexes, but appends a surplus zero to its text packet.

Other recovered scripting leads

The Jack quest article records profession-specific item exchanges and rewards; Living Cyber Armor records multi-stage tasks; Rings of Tir records dog-tag bag progression; the shoulderpad article records parts collection. These are useful inputs for inventory and quest implementations, but do not supply complete historical conditions or executable original scripts. No mission or item grants are inferred from the conversation menus.

Daedra Iberra's location does not select a unique maintained NPC, and Dr. Henrik Stevenson's Omni-Med transcript has no identified fixed template. Five Jack quest speaker sections contain no dialogue, and Monday Kline has player prompts without answers. Those are retained as research gaps. Omni Starter Quests depends on Newbie Island, and several other dialogue pages describe Shadowlands or later content; they are excluded from this target.

Go tests cover every script's ID link, recorded text, omitted actions, protocol limits and farewell behavior. World-connection tests exercise native packet framing, conversation validation and repeated open requests. Replies use plain text and explicit line breaks; this client displays HTML font tags literally. Repeated opens for the same active NPC are ignored so the native window does not close and invalidate the current session.

WASM GUI verification on 2026-10-20 exercised Ida at her maintained location in the full Omni-1 Trade population: greeting, topic menu, two recorded replies and closing. Temporary HTML buttons queued mouse events through the existing browser input bridge; the native dialogue widget selected the topics and emitted the answer packets. Ordinary desktop pointer automation was unreliable. The other 15 speakers have Go coverage but were not individually exercised in the GUI. Screenshots, client packets and bundle metadata are retained in local/reports/npc-wasm-test-status.json and its referenced files.

Choice links require the MSVCRT.dll!atol import from ddr.dll at sub_2B095D60. The runtime maps it to the same 32-bit decimal parser as atoi; client/tests/atoi.c covers 4,366 cases for each export, including wraparound and ABI state. Human body models also require matching appearance flags; see the population notes.