#W# Exhaustion system and some Food changes.

This commit is contained in:
WarrentyExpired 2026-08-27 21:35:43 -04:00
parent d5102df9b4
commit a254b9db25
2 changed files with 225 additions and 45 deletions

View file

@ -206,6 +206,9 @@ namespace Server.Mobiles
private Point3D m_LastInnLocation;
private Map m_LastInnMap;
// -- Inn Room End
// -- Exhaustion System Start
private int m_ExhaustionDamageTracker;
// -- Exhaustion System End
#region Getters & Setters
@ -2638,6 +2641,39 @@ namespace Server.Mobiles
if ( willKill && from is PlayerMobile )
Timer.DelayCall( TimeSpan.FromSeconds( 10 ), new TimerCallback( ((PlayerMobile) from).RecoverAmmo ) );
// -- Exhaustion System Start
if ( this.Alive && amount > 0 )
{
m_ExhaustionDamageTracker += amount;
if ( m_ExhaustionDamageTracker >= 200 )
{
int drops = m_ExhaustionDamageTracker / 200;
bool statsDropped = false;
if ( this.Hunger > 0 )
{
this.Hunger = Math.Max( 0, this.Hunger - drops );
statsDropped = true;
}
if ( this.Thirst > 0 )
{
this.Thirst = Math.Max( 0, this.Thirst - drops );
statsDropped = true;
}
if ( statsDropped )
{
this.SendMessage( 33, "The physical toll of combat leaves you exhausted and parched." );
}
// Save the leftover damage for the next cycle
m_ExhaustionDamageTracker %= 200;
}
}
// -- Exhaustion System End
base.OnDamage( amount, from, willKill );
}