Skip to content

ObjectManager » Models » IUnit

Namespace: Mayo.Manager.Objects
Namespace: Mayo.Manager.Objects.Interface
Dependencies: IUnitIBase


UInt128 TargetGUID

Returns the GUID of the current selected target.
Returns 0 if no target is selected.

int TargetDisplayID

Returns the Display ID of the current selected target.
Returns 0 if no target is selected or target has no Display ID.

IUnit? TargetUnit

Returns IUnit of the current selected target.
Returns null if no unit is selected.

IPlayer? TargetPlayer

Returns IPlayer of the current selected target.
Returns null if no player is selected.

int DisplayID

Returns the NPC ID.

int Level
int CurrentHealth
int MaxHealth
int CurrentHealthInPercent
int CurrentPower

Returns the current power based on the class or form.
Druid in cat form, for example, returns the current energy.

int MaxPower

Returns the maximum available power based on the class or form.
Druid in cat form, for example, would return 100.

int CurrentPowerInPercent
int CurrentMana

Always returns the current mana value, regardless of class or form.

int MaxMana

Always returns the maximum available mana value, regardless of class or form.

int CurrentManaInPercent
float Rotation

Horizontal alignment.

float Pitch

Vertical alignment.

string Name
float Speed

Current movement speed in yards per second.

bool IsMoving

Returns true if the movement speed is greater than 0.
This does not include horizontal and vertical rotation while standing still.

float PositionZ
Vector3 Position
Vector2 PositionV2
bool IsCasting
bool IsChanneling
bool IsCastingOrChanneling
Constants.UnitClass Class
bool IsClass(Constants.UnitClass)
bool IsManaClass

Returns true if the class has the Power "Mana".
The current status (form) is not taken into account.

Constants.UnitRace Race
bool IsRace(Constants.UnitRace)
bool IsAlliance
bool IsHorde
bool IsNPC
bool IsHostile
bool IsNeutral
bool IsHostileOrNeutral
bool IsInCombat
bool IsInCombatWithMe

Returns true if this unit is currently in combat with me.

bool IsFleeing
bool IsRunningBack

This happens when an NPC that's chasing you runs back to its starting position.

bool IsStunned
bool IsSkinnable
bool IsPlayerControlled

Returns true if this unit is controlled by a player.
This also applies to pets.

bool IsLootable
bool IsHerbable
bool IsMineable
bool HasTarget
bool IsTargetingMe
bool IsTargetingMyPet
bool IsPet
bool IsMyPet
bool IsInCombatWithAnotherPlayer
bool IsInCombatWithAnotherPlayerOrPet

Returns true if this unit is in combat with another player or pet (any).

int MountDisplayID

Returns the Display ID of the current used Mount.
Returns 0 if not mounted.

bool IsAlive
bool IsDead
bool IsMounted
bool IsFlying
bool IsSwimming
Constants.CreatureType CreatureType
bool IsCreatureType(Constants.CreatureType)
Constants.CreatureRank CreatureRank
bool IsCreatureRank(Constants.CreatureRank)
List<Mayo.Manager.Spells.Aura> Auras

Returns a list of all active auras.
See: SpellManager → Auras

List<Mayo.Manager.Spells.Aura> Buffs

Returns a list of all active "helpful" auras.
See: SpellManager → Auras

List<Mayo.Manager.Spells.Aura> Debuffs

Returns a list of all active "harmful" auras.
See: SpellManager → Auras

bool HasAura(int AuraID)
bool HasAura(string AuraName)

The name must be in English.

int GetAuraStackCount(int AuraID)

Returns 0 if no aura has been found.

int GetAuraStackCount(string AuraName)

The name must be in English.
Returns 0 if no aura has been found.

bool IsAuctioneer
bool IsBanker
bool IsBattleMaster
bool IsFlightMaster
bool IsGossip
bool IsInnkeeper
bool IsPetitioner
bool IsQuestgiver
bool CanRepair
bool IsSpiritGuide
bool IsSpiritHealer
bool IsStablemaster
bool IsTabardDesigner
bool IsTrainer
bool IsTrainerClass
bool IsTrainerProfession
bool IsVendor
bool IsVendorAmmo
bool IsVendorFood
bool IsVendorPoison
bool IsVendorReagent
Constants.ShapeshiftForm ShapeshiftForm
bool IsInShapeshiftForm(Constants.ShapeshiftForm)
bool IsInCatForm
bool IsInTreeOfLifeForm
bool IsInTravelForm
bool IsInAquaticForm
bool IsInBearForm
bool IsInMoonkinForm
bool IsInFlightForm
bool IsInGhostWolfForm
bool IsInShadowForm
bool IsInGhoulForm
bool IsInBattleStance
bool IsInDefensiveStance
bool IsInBerserkerStance
bool IsInStealth
double Distance3D

Returns the distance in yards, taking into account the height between the character and this unit.
Always preferred.

double Distance2D

Returns the direct distance between this unit and the character.
Distance3D should be the preferred choice.

bool IsInFront
double HeightDifference

+ = Above
- = Below

double AbsHeightDifference
List<IModel> GetAttackers

Returns a list of all attackers attacking this unit.
See: IModel

int GetNumAttackers

Returns the number of attackers attacking this unit.

bool HasAttackers
bool IsInteractedByAnotherPlayer

Returns true if this unit is interacting with any player.

bool IsInLightOfSight

Returns true if this unit is within sight.

double ApproachTimeInSec

Returns the approximate number of seconds it takes for your character to reach this unit.