public static bool FillHunger(Mobile from, int fillFactor)
{
if (from.Hunger >= 20)
{
from.SendLocalizedMessage(500867); // You are simply too full to eat any more!
return false;
}
int iHunger = from.Hunger + fillFactor;
if (from.Stam < from.StamMax)
from.Stam += Utility.Random(6, 3) + fillFactor / 5;
if (iHunger >= 20)
{
from.Hunger = 20;
from.SendLocalizedMessage(500872); // You manage to eat the food, but you are stuffed!
}
else
{
from.Hunger = iHunger;
if (iHunger < 5)
from.SendLocalizedMessage(500868); // You eat the food, but are still extremely hungry.
else if (iHunger < 10)
from.SendLocalizedMessage(500869); // You eat the food, and begin to feel more satiated.
else if (iHunger < 15)
from.SendLocalizedMessage(500870); // After eating the food, you feel much less hungry.
else
from.SendLocalizedMessage(500871); // You feel quite full after consuming the food.
}
return true;
}
In Food.cs
See how it handles stamina. [Health would be Hits]
Code:public static bool FillHunger(Mobile from, int fillFactor) { if (from.Hunger >= 20) { from.SendLocalizedMessage(500867); // You are simply too full to eat any more! return false; } int iHunger = from.Hunger + fillFactor; if (from.Stam < from.StamMax) from.Stam += Utility.Random(6, 3) + fillFactor / 5; if (iHunger >= 20) { from.Hunger = 20; from.SendLocalizedMessage(500872); // You manage to eat the food, but you are stuffed! } else { from.Hunger = iHunger; if (iHunger < 5) from.SendLocalizedMessage(500868); // You eat the food, but are still extremely hungry. else if (iHunger < 10) from.SendLocalizedMessage(500869); // You eat the food, and begin to feel more satiated. else if (iHunger < 15) from.SendLocalizedMessage(500870); // After eating the food, you feel much less hungry. else from.SendLocalizedMessage(500871); // You feel quite full after consuming the food. } return true; }
In Food.cs
See how it handles stamina. [Health would be Hits]
Code:public static bool FillHunger(Mobile from, int fillFactor) { if (from.Hunger >= 20) { from.SendLocalizedMessage(500867); // You are simply too full to eat any more! return false; } int iHunger = from.Hunger + fillFactor; if (from.Stam < from.StamMax) from.Stam += Utility.Random(6, 3) + fillFactor / 5; if (iHunger >= 20) { from.Hunger = 20; from.SendLocalizedMessage(500872); // You manage to eat the food, but you are stuffed! } else { from.Hunger = iHunger; if (iHunger < 5) from.SendLocalizedMessage(500868); // You eat the food, but are still extremely hungry. else if (iHunger < 10) from.SendLocalizedMessage(500869); // You eat the food, and begin to feel more satiated. else if (iHunger < 15) from.SendLocalizedMessage(500870); // After eating the food, you feel much less hungry. else from.SendLocalizedMessage(500871); // You feel quite full after consuming the food. } return true; }
if (from.Hunger >= 20)
{
from.SendLocalizedMessage(500867); // You are simply too full to eat any more!
return false;
}
Everything is found in Food.cs, however, be cautious how much you increase it. Since potions have a delay timer between uses, so do bandages and considering casting delays for spells, you could unbalance the game. Also food doesn't require a free hand to use like potions or spell casting and you can't be interrupted while eating. I wouldn't remove the cap, consider all the mechanics at work that I mentioned...
We use essential cookies to make this site work, and optional cookies to enhance your experience.