feat(items): port retail shared cooldown overlays

Preserve public shared-cooldown metadata, resolve the authoritative cooldown enchantment with retail expiry semantics, and project the exact ten DAT-authored radial steps through the shared retained item-slot architecture.

Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
Erik 2026-07-23 10:41:16 +02:00
parent 19e8863f4e
commit 6b1ae4fb76
27 changed files with 875 additions and 20 deletions

View file

@ -210,6 +210,11 @@ public static class CreateObject
// PublicWeenieDesc._spellID, gated by PWD_Packed_SpellID. The packed
// wire field is u16 and widens into retail's u32 runtime member.
uint? SpellId = null,
// PublicWeenieDesc second-header cooldown metadata. The group id is
// compared against the player's cooldown enchantment list; the
// duration scales the shared UIItem radial countdown.
uint? CooldownId = null,
double? CooldownDuration = null,
// Complete immutable PhysicsDesc projection. Kept alongside the
// legacy convenience fields while live-entity ownership migrates to
// LiveEntityRuntime in Step 2.
@ -871,6 +876,8 @@ public static class CreateObject
uint uiEffects = 0;
uint weenieFlags2 = 0;
uint? petOwnerId = null;
uint? cooldownId = null;
double? cooldownDuration = null;
try
{
// BF_INCLUDES_SECOND_HEADER = 0x04000000 per acclient.h:6458
@ -1075,11 +1082,12 @@ public static class CreateObject
if ((weenieFlags2 & 0x00000002u) != 0) // CooldownId u32
{
if (body.Length - pos < 4) throw new FormatException("trunc CooldownId");
pos += 4;
cooldownId = ReadU32(body, ref pos);
}
if ((weenieFlags2 & 0x00000004u) != 0) // CooldownDuration f64
{
if (body.Length - pos < 8) throw new FormatException("trunc CooldownDuration");
cooldownDuration = BinaryPrimitives.ReadDoubleLittleEndian(body.Slice(pos));
pos += 8;
}
if ((weenieFlags2 & 0x00000008u) != 0) // PetOwner u32
@ -1119,6 +1127,8 @@ public static class CreateObject
PetOwnerId: petOwnerId,
AmmoType: ammoType,
SpellId: spellId,
CooldownId: cooldownId,
CooldownDuration: cooldownDuration,
Physics: physics);
}
catch