From a19ee1904e422409027e62f74f6219d103e62b40 Mon Sep 17 00:00:00 2001 From: Tom Bohar Date: Sun, 27 Sep 2026 00:26:18 -0400 Subject: [PATCH] RynthSuite as of 2026-09-27 (internal e52ccc8): Damage tab learns only from fightable creatures Co-Authored-By: Claude Opus 5.5 --- .../Combat/CombatManager.cs | 3 +++ .../RynthCore.Plugin.RynthAi/RynthAiPlugin.cs | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Plugins/RynthCore.Plugin.RynthAi/Combat/CombatManager.cs b/Plugins/RynthCore.Plugin.RynthAi/Combat/CombatManager.cs index a641dda..a477960 100644 --- a/Plugins/RynthCore.Plugin.RynthAi/Combat/CombatManager.cs +++ b/Plugins/RynthCore.Plugin.RynthAi/Combat/CombatManager.cs @@ -692,8 +692,11 @@ public class CombatManager : IDisposable // Cache name->wcid (once per type) for AOE kill attribution (tier 5): a mob wiped // by an area cast we never directly fought is credited by matching its death message. + // Attackable only — this runs before the attackable filter below, so an NPC the + // cache misclassifies as a monster could otherwise be credited kills (Damage tab). if (!string.IsNullOrEmpty(wo.Name) && _seenMonsterNameToWcid.Count < 256 && !_seenMonsterNameToWcid.ContainsKey(wo.Name) + && (!_host.HasObjectIsAttackable || _host.ObjectIsAttackable((uint)wo.Id)) && _host.HasGetObjectWcid && _host.TryGetObjectWcid((uint)wo.Id, out uint scanWcid) && scanWcid != 0) _seenMonsterNameToWcid[wo.Name] = scanWcid; diff --git a/Plugins/RynthCore.Plugin.RynthAi/RynthAiPlugin.cs b/Plugins/RynthCore.Plugin.RynthAi/RynthAiPlugin.cs index 8c85664..4838f8a 100644 --- a/Plugins/RynthCore.Plugin.RynthAi/RynthAiPlugin.cs +++ b/Plugins/RynthCore.Plugin.RynthAi/RynthAiPlugin.cs @@ -1559,10 +1559,25 @@ public sealed partial class RynthAiPlugin : RynthPluginBase // Capture observed creature data into the persistent store. maxHealth>0 means // we just got a successful CreatureProfile (Assess succeeded) — the only time // we have authoritative max vitals + resists. - if (targetId != _playerId && maxHealth > 0) + if (targetId != _playerId && maxHealth > 0 && IsFightableCreature(targetId)) CaptureCreatureSample(targetId, maxHealth); } + /// + /// Something you can fight — what the Damage tab and creatures.json should learn from. + /// Appraising an NPC, a vendor, another player or your own pet also returns health, and + /// each one used to become a Damage-tab row (and a creatures.json entry). The attackable + /// check also catches NPCs the object cache classifies as monsters. + /// + private bool IsFightableCreature(uint objectId) + { + WorldObject? obj = _objectCache?[unchecked((int)objectId)]; + if (obj != null && obj.ObjectClass is AcObjectClass.Npc or AcObjectClass.Vendor + or AcObjectClass.Player or AcObjectClass.CombatPet) + return false; + return !Host.HasObjectIsAttackable || Host.ObjectIsAttackable(objectId); + } + // Exact per-hit damage from the engine (AttackerNotification 0x01B1). This is // the only selection-free source of real damage numbers — combat uses it to // learn per-monster damage and predict kill shots. isAttacker==true = our hit.