Monster

Namespace: SharpPluginLoader.Core.Entities

public class Monster : Entity

Inheritance ObjectNativeWrapperMtObjectModelEntityMonster

Properties

SingletonInstance

The sEnemy singleton instance

public static nint SingletonInstance { get; }

Property Value

IntPtr

Type

The id of the monster

public MonsterType Type { get; }

Property Value

MonsterType

Variant

The variant (sub id) of the monster

public uint Variant { get; }

Property Value

UInt32

Name

The name of the monster

public string Name { get; }

Property Value

String

Health

The current health of the monster

public Single& Health { get; }

Property Value

Single&

MaxHealth

The maximum health of the monster

public Single& MaxHealth { get; }

Property Value

Single&

Speed

The speed of the monster (1.0 is normal speed)

public Single& Speed { get; }

Property Value

Single&

DespawnTime

The despawn time of the monster (in seconds)

public Single& DespawnTime { get; }

Property Value

Single&

DifficultyIndex

The index of the monster in the difficulty table (dtt_dif)

public UInt32& DifficultyIndex { get; }

Property Value

UInt32&

Frozen

Freezes the monster and pauses all ai processing

public bool Frozen { get; set; }

Property Value

Boolean

AiData

The AI data of the monster

public nint AiData { get; }

Property Value

IntPtr

CollisionComponent

Gets the entity's collision component

public CollisionComponent CollisionComponent { get; }

Property Value

CollisionComponent

ActionController

The entity's action controller

public ActionController ActionController { get; }

Property Value

ActionController

Position

The position of the model

public MtVector3& Position { get; }

Property Value

MtVector3&

Size

The size of the model

public MtVector3& Size { get; }

Property Value

MtVector3&

CollisionPosition

The position of the model's collision box

public MtVector3& CollisionPosition { get; }

Property Value

MtVector3&

Rotation

The rotation of the model

public MtQuaternion& Rotation { get; }

Property Value

MtQuaternion&

Forward

The model's forward vector

public MtVector3 Forward { get; }

Property Value

MtVector3

AnimationFrame

The current frame of the model's current animation

public float AnimationFrame { get; set; }

Property Value

Single

MaxAnimationFrame

The frame count of the model's current animation

public float MaxAnimationFrame { get; set; }

Property Value

Single

AnimationSpeed

The speed of the model's current animation. Note, this value gets set every frame.

public float AnimationSpeed { get; set; }

Property Value

Single

CurrentAnimation

Gets the current animation of the model

public AnimationId& CurrentAnimation { get; }

Property Value

AnimationId&

AnimationLayer

The model's animation component

public AnimationLayerComponent AnimationLayer { get; }

Property Value

AnimationLayerComponent

MotionLists

The model's motion lists.

public IEnumerable<MotionList> MotionLists { get; }

Property Value

IEnumerable<MotionList>

Instance

The native pointer.

public nint Instance { get; set; }

Property Value

IntPtr

Constructors

Monster(IntPtr)

Constructs a new Monster from a native pointer

public Monster(nint instance)

Parameters

instance IntPtr
The native pointer

Monster()

Constructs a new Monster from a nullptr

public Monster()

Methods

GetAllMonsters()

Gets a list of all monsters in the game

public static IEnumerable<Monster> GetAllMonsters()

Returns

IEnumerable<Monster>

ForceAction(Int32)

Forces the monster to do a given action. This will interrupt the current action.

public void ForceAction(int id)

Parameters

id Int32
The id of the action to execute

Enrage()

Tries to enrage the monster

public bool Enrage()

Returns

Boolean

Unenrage()

Unenrages the monster

public void Unenrage()

SetTarget(IntPtr)

Sets the monster's target

public void SetTarget(nint target)

Parameters

target IntPtr

CreateShell(UInt32, MtVector3, Nullable<MtVector3>)

public void CreateShell(uint index, MtVector3 target, Nullable<MtVector3> origin)

Parameters

index UInt32

target MtVector3

origin Nullable<MtVector3>

ToString(MonsterType)

Gets the human readable name of the given monster id

public static string ToString(MonsterType type)

Parameters

type MonsterType
The monster id

Returns

String
The human readable name of the monster

Remarks:

This is equivalent to the Monster.Name property on a monster with this

DisableSpeedReset()

Disables the periodic speed reset that the game does

public static void DisableSpeedReset()

Remarks:

Call this before changing the Monster.Speed property on a monster. This setting applies globally

EnableSpeedReset()

Reenables the periodic speed reset that the game does

public static void EnableSpeedReset()