XML Food System

Discussion in 'Custom Script Releases' started by datguy, Jan 8, 2011.

  1. datguy New Member

    Food System, XmlSpawner Required

    Finding the cooking section quite boring and if the server required eating, players would still only
    buy fruits or cakes & not work on their cooking skills I decided to give them incentive to become a great chef.

    When players buy foods they get full & that is all, when they craft foods, they get a small bonus to either a particular skill or a stat or both, depending on what they are eating, the more difficult the item is to craft the better the boost to the foods.

    Added a Speciality Section in the craft area, all of these require a recipe, there is a series of Quests that will give out these recipes However there is only a small chance the player will get the recipe each time they do the quest, they will however get a sample of the food they are trying to learn.

    Once they do get the recipe the food itself is not hard to make skillwise, so this then would be their specialty. You can opt to give out the recipes some other way but you'd be missing out imo. Quests created by Ednyved mostly (used by permission)


    internally what it does

    -Modified the foods to have properties, each food can have of
    1 skill boost, int/dex/str, 1 or 2 or 3 stat boosts
    -each boost will last as long as the foods fillfactor, which is set for 15 minutes, so if the food has
    a fillfactor of 4, the boost lasts 1 hour and so does the food till your at that hunger level again.
    -The time can also be specified manually in the scripts per item but if nothing is specified it is
    same as fillfactor
    -each of the boosts are easily adjusted in the food scripts
    Statboost time & skill boost time can be adjusted globaly in food.cs to be less than fillfactor, note:

    If it is set longer than Fillfactor it does Not stack but just doesn't add the boost if you eat again (checks if there's already a boost applied)so the first Boost may run out before you can eat again because your full.
    -

    Only crafted foods have these boosts applied to them and the default is that nothing is applied so existing

    foods that need no boost properties specified do not need to be altered in any way.

    ANY purchasable foods have no boosts on them

    example of a crafted food;
    Code:
    		[Constructable]
    public DriedPeachSlice( int amount ) : base( amount, 0x172A )
    		{
                Name = "Dried Peach Slice";
                Stackable = true;
                Hue = 435;
                this.Weight = 0.2;
                this.FillFactor = 1;//1 fillfactor = 15 minutes of time
    
                this.IntBoost = 2;
                this.DexBoost = 1;
                //this.StrBoost = 2;
                //this.StatBoostTime = 500;//can set it's time in SECONDS--default is fillfactor
    
                this.Skill = "Lumberjacking";
                this.SkillBoost = 2;
                //this.SkillBoostTime = 10;//can set this time in MINUTES independantly from StatBoostTime --default is fillfactor
    //XmlSpawner treats XmlSkill differently than XmlDex/str/int time wise.
    		}
    		
    example of non-crafted food
    Code:
            [Constructable]
            public Peach( int amount ) : base( amount, 0x9D2 )
            {
                this.Weight = 1.0;
                this.FillFactor = 1;
            }
    
    Hopefully I got all the code out of my custom server correctly and hopefully I've made things clear enough to understand ;) install info inside




    *edit*
    found a slight issue with the duration calculation on unmodded xmlspawner, fixing in process

    ----Fixed!!


    .

    Attached Files:

  2. datguy New Member

    base foods that need to be added to world - found in Fooditems.cs & Vegetables.cs

    put these into the world somehow, either forsale somewhere or a plant system or as loot off of a plant creature
    Needed for base ingredients.


    Carrot
    //Cabbage ----- not nessessary for any recipe but is there might as well use it
    Onion
    Lettuce
    Pumpkin
    //SmallPumpkin--- not nessessary for any recipe but is there might as well use it
    Peanut
    Corn
    GarlicBulb
    Potato
    Spinach
    Broccoli
    BlackPepperHarvest
    WormSilk //add to a worm type creature?

    fruit from fruit.cs
    peach
    Banana
    Lemon
    Pear
    Apple

    the rest are not nessessary for any recipe but is there might as well sell it
  3. datguy New Member

  4. LordHogFred New Member

    Very nice, looks very complete and easy to adapt :)
    Looking forward to working on it.
  5. datguy New Member

    found another slight error, there are 2 possible quests to use skarachef.npc & skarachef1.npc depending in you have quivers or not, when I made one ask for bows instead for easier distribution I neglected to change line #5 to
    Oh, {GETONTRIGMOB,name}! Have you brought the bows?</Text>
    here's a replacement , just rename skarachef.npc or fix file yourself :) Main post fixed as well.

    Attached Files:

Insert every image as a...
  1.  0%

Share This Page