feat: add item appraisal requests to LiveInventoryTracker
RequestId() is called for armor, weapons, jewelry, and other items that need full ID data when picked up via OnCreateObject or OnChangeObject. Adds ObjectClassNeedsIdent helper matching MossyInventory's logic. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
parent
97ace3375a
commit
ac691d3140
1 changed files with 24 additions and 0 deletions
|
|
@ -51,6 +51,12 @@ namespace MosswartMassacre
|
|||
_trackedItemIds.Add(item.Id);
|
||||
var mwo = MyWorldObjectCreator.Create(item);
|
||||
_ = WebSocket.SendInventoryDeltaAsync("add", mwo);
|
||||
|
||||
// Request appraisal if item needs full ID data (spells, combat stats, etc.)
|
||||
if (!item.HasIdData && ObjectClassNeedsIdent(item.ObjectClass, item.Name))
|
||||
{
|
||||
CoreManager.Current.Actions.RequestId(item.Id);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -96,6 +102,12 @@ namespace MosswartMassacre
|
|||
_trackedItemIds.Add(item.Id);
|
||||
var mwo = MyWorldObjectCreator.Create(item);
|
||||
_ = WebSocket.SendInventoryDeltaAsync("add", mwo);
|
||||
|
||||
// Request appraisal if item needs full ID data
|
||||
if (!item.HasIdData && ObjectClassNeedsIdent(item.ObjectClass, item.Name))
|
||||
{
|
||||
CoreManager.Current.Actions.RequestId(item.Id);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -115,6 +127,18 @@ namespace MosswartMassacre
|
|||
_trackedItemIds.Clear();
|
||||
}
|
||||
|
||||
private static bool ObjectClassNeedsIdent(ObjectClass oc, string name)
|
||||
{
|
||||
return oc == ObjectClass.Armor
|
||||
|| oc == ObjectClass.Clothing
|
||||
|| oc == ObjectClass.MeleeWeapon
|
||||
|| oc == ObjectClass.MissileWeapon
|
||||
|| oc == ObjectClass.WandStaffOrb
|
||||
|| oc == ObjectClass.Jewelry
|
||||
|| (oc == ObjectClass.Gem && !string.IsNullOrEmpty(name) && name.Contains("Aetheria"))
|
||||
|| (oc == ObjectClass.Misc && !string.IsNullOrEmpty(name) && name.Contains("Essence"));
|
||||
}
|
||||
|
||||
private static bool IsPlayerInventory(WorldObject item)
|
||||
{
|
||||
try
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue