Interface ICombatAutomation
- Namespace
- AcDream.Plugin.Abstractions
- Assembly
- AcDream.Plugin.Abstractions.dll
Finds things to fight and drives physical attacks. A physical attack is two steps, as it is for the user: begin it, which starts the power bar charging, and release it, which actually swings.
public interface ICombatAutomation
Properties
Snapshot
The current combat state. Reads as its default value when the session is not in the world.
PluginCombatSnapshot Snapshot { get; }
Property Value
Methods
AbortPhysicalAttack()
Calls off the attack in progress, including any repeating one, without swinging. Safe to call when nothing is running.
PluginCombatCommandResult AbortPhysicalAttack()
Returns
AcquireCombatControl()
Temporarily disables automatic target replacement and repeat attacks. Dispose when the caller stops directing combat; saved options are unchanged.
IDisposable? AcquireCombatControl()
Returns
BeginPhysicalAttack(uint, PluginAttackHeight, float)
Selects the target and begins a physical attack at the given height and power (0 to 1, clamped), the same as holding the attack button down. Reports InvalidTarget for anything that is not an attackable creature, WrongMode when the stance cannot make a targeted attack, and Busy while an earlier attack is still running. A Refused result carries a short reason in Notice when the host has one. Finish it with ReleasePhysicalAttack().
PluginCombatCommandResult BeginPhysicalAttack(uint targetObjectId, PluginAttackHeight height, float power)
Parameters
targetObjectIduintheightPluginAttackHeightpowerfloat
Returns
CaptureHostileTargets(float)
Lists hostile creatures within maximumDistance
metres that the player could attack, leaving out anything hidden, not
drawn, or already dead. Returns an empty list when the session is not
in the world or the distance is not a positive number.
IReadOnlyList<PluginCombatTarget> CaptureHostileTargets(float maximumDistance)
Parameters
maximumDistancefloat
Returns
DismissGhostTarget(uint)
Removes a creature the client is still drawing but the server no longer has, clearing it from the client's own world only -- nothing is sent to the server. Reports InvalidTarget for an unknown id or for the local player.
PluginCombatCommandResult DismissGhostTarget(uint targetObjectId)
Parameters
targetObjectIduint
Returns
EnterDefaultMode()
Puts the character into its default combat stance. Reports AlreadyReady when it is already in a combat stance of any kind.
PluginCombatCommandResult EnterDefaultMode()
Returns
EnterMode(PluginCombatMode)
Asks the server for a specific stance. Reports AlreadyReady when the character is already in it, and Refused for a stance value the client does not recognise.
PluginCombatCommandResult EnterMode(PluginCombatMode mode)
Parameters
modePluginCombatMode
Returns
ReleasePhysicalAttack()
Releases an attack begun with BeginPhysicalAttack(uint, PluginAttackHeight, float), sending the swing. Reports Refused when no attack is being held.
PluginCombatCommandResult ReleasePhysicalAttack()