Interface ILootAutomation
- Namespace
- AcDream.Plugin.Abstractions
- Assembly
- AcDream.Plugin.Abstractions.dll
Looting: finding nearby corpses, opening one, reading what is inside, and moving items out of it into the player's packs. Everything here is scoped to the client's one open external container.
public interface ILootAutomation
Properties
Appraisal
The shared appraisal slot's current state, for polling an Identify(uint) to completion.
PluginAppraisalState Appraisal { get; }
Property Value
CurrentContainerId
The container currently open, or zero when none is.
uint CurrentContainerId { get; }
Property Value
CurrentContentsReady
All listed contents have arrived with their basic item descriptions.
bool CurrentContentsReady { get; }
Property Value
IsAvailable
True when this surface can be used: the session is in the world and the host wired up using, picking up, and appraising.
bool IsAvailable { get; }
Property Value
IsBusy
True while a command here offered right now would come back Busy. Two things put it there: a request of your own already in flight, and the short pacing the client keeps between one use and the next -- opening one corpse straight after closing the last runs into the second. Both mean "not yet" rather than "no": wait for this to read false and ask again rather than counting the refusal as a failed attempt. It never reads false while a command would be refused as busy.
bool IsBusy { get; }
Property Value
LastInventoryCompletion
The server's answer to the last inventory request -- a pickup, move, or similar. Default until something completes.
PluginInventoryCompletion LastInventoryCompletion { get; }
Property Value
LastItemUseCompletion
The server's answer to the last item use, including one this surface sent. Default until something completes.
PluginItemUseCompletion LastItemUseCompletion { get; }
Property Value
RequestedContainerId
The container the client has asked to open and is still waiting for, or zero when nothing is pending.
uint RequestedContainerId { get; }
Property Value
Methods
CaptureCorpses(float)
Lists the corpses lying loose within
maximumDistance metres, nearest first. Corpses held
inside something else are left out. Returns an empty list when the
surface is unavailable or the distance is not a positive number.
IReadOnlyList<PluginLootContainer> CaptureCorpses(float maximumDistance)
Parameters
maximumDistancefloat
Returns
CaptureCurrentContents()
Lists everything inside the currently open container, following into any containers nested in it. Returns an empty list when no container is open.
IReadOnlyList<PluginInventoryItem> CaptureCurrentContents()
Returns
Close(uint)
Closes the open corpse or container: the inverse of Open(uint), through the same use the client's own close sends.
PluginItemCommandResult Close(uint containerObjectId)
Parameters
containerObjectIduint
Returns
Identify(uint)
Identifies an item scoped to loot handling: only the currently open corpse/container's contents, or the corpse itself, is a valid target. Use IWorldObjectAutomation.Identify to assess any object the client can currently see (owned, equipped, landscape, a vendor listing, or open-container content) -- this member exists separately because a loot-sorting plugin should not accidentally identify something outside the container it is currently working.
PluginItemCommandResult Identify(uint objectId)
Parameters
objectIduint
Returns
Open(uint)
Asks the server to open a corpse or other openable container, exactly as using it does. Reports InvalidTarget for an object that is neither, and Busy while another inventory request is in flight. The container's contents arrive later, not from this call.
PluginItemCommandResult Open(uint containerObjectId)
Parameters
containerObjectIduint
Returns
Pickup(uint, bool)
Asks the server to move one item out of the currently open container
and into the player's packs, letting the client choose the pack the
same way its own loot click does; pass true for
mainPack to prefer the main pack. Reports
InvalidItem for anything that is
not in the open container. If no pack has room, the client says so
locally and nothing goes to the server.
PluginItemCommandResult Pickup(uint objectId, bool mainPack = false)
Parameters
Returns
TryCaptureProperties(uint, out PluginItemProperties)
Reads the property tables the client holds for one item inside the currently open container. Returns false when no container is open or the object is not in it -- use the object surface to read anything else.
bool TryCaptureProperties(uint objectId, out PluginItemProperties properties)
Parameters
objectIduintpropertiesPluginItemProperties