Struct ReadyMainCharacter
Namespace: OblivionMp.Sdk.Entities.Player
Assembly: OblivionMp.Sdk.dll
Represents the player character entity in the game, providing access to its properties.
public readonly struct ReadyMainCharacter : IReadyEntity<ReadyMainCharacter>
Implements
IReadyEntity<ReadyMainCharacter>
Inherited Members
object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Extension Methods
ReadyObjectExtensions.SetLocationRotation<ReadyMainCharacter>(ReadyMainCharacter, Vector3, Vector3)
Properties
Animation
Set of flags useful for checking which actions is the player is currently performing.
public ReadyMainCharacter.AnimationApi Animation { get; }
Property Value
ReadyMainCharacter.AnimationApi
ArrowCount
Gets number of arrows left in quiver.
public int ArrowCount { get; set; }
Property Value
CustomSpells
public IEnumerable<CustomSpell> CustomSpells { get; }
Property Value
Fatigue
Current Fatigue (Green bar) of the character. Does not impact MaxFatigue value.
public float Fatigue { get; set; }
Property Value
HasQuiverEquipped
Checks whether character has any arrows equipped.
public bool HasQuiverEquipped { get; }
Property Value
HasTorchEquipped
Checks whether character has a torch equipped.
public bool HasTorchEquipped { get; }
Property Value
Hp
Current Hp (HealthPoints) of the character. Unclear behavior as of now. Some actions reset it to MaxHp while some modify only this value. Does not impact MaxHp value.
public float Hp { get; set; }
Property Value
InCombat
Checks whether the character is in active combat.
public bool InCombat { get; }
Property Value
InDialogue
Checks whether the character is in active dialogue menu.
public bool InDialogue { get; }
Property Value
IsDead
public bool IsDead { get; }
Property Value
IsValid
public bool IsValid { get; }
Property Value
KnownCustomPotionTypes
public IEnumerable<CustomPotion> KnownCustomPotionTypes { get; }
Property Value
Magicka
Current Magicka (Mana) of the character. Does not impact MaxMagicka value.
public float Magicka { get; set; }
Property Value
MaxHp
Current base Hp (HealthPoints) of the character. Unclear behavior as of now. Some actions reset it to MaxHp while some modify only this value. Does not impact MaxHp value.
public float MaxHp { get; set; }
Property Value
Nickname
Gets the visible player nickname.
public string Nickname { get; }
Property Value
PlayerId
Gets the Player ID.
public PlayerId PlayerId { get; }
Property Value
Position
public Vector3 Position { get; set; }
Property Value
Rotation
public float Rotation { get; set; }
Property Value
Sex
Character gender.
public CharacterSex Sex { get; set; }
Property Value
Visibility
How visible the character currently is, from 0 (fully hidden) to 1 (fully visible).
public float Visibility { get; }
Property Value
Methods
AddItemToInventory(FormId, int)
Add the specified item to the inventory. Check Items for item list.
public void AddItemToInventory(FormId itemId, int quantity)
Parameters
itemId FormId
The FormId of the item to add.
quantity int
Number of items to add.
ClearInventory()
Clear character inventory.
public void ClearInventory()
Get<T>()
Get a reference to a component of type T on the player character entity.
public ref T Get<T>() where T : struct, IComponent
Returns
T
Type Parameters
T
GetAttribute(CharacterAttribute)
Gets the target attribute value from the character.
public float GetAttribute(CharacterAttribute attribute)
Parameters
attribute CharacterAttribute
Type of attribute
Returns
Current level of specified attribute
Examples
player.GetAttribute(CharacterAttribute.Security);
GetEffectValue(CharacterEffect)
Gets the target effect value from character.
public float GetEffectValue(CharacterEffect effect)
Parameters
effect CharacterEffect
Type of effect
Returns
Strength of the effect
GetGlobal<T>()
Get a reference to a component of type T on the global player archetype entity associated with this player character entity.
public ref T GetGlobal<T>() where T : struct, IComponent
Returns
T
Type Parameters
T
GetSocialAttribute(CharacterSocialAttribute)
Gets the social interaction attribute level
public float GetSocialAttribute(CharacterSocialAttribute attribute)
Parameters
attribute CharacterSocialAttribute
Type of social attribute
Returns
Current level of the attribute
HasItemInInventory(FormId)
Checks whether the character has the specified item in the inventory.
public bool HasItemInInventory(FormId itemId)
Parameters
itemId FormId
Target item FormId.
Returns
True if at least one item of given FormId is found in inventory.
HasItemInInventory(FormId, out int)
Checks whether the character has the specified item in the inventory.
public bool HasItemInInventory(FormId itemId, out int itemCount)
Parameters
itemId FormId
Target item FormId.
itemCount int
Possessed item count.
Returns
True if at least one item of given FormId is found in inventory.
RebirthLocalPlayer()
Rebirths (revives) the local player character.
public void RebirthLocalPlayer()
RemoveItemFromInventory(FormId, int)
Remove an item from the player's inventory. Check Items for item list. If the quantity to remove is greater than the current quantity, the item will be completely removed from the inventory.
public void RemoveItemFromInventory(FormId itemId, int quantity = 2147483647)
Parameters
itemId FormId
FormId of the item to remove.
quantity int
The quantity of the item to remove. Defaults to int.MaxValue, which will remove all instances of the item.
SetAttribute(CharacterAttribute, float)
Sets the target attribute to specified value.
public void SetAttribute(CharacterAttribute attribute, float value)
Parameters
attribute CharacterAttribute
Type of attribute
value float
Desired level of the attribute
SetEffectValue(CharacterEffect, float)
Sets the target effect on character.
public void SetEffectValue(CharacterEffect effect, float value)
Parameters
effect CharacterEffect
Type of effect
value float
Strength of the effect
SetSocialAttribute(CharacterSocialAttribute, float)
Sets the specified social interaction attribute to desired level
public void SetSocialAttribute(CharacterSocialAttribute attribute, float value)
Parameters
attribute CharacterSocialAttribute
Type of social attribute
value float
Desired level of the social attribute
Operators
explicit operator ReadyMainCharacter(ReadyObject)
public static explicit operator ReadyMainCharacter(ReadyObject obj)
Parameters
obj ReadyObject
Returns
explicit operator ReadyMainCharacter(ReadyCharacter)
public static explicit operator ReadyMainCharacter(ReadyCharacter character)
Parameters
character ReadyCharacter
Returns
implicit operator ReadyObject(ReadyMainCharacter)
public static implicit operator ReadyObject(ReadyMainCharacter mainCharacter)
Parameters
mainCharacter ReadyMainCharacter
Returns
implicit operator ReadyCharacter(ReadyMainCharacter)
public static implicit operator ReadyCharacter(ReadyMainCharacter mainCharacter)
Parameters
mainCharacter ReadyMainCharacter