Resource icon

gain cooking passively from eating drinking and tasteid

been lurking and leeching for years from all these sites, my time was bound to come when i had to post something, i guess.

i wanted to make cooking skills easier to gain, god i hate cooking in games. So i got the idea from this post to attach it to other skills. Im posting it here with a reason other than simply sharing. Im pretty sure you can tell by looking at it that im a copypaster. Believe me ive been trying to learn to code. Anyways, the reason is, the code works fine in my server, but im afraid that the bad coding is going to come back and bite me in the kitchen. Its just some edits in food.cs, beverage.cs and tasteid.cs.

So, it works, and i post it here for others who would like to use it, but, is there a better way i could have done it? The taste id one especially seems kind of iffy.

sorry for the wall of text.

gain cooking passively from eating, drinking

food.cs

public virtual bool Eat(Mobile from)
{
// Fill the Mobile with FillFactor
if (CheckHunger(from))
{
// Play a random "eat" sound
from.PlaySound(Utility.Random(0x3A, 3));

if (from.Body.IsHuman && !from.Mounted)
from.Animate(34, 5, 1, true, false, 0);

if (from.Body.IsHuman && !from.Mounted) // <---passively check Cooking for gain
from.CheckSkill(SkillName.Cooking, 0.0, 120.0); // <---Passively check Cooking for gain

if (m_Poison != null)
from.ApplyPoison(m_Poisoner, m_Poison);

=====================================================================================================================

beverage.cs


else if (from == targ)
{
if (from.Thirst < 20)
from.Thirst += 1;

if (from.Body.IsHuman && !from.Mounted) // <---passively check Cooking for gain
from.CheckSkill(SkillName.Cooking, 0.0, 120.0); // <---Passively check Cooking for gain


========================================================================================================================

Tasteid.cs


else if (targeted is Food)
{
Food food = (Food)targeted;

if (from.CheckTargetSkill(SkillName.TasteID, food, 0, 120))
if (from.CheckTargetSkill(SkillName.Cooking, food, 0, 120)) // <--passively check cooking for gain
{
if (food.Poison != null)
  • Like
Reactions: sahisahi
Author
FreeReign
Views
274
First release
Last update
Rating
0.00 star(s) 0 ratings