#W# Tweaked FoodDecay a bit.
This commit is contained in:
parent
40149e7604
commit
7f040e1951
2 changed files with 93 additions and 54 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -4,3 +4,4 @@ Backups
|
||||||
Saves
|
Saves
|
||||||
Data/Logs
|
Data/Logs
|
||||||
Scripts/Output
|
Scripts/Output
|
||||||
|
Packets.log
|
||||||
|
|
|
||||||
|
|
@ -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 != null && m is PlayerMobile && !(m.AccessLevel > AccessLevel.Player) && !(m.Region is InnRegion) )
|
||||||
{
|
{
|
||||||
if ( m.Hunger >= 1 )
|
if ( m.Hunger >= 1 )
|
||||||
|
{
|
||||||
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 )
|
if ( m.Thirst >= 1 )
|
||||||
|
{
|
||||||
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;
|
if ( m.Hunger < 5 )
|
||||||
|
|
||||||
switch (m.Hunger)
|
|
||||||
{
|
{
|
||||||
case 4: hits = 2; break;
|
int hits = 0;
|
||||||
case 3: hits = 3; break;
|
|
||||||
case 2: hits = 4; break;
|
switch (m.Hunger)
|
||||||
case 1: hits = 5; break;
|
|
||||||
case 0:
|
|
||||||
{
|
{
|
||||||
hits = 6;
|
case 4: hits = 2; break;
|
||||||
m.SendMessage( "You are starving to death!" );
|
case 3: hits = 3; break;
|
||||||
m.LocalOverheadMessage(MessageType.Emote, 1150, true, "I am so hungry!");
|
case 2: hits = 4; break;
|
||||||
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 )
|
if ( m.Thirst < 5 )
|
||||||
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!" ); }
|
switch (m.Thirst)
|
||||||
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:
|
|
||||||
{
|
{
|
||||||
m.Stam -= 6;
|
case 4: m.Stam -= 2; break;
|
||||||
m.SendMessage( "You are exhausted from thirst!" );
|
case 3: m.Stam -= 3; break;
|
||||||
m.LocalOverheadMessage(MessageType.Emote, 1150, true, "I am so thirsty!");
|
case 2: m.Stam -= 4; break;
|
||||||
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;
|
int test = m.Thirst;
|
||||||
if ( m.Hunger < m.Thirst )
|
if ( m.Hunger < m.Thirst )
|
||||||
test = m.Hunger;
|
test = m.Hunger;
|
||||||
|
|
||||||
switch (test)
|
switch (test)
|
||||||
{
|
{
|
||||||
|
|
@ -141,10 +160,29 @@ namespace Server.Misc
|
||||||
case 1: m.Mana -= 5; break;
|
case 1: m.Mana -= 5; break;
|
||||||
case 0: m.Mana -= 6; break;
|
case 0: m.Mana -= 6; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m.Mana < 0 )
|
if ( m.Mana < 0 )
|
||||||
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue