From 8133983b64e36aba1823b786881afa4073397a61 Mon Sep 17 00:00:00 2001 From: Arutosio <30377429+Arutosio@users.noreply.github.com> Date: Wed, 14 Jan 2026 02:04:41 +0100 Subject: [PATCH] feat: Adds OnThirstChanged (#2313) --- Projects/Server/Mobiles/Mobile.cs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) 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)