Table of Contents

Class UOMobileEntity

Namespace
Moongate.UO.Data.Persistence.Entities
Assembly
Moongate.UO.Data.dll

Minimal mobile entity implementation used by race and map systems.

public class UOMobileEntity : IMobileEntity, IPositionEntity, IUOEntity
Inheritance
UOMobileEntity
Implements
Inherited Members

Properties

AccountId

public Serial AccountId { get; set; }

Property Value

Serial

BackpackId

Gets or sets the serial of the backpack item.

public Serial BackpackId { get; set; }

Property Value

Serial

BaseBody

public Body? BaseBody { get; set; }

Property Value

Body?

Body

public Body Body { get; set; }

Property Value

Body

ColdResistance

public int ColdResistance { get; set; }

Property Value

int

CreatedUtc

public DateTime CreatedUtc { get; set; }

Property Value

DateTime

Dexterity

public int Dexterity { get; set; }

Property Value

int

Direction

public DirectionType Direction { get; set; }

Property Value

DirectionType

EnergyResistance

public int EnergyResistance { get; set; }

Property Value

int

EquippedItemIds

Gets equipped item references by layer.

public Dictionary<ItemLayerType, Serial> EquippedItemIds { get; set; }

Property Value

Dictionary<ItemLayerType, Serial>

EquippedItemReferences

Gets runtime equipped-item snapshots keyed by equipment layer. This cache is not used for persistence.

public IReadOnlyDictionary<ItemLayerType, ItemReference> EquippedItemReferences { get; }

Property Value

IReadOnlyDictionary<ItemLayerType, ItemReference>

Experience

public long Experience { get; set; }

Property Value

long

FacialHairHue

public short FacialHairHue { get; set; }

Property Value

short

FacialHairStyle

public short FacialHairStyle { get; set; }

Property Value

short

FireResistance

public int FireResistance { get; set; }

Property Value

int

Gender

Gets the mobile gender.

public GenderType Gender { get; set; }

Property Value

GenderType

HairHue

public short HairHue { get; set; }

Property Value

short

HairStyle

public short HairStyle { get; set; }

Property Value

short

Hits

public int Hits { get; set; }

Property Value

int

Id

Gets the unique serial identifier.

public Serial Id { get; set; }

Property Value

Serial

IgnoreMobiles

public bool IgnoreMobiles { get; set; }

Property Value

bool

Intelligence

public int Intelligence { get; set; }

Property Value

int

IsAlive

Gets whether this mobile is alive.

public bool IsAlive { get; set; }

Property Value

bool

IsBlessed

public bool IsBlessed { get; set; }

Property Value

bool

IsFlying

public bool IsFlying { get; set; }

Property Value

bool

IsFrozen

public bool IsFrozen { get; set; }

Property Value

bool

IsHidden

public bool IsHidden { get; set; }

Property Value

bool

IsInvulnerable

public bool IsInvulnerable { get; set; }

Property Value

bool

IsMounted

public bool IsMounted { get; set; }

Property Value

bool

IsParalyzed

public bool IsParalyzed { get; set; }

Property Value

bool

IsPlayer

Gets whether this mobile is player-controlled.

public bool IsPlayer { get; set; }

Property Value

bool

IsPoisoned

public bool IsPoisoned { get; set; }

Property Value

bool

IsWarMode

public bool IsWarMode { get; set; }

Property Value

bool

LastLoginUtc

public DateTime LastLoginUtc { get; set; }

Property Value

DateTime

Level

public int Level { get; set; }

Property Value

int

Location

Gets or sets the entity world location.

public Point3D Location { get; set; }

Property Value

Point3D

Luck

public int Luck { get; set; }

Property Value

int

Mana

public int Mana { get; set; }

Property Value

int

Map

public Map? Map { get; set; }

Property Value

Map

MapId

public int MapId { get; set; }

Property Value

int

MaxHits

public int MaxHits { get; set; }

Property Value

int

MaxMana

public int MaxMana { get; set; }

Property Value

int

MaxStamina

public int MaxStamina { get; set; }

Property Value

int

Name

public string? Name { get; set; }

Property Value

string

Notoriety

public Notoriety Notoriety { get; set; }

Property Value

Notoriety

PoisonResistance

public int PoisonResistance { get; set; }

Property Value

int

Profession

public ProfessionInfo Profession { get; set; }

Property Value

ProfessionInfo

ProfessionId

public int ProfessionId { get; set; }

Property Value

int

Race

public Race? Race { get; set; }

Property Value

Race

RaceIndex

public byte RaceIndex { get; set; }

Property Value

byte

SkillPoints

public int SkillPoints { get; set; }

Property Value

int

SkinHue

public short SkinHue { get; set; }

Property Value

short

Stamina

public int Stamina { get; set; }

Property Value

int

StatPoints

public int StatPoints { get; set; }

Property Value

int

Strength

public int Strength { get; set; }

Property Value

int

Title

public string? Title { get; set; }

Property Value

string

Methods

AddEquippedItem(ItemLayerType, Serial)

Associates an equipped item id with this mobile without item metadata updates.

public void AddEquippedItem(ItemLayerType layer, Serial itemId)

Parameters

layer ItemLayerType
itemId Serial

AddEquippedItem(ItemLayerType, UOItemEntity)

Associates an equipped item with this mobile and updates item ownership metadata.

public void AddEquippedItem(ItemLayerType layer, UOItemEntity item)

Parameters

layer ItemLayerType
item UOItemEntity

EquipItem(ItemLayerType, UOItemEntity)

Equips an item and updates both persisted references and runtime cache.

public void EquipItem(ItemLayerType layer, UOItemEntity item)

Parameters

layer ItemLayerType

Target item layer.

item UOItemEntity

Equipped item entity.

GetBody()

public virtual Body GetBody()

Returns

Body

GetEquippedReference(ItemLayerType)

Gets runtime equipped-item reference for a layer, if present.

public ItemReference? GetEquippedReference(ItemLayerType layer)

Parameters

layer ItemLayerType

Equipment layer.

Returns

ItemReference?

Runtime equipped item reference; otherwise null.

GetPacketFlags(bool)

Calculates protocol packet flags for this mobile.

public virtual byte GetPacketFlags(bool stygianAbyss)

Parameters

stygianAbyss bool

Whether to use Stygian Abyss semantics (bit 0x04 is flying instead of poisoned).

Returns

byte

Packet flags byte for mobile update packets.

HasEquippedItem(ItemLayerType)

Gets whether an item is equipped in the specified layer.

public bool HasEquippedItem(ItemLayerType layer)

Parameters

layer ItemLayerType

Equipment layer.

Returns

bool

true when equipped.

HydrateEquipmentRuntime(IEnumerable<UOItemEntity>)

Hydrates runtime equipped-item references from resolved item entities.

public void HydrateEquipmentRuntime(IEnumerable<UOItemEntity> equippedItems)

Parameters

equippedItems IEnumerable<UOItemEntity>

Resolved equipped items for this mobile.

OverrideBody(Body)

public void OverrideBody(Body body)

Parameters

body Body

RecalculateMaxStats()

Recomputes max stat caps from base stats and clamps current values.

public void RecalculateMaxStats()

SetBody(Body)

public void SetBody(Body body)

Parameters

body Body

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

TryGetEquippedReference(ItemLayerType, out ItemReference)

Tries to get runtime equipped-item reference for a layer.

public bool TryGetEquippedReference(ItemLayerType layer, out ItemReference itemReference)

Parameters

layer ItemLayerType

Equipment layer.

itemReference ItemReference

Resolved runtime reference when found.

Returns

bool

true when runtime reference is available.

UnequipItem(ItemLayerType, UOItemEntity?)

Unequips an item layer and optionally clears metadata on a provided item instance.

public bool UnequipItem(ItemLayerType layer, UOItemEntity? item = null)

Parameters

layer ItemLayerType

Layer to unequip.

item UOItemEntity

Optional equipped item instance to clear metadata on.

Returns

bool

true when a layer entry existed and was removed.