fix(client/netproto): align 1.13c monster/NPC mode decoding and prevent initial death state (#551) #553
Loading…
Reference in New Issue
No description provided.
Delete Branch "fix/issue-551-npc-initial-death-mode"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Closes #551
Fixes monsters and camp NPCs (e.g. Rogue Scout
act1hire,classId=564, and CharsiclassId=154) initially or intermittently rendering in a death/corpse pose (MONMODE_DEATH = 0/MONMODE_DEAD = 12).1.13c Ground Truth Verification & Changes
0xAC AssignNPCBitstream Mode & Initial Facing (D2Game.dll0x6fcaca40/D2Client.dll0x6fb5e420):D2Game.dll(0x6fcacac9..0x6fcacb01) andD2Client.dll(0x6fb5e462), the first 4 bits of the0xACbitstream atpkt[13]encode the initial monster modenMode(0=DT,8=SQ,9=KB,12=DD, or1=NUfor all other alive modes), applied viaD2Common_11090(UNITS_ChangeCurrentMode).0x6ac690c5inD2CLIENT_InitMonsterUnit(0x6fafd512..0x6fafd59c).0x69/0x6A/0x6BState Command Mapping &lifePctGuard (D2Game.dll0x6fd13620&0x6fd1a718/D2Client.dll0x6fafdc70&0x6fb82e68):pkt[5](0..29) through the 30-entryMONSTER_CMD_TO_MODEtable atD2Client.dll0x6fb82e68(0x06 -> 3 GH,0x07 -> 1 NU,0x08 -> 0 DT,0x09 -> 12 DD,0x0A/0x0B -> 4 A1,0x0C/0x0D -> 8 SQ,0x10/0x11 -> 5 A2,0x04/0x05 -> 7 SC, etc.).D2Game.dll0x6fd13829andD2Client.dll0x6fafe16c/0x6fafe298,pkt[10]/pkt[11]only carrieslifePcton0x06(GH) or0x08/0x09(DT/DD), preventing non-death commands withparamByte = 0(such as Charsi's0x6Banvil sequence0x0C) from zeroing outunit.lifePct.ClientUnit,ClientWorld,OnlineSession,unit-drawables,world-renderer):lifePct > 0) and players default tomode = 1(NU) instead of0(DT), while dead monsters (lifePct <= 0) default to12(DD).UnitMove(0x67/0x68/0x6D/0x0F/0x0D) andOnlineSession.tick()/buildRenderableUnits()synchronize movement modes (2walk,15/3run,9/19knockback) and return to1(NU) upon stopping.Verification
npx vitest run tests/netproto/d2gs-s2c.test.ts tests/client/client-world.test.ts tests/client/unit-facing-motion.test.ts tests/client/drlg-map-motion.test.ts tests/client/spawn-position-539.test.tsnpx tsc --noEmit59435527b0to45aa95ce2dPull request closed