[1.0] Harvest System 1.4
Summary:
Renewable Harvestable Plants and Crops.
Cotton, Flax, Wheat, Corn, Carrots, Onions, Garlic, Lettuce, Cabbage, Apple, Peach, Pear, Coconut, Banana, Mandrake, Nightshade and Ginseng.
1.0 Notes:
This system works under RunUO 1.0. As such I am moving it from Archives to Submissions. (I am in the process of doing that for all my archived scripts.) However it was an early script for me and I am not very happy with it from a coding or shard balancing point of view. There is at least one variation to this in the pre-1.0 script archives which I would encourage you to look at as well. A full re-write of this system is planed when RunUO 2.0 is released. - David 05/05/06
Description:
Version 1.4:
Tested on Beta 36, should work on future and recent past Beta’s as well. Note that as of Beta 36 the food items Wheat and Corn are not yet in the RunUO distribution. Currently Wheat and Corn crops return bread items. All scripts included use a new Namespace Server.Items.Crops this should minimize the impact of changes in Beta releases.
This is a renewable crop growing system. Crops include Cotton, Flax, Wheat, Corn, Carrots, Onions, Garlic, Lettuce, and Cabbage. Trees include Apple, Peach, Pear, Coconut, and Banana. Harvestable Reagents include Mandrake, Nightshade and Ginseng. Players may plant crops on any furrowed ground, other land tiles may be allowed by editing CropHelper.cs. Trees are planted by GM's pretty much anywhere. Reagents are designed to be placed by spawners in the wild.
Crops start as seeds, which may be bought from a Farmhand (included.) The player double-clicks the seed while in his/her pack and after a check of surrounding tiles, it is planted in the spot they are standing. With the exception of Lettuce and Cabbage, crops may not be planted too densely. A seedling sprouts right away. After a period of 10 to 30 minutes the seedling either turns into a crop or a weed based on a random chance against the sower's Lumberjacking skill. If a seedling does become a weed, the sower may pull it up right away, or anyone may after three hours. Once grown, the crop begins with a yield of zero, after ten minutes the yield will quickly raise to the crops maximum capacity. Maximum yield varies; ten for Cotton and Wheat, six for Carrots and Onions, three for Corn, and one for Lettuce and Cabbage. Crops may be harvested by anyone, to do so the player double-clicks the crop. Based on Lumberjacking skill, the sower may gather from zero to current yield with each attempt, others from zero to half the current yield. Another attempt may be made after three seconds. If an attempt to harvest the crops is made while the current yield is zero, the Player is presented with the option to destroy the crop (unless it was planted by a GM or better.) seedlings, partial crops, and full crops each have their own graphics.
GM's plant trees as saplings. [Add Applesapling, [Add Peachsapling, [Add Pearsapling. Saplings grow into a fruit tree three hours later and then produce fruit similarly to crops. Players may double-click a fruit tree to gather fruit up to the maximum yield of 12. Players may also chop down the tree to gather up to ten logs and up to 24 fruits. If chopped down, a stump remains for one hour, then sprouts a sapling and three hours later another fruit tree. In the TreeHelper.cs file there is a TreeOrdinance Boolean switch which by default is false, if true chopping a fruit tree in a guarded region is a criminal offense. There are two special tree types, BananaTree and CoconutPalm which bear fruit but are not choppable. GM's add these directly, no saplings.
Three types of reagents may also be harvested from the following plants; NightshadePlant, MandrakePlant, and GinsengPlant. These plants are intended to be placed by spawner in the wild. They can be hard to see, players will have to look for them. When found, a player stands next to the plant and double-clicks it. As in the other crop types there is a check against the Lumberjacking skill, at zero the player has a 20% chance of picking the plant and at eighty a 100% chance. If the check fails the player may try again in three seconds. The code is commented if you wish to remove the check. Once the player picks the plant, they will have an Uprooted Plant in their pack. Using a knife on an Uprooted Plant will produce between zero and four of the final reagent.
Changes from version 1.3:
* If the sower’s character is deleted, the next character to attempt to harvest the crops will be designated as the sower. This eliminates a potential shard-crashing bug.
* Added several Boolean switches at the beginning of the CropHelper.cs file. These switches are detailed below.
* CanGrowFarm, CanGrowDirt, CanGrowGround, CanGrowSwamp, CanGrowSand: These switches determine where on the map a Player may plant a seed. CanGrowFarm represents furrowed ground and is the only one that defaults to true. In addition, one more switch, CanGrowGarden will allow a Player to plant on ground tiles (Item 0x32C9 ) placed by GM’s or frozen into the Map. This will allow for the addition of garden deeds.
Note that CanGrowGarden defaults to false in CropHelper.cs but is overridden as true in each Crop script. This was done to demonstrate how the defaults can be changed per crop type. Net result is CanGrowGarden is allowed.
* A new setting SowerPickTime defaults to 14 days. If the sower does not harvest a crop within that time, the crop is destroyed on the next non-sower successful harvesting, unless the sower’s AccessLevel is GM or better. Setting SowerPickTime to TimeSpan.Zero will disable this check.
* If PlayerCanDestroy is set to true, when a Player attempts to harvest from an empty Crop they are presented with the opportunity to destroy the Crop, unless the sower is a GM or better.
* A little further down in CropHelper.cs (line 61) you will find the Boolean switch CanWorkMounted. This determines if a mounted Player may sow seeds, pull weeds, and harvest crops. CanWorkMounted defaults to false.
* TreeHelper.cs has a similar switch CanPickMounted which defaults to true. This switch affects picking fruit from any tree.
* If picking fruit from trees while mounted is allowed, the Player has a 20% better chance of gathering fruit while mounted.
* There are no changes to reagent plants in this version.
Planned Enhancements:
Planned for the next version are deeds for Garden plots placeable by Players and an easier to configure more consistent method of skill checking.
Coments, Questions, and Bugs are always welcome.
enjoy!
Installation:
Extract these files into your custom scripts folder. I suggest creating a new folder such as Scripts\Custom\Harvest.
Place a FarmHand in the fields to sell seeds. Otherwise read the description above.
Summary:
Renewable Harvestable Plants and Crops.
Cotton, Flax, Wheat, Corn, Carrots, Onions, Garlic, Lettuce, Cabbage, Apple, Peach, Pear, Coconut, Banana, Mandrake, Nightshade and Ginseng.
1.0 Notes:
This system works under RunUO 1.0. As such I am moving it from Archives to Submissions. (I am in the process of doing that for all my archived scripts.) However it was an early script for me and I am not very happy with it from a coding or shard balancing point of view. There is at least one variation to this in the pre-1.0 script archives which I would encourage you to look at as well. A full re-write of this system is planed when RunUO 2.0 is released. - David 05/05/06
Description:
Version 1.4:
Tested on Beta 36, should work on future and recent past Beta’s as well. Note that as of Beta 36 the food items Wheat and Corn are not yet in the RunUO distribution. Currently Wheat and Corn crops return bread items. All scripts included use a new Namespace Server.Items.Crops this should minimize the impact of changes in Beta releases.
This is a renewable crop growing system. Crops include Cotton, Flax, Wheat, Corn, Carrots, Onions, Garlic, Lettuce, and Cabbage. Trees include Apple, Peach, Pear, Coconut, and Banana. Harvestable Reagents include Mandrake, Nightshade and Ginseng. Players may plant crops on any furrowed ground, other land tiles may be allowed by editing CropHelper.cs. Trees are planted by GM's pretty much anywhere. Reagents are designed to be placed by spawners in the wild.
Crops start as seeds, which may be bought from a Farmhand (included.) The player double-clicks the seed while in his/her pack and after a check of surrounding tiles, it is planted in the spot they are standing. With the exception of Lettuce and Cabbage, crops may not be planted too densely. A seedling sprouts right away. After a period of 10 to 30 minutes the seedling either turns into a crop or a weed based on a random chance against the sower's Lumberjacking skill. If a seedling does become a weed, the sower may pull it up right away, or anyone may after three hours. Once grown, the crop begins with a yield of zero, after ten minutes the yield will quickly raise to the crops maximum capacity. Maximum yield varies; ten for Cotton and Wheat, six for Carrots and Onions, three for Corn, and one for Lettuce and Cabbage. Crops may be harvested by anyone, to do so the player double-clicks the crop. Based on Lumberjacking skill, the sower may gather from zero to current yield with each attempt, others from zero to half the current yield. Another attempt may be made after three seconds. If an attempt to harvest the crops is made while the current yield is zero, the Player is presented with the option to destroy the crop (unless it was planted by a GM or better.) seedlings, partial crops, and full crops each have their own graphics.
GM's plant trees as saplings. [Add Applesapling, [Add Peachsapling, [Add Pearsapling. Saplings grow into a fruit tree three hours later and then produce fruit similarly to crops. Players may double-click a fruit tree to gather fruit up to the maximum yield of 12. Players may also chop down the tree to gather up to ten logs and up to 24 fruits. If chopped down, a stump remains for one hour, then sprouts a sapling and three hours later another fruit tree. In the TreeHelper.cs file there is a TreeOrdinance Boolean switch which by default is false, if true chopping a fruit tree in a guarded region is a criminal offense. There are two special tree types, BananaTree and CoconutPalm which bear fruit but are not choppable. GM's add these directly, no saplings.
Three types of reagents may also be harvested from the following plants; NightshadePlant, MandrakePlant, and GinsengPlant. These plants are intended to be placed by spawner in the wild. They can be hard to see, players will have to look for them. When found, a player stands next to the plant and double-clicks it. As in the other crop types there is a check against the Lumberjacking skill, at zero the player has a 20% chance of picking the plant and at eighty a 100% chance. If the check fails the player may try again in three seconds. The code is commented if you wish to remove the check. Once the player picks the plant, they will have an Uprooted Plant in their pack. Using a knife on an Uprooted Plant will produce between zero and four of the final reagent.
Changes from version 1.3:
* If the sower’s character is deleted, the next character to attempt to harvest the crops will be designated as the sower. This eliminates a potential shard-crashing bug.
* Added several Boolean switches at the beginning of the CropHelper.cs file. These switches are detailed below.
* CanGrowFarm, CanGrowDirt, CanGrowGround, CanGrowSwamp, CanGrowSand: These switches determine where on the map a Player may plant a seed. CanGrowFarm represents furrowed ground and is the only one that defaults to true. In addition, one more switch, CanGrowGarden will allow a Player to plant on ground tiles (Item 0x32C9 ) placed by GM’s or frozen into the Map. This will allow for the addition of garden deeds.
Note that CanGrowGarden defaults to false in CropHelper.cs but is overridden as true in each Crop script. This was done to demonstrate how the defaults can be changed per crop type. Net result is CanGrowGarden is allowed.
* A new setting SowerPickTime defaults to 14 days. If the sower does not harvest a crop within that time, the crop is destroyed on the next non-sower successful harvesting, unless the sower’s AccessLevel is GM or better. Setting SowerPickTime to TimeSpan.Zero will disable this check.
* If PlayerCanDestroy is set to true, when a Player attempts to harvest from an empty Crop they are presented with the opportunity to destroy the Crop, unless the sower is a GM or better.
* A little further down in CropHelper.cs (line 61) you will find the Boolean switch CanWorkMounted. This determines if a mounted Player may sow seeds, pull weeds, and harvest crops. CanWorkMounted defaults to false.
* TreeHelper.cs has a similar switch CanPickMounted which defaults to true. This switch affects picking fruit from any tree.
* If picking fruit from trees while mounted is allowed, the Player has a 20% better chance of gathering fruit while mounted.
* There are no changes to reagent plants in this version.
Planned Enhancements:
Planned for the next version are deeds for Garden plots placeable by Players and an easier to configure more consistent method of skill checking.
Coments, Questions, and Bugs are always welcome.
enjoy!
Installation:
Extract these files into your custom scripts folder. I suggest creating a new folder such as Scripts\Custom\Harvest.
Place a FarmHand in the fields to sell seeds. Otherwise read the description above.