Skip to main content
Version: 0.2.0

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

int

CustomSpells

public IEnumerable<CustomSpell> CustomSpells { get; }

Property Value

IEnumerable<CustomSpell>

Fatigue

Current Fatigue (Green bar) of the character. Does not impact MaxFatigue value.

public float Fatigue { get; set; }

Property Value

float

HasQuiverEquipped

Checks whether character has any arrows equipped.

public bool HasQuiverEquipped { get; }

Property Value

bool

HasTorchEquipped

Checks whether character has a torch equipped.

public bool HasTorchEquipped { get; }

Property Value

bool

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

float

InCombat

Checks whether the character is in active combat.

public bool InCombat { get; }

Property Value

bool

InDialogue

Checks whether the character is in active dialogue menu.

public bool InDialogue { get; }

Property Value

bool

IsDead

public bool IsDead { get; }

Property Value

bool

IsValid

public bool IsValid { get; }

Property Value

bool

KnownCustomPotionTypes

public IEnumerable<CustomPotion> KnownCustomPotionTypes { get; }

Property Value

IEnumerable<CustomPotion>

Magicka

Current Magicka (Mana) of the character. Does not impact MaxMagicka value.

public float Magicka { get; set; }

Property Value

float

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

float

Nickname

Gets the visible player nickname.

public string Nickname { get; }

Property Value

string

PlayerId

Gets the Player ID.

public PlayerId PlayerId { get; }

Property Value

PlayerId

Position

public Vector3 Position { get; set; }

Property Value

Vector3

Rotation

public float Rotation { get; set; }

Property Value

float

Sex

Character gender.

public CharacterSex Sex { get; set; }

Property Value

CharacterSex

Visibility

How visible the character currently is, from 0 (fully hidden) to 1 (fully visible).

public float Visibility { get; }

Property Value

float

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

float

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

float

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

float

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

bool

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

bool

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

ReadyMainCharacter

explicit operator ReadyMainCharacter(ReadyCharacter)

public static explicit operator ReadyMainCharacter(ReadyCharacter character)

Parameters

character ReadyCharacter

Returns

ReadyMainCharacter

implicit operator ReadyObject(ReadyMainCharacter)

public static implicit operator ReadyObject(ReadyMainCharacter mainCharacter)

Parameters

mainCharacter ReadyMainCharacter

Returns

ReadyObject

implicit operator ReadyCharacter(ReadyMainCharacter)

public static implicit operator ReadyCharacter(ReadyMainCharacter mainCharacter)

Parameters

mainCharacter ReadyMainCharacter

Returns

ReadyCharacter

  • Properties
    • Animation
    • ArrowCount
    • CustomSpells
    • Fatigue
    • HasQuiverEquipped
    • HasTorchEquipped
    • Hp
    • InCombat
    • InDialogue
    • IsDead
    • IsValid
    • KnownCustomPotionTypes
    • Magicka
    • MaxHp
    • Nickname
    • PlayerId
    • Position
    • Rotation
    • Sex
    • Visibility
  • Methods
    • AddItemToInventory(FormId, int)
    • ClearInventory()
    • Get<T>()
    • GetAttribute(CharacterAttribute)
    • GetEffectValue(CharacterEffect)
    • GetGlobal<T>()
    • GetSocialAttribute(CharacterSocialAttribute)
    • HasItemInInventory(FormId)
    • HasItemInInventory(FormId, out int)
    • RebirthLocalPlayer()
    • RemoveItemFromInventory(FormId, int)
    • SetAttribute(CharacterAttribute, float)
    • SetEffectValue(CharacterEffect, float)
    • SetSocialAttribute(CharacterSocialAttribute, float)
  • Operators
    • explicit operator ReadyMainCharacter(ReadyObject)
    • explicit operator ReadyMainCharacter(ReadyCharacter)
    • implicit operator ReadyObject(ReadyMainCharacter)
    • implicit operator ReadyCharacter(ReadyMainCharacter)