feat(sdk): publish npc type id on NearbyNpc

Filters written as npc.id === configId were comparing undefined === n and
failing silently - NearbyNpc only carried the world slot (index) and name,
unlike every other published entity. Surface NpcType.id (npc.pack config
id) on both the collector and the SDK type.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
max bittkerandClaude Fable 5 committed 2026-08-12 12:35:26 -04:00
1 parent e4cb65ec47
commit 931ebe0514
3 files changed
+11

No files matched your search

+5
View File
@@ -78,6 +78,11 @@ export interface NpcOption {
export interface NearbyNpc {
/** Discriminator so npc and player targets can share one API. */
kind: 'npc';
/**
* NPC type/config id (matches server/content npc.pack). Not the world
* slot - interact packets address `index`.
*/
id: number;
index: number;
name: string;
combatLevel: number;
@@ -951,6 +951,7 @@ export class BotStateCollector implements ScanProvider {
npcs.push({
kind: 'npc',
id: npcType.id,
index: npcIndex,
name: npcType.name || 'Unknown',
combatLevel: npcType.vislevel || 0,
+5
View File
@@ -70,6 +70,11 @@ export interface NpcOption {
export interface NearbyNpc {
/** Discriminator so npc and player targets can share one API. */
kind: 'npc';
/**
* NPC type/config id (matches server/content npc.pack). Not the world
* slot - interact packets address `index`.
*/
id: number;
index: number;
name: string;
combatLevel: number;