diff --git a/src/AcDream.Core.Net/GameEventWiring.cs b/src/AcDream.Core.Net/GameEventWiring.cs index be38076..81d741b 100644 --- a/src/AcDream.Core.Net/GameEventWiring.cs +++ b/src/AcDream.Core.Net/GameEventWiring.cs @@ -151,5 +151,19 @@ public static class GameEventWiring if (p is not null) items.MoveItem(p.Value.ItemGuid, p.Value.ContainerGuid, newSlot: (int)p.Value.Placement); }); + dispatcher.Register(GameEventType.IdentifyObjectResponse, e => + { + var p = AppraiseInfoParser.TryParse(e.Payload.Span); + if (p is null || !p.Value.Success) return; + // Merge parsed properties into the item if we know about it. + if (items.GetItem(p.Value.Guid) is not null) + items.UpdateProperties(p.Value.Guid, p.Value.Properties); + // Spell book from appraise: for ITEMS (caster / scrolls) this + // lists cast-on-use effects; for players (PlayerDescription) + // it's the whole learned spellbook. Both mutate the spellbook + // by adding any not-yet-known ids. + foreach (uint sid in p.Value.SpellBook) + spellbook.OnSpellLearned(sid); + }); } }