dao::CCObject

class

Derives from dao::CGameObject.

An object in the world: a creature, placeable, waypoint or item.

It has a position, an area and a queue of commands.

Declared in dao/Objects.h.

Functions

AILevel()

std::int32_t AILevel() const

Returns the object’s AI level, the same as GetAILevel.

Area()

CCArea * Area()

Returns the area the object is in.

Returns the area, or null if the object is not in an area

AreaId()

ObjectId AreaId() const

Returns the id of the area the object is in, the same as GetArea.

CommandAt()

const Command * CommandAt(std::uint16_t index) const

Returns the command at a position in the queue, where 0 is the head.

The queue owns the command, and it stays valid until the object moves on from it.

Returns the command, or null if the position is past the end of the queue

CommandQueueSize()

std::int32_t CommandQueueSize() const

Returns the number of commands in the queue.

CurrentCommand()

const Command * CurrentCommand() const

Returns the command at the head of the queue, which is the one being carried out.

The queue owns the command, and it stays valid until the object moves on from it.

Returns the command, or null if the queue is empty

CurrentEvent()

const CScriptEvent * CurrentEvent() const

Returns the event the object’s script is handling, the same one GetCurrentEvent returns to the script.

The engine owns the event, and it is valid only while the script runs.

Returns the event, or null if there is none

GroupId()

std::int32_t GroupId() const

Returns the object’s group, the same as GetGroupId.

Position()

Vector Position() const

Returns the object’s position, the same as GetPosition.

QueueCommand()

int QueueCommand(Command *command, bool addToFront, int overrideBehaviour=-1)

Queues a command on the object, the same as the scripts’ AddCommand.

If you detour this function and refuse a command, free it with dao::script::DestroyStructure(EngineStructure::Command, command), because nothing else will.

Parameter  
command the command. The queue takes ownership of it
addToFront true to put it at the front of the queue, false to put it at the back
overrideBehaviour AddCommand’s nOverrideAddBehavior. 0 just adds; 1 clears the queue first; 2 clears it hard; 3 clears it soft or hard, depending on whether the command’s target is the creature’s current target; -1 uses the default for the command’s type, from the commands table

Returns 1, or 0 if the command is null

TeamId()

std::int32_t TeamId() const

Returns the object’s team, the same as GetTeamId.