RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

RunUOBeta36World2

Status
Not open for further replies.

Honor

Sorceror
.

Do i got to change something ion this?
[code:1]
using System;
using System.Collections;
using System.IO;
using Server;
using Server.Mobiles;
using Server.Items;
using Server.Scripts.Commands;
using Server.Network;
using Server.Gumps;

namespace Server.Scripts.Commands
{
/// <summary>
/// Summary description for CreateWorld.
/// </summary>
public class CreateWorld
{
public CreateWorld()
{
}

public static void Initialize()
{
Server.Commands.Register( "CreateWorld", AccessLevel.Administrator, new CommandEventHandler( Create_OnCommand ) );
}

[Usage( "Creates a new world from scratch (only run this once!)" )]
[Description( "Creates an entire world based on the commands defined." )]
private static void Create_OnCommand( CommandEventArgs e )
{
// Store the mobiles current map
Map map = e.Mobile.Map;

// Construct the entire world based on the commands below
if( e.Arguments.Length == 0 )
{
string[] Args = new string[1] { Path.Combine( Core.BaseDirectory, "items.wsc" ) };
e = new CommandEventArgs( e.Mobile, e.Command, Args[0], Args );
}

try
{
e.Mobile.SendGump( new CreateWorldGump( e ) );
/*
// Decorate the world first
Decorate.Decorate_OnCommand( e );

// Import the items.wsc file into Felucca
e.Mobile.Map = Map.Felucca;
e.Mobile.Say( "Importing WSC into Felucca from file " + e.Arguments[0] + "..." );
ImportWSC.ImportWSC_OnCommand( e );

// Import the items.wsc file into Trammel
e.Mobile.Map = Map.Trammel;
e.Mobile.Say( "Importing WSC into Trammel from file " + e.Arguments[0] + "..." );
ImportWSC.ImportWSC_OnCommand( e );

// Generate all of the world signs
e.Mobile.Say( "Generating Signs..." );
SignParser.SignGen_OnCommand( e );

// This isn't necessary anymore
//e.Mobile.Say( "Fixing Dungeon Shame..." );
//FixShame.FixShame_OnCommand( e );

// Generate all of the world moongates
e.Mobile.Say( "Generating Moongates..." );
PublicMoongate.MoonGen_OnCommand( e );

// Generate all of the world teleporters
e.Mobile.Say( "Generating Teleporters..." );
GenTeleporter.GenTeleporter_OnCommand( e );

// Generate all of the world doors
e.Mobile.Say( "Generating Doors..." );
DoorGenerator.DoorGen_OnCommand( e );

e.Mobile.Say( "Generating World Spawns..." );
e.Arguments[0] = "Spawns\\Felucca\\";
LoadSpawns( e );

e.Arguments[0] = "Spawns\\Trammel\\";
LoadSpawns( e );

e.Arguments[0] = "Spawns\\Ilshenar\\";
LoadSpawns( e );

e.Arguments[0] = "Spawns\\Malas\\";
LoadSpawns( e );

e.Mobile.Say( "World Creation Completed!" );
*/
}
finally
{
// Place the mobile back on the original map
e.Mobile.Map = map;
}
}

internal static void LoadSpawns( CommandEventArgs e )
{
try
{
// Search the directory specified for any *.xml files
// and load all spawners from each xml file
string[] SpawnFiles = Directory.GetFiles( e.Arguments[0], "*.xml" );

// Load each file
foreach( string SpawnFile in SpawnFiles )
{
e.Arguments[0] = SpawnFile;
XmlSpawner.Load_OnCommand( e );
}
}
catch( System.Exception se )
{
Console.WriteLine( se.ToString() );
}

return;
}
}

public class CreateWorldGump : Gump
{
private CommandEventArgs m_CommandEventArgs;
public CreateWorldGump( CommandEventArgs e ) : base( 30,30 )
{
m_CommandEventArgs = e;
Closable = true;
Dragable = true;

AddPage(0);

AddBackground( 0, 0, 320, 310, 5054 );
AddLabel( 120, 2, 200, "Create World" );
AddImageTiled( 10, 20, 300, 132, 3004 );
AddLabel( 30, 27, 200, "Facet" );
AddLabel( 172, 27, 200, "Spawn" );
AddLabel( 224, 27, 200, "Import Items" );
AddImageTiled( 20, 45, 280, 2, 10001 );
AddImageTiled( 20, 25, 280, 2, 10001 );
AddImageTiled( 20, 25, 2, 122, 10003 );
AddImageTiled( 163, 25, 2, 122, 10003 );
AddImageTiled( 218, 25, 2, 122, 10003 );
AddImageTiled( 300, 25, 2, 122, 10003 );
AddImageTiled( 20, 70, 280, 2, 10001 );
AddImageTiled( 20, 95, 280, 2, 10001 );
AddImageTiled( 20, 120, 280, 2, 10001 );
AddImageTiled( 20, 145, 280, 2, 10001 );
AddLabel( 35, 51, 200, "Trammel" );
AddLabel( 35, 76, 200, "Felucca" );
AddLabel( 35, 101, 200, "Ilshenar" );
AddLabel( 35, 126, 200, "Malas" );

// Facet level options
AddCheck( 181, 48, 210, 211, true, 101 ); // Spawn Trammel
AddCheck( 181, 73, 210, 211, true, 102 ); // Spawn Felucca
AddCheck( 181, 98, 210, 211, true, 103 ); // Spawn Ilshenar
AddCheck( 181, 123, 210, 211, true, 104 );// Spawn Malas
AddCheck( 250, 48, 210, 211, true, 201 ); // Import items.wsc into Trammel
AddCheck( 250, 73, 210, 211, true, 202 ); // Import items.wsc into Felucca
AddLabel( 248, 101, 200, "N/A" );
AddLabel( 248, 127, 200, "N/A" );

// World level options
AddCheck( 20, 155, 210, 211, true, 11 );
AddLabel( 40, 158, 200, "Decorate World - [Decorate");
AddCheck( 20, 180, 210, 211, true, 12 );
AddLabel( 40, 183, 200, "Moongates - [MoonGen");
AddCheck( 20, 205, 210, 211, true, 13 );
AddLabel( 40, 208, 200, "Teleporters - [TelGen");
AddCheck( 20, 230, 210, 211, true, 14 );
AddLabel( 40, 233, 200, "Signs - [SignGen");
AddCheck( 20, 255, 210, 211, true, 15 );
AddLabel( 40, 258, 200, "Doors - [DoorGen");

AddButton( 170, 280, 247, 249, 1, GumpButtonType.Reply, 0 );
AddButton( 245, 280, 241, 243, 0, GumpButtonType.Reply, 0 );
}

public override void OnResponse( NetState state, RelayInfo info )
{
Mobile from = state.Mobile;

switch( info.ButtonID )
{
case 0: // Closed or Cancel
{
return;
}

default:
{
// Make sure that the OK, button was pressed
if( info.ButtonID == 1 )
{
// Get the array of switches selected
ArrayList Selections = new ArrayList( info.Switches );

// Decorate the world
if( Selections.Contains( 11 ) == true )
{
from.Say( "Decorating World..." );
Decorate.Decorate_OnCommand( m_CommandEventArgs );
}

// Do any facet specific items creation
if( Selections.Contains( 201 ) == true )
{
// Import Trammels 'items.wsc' file
from.Map = Map.Trammel;
from.Say( "Importing WSC into Trammel from file " + m_CommandEventArgs.Arguments[0] + "..." );
ImportWSC.ImportWSC_OnCommand( m_CommandEventArgs );
}

if( Selections.Contains( 202 ) == true )
{
// Import Felucca 'items.wsc' file
from.Map = Map.Felucca;
from.Say( "Importing WSC into Felucca from file " + m_CommandEventArgs.Arguments[0] + "..." );
ImportWSC.ImportWSC_OnCommand( m_CommandEventArgs );
}

// Generate all of the world moongates
if( Selections.Contains( 12 ) == true )
{
from.Say( "Generating Moongates..." );
PublicMoongate.MoonGen_OnCommand( m_CommandEventArgs );
}

// Generate all of the world teleporters
if( Selections.Contains( 13 ) == true )
{
from.Say( "Generating Teleporters..." );
GenTeleporter.GenTeleporter_OnCommand( m_CommandEventArgs );
}

// Generate all of the world signs
if( Selections.Contains( 14 ) == true )
{
from.Say( "Generating Signs..." );
SignParser.SignGen_OnCommand( m_CommandEventArgs );
}

// Generate all of the world doors
if( Selections.Contains( 15 ) == true )
{
from.Say( "Generating Doors..." );
DoorGenerator.DoorGen_OnCommand( m_CommandEventArgs );
}

// Now spawn any selected facets
if( Selections.Contains( 101 ) == true )
{
from.Say( "Spawning Trammel..." );
m_CommandEventArgs.Arguments[0] = "Spawns\\Trammel\\";
CreateWorld.LoadSpawns( m_CommandEventArgs );
from.Say( "Done Spawning Trammel." );
}

if( Selections.Contains( 102 ) == true )
{
from.Say( "Spawning Felucca..." );
m_CommandEventArgs.Arguments[0] = "Spawns\\Felucca\\";
CreateWorld.LoadSpawns( m_CommandEventArgs );
from.Say( "Done Spawning Felucca." );
}

if( Selections.Contains( 103 ) == true )
{
from.Say( "Spawning Ilshenar..." );
m_CommandEventArgs.Arguments[0] = "Spawns\\Ilshenar\\";
CreateWorld.LoadSpawns( m_CommandEventArgs );
from.Say( "Done Spawning Ilshenar." );
}

if( Selections.Contains( 104 ) == true )
{
from.Say( "Spawning Malas..." );
m_CommandEventArgs.Arguments[0] = "Spawns\\Malas\\";
CreateWorld.LoadSpawns( m_CommandEventArgs);
from.Say( "Done Spawning Malas." );
}
}

from.Say( "World Creation Completed!" );

break;
}
}
}
}
}
[/code:1]
 

ArteGordon

Wanderer
try commenting out the wsc importing lines

[code:1]
/*
// Do any facet specific items creation
if( Selections.Contains( 201 ) == true )
{
// Import Trammels 'items.wsc' file
from.Map = Map.Trammel;
from.Say( "Importing WSC into Trammel from file " + m_CommandEventArgs.Arguments[0] + "..." );
ImportWSC.ImportWSC_OnCommand( m_CommandEventArgs );
}

if( Selections.Contains( 202 ) == true )
{
// Import Felucca 'items.wsc' file
from.Map = Map.Felucca;
from.Say( "Importing WSC into Felucca from file " + m_CommandEventArgs.Arguments[0] + "..." );
ImportWSC.ImportWSC_OnCommand( m_CommandEventArgs );
}

*/

[/code:1]
 

ArteGordon

Wanderer
[code:1]
using System;
using System.Collections;
using System.IO;
using Server;
using Server.Mobiles;
using Server.Items;
using Server.Scripts.Commands;
using Server.Network;
using Server.Gumps;

namespace Server.Scripts.Commands
{
/// <summary>
/// Summary description for CreateWorld.
/// </summary>
public class CreateWorld
{
public CreateWorld()
{
}

public static void Initialize()
{
Server.Commands.Register( "CreateWorld", AccessLevel.Administrator, new CommandEventHandler( Create_OnCommand ) );
}

[Usage( "Creates a new world from scratch (only run this once!)" )]
[Description( "Creates an entire world based on the commands defined." )]
private static void Create_OnCommand( CommandEventArgs e )
{
// Store the mobiles current map
Map map = e.Mobile.Map;

// Construct the entire world based on the commands below
if( e.Arguments.Length == 0 )
{
string[] Args = new string[1] { Path.Combine( Core.BaseDirectory, "items.wsc" ) };
e = new CommandEventArgs( e.Mobile, e.Command, Args[0], Args );
}

try
{
e.Mobile.SendGump( new CreateWorldGump( e ) );
/*
// Decorate the world first
//Decorate.Decorate_OnCommand( e );

// Import the items.wsc file into Felucca
//e.Mobile.Map = Map.Felucca;
//e.Mobile.Say( "Importing WSC into Felucca from file " + e.Arguments[0] + "..." );
//ImportWSC.ImportWSC_OnCommand( e );

// Import the items.wsc file into Trammel
//e.Mobile.Map = Map.Trammel;
//e.Mobile.Say( "Importing WSC into Trammel from file " + e.Arguments[0] + "..." );
//ImportWSC.ImportWSC_OnCommand( e );

// Generate all of the world signs
//e.Mobile.Say( "Generating Signs..." );
//SignParser.SignGen_OnCommand( e );

// This isn't necessary anymore
//e.Mobile.Say( "Fixing Dungeon Shame..." );
//FixShame.FixShame_OnCommand( e );

// Generate all of the world moongates
//e.Mobile.Say( "Generating Moongates..." );
//PublicMoongate.MoonGen_OnCommand( e );

// Generate all of the world teleporters
//e.Mobile.Say( "Generating Teleporters..." );
//GenTeleporter.GenTeleporter_OnCommand( e );

// Generate all of the world doors
//e.Mobile.Say( "Generating Doors..." );
//DoorGenerator.DoorGen_OnCommand( e );

e.Mobile.Say( "Generating World Spawns..." );
e.Arguments[0] = "Spawns\\Felucca\\";
LoadSpawns( e );

e.Arguments[0] = "Spawns\\Trammel\\";
LoadSpawns( e );

e.Arguments[0] = "Spawns\\Ilshenar\\";
LoadSpawns( e );

e.Arguments[0] = "Spawns\\Malas\\";
LoadSpawns( e );

e.Mobile.Say( "World Creation Completed!" );
*/
}
finally
{
// Place the mobile back on the original map
e.Mobile.Map = map;
}
}

internal static void LoadSpawns( CommandEventArgs e )
{
try
{
// Search the directory specified for any *.xml files
// and load all spawners from each xml file
string[] SpawnFiles = Directory.GetFiles( e.Arguments[0], "*.xml" );

// Load each file
foreach( string SpawnFile in SpawnFiles )
{
e.Arguments[0] = SpawnFile;
XmlSpawner.Load_OnCommand( e );
}
}
catch( System.Exception se )
{
Console.WriteLine( se.ToString() );
}

return;
}
}

public class CreateWorldGump : Gump
{
private CommandEventArgs m_CommandEventArgs;
public CreateWorldGump( CommandEventArgs e ) : base( 30,30 )
{
m_CommandEventArgs = e;
Closable = true;
Dragable = true;

AddPage(0);

AddBackground( 0, 0, 320, 310, 5054 );
AddLabel( 120, 2, 200, "Create World" );
AddImageTiled( 10, 20, 300, 132, 3004 );
AddLabel( 30, 27, 200, "Facet" );
AddLabel( 172, 27, 200, "Spawn" );
//AddLabel( 224, 27, 200, "Import Items" );
AddImageTiled( 20, 45, 280, 2, 10001 );
AddImageTiled( 20, 25, 280, 2, 10001 );
AddImageTiled( 20, 25, 2, 122, 10003 );
AddImageTiled( 163, 25, 2, 122, 10003 );
AddImageTiled( 218, 25, 2, 122, 10003 );
AddImageTiled( 300, 25, 2, 122, 10003 );
AddImageTiled( 20, 70, 280, 2, 10001 );
AddImageTiled( 20, 95, 280, 2, 10001 );
AddImageTiled( 20, 120, 280, 2, 10001 );
AddImageTiled( 20, 145, 280, 2, 10001 );
AddLabel( 35, 51, 200, "Trammel" );
AddLabel( 35, 76, 200, "Felucca" );
AddLabel( 35, 101, 200, "Ilshenar" );
AddLabel( 35, 126, 200, "Malas" );

// Facet level options
AddCheck( 181, 48, 210, 211, true, 101 ); // Spawn Trammel
AddCheck( 181, 73, 210, 211, true, 102 ); // Spawn Felucca
AddCheck( 181, 98, 210, 211, true, 103 ); // Spawn Ilshenar
AddCheck( 181, 123, 210, 211, true, 104 );// Spawn Malas
//AddCheck( 250, 48, 210, 211, true, 201 ); // Import items.wsc into Trammel
//AddCheck( 250, 73, 210, 211, true, 202 ); // Import items.wsc into Felucca
AddLabel( 248, 101, 200, "N/A" );
AddLabel( 248, 127, 200, "N/A" );

// World level options
//AddCheck( 20, 155, 210, 211, true, 11 );
//AddLabel( 40, 158, 200, "Decorate World - [Decorate");
AddCheck( 20, 180, 210, 211, true, 12 );
AddLabel( 40, 183, 200, "Moongates - [MoonGen");
AddCheck( 20, 205, 210, 211, true, 13 );
AddLabel( 40, 208, 200, "Teleporters - [TelGen");
AddCheck( 20, 230, 210, 211, true, 14 );
AddLabel( 40, 233, 200, "Signs - [SignGen");
AddCheck( 20, 255, 210, 211, true, 15 );
AddLabel( 40, 258, 200, "Doors - [DoorGen");

AddButton( 170, 280, 247, 249, 1, GumpButtonType.Reply, 0 );
AddButton( 245, 280, 241, 243, 0, GumpButtonType.Reply, 0 );
}

public override void OnResponse( NetState state, RelayInfo info )
{
Mobile from = state.Mobile;

switch( info.ButtonID )
{
case 0: // Closed or Cancel
{
return;
}

default:
{
// Make sure that the OK, button was pressed
if( info.ButtonID == 1 )
{
// Get the array of switches selected
ArrayList Selections = new ArrayList( info.Switches );

//Decorate the world
//if( Selections.Contains( 11 ) == true )
//{
//from.Say( "Decorating World..." );
//Decorate.Decorate_OnCommand( m_CommandEventArgs );
//}

//Do any facet specific items creation
// if( Selections.Contains( 201 ) == true )
//{
//Import Trammels 'items.wsc' file
//from.Map = Map.Trammel;
//from.Say( "Importing WSC into Trammel from file " + m_CommandEventArgs.Arguments[0] + "..." );
//ImportWSC.ImportWSC_OnCommand( m_CommandEventArgs );
//}

//if( Selections.Contains( 202 ) == true )
//{
//Import Felucca 'items.wsc' file
//from.Map = Map.Felucca;
//from.Say( "Importing WSC into Felucca from file " + m_CommandEventArgs.Arguments[0] + "..." );
//ImportWSC.ImportWSC_OnCommand( m_CommandEventArgs );
//}

//Generate all of the world moongates
if( Selections.Contains( 12 ) == true )
{
from.Say( "Generating Moongates..." );
PublicMoongate.MoonGen_OnCommand( m_CommandEventArgs );
}

// Generate all of the world teleporters
if( Selections.Contains( 13 ) == true )
{
from.Say( "Generating Teleporters..." );
GenTeleporter.GenTeleporter_OnCommand( m_CommandEventArgs );
}

// Generate all of the world signs
if( Selections.Contains( 14 ) == true )
{
from.Say( "Generating Signs..." );
SignParser.SignGen_OnCommand( m_CommandEventArgs );
}

// Generate all of the world doors
if( Selections.Contains( 15 ) == true )
{
from.Say( "Generating Doors..." );
DoorGenerator.DoorGen_OnCommand( m_CommandEventArgs );
}

// Now spawn any selected facets
if( Selections.Contains( 101 ) == true )
{
from.Say( "Spawning Trammel..." );
m_CommandEventArgs.Arguments[0] = "Spawns\\Trammel\\";
CreateWorld.LoadSpawns( m_CommandEventArgs );
from.Say( "Done Spawning Trammel." );
}

if( Selections.Contains( 102 ) == true )
{
from.Say( "Spawning Felucca..." );
m_CommandEventArgs.Arguments[0] = "Spawns\\Felucca\\";
CreateWorld.LoadSpawns( m_CommandEventArgs );
from.Say( "Done Spawning Felucca." );
}

if( Selections.Contains( 103 ) == true )
{
from.Say( "Spawning Ilshenar..." );
m_CommandEventArgs.Arguments[0] = "Spawns\\Ilshenar\\";
CreateWorld.LoadSpawns( m_CommandEventArgs );
from.Say( "Done Spawning Ilshenar." );
}

if( Selections.Contains( 104 ) == true )
{
from.Say( "Spawning Malas..." );
m_CommandEventArgs.Arguments[0] = "Spawns\\Malas\\";
CreateWorld.LoadSpawns( m_CommandEventArgs);
from.Say( "Done Spawning Malas." );
}
}

from.Say( "World Creation Completed!" );

break;
}
}
}
}
}[/code:1]

This createworld.cs should work with just the spawns installed and nothing else.
 

ArteGordon

Wanderer
did you install the spawns from the package? (the spawns\ subdirectory and its contents that goes in the top level of your runuo installation)
 

ArteGordon

Wanderer
did you extract the spawns\ subdirectory from the world package archive into your runuo install directory?
If you did, there would be a subdirectory named Spawns in the top level of your runuo installation, and inside that subdirectory would be subdirectories named Felucca, Trammel, Ilshenar, and Malas, and beneath those would be a bunch of files with .xml extensions that are the actual spawn files.
If those arent there, then you need to open up the beta36world2 package and extract the spawns\ subdirectory.
 

Honor

Sorceror
.

I took the files in the felucca folder. And putted them in my server regions folder. nothing happend
 

ArteGordon

Wanderer
In order for the createworld to work, the .xml files for felucca have to be in exactly the Spawns\Felucca\ subdirectory that is placed in the top level of your runuo installation. That's where the code looks for them.

So if you installed runuo into the directory

\RunUO-Beta-36

Then you need to put those spawns (the felucca .xml files) into

\RunUO-Beta-36\Spawns\Felucca\
 

Honor

Sorceror
.

Runuo-beta36 folder:

Got theese folders

- Data

- Web

- Saves

- Logs

- docs

- backups

- scripts

- RunUO Server Service

. FrontEnd

- RunUo Server
 

ArteGordon

Wanderer
you have to make the Spawns directory, it is not a part of the standard distribution. The easiest way is just to extract it from the package and the archiver program should make the directory for you during extraction.
 

ArteGordon

Wanderer
ArteGordon said:
In order for the createworld to work, the .xml files for felucca have to be in exactly the Spawns\Felucca\ subdirectory that is placed in the top level of your runuo installation. That's where the code looks for them.

So if you installed runuo into the directory

\RunUO-Beta-36

Then you need to put those spawns (the felucca .xml files) into

\RunUO-Beta-36\Spawns\Felucca\

did you put them exactly in this location? When you look in the directory \RunUO-Beta-36\Spawns\Felucca\ do you see the .xml files for felucca?
 

ArteGordon

Wanderer
Re: .

Honor said:
YEs in the RunUOWolrd2 folder its an Spawns/Felucca and loads of xml files
no, it needs to be in your runuo-beta-36 directory. Where all of your other runuo scripts and data are installed. The same directory that has Data, docs, Saves, the server.exe, etc. In that directory, you have to place the Spawns folder with all of its contents.
 

Randuin

Wanderer
OKay... I used the xmlspawnloader to load all the spawns, but after I kill the monsters... they don't respawn! what's wrong? :(
 

ArteGordon

Wanderer
cant say that I know whats going on. Try opening up one of the spawner gumps (double click a spawner as an admin) and see what it is doing.
 
Status
Not open for further replies.
Top