dao::orders
Give orders as the player’s clicks do: attack, use, cast, move.
Declared in dao/Orders.h.
Functions
Attack()
bool Attack(ObjectId creature, ObjectId target)
Orders the creature to attack a target, ahead of its other commands.
Call it, like every function here, on the game thread in explore or combat mode.
Returns false, and gives no order, if there is no such creature
MoveTo()
bool MoveTo(ObjectId creature, const Vector &point)
Orders the creature to move to a point, like a click on the ground in explore mode.
Returns false, and gives no order, if there is no such creature or the game is not in explore mode
UseAbility()
bool UseAbility(ObjectId creature, std::int32_t ability, ObjectId target, ObjectId item=kInvalidObject, const Vector &point={})
Orders the creature to use an ability, after its other commands.
An ability with an instant script runs that script instead. A creature that cannot act, or is standing in a trigger that forbids the ability, gets no order, but the function still returns true.
| Parameter | |
|---|---|
ability |
the ability’s row in the ability table, such as 10003 |
target |
the creature or object to aim at, or kInvalidObject for none |
item |
the item the ability comes from, or kInvalidObject for none |
point |
the place to aim at, for an ability aimed at the ground |
Returns false, and gives no order, if there is no such creature
UseObject()
bool UseObject(ObjectId creature, ObjectId object, script::PlaceableAction action=script::PlaceableAction::Use)
Orders the creature to use an object, such as a door or a chest, after its other commands.
PLACEABLE_ACTION_DESTROY becomes an attack.
Returns false, and gives no order, if there is no such creature