aorecomp

Anarchy Online classic in the browser

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


docs/implants.md (24335B)


Implants and surgery access

Implants use native type 51022, ItemType 76=3 and Wear bit 4 in Can30. Admission requires the exact authored quality, a valid anatomical mask and a complete implemented effect contract. The decoded catalog contains 44,356 implant definitions; 39,712 currently qualify. Authored qualities are 1, 200, 201 and 300; no QL400 implants exist. Intermediate qualities are not inferred from matching names.

Every admitted function is unconditional OnWear14 Modify53045, target2, one tick and zero interval, with two integer arguments. Supported consumers cover abilities, all trained skills, AC, health/nano maxima, NCU, offense/defense, damage, XP, weapon range, NanoCostModifier318, NanoRange381, SkillLockModifier382 and HealDelta343/NanoDelta364. Blank implants also qualify. Conditional/repeating effects, unsupported stat consumers, other use effects, unparsed data and unknown section contracts reject the complete item. The remaining 4,644 definitions are unavailable until their full behavior is modeled.

Nano cost modifiers

Stat318 admits816 complete definitions:204 at each authored quality. The anatomical masks select ears35, left arm38 or waist40. Every effect uses the ordinary unconditional OnWear contract, and all companions have implemented consumers. This includes32 cost-bearing definitions with implemented defense277 companions. All816 original payloads are independently reparsed and compared against their complete decoded fields.

Quality Ear template / modifier Left arm template / modifier Waist template / modifier
1 173249 / +3 179184 / +2 179302 / +5
200 173250 / -2 179185 / -1 179303 / -2
201 173251 / -2 179186 / -1 179304 / -3
300 173252 / -3 179187 / -2 179305 / -5

Positive low-quality signs are authored costs, not reductions to normalize. The three QL1 implants total+10; the three QL300 implants total-10. They feed the same nano cost expression as devices and active programs. Strength Boost costs49 or40 respectively. Adding a Hardcore CPU Upgrade and Ease of Execution changes those costs to39 or30. Removing the left arm leaves exactly the other sources. Lowering Treatment and abilities below installation requirements does not reduce installed implant contributions.

Each item keeps its exact quality, complete ordered modifiers, strict action6 criteria and inherited100ms equip delay. The deterministic fixture retains all816 definitions, including the32 rejected boundaries, with SHA-256 bbcb0cebfb4b50a0c08bd205d0df22ff87a479900cff895819b64c3f68d6d92b. Complete original checks, catalog provenance and before/after results are under local/nano-cost-implant-research/.

Automation installs, casts with, removes and cold-loads all784 admitted definitions, checking every companion and the same owned instance. It also checks all32 rejected complete contracts, strict Treatment/ability/title boundaries, delayed surgery revalidation, and failed/ignored SQL or failed COMMIT followed by retry. Positive, negative and mixed stacks use the ordinary device and nano paths, including after installation requirements cease to hold.

Two actual GPU WASM clients verify all four ear qualities, positive and negative stacks, occupied/rejected installation, and the mixed179201 HealDelta getter changing by exactly5 on equip/remove. Authoritative reservations show Strength Boost costs49/47/46/40/30/31 for the corresponding configurations. Both clients restore cost70 with the same12 instances after a cold server restart, while Treatment remains0 and base abilities1. Fixtures use owned level200 control-panel profiles; GUI actions drive gameplay, with read-only heap, wire and SQLite observations. Evidence is retained in local/nano-cost-implant-smoke/verification.json. Post-restart casting again costs31, and removing both remaining implants preserves all12 instances. These contracts share the complete automated validation reported under nano range modifiers. Owned clients, players and12 remaining items are cleaned up; unrelated rows are unchanged and SQLite foreign-key/integrity checks pass. The single LAN preview remains on the default HTTPS8443 port.

Nano range modifiers

Stat381 admits776 complete implant definitions:194 at each authored quality. The three authored masks select right arm36 (544 definitions), left arm38 (192) and left hand44 (40). Every companion uses an existing consumer; there are no template-specific effect handlers. The68 defense277 companion contracts now qualify. The80 remaining range-bearing implants require absorption 227/229/231/234 (20 each) and remain rejected as whole items.

Quality Right arm Left arm Left hand Combined381 Strength range
1 176593 / +2 178564 / +5 193468 / +3 10 13
200 176594 / +6 178565 / +15 193469 / +9 30 15
201 176595 / +6 178566 / +15 193470 / +9 30 15
300 176596 / +7 178567 / +19 193471 / +11 37 16

The shared native range expression adds all equipped and active-program contributions before percentage scaling, truncation and the 40 cap. Implants retain full effects below installation requirements. No separate implant range formula or overequipping branch is needed.

The fixture retains all 856 whole original contracts, ordered companions, strict wear criteria, exact qualities and payload hashes. Its SHA-256 is d475327a9a243ca778cc4e22762dd7b757226119f0f6da337cd26edde264ae1c. All 856 original payloads were independently reparsed against current decoded YAML. Source identity, complete-consumer membership and the 1840-record delta census are retained in local/nano-range-implant-research/.

Automation exercises all 708 installations, just-outside rejection and exact range casting, complete companions, removal, cold restoration and item conservation; all 148 unsupported contracts reject without partial effects. Pure families cover every strict Treatment/ability/title boundary. Delayed surgery rechecks access and requirements; failed, ignored and failed-COMMIT saves preserve both range and NanoDelta, followed by a successful retry. All four quality sets also stack with a range device and Coherent Pathway, including after Treatment and abilities fall below installation requirements.

Two actual GPU WASM clients verify all three slots at qualities 1/200/201/300 through GUI installation and read-only native observations. Three owned pure instances are reused at each authored quality through the public control panel; their native identities, qualities and template endpoints remain exact. The mixed176962/179209/193471 set gives range 18, cost 102 and NanoDelta 6 on both replicas. The earlier defense277 rejection is superseded by the shared defense consumer admission; absorption227 companions still reject without partial installation. Removing the whole set returns range0, cost100 and NanoDelta3.

At 12.19 metres, Strength Boost rejects with base range 12 and succeeds with the mixed set's range 14; at 14.29 metres it rejects again before any cast request. Coherent Nano Pathway raises the modifier to 68 and the same target becomes reachable. Successful mixed casts reserve 45 nano, including after cold restart. Treatment 0 and abilities 1 leave all installed effects intact. Both cold clients restore the same 11 remaining instances, exact mixed qualities/endpoints and active program. Removing the implants below wear requirements clears exactly their effects; removing Coherent restores the base range. There are no recorded client errors. Executable assertions and 25 native states are retained in local/nano-range-implant-smoke/verification.json.

The full tracked suite passes 10,136 server checks and 18 game-data checks. Two race repetitions pass 312 checks; build and vet pass. The final tested source/fixture hashes, terminal outcomes and passing reports are in local/nano-range-implant-research/verification.json. Diagnostic baseline and pre-correction runs remain separately identified. Both owned clients close; cleanup removes only the two owned players and 11 items. Unrelated rows are unchanged, SQLite foreign-key/integrity checks pass, and exactly one shared preview remains available on default LAN HTTPS8443.

Passive regeneration modifiers

The original catalog has 1,840 delta-bearing implants at authored qualities 1/200/201/300. There are1,696 complete supported definitions,424 at each quality; the other144 also need an unsupported consumer. This includes32 complete cost/HealDelta contracts, such as179201 (+2 cost and+5 HealDelta). The68 complete range/NanoDelta contracts include176962 (+2 range and+3 NanoDelta);193040 still requires an unsupported383 consumer. The complete original records, hashes and admission audit are retained in local/regeneration-delta-research/catalog/.

Complete QL1 fixture Slot HealDelta343 NanoDelta364
178548 Left arm38 5 0
166365 Right wrist39 0 5
191531 Feet45 3 2

These three stack to +8 health and +7 nano per eligible recovery check. Each requires Treatment>10, its authored ability>15 and TitleLevel>2, plus surgery access. Installed deltas retain their full value after an ability drops below its installation threshold. They change recovery amount, with the existing native counter, intervals and posture rules documented in regeneration.

Slots and installation

LocationMask298 uses bit absolute_slot-32; multi-slot masks permit every matching slot. The authored default position selects a UI default, without restricting an item to that one position.

Slot Anatomy Mask
33 Eyes 2
34 Head 4
35 Ears 8
36 Right arm 16
37 Chest 32
38 Left arm 64
39 Right wrist 128
40 Waist 256
41 Left wrist 512
42 Right hand 1024
43 Legs 2048
44 Left hand 4096
45 Feet 8192

Installation evaluates the complete authored action6 postfix expression, including strict Treatment/ability/title thresholds and intrinsic breed, profession or side restrictions. Missing action6 imposes no wear requirements; Plastic Muscles' separate action3 criteria do not become invented wear gates. Occupied implant destinations reject insertion. Removal evaluates action7 when authored, independently of action6. Both permission and applicable criteria are checked again when the delayed move completes.

EquipDelay211 inherits10 centiseconds (100ms) when absent. Authored overrides remain effective, including50 centiseconds for Plastic Muscles. Each complete move persists the same instance and its resource clamps atomically before publishing effects. Implants bypass armor overequipping; dropping below an installation threshold does not reduce their installed modifiers.

Template101173/QL1 is a representative chest implant: Treatment>10 AND Strength>5, MeleeAC91 +8, mask32 and inherited100ms delay. The QL1 Metaplast chest, boots and implant total MeleeAC14; removing the implant leaves6. Derived bonuses come from current equipment, without a second persisted modifier balance.

Jobe cooldown modifiers

Pure modifier implants include chest178218/219 (+2/-2), leg191026/027 (+5/-5) and left-hand193502/503 (+3/-3) at QL1/200. Positive signs in the original QL1 data increase cooldown duration. Leg endpoints illustrate the strict gates:

Template/QL Modifier382 Treatment > Stamina > Title level >
191026/1 5 10 15 2
191027/200 -5 1004 413 3
191028/201 -5 1000 425 4
191029/300 -9 2050 1094 5

New uses sample the effective modifier once. Equipment changes preserve each existing absolute deadline. FullCharacter restores its remaining-second pairs directly after applying installed OnWear effects; it does not rescale them with the current gear. See skill locks for native rounding and expiry.

Treatment is a persisted base skill. Resource 1000204/124 supplies weights [0,30,0,50,20,0] for Strength, Agility, Stamina, Intelligence, Sense and Psychic. The native skill calculation is documented in starting stats. The native default initializer 10072760, specifically its store at 10072853, sets Treatment base5, also used by current character creation. This is verified client default behavior; historical server character-creation values remain unproven. FullCharacter transmits the base skill so the client applies trickle once.

Surgery permission and cooldown

Portable Surgery Clinic 43552, exact QL 1, type 51005, is supported for self-use from ordinary inventory or a carried backpack. Select yourself before using it. Other selected targets are rejected; friendly portable-clinic use remains future work. The 155 original stationary clinics now supply their separate paid, five-minute Treatment/access effect; see stationary clinics. The portable item comes from server/gamedata/items/items_002.yaml and Auno's historical 14.2.1 record.

The clinic requires Treatment > 5 and a selected character. Its raw SelectedTarget 431 & 35 condition describes selection, independently of the Treatment cooldown. Native LookAt 2252445f reports the selected identity and mode. The request's separate user identity must still be its actual owner.

Authored Use effects start a raw 600-second Treatment lock and grant Features 224 bit 0x10 for 30 seconds. The portable clinic adds no Treatment bonus. Both installation and removal require this permission, including at completion of a pending equipment move. A full ordinary inventory cannot discard an installed implant during removal. Combat equipment restrictions, ownership checks and atomic inventory saves also apply.

FullCharacter sends Features22 during surgery access, preserving the native base value6; expiry restores6. Native initializer10072760 sets6, and casting gate100646a0 requires bit2 through getter10059ba0. Sending16 or0 replaces normal features and prevents the client from submitting casts. Complete original-function evidence is retained in local/regeneration-nano-research/native/features-evidence.json.

The server saves absolute permission and cooldown deadlines before acknowledging use. Repeated requests cannot extend either deadline. Reconnect/restart restores the remaining window and cooldown, without re-executing the 30-second Use effect. Each expiry clears its corresponding permission or skill lock. The cooldown uses shared SkillLockModifier382 rules; its independent access window remains 30 seconds. Historical handling of portable permission across zoning, death and server downtime remains unverified; retaining these absolute deadlines is the current persistence policy.

TestBackpackClinicPreservesSourcesAndSharesPermission covers first/last child slots, open/closed known bags, exact effect sources, replay/lock refusal and cold recovery without any item-store change. Companion checks reject unavailable sources/targets and verify failed/ignored writes and failed commit roll back both deadlines, with a complete retry. The native fixture uses a controlled level2 character with cap-checked Treatment10/Strength8, a carried clinic, one implant and an unrelated bag item. It right-clicks the clinic after real F1 selection, installs the chest implant, advances that admitted move to its existing deadline, then reloads. The clinic, bag, companion, implant and both absolute deadlines survive page/cold recovery; the installed implant retains its +8 melee AC on the server. This is controlled permission/ownership evidence, not earned progression. Baseline and fixed captures are under local/backpack-clinic/. The accepted run 20261104-064356 completes in17.96s. Independent checks retain the exact page107 request, successful effect/lock, native implant move and all four owned identities. Focused Go checks pass11 roots/43 results; related race checks pass15 roots/52 results in104.218s. Maintained-package vet and JavaScript syntax checks pass. That folder's verification.json records source hashes and the three clean, complete native traces.

Native messages

The ordinary item remains a template proxy. GenericCmd 52526858 success only updates a proxy's inventory state; it does not execute the resource's Use effects. The server therefore follows the acknowledgement with TemplateAction 35505644:

43552,43552,1,1,3,sourcePage,sourceSlot,50000,ownerID

The auxiliary identity selects the effect recipient. It is required for the clinic's target-3 effects. A contained source keeps page107 and the packed session handle/inner slot in both the acknowledgement and TemplateAction; the physical bag ID is not that handle. Known contents remain usable after their carried bag closes. Banked, foreign and unknown bags remain ineligible. The reusable clinic and all companion items stay owned in their original slots. Ordinary placement slots are translated between saved 64..93 and native 48..77, including this message. CharacterAction 5e477770 with body {170,0,0,124,rawSeconds} starts the native Treatment lock; {164,0,0,0,124} clears it. LockSkill's authored function reaches an original client stub, so the explicit server lock response is necessary.

The owner restores active Features 224 bit 0x10 through FullCharacter. StatIIR 2b333d6e clears that bit on authoritative expiry, preserving base value6.

Implant moves use ContainerAddItem 47537a24: source page 104 for installation, page103/absolute implant slot for removal, and destination111 for the first free ordinary slot. TemplateAction6/7 applies/removes the implant bonus using placement103 and the absolute slot33..45. FullCharacter already applies installed implant effects during initialization; another owner wear message would double the bonus. Observers receive one wear action after their SimpleChar snapshot, as with armor.

Stale installed sources

A controlled earlier bank transfer can leave an installed implant visible after its authoritative row is empty. The focused chest101173/QL1 fixture retains its native page103:37 view and MeleeAC+8. A real right-click removal sends ContainerAddItem103:37 ->111 but previously received no reply. Go returns zero packets; the native baseline times out awaiting cancellation. Retained baselines are local/stale-implant-move/baseline.log and local/stale-inventory-move/20261103-234513/37/.

The connection's existing exact unwear cache now also covers installed implants. The empty-source correction sends cancellation146, the exact published action7 once, then row clearing112. It consumes that cached contract without changing ownership or guessing the template from bank contents. Normal installation and removal still require surgery access. Original action6/7 routing is established above and shares the armor receiver.

TestStaleImplantMove checks all13 empty anatomical slots, first/last/automatic ordinary destinations, repeated requests, exact template metadata, zero database writes, cold ownership, forged requests and pending equipment. The short native TestBrowserStaleImplantMove withdraws and reinstalls the same banked implant on the same page, then reconnects. Its cold Go read conserves implant1 at37 and part2 at65, zero cash and allocator2. The16.81-second capture is retained in local/stale-inventory-move/20261103-234700/37/; manual inspection of its Stats windows verifies MeleeAC8 ->0 ->8 and the cleared/restored chest implant icon. All trace error/drop counters are zero. This is controlled stale-view evidence, not earned progression or a resolution of the broader disappearance audit. Focused related checks pass53 roots/397 results, and the race run passes50 results. Vet and driver syntax checks pass. Packet ordering, source hashes and capture hashes are retained in local/stale-implant-move/validation.json.

Evidence

Original kkr.dll SHA-256: a37bc1c15053fdcc5572772309f7074c4f83baffe2faa164df40b059b7c480c0. Addresses use its original base 0x10000000; generated C uses 0x36000000. The retained local/reports/implant-protocol-1491-evidence.json has 136 REA records. Catalog and historical-page extracts are in local/implant-smoke/source-ledger.json and treatment-weights.json. The complete catalog audit, original verification of every family payload, 49 independently re-parsed fixtures, 146 complete native evidence records and 22 complete translated routines are retained in local/implant-catalog-research/.

Finding Original function Evidence ID
Permission gate 10059ba0 ev_984c68d7c48db7c554b9e1980aa680567937286aad254fc0667d4c14434c0099
Implant slot conversion 1002a1f0 ev_178142dff667fea800df25ab5ae2730e84892895651154915ea1bb29f35215d3
Owner initialization 1005f220 ev_1a427a9cc632357b64ee07772afccbc7de2100a84b966a0ecfeb46b5364b7bbf
Clinic restriction effect 100c1730 ev_7a516b3bcdb7faf5d10a93c80663030360858125f5b5705ba96548bdc6a38268
Skill lock installation 10073ae0 ev_96a64081194dab5d44fcfa4d96a4c18476f94d2434ebea56d9229ec484519ed1
Proxy Use dispatch 1005e790 ev_d6fce7cdf8a26b4feb90ba17fcd1711f9ae42241843a86f766749070d244b871
LookAt serialization 1007fd60 ev_26112f2ec7e8d5ffd44d370e8ce17445746b16c22d645f421c6773020a1a8c64

Native 1008e840 establishes the inherited equip delay; stat 2 = 205 is Mass, not a delay. Internal timer signal 128 removes local permission but is not a supported network CharacterAction.

Verification

The full go test ./server/... -count=1 -timeout 20m suite passed in 547.172 seconds. Focused race checks passed in 111.941 seconds; additional malformed contract/default-delay checks passed in 10.203 seconds, and vet was clean. Logs are under local/implant-catalog-checks/.

Tests validate every decoded implant against the independently audited family counts, all 13 install/remove routes, owner/observer placement, identity and cold recovery. They exercise exact Jobe qualities and strict Treatment, ability/title/breed boundaries, multi-slot masks, independent action7 removal, missing action6, authored/inherited delays, whole-item unsupported-effect rejection, full inventory, failed saves and completion-time revalidation. Resource, ability, skill and NCU fixtures apply once and restore their bases; removal clamps HP/nano atomically. Real Jobe fixtures sample signed cooldown modifiers and preserve existing deadlines through gear removal and restart.

Actual GPU/OpenGL Chromium WASM checks are under local/implant-catalog-smoke/. The native UI installs all 13 anatomical slots, shows the exact AC/skill contributions, rejects an occupied leg slot and conserves the original 21 instances. Original Jobe 191026/QL1 produces modifier +5, a raw 600 clinic lock lasting 629 seconds, and raw 40 First Aid lasting 41. Swapping to 191027/QL200 gives -5 without altering either existing deadline; a later First Aid use lasts 38 seconds and a repeat consumes nothing.

Page reload and an actual server restart retain the same instances, modifier -5 and original clinic deadline. Native removal fails after the real 30-second surgery window expires. After a declared GM access-window extension, removing the negative implant and reloading restores modifier 0 while retaining that deadline. Returning all remaining implants to ordinary inventory restores their baseline stats and preserves all 21 instances; only the two actual stim uses reduce its count from 25 to 23. Native snapshots and complete world-stream parsing verify 15 wear and 15 unwear actions, with no owner wear replays during FullCharacter restoration.

Raw player skills and extended surgery access are explicit GM fixtures to permit the long manual run. Cooldown deadlines are never edited. Owned fixtures are removed with FK/integrity checks and unchanged hashes for every unrelated table. Browser runs have no exceptions or adapter failures. Earlier chest/clinic boundary and second-character isolation evidence remains under local/implant-smoke/.