aorecomp

Anarchy Online classic in the browser

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


docs/treatment-kit.md (7444B)


Treatment Laboratory

Supported labs are Treatment Laboratory 25812/QL1, 25811/QL200, 160277/QL400 and Startup Treatment Laboratory 116628/QL1. Shared catalog decoding and the startup kit's combined 15-HP/15-nano recovery are described in medical consumables. The following reference is Treatment Laboratory25812, QL1, from the selected 14.9.1 database. Its record is at offset128476411 with payload SHA256 216cf2dc3a20028e17b718895a17f7ae746f6912192ba37d374086f4279e9dff.

Authored behavior and native interpretation

The laboratory carries 50 charges. Use3 restores exactly 30 Health27 to the selected patient, runs graphics13600, and locks the patient's Treatment124 for 15 seconds. Range is3 and AttackDelay is0. SkillTimeOnSelectedTarget371 is1; native kkr.dll 1008ede0 rewrites SkillTime53033 targets to3 for this setting. Activate's AddSkill53028 initializes the item's skill metadata; it does not grant a character Treatment bonus.

The Use3 expression checks the user's Treatment greater than7, combat410 equal to0 and target-mask431 against35. Operator18 switches context to the selected patient, who must have Sitting430 equal to2 and combat410 equal to0. The repeated combat test before the switch still refers to the user. The healer can stand while treating a sitting patient. Self-use requires sitting because user and patient are the same actor.

Stat410's original short and long names are IsFightingMe and Number of fighting opponents. These are separate registry entries for the same ID, at original 10031ca2 and 100366ca, rather than conflicting stats. The client stores the replicated value; its original server producer is unknown. This reconstruction treats either an outgoing attack or an active incoming attacker as combat, for both user and patient. The shipped cd_image/text/tips/LookatStartupTreatmentLaboratory.txt describes treatment after combat. A September2001 PvP account also reports kit restrictions after the attack bar became inactive, but does not establish exact14.9.1 PvM combat expiry rules.

The recovered ordinary right-click Use3 resource predicate 1008fda0 does not itself query skill locks. UseOnCharacter32 has a separate lock predicate 10090210; it is not proof of ordinary Use3 GUI behavior. The server enforces the authored patient lock. No recovered evidence justifies additionally rejecting a standing healer whose own Treatment is locked when the selected patient is unlocked.

Server and persistence

Accepted use commits the source charge, the patient's absolute lock deadline in skill_locks, and the recipient's clamped health and any authored nano gain together in one SQLite transaction. Only after commit does the server publish the in-memory inventory, health and lock and acknowledge success. Different patients have independent deadlines in the same 15-second interval. Expired entries are ignored on startup and overwritten on the next accepted treatment. Clinics and laboratories share the same patient Treatment124 row, so either blocks the other until expiry. Modifier scaling, reconnect and expiry notification use shared skill-lock rules.

Native proxy success consumes the charge; TemplateAction3 supplies the item graphics to ready observers. HealthDamage carries the authoritative clamped health with zero feedback delta. Use is rejected during incoming or outgoing combat, where absolute HP could otherwise conflict with queued weapon results. Ordinary stop/death/disconnect paths retain their existing queue-flush behavior. Treatment does not interrupt combat to heal. Starting an attack also clears the server's sitting state, matching native AttackIIR 10078fc0 and its sitting-controller exit. This keeps posture validation correct after combat ends.

The item has Eat and Stackable, but lacks the stims' UseEmptyDestruct flag. Native count helper 1005e790 decrements independently of that flag and emits ItemRemoved at zero. The row getter returns zero exactly; resource validation can still see the template's positive capacity, so retaining the empty row permits ushort underflow on another accepted ACK. Explicit CharacterAction112 completes the last-charge removal. The supported kit also participates in the existing matching-template split/join paths.

Limits and verification

The exact original server producer and expiry rules for combat410 remain unrecovered. Full-health consumption is an implementation policy: there is no full-health rejection in the authored expression. Friendly-player permissions retain the nano kit's connected-player server subset and the native client's stricter team gate. NPC/PvP categories, direct use inside backpacks and general stack merge limits remain outside this milestone. Health-restoring First Aid remains blocked by its separate combat delivery problem; see First Aid research.

Go tests cover exact healing, posture, skill, range, both combat directions for healer and patient, shared clinic locks, replay/concurrent requests, failed saves, closed-owner output, multiple patient locks across startup, clamping, final-charge removal and exact expiry. Manual WASM verification is recorded under local/treatment-kit-smoke/.

The first WASM run verified standing rejection without consumption, sitting self-use from200 to230 HP with50 to49 charges, and rejection during the Treatment lock. An incoming-only Leet attack left the player's own attack target empty while treatment consumed nothing; a read-only probe confirmed a pending incoming weapon result during this check. A standing healer then treated a sitting native teammate from10 to its37-HP maximum, consuming 49 to48 charges and locking only the patient. An immediate repeat consumed nothing. Recipient native health and its mirror both reached37.

Ctrl-click split48 charges into1 and47. After clearing the held-item/target interaction and selecting self again, the single charge clamped server health921 to922, removed its native row, and preserved the47-charge stack. Lowering effective Treatment to7 produced the native requirement message without consuming anything. A healer attacking the Leet also failed to consume a charge when treating the sitting teammate. The test verifier asserts the retained states and read-only native traces. Both clients closed without a page or missing-adapter error.

The fixture disabled server regeneration to isolate the laboratory's authoritative30-HP gain. Native client regeneration continued independently: self-use briefly synchronized both native health fields to230, followed by a separate native15-HP sitting tick. These ticks are not laboratory healing; the fixture does not establish continuous regeneration synchronization.

A fresh build verified the attack-posture correction. Before attacking, server sitting was true and native430 was2. Attack start changed them to false and0 respectively. After stopping combat, standing self-use retained all47 charges. This run also closed without client errors.

The full go test ./server/... suite passed after the posture correction. Three race-detector repetitions of treatment, portable-clinic, stack and attack-posture tests also passed. All test-owned clients and servers were closed before the final automated checks, and the temporary WASM fixture binary was removed after recording its SHA256.