feat(combat): port retail held weapon parenting
Select the default combat mode from ordered equipped objects so bows request missile stance. Parse CreateObject parent metadata and ParentEvent, then render held objects as separate children composed from setup holding locations and placement frames each animation tick.
This commit is contained in:
parent
564d39dfea
commit
ab6d96d113
18 changed files with 1152 additions and 17 deletions
|
|
@ -122,6 +122,12 @@ public static class CreateObject
|
|||
// L.2g S1 (DEV-6): ObjectMovement stamp (timestamp block index 1)
|
||||
// seeds MotionSequenceGate's MOVEMENT_TS at spawn.
|
||||
ushort MovementSequence = 0,
|
||||
// Parent/placement bootstrap for equipped child objects. These are
|
||||
// the CreateObject equivalents of ParentEvent 0xF749.
|
||||
ushort PositionSequence = 0,
|
||||
uint? ParentGuid = null,
|
||||
uint? ParentLocation = null,
|
||||
uint? PlacementId = null,
|
||||
uint? PhysicsState = null,
|
||||
uint? ObjectDescriptionFlags = null,
|
||||
// L.3b (2026-04-30): per-object friction + elasticity from the
|
||||
|
|
@ -522,6 +528,10 @@ public static class CreateObject
|
|||
physicsState = BinaryPrimitives.ReadUInt32LittleEndian(body.Slice(pos));
|
||||
pos += 4;
|
||||
|
||||
uint? placementId = null;
|
||||
uint? parentGuid = null;
|
||||
uint? parentLocation = null;
|
||||
|
||||
if ((physicsFlags & PhysicsDescriptionFlag.Movement) != 0)
|
||||
{
|
||||
// u32 length, length bytes of serialized MovementData (no header
|
||||
|
|
@ -543,6 +553,7 @@ public static class CreateObject
|
|||
else if ((physicsFlags & PhysicsDescriptionFlag.AnimationFrame) != 0)
|
||||
{
|
||||
if (body.Length - pos < 4) return null;
|
||||
placementId = BinaryPrimitives.ReadUInt32LittleEndian(body.Slice(pos));
|
||||
pos += 4;
|
||||
}
|
||||
|
||||
|
|
@ -593,7 +604,9 @@ public static class CreateObject
|
|||
if ((physicsFlags & PhysicsDescriptionFlag.Parent) != 0)
|
||||
{
|
||||
if (body.Length - pos < 8) return null;
|
||||
pos += 8; // wielderId u32 + parentLocation u32
|
||||
parentGuid = BinaryPrimitives.ReadUInt32LittleEndian(body.Slice(pos));
|
||||
parentLocation = BinaryPrimitives.ReadUInt32LittleEndian(body.Slice(pos + 4));
|
||||
pos += 8;
|
||||
}
|
||||
if ((physicsFlags & PhysicsDescriptionFlag.Children) != 0)
|
||||
{
|
||||
|
|
@ -643,6 +656,7 @@ public static class CreateObject
|
|||
if (body.Length - pos < 9 * 2) return PartialResult();
|
||||
var seqSpan = body.Slice(pos, 9 * 2);
|
||||
ushort instanceSeq = BinaryPrimitives.ReadUInt16LittleEndian(seqSpan.Slice(8 * 2));
|
||||
ushort positionSeq = BinaryPrimitives.ReadUInt16LittleEndian(seqSpan.Slice(0 * 2));
|
||||
ushort movementSeq = BinaryPrimitives.ReadUInt16LittleEndian(seqSpan.Slice(1 * 2));
|
||||
ushort teleportSeq = BinaryPrimitives.ReadUInt16LittleEndian(seqSpan.Slice(4 * 2));
|
||||
ushort serverControlSeq = BinaryPrimitives.ReadUInt16LittleEndian(seqSpan.Slice(5 * 2));
|
||||
|
|
@ -984,8 +998,14 @@ public static class CreateObject
|
|||
textureChanges, subPalettes, basePaletteId, objScale, name, itemType, motionState, motionTableId,
|
||||
instanceSeq, teleportSeq, serverControlSeq, forcePositionSeq,
|
||||
movementSeq,
|
||||
physicsState, objectDescriptionFlags,
|
||||
friction, elasticity,
|
||||
PositionSequence: positionSeq,
|
||||
ParentGuid: parentGuid,
|
||||
ParentLocation: parentLocation,
|
||||
PlacementId: placementId,
|
||||
PhysicsState: physicsState,
|
||||
ObjectDescriptionFlags: objectDescriptionFlags,
|
||||
Friction: friction,
|
||||
Elasticity: elasticity,
|
||||
IconId: iconId,
|
||||
Useability: useability, UseRadius: useRadius, TargetType: targetType,
|
||||
IconOverlayId: iconOverlayId, IconUnderlayId: iconUnderlayId,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue