Actor functions¶
-
class ActorFunctions¶
Public Static Functions
-
static void ReadReceivedActorList() noexcept¶
Use the last actor list received by the server as the one being read.
- Returns
void
-
static void ReadCellActorList(const char *cellDescription) noexcept¶
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.
- Parameters
cellDescription – The description of the cell whose actor list should be read.
- Returns
void
-
static void ClearActorList() noexcept¶
Clear the data from the actor list stored on the server.
- Returns
void
-
static void SetActorListPid(unsigned short pid) noexcept¶
Set the pid attached to the ActorList.
- Parameters
pid – The player ID to whom the actor list should be attached.
- Returns
void
-
static void CopyReceivedActorListToStore() noexcept¶
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.
- Returns
void
-
static unsigned int GetActorListSize() noexcept¶
Get the number of indexes in the read actor list.
- Returns
The number of indexes.
-
static unsigned char GetActorListAction() noexcept¶
Get the action type used in the read actor list.
- Returns
The action type (0 for SET, 1 for ADD, 2 for REMOVE, 3 for REQUEST).
-
static const char *GetActorCell(unsigned int index) noexcept¶
Get the cell description of the actor at a certain index in the read actor list.
- Parameters
index – The index of the actor.
- Returns
The cell description.
-
static const char *GetActorRefId(unsigned int index) noexcept¶
Get the refId of the actor at a certain index in the read actor list.
- Parameters
index – The index of the actor.
- Returns
The refId.
-
static unsigned int GetActorRefNum(unsigned int index) noexcept¶
Get the refNum of the actor at a certain index in the read actor list.
- Parameters
index – The index of the actor.
- Returns
The refNum.
-
static unsigned int GetActorMpNum(unsigned int index) noexcept¶
Get the mpNum of the actor at a certain index in the read actor list.
- Parameters
index – The index of the actor.
- Returns
The mpNum.
-
static double GetActorPosX(unsigned int index) noexcept¶
Get the X position of the actor at a certain index in the read actor list.
- Parameters
index – The index of the actor.
- Returns
The X position.
-
static double GetActorPosY(unsigned int index) noexcept¶
Get the Y position of the actor at a certain index in the read actor list.
- Parameters
index – The index of the actor.
- Returns
The Y position.
-
static double GetActorPosZ(unsigned int index) noexcept¶
Get the Z position of the actor at a certain index in the read actor list.
- Parameters
index – The index of the actor.
- Returns
The Z position.
-
static double GetActorRotX(unsigned int index) noexcept¶
Get the X rotation of the actor at a certain index in the read actor list.
- Parameters
index – The index of the actor.
- Returns
The X rotation.
-
static double GetActorRotY(unsigned int index) noexcept¶
Get the Y rotation of the actor at a certain index in the read actor list.
- Parameters
index – The index of the actor.
- Returns
The Y rotation.
-
static double GetActorRotZ(unsigned int index) noexcept¶
Get the Z rotation of the actor at a certain index in the read actor list.
- Parameters
index – The index of the actor.
- Returns
The Z rotation.
-
static double GetActorHealthBase(unsigned int index) noexcept¶
Get the base health of the actor at a certain index in the read actor list.
- Parameters
index – The index of the actor.
- Returns
The base health.
-
static double GetActorHealthCurrent(unsigned int index) noexcept¶
Get the current health of the actor at a certain index in the read actor list.
- Parameters
index – The index of the actor.
- Returns
The current health.
-
static double GetActorHealthModified(unsigned int index) noexcept¶
Get the modified health of the actor at a certain index in the read actor list.
- Parameters
index – The index of the actor.
- Returns
The modified health.
-
static double GetActorMagickaBase(unsigned int index) noexcept¶
Get the base magicka of the actor at a certain index in the read actor list.
- Parameters
index – The index of the actor.
- Returns
The base magicka.
-
static double GetActorMagickaCurrent(unsigned int index) noexcept¶
Get the current magicka of the actor at a certain index in the read actor list.
- Parameters
index – The index of the actor.
- Returns
The current magicka.
-
static double GetActorMagickaModified(unsigned int index) noexcept¶
Get the modified magicka of the actor at a certain index in the read actor list.
- Parameters
index – The index of the actor.
- Returns
The modified magicka.
-
static double GetActorFatigueBase(unsigned int index) noexcept¶
Get the base fatigue of the actor at a certain index in the read actor list.
- Parameters
index – The index of the actor.
- Returns
The base fatigue.
-
static double GetActorFatigueCurrent(unsigned int index) noexcept¶
Get the current fatigue of the actor at a certain index in the read actor list.
- Parameters
index – The index of the actor.
- Returns
The current fatigue.
-
static double GetActorFatigueModified(unsigned int index) noexcept¶
Get the modified fatigue of the actor at a certain index in the read actor list.
- Parameters
index – The index of the actor.
- Returns
The modified fatigue.
-
static const char *GetActorEquipmentItemRefId(unsigned int index, unsigned short slot) noexcept¶
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.
- Parameters
index – The index of the actor.
slot – The slot of the equipment item.
- Returns
The refId.
-
static int GetActorEquipmentItemCount(unsigned int index, unsigned short slot) noexcept¶
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.
- Parameters
index – The index of the actor.
slot – The slot of the equipment item.
- Returns
The item count.
-
static int GetActorEquipmentItemCharge(unsigned int index, unsigned short slot) noexcept¶
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.
- Parameters
index – The index of the actor.
slot – The slot of the equipment item.
- Returns
The charge.
-
static double GetActorEquipmentItemEnchantmentCharge(unsigned int index, unsigned short slot) noexcept¶
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.
- Parameters
index – The index of the actor.
slot – The slot of the equipment item.
- Returns
The enchantment charge.
-
static bool DoesActorHavePlayerKiller(unsigned int index) noexcept¶
Check whether the killer of the actor at a certain index in the read actor list is a player.
- Parameters
index – The index of the actor.
- Returns
Whether the actor was killed by a player.
-
static int GetActorKillerPid(unsigned int index) noexcept¶
Get the player ID of the killer of the actor at a certain index in the read actor list.
- Parameters
index – The index of the actor.
- Returns
The player ID of the killer.
-
static const char *GetActorKillerRefId(unsigned int index) noexcept¶
Get the refId of the actor killer of the actor at a certain index in the read actor list.
- Parameters
index – The index of the actor.
- Returns
The refId of the killer.
-
static unsigned int GetActorKillerRefNum(unsigned int index) noexcept¶
Get the refNum of the actor killer of the actor at a certain index in the read actor list.
- Parameters
index – The index of the actor.
- Returns
The refNum of the killer.
-
static unsigned int GetActorKillerMpNum(unsigned int index) noexcept¶
Get the mpNum of the actor killer of the actor at a certain index in the read actor list.
- Parameters
index – The index of the actor.
- Returns
The mpNum of the killer.
-
static const char *GetActorKillerName(unsigned int index) noexcept¶
Get the name of the actor killer of the actor at a certain index in the read actor list.
- Parameters
index – The index of the actor.
- Returns
The name of the killer.
-
static unsigned int GetActorDeathState(unsigned int index) noexcept¶
Get the deathState of the actor at a certain index in the read actor list.
- Parameters
index – The index of the actor.
- Returns
The deathState.
-
static unsigned int GetActorSpellsActiveChangesSize(unsigned int actorIndex) noexcept¶
Get the number of indexes in an actor’s latest spells active changes.
- Parameters
actorIndex – The index of the actor.
- Returns
The number of indexes for spells active changes.
-
static unsigned int GetActorSpellsActiveChangesAction(unsigned int actorIndex) noexcept¶
Get the action type used in an actor’s latest spells active changes.
- Parameters
actorIndex – The index of the actor.
- Returns
The action type (0 for SET, 1 for ADD, 2 for REMOVE).
-
static const char *GetActorSpellsActiveId(unsigned int actorIndex, unsigned int spellIndex) noexcept¶
Get the spell id at a certain index in an actor’s latest spells active changes.
- Parameters
actorIndex – The index of the actor.
spellIndex – The index of the spell.
- Returns
The spell id.
-
static const char *GetActorSpellsActiveDisplayName(unsigned int actorIndex, unsigned int spellIndex) noexcept¶
Get the spell display name at a certain index in an actor’s latest spells active changes.
- Parameters
actorIndex – The index of the actor.
spellIndex – The index of the spell.
- Returns
The spell display name.
-
static bool GetActorSpellsActiveStackingState(unsigned int actorIndex, unsigned int spellIndex) noexcept¶
Get the spell stacking state at a certain index in an actor’s latest spells active changes.
- Parameters
actorIndex – The index of the actor.
spellIndex – The index of the spell.
- Returns
The spell stacking state.
-
static unsigned int GetActorSpellsActiveEffectCount(unsigned int actorIndex, unsigned int spellIndex) noexcept¶
Get the number of effects at an index in an actor’s latest spells active changes.
- Parameters
actorIndex – The index of the actor.
spellIndex – The index of the spell.
- Returns
The number of effects.
-
static unsigned int GetActorSpellsActiveEffectId(unsigned int actorIndex, unsigned int spellIndex, unsigned int effectIndex) noexcept¶
Get the id for an effect index at a spell index in an actor’s latest spells active changes.
- Parameters
actorIndex – The index of the actor.
spellIndex – The index of the spell.
effectIndex – The index of the effect.
- Returns
The id of the effect.
-
static int GetActorSpellsActiveEffectArg(unsigned int actorIndex, unsigned int spellIndex, unsigned int effectIndex) noexcept¶
Get the arg for an effect index at a spell index in an actor’s latest spells active changes.
- Parameters
actorIndex – The index of the actor.
spellIndex – The index of the spell.
effectIndex – The index of the effect.
- Returns
The arg of the effect.
-
static double GetActorSpellsActiveEffectMagnitude(unsigned int actorIndex, unsigned int spellIndex, unsigned int effectIndex) noexcept¶
Get the magnitude for an effect index at a spell index in an actor’s latest spells active changes.
- Parameters
actorIndex – The index of the actor.
spellIndex – The index of the spell.
effectIndex – The index of the effect.
- Returns
The magnitude of the effect.
-
static double GetActorSpellsActiveEffectDuration(unsigned int actorIndex, unsigned int spellIndex, unsigned int effectIndex) noexcept¶
Get the duration for an effect index at a spell index in an actor’s latest spells active changes.
- Parameters
actorIndex – The index of the actor.
spellIndex – The index of the spell.
effectIndex – The index of the effect.
- Returns
The duration of the effect.
-
static double GetActorSpellsActiveEffectTimeLeft(unsigned int actorIndex, unsigned int spellIndex, unsigned int effectIndex) noexcept¶
Get the time left for an effect index at a spell index in an actor’s latest spells active changes.
- Parameters
actorIndex – The index of the actor.
spellIndex – The index of the spell.
effectIndex – The index of the effect.
- Returns
The time left for the effect.
-
static bool DoesActorSpellsActiveHavePlayerCaster(unsigned int actorIndex, unsigned int spellIndex) noexcept¶
Check whether the spell at a certain index in an actor’s latest spells active changes has a player as its caster.
- Parameters
actorIndex – The index of the actor.
spellIndex – The index of the spell.
- Returns
Whether a player is the caster of the spell.
-
static int GetActorSpellsActiveCasterPid(unsigned int actorIndex, unsigned int spellIndex) noexcept¶
Get the player ID of the caster of the spell at a certain index in an actor’s latest spells active changes.
- Parameters
actorIndex – The index of the actor.
spellIndex – The index of the spell.
- Returns
The player ID of the caster.
-
static const char *GetActorSpellsActiveCasterRefId(unsigned int actorIndex, unsigned int spellIndex) noexcept¶
Get the refId of the actor caster of the spell at a certain index in an actor’s latest spells active changes.
- Parameters
actorIndex – The index of the actor.
spellIndex – The index of the spell.
- Returns
The refId of the caster.
-
static unsigned int GetActorSpellsActiveCasterRefNum(unsigned int actorIndex, unsigned int spellIndex) noexcept¶
Get the refNum of the actor caster of the spell at a certain index in an actor’s latest spells active changes.
- Parameters
actorIndex – The index of the actor.
spellIndex – The index of the spell.
- Returns
The refNum of the caster.
-
static unsigned int GetActorSpellsActiveCasterMpNum(unsigned int actorIndex, unsigned int spellIndex) noexcept¶
Get the mpNum of the actor caster of the spell at a certain index in an actor’s latest spells active changes.
- Parameters
actorIndex – The index of the actor.
spellIndex – The index of the spell.
- Returns
The mpNum of the caster.
-
static bool DoesActorHavePosition(unsigned int index) noexcept¶
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.
- Parameters
index – The index of the actor.
- Returns
Whether the read actor list contains positional data.
-
static bool DoesActorHaveStatsDynamic(unsigned int index) noexcept¶
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.
- Parameters
index – The index of the actor.
- Returns
Whether the read actor list contains dynamic stats data.
-
static void SetActorListCell(const char *cellDescription) noexcept¶
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.
- Parameters
cellDescription – The description of the cell.
- Returns
void
-
static void SetActorListAction(unsigned char action) noexcept¶
Set the action type of the temporary actor list stored on the server.
- Parameters
action – The action type (0 for SET, 1 for ADD, 2 for REMOVE, 3 for REQUEST).
- Returns
void
-
static void SetActorCell(const char *cellDescription) noexcept¶
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.
- Parameters
cellDescription – The description of the cell.
- Returns
void
-
static void SetActorRefId(const char *refId) noexcept¶
Set the refId of the temporary actor stored on the server.
- Parameters
refId – The refId.
- Returns
void
-
static void SetActorRefNum(int refNum) noexcept¶
Set the refNum of the temporary actor stored on the server.
- Parameters
refNum – The refNum.
- Returns
void
-
static void SetActorMpNum(int mpNum) noexcept¶
Set the mpNum of the temporary actor stored on the server.
- Parameters
mpNum – The mpNum.
- Returns
void
-
static void SetActorPosition(double x, double y, double z) noexcept¶
Set the position of the temporary actor stored on the server.
- Parameters
x – The X position.
y – The Y position.
z – The Z position.
- Returns
void
-
static void SetActorRotation(double x, double y, double z) noexcept¶
Set the rotation of the temporary actor stored on the server.
- Parameters
x – The X rotation.
y – The Y rotation.
z – The Z rotation.
- Returns
void
-
static void SetActorHealthBase(double value) noexcept¶
Set the base health of the temporary actor stored on the server.
- Parameters
value – The new value.
- Returns
void
-
static void SetActorHealthCurrent(double value) noexcept¶
Set the current health of the temporary actor stored on the server.
- Parameters
value – The new value.
- Returns
void
-
static void SetActorHealthModified(double value) noexcept¶
Set the modified health of the temporary actor stored on the server.
- Parameters
value – The new value.
- Returns
void
-
static void SetActorMagickaBase(double value) noexcept¶
Set the base magicka of the temporary actor stored on the server.
- Parameters
value – The new value.
- Returns
void
-
static void SetActorMagickaCurrent(double value) noexcept¶
Set the current magicka of the temporary actor stored on the server.
- Parameters
value – The new value.
- Returns
void
-
static void SetActorMagickaModified(double value) noexcept¶
Set the modified magicka of the temporary actor stored on the server.
- Parameters
value – The new value.
- Returns
void
-
static void SetActorFatigueBase(double value) noexcept¶
Set the base fatigue of the temporary actor stored on the server.
- Parameters
value – The new value.
- Returns
void
-
static void SetActorFatigueCurrent(double value) noexcept¶
Set the current fatigue of the temporary actor stored on the server.
- Parameters
value – The new value.
- Returns
void
-
static void SetActorFatigueModified(double value) noexcept¶
Set the modified fatigue of the temporary actor stored on the server.
- Parameters
value – The new value.
- Returns
void
-
static void SetActorSound(const char *sound) noexcept¶
Set the sound of the temporary actor stored on the server.
- Parameters
sound – The sound.
- Returns
void
-
static void SetActorDeathState(unsigned int deathState) noexcept¶
Set the deathState of the temporary actor stored on the server.
- Parameters
deathState – The deathState.
- Returns
void
-
static void SetActorDeathInstant(bool isInstant) noexcept¶
Set whether the death of the temporary actor stored on the server should be instant or not.
- Parameters
isInstant – Whether the death should be instant.
- Returns
void
-
static void SetActorSpellsActiveAction(unsigned char action) noexcept¶
Set the action type in the spells active changes of the temporary actor stored on the server.
- Parameters
action – The action (0 for SET, 1 for ADD, 2 for REMOVE).
- Returns
void
-
static void SetActorAIAction(unsigned int action) noexcept¶
Set the AI action of the temporary actor stored on the server.
- Parameters
action – The new action.
- Returns
void
-
static void SetActorAITargetToPlayer(unsigned short pid) noexcept¶
Set a player as the AI target of the temporary actor stored on the server.
- Parameters
pid – The player ID.
- Returns
void
-
static void SetActorAITargetToObject(int refNum, int mpNum) noexcept¶
Set another object as the AI target of the temporary actor stored on the server.
- Parameters
refNum – The refNum of the target object.
mpNum – The mpNum of the target object.
- Returns
void
-
static void SetActorAICoordinates(double x, double y, double z) noexcept¶
Set the coordinates for the AI package associated with the current AI action.
- Parameters
x – The X coordinate.
y – The Y coordinate.
z – The Z coordinate.
- Returns
void
-
static void SetActorAIDistance(unsigned int distance) noexcept¶
Set the distance of the AI package associated with the current AI action.
- Parameters
distance – The distance of the package.
- Returns
void
-
static void SetActorAIDuration(unsigned int duration) noexcept¶
Set the duration of the AI package associated with the current AI action.
- Parameters
duration – The duration of the package.
- Returns
void
-
static void SetActorAIRepetition(bool shouldRepeat) noexcept¶
Set whether the current AI package should be repeated.
Note: This only has an effect on the WANDER package.
- Parameters
shouldRepeat – Whether the package should be repeated.
- Returns
void
-
static void EquipActorItem(unsigned short slot, const char *refId, unsigned int count, int charge, double enchantmentCharge = -1) noexcept¶
Equip an item in a certain slot of the equipment of the temporary actor stored on the server.
- 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.
- Returns
void
-
static void UnequipActorItem(unsigned short slot) noexcept¶
Unequip the item in a certain slot of the equipment of the temporary actor stored on the server.
- Parameters
slot – The equipment slot.
- Returns
void
-
static void AddActorSpellActive(const char *spellId, const char *displayName, bool stackingState) noexcept¶
Add a new active spell to the spells active changes for the temporary actor stored, on the server, using the temporary effect values stored so far.
- Parameters
spellId – The spellId of the spell.
displayName – The displayName of the spell.
stackingState – Whether the spell should stack with other instances of itself.
- Returns
void
-
static void AddActorSpellActiveEffect(int effectId, double magnitude, double duration, double timeLeft, int arg) noexcept¶
Add a new effect to the next active spell that will be added to the temporary actor stored on the server.
- Parameters
effectId – The id of the effect.
magnitude – The magnitude of the effect.
duration – The duration of the effect.
timeLeft – The timeLeft for the effect.
arg – The arg of the effect when applicable, e.g. the skill used for Fortify Skill or the attribute used for Fortify Attribute.
- Returns
void
-
static void AddActor() noexcept¶
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.
- Returns
void
-
static void SendActorList() noexcept¶
Send an ActorList packet.
It is sent only to the player for whom the current actor list was initialized.
- Returns
void
-
static void SendActorAuthority() noexcept¶
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.
- Returns
void
-
static void SendActorPosition(bool sendToOtherVisitors, bool skipAttachedPlayer) noexcept¶
Send an ActorPosition packet.
- 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).
- Returns
void
-
static void SendActorStatsDynamic(bool sendToOtherVisitors, bool skipAttachedPlayer) noexcept¶
Send an ActorStatsDynamic packet.
- 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).
- Returns
void
-
static void SendActorEquipment(bool sendToOtherVisitors, bool skipAttachedPlayer) noexcept¶
Send an ActorEquipment packet.
- 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).
- Returns
void
-
static void SendActorSpellsActiveChanges(bool sendToOtherVisitors, bool skipAttachedPlayer) noexcept¶
Send an ActorSpellsActive packet.
- 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).
- Returns
void
-
static void SendActorSpeech(bool sendToOtherVisitors, bool skipAttachedPlayer) noexcept¶
Send an ActorSpeech packet.
- 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).
- Returns
void
-
static void SendActorDeath(bool sendToOtherVisitors, bool skipAttachedPlayer) noexcept¶
Send an ActorDeath packet.
- 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).
- Returns
void
-
static void SendActorAI(bool sendToOtherVisitors, bool skipAttachedPlayer) noexcept¶
Send an ActorAI packet.
- 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).
- Returns
void
-
static void SendActorCellChange(bool sendToOtherVisitors, bool skipAttachedPlayer) noexcept¶
Send an ActorCellChange packet.
- 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).
- Returns
void
-
static void ReadReceivedActorList() noexcept¶