diff --git a/Scripts/Engines/CannedEvil/ChampionSpawn.cs b/Scripts/Engines/CannedEvil/ChampionSpawn.cs index 295aa51f9..05ebb5790 100644 --- a/Scripts/Engines/CannedEvil/ChampionSpawn.cs +++ b/Scripts/Engines/CannedEvil/ChampionSpawn.cs @@ -70,7 +70,7 @@ namespace Server.Engines.CannedEvil m_Idol = new IdolOfTheChampion( this ); m_ExpireDelay = TimeSpan.FromMinutes( 10.0 ); - m_RestartDelay = TimeSpan.FromMinutes( 5.0 ); + m_RestartDelay = TimeSpan.FromMinutes( 10.0 ); m_DamageEntries = new Dictionary(); @@ -1232,6 +1232,8 @@ namespace Server.Engines.CannedEvil public class ChampionSpawnRegion : BaseRegion { + public override bool YoungProtected { get { return false; } } + private ChampionSpawn m_Spawn; public ChampionSpawn ChampionSpawn diff --git a/Scripts/Mobiles/PlayerMobile.cs b/Scripts/Mobiles/PlayerMobile.cs index ca3b27fee..37b259437 100644 --- a/Scripts/Mobiles/PlayerMobile.cs +++ b/Scripts/Mobiles/PlayerMobile.cs @@ -3731,7 +3731,7 @@ namespace Server.Mobiles if ( !this.Young ) return false; - if ( Region.IsPartOf( typeof( DungeonRegion ) ) ) + if ( !((BaseRegion)Region).YoungProtected ) return false; if( from is BaseCreature && ((BaseCreature)from).IgnoreYoungProtection ) diff --git a/Scripts/Regions/BaseRegion.cs b/Scripts/Regions/BaseRegion.cs index 303a66e4a..cb1ce9ba7 100644 --- a/Scripts/Regions/BaseRegion.cs +++ b/Scripts/Regions/BaseRegion.cs @@ -4,6 +4,9 @@ using System.Collections.Generic; using System.Xml; using Server; using Server.Items; +using Server.Mobiles; +using Server.Gumps; + namespace Server.Regions { @@ -16,6 +19,8 @@ namespace Server.Regions public class BaseRegion : Region { + public virtual bool YoungProtected { get { return true; } } + public static void Configure() { Region.DefaultRegionType = typeof( BaseRegion ); @@ -116,6 +121,17 @@ namespace Server.Regions return false; } + public override void OnEnter(Mobile m) + { + if (m is PlayerMobile && ((PlayerMobile)m).Young) + { + if(!this.YoungProtected) + { + m.SendGump(new YoungDungeonWarning()); + } + } + } + public override bool AcceptsSpawnsFrom( Region region ) { if ( region == this || !m_ExcludeFromParentSpawns ) diff --git a/Scripts/Regions/DungeonRegion.cs b/Scripts/Regions/DungeonRegion.cs index 82b3c11b4..3d907f568 100644 --- a/Scripts/Regions/DungeonRegion.cs +++ b/Scripts/Regions/DungeonRegion.cs @@ -8,6 +8,8 @@ namespace Server.Regions { public class DungeonRegion : BaseRegion { + public override bool YoungProtected { get { return false; } } + private Point3D m_EntranceLocation; private Map m_EntranceMap; @@ -30,12 +32,6 @@ namespace Server.Regions return false; } - public override void OnEnter( Mobile m ) - { - if ( m is PlayerMobile && ((PlayerMobile)m).Young ) - m.SendGump( new YoungDungeonWarning() ); - } - public override void AlterLightLevel( Mobile m, ref int global, ref int personal ) { global = LightCycle.DungeonLevel;