Fisher

Member
Hello I found some cool food effects I would like to add to my foods in foodeffects.cs but I have no idea how to go about it. Any help or a point in the right direction would be greatly appreciated.

foodeffects.cs

Code:
using System;

namespace CustomsFramework.Systems.FoodEffects
{
    public class FoodEffect
    {
        private Int32 m_RegenHits = 0;
        public Int32 RegenHits { get { return m_RegenHits; } }

        private Int32 m_RegenStam = 0;
        public Int32 RegenStam { get { return m_RegenStam; } }

        private Int32 m_RegenMana = 0;
        public Int32 RegenMana { get { return m_RegenMana; } }

        private Int32 m_StrBonus = 0;
        public Int32 StrBonus { get { return m_StrBonus; } }

        private Int32 m_DexBonus = 0;
        public Int32 DexBonus { get { return m_DexBonus; } }

        private Int32 m_IntBonus = 0;
        public Int32 IntBonus { get { return m_IntBonus; } }

        private Int32 m_Duration = 0;
        public Int32 Duration { get { return m_Duration; } }

        private DateTime m_Added;
        public DateTime Added { get { return m_Added; } }

        public TimeSpan EffectTimeSpan { get { return TimeSpan.FromMinutes(m_Duration); } }

        public FoodEffect(Int32 regenHits, Int32 regenStam, Int32 regenMana, Int32 strBonus, Int32 dexBonus, Int32 intBonus, Int32 duration) :
            this(regenHits, regenStam, regenMana, strBonus, dexBonus, intBonus, duration, DateTime.UtcNow)
        {
        }

        public FoodEffect(Int32 regenHits, Int32 regenStam, Int32 regenMana, Int32 strBonus, Int32 dexBonus, Int32 intBonus, Int32 duration, DateTime added)
        {
            m_RegenHits = regenHits;
            m_RegenStam = regenStam;
            m_RegenMana = regenMana;
            m_StrBonus = strBonus;
            m_DexBonus = dexBonus;
            m_IntBonus = intBonus;
            m_Duration = duration;
            m_Added = added;
        }

        public Boolean IsExpired
        {
            get
            {
                if (m_Added.AddMinutes((double)m_Duration) < DateTime.UtcNow)
                    return false;
                else
                    return true;
            }
        }

        public String GetBuffInfoText()
        {
            String buffText = "";

            if (m_StrBonus != 0)
                buffText = String.Format("{0}{1}{2}{3} Str", buffText, (buffText != "" ? "<BR>" : ""), (m_StrBonus < 0 ? "-" : "+"), m_StrBonus);

            if (m_DexBonus != 0)
                buffText = String.Format("{0}{1}{2}{3} Dex", buffText, (buffText != "" ? "<BR>" : ""), (m_DexBonus < 0 ? "-" : "+"), m_DexBonus);

            if (m_IntBonus != 0)
                buffText = String.Format("{0}{1}{2}{3} Int", buffText, (buffText != "" ? "<BR>" : ""), (m_IntBonus < 0 ? "-" : "+"), m_IntBonus);

            if (m_RegenHits != 0)
                buffText = String.Format("{0}{1}{2}{3} HP Regen", buffText, (buffText != "" ? "<BR>" : ""), (m_RegenHits < 0 ? "-" : "+"), m_RegenHits);

            if (m_RegenStam != 0)
                buffText = String.Format("{0}{1}{2}{3} Stam Regen", buffText, (buffText != "" ? "<BR>" : ""), (m_RegenStam < 0 ? "-" : "+"), m_RegenStam);

            if (m_RegenMana != 0)
                buffText = String.Format("{0}{1}{2}{3} Mana Regen", buffText, (buffText != "" ? "<BR>" : ""), (m_RegenMana < 0 ? "-" : "+"), m_RegenMana);

            return buffText;
        }
    }
}

food.cs
Code:
using System;
using System.Collections.Generic;
using Server.ContextMenus;

using CustomsFramework;
using CustomsFramework.Systems.FoodEffects;

namespace Server.Items
{
    public abstract class Food : Item
    {
        private Mobile m_Poisoner;
        private Poison m_Poison;
        private int m_FillFactor;
        private bool m_PlayerConstructed;

        [CommandProperty(AccessLevel.GameMaster)]
        public Mobile Poisoner
        {
            get
            {
                return this.m_Poisoner;
            }
            set
            {
                this.m_Poisoner = value;
            }
        }

        [CommandProperty(AccessLevel.GameMaster)]
        public bool PlayerConstructed
        {
            get
            {
                return this.m_PlayerConstructed;
            }
            set
            {
                this.m_PlayerConstructed = value;
                InvalidateProperties();
            }
        }

        [CommandProperty(AccessLevel.GameMaster)]
        public Poison Poison
        {
            get
            {
                return this.m_Poison;
            }
            set
            {
                this.m_Poison = value;
            }
        }

        [CommandProperty(AccessLevel.GameMaster)]
        public int FillFactor
        {
            get
            {
                return this.m_FillFactor;
            }
            set
            {
                this.m_FillFactor = value;
            }
        }

        public Food(int itemID)
            : this(1, itemID)
        {
        }

        public Food(int amount, int itemID)
            : base(itemID)
        {
            this.Stackable = true;
            this.Amount = amount;
            this.m_FillFactor = 1;

            FoodEffectsCore.OnFoodEffectSystemUpdate += FoodEffectsCore_OnFoodEffectSystemUpdate;
        }

        public Food(Serial serial)
            : base(serial)
        {
            FoodEffectsCore.OnFoodEffectSystemUpdate += FoodEffectsCore_OnFoodEffectSystemUpdate;
        }

        private void FoodEffectsCore_OnFoodEffectSystemUpdate(BaseCoreEventArgs e)
        {
            if (e.Core == FoodEffectsCore.Core)
                InvalidateProperties();
        }

        public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
        {
            base.GetContextMenuEntries(from, list);

            if (from.Alive)
                list.Add(new ContextMenus.EatEntry(from, this));
        }

        public override void OnDoubleClick(Mobile from)
        {
            if (!this.Movable)
                return;

            if (from.InRange(this.GetWorldLocation(), 1))
            {
                this.Eat(from);
            }
        }

        public override bool StackWith(Mobile from, Item dropped, bool playSound)
        {
            if (dropped is Food && ((Food)dropped).PlayerConstructed == this.PlayerConstructed)
                return base.StackWith(from, dropped, playSound);
            else
                return false;
        }

        public override void GetProperties(ObjectPropertyList list)
        {
            base.GetProperties(list);

            FoodEffect effect = FoodEffectsCore.GetEffects(this);

            if (effect != null)
            {
                int prop;

                if ((prop = effect.DexBonus) != 0)
                    list.Add(1060409, prop.ToString()); // dexterity bonus ~1_val~

                if ((prop = effect.IntBonus) != 0)
                    list.Add(1060432, prop.ToString()); // intelligence bonus ~1_val~

                if ((prop = effect.RegenMana) != 0)
                    list.Add(1060440, prop.ToString()); // mana regeneration ~1_val~

                if ((prop = effect.RegenStam) != 0)
                    list.Add(1060443, prop.ToString()); // stamina regeneration ~1_val~

                if ((prop = effect.RegenHits) != 0)
                    list.Add(1060444, prop.ToString()); // hit point regeneration ~1_val~

                if ((prop = effect.StrBonus) != 0)
                    list.Add(1060485, prop.ToString()); // strength bonus ~1_val~

                if ((prop = effect.Duration) != 0)
                    list.Add(1071346, prop.ToString()); // Duration: ~1_val~ minutes
            }
        }

        public virtual bool Eat(Mobile from)
        {
            // Fill the Mobile with FillFactor
            if (this.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 (this.m_Poison != null)
                    from.ApplyPoison(this.m_Poisoner, this.m_Poison);

                this.Consume();

                EventSink.InvokeOnConsume(new OnConsumeEventArgs(from, this));

                return true;
            }

            return false;
        }

        public virtual bool CheckHunger(Mobile from)
        {
            return FillHunger(from, this.m_FillFactor);
        }

        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;
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)5); // version

            writer.Write((bool)m_PlayerConstructed);
            writer.Write(this.m_Poisoner);

            Poison.Serialize(this.m_Poison, writer);
            writer.Write(this.m_FillFactor);
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch ( version )
            {
                case 1:
                    {
                        switch ( reader.ReadInt() )
                        {
                            case 0:
                                this.m_Poison = null;
                                break;
                            case 1:
                                this.m_Poison = Poison.Lesser;
                                break;
                            case 2:
                                this.m_Poison = Poison.Regular;
                                break;
                            case 3:
                                this.m_Poison = Poison.Greater;
                                break;
                            case 4:
                                this.m_Poison = Poison.Deadly;
                                break;
                        }

                        break;
                    }
                case 2:
                    {
                        this.m_Poison = Poison.Deserialize(reader);
                        break;
                    }
                case 3:
                    {
                        this.m_Poison = Poison.Deserialize(reader);
                        this.m_FillFactor = reader.ReadInt();
                        break;
                    }
                case 4:
                    {
                        this.m_Poisoner = reader.ReadMobile();
                        goto case 3;
                    }
                case 5:
                    {
                        this.m_PlayerConstructed = reader.ReadBool();
                        goto case 4;
                    }
            }
        }
    }

    public class BreadLoaf : Food
    {
        [Constructable]
        public BreadLoaf()
            : this(1)
        {
        }

        [Constructable]
        public BreadLoaf(int amount)
            : base(amount, 0x103B)
        {
            this.Weight = 1.0;
            this.FillFactor = 3;
        }

        public BreadLoaf(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }

    public class Bacon : Food
    {
        [Constructable]
        public Bacon()
            : this(1)
        {
        }

        [Constructable]
        public Bacon(int amount)
            : base(amount, 0x979)
        {
            this.Weight = 1.0;
            this.FillFactor = 1;
        }

        public Bacon(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }

    public class SlabOfBacon : Food
    {
        [Constructable]
        public SlabOfBacon()
            : this(1)
        {
        }

        [Constructable]
        public SlabOfBacon(int amount)
            : base(amount, 0x976)
        {
            this.Weight = 1.0;
            this.FillFactor = 3;
        }

        public SlabOfBacon(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }

public class FishSteak : Food
    {
        public override double DefaultWeight
        {
            get { return 0.1; }
        }

        [Constructable]
        public FishSteak() : this( 1 )
        {
        }

        [Constructable]
        public FishSteak( int amount ) : base( amount, 0x97B )
        {
            this.FillFactor = 3;
        }

        public FishSteak( Serial serial ) : base( serial )
        {
        }

        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.Write( (int) 0 ); // version
        }

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();
        }
    }

    public class SpottedBassSteak : Food
    {
        public override double DefaultWeight
        {
            get { return 0.1; }
        }

        [Constructable]
        public SpottedBassSteak() : this( 1 )
        {
        }

        [Constructable]
        public SpottedBassSteak( int amount ) : base( amount, 0x97B )
        {
            this.FillFactor = 3;
            Name = "Spotted Bass Steak";
        }

        public SpottedBassSteak( Serial serial ) : base( serial )
        {
        }

        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.Write( (int) 0 ); // version
        }

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();
        }
    }

    public class SummerBassSteak : Food
    {
        public override double DefaultWeight
        {
            get { return 0.1; }
        }

        [Constructable]
        public SummerBassSteak() : this( 1 )
        {
        }

        [Constructable]
        public SummerBassSteak( int amount ) : base( amount, 0x97B )
        {
            this.FillFactor = 3;
            Name = "Summer Bass Steak";
        }

        public SummerBassSteak( Serial serial ) : base( serial )
        {
        }

        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.Write( (int) 0 ); // version
        }

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();
        }
    }

    public class SageFishSteak : Food
    {
        public override double DefaultWeight
        {
            get { return 0.1; }
        }

        [Constructable]
        public SageFishSteak() : this( 1 )
        {
        }

        [Constructable]
        public SageFishSteak( int amount ) : base( amount, 0x97B )
        {
            this.FillFactor = 4;
            Name = "Sagefish Steak";
        }

        public SageFishSteak( Serial serial ) : base( serial )
        {
        }

        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.Write( (int) 0 ); // version
        }

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();
        }
    }

    public class CatFishSteak : Food
    {
        public override double DefaultWeight
        {
            get { return 0.1; }
        }

        [Constructable]
        public CatFishSteak() : this( 1 )
        {
        }

        [Constructable]
        public CatFishSteak( int amount ) : base( amount, 0x97B )
        {
            this.FillFactor = 4;
            Name = "Catfish Steak";
        }

        public CatFishSteak( Serial serial ) : base( serial )
        {
        }

        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.Write( (int) 0 ); // version
        }

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();
        }
    }

    public class HalibutSteak : Food
    {
        public override double DefaultWeight
        {
            get { return 0.1; }
        }

        [Constructable]
        public HalibutSteak() : this( 1 )
        {
        }

        [Constructable]
        public HalibutSteak( int amount ) : base( amount, 0x97B )
        {
            this.FillFactor = 5;
            Name = "Halibut Steak";
        }

        public HalibutSteak( Serial serial ) : base( serial )
        {
        }

        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.Write( (int) 0 ); // version
        }

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();
        }
    }

    public class RockscaleCodSteak : Food
    {
        public override double DefaultWeight
        {
            get { return 0.1; }
        }

        [Constructable]
        public RockscaleCodSteak() : this( 1 )
        {
        }

        [Constructable]
        public RockscaleCodSteak( int amount ) : base( amount, 0x97B )
        {
            this.FillFactor = 5;
            Name = "Rockscale Cod Steak";
        }

        public RockscaleCodSteak( Serial serial ) : base( serial )
        {
        }

        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.Write( (int) 0 ); // version
        }

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();
        }
    }

    public class RainbowTroutSteak : Food
    {
        public override double DefaultWeight
        {
            get { return 0.1; }
        }

        [Constructable]
        public RainbowTroutSteak() : this( 1 )
        {
        }

        [Constructable]
        public RainbowTroutSteak( int amount ) : base( amount, 0x97B )
        {
            this.FillFactor = 6;
            Name = "Rainbow Trout Steak";
        }

        public RainbowTroutSteak( Serial serial ) : base( serial )
        {
        }

        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.Write( (int) 0 ); // version
        }

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();
        }
    }

    public class CarpSteak : Food
    {
        public override double DefaultWeight
        {
            get { return 0.1; }
        }

        [Constructable]
        public CarpSteak() : this( 1 )
        {
        }

        [Constructable]
        public CarpSteak( int amount ) : base( amount, 0x97B )
        {
            this.FillFactor = 4;
            Name = "Carp Steak";
        }

        public CarpSteak( Serial serial ) : base( serial )
        {
        }

        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.Write( (int) 0 ); // version
        }

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();
        }
    }

    public class SalmonSteak : Food
    {
        public override double DefaultWeight
        {
            get { return 0.1; }
        }

        [Constructable]
        public SalmonSteak() : this( 1 )
        {
        }

        [Constructable]
        public SalmonSteak( int amount ) : base( amount, 0x97B )
        {
            this.FillFactor = 7;
            Name = "Salmon Steak";
        }

        public SalmonSteak( Serial serial ) : base( serial )
        {
        }

        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.Write( (int) 0 ); // version
        }

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();
        }
    }

    public class DarkscaleGrouperSteak : Food
    {
        public override double DefaultWeight
        {
            get { return 0.1; }
        }

        [Constructable]
        public DarkscaleGrouperSteak() : this( 1 )
        {
        }

        [Constructable]
        public DarkscaleGrouperSteak( int amount ) : base( amount, 0x97B )
        {
            this.FillFactor = 11;
            Name = "Darkscale Grouper Steak";
        }

        public DarkscaleGrouperSteak( Serial serial ) : base( serial )
        {
        }

        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.Write( (int) 0 ); // version
        }

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();
        }
    }

    public class SeaSerpentTail : Food
    {
        public override double DefaultWeight
        {
            get { return 0.1; }
        }

        [Constructable]
        public SeaSerpentTail() : this( 1 )
        {
        }

        [Constructable]
        public SeaSerpentTail( int amount ) : base( amount, 0x97B )
        {
            this.FillFactor = 30;
            Name = "Sea Serpent tail";
        }

        public SeaSerpentTail( Serial serial ) : base( serial )
        {
        }

        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.Write( (int) 0 ); // version
        }

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();
        }
    }
   
    public class CheeseWheel : Food
    {
        public override double DefaultWeight
        {
            get
            {
                return 0.1;
            }
        }

        [Constructable]
        public CheeseWheel()
            : this(1)
        {
        }

        [Constructable]
        public CheeseWheel(int amount)
            : base(amount, 0x97E)
        {
            this.FillFactor = 3;
        }

        public CheeseWheel(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }

    public class CheeseWedge : Food
    {
        public override double DefaultWeight
        {
            get
            {
                return 0.1;
            }
        }

        [Constructable]
        public CheeseWedge()
            : this(1)
        {
        }

        [Constructable]
        public CheeseWedge(int amount)
            : base(amount, 0x97D)
        {
            this.FillFactor = 3;
        }

        public CheeseWedge(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }

    public class CheeseSlice : Food
    {
        public override double DefaultWeight
        {
            get
            {
                return 0.1;
            }
        }

        [Constructable]
        public CheeseSlice()
            : this(1)
        {
        }

        [Constructable]
        public CheeseSlice(int amount)
            : base(amount, 0x97C)
        {
            this.FillFactor = 1;
        }

        public CheeseSlice(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }

    public class FrenchBread : Food
    {
        [Constructable]
        public FrenchBread()
            : this(1)
        {
        }

        [Constructable]
        public FrenchBread(int amount)
            : base(amount, 0x98C)
        {
            this.Weight = 2.0;
            this.FillFactor = 3;
        }

        public FrenchBread(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }

    public class FriedEggs : Food
    {
        [Constructable]
        public FriedEggs()
            : this(1)
        {
        }

        [Constructable]
        public FriedEggs(int amount)
            : base(amount, 0x9B6)
        {
            this.Weight = 1.0;
            this.FillFactor = 4;
        }

        public FriedEggs(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }

    public class CookedBird : Food
    {
        [Constructable]
        public CookedBird()
            : this(1)
        {
        }

        [Constructable]
        public CookedBird(int amount)
            : base(amount, 0x9B7)
        {
            this.Weight = 1.0;
            this.FillFactor = 5;
        }

        public CookedBird(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }

    public class RoastPig : Food
    {
        [Constructable]
        public RoastPig()
            : this(1)
        {
        }

        [Constructable]
        public RoastPig(int amount)
            : base(amount, 0x9BB)
        {
            this.Weight = 45.0;
            this.FillFactor = 20;
        }

        public RoastPig(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }

    public class Sausage : Food
    {
        [Constructable]
        public Sausage()
            : this(1)
        {
        }

        [Constructable]
        public Sausage(int amount)
            : base(amount, 0x9C0)
        {
            this.Weight = 1.0;
            this.FillFactor = 4;
        }

        public Sausage(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }

    public class Ham : Food
    {
        [Constructable]
        public Ham()
            : this(1)
        {
        }

        [Constructable]
        public Ham(int amount)
            : base(amount, 0x9C9)
        {
            this.Weight = 1.0;
            this.FillFactor = 5;
        }

        public Ham(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }

    public class Cake : Food
    {
        [Constructable]
        public Cake()
            : base(0x9E9)
        {
            this.Stackable = false;
            this.Weight = 1.0;
            this.FillFactor = 10;
        }

        public Cake(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }
//
  public class Venison : Food
    {
        [Constructable]
        public Venison()
            : this(1)
        {
        }

        [Constructable]
        public Venison(int amount)
            : base(amount, 0x9F2)
        {
            this.Weight = 1.0;
            this.FillFactor = 7;
            this.Name = "Venison";
        }

        public Venison(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }
   
    //
  public class WolfMeat : Food
    {
        [Constructable]
        public WolfMeat()
            : this(1)
        {
        }

        [Constructable]
        public WolfMeat(int amount)
            : base(amount, 0x9F2)
        {
            this.Weight = 1.0;
            this.FillFactor = 8;
            this.Name = "Wolf Meat";
        }

        public WolfMeat(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }
   
    //
    public class Ribs : Food
    {
        [Constructable]
        public Ribs()
            : this(1)
        {
        }

        [Constructable]
        public Ribs(int amount)
            : base(amount, 0x9F2)
        {
            this.Weight = 1.0;
            this.FillFactor = 3;
        }

        public Ribs(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }

    public class Cookies : Food
    {
        [Constructable]
        public Cookies()
            : base(0x160b)
        {
            this.Stackable = Core.ML;
            this.Weight = 1.0;
            this.FillFactor = 4;
        }

        public Cookies(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }

    public class Muffins : Food
    {
        [Constructable]
        public Muffins()
            : base(0x9eb)
        {
            this.Stackable = false;
            this.Weight = 1.0;
            this.FillFactor = 4;
        }

        public Muffins(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }

    [TypeAlias("Server.Items.Pizza")]
    public class CheesePizza : Food
    {
        public override int LabelNumber
        {
            get
            {
                return 1044516;
            }
        }// cheese pizza

        [Constructable]
        public CheesePizza()
            : base(0x1040)
        {
            this.Stackable = false;
            this.Weight = 1.0;
            this.FillFactor = 11;
        }

        public CheesePizza(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }

    public class SausagePizza : Food
    {
        public override int LabelNumber
        {
            get
            {
                return 1044517;
            }
        }// sausage pizza

        [Constructable]
        public SausagePizza()
            : base(0x1040)
        {
            this.Stackable = false;
            this.Weight = 1.0;
            this.FillFactor = 12;
        }

        public SausagePizza(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }

    #if false
    public class Pizza : Food
    {
        [Constructable]
        public Pizza() : base( 0x1040 )
        {
            Stackable = false;
            this.Weight = 1.0;
            this.FillFactor = 12;
        }

        public Pizza( Serial serial ) : base( serial )
        {
        }

        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.Write( (int) 0 ); // version
        }

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();
        }
    }
    #endif

    public class FruitPie : Food
    {
        public override int LabelNumber
        {
            get
            {
                return 1041346;
            }
        }// baked fruit pie

        [Constructable]
        public FruitPie()
            : base(0x1041)
        {
            this.Stackable = false;
            this.Weight = 1.0;
            this.FillFactor = 8;
        }

        public FruitPie(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }

    public class MeatPie : Food
    {
        public override int LabelNumber
        {
            get
            {
                return 1041347;
            }
        }// baked meat pie

        [Constructable]
        public MeatPie()
            : base(0x1041)
        {
            this.Stackable = false;
            this.Weight = 1.0;
            this.FillFactor = 12;
        }

        public MeatPie(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }

    public class PumpkinPie : Food
    {
        public override int LabelNumber
        {
            get
            {
                return 1041348;
            }
        }// baked pumpkin pie

        [Constructable]
        public PumpkinPie()
            : base(0x1041)
        {
            this.Stackable = false;
            this.Weight = 1.0;
            this.FillFactor = 11;
        }

        public PumpkinPie(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }

    public class ApplePie : Food
    {
        public override int LabelNumber
        {
            get
            {
                return 1041343;
            }
        }// baked apple pie

        [Constructable]
        public ApplePie()
            : base(0x1041)
        {
            this.Stackable = false;
            this.Weight = 1.0;
            this.FillFactor = 11;
        }

        public ApplePie(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }

    public class PeachCobbler : Food
    {
        public override int LabelNumber
        {
            get
            {
                return 1041344;
            }
        }// baked peach cobbler

        [Constructable]
        public PeachCobbler()
            : base(0x1041)
        {
            this.Stackable = false;
            this.Weight = 1.0;
            this.FillFactor = 11;
        }

        public PeachCobbler(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }

    public class Quiche : Food
    {
        public override int LabelNumber
        {
            get
            {
                return 1041345;
            }
        }// baked quiche

        [Constructable]
        public Quiche()
            : base(0x1041)
        {
            this.Stackable = Core.ML;
            this.Weight = 1.0;
            this.FillFactor = 11;
        }

        public Quiche(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }

    public class LambLeg : Food
    {
        [Constructable]
        public LambLeg()
            : this(1)
        {
        }

        [Constructable]
        public LambLeg(int amount)
            : base(amount, 0x160a)
        {
            this.Weight = 2.0;
            this.FillFactor = 8;
        }

        public LambLeg(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }

    public class ChickenLeg : Food
    {
        [Constructable]
        public ChickenLeg()
            : this(1)
        {
        }

        [Constructable]
        public ChickenLeg(int amount)
            : base(amount, 0x1608)
        {
            this.Weight = 1.0;
            this.FillFactor = 3;
        }

        public ChickenLeg(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }

    [FlipableAttribute(0xC74, 0xC75)]
    public class HoneydewMelon : Food
    {
        [Constructable]
        public HoneydewMelon()
            : this(1)
        {
        }

        [Constructable]
        public HoneydewMelon(int amount)
            : base(amount, 0xC74)
        {
            this.Weight = 1.0;
            this.FillFactor = 1;
        }

        public HoneydewMelon(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }

    [FlipableAttribute(0xC64, 0xC65)]
    public class YellowGourd : Food
    {
        [Constructable]
        public YellowGourd()
            : this(1)
        {
        }

        [Constructable]
        public YellowGourd(int amount)
            : base(amount, 0xC64)
        {
            this.Weight = 1.0;
            this.FillFactor = 1;
        }

        public YellowGourd(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }

    [FlipableAttribute(0xC66, 0xC67)]
    public class GreenGourd : Food
    {
        [Constructable]
        public GreenGourd()
            : this(1)
        {
        }

        [Constructable]
        public GreenGourd(int amount)
            : base(amount, 0xC66)
        {
            this.Weight = 1.0;
            this.FillFactor = 1;
        }

        public GreenGourd(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }

    [FlipableAttribute(0xC7F, 0xC81)]
    public class EarOfCorn : Food
    {
        [Constructable]
        public EarOfCorn()
            : this(1)
        {
        }

        [Constructable]
        public EarOfCorn(int amount)
            : base(amount, 0xC81)
        {
            this.Weight = 1.0;
            this.FillFactor = 1;
        }

        public EarOfCorn(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }

    public class Turnip : Food
    {
        [Constructable]
        public Turnip()
            : this(1)
        {
        }

        [Constructable]
        public Turnip(int amount)
            : base(amount, 0xD3A)
        {
            this.Weight = 1.0;
            this.FillFactor = 1;
        }

        public Turnip(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }

    public class SheafOfHay : Item
    {
        [Constructable]
        public SheafOfHay()
            : base(0xF36)
        {
            this.Weight = 10.0;
        }

        public SheafOfHay(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }
}
 
I found the fes command and it brings up an awesome gump that has everything I was looking for but after enabling the system via the gump eating the food still does not give the bonuses.
 
I've added food effects to food, it's a very complicated system of my own confusing comphrehension. So it's doable, it's not easy or simple though.
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back