From 3d61b04b72c69eb4e445e66bd43ac84051e23e39 Mon Sep 17 00:00:00 2001 From: WarrentyExpired Date: Wed, 19 Aug 2026 12:54:54 -0400 Subject: [PATCH] #W# FarmController work. Added new graphic for farmablecabbage. --- Data/Config/Regions.xml | 6 +++--- Data/Decoration/Towns/Overworld_Doors.cfg | 24 +++++++++++++++++++++ Scripts/Engines/FarmController.cs | 26 ++++++++++++++++++----- Scripts/Items/Farming/FarmableCabbage.cs | 5 +++-- Scripts/Settings.cs | 2 +- 5 files changed, 52 insertions(+), 11 deletions(-) diff --git a/Data/Config/Regions.xml b/Data/Config/Regions.xml index 95bb5ef..d8c6d07 100644 --- a/Data/Config/Regions.xml +++ b/Data/Config/Regions.xml @@ -146,11 +146,11 @@ - - + + - + diff --git a/Data/Decoration/Towns/Overworld_Doors.cfg b/Data/Decoration/Towns/Overworld_Doors.cfg index 21fd47f..356dae8 100644 --- a/Data/Decoration/Towns/Overworld_Doors.cfg +++ b/Data/Decoration/Towns/Overworld_Doors.cfg @@ -8,6 +8,12 @@ StrongWoodDoor 1765 (Facing=WestCCW) DarkWoodGate 2152 (Facing=EastCW) 814 768 0 +DarkWoodGate 2150 (Facing=WestCW) +803 787 0 + +DarkWoodGate 2152 (Facing=EastCCW) +804 787 0 + LightWoodDoor 1757 (Facing=SouthCCW) 857 846 0 @@ -17,6 +23,24 @@ DarkWoodGate 2150 (Facing=WestCCW) DarkWoodGate 2152 (Facing=EastCW) 851 855 0 +DarkWoodGate 2150 (Facing=WestCW) +830 860 0 + +DarkWoodGate 2152 (Facing=EastCCW) +831 860 0 + +DarkWoodGate 2160 (Facing=NorthCW) +818 849 0 + +DarkWoodGate 2158 (Facing=SouthCCW) +818 850 0 + +DarkWoodGate 2150 (Facing=WestCCW) +832 841 0 + +DarkWoodGate 2152 (Facing=EastCW) +833 841 0 + # North Bastion Dock house RattanDoor 1685 (Facing=WestCW) 664 509 0 diff --git a/Scripts/Engines/FarmController.cs b/Scripts/Engines/FarmController.cs index e7f981a..2e15daa 100644 --- a/Scripts/Engines/FarmController.cs +++ b/Scripts/Engines/FarmController.cs @@ -9,12 +9,21 @@ namespace Server.Items public static class FarmController { // Vegetable Plot Boundaries - private static Rectangle2D VeggieRect = new Rectangle2D(795, 771, 17, 15); + private static Rectangle2D CabbagePlot = new Rectangle2D(795, 771, 5, 4); + private static Rectangle2D CarrotPlot = new Rectangle2D(795, 776, 5, 4); + private static Rectangle2D LettucePlot = new Rectangle2D(795, 781, 5, 5); + private static Rectangle2D OnionPlot = new Rectangle2D(801, 771, 5, 4); + private static Rectangle2D TurnipPlot = new Rectangle2D(801, 776,5 ,4); + private static Rectangle2D PumpkinPlot = new Rectangle2D(801, 781, 5, 5); + private static Rectangle2D WheatPlot = new Rectangle2D(808, 771, 5, 4); + private static Rectangle2D FlaxPlot = new Rectangle2D(808, 776, 5, 4); + private static Rectangle2D CottonPlot = new Rectangle2D(808, 781, 5, 5); + // Reagent Plot Boundaries - private static Rectangle2D ReagentRect = new Rectangle2D(820, 843, 23, 16); + //private static Rectangle2D ReagentRect = new Rectangle2D(820, 843, 23, 16); // Lists must be static now - private static List m_VeggieTypes = new List { typeof(FarmableCabbage), typeof(FarmableCarrot), typeof(FarmableCotton), typeof(FarmableFlax), typeof(FarmableLettuce), typeof(FarmableOnion), typeof(FarmablePumpkin), typeof(FarmableTurnip), typeof(FarmableWheat) }; + //private static List m_VeggieTypes = new List { typeof(FarmableCabbage), typeof(FarmableCarrot), typeof(FarmableCotton), typeof(FarmableFlax), typeof(FarmableLettuce), typeof(FarmableOnion), typeof(FarmablePumpkin), typeof(FarmableTurnip), typeof(FarmableWheat) }; //private static List m_ReagentTypes = new List { typeof(FarmableBlackPearl), typeof(FarmableBloodmoss), typeof(FarmableGarlic), typeof(FarmableGinseng), typeof(FarmableMandrakeRoot), typeof(FarmableNightshade), typeof(FarmableSpidersSilk), typeof(FarmableSulfurousAsh) }; // The core looks for 'Initialize' on startup and runs it automatically @@ -30,8 +39,15 @@ namespace Server.Items private static void SpawnTick() { // Spawn 2 vegetables and 2 reagents each tick if space allows - SpawnInArea(VeggieRect, m_VeggieTypes, 2); - //SpawnInArea(ReagentRect, m_ReagentTypes, 2); + SpawnInArea(CabbagePlot, new List { typeof(FarmableCabbage) }, 1); + SpawnInArea(CarrotPlot, new List { typeof(FarmableCarrot) }, 1); + SpawnInArea(LettucePlot, new List { typeof(FarmableLettuce) }, 1); + SpawnInArea(OnionPlot, new List { typeof(FarmableOnion) }, 1); + SpawnInArea(TurnipPlot, new List { typeof(FarmableTurnip) }, 1); + SpawnInArea(PumpkinPlot, new List { typeof(FarmablePumpkin) }, 1); + SpawnInArea(WheatPlot, new List { typeof(FarmableWheat) }, 1); + SpawnInArea(FlaxPlot, new List { typeof(FarmableFlax) }, 1); + SpawnInArea(CottonPlot, new List { typeof(FarmableCotton) }, 1); } private static void SpawnInArea(Rectangle2D rect, List types, int count) diff --git a/Scripts/Items/Farming/FarmableCabbage.cs b/Scripts/Items/Farming/FarmableCabbage.cs index cbca259..38267e9 100644 --- a/Scripts/Items/Farming/FarmableCabbage.cs +++ b/Scripts/Items/Farming/FarmableCabbage.cs @@ -8,7 +8,8 @@ namespace Server.Items { public static int GetCropID() { - return 3254; + //return 3254; + return 0x48E4; } public override Item GetCropObject() @@ -48,4 +49,4 @@ namespace Server.Items int version = reader.ReadEncodedInt(); } } -} \ No newline at end of file +} diff --git a/Scripts/Settings.cs b/Scripts/Settings.cs index 4894c1e..126eadf 100644 --- a/Scripts/Settings.cs +++ b/Scripts/Settings.cs @@ -21,6 +21,6 @@ namespace Server public static bool S_MonstersSurprise = true; public static bool S_DungeonTraps = true; public static double S_FarmSpawnTimer = 15.0; - public static int S_HarvestRange = 2; + public static int S_HarvestRange = 1; } }