diff --git a/Projects/Server/Mobiles/Mobile.cs b/Projects/Server/Mobiles/Mobile.cs index 02e4dbbc2..49915a2ff 100644 --- a/Projects/Server/Mobiles/Mobile.cs +++ b/Projects/Server/Mobiles/Mobile.cs @@ -293,6 +293,7 @@ public partial class Mobile : IHued, IComparable, ISpawnable, IObjectPro private int m_HueMod = -1; private int m_Hunger; + private int _thirst; private bool m_InDeltaQueue; private int m_Kills; @@ -513,7 +514,20 @@ public partial class Mobile : IHued, IComparable, ISpawnable, IObjectPro } [CommandProperty(AccessLevel.GameMaster)] - public int Thirst { get; set; } + public int Thirst + { + get => _thirst; + set + { + var oldValue = _thirst; + + if (oldValue != value) + { + _thirst = value; + OnThirstChanged(oldValue); + } + } + } [CommandProperty(AccessLevel.GameMaster)] public int BAC { get; set; } @@ -3725,6 +3739,14 @@ public partial class Mobile : IHued, IComparable, ISpawnable, IObjectPro { } + /// + /// Overridable. Virtual event invoked after the property has changed. + /// + /// + public virtual void OnThirstChanged(int oldValue) + { + } + public virtual void AggressiveAction(Mobile aggressor) => AggressiveAction(aggressor, false); public virtual void AggressiveAction(Mobile aggressor, bool criminal)