aorecomp

Anarchy Online classic in the browser

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


commit a812ce7419bb182813af3baf65873adcb1aa69e1
parent 5c77dadf28e5584cce6040a526c4c2e8a9d5c8df
Author: anon <anon@example.com>
Date:   Thu, 22 Oct 2026 06:04:32 +0000

Recover native corpse animation and use protocol

Diffstat:
Mdocs/corpse-loot.md | 57+++++++++++++++++++++++++++++++++++++++++++++++++++------
1 file changed, 51 insertions(+), 6 deletions(-)

diff --git a/docs/corpse-loot.md b/docs/corpse-loot.md @@ -1,9 +1,10 @@ # Corpse and loot protocol research This is partial 14.9.1 protocol recovery, not implemented server loot support. -An isolated WASM fixture displays a named corpse's loot window with QL 1 -Monster Parts. Its replacement corpse geometry remains invisible, so opening -the corpse through normal world interaction still needs verification. +An isolated WASM fixture renders a fallen Leet, accepts native selection, +inspection and right-click use, and displays its named loot window with QL 1 +Monster Parts. Production corpse creation, use handling and transfers remain +to be implemented. ## Corpse creation @@ -26,7 +27,8 @@ specified otherwise: 5. Extra-data byte length and raw bytes. A NUL-terminated name here supplies `Remains of Loot Target` in the verified fixture. 6. Lockable version 2, lock field, encoded identity list; Chest version 3. -7. Encoded spell/effect list, original actor identity, encoded ClothData list. +7. Encoded creation-event function list, original actor identity, encoded + ClothData list. 8. Additional-texture-list presence integer and optional texture list. 9. Team, loot mode, looter identity, XP reward count and optional reward entries. @@ -34,11 +36,54 @@ The SimpleItem reader and activation are `sub_360B2440` and `sub_360B2830`. The raw name is applied by `sub_36090D90` and returned by `sub_36090DF0`. An empty name falls back to template lookup and can produce `NameMissing`. ClothData is clothing data, not a replacement for the corpse's base mesh. -The appearance stats and native world interaction remain unresolved; merely -sending the living creature's mesh stat does not establish a visible corpse. +The creature's model belongs in stat 42 (`CATMesh`), with breed, sex and race +in stats 4, 59 and 89. The verified Leet fixture uses model 15222, breed 6, +sex 1, race 1, static mesh stat 12 equal to zero, scale stat 360 equal to 100, +and CanChangeClothes stat 223 equal to zero. Merely copying MonsterData's +mesh stat 12 into a SimpleItem does not establish an animated corpse. + +## Creation animation + +`sub_360AF9C0` reads the creation-event function list through `sub_360BD000` +into event 10. Its length is `(count + 1) * 1009`. An empty list leaves the +animated mesh without an animation: `bbr.dll` `VisualCATMesh_t::RunFunction` +(`0x25096dd0`) returns -1 for an empty animation list, and `llr.dll` +`n3VisualDynel_t::Run` (`0x3803d500`) substitutes `default_mesh.abiff`. +Native WASM tracing confirmed successful model creation followed by this +replacement, independently of the loot-window update. + +One animation function prevents that replacement and holds the death pose. +After the list length 2018, the verified Leet function has these uint32 words: + +| Field | Value | +| --- | --- | +| Function identity type, instance | 53003, 0 | +| Function version, requirement count | 4, 0 | +| Common arguments 3, 4, 32, 35 | 1, 0, 0, 0xffffffff | +| Target type, target instance | 51050, corpse ID | +| Animation resource | 18107 | +| Base-animation flag, argument 11 | 1, 0 | + +Reader `sub_360B9530` establishes version 4 and this argument order for type +53003. Dispatch `sub_360BE8E0` calls `sub_360BD850`; its base-animation branch +calls `sub_36018550`, which sets both animation start and stop to the resource's +total time and starts it. Resource 18107 is the Leet's +`cutecreature_die-pain_01_01.ani`, obtained from MonsterData 17655's key 6000. +The creation function takes a resource ID, whereas the living actor's death +action takes the MonsterData animation key. This wire-only fixture kept the +correct fallen model visible without changing maintained client code. ## Contents and pickup +Native right-click use emits `GenericCmdIIR_t` (`0x52526858`). Its body is +eight uint32 words: `0, sequence, 3, 1, 50000, playerID, 51050, corpseID`. +The request was captured by selecting and right-clicking the rendered Leet. +Closing its loot window and then using the corpse again emitted the same +layout with successive sequence values 1, 2 and 3. The close/open state and +acknowledgement still need recovery before implementing the use handler. +In scripted WASM input, settle mouse motion before pressing the button so the +native world picker uses the intended cursor position. + `InventoryUpdateIIR_t` (`0x4e536976`) starts directly with the encoded item list, using `(count + 1) * 1009`. There is no slot-count prefix in this client. Each 32-byte entry is slot, uint16 flags, uint16 count, item identity, low/high