diff --git a/.gitignore b/.gitignore index 4c6bb16..da57eda 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ Backups Saves Data/Logs Scripts/Output +Packets.log diff --git a/Scripts/Misc/FoodDecay.cs b/Scripts/Misc/FoodDecay.cs index 1cfe994..3cb828d 100644 --- a/Scripts/Misc/FoodDecay.cs +++ b/Scripts/Misc/FoodDecay.cs @@ -31,14 +31,31 @@ namespace Server.Misc } } - public static void HungerDecay( Mobile m ) + public static void HungerDecay( Mobile m ) { if ( m != null && m is PlayerMobile && !(m.AccessLevel > AccessLevel.Player) && !(m.Region is InnRegion) ) { if ( m.Hunger >= 1 ) + { m.Hunger -= 1; + if ( m.Hunger == 15 ) + m.SendMessage( "Your stomach gives a slight rumble." ); + else if ( m.Hunger == 10 ) + m.SendMessage( "You are starting to feel hungry." ); + else if ( m.Hunger == 5 ) + m.SendMessage( "You are getting extremely hungry. You should eat soon!" ); + } + if ( m.Thirst >= 1 ) + { m.Thirst -= 1; + if ( m.Thirst == 15 ) + m.SendMessage( "Your mouth feels a little dry." ); + else if ( m.Thirst == 10 ) + m.SendMessage( "You are starting to feel thirsty." ); + else if ( m.Thirst == 5 ) + m.SendMessage( "You are getting extremely thirsty. You should drink soon!" ); + } } } } @@ -68,70 +85,72 @@ namespace Server.Misc } } - public static void EatDecaying( Mobile m ) + public static void EatDecaying( Mobile m ) { - if ( m is PlayerMobile && m.Alive && (m.Hunger < 5 || m.Thirst < 5) ) + if ( m is PlayerMobile && m.Alive ) { - if ( m.Hunger < 5 ) + if ( m.Hunger < 5 || m.Thirst < 5 ) { - int hits = 0; - - switch (m.Hunger) + if ( m.Hunger < 5 ) { - case 4: hits = 2; break; - case 3: hits = 3; break; - case 2: hits = 4; break; - case 1: hits = 5; break; - case 0: + int hits = 0; + + switch (m.Hunger) { - hits = 6; - m.SendMessage( "You are starving to death!" ); - m.LocalOverheadMessage(MessageType.Emote, 1150, true, "I am so hungry!"); - break; + case 4: hits = 2; break; + case 3: hits = 3; break; + case 2: hits = 4; break; + case 1: hits = 5; break; + case 0: + { + hits = 6; + m.SendMessage( "You are starving to death!" ); + m.LocalOverheadMessage(MessageType.Emote, 1150, true, "I am so hungry!"); + break; + } + } + + if ( m.Hits < hits ) + hits = m.Hits-1; + + if ( hits > 0 ) + m.Hits -= hits; + + if ( m.Hunger < 3 && m.Hunger > 0 ) + { + if ( Utility.RandomBool() ){ m.SendMessage( "You are getting very hungry!" ); } + if ( Utility.RandomMinMax(1,5)==1 ){ m.LocalOverheadMessage(MessageType.Emote, 1150, true, "I am getting hungry!"); } } } - - if ( m.Hits < hits ) - hits = m.Hits-1; - - if ( hits > 0 ) - m.Hits -= hits; - - if ( m.Hunger < 3 && m.Hunger > 0 ) + + if ( m.Thirst < 5 ) { - if ( Utility.RandomBool() ){ m.SendMessage( "You are getting very hungry!" ); } - if ( Utility.RandomMinMax(1,5)==1 ){ m.LocalOverheadMessage(MessageType.Emote, 1150, true, "I am getting hungry!"); } - } - } - if ( m.Thirst < 5 ) - { - switch (m.Thirst) - { - case 4: m.Stam -= 2; break; - case 3: m.Stam -= 3; break; - case 2: m.Stam -= 4; break; - case 1: m.Stam -= 5; break; - case 0: + switch (m.Thirst) { - m.Stam -= 6; - m.SendMessage( "You are exhausted from thirst!" ); - m.LocalOverheadMessage(MessageType.Emote, 1150, true, "I am so thirsty!"); - break; + case 4: m.Stam -= 2; break; + case 3: m.Stam -= 3; break; + case 2: m.Stam -= 4; break; + case 1: m.Stam -= 5; break; + case 0: + { + m.Stam -= 6; + m.SendMessage( "You are exhausted from thirst!" ); + m.LocalOverheadMessage(MessageType.Emote, 1150, true, "I am so thirsty!"); + break; + } } + if ( m.Thirst < 3 && m.Thirst > 0 ) + { + if ( Utility.RandomBool() ){ m.SendMessage( "You are getting exhausted from thirst!" ); } + if ( Utility.RandomMinMax(1,5)==1 ){ m.LocalOverheadMessage(MessageType.Emote, 1150, true, "I am getting thirsty!"); } + } + if ( m.Stam < 0 ) + m.Stam = 0; } - if ( m.Thirst < 3 && m.Thirst > 0 ) - { - if ( Utility.RandomBool() ){ m.SendMessage( "You are getting exhausted from thirst!" ); } - if ( Utility.RandomMinMax(1,5)==1 ){ m.LocalOverheadMessage(MessageType.Emote, 1150, true, "I am getting thirsty!"); } - } - if ( m.Stam < 0 ) - m.Stam = 0; - } - if ( m.Thirst < 5 || m.Hunger < 5 ) - { + int test = m.Thirst; - if ( m.Hunger < m.Thirst ) - test = m.Hunger; + if ( m.Hunger < m.Thirst ) + test = m.Hunger; switch (test) { @@ -141,10 +160,29 @@ namespace Server.Misc case 1: m.Mana -= 5; break; case 0: m.Mana -= 6; break; } + if ( m.Mana < 0 ) m.Mana = 0; } + else + { + if ( m.Hunger >= 15 && m.Hits < m.HitsMax ) + { + int hpRegen = (int)(2 * Server.Misc.Settings.HitPoints()); + m.Hits += hpRegen; + } + + if ( m.Thirst >= 15 && m.Stam < m.StamMax ) + { + m.Stam += 2; + } + + if ( m.Hunger >= 15 && m.Thirst >= 15 && m.Mana < m.ManaMax ) + { + m.Mana += 2; + } + } } } } -} \ No newline at end of file +}