aorecomp

Anarchy Online classic in the browser

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


docs/unique-items.md (5461B)


Unique item acquisition

Unique is Flags0 bit 0x08000000, separate from NoDrop 0x04000000. Acquiring an individual Unique item checks its low template ID against loose inventory, worn equipment and the contents of carried backpacks. Banked items and banked backpack contents are outside that carried scope. Learning a crystal consumes the item; its learned program entry is not carried item ownership.

Bank withdrawal and corpse pickup share playerInventory.carriesUnique. The check runs while the inventory update lock is held and before changing locations or committing a transfer. Two concurrent pickups of duplicate Unique items can therefore acquire only one instance. Rejection changes no item IDs, counts, locations or player credits. Deliberate control-panel fixture creation remains unrestricted.

Original client evidence

Original kkr.dll!10060510 validates moves from an external Chest. Its Unique branch calls 10062a20 when the Chest's parent is not the local character. 10062a20 checks the low template against the carried inventories, including loaded carried Chest contents. The related bank contract and quality-endpoint checks are documented in bank storage.

Three complete retained records are in local/unique-loot-research/native-evidence.json, selected from the matching bank and source-refresh investigations. The original DLL was rehashed as a37bc1c15053fdcc5572772309f7074c4f83baffe2faa164df40b059b7c480c0. Validator evidence is ev_5a372a2ca28d7119684aacd9981bc963dd958fe827b527bdc110b4817cf4db89; lookup evidence is ev_8fc2e6829eababebc05fba0e2766580f1f6c8ec53240e7d0ae5ca11c4bcb6db9. These are original static client branches, not a historical server capture. Source refresh 10062960 is retained as ev_23447888b082b5e191bb5ea8a9564d3271ae3dd17a04935cf66fbab8a2bc8636.

A client may not yet know the contents of an unopened carried bag. The server must check its complete owned inventory rather than relying on the client's local validation. On corpse rejection, action 146 refreshes the picked source before the authoritative loot list and the original Unique explanation are sent. A list refresh alone preserved ownership but left the optimistic source icon hidden in the real WASM client.

Verification

The full maintained Go suite passed in 591.187s, with gamedata passing in 10.345s. The focused run passed in 64.835s, the same loot/bank/container selection passed under the race detector in 566.389s, and build/vet passed. Logs are in local/unique-loot-research/. New regressions first reproduced duplicate acquisition from loose inventory, equipment and carried bags, and both duplicate pickups succeeding concurrently. They now cover those rejections, successful first acquisition, a different Unique template, bank/banked-bag exclusion, exact rejection packets, unchanged item-store snapshots and cold recovery. The concurrent case retains one instance in inventory and the other on the corpse. Existing bank tests cover low-template equality across quality endpoints.

A real GPU Chromium WASM client exercised the unopened-bag case twice. Both server rejections retained all four fixture instances and restored the picked source icon. Opening the bag made the native client reject another attempt locally without a pickup request. The player then moved the existing Body Boost crystal out of the bag and uploaded it, consuming only instance 57. Native pickup transferred corpse instance 58 into ordinary inventory; another duplicate attempt retained instance 59 on the corpse. Browser reconnect and an actual server restart retained the learned program and exact item locations.

local/unique-loot-smoke/tmp_verify.py checks native inventory entries, SQL snapshots, all pickup requests and acknowledgements, source-refresh slots, local rejection without a request, renderer identity and zero client errors. The fixture used one GM-created player, a Medium Backpack, three original startup crystals and a cloned dead Leet containing the two spare crystals. It establishes transfer behavior, not authored Leet loot content. BM/MC were raised through the control editor; learning and transfers used native UI.

The owned browser closed. Cleanup removed only the owned character, corpse and three remaining item instances. Every unrelated row retained its hash, and SQLite foreign key and integrity checks passed. The sole normal HTTPS preview remains available on port 8443.

Remaining scope

Shop purchases and player trading are unfinished. Acquiring a filled container with Unique children needs its own complete original contract; this individual item check does not claim to validate that operation. Dynamic temporary item lifetimes and other acquisition restrictions remain separate work.

Token acquisition uncertainty

A March 22, 2002 report of patch 13.92 describes mission and bravery tokens becoming Unique and uploading an existing token before receiving another. Its Japanese wording leaves open whether this means one of each design or an additional restriction across the different designs. The ordinary and bravery records have distinct low template IDs; the recovered general client check above compares that ID. Recover original wording or server evidence before adding a token-specific acquisition rule. This lead does not establish mission token eligibility, chance or completion XP.