Actor functions

class ActorFunctions

Public Static Functions

void ReadReceivedActorList()

Use the last actor list received by the server as the one being read.

Return
void

void ReadCellActorList(const char *cellDescription)

Use the temporary actor list stored for a cell as the one being read.

This type of actor list is used to store actor positions and dynamic stats and is deleted when the cell is unloaded.

Return
void
Parameters
  • cellDescription: The description of the cell whose actor list should be read.

void ClearActorList()

Clear the data from the actor list stored on the server.

Return
void

void SetActorListPid(unsigned short pid)

Set the pid attached to the ActorList.

Return
void
Parameters
  • pid: The player ID to whom the actor list should be attached.

void CopyReceivedActorListToStore()

Take the contents of the read-only actor list last received by the server from a player and move its contents to the stored object list that can be sent by the server.

Return
void

unsigned int GetActorListSize()

Get the number of indexes in the read actor list.

Return
The number of indexes.

unsigned char GetActorListAction()

Get the action type used in the read actor list.

Return
The action type (0 for SET, 1 for ADD, 2 for REMOVE, 3 for REQUEST).

const char *GetActorCell(unsigned int index)

Get the cell description of the actor at a certain index in the read actor list.

Return
The cell description.
Parameters
  • index: The index of the actor.

const char *GetActorRefId(unsigned int index)

Get the refId of the actor at a certain index in the read actor list.

Return
The refId.
Parameters
  • index: The index of the actor.

unsigned int GetActorRefNum(unsigned int index)

Get the refNum of the actor at a certain index in the read actor list.

Return
The refNum.
Parameters
  • index: The index of the actor.

unsigned int GetActorMpNum(unsigned int index)

Get the mpNum of the actor at a certain index in the read actor list.

Return
The mpNum.
Parameters
  • index: The index of the actor.

double GetActorPosX(unsigned int index)

Get the X position of the actor at a certain index in the read actor list.

Return
The X position.
Parameters
  • index: The index of the actor.

double GetActorPosY(unsigned int index)

Get the Y position of the actor at a certain index in the read actor list.

Return
The Y position.
Parameters
  • index: The index of the actor.

double GetActorPosZ(unsigned int index)

Get the Z position of the actor at a certain index in the read actor list.

Return
The Z position.
Parameters
  • index: The index of the actor.

double GetActorRotX(unsigned int index)

Get the X rotation of the actor at a certain index in the read actor list.

Return
The X rotation.
Parameters
  • index: The index of the actor.

double GetActorRotY(unsigned int index)

Get the Y rotation of the actor at a certain index in the read actor list.

Return
The Y rotation.
Parameters
  • index: The index of the actor.

double GetActorRotZ(unsigned int index)

Get the Z rotation of the actor at a certain index in the read actor list.

Return
The Z rotation.
Parameters
  • index: The index of the actor.

double GetActorHealthBase(unsigned int index)

Get the base health of the actor at a certain index in the read actor list.

Return
The base health.
Parameters
  • index: The index of the actor.

double GetActorHealthCurrent(unsigned int index)

Get the current health of the actor at a certain index in the read actor list.

Return
The current health.
Parameters
  • index: The index of the actor.

double GetActorHealthModified(unsigned int index)

Get the modified health of the actor at a certain index in the read actor list.

Return
The modified health.
Parameters
  • index: The index of the actor.

double GetActorMagickaBase(unsigned int index)

Get the base magicka of the actor at a certain index in the read actor list.

Return
The base magicka.
Parameters
  • index: The index of the actor.

double GetActorMagickaCurrent(unsigned int index)

Get the current magicka of the actor at a certain index in the read actor list.

Return
The current magicka.
Parameters
  • index: The index of the actor.

double GetActorMagickaModified(unsigned int index)

Get the modified magicka of the actor at a certain index in the read actor list.

Return
The modified magicka.
Parameters
  • index: The index of the actor.

double GetActorFatigueBase(unsigned int index)

Get the base fatigue of the actor at a certain index in the read actor list.

Return
The base fatigue.
Parameters
  • index: The index of the actor.

double GetActorFatigueCurrent(unsigned int index)

Get the current fatigue of the actor at a certain index in the read actor list.

Return
The current fatigue.
Parameters
  • index: The index of the actor.

double GetActorFatigueModified(unsigned int index)

Get the modified fatigue of the actor at a certain index in the read actor list.

Return
The modified fatigue.
Parameters
  • index: The index of the actor.

const char *GetActorEquipmentItemRefId(unsigned int index, unsigned short slot)

Get the refId of the item in a certain slot of the equipment of the actor at a certain index in the read actor list.

Return
The refId.
Parameters
  • index: The index of the actor.
  • slot: The slot of the equipment item.

int GetActorEquipmentItemCount(unsigned int index, unsigned short slot)

Get the count of the item in a certain slot of the equipment of the actor at a certain index in the read actor list.

Return
The item count.
Parameters
  • index: The index of the actor.
  • slot: The slot of the equipment item.

int GetActorEquipmentItemCharge(unsigned int index, unsigned short slot)

Get the charge of the item in a certain slot of the equipment of the actor at a certain index in the read actor list.

Return
The charge.
Parameters
  • index: The index of the actor.
  • slot: The slot of the equipment item.

double GetActorEquipmentItemEnchantmentCharge(unsigned int index, unsigned short slot)

Get the enchantment charge of the item in a certain slot of the equipment of the actor at a certain index in the read actor list.

Return
The enchantment charge.
Parameters
  • index: The index of the actor.
  • slot: The slot of the equipment item.

bool DoesActorHavePlayerKiller(unsigned int index)

Check whether the killer of the actor at a certain index in the read actor list is a player.

Return
Whether the actor was killed by a player.
Parameters
  • index: The index of the actor.

int GetActorKillerPid(unsigned int index)

Get the player ID of the killer of the actor at a certain index in the read actor list.

Return
The player ID of the killer.
Parameters
  • index: The index of the actor.

const char *GetActorKillerRefId(unsigned int index)

Get the refId of the actor killer of the actor at a certain index in the read actor list.

Return
The refId of the killer.
Parameters
  • index: The index of the actor.

unsigned int GetActorKillerRefNum(unsigned int index)

Get the refNum of the actor killer of the actor at a certain index in the read actor list.

Return
The refNum of the killer.
Parameters
  • index: The index of the actor.

unsigned int GetActorKillerMpNum(unsigned int index)

Get the mpNum of the actor killer of the actor at a certain index in the read actor list.

Return
The mpNum of the killer.
Parameters
  • index: The index of the actor.

const char *GetActorKillerName(unsigned int index)

Get the name of the actor killer of the actor at a certain index in the read actor list.

Return
The name of the killer.
Parameters
  • index: The index of the actor.

bool DoesActorHavePosition(unsigned int index)

Check whether there is any positional data for the actor at a certain index in the read actor list.

This is only useful when reading the actor list data recorded for a particular cell.

Return
Whether the read actor list contains positional data.
Parameters
  • index: The index of the actor.

bool DoesActorHaveStatsDynamic(unsigned int index)

Check whether there is any dynamic stats data for the actor at a certain index in the read actor list.

This is only useful when reading the actor list data recorded for a particular cell.

Return
Whether the read actor list contains dynamic stats data.
Parameters
  • index: The index of the actor.

void SetActorListCell(const char *cellDescription)

Set the cell of the temporary actor list stored on the server.

The cell is determined to be an exterior cell if it fits the pattern of a number followed by a comma followed by another number.

Return
void
Parameters
  • cellDescription: The description of the cell.

void SetActorListAction(unsigned char action)

Set the action type of the temporary actor list stored on the server.

Return
void
Parameters
  • action: The action type (0 for SET, 1 for ADD, 2 for REMOVE, 3 for REQUEST).

void SetActorCell(const char *cellDescription)

Set the cell of the temporary actor stored on the server.

Used for ActorCellChange packets, where a specific actor’s cell now differs from that of the actor list.

The cell is determined to be an exterior cell if it fits the pattern of a number followed by a comma followed by another number.

Return
void
Parameters
  • cellDescription: The description of the cell.

void SetActorRefId(const char *refId)

Set the refId of the temporary actor stored on the server.

Return
void
Parameters
  • refId: The refId.

void SetActorRefNum(int refNum)

Set the refNum of the temporary actor stored on the server.

Return
void
Parameters
  • refNum: The refNum.

void SetActorMpNum(int mpNum)

Set the mpNum of the temporary actor stored on the server.

Return
void
Parameters
  • mpNum: The mpNum.

void SetActorPosition(double x, double y, double z)

Set the position of the temporary actor stored on the server.

Return
void
Parameters
  • x: The X position.
  • y: The Y position.
  • z: The Z position.

void SetActorRotation(double x, double y, double z)

Set the rotation of the temporary actor stored on the server.

Return
void
Parameters
  • x: The X rotation.
  • y: The Y rotation.
  • z: The Z rotation.

void SetActorHealthBase(double value)

Set the base health of the temporary actor stored on the server.

Return
void
Parameters
  • value: The new value.

void SetActorHealthCurrent(double value)

Set the current health of the temporary actor stored on the server.

Return
void
Parameters
  • value: The new value.

void SetActorHealthModified(double value)

Set the modified health of the temporary actor stored on the server.

Return
void
Parameters
  • value: The new value.

void SetActorMagickaBase(double value)

Set the base magicka of the temporary actor stored on the server.

Return
void
Parameters
  • value: The new value.

void SetActorMagickaCurrent(double value)

Set the current magicka of the temporary actor stored on the server.

Return
void
Parameters
  • value: The new value.

void SetActorMagickaModified(double value)

Set the modified magicka of the temporary actor stored on the server.

Return
void
Parameters
  • value: The new value.

void SetActorFatigueBase(double value)

Set the base fatigue of the temporary actor stored on the server.

Return
void
Parameters
  • value: The new value.

void SetActorFatigueCurrent(double value)

Set the current fatigue of the temporary actor stored on the server.

Return
void
Parameters
  • value: The new value.

void SetActorFatigueModified(double value)

Set the modified fatigue of the temporary actor stored on the server.

Return
void
Parameters
  • value: The new value.

void SetActorSound(const char *sound)

Set the sound of the temporary actor stored on the server.

Return
void
Parameters
  • sound: The sound.

void SetActorAIAction(unsigned int action)

Set the AI action of the temporary actor stored on the server.

Return
void
Parameters
  • action: The new action.

void SetActorAITargetToPlayer(unsigned short pid)

Set a player as the AI target of the temporary actor stored on the server.

Return
void
Parameters
  • pid: The player ID.

void SetActorAITargetToObject(int refNum, int mpNum)

Set another object as the AI target of the temporary actor stored on the server.

Return
void
Parameters
  • refNum: The refNum of the target object.
  • mpNum: The mpNum of the target object.

void SetActorAICoordinates(double x, double y, double z)

Set the coordinates for the AI package associated with the current AI action.

Return
void
Parameters
  • x: The X coordinate.
  • y: The Y coordinate.
  • z: The Z coordinate.

void SetActorAIDistance(unsigned int distance)

Set the distance of the AI package associated with the current AI action.

Return
void
Parameters
  • duration: The distance of the package.

void SetActorAIDuration(unsigned int duration)

Set the duration of the AI package associated with the current AI action.

Return
void
Parameters
  • duration: The duration of the package.

void SetActorAIRepetition(bool shouldRepeat)

Set whether the current AI package should be repeated.

Note: This only has an effect on the WANDER package.

Return
void
Parameters
  • shouldRepeat: Whether the package should be repeated.

void EquipActorItem(unsigned short slot, const char *refId, unsigned int count, int charge, double enchantmentCharge = -1)

Equip an item in a certain slot of the equipment of the temporary actor stored on the server.

Return
void
Parameters
  • slot: The equipment slot.
  • refId: The refId of the item.
  • count: The count of the item.
  • charge: The charge of the item.
  • enchantmentCharge: The enchantment charge of the item.

void UnequipActorItem(unsigned short slot)

Unequip the item in a certain slot of the equipment of the temporary actor stored on the server.

Return
void
Parameters
  • slot: The equipment slot.

void AddActor()

Add a copy of the server’s temporary actor to the server’s temporary actor list.

In the process, the server’s temporary actor will automatically be cleared so a new one can be set up.

Return
void

void SendActorList()

Send an ActorList packet.

It is sent only to the player for whom the current actor list was initialized.

Return
void

void SendActorAuthority()

Send an ActorAuthority packet.

The player for whom the current actor list was initialized is recorded in the server memory as the new actor authority for the actor list’s cell.

The packet is sent to that player as well as all other players who have the cell loaded.

Return
void

void SendActorPosition(bool sendToOtherVisitors, bool skipAttachedPlayer)

Send an ActorPosition packet.

Return
void
Parameters
  • sendToOtherVisitors: Whether this packet should be sent to cell visitors other than the player attached to the packet (false by default).
  • skipAttachedPlayer: Whether the packet should skip being sent to the player attached to the packet (false by default).

void SendActorStatsDynamic(bool sendToOtherVisitors, bool skipAttachedPlayer)

Send an ActorStatsDynamic packet.

Return
void
Parameters
  • sendToOtherVisitors: Whether this packet should be sent to cell visitors other than the player attached to the packet (false by default).
  • skipAttachedPlayer: Whether the packet should skip being sent to the player attached to the packet (false by default).

void SendActorEquipment(bool sendToOtherVisitors, bool skipAttachedPlayer)

Send an ActorEquipment packet.

Return
void
Parameters
  • sendToOtherVisitors: Whether this packet should be sent to cell visitors other than the player attached to the packet (false by default).
  • skipAttachedPlayer: Whether the packet should skip being sent to the player attached to the packet (false by default).

void SendActorSpeech(bool sendToOtherVisitors, bool skipAttachedPlayer)

Send an ActorSpeech packet.

Return
void
Parameters
  • sendToOtherVisitors: Whether this packet should be sent to cell visitors other than the player attached to the packet (false by default).
  • skipAttachedPlayer: Whether the packet should skip being sent to the player attached to the packet (false by default).

void SendActorAI(bool sendToOtherVisitors, bool skipAttachedPlayer)

Send an ActorAI packet.

Return
void
Parameters
  • sendToOtherVisitors: Whether this packet should be sent to cell visitors other than the player attached to the packet (false by default).
  • skipAttachedPlayer: Whether the packet should skip being sent to the player attached to the packet (false by default).

void SendActorCellChange(bool sendToOtherVisitors, bool skipAttachedPlayer)

Send an ActorCellChange packet.

Return
void
Parameters
  • sendToOtherVisitors: Whether this packet should be sent to cell visitors other than the player attached to the packet (false by default).
  • skipAttachedPlayer: Whether the packet should skip being sent to the player attached to the packet (false by default).