From 0943058ab02f9f891f5a8252426988af62c939b9 Mon Sep 17 00:00:00 2001 From: BlankenshipG Date: Sun, 4 Oct 2026 22:38:55 -0400 Subject: [PATCH] feat(engine): serve IconOverlay/IconUnderlay DID properties from the PWD Co-authored-by: Cursor --- .../2026-10-04-pet-scan-type-detection.md | 44 +++++++++++++++++++ .../Compatibility/ClientObjectHooks.cs | 13 +++--- .../Plugins/PluginContract.cs | 4 +- src/RynthCore.PluginSdk/RynthCoreHost.cs | 5 ++- 4 files changed, 56 insertions(+), 10 deletions(-) create mode 100644 Changelog/2026-10-04-pet-scan-type-detection.md diff --git a/Changelog/2026-10-04-pet-scan-type-detection.md b/Changelog/2026-10-04-pet-scan-type-detection.md new file mode 100644 index 0000000..405155b --- /dev/null +++ b/Changelog/2026-10-04-pet-scan-type-detection.md @@ -0,0 +1,44 @@ +# Pet scan: detect pets by type, not by "Essence" in the name + +**Date:** 2026-10-04 +**Components:** RynthAi plugin 0.6.26 (RynthSuite), RynthCore Engine / PluginSdk (next installer, 2026.10.4.19) + +## Problem + +The ILT Hub **Pet** tab (roster, **Scan pack**, heal-pet lookup, Mini Remote pet line) counted +any carried item whose name ended in ` Essence` as a combat pet. Augmentation gems and other +non-pet items with that suffix (for example "Jibril's Essence") showed up in the roster and got +appraised by Scan pack. + +## Fix + +### RynthAi — `IltHub/IltPets.cs` +- New `IsPetDevice(WorldObject)` decides by item type: + - **Never pets:** Encapsulated Spirit, the charm block (78780030–78780089), capture + devices (78780001–78780012) and the summoned combat pet creature block (787802001–787802072). + - **Pets:** + - the ACECustom combat essence WCID block (787801001–787801072); + - the summoning-gem icon underlay (DID 0x06007420), which needs no appraisal; + - `UseRequiresSkill` / `UseRequiresSkillSpec` = Summoning (54); + - ACECustom `BondLevel` (9053) > 0 or `PotencyStored` (9056) present. + - **Name hints only nominate items.** A name ending in " Essence", Healing Buddy / Dule box, + stamina buddy/crate/pet, or cosmetic/plush/display pet only makes an item a candidate. + It counts as a pet once it shows charges (`MaxStructure` > 0), matching UtilityBelt's pet scan. +- `ClassifyKind` now requires `IsPetDevice`. After that, naming picks the type: heal naming + → Healing, cosmetic naming → Cosmetic, otherwise Combat. Manual re-types ("Add sel." / + right-click) and the ticked heal pet still win. +- **Scan pack** appraises every confirmed pet and also any un-appraised pet-named candidate, + so its type can be confirmed or ruled out. The chat line reports both counts. The 2 s + background trickle also appraises candidates, two per scan. + +### Engine / SDK +- `ClientObjectHooks.TryGetObjectDataIdProperty` now serves `IconOverlay` (50, PWD+20) and + `IconUnderlay` (52, PWD+24) as well as `Icon` (8). This is the same network-populated + PublicWeenieDesc read, so it works on never-appraised pack items. No API version change: + older engines just return false for 50/52, and the plugin falls back to the appraisal-based + signals. + +## Notes +- Without the new engine, a real pet whose WCID is outside the essence block appears once its + appraisal lands (via Scan pack or the background trickle) instead of right away. +- Versions: RynthAi `0.6.25` → `0.6.26`. diff --git a/src/RynthCore.Engine/Compatibility/ClientObjectHooks.cs b/src/RynthCore.Engine/Compatibility/ClientObjectHooks.cs index 0708301..b8e4812 100644 --- a/src/RynthCore.Engine/Compatibility/ClientObjectHooks.cs +++ b/src/RynthCore.Engine/Compatibility/ClientObjectHooks.cs @@ -2044,10 +2044,9 @@ internal static class ClientObjectHooks /// network-populated, so this works on UNequipped items with no qualities pointer /// and no appraisal — no main-thread native call (the weenie ptr is served from /// the off-thread double-buffered snapshot when not on AC's main thread). - /// Supported stype: Icon=8 (PWD._iconID at +16). Layout per the _type reader - /// above: WeenieDesc(4) + _name(4) + _plural_name(4) + _wcid(4) = 16 → _iconID. - /// (Generic switch so _iconOverlayID(+20) / _iconUnderlayID(+24) can extend it - /// later without a new bridge.) + /// Supported stypes: Icon=8, IconOverlay=50, IconUnderlay=52. Layout per the _type + /// reader above: WeenieDesc(4) + _name(4) + _plural_name(4) + _wcid(4) = 16 → _iconID, + /// then _iconOverlayID(+20) and _iconUnderlayID(+24). /// public static bool TryGetObjectDataIdProperty(uint objectId, uint stype, out uint dataId) { @@ -2055,8 +2054,10 @@ internal static class ClientObjectHooks int pwdFieldOffset = stype switch { - 8 => 16, // PropertyDataId.Icon → _iconID - _ => -1, + 8 => 16, // PropertyDataId.Icon → _iconID + 50 => 20, // PropertyDataId.IconOverlay → _iconOverlayID + 52 => 24, // PropertyDataId.IconUnderlay → _iconUnderlayID + _ => -1, }; if (pwdFieldOffset < 0) return false; diff --git a/src/RynthCore.Engine/Plugins/PluginContract.cs b/src/RynthCore.Engine/Plugins/PluginContract.cs index bf8c966..7701407 100644 --- a/src/RynthCore.Engine/Plugins/PluginContract.cs +++ b/src/RynthCore.Engine/Plugins/PluginContract.cs @@ -585,8 +585,8 @@ internal struct RynthCoreAPI public IntPtr SendPluginCommandFn; /// Function pointer: int GetObjectDataIdProperty(uint objectId, uint stype, uint* value) - /// Reads a STypeDID property that lives in the object's PublicWeenieDesc (currently Icon=8 → - /// _iconID). Read directly from the embedded PWD struct — network-populated, so it works on + /// Reads a STypeDID property that lives in the object's PublicWeenieDesc (Icon=8 → _iconID, + /// IconOverlay=50 → _iconOverlayID, IconUnderlay=52 → _iconUnderlayID). Read directly from the embedded PWD struct — network-populated, so it works on /// UNequipped/never-appraised pack items with no qualities pointer and no main-thread native /// call. Returns 1 on success (value = the DataID, e.g. 0x06xxxxxx), 0 otherwise. Requires API /// v65+. APPENDED-AT-END for ABI safety. diff --git a/src/RynthCore.PluginSdk/RynthCoreHost.cs b/src/RynthCore.PluginSdk/RynthCoreHost.cs index 6da015a..c134889 100644 --- a/src/RynthCore.PluginSdk/RynthCoreHost.cs +++ b/src/RynthCore.PluginSdk/RynthCoreHost.cs @@ -847,8 +847,9 @@ public readonly unsafe struct RynthCoreHost } /// - /// Reads a STypeDID property that lives in the object's PublicWeenieDesc — currently - /// Icon=8 (→ _iconID, e.g. 0x06xxxxxx). Works on UNequipped/never-appraised pack items + /// Reads a STypeDID property that lives in the object's PublicWeenieDesc — Icon=8, and on + /// engines 2026.10.4.19+ also IconOverlay=50 / IconUnderlay=52 (0x06xxxxxx; older engines + /// return false for those). Works on UNequipped/never-appraised pack items /// (PWD is network-populated; no qualities pointer or appraisal required). Returns false /// when the engine predates API v65 or the read fails. ///