Monster
Namespace: SharpPluginLoader.Core.Entities
public class Monster : Entity
Inheritance Object → NativeWrapper → MtObject → Model → Entity → Monster
Properties
SingletonInstance
The sEnemy singleton instance
public static nint SingletonInstance { get; }
Property Value
Type
The id of the monster
public MonsterType Type { get; }
Property Value
Variant
The variant (sub id) of the monster
public uint Variant { get; }
Property Value
Name
The name of the monster
public string Name { get; }
Property Value
Health
The current health of the monster
public Single& Health { get; }
Property Value
MaxHealth
The maximum health of the monster
public Single& MaxHealth { get; }
Property Value
Speed
The speed of the monster (1.0 is normal speed)
public Single& Speed { get; }
Property Value
DespawnTime
The despawn time of the monster (in seconds)
public Single& DespawnTime { get; }
Property Value
DifficultyIndex
The index of the monster in the difficulty table (dtt_dif)
public UInt32& DifficultyIndex { get; }
Property Value
Frozen
Freezes the monster and pauses all ai processing
public bool Frozen { get; set; }
Property Value
AiData
The AI data of the monster
public nint AiData { get; }
Property Value
CollisionComponent
Gets the entity's collision component
public CollisionComponent CollisionComponent { get; }
Property Value
ActionController
The entity's action controller
public ActionController ActionController { get; }
Property Value
Position
The position of the model
public MtVector3& Position { get; }
Property Value
Size
The size of the model
public MtVector3& Size { get; }
Property Value
CollisionPosition
The position of the model's collision box
public MtVector3& CollisionPosition { get; }
Property Value
Rotation
The rotation of the model
public MtQuaternion& Rotation { get; }
Property Value
Forward
The model's forward vector
public MtVector3 Forward { get; }
Property Value
AnimationFrame
The current frame of the model's current animation
public float AnimationFrame { get; set; }
Property Value
MaxAnimationFrame
The frame count of the model's current animation
public float MaxAnimationFrame { get; set; }
Property Value
AnimationSpeed
The speed of the model's current animation. Note, this value gets set every frame.
public float AnimationSpeed { get; set; }
Property Value
CurrentAnimation
Gets the current animation of the model
public AnimationId& CurrentAnimation { get; }
Property Value
AnimationLayer
The model's animation component
public AnimationLayerComponent AnimationLayer { get; }
Property Value
MotionLists
The model's motion lists.
public IEnumerable<MotionList> MotionLists { get; }
Property Value
Instance
The native pointer.
public nint Instance { get; set; }
Property Value
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
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
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()