diff --git a/Data/Spawns/overworld.map b/Data/Spawns/overworld.map index 931d711..db4c7d9 100644 --- a/Data/Spawns/overworld.map +++ b/Data/Spawns/overworld.map @@ -44,11 +44,11 @@ *|spawnbirds|spawnanimals|spawncritters|spawn_a|||135|120|0|1|5|10|-1|30|1|15|5|5|0|0|0 *|spawnbirds|spawnanimals|spawncritters|spawn_a|||256|1343|0|1|5|10|-1|30|1|15|5|5|0|0|0 *|spawnbirds|spawnanimals|spawncritters|spawn_a|||438|1357|2|1|5|10|-1|15|1|10|0|5|0|0|0 -*|spawnbirds|spawnanimals|spawncritters|spawn_a|||362|1413|1|1|5|10|-1|30|1|15|5|5|0|0|0 +*|spawnbirds|spawnanimals|spawncritters|spawn_a|||362|1413|1|1|5|10|-1|30|1|10|3|3|0|0|0 *|spawnbirds|spawnanimals|spawncritters|spawn_a|||213|1433|1|1|5|10|-1|30|1|15|5|5|3|0|0 *|spawnbirds|spawnanimals|spawncritters|spawn_a|||269|1441|1|1|5|10|-1|30|1|15|5|5|0|0|0 -*|spawnbirds|spawnanimals|spawncritters|spawn_a|||358|1462|3|1|5|10|-1|30|1|15|5|5|0|0|0 -*|spawnbirds|spawnanimals|spawncritters|spawn_a|||405|1437|1|1|5|10|-1|30|1|15|0|5|0|0|0 +*|spawnbirds|spawnanimals|spawncritters|spawn_a|||358|1462|3|1|5|10|-1|30|1|10|3|3|0|0|0 +*|spawnbirds|spawnanimals|spawncritters|spawn_a|||405|1437|1|1|5|10|-1|30|1|10|0|5|0|0|0 *|spawnbirds|spawnanimals|spawncritters|spawn_a|spawn_d||870|1736|5|1|5|10|-1|30|1|5|5|5|5|2|0 *|spawnbirds|spawnanimals|spawncritters|spawn_a|spawn_d||988|1674|3|1|5|10|-1|30|1|5|5|5|5|2|0 *|spawnbirds|spawnanimals|spawncritters|spawn_a|spawn_d||997|1711|3|1|5|10|-1|30|1|5|5|5|5|2|0 diff --git a/Scripts/Commands/BuildWorld.cs b/Scripts/Commands/BuildWorld.cs index dd5335d..4dc1c53 100644 --- a/Scripts/Commands/BuildWorld.cs +++ b/Scripts/Commands/BuildWorld.cs @@ -7,11 +7,11 @@ using Server.Mobiles; using Server.Network; using Server.Regions; using Server; +using Server.Gumps; using System.Collections.Generic; using System.Collections; using System.IO; using System; -using System.Reflection; // Added to access private variables inside BaseSpawner namespace Server.Scripts.Commands { @@ -19,34 +19,52 @@ namespace Server.Scripts.Commands { public static void Initialize() { - CommandSystem.Register("BuildWorld", AccessLevel.Counselor, new CommandEventHandler( BuildWorlds )); + CommandSystem.Register("BuildWorld", AccessLevel.Counselor, new CommandEventHandler( BuildWorld_OnCommand )); } [Usage("BuildWorld")] - [Description("This cleans up the world and rebuilds it, leaving players intact.")] - public static void BuildWorlds( CommandEventArgs e ) + [Description("Opens the Vaelen World Builder control panel.")] + public static void BuildWorld_OnCommand( CommandEventArgs e ) { + Mobile m = e.Mobile; + + if (m.HasGump(typeof(BuildWorldGump))) + m.CloseGump(typeof(BuildWorldGump)); + + m.SendGump(new BuildWorldGump()); + } + // ============================================================================== + // --- MODULAR GENERATION METHODS --- + // ============================================================================== + + public static void DoWipe( Mobile m ) + { + m.SendMessage( 38, "Removing Premium Spawners and wild mobs... This may take a moment." ); Console.WriteLine( "Removing Spawners..." ); - ArrayList targets = new ArrayList(); - foreach ( Item item in World.Items.Values ) - if ( item is PremiumSpawner ) - { - targets.Add( item ); - } - for ( int i = 0; i < targets.Count; ++i ) - { - Item item = ( Item )targets[ i ]; - item.Delete(); - } + + ArrayList targets = new ArrayList(); + foreach ( Item item in World.Items.Values ) + { + if ( item is PremiumSpawner ) + { + targets.Add( item ); + } + } + for ( int i = 0; i < targets.Count; ++i ) + { + Item item = ( Item )targets[ i ]; + item.Delete(); + } + Console.WriteLine( "Removing wild mobs and animals..." ); ArrayList mobsToDelete = new ArrayList(); - foreach ( Mobile m in World.Mobiles.Values ) + foreach ( Mobile mob in World.Mobiles.Values ) { - if ( m is BaseCreature ) + if ( mob is BaseCreature ) { - BaseCreature bc = (BaseCreature)m; + BaseCreature bc = (BaseCreature)mob; if ( !bc.Controlled && !bc.IsStabled ) { mobsToDelete.Add( bc ); @@ -55,22 +73,126 @@ namespace Server.Scripts.Commands } for ( int i = 0; i < mobsToDelete.Count; ++i ) { - Mobile m = ( Mobile )mobsToDelete[ i ]; - m.Delete(); + Mobile mob = ( Mobile )mobsToDelete[ i ]; + mob.Delete(); } + + m.SendMessage( 63, "Wipe Complete: Premium Spawners and wild mobs deleted!" ); + } + + public static void DoDecorate( Mobile m ) + { + m.SendMessage( 38, "Generating World Decorations, Signs & Teleporters..." ); Console.WriteLine( "Decorating the world..."); - CommandSystem.Handle(e.Mobile, String.Format("{0}Decorate", CommandSystem.Prefix)); - CommandSystem.Handle(e.Mobile, String.Format("{0}SignGen", CommandSystem.Prefix)); - CommandSystem.Handle(e.Mobile, String.Format("{0}TelGen", CommandSystem.Prefix)); + + CommandSystem.Handle(m, String.Format("{0}Decorate", CommandSystem.Prefix)); + CommandSystem.Handle(m, String.Format("{0}SignGen", CommandSystem.Prefix)); + CommandSystem.Handle(m, String.Format("{0}TelGen", CommandSystem.Prefix)); + + m.SendMessage( 63, "Decorations, Signs, and Teleporters generated!" ); + } + + public static void DoSpawns( Mobile m ) + { + m.SendMessage( 38, "Parsing map files and generating spawners..." ); + Console.WriteLine( "Spawning Overworld..."); - Server.SpawnGenerator.Parse( e.Mobile, "overworld.map" ); + Server.SpawnGenerator.Parse( m, "overworld.map" ); + Console.WriteLine( "Spawning Town Animals..."); - Server.SpawnGenerator.Parse( e.Mobile, "townanimals.map" ); + Server.SpawnGenerator.Parse( m, "townanimals.map" ); + Console.WriteLine( "Spawning Camps..." ); - Server.SpawnGenerator.Parse( e.Mobile, "camps.map" ); + Server.SpawnGenerator.Parse( m, "camps.map" ); + Console.WriteLine( "Spawning NPC's..." ); Console.WriteLine( "Spawning Dungeons..." ); - Console.WriteLine( "The world has been built." ); + + m.SendMessage( 63, "Map parsing complete and world populated!" ); + } + } + + // ============================================================================== + // --- BUILD WORLD GUMP UI --- + // ============================================================================== + + public class BuildWorldGump : Gump + { + public BuildWorldGump() : base( 50, 50 ) + { + Closable = true; + Disposable = true; + Dragable = true; + Resizable = false; + + AddPage(0); + + // Background 3600: Modern semi-transparent black with border + AddBackground(0, 0, 350, 360, 3600); + + // Header + AddHtml(0, 15, 350, 20, "