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

@ -625,9 +625,28 @@ public sealed class CreateObjectTests
var parsed = CreateObject.TryParse(body);
Assert.NotNull(parsed);
Assert.Equal(11u, parsed.Value.CooldownId);
Assert.Equal(12.5, parsed.Value.CooldownDuration);
Assert.Equal(0x50000001u, parsed.Value.PetOwnerId);
}
[Fact]
public void WeenieHeader_absentCooldownFields_remainNull()
{
byte[] body = BuildMinimalCreateObjectWithWeenieHeader(
guid: 0x50000026u,
name: "Ordinary Stone",
itemType: (uint)ItemType.Misc,
objectDescriptionFlags: 0x04000000u,
weenieFlags2: 0u);
var parsed = CreateObject.TryParse(body);
Assert.NotNull(parsed);
Assert.Null(parsed.Value.CooldownId);
Assert.Null(parsed.Value.CooldownDuration);
}
[Fact]
public void WeenieHeader_spellId_isPreservedForCasterEndowment()
{

View file

@ -66,6 +66,8 @@ public sealed class ObjectTableWiringTests
AmmoType = 1,
PluralName = "Iron Swords",
PetOwnerId = 0x50000001u,
CooldownId = 42u,
CooldownDuration = 30d,
};
var d = ObjectTableWiring.ToWeenieData(spawn);
@ -114,6 +116,8 @@ public sealed class ObjectTableWiringTests
Assert.Equal((ushort)1, d.AmmoType);
Assert.Equal("Iron Swords", d.PluralName);
Assert.Equal(0x50000001u, d.PetOwnerId);
Assert.Equal(42u, d.CooldownId);
Assert.Equal(30d, d.CooldownDuration);
}
[Fact]