From 11cf73428d44f1444d173d7b0331805e0862cdd2 Mon Sep 17 00:00:00 2001 From: WarrentyExpired Date: Tue, 20 Oct 2026 19:35:43 -0400 Subject: [PATCH] #W# Region: Added a new Cave Region. --- Distribution/Data/regions.json | 10 +++++ .../Regions/Custom/GreetingCaveRegion.cs | 39 +++++++++++++++++++ .../Regions/RegionJsonRegistration.cs | 1 + 3 files changed, 50 insertions(+) create mode 100644 Projects/UOContent/Regions/Custom/GreetingCaveRegion.cs diff --git a/Distribution/Data/regions.json b/Distribution/Data/regions.json index 0a05fd999..e99a0fe97 100644 --- a/Distribution/Data/regions.json +++ b/Distribution/Data/regions.json @@ -2963,5 +2963,15 @@ "Area": [ { "x1": 441, "y1": 1189, "x2": 498, "y2": 1225 } ] + }, + { + "$type": "GreetingCaveRegion", + "Map": "Underworld", + "Name": "Cave System", + "Priority": 55, + "Area": [ + { "x1": 56, "y1": 527, "x2": 643, "y2": 756 }, + { "x1": 56, "y1": 761, "x2": 1996, "y2": 1301 } + ] } ] diff --git a/Projects/UOContent/Regions/Custom/GreetingCaveRegion.cs b/Projects/UOContent/Regions/Custom/GreetingCaveRegion.cs new file mode 100644 index 000000000..171f6f87f --- /dev/null +++ b/Projects/UOContent/Regions/Custom/GreetingCaveRegion.cs @@ -0,0 +1,39 @@ +using Server; +using Server.Mobiles; +using Server.Custom; + +namespace Server.Regions +{ + public class GreetingCaveRegion : BaseRegion + { + public GreetingCaveRegion(string name, Map map, int priority, params Rectangle3D[] area) + : base(name, map, priority, area) + { + } + public override bool MountsAllowed => false; + public override void OnEnter(Mobile m) + { + base.OnEnter(m); + if (m.Player) + { + m.SendMessage($"You have entered a dark cave system."); + } + if (m is PlayerMobile player ) + { + if ( player.Mounted ) + { + Server.Custom.AutoStable.StoreMount(player); + } + } + } + + public override void OnExit(Mobile m) + { + base.OnExit(m); + if ( m is PlayerMobile player ) + { + Server.Custom.AutoStable.RestoreMount(player); + } + } + } +} diff --git a/Projects/UOContent/Regions/RegionJsonRegistration.cs b/Projects/UOContent/Regions/RegionJsonRegistration.cs index 12c2005e0..41553eff3 100644 --- a/Projects/UOContent/Regions/RegionJsonRegistration.cs +++ b/Projects/UOContent/Regions/RegionJsonRegistration.cs @@ -68,5 +68,6 @@ public static class RegionJsonRegistration RegionJsonSerializer.Register(); RegionJsonSerializer.Register(); RegionJsonSerializer.Register(); + RegionJsonSerializer.Register(); } }