styyx-util 1.0
Utility Header for SKSE Plugin development
Loading...
Searching...
No Matches
StyyxUtil::ActorUtil Struct Reference

#include <st-actor.h>

Static Public Member Functions

static void GetPerksFromBaseActor (RE::Actor *a_actor, std::vector< RE::BGSPerk * > &perks)
 Fills a vector<RE::BGSPerk*> reference with all the perks an actor inherits from the actor base.
static bool ActorHasEquippedHeavyArmor (RE::Actor *actor)
 Check if an actor has any heavy armor equipped. It returning false does not mean the actor has light armor equipped.
static bool ActorHasEquippedLightArmor (const RE::Actor *actor)
 Check if an actor has any light armor equipped. It returning false does not mean the actor has heavy armor equipped.
static bool IsInOpportunityState (RE::Actor *victim, const RE::Actor *attacker)
 Very specific function used to see if an Actor is in a state an attack of opportunity should be possible.
static bool ActorHasQuestObjectInHand (RE::Actor *actor)
 Check if actor has Quest item as weapon.
static bool IsVampire (RE::Actor *a_ref)
 Check if actor is vampire.
static bool IsUndead (RE::Actor *a_ref)
 Check if actor is undead.
static bool IsDragon (const RE::Actor *a_actor)
 Check if actor is a dragon.
static RE::TESObjectCELL * GetPlayerCell ()
 Get the current cell the player is in.
static float GetCurrentLightLevel (const RE::Actor *a_actor)
 Get the current light level the actor is standing in.
static float GetCurrentLightLevelPlayer ()
 Get the light level the player is standing in.
static void TryStagger (RE::Actor *a_target, float a_staggerMult, RE::Actor *a_aggressor)
 Try to stagger a target.
static bool StartsDead (const RE::Actor *actor)
 Check if actor is supposed to spawn dead.
static float GetMaxHealth (RE::Actor *a_actor)
 Get maximum Health of an actor.
static float GetMaxStamina (RE::Actor *actor)
 Get maximum Stamina of an actor.
static float GetMaxMagicka (RE::Actor *actor)
 Get maximum Magicka of an actor.
static void FullyHealActor (RE::Actor *a_actor)
 Fully heals all 3 attributes of an actor.
static bool ActorHasEffectOfTypeActive (RE::Actor *a_actor, RE::EffectArchetypes::ArchetypeID a_type)
 Check if actor has an effect of a specific type active.
static bool HasEffectWithKeywordActive (RE::Actor *a_actor, const std::string_view a_keyword)
 Check if an actor has an effect active with a specific keyword.
static bool IsEffectActive (RE::Actor *a_actor, const RE::EffectSetting *a_effect)
 Check if an actor has a specific effect active.
static void AddItem (RE::Actor *a_actor, RE::TESBoundObject *a_item, RE::ExtraDataList *a_extraList, int a_count, RE::TESObjectREFR *a_fromRefr)
 Add item to actor.
static void AddItemPlayer (RE::TESBoundObject *a_item, const int a_count)
 Helper function to add an item to the player.
static int RemoveItemPlayer (RE::TESBoundObject *item, int count)
 Remove item from the player.
static bool ActorHasItem (RE::Actor *actor, RE::TESBoundObject *item)
 Check if actor has the specified item in the inventory.
static RE::TESObjectWEAP * GetWieldingWeapon (RE::Actor *a_actor)
 Get the weapon a character is currently wielding.
static RE::Actor * GetPlayerMount ()
 Get the player mount.
static bool IsPowerAttacking (const RE::Actor *actor)
 Check if an actor is power attacking.
static bool IsBashing (const RE::Actor *actor)
 Check if an actor is shield bashing.
static std::vector< RE::Actor * > GetNearbyActors (const RE::TESObjectREFR *a_ref, const float a_radius, const bool a_ignorePlayer)
 Get all nearby actors.
static std::vector< RE::Actor * > GetNearbyNonPlayerTeammates (const RE::TESObjectREFR *a_ref, const float a_radius)
 Search all non-teammates within a certain radius.
static bool IsGuardNearby (const RE::TESObjectREFR *a_ref, const float a_radius)
 Check if any actor within a certain radius is a guard.
static RE::Actor * GetClosestActor (const RE::TESObjectREFR *a_ref, const float a_radius)
 Get the closest actor within a radius.
static RE::Actor * GetClosestNonPlayerTeammate (const RE::TESObjectREFR *a_ref, const float a_radius)
 Get the closest non-player teammate within a radius of a reference.
static void SetNPCLevel (RE::Actor *actor, uint16_t level)
 Runs the console command SetLevel to set an actor's level to the amount.
static float GetActorValuePercentage (RE::Actor *a_actor, RE::ActorValue a_av)
 Get the actor value percentage of an actor.

Static Private Member Functions

static RE::Actor * GetClosestFromVector (const RE::TESObjectREFR *a_ref, const std::vector< RE::Actor * > &actors)
 Helper function to get the closest actor from a vector.

Member Function Documentation

◆ ActorHasEffectOfTypeActive()

bool StyyxUtil::ActorUtil::ActorHasEffectOfTypeActive ( RE::Actor * a_actor,
RE::EffectArchetypes::ArchetypeID a_type )
inlinestatic

Check if actor has an effect of a specific type active.

Parameters
a_actorThe actor to check
a_typeThe Effect archetype needed
Returns
True if actor has an active effect with the set type
Here is the caller graph for this function:

◆ ActorHasEquippedHeavyArmor()

bool StyyxUtil::ActorUtil::ActorHasEquippedHeavyArmor ( RE::Actor * actor)
inlinestatic

Check if an actor has any heavy armor equipped. It returning false does not mean the actor has light armor equipped.

Parameters
actorActor to check
Returns
returns true if the actor has any heavy armor equipped

◆ ActorHasEquippedLightArmor()

bool StyyxUtil::ActorUtil::ActorHasEquippedLightArmor ( const RE::Actor * actor)
inlinestatic

Check if an actor has any light armor equipped. It returning false does not mean the actor has heavy armor equipped.

Parameters
actorActor to check
Returns
returns true if the actor has any light armor equipped

◆ ActorHasItem()

bool StyyxUtil::ActorUtil::ActorHasItem ( RE::Actor * actor,
RE::TESBoundObject * item )
inlinestatic

Check if actor has the specified item in the inventory.

Parameters
actorThe actor to check
itemThe item to look for
Returns
True if actor has at least one of the item

◆ ActorHasQuestObjectInHand()

bool StyyxUtil::ActorUtil::ActorHasQuestObjectInHand ( RE::Actor * actor)
inlinestatic

Check if actor has Quest item as weapon.

Parameters
actorThe actor to check the equipped item of
Returns
True if the actor has a quest item equipped

◆ AddItem()

void StyyxUtil::ActorUtil::AddItem ( RE::Actor * a_actor,
RE::TESBoundObject * a_item,
RE::ExtraDataList * a_extraList,
int a_count,
RE::TESObjectREFR * a_fromRefr )
inlinestatic

Add item to actor.

Parameters
a_actorThe actor to add the item to
a_itemThe item to add
a_extraListThe extra data to add
a_countThe amount to add
a_fromRefrThe reference the item is coming from
Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddItemPlayer()

void StyyxUtil::ActorUtil::AddItemPlayer ( RE::TESBoundObject * a_item,
const int a_count )
inlinestatic

Helper function to add an item to the player.

Parameters
a_itemThe item to add to the player
a_countThe amount to add
Here is the call graph for this function:

◆ FullyHealActor()

void StyyxUtil::ActorUtil::FullyHealActor ( RE::Actor * a_actor)
inlinestatic

Fully heals all 3 attributes of an actor.

Parameters
a_actorThe actor to heal
Here is the call graph for this function:

◆ GetActorValuePercentage()

float StyyxUtil::ActorUtil::GetActorValuePercentage ( RE::Actor * a_actor,
RE::ActorValue a_av )
inlinestatic

Get the actor value percentage of an actor.

Parameters
a_actorThe actor to get the value from
a_avThe Actor Value to get
Returns
float between 0.0 and 1.0
Note
0.0 means 0% and 1.0 means 100%
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetClosestActor()

RE::Actor * StyyxUtil::ActorUtil::GetClosestActor ( const RE::TESObjectREFR * a_ref,
const float a_radius )
inlinestatic

Get the closest actor within a radius.

Parameters
a_refThe reference to get the closest actor to
a_radiusThe radius in which the closest actor gets searched
Returns
The closest actor if any are there. nullptr if none are found
Here is the call graph for this function:

◆ GetClosestFromVector()

RE::Actor * StyyxUtil::ActorUtil::GetClosestFromVector ( const RE::TESObjectREFR * a_ref,
const std::vector< RE::Actor * > & actors )
inlinestaticprivate

Helper function to get the closest actor from a vector.

Parameters
a_refThe reference to check
actorsA vector with Actors
Returns
The closest actor to a ref in a vector
Here is the caller graph for this function:

◆ GetClosestNonPlayerTeammate()

RE::Actor * StyyxUtil::ActorUtil::GetClosestNonPlayerTeammate ( const RE::TESObjectREFR * a_ref,
const float a_radius )
inlinestatic

Get the closest non-player teammate within a radius of a reference.

Parameters
a_refThe ref to check the closest non-teammate of
a_radiusThe radius to check within
Returns
The closest non-teammate actor. Or nullptr if there are none
Here is the call graph for this function:

◆ GetCurrentLightLevel()

float StyyxUtil::ActorUtil::GetCurrentLightLevel ( const RE::Actor * a_actor)
inlinestatic

Get the current light level the actor is standing in.

Parameters
a_actorThe actor to check
Returns
The current light level or 0.0 if the actor process can't be found
Here is the caller graph for this function:

◆ GetCurrentLightLevelPlayer()

float StyyxUtil::ActorUtil::GetCurrentLightLevelPlayer ( )
inlinestatic

Get the light level the player is standing in.

Returns
GetCurrentLightLevel() for the player
Here is the call graph for this function:

◆ GetMaxHealth()

float StyyxUtil::ActorUtil::GetMaxHealth ( RE::Actor * a_actor)
inlinestatic

Get maximum Health of an actor.

Parameters
a_actorThe actor to check
Returns
The maximum health including temporary modifiers
Note
Credits: Blade and Blunt by colinswrath
Here is the caller graph for this function:

◆ GetMaxMagicka()

float StyyxUtil::ActorUtil::GetMaxMagicka ( RE::Actor * actor)
inlinestatic

Get maximum Magicka of an actor.

Parameters
actorThe actor to check
Returns
The maximum Magicka including temporary modifiers
Here is the caller graph for this function:

◆ GetMaxStamina()

float StyyxUtil::ActorUtil::GetMaxStamina ( RE::Actor * actor)
inlinestatic

Get maximum Stamina of an actor.

Parameters
actorThe actor to check
Returns
The maximum Stamina including temporary modifiers
Here is the caller graph for this function:

◆ GetNearbyActors()

std::vector< RE::Actor * > StyyxUtil::ActorUtil::GetNearbyActors ( const RE::TESObjectREFR * a_ref,
const float a_radius,
const bool a_ignorePlayer )
inlinestatic

Get all nearby actors.

Parameters
a_refThe reference to check nearby
a_radiusThe radius to search for actors
a_ignorePlayerIgnore the player as actor
Returns
vector of all actors in a set radius around a reference
Note
Credits: Papyrus Extender by PO3
Here is the caller graph for this function:

◆ GetNearbyNonPlayerTeammates()

std::vector< RE::Actor * > StyyxUtil::ActorUtil::GetNearbyNonPlayerTeammates ( const RE::TESObjectREFR * a_ref,
const float a_radius )
inlinestatic

Search all non-teammates within a certain radius.

Parameters
a_refThe reference to search nearby actors for
a_radiusThe radius within actors are searched for
Returns
A vector of all actors that are not PlayerTeammates within a certain radius
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetPerksFromBaseActor()

void StyyxUtil::ActorUtil::GetPerksFromBaseActor ( RE::Actor * a_actor,
std::vector< RE::BGSPerk * > & perks )
inlinestatic

Fills a vector<RE::BGSPerk*> reference with all the perks an actor inherits from the actor base.

Parameters
a_actorActor which the perks are gotten from
perksvector reference all the perks are added to

◆ GetPlayerCell()

RE::TESObjectCELL * StyyxUtil::ActorUtil::GetPlayerCell ( )
inlinestatic

Get the current cell the player is in.

Returns
The current cell the player is in or nullptr if it can't be found

◆ GetPlayerMount()

RE::Actor * StyyxUtil::ActorUtil::GetPlayerMount ( )
inlinestatic

Get the player mount.

Returns
The mount as actor

◆ GetWieldingWeapon()

RE::TESObjectWEAP * StyyxUtil::ActorUtil::GetWieldingWeapon ( RE::Actor * a_actor)
inlinestatic

Get the weapon a character is currently wielding.

Parameters
a_actorThe actor to check
Returns
The weapon the actor is currently wielding. If none, returns nullptr
Note
Credits: Valhalla Combat by D7ry

◆ HasEffectWithKeywordActive()

bool StyyxUtil::ActorUtil::HasEffectWithKeywordActive ( RE::Actor * a_actor,
const std::string_view a_keyword )
inlinestatic

Check if an actor has an effect active with a specific keyword.

Parameters
a_actorThe actor to check
a_keywordThe keyword an effect should have
Returns
True if the actor has an active effect with the keyword

◆ IsBashing()

bool StyyxUtil::ActorUtil::IsBashing ( const RE::Actor * actor)
inlinestatic

Check if an actor is shield bashing.

Parameters
actorThe actor to check
Returns
True if actor is attacking with a bash

◆ IsDragon()

bool StyyxUtil::ActorUtil::IsDragon ( const RE::Actor * a_actor)
inlinestatic

Check if actor is a dragon.

Parameters
a_actorThe actor to check
Returns
True if actor has the Dragon keyword
Note
the Default Object in skyrim.esm is empty for that
This is a mod that fixes this
Here we do a manual lookup in case the default object is null

◆ IsEffectActive()

bool StyyxUtil::ActorUtil::IsEffectActive ( RE::Actor * a_actor,
const RE::EffectSetting * a_effect )
inlinestatic

Check if an actor has a specific effect active.

Parameters
a_actorThe actor to check
a_effectThe effect to check for
Returns
true if the specified effect is active

◆ IsGuardNearby()

bool StyyxUtil::ActorUtil::IsGuardNearby ( const RE::TESObjectREFR * a_ref,
const float a_radius )
inlinestatic

Check if any actor within a certain radius is a guard.

Parameters
a_refThe reference to check
a_radiusThe radius to search a guard in
Returns
True if any actor within the radius is a guard
Here is the call graph for this function:

◆ IsInOpportunityState()

bool StyyxUtil::ActorUtil::IsInOpportunityState ( RE::Actor * victim,
const RE::Actor * attacker )
inlinestatic

Very specific function used to see if an Actor is in a state an attack of opportunity should be possible.

Parameters
victimThe actor being attacked
attackerThe attacking Actor
Returns
True if Actor is in a state an attack of opportunity should be possible
Here is the call graph for this function:

◆ IsPowerAttacking()

bool StyyxUtil::ActorUtil::IsPowerAttacking ( const RE::Actor * actor)
inlinestatic

Check if an actor is power attacking.

Parameters
actorThe actor to check
Returns
True if actor is power attacking
Here is the caller graph for this function:

◆ IsUndead()

bool StyyxUtil::ActorUtil::IsUndead ( RE::Actor * a_ref)
inlinestatic

Check if actor is undead.

Parameters
a_refActor to check
Returns
True if actor has the default object keyword for undead

◆ IsVampire()

bool StyyxUtil::ActorUtil::IsVampire ( RE::Actor * a_ref)
inlinestatic

Check if actor is vampire.

Parameters
a_refActor to check
Returns
True if actor has the default object keyword for vampires

◆ RemoveItemPlayer()

int StyyxUtil::ActorUtil::RemoveItemPlayer ( RE::TESBoundObject * item,
int count )
inlinestatic

Remove item from the player.

Parameters
itemThe item to remove
countThe amount ot remove
Returns
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetNPCLevel()

void StyyxUtil::ActorUtil::SetNPCLevel ( RE::Actor * actor,
uint16_t level )
inlinestatic

Runs the console command SetLevel to set an actor's level to the amount.

Parameters
actorThe actor to set the level of
levelThe level the actor gets set to
Note
The console command also updates the actor's stats which the standalone function does not do automatically
Here is the call graph for this function:

◆ StartsDead()

bool StyyxUtil::ActorUtil::StartsDead ( const RE::Actor * actor)
inlinestatic

Check if actor is supposed to spawn dead.

Parameters
actorThe Actor to check
Returns
True if actor has the Start Dead flag set
Note
Credits: SPID by PO3

◆ TryStagger()

void StyyxUtil::ActorUtil::TryStagger ( RE::Actor * a_target,
float a_staggerMult,
RE::Actor * a_aggressor )
inlinestatic

Try to stagger a target.

Parameters
a_targetThe target to stagger
a_staggerMultThe stagger multiplier
a_aggressorThe attacker
Note
Credits: Chocolate Poise by doodlez
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this struct was generated from the following file: