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
BackpackId
Gets or sets the serial of the backpack item.
public Serial BackpackId { get; set; }
Property Value
BaseBody
public Body? BaseBody { get; set; }
Property Value
- Body?
Body
public Body Body { get; set; }
Property Value
ColdResistance
public int ColdResistance { get; set; }
Property Value
CreatedUtc
public DateTime CreatedUtc { get; set; }
Property Value
Dexterity
public int Dexterity { get; set; }
Property Value
Direction
public DirectionType Direction { get; set; }
Property Value
EnergyResistance
public int EnergyResistance { get; set; }
Property Value
EquippedItemIds
Gets equipped item references by layer.
public Dictionary<ItemLayerType, Serial> EquippedItemIds { get; set; }
Property Value
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
Experience
public long Experience { get; set; }
Property Value
FacialHairHue
public short FacialHairHue { get; set; }
Property Value
FacialHairStyle
public short FacialHairStyle { get; set; }
Property Value
FireResistance
public int FireResistance { get; set; }
Property Value
Gender
Gets the mobile gender.
public GenderType Gender { get; set; }
Property Value
HairHue
public short HairHue { get; set; }
Property Value
HairStyle
public short HairStyle { get; set; }
Property Value
Hits
public int Hits { get; set; }
Property Value
Id
Gets the unique serial identifier.
public Serial Id { get; set; }
Property Value
IgnoreMobiles
public bool IgnoreMobiles { get; set; }
Property Value
Intelligence
public int Intelligence { get; set; }
Property Value
IsAlive
Gets whether this mobile is alive.
public bool IsAlive { get; set; }
Property Value
IsBlessed
public bool IsBlessed { get; set; }
Property Value
IsFlying
public bool IsFlying { get; set; }
Property Value
IsFrozen
public bool IsFrozen { get; set; }
Property Value
IsHidden
public bool IsHidden { get; set; }
Property Value
IsInvulnerable
public bool IsInvulnerable { get; set; }
Property Value
IsMounted
public bool IsMounted { get; set; }
Property Value
IsParalyzed
public bool IsParalyzed { get; set; }
Property Value
IsPlayer
Gets whether this mobile is player-controlled.
public bool IsPlayer { get; set; }
Property Value
IsPoisoned
public bool IsPoisoned { get; set; }
Property Value
IsWarMode
public bool IsWarMode { get; set; }
Property Value
LastLoginUtc
public DateTime LastLoginUtc { get; set; }
Property Value
Level
public int Level { get; set; }
Property Value
Location
Gets or sets the entity world location.
public Point3D Location { get; set; }
Property Value
Luck
public int Luck { get; set; }
Property Value
Mana
public int Mana { get; set; }
Property Value
Map
public Map? Map { get; set; }
Property Value
MapId
public int MapId { get; set; }
Property Value
MaxHits
public int MaxHits { get; set; }
Property Value
MaxMana
public int MaxMana { get; set; }
Property Value
MaxStamina
public int MaxStamina { get; set; }
Property Value
Name
public string? Name { get; set; }
Property Value
Notoriety
public Notoriety Notoriety { get; set; }
Property Value
PoisonResistance
public int PoisonResistance { get; set; }
Property Value
Profession
public ProfessionInfo Profession { get; set; }
Property Value
ProfessionId
public int ProfessionId { get; set; }
Property Value
Race
public Race? Race { get; set; }
Property Value
RaceIndex
public byte RaceIndex { get; set; }
Property Value
SkillPoints
public int SkillPoints { get; set; }
Property Value
SkinHue
public short SkinHue { get; set; }
Property Value
Stamina
public int Stamina { get; set; }
Property Value
StatPoints
public int StatPoints { get; set; }
Property Value
Strength
public int Strength { get; set; }
Property Value
Title
public string? Title { get; set; }
Property Value
Methods
AddEquippedItem(ItemLayerType, Serial)
Associates an equipped item id with this mobile without item metadata updates.
public void AddEquippedItem(ItemLayerType layer, Serial itemId)
Parameters
layerItemLayerTypeitemIdSerial
AddEquippedItem(ItemLayerType, UOItemEntity)
Associates an equipped item with this mobile and updates item ownership metadata.
public void AddEquippedItem(ItemLayerType layer, UOItemEntity item)
Parameters
layerItemLayerTypeitemUOItemEntity
EquipItem(ItemLayerType, UOItemEntity)
Equips an item and updates both persisted references and runtime cache.
public void EquipItem(ItemLayerType layer, UOItemEntity item)
Parameters
layerItemLayerTypeTarget item layer.
itemUOItemEntityEquipped item entity.
GetBody()
public virtual Body GetBody()
Returns
GetEquippedReference(ItemLayerType)
Gets runtime equipped-item reference for a layer, if present.
public ItemReference? GetEquippedReference(ItemLayerType layer)
Parameters
layerItemLayerTypeEquipment 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
stygianAbyssboolWhether 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
layerItemLayerTypeEquipment layer.
Returns
- bool
truewhen equipped.
HydrateEquipmentRuntime(IEnumerable<UOItemEntity>)
Hydrates runtime equipped-item references from resolved item entities.
public void HydrateEquipmentRuntime(IEnumerable<UOItemEntity> equippedItems)
Parameters
equippedItemsIEnumerable<UOItemEntity>Resolved equipped items for this mobile.
OverrideBody(Body)
public void OverrideBody(Body body)
Parameters
bodyBody
RecalculateMaxStats()
Recomputes max stat caps from base stats and clamps current values.
public void RecalculateMaxStats()
SetBody(Body)
public void SetBody(Body body)
Parameters
bodyBody
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
layerItemLayerTypeEquipment layer.
itemReferenceItemReferenceResolved runtime reference when found.
Returns
- bool
truewhen 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
layerItemLayerTypeLayer to unequip.
itemUOItemEntityOptional equipped item instance to clear metadata on.
Returns
- bool
truewhen a layer entry existed and was removed.