#W# Added PremiumSpawner system.
This commit is contained in:
parent
8fca4205a0
commit
9d0c3b9e9f
15 changed files with 6219 additions and 1220 deletions
45
Scripts/Engines/Spawner/PremiumSpawner/PSCount.cs
Normal file
45
Scripts/Engines/Spawner/PremiumSpawner/PSCount.cs
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using Server;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
using Server.Commands;
|
||||
|
||||
namespace Server.Commands
|
||||
{
|
||||
public class PSpawnerCount
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
Register( "pscount", AccessLevel.Administrator, new CommandEventHandler( Clearall_OnCommand ) );
|
||||
}
|
||||
|
||||
public static void Register( string command, AccessLevel access, CommandEventHandler handler )
|
||||
{
|
||||
CommandSystem.Register( command, access, handler );
|
||||
}
|
||||
|
||||
[Usage( "pscount" )]
|
||||
[Description( "Count PremiumSpawners." )]
|
||||
public static void Clearall_OnCommand( CommandEventArgs e )
|
||||
{
|
||||
Mobile from = e.Mobile;
|
||||
DateTime time = DateTime.Now;
|
||||
|
||||
List<Item> pspawnerlist = new List<Item>();
|
||||
|
||||
foreach ( Item pspawner in World.Items.Values )
|
||||
{
|
||||
if ( pspawner.Parent == null && pspawner is PremiumSpawner)
|
||||
{
|
||||
pspawnerlist.Add( pspawner );
|
||||
}
|
||||
}
|
||||
|
||||
from.SendMessage( "Premium Spawners: {0}", pspawnerlist.Count );
|
||||
}
|
||||
}
|
||||
}
|
||||
1515
Scripts/Engines/Spawner/PremiumSpawner/PremiumSpawner.cs
Normal file
1515
Scripts/Engines/Spawner/PremiumSpawner/PremiumSpawner.cs
Normal file
File diff suppressed because it is too large
Load diff
496
Scripts/Engines/Spawner/PremiumSpawner/PremiumSpawnerGump.cs
Normal file
496
Scripts/Engines/Spawner/PremiumSpawner/PremiumSpawnerGump.cs
Normal file
|
|
@ -0,0 +1,496 @@
|
|||
//Engine r120
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server.Network;
|
||||
using Server.Gumps;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class PremiumSpawnerGump : Gump
|
||||
{
|
||||
private PremiumSpawner m_Spawner;
|
||||
|
||||
public void AddBlackAlpha( int x, int y, int width, int height )
|
||||
{
|
||||
AddImageTiled( x, y, width, height, 2624 );
|
||||
AddAlphaRegion( x, y, width, height );
|
||||
}
|
||||
|
||||
public PremiumSpawnerGump( PremiumSpawner spawner ) : base( 50, 50 )
|
||||
{
|
||||
m_Spawner = spawner;
|
||||
|
||||
AddPage( 1 );
|
||||
|
||||
AddBackground( 0, 0, 350, 360, 5054 );
|
||||
|
||||
AddLabel( 80, 1, 52, "Creatures List 1" );
|
||||
|
||||
AddLabel( 215, 3, 52, "PREMIUM SPAWNER" );
|
||||
AddBlackAlpha( 213, 23, 125, 270 );
|
||||
|
||||
AddButton( 260, 40, 0xFB7, 0xFB9, 1000, GumpButtonType.Reply, 0 );
|
||||
AddLabel( 260, 60, 52, "Okay" );
|
||||
|
||||
AddButton( 260, 90, 0xFB4, 0xFB6, 200, GumpButtonType.Reply, 0 );
|
||||
AddLabel( 232, 110, 52, "Bring to Home" );
|
||||
|
||||
AddButton( 260, 140, 0xFA8, 0xFAA, 300, GumpButtonType.Reply, 0 );
|
||||
AddLabel( 232, 160, 52, "Total Respawn" );
|
||||
|
||||
AddButton( 260, 190, 0xFAB, 0xFAD, 400, GumpButtonType.Reply, 0 );
|
||||
AddLabel( 245, 210, 52, "Properties" );
|
||||
|
||||
AddButton( 260, 240, 0xFB1, 0xFB3, 500, GumpButtonType.Reply, 0 );
|
||||
AddLabel( 256, 260, 52, "Cancel" );
|
||||
|
||||
AddButton( 230, 320, 5603, 5607, 0, GumpButtonType.Page, 6 );
|
||||
AddButton( 302, 320, 5601, 5605, 0, GumpButtonType.Page, 2 );
|
||||
AddLabel( 258, 320, 52, "- 1 -" );
|
||||
|
||||
for ( int i = 0; i < 15; i++ )
|
||||
{
|
||||
// AddButton ( x, y, image, imageOnClick, ButtonID )
|
||||
AddButton( 5, ( 22 * i ) + 20, 0xFA5, 0xFA7, (1 + i), GumpButtonType.Reply, 0 ); // > (spawn this creature)
|
||||
AddButton( 38, ( 22 * i ) + 20, 0xFA2, 0xFA4, (91 + i), GumpButtonType.Reply, 0 ); // X (remove this creature)
|
||||
|
||||
AddImageTiled( 71, ( 22 * i ) + 20, 119, 23, 0xA40 );
|
||||
AddImageTiled( 72, ( 22 * i ) + 21, 117, 21, 0xBBC );
|
||||
|
||||
string str = "";
|
||||
|
||||
if ( i < spawner.CreaturesName.Count )
|
||||
{
|
||||
str = (string)spawner.CreaturesName[i];
|
||||
int count = m_Spawner.CountCreatures( m_Spawner.Creatures, str );
|
||||
|
||||
AddLabel( 192, ( 22 * i ) + 20, 0, count.ToString() );
|
||||
}
|
||||
|
||||
AddTextEntry( 75, ( 22 * i ) + 21, 114, 21, 0, 101 + i, str );
|
||||
}
|
||||
|
||||
AddPage( 2 );
|
||||
|
||||
AddBackground( 0, 0, 350, 360, 5054 );
|
||||
|
||||
AddLabel( 80, 1, 52, "Creatures List 2" );
|
||||
|
||||
AddLabel( 215, 3, 52, "PREMIUM SPAWNER" );
|
||||
AddBlackAlpha( 213, 23, 125, 270 );
|
||||
|
||||
AddButton( 260, 40, 0xFB7, 0xFB9, 1000, GumpButtonType.Reply, 0 );
|
||||
AddLabel( 260, 60, 52, "Okay" );
|
||||
|
||||
AddButton( 260, 90, 0xFB4, 0xFB6, 200, GumpButtonType.Reply, 0 );
|
||||
AddLabel( 232, 110, 52, "Bring to Home" );
|
||||
|
||||
AddButton( 260, 140, 0xFA8, 0xFAA, 300, GumpButtonType.Reply, 0 );
|
||||
AddLabel( 232, 160, 52, "Total Respawn" );
|
||||
|
||||
AddButton( 260, 190, 0xFAB, 0xFAD, 400, GumpButtonType.Reply, 0 );
|
||||
AddLabel( 245, 210, 52, "Properties" );
|
||||
|
||||
AddButton( 260, 240, 0xFB1, 0xFB3, 500, GumpButtonType.Reply, 0 );
|
||||
AddLabel( 256, 260, 52, "Cancel" );
|
||||
|
||||
AddButton( 230, 320, 5603, 5607, 0, GumpButtonType.Page, 1 );
|
||||
AddButton( 302, 320, 5601, 5605, 0, GumpButtonType.Page, 3 );
|
||||
AddLabel( 258, 320, 52, "- 2 -" );
|
||||
|
||||
for ( int i = 0; i < 15; i++ )
|
||||
{
|
||||
AddButton( 5, ( 22 * i ) + 20, 0xFA5, 0xFA7, (16 + i), GumpButtonType.Reply, 0 );
|
||||
AddButton( 38, ( 22 * i ) + 20, 0xFA2, 0xFA4, (106 + i), GumpButtonType.Reply, 0 );
|
||||
|
||||
AddImageTiled( 71, ( 22 * i ) + 20, 119, 23, 0xA40 );
|
||||
AddImageTiled( 72, ( 22 * i ) + 21, 117, 21, 0xBBC );
|
||||
|
||||
string str = "";
|
||||
|
||||
if ( i < spawner.SubSpawnerA.Count )
|
||||
{
|
||||
str = (string)spawner.SubSpawnerA[i];
|
||||
int count = m_Spawner.CountCreatures( m_Spawner.CreaturesA, str );
|
||||
|
||||
AddLabel( 192, ( 22 * i ) + 20, 0, count.ToString() );
|
||||
}
|
||||
|
||||
AddTextEntry( 75, ( 22 * i ) + 21, 114, 21, 0, 201 + i, str );
|
||||
}
|
||||
|
||||
AddPage( 3 );
|
||||
|
||||
AddBackground( 0, 0, 350, 360, 5054 );
|
||||
|
||||
AddLabel( 80, 1, 52, "Creatures List 3" );
|
||||
|
||||
AddLabel( 215, 3, 52, "PREMIUM SPAWNER" );
|
||||
AddBlackAlpha( 213, 23, 125, 270 );
|
||||
|
||||
AddButton( 260, 40, 0xFB7, 0xFB9, 1000, GumpButtonType.Reply, 0 );
|
||||
AddLabel( 260, 60, 52, "Okay" );
|
||||
|
||||
AddButton( 260, 90, 0xFB4, 0xFB6, 200, GumpButtonType.Reply, 0 );
|
||||
AddLabel( 232, 110, 52, "Bring to Home" );
|
||||
|
||||
AddButton( 260, 140, 0xFA8, 0xFAA, 300, GumpButtonType.Reply, 0 );
|
||||
AddLabel( 232, 160, 52, "Total Respawn" );
|
||||
|
||||
AddButton( 260, 190, 0xFAB, 0xFAD, 400, GumpButtonType.Reply, 0 );
|
||||
AddLabel( 245, 210, 52, "Properties" );
|
||||
|
||||
AddButton( 260, 240, 0xFB1, 0xFB3, 500, GumpButtonType.Reply, 0 );
|
||||
AddLabel( 256, 260, 52, "Cancel" );
|
||||
|
||||
AddButton( 230, 320, 5603, 5607, 0, GumpButtonType.Page, 2 );
|
||||
AddButton( 302, 320, 5601, 5605, 0, GumpButtonType.Page, 4 );
|
||||
AddLabel( 258, 320, 52, "- 3 -" );
|
||||
|
||||
for ( int i = 0; i < 15; i++ )
|
||||
{
|
||||
AddButton( 5, ( 22 * i ) + 20, 0xFA5, 0xFA7, (31 + i), GumpButtonType.Reply, 0 );
|
||||
AddButton( 38, ( 22 * i ) + 20, 0xFA2, 0xFA4, (121 + i), GumpButtonType.Reply, 0 );
|
||||
|
||||
AddImageTiled( 71, ( 22 * i ) + 20, 119, 23, 0xA40 );
|
||||
AddImageTiled( 72, ( 22 * i ) + 21, 117, 21, 0xBBC );
|
||||
|
||||
string str = "";
|
||||
|
||||
if ( i < spawner.SubSpawnerB.Count )
|
||||
{
|
||||
str = (string)spawner.SubSpawnerB[i];
|
||||
int count = m_Spawner.CountCreatures( m_Spawner.CreaturesB, str );
|
||||
|
||||
AddLabel( 192, ( 22 * i ) + 20, 0, count.ToString() );
|
||||
}
|
||||
|
||||
AddTextEntry( 75, ( 22 * i ) + 21, 114, 21, 0, 301 + i, str );
|
||||
}
|
||||
|
||||
AddPage( 4 );
|
||||
|
||||
AddBackground( 0, 0, 350, 360, 5054 );
|
||||
|
||||
AddLabel( 80, 1, 52, "Creatures List 4" );
|
||||
|
||||
AddLabel( 215, 3, 52, "PREMIUM SPAWNER" );
|
||||
AddBlackAlpha( 213, 23, 125, 270 );
|
||||
|
||||
AddButton( 260, 40, 0xFB7, 0xFB9, 1000, GumpButtonType.Reply, 0 );
|
||||
AddLabel( 260, 60, 52, "Okay" );
|
||||
|
||||
AddButton( 260, 90, 0xFB4, 0xFB6, 200, GumpButtonType.Reply, 0 );
|
||||
AddLabel( 232, 110, 52, "Bring to Home" );
|
||||
|
||||
AddButton( 260, 140, 0xFA8, 0xFAA, 300, GumpButtonType.Reply, 0 );
|
||||
AddLabel( 232, 160, 52, "Total Respawn" );
|
||||
|
||||
AddButton( 260, 190, 0xFAB, 0xFAD, 400, GumpButtonType.Reply, 0 );
|
||||
AddLabel( 245, 210, 52, "Properties" );
|
||||
|
||||
AddButton( 260, 240, 0xFB1, 0xFB3, 500, GumpButtonType.Reply, 0 );
|
||||
AddLabel( 256, 260, 52, "Cancel" );
|
||||
|
||||
AddButton( 230, 320, 5603, 5607, 0, GumpButtonType.Page, 3 );
|
||||
AddButton( 302, 320, 5601, 5605, 0, GumpButtonType.Page, 5 );
|
||||
AddLabel( 258, 320, 52, "- 4 -" );
|
||||
|
||||
for ( int i = 0; i < 15; i++ )
|
||||
{
|
||||
AddButton( 5, ( 22 * i ) + 20, 0xFA5, 0xFA7, (46 + i), GumpButtonType.Reply, 0 );
|
||||
AddButton( 38, ( 22 * i ) + 20, 0xFA2, 0xFA4, (136 + i), GumpButtonType.Reply, 0 );
|
||||
|
||||
AddImageTiled( 71, ( 22 * i ) + 20, 119, 23, 0xA40 );
|
||||
AddImageTiled( 72, ( 22 * i ) + 21, 117, 21, 0xBBC );
|
||||
|
||||
string str = "";
|
||||
|
||||
if ( i < spawner.SubSpawnerC.Count )
|
||||
{
|
||||
str = (string)spawner.SubSpawnerC[i];
|
||||
int count = m_Spawner.CountCreatures( m_Spawner.CreaturesC, str );
|
||||
|
||||
AddLabel( 192, ( 22 * i ) + 20, 0, count.ToString() );
|
||||
}
|
||||
|
||||
AddTextEntry( 75, ( 22 * i ) + 21, 114, 21, 0, 401 + i, str );
|
||||
}
|
||||
|
||||
AddPage( 5 );
|
||||
|
||||
AddBackground( 0, 0, 350, 360, 5054 );
|
||||
|
||||
AddLabel( 80, 1, 52, "Creatures List 5" );
|
||||
|
||||
AddLabel( 215, 3, 52, "PREMIUM SPAWNER" );
|
||||
AddBlackAlpha( 213, 23, 125, 270 );
|
||||
|
||||
AddButton( 260, 40, 0xFB7, 0xFB9, 1000, GumpButtonType.Reply, 0 );
|
||||
AddLabel( 260, 60, 52, "Okay" );
|
||||
|
||||
AddButton( 260, 90, 0xFB4, 0xFB6, 200, GumpButtonType.Reply, 0 );
|
||||
AddLabel( 232, 110, 52, "Bring to Home" );
|
||||
|
||||
AddButton( 260, 140, 0xFA8, 0xFAA, 300, GumpButtonType.Reply, 0 );
|
||||
AddLabel( 232, 160, 52, "Total Respawn" );
|
||||
|
||||
AddButton( 260, 190, 0xFAB, 0xFAD, 400, GumpButtonType.Reply, 0 );
|
||||
AddLabel( 245, 210, 52, "Properties" );
|
||||
|
||||
AddButton( 260, 240, 0xFB1, 0xFB3, 500, GumpButtonType.Reply, 0 );
|
||||
AddLabel( 256, 260, 52, "Cancel" );
|
||||
|
||||
AddButton( 230, 320, 5603, 5607, 0, GumpButtonType.Page, 4 );
|
||||
AddButton( 302, 320, 5601, 5605, 0, GumpButtonType.Page, 6 );
|
||||
AddLabel( 258, 320, 52, "- 5 -" );
|
||||
|
||||
for ( int i = 0; i < 15; i++ )
|
||||
{
|
||||
AddButton( 5, ( 22 * i ) + 20, 0xFA5, 0xFA7, (61 + i), GumpButtonType.Reply, 0 );
|
||||
AddButton( 38, ( 22 * i ) + 20, 0xFA2, 0xFA4, (151 + i), GumpButtonType.Reply, 0 );
|
||||
|
||||
AddImageTiled( 71, ( 22 * i ) + 20, 119, 23, 0xA40 );
|
||||
AddImageTiled( 72, ( 22 * i ) + 21, 117, 21, 0xBBC );
|
||||
|
||||
string str = "";
|
||||
|
||||
if ( i < spawner.SubSpawnerD.Count )
|
||||
{
|
||||
str = (string)spawner.SubSpawnerD[i];
|
||||
int count = m_Spawner.CountCreatures( m_Spawner.CreaturesD, str );
|
||||
|
||||
AddLabel( 192, ( 22 * i ) + 20, 0, count.ToString() );
|
||||
}
|
||||
|
||||
AddTextEntry( 75, ( 22 * i ) + 21, 114, 21, 0, 501 + i, str );
|
||||
}
|
||||
|
||||
AddPage( 6 );
|
||||
|
||||
AddBackground( 0, 0, 350, 360, 5054 );
|
||||
|
||||
AddLabel( 80, 1, 52, "Creatures List 6" );
|
||||
|
||||
AddLabel( 215, 3, 52, "PREMIUM SPAWNER" );
|
||||
AddBlackAlpha( 213, 23, 125, 270 );
|
||||
|
||||
AddButton( 260, 40, 0xFB7, 0xFB9, 1000, GumpButtonType.Reply, 0 );
|
||||
AddLabel( 260, 60, 52, "Okay" );
|
||||
|
||||
AddButton( 260, 90, 0xFB4, 0xFB6, 200, GumpButtonType.Reply, 0 );
|
||||
AddLabel( 232, 110, 52, "Bring to Home" );
|
||||
|
||||
AddButton( 260, 140, 0xFA8, 0xFAA, 300, GumpButtonType.Reply, 0 );
|
||||
AddLabel( 232, 160, 52, "Total Respawn" );
|
||||
|
||||
AddButton( 260, 190, 0xFAB, 0xFAD, 400, GumpButtonType.Reply, 0 );
|
||||
AddLabel( 245, 210, 52, "Properties" );
|
||||
|
||||
AddButton( 260, 240, 0xFB1, 0xFB3, 500, GumpButtonType.Reply, 0 );
|
||||
AddLabel( 256, 260, 52, "Cancel" );
|
||||
|
||||
AddButton( 230, 320, 5603, 5607, 0, GumpButtonType.Page, 5 );
|
||||
AddButton( 302, 320, 5601, 5605, 0, GumpButtonType.Page, 1 );
|
||||
AddLabel( 258, 320, 52, "- 6 -" );
|
||||
|
||||
for ( int i = 0; i < 15; i++ )
|
||||
{
|
||||
AddButton( 5, ( 22 * i ) + 20, 0xFA5, 0xFA7, (76 + i), GumpButtonType.Reply, 0 );
|
||||
AddButton( 38, ( 22 * i ) + 20, 0xFA2, 0xFA4, (166 + i), GumpButtonType.Reply, 0 );
|
||||
|
||||
AddImageTiled( 71, ( 22 * i ) + 20, 119, 23, 0xA40 );
|
||||
AddImageTiled( 72, ( 22 * i ) + 21, 117, 21, 0xBBC );
|
||||
|
||||
string str = "";
|
||||
|
||||
if ( i < spawner.SubSpawnerE.Count )
|
||||
{
|
||||
str = (string)spawner.SubSpawnerE[i];
|
||||
int count = m_Spawner.CountCreatures( m_Spawner.CreaturesE, str );
|
||||
|
||||
AddLabel( 192, ( 22 * i ) + 20, 0, count.ToString() );
|
||||
}
|
||||
|
||||
AddTextEntry( 75, ( 22 * i ) + 21, 114, 21, 0, 601 + i, str );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public List<string> CreateArray( RelayInfo info, Mobile from, int TextIndex )
|
||||
{
|
||||
List<string> creaturesName = new List<string>();
|
||||
|
||||
for ( int i = 0; i < 15; i++ )
|
||||
{
|
||||
TextRelay te = info.GetTextEntry( TextIndex + i );
|
||||
|
||||
if ( te != null )
|
||||
{
|
||||
string str = te.Text;
|
||||
|
||||
if ( str.Length > 0 )
|
||||
{
|
||||
str = str.Trim();
|
||||
|
||||
string t = Spawner.ParseType( str );
|
||||
|
||||
Type type = ScriptCompiler.FindTypeByName( t );
|
||||
|
||||
if ( type != null )
|
||||
creaturesName.Add( str );
|
||||
else
|
||||
from.SendMessage( "{0} is not a valid type name.", t );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return creaturesName;
|
||||
}
|
||||
|
||||
public string GetEntry( int Type, RelayInfo info )
|
||||
{
|
||||
TextRelay entry = info.GetTextEntry( Type );
|
||||
return entry.Text;
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState state, RelayInfo info )
|
||||
{
|
||||
if ( m_Spawner.Deleted )
|
||||
return;
|
||||
|
||||
switch ( info.ButtonID )
|
||||
{
|
||||
case 0: // Cancel (mouse's right button click anywhere on the gump)
|
||||
{
|
||||
break;
|
||||
}
|
||||
case 200: // Bring everything home
|
||||
{
|
||||
m_Spawner.BringToHome();
|
||||
break;
|
||||
}
|
||||
case 300: // Total respawn
|
||||
{
|
||||
// 1st save changes
|
||||
m_Spawner.CreaturesName = CreateArray( info, state.Mobile, 100 );
|
||||
m_Spawner.SubSpawnerA = CreateArray( info, state.Mobile, 200 );
|
||||
m_Spawner.SubSpawnerB = CreateArray( info, state.Mobile, 300 );
|
||||
m_Spawner.SubSpawnerC = CreateArray( info, state.Mobile, 400 );
|
||||
m_Spawner.SubSpawnerD = CreateArray( info, state.Mobile, 500 );
|
||||
m_Spawner.SubSpawnerE = CreateArray( info, state.Mobile, 600 );
|
||||
// then respwan
|
||||
m_Spawner.Respawn();
|
||||
m_Spawner.Running = true;
|
||||
break;
|
||||
}
|
||||
case 400: // Props
|
||||
{
|
||||
state.Mobile.SendGump( new PropertiesGump( state.Mobile, m_Spawner ) );
|
||||
state.Mobile.SendGump( new PremiumSpawnerGump( m_Spawner ) );
|
||||
break;
|
||||
}
|
||||
case 500: // Cancel button
|
||||
{
|
||||
break;
|
||||
}
|
||||
case 1000: // Okay
|
||||
{
|
||||
m_Spawner.CreaturesName = CreateArray( info, state.Mobile, 100 );
|
||||
m_Spawner.SubSpawnerA = CreateArray( info, state.Mobile, 200 );
|
||||
m_Spawner.SubSpawnerB = CreateArray( info, state.Mobile, 300 );
|
||||
m_Spawner.SubSpawnerC = CreateArray( info, state.Mobile, 400 );
|
||||
m_Spawner.SubSpawnerD = CreateArray( info, state.Mobile, 500 );
|
||||
m_Spawner.SubSpawnerE = CreateArray( info, state.Mobile, 600 );
|
||||
m_Spawner.Running = true;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{ //ButtonID: 1-90 spawn; 91-180 remove
|
||||
int ID = info.ButtonID;
|
||||
|
||||
int Type = 0;
|
||||
|
||||
// Spawn creature
|
||||
if ( (ID >= 1) && (ID <= 15) )
|
||||
{
|
||||
Type += 100 + ID;
|
||||
m_Spawner.SpawnFromGump( m_Spawner.CreaturesName, m_Spawner.Creatures, m_Spawner.Count, m_Spawner.CreaturesNameCount, GetEntry(Type, info) );
|
||||
}
|
||||
else if ( (ID >= 16) && (ID <= 30) )
|
||||
{
|
||||
Type += 200 + ID - 15;
|
||||
m_Spawner.SpawnFromGump( m_Spawner.SubSpawnerA, m_Spawner.CreaturesA, m_Spawner.CountA, m_Spawner.CreaturesNameCountA, GetEntry(Type, info) );
|
||||
}
|
||||
else if ( (ID >= 31) && (ID <= 45) )
|
||||
{
|
||||
Type += 300 + ID - 30;
|
||||
m_Spawner.SpawnFromGump( m_Spawner.SubSpawnerB, m_Spawner.CreaturesB, m_Spawner.CountB, m_Spawner.CreaturesNameCountB, GetEntry(Type, info) );
|
||||
}
|
||||
else if ( (ID >= 46) && (ID <= 60) )
|
||||
{
|
||||
Type += 400 + ID - 45;
|
||||
m_Spawner.SpawnFromGump( m_Spawner.SubSpawnerC, m_Spawner.CreaturesC, m_Spawner.CountC, m_Spawner.CreaturesNameCountC, GetEntry(Type, info) );
|
||||
}
|
||||
else if ( (ID >= 61) && (ID <= 75) )
|
||||
{
|
||||
Type += 500 + ID - 60;
|
||||
m_Spawner.SpawnFromGump( m_Spawner.SubSpawnerD, m_Spawner.CreaturesD, m_Spawner.CountD, m_Spawner.CreaturesNameCountD, GetEntry(Type, info) );
|
||||
}
|
||||
else if ( (ID >= 76) && (ID <= 90) )
|
||||
{
|
||||
Type += 600 + ID - 75;
|
||||
m_Spawner.SpawnFromGump( m_Spawner.SubSpawnerE, m_Spawner.CreaturesE, m_Spawner.CountE, m_Spawner.CreaturesNameCountE, GetEntry(Type, info) );
|
||||
}
|
||||
// Remove creature
|
||||
else if ( (ID >= 91) && (ID <= 105) )
|
||||
{
|
||||
Type += 100 + ID - 90;
|
||||
m_Spawner.RemoveCreaturesFromGump( m_Spawner.Creatures, GetEntry(Type, info) );
|
||||
}
|
||||
else if ( (ID >= 106) && (ID <= 120) )
|
||||
{
|
||||
Type += 200 + ID - 105;
|
||||
m_Spawner.RemoveCreaturesFromGump( m_Spawner.CreaturesA, GetEntry(Type, info) );
|
||||
}
|
||||
else if ( (ID >= 121) && (ID <= 135) )
|
||||
{
|
||||
Type += 300 + ID - 120;
|
||||
m_Spawner.RemoveCreaturesFromGump( m_Spawner.CreaturesB, GetEntry(Type, info) );
|
||||
}
|
||||
else if ( (ID >= 136) && (ID <= 150) )
|
||||
{
|
||||
Type += 400 + ID - 135;
|
||||
m_Spawner.RemoveCreaturesFromGump( m_Spawner.CreaturesC, GetEntry(Type, info) );
|
||||
}
|
||||
else if ( (ID >= 151) && (ID <= 165) )
|
||||
{
|
||||
Type += 500 + ID - 150;
|
||||
m_Spawner.RemoveCreaturesFromGump( m_Spawner.CreaturesD, GetEntry(Type, info) );
|
||||
}
|
||||
else if ( (ID >= 166) && (ID <= 180) )
|
||||
{
|
||||
Type += 600 + ID - 165;
|
||||
m_Spawner.RemoveCreaturesFromGump( m_Spawner.CreaturesE, GetEntry(Type, info) );
|
||||
}
|
||||
|
||||
string entry = GetEntry(Type, info);
|
||||
|
||||
if ( entry != null && entry.Length > 0 )
|
||||
{
|
||||
m_Spawner.CreaturesName = CreateArray( info, state.Mobile, 100 );
|
||||
m_Spawner.SubSpawnerA = CreateArray( info, state.Mobile, 200 );
|
||||
m_Spawner.SubSpawnerB = CreateArray( info, state.Mobile, 300 );
|
||||
m_Spawner.SubSpawnerC = CreateArray( info, state.Mobile, 400 );
|
||||
m_Spawner.SubSpawnerD = CreateArray( info, state.Mobile, 500 );
|
||||
m_Spawner.SubSpawnerE = CreateArray( info, state.Mobile, 600 );
|
||||
m_Spawner.Running = true;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
419
Scripts/Engines/Spawner/PremiumSpawner/PremiumSpawnerGumps.cs
Normal file
419
Scripts/Engines/Spawner/PremiumSpawner/PremiumSpawnerGumps.cs
Normal file
|
|
@ -0,0 +1,419 @@
|
|||
// Engine r117
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using Server.Commands;
|
||||
using Server.Network;
|
||||
using Server.Gumps;
|
||||
using Server.Regions;
|
||||
|
||||
namespace Server.Commands
|
||||
{
|
||||
public class OptionsGumps
|
||||
{
|
||||
public OptionsGumps()
|
||||
{
|
||||
}
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
CommandSystem.Register( "GumpSaveRegion", AccessLevel.Administrator, new CommandEventHandler( OptionsGumps1_OnCommand ) );
|
||||
CommandSystem.Register( "GumpSaveCoordinate", AccessLevel.Administrator, new CommandEventHandler( OptionsGumps2_OnCommand ) );
|
||||
CommandSystem.Register( "GumpRemoveID", AccessLevel.Administrator, new CommandEventHandler( OptionsGumps3_OnCommand ) );
|
||||
CommandSystem.Register( "GumpRemoveCoordinate", AccessLevel.Administrator, new CommandEventHandler( OptionsGumps4_OnCommand ) );
|
||||
CommandSystem.Register( "GumpRemoveRegion", AccessLevel.Administrator, new CommandEventHandler( OptionsGumps5_OnCommand ) );
|
||||
}
|
||||
|
||||
[Usage( "[GumpSaveRegion" )]
|
||||
[Description( "Gump to Save inside Region" )]
|
||||
private static void OptionsGumps1_OnCommand( CommandEventArgs e )
|
||||
{
|
||||
e.Mobile.SendGump( new GumpSaveRegion( e ) );
|
||||
}
|
||||
|
||||
[Usage( "[GumpSaveCoordinate" )]
|
||||
[Description( "Gump to save by coordinates" )]
|
||||
private static void OptionsGumps2_OnCommand( CommandEventArgs e )
|
||||
{
|
||||
e.Mobile.SendGump( new GumpSaveCoordinate( e ) );
|
||||
}
|
||||
|
||||
[Usage( "[GumpRemoveID" )]
|
||||
[Description( "Gump to remove by ID" )]
|
||||
private static void OptionsGumps3_OnCommand( CommandEventArgs e )
|
||||
{
|
||||
e.Mobile.SendGump( new GumpRemoveID( e ) );
|
||||
}
|
||||
|
||||
[Usage( "[GumpRemoveCoordinate" )]
|
||||
[Description( "Gump to remove by coordinates" )]
|
||||
private static void OptionsGumps4_OnCommand( CommandEventArgs e )
|
||||
{
|
||||
e.Mobile.SendGump( new GumpRemoveCoordinate( e ) );
|
||||
}
|
||||
|
||||
[Usage( "[GumpRemoveRegion" )]
|
||||
[Description( "Gump to remove inside region" )]
|
||||
private static void OptionsGumps5_OnCommand( CommandEventArgs e )
|
||||
{
|
||||
e.Mobile.SendGump( new GumpRemoveRegion( e ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpSaveRegion : Gump
|
||||
{
|
||||
private CommandEventArgs m_CommandEventArgs;
|
||||
|
||||
public GumpSaveRegion( CommandEventArgs e ) : base( 50,50 )
|
||||
{
|
||||
m_CommandEventArgs = e;
|
||||
Closable = true;
|
||||
Dragable = true;
|
||||
Mobile from = e.Mobile;
|
||||
|
||||
AddPage(1);
|
||||
//x, y, width, hight
|
||||
AddBackground( 0, 0, 232, 210, 5054 );
|
||||
|
||||
AddImageTiled( 15, 30, 120, 20, 3004 );
|
||||
AddTextEntry( 15, 30, 120, 20, 0, 0, @"region to save");
|
||||
AddLabel( 15, 10, 52, "Enter a Region:" );
|
||||
AddButton( 140, 32, 0x15E1, 0x15E5, 101, GumpButtonType.Reply, 0 );
|
||||
|
||||
AddLabel( 15, 60, 52, "Tip:" );
|
||||
AddHtml( 15, 80, 200, 110, "This will SAVE the spawners, in a specified region, to Data/Nerun's Distro/Spawns/'region name'.map. Type [where if you don't know the region you are. Copy to the text box the name of the region. You also can open Data/Regions.xml to a full list of regions.<BR>Example: you type [where and appear 'your region is town of Britain'. Type 'Britain' in text box.", true, true );
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState state, RelayInfo info)
|
||||
{
|
||||
Mobile from = state.Mobile;
|
||||
|
||||
switch ( info.ButtonID )
|
||||
{
|
||||
case 0: // close the gump
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
case 101:
|
||||
{
|
||||
TextRelay oRegion = info.GetTextEntry( 0 );
|
||||
string sRegion = oRegion.Text;
|
||||
if( sRegion != "" )
|
||||
{
|
||||
string prefix = Server.Commands.CommandSystem.Prefix;
|
||||
CommandSystem.Handle( from, String.Format( "{0}Spawngen save {1}", prefix, sRegion ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage( "You must specify a region!" );
|
||||
string prefix = Server.Commands.CommandSystem.Prefix;
|
||||
CommandSystem.Handle( from, String.Format( "{0}GumpSaveRegion", prefix ) );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class GumpRemoveRegion : Gump
|
||||
{
|
||||
private CommandEventArgs m_CommandEventArgs;
|
||||
|
||||
public GumpRemoveRegion( CommandEventArgs e ) : base( 50,50 )
|
||||
{
|
||||
m_CommandEventArgs = e;
|
||||
Closable = true;
|
||||
Dragable = true;
|
||||
Mobile from = e.Mobile;
|
||||
|
||||
AddPage(1);
|
||||
|
||||
AddBackground( 0, 0, 232, 210, 5054 );
|
||||
|
||||
AddImageTiled( 15, 30, 120, 20, 3004 );
|
||||
AddTextEntry( 15, 30, 120, 20, 0, 0, @"region to remove");
|
||||
AddLabel( 15, 10, 52, "Enter a Region:" );
|
||||
AddButton( 140, 32, 0x15E1, 0x15E5, 101, GumpButtonType.Reply, 0 );
|
||||
|
||||
AddLabel( 15, 60, 52, "Tip:" );
|
||||
AddHtml( 15, 80, 200, 110, "This will REMOVE the spawners, in a specified region. Type [where if you don't know the region you are. Copy to the text box the name of the region. You also can open Data/Regions.xml to a full list of regions.<BR>Example: you type [where and appear 'your region is town of Britain'. Type 'Britain' in text box.", true, true );
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState state, RelayInfo info)
|
||||
{
|
||||
Mobile from = state.Mobile;
|
||||
|
||||
switch ( info.ButtonID )
|
||||
{
|
||||
case 0: // close the gump
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
case 101:
|
||||
{
|
||||
TextRelay oRegion = info.GetTextEntry( 0 );
|
||||
string sRegion = oRegion.Text;
|
||||
if( sRegion != "" )
|
||||
{
|
||||
string prefix = Server.Commands.CommandSystem.Prefix;
|
||||
CommandSystem.Handle( from, String.Format( "{0}Spawngen remove {1}", prefix, sRegion ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage( "You must specify a region!" );
|
||||
string prefix = Server.Commands.CommandSystem.Prefix;
|
||||
CommandSystem.Handle( from, String.Format( "{0}GumpRemoveRegion", prefix ) );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class GumpRemoveID : Gump
|
||||
{
|
||||
private CommandEventArgs m_CommandEventArgs;
|
||||
|
||||
public GumpRemoveID( CommandEventArgs e ) : base( 50,50 )
|
||||
{
|
||||
m_CommandEventArgs = e;
|
||||
Closable = true;
|
||||
Dragable = true;
|
||||
Mobile from = e.Mobile;
|
||||
|
||||
AddPage(1);
|
||||
|
||||
AddBackground( 0, 0, 232, 210, 5054 );
|
||||
|
||||
AddImageTiled( 15, 30, 120, 20, 3004 );
|
||||
AddTextEntry( 15, 30, 120, 20, 0, 0, @"SpawnID to remove");
|
||||
AddLabel( 15, 10, 52, "Enter a SpawnID:" );
|
||||
AddButton( 140, 32, 0x15E1, 0x15E5, 101, GumpButtonType.Reply, 0 );
|
||||
|
||||
AddLabel( 15, 60, 52, "Tip:" );
|
||||
AddHtml( 15, 80, 200, 110, "This command was made to UNLOAD your own custom maps. This will REMOVE the spawners with the specified ID. Type '[get spawnid' in a spawner to know your ID. Remember: 'By Hand' spawns, i.e., those done with '[add premiumspawner' have ID = 1.", true, true );
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState state, RelayInfo info)
|
||||
{
|
||||
Mobile from = state.Mobile;
|
||||
|
||||
switch ( info.ButtonID )
|
||||
{
|
||||
case 0: // close the gump
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
case 101:
|
||||
{
|
||||
TextRelay oID = info.GetTextEntry( 0 );
|
||||
string sID = oID.Text;
|
||||
if( sID != "" )
|
||||
{
|
||||
try
|
||||
{
|
||||
int UnloadID = Convert.ToInt32( sID );
|
||||
string prefix = Server.Commands.CommandSystem.Prefix;
|
||||
CommandSystem.Handle( from, String.Format( "{0}Spawngen unload {1}", prefix, UnloadID ) );
|
||||
}
|
||||
catch
|
||||
{
|
||||
from.SendMessage( "SpawnID must be a number!" );
|
||||
string prefix = Server.Commands.CommandSystem.Prefix;
|
||||
CommandSystem.Handle( from, String.Format( "{0}GumpRemoveID", prefix ) );
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
from.SendMessage( "You must specify an SpawnID!" );
|
||||
string prefix = Server.Commands.CommandSystem.Prefix;
|
||||
CommandSystem.Handle( from, String.Format( "{0}GumpRemoveID", prefix ) );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class GumpSaveCoordinate : Gump
|
||||
{
|
||||
private CommandEventArgs m_CommandEventArgs;
|
||||
|
||||
public GumpSaveCoordinate( CommandEventArgs e ) : base( 50,50 )
|
||||
{
|
||||
m_CommandEventArgs = e;
|
||||
Closable = true;
|
||||
Dragable = true;
|
||||
Mobile from = e.Mobile;
|
||||
|
||||
AddPage(1);
|
||||
|
||||
AddBackground( 0, 0, 232, 235, 5054 );
|
||||
|
||||
AddImageTiled( 15, 30, 37, 20, 3004 );
|
||||
AddTextEntry( 15, 30, 37, 20, 0, 0, @"X1");
|
||||
|
||||
AddImageTiled( 57, 30, 37, 20, 3004 );
|
||||
AddTextEntry( 57, 30, 37, 20, 0, 1, @"Y1");
|
||||
|
||||
AddImageTiled( 15, 55, 37, 20, 3004 );
|
||||
AddTextEntry( 15, 55, 37, 20, 0, 2, @"X2");
|
||||
|
||||
AddImageTiled( 57, 55, 37, 20, 3004 );
|
||||
AddTextEntry( 57, 55, 37, 20, 0, 3, @"Y2");
|
||||
|
||||
AddLabel( 15, 10, 52, "Enter Coordinates:" );
|
||||
AddButton( 140, 32, 0x15E1, 0x15E5, 101, GumpButtonType.Reply, 0 );
|
||||
|
||||
AddLabel( 15, 85, 52, "Tip:" );
|
||||
AddHtml( 15, 105, 200, 110, "This will SAVE spawners inside specified coordinates. You can use [where in the first point and again [where in the second point to get the X and Y coordinates. You need 2: X1, Y1 for first point and X2, Y2 for the second point. The objective is determine a 'box'. This command will save all spawners inside this box.", true, true );
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState state, RelayInfo info)
|
||||
{
|
||||
Mobile from = state.Mobile;
|
||||
|
||||
switch ( info.ButtonID )
|
||||
{
|
||||
case 0: // close the gump
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
case 101:
|
||||
{
|
||||
TextRelay oX1 = info.GetTextEntry( 0 );
|
||||
TextRelay oY1 = info.GetTextEntry( 1 );
|
||||
TextRelay oX2 = info.GetTextEntry( 2 );
|
||||
TextRelay oY2 = info.GetTextEntry( 3 );
|
||||
string sX1 = oX1.Text;
|
||||
string sY1 = oY1.Text;
|
||||
string sX2 = oX2.Text;
|
||||
string sY2 = oY2.Text;
|
||||
if( sX1 != "" && sY1 != "" && sX2 != "" && sY2 != "" )
|
||||
{
|
||||
try
|
||||
{
|
||||
int iX1 = Convert.ToInt32( sX1 );
|
||||
int iY1 = Convert.ToInt32( sY1 );
|
||||
int iX2 = Convert.ToInt32( sX2 );
|
||||
int iY2 = Convert.ToInt32( sY2 );
|
||||
string prefix = Server.Commands.CommandSystem.Prefix;
|
||||
CommandSystem.Handle( from, String.Format( "{0}Spawngen save {1} {2} {3} {4}", prefix, iX1, iY1, iX2, iY2 ) );
|
||||
}
|
||||
catch
|
||||
{
|
||||
from.SendMessage( "Coordinates must be numbers!" );
|
||||
string prefix = Server.Commands.CommandSystem.Prefix;
|
||||
CommandSystem.Handle( from, String.Format( "{0}GumpSaveCoordinate", prefix ) );
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
from.SendMessage( "You must specify all coordinates!" );
|
||||
string prefix = Server.Commands.CommandSystem.Prefix;
|
||||
CommandSystem.Handle( from, String.Format( "{0}GumpSaveCoordinate", prefix ) );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class GumpRemoveCoordinate : Gump
|
||||
{
|
||||
private CommandEventArgs m_CommandEventArgs;
|
||||
|
||||
public GumpRemoveCoordinate( CommandEventArgs e ) : base( 50,50 )
|
||||
{
|
||||
m_CommandEventArgs = e;
|
||||
Closable = true;
|
||||
Dragable = true;
|
||||
Mobile from = e.Mobile;
|
||||
|
||||
AddPage(1);
|
||||
|
||||
AddBackground( 0, 0, 232, 235, 5054 );
|
||||
|
||||
AddImageTiled( 15, 30, 37, 20, 3004 );
|
||||
AddTextEntry( 15, 30, 37, 20, 0, 0, @"X1");
|
||||
|
||||
AddImageTiled( 57, 30, 37, 20, 3004 );
|
||||
AddTextEntry( 57, 30, 37, 20, 0, 1, @"Y1");
|
||||
|
||||
AddImageTiled( 15, 55, 37, 20, 3004 );
|
||||
AddTextEntry( 15, 55, 37, 20, 0, 2, @"X2");
|
||||
|
||||
AddImageTiled( 57, 55, 37, 20, 3004 );
|
||||
AddTextEntry( 57, 55, 37, 20, 0, 3, @"Y2");
|
||||
|
||||
AddLabel( 15, 10, 52, "Enter Coordinates:" );
|
||||
AddButton( 140, 32, 0x15E1, 0x15E5, 101, GumpButtonType.Reply, 0 );
|
||||
|
||||
AddLabel( 15, 85, 52, "Tip:" );
|
||||
AddHtml( 15, 105, 200, 110, "This will REMOVE spawners inside specified coordinates. You can use [where in the first point and again [where in the second point to get the X and Y coordinates. You need 2: X1, Y1 for first point and X2, Y2 for the second point. The objective is determine a 'box'. This command will remove all spawners inside this box.", true, true );
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState state, RelayInfo info)
|
||||
{
|
||||
Mobile from = state.Mobile;
|
||||
|
||||
switch ( info.ButtonID )
|
||||
{
|
||||
case 0: // close the gump
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
case 101:
|
||||
{
|
||||
TextRelay oX1 = info.GetTextEntry( 0 );
|
||||
TextRelay oY1 = info.GetTextEntry( 1 );
|
||||
TextRelay oX2 = info.GetTextEntry( 2 );
|
||||
TextRelay oY2 = info.GetTextEntry( 3 );
|
||||
string sX1 = oX1.Text;
|
||||
string sY1 = oY1.Text;
|
||||
string sX2 = oX2.Text;
|
||||
string sY2 = oY2.Text;
|
||||
if( sX1 != "" && sY1 != "" && sX2 != "" && sY2 != "" )
|
||||
{
|
||||
try
|
||||
{
|
||||
int iX1 = Convert.ToInt32( sX1 );
|
||||
int iY1 = Convert.ToInt32( sY1 );
|
||||
int iX2 = Convert.ToInt32( sX2 );
|
||||
int iY2 = Convert.ToInt32( sY2 );
|
||||
string prefix = Server.Commands.CommandSystem.Prefix;
|
||||
CommandSystem.Handle( from, String.Format( "{0}Spawngen remove {1} {2} {3} {4}", prefix, iX1, iY1, iX2, iY2 ) );
|
||||
}
|
||||
catch
|
||||
{
|
||||
from.SendMessage( "Coordinates must be numbers!" );
|
||||
string prefix = Server.Commands.CommandSystem.Prefix;
|
||||
CommandSystem.Handle( from, String.Format( "{0}GumpRemoveCoordinate", prefix ) );
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
from.SendMessage( "You must specify all coordinates!" );
|
||||
string prefix = Server.Commands.CommandSystem.Prefix;
|
||||
CommandSystem.Handle( from, String.Format( "{0}GumpRemoveCoordinate", prefix ) );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
288
Scripts/Engines/Spawner/PremiumSpawner/PremiumSpawnerMainGump.cs
Normal file
288
Scripts/Engines/Spawner/PremiumSpawner/PremiumSpawnerMainGump.cs
Normal file
|
|
@ -0,0 +1,288 @@
|
|||
// Engine r153
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
using Server.Commands;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class PremiumSpawnerMainGump : Gump
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
CommandSystem.Register("PremiumSpawner", AccessLevel.Administrator, new CommandEventHandler(PremiumSpawner_OnCommand));
|
||||
CommandSystem.Register("Spawner", AccessLevel.Administrator, new CommandEventHandler(PremiumSpawner_OnCommand));
|
||||
}
|
||||
|
||||
[Usage("PremiumSpawner")]
|
||||
[Aliases( "Spawner" )]
|
||||
[Description("PremiumSpawner main gump.")]
|
||||
public static void PremiumSpawner_OnCommand(CommandEventArgs e)
|
||||
{
|
||||
Mobile from = e.Mobile;
|
||||
|
||||
if (from.HasGump(typeof(PremiumSpawnerMainGump)))
|
||||
from.CloseGump(typeof(PremiumSpawnerMainGump));
|
||||
from.SendGump(new PremiumSpawnerMainGump(from));
|
||||
}
|
||||
|
||||
public PremiumSpawnerMainGump(Mobile from) : this()
|
||||
{
|
||||
}
|
||||
|
||||
public void AddBlackAlpha( int x, int y, int width, int height )
|
||||
{
|
||||
AddImageTiled( x, y, width, height, 2624 );
|
||||
AddAlphaRegion( x, y, width, height );
|
||||
}
|
||||
|
||||
public PremiumSpawnerMainGump() : base( 0, 0 )
|
||||
{
|
||||
this.Closable=true;
|
||||
this.Disposable=true;
|
||||
this.Dragable=true;
|
||||
//PAGE 1
|
||||
AddPage(1);
|
||||
AddBackground(93, 68, 256, 423, 9200);
|
||||
AddHtml( 98, 75, 244, 44, " PREMIUM SPAWNER<BR>" + "by Nerun Rev.154", (bool)true, (bool)false);
|
||||
AddBlackAlpha(100, 124, 241, 71);
|
||||
AddLabel(109, 126, 52, @"WORLD CREATION");
|
||||
AddLabel(126, 148, 52, @"Let there be light (Create World)");
|
||||
AddLabel(126, 170, 52, @"Apocalypse now (Clear All Facets)");
|
||||
AddButton(109, 151, 1210, 1209, 101, GumpButtonType.Reply, 0);
|
||||
AddButton(109, 173, 1210, 1209, 102, GumpButtonType.Reply, 0);
|
||||
AddBlackAlpha(100, 200, 241, 89);
|
||||
AddLabel(109, 202, 52, @"SELECT SPAWNS BY EXPANSION");
|
||||
AddLabel(126, 224, 52, @"UO Classic spawns (pre-T2A)");
|
||||
AddLabel(126, 244, 52, @"UO Mondain's Legacy spawns");
|
||||
AddLabel(126, 264, 52, @"UO KR, SA and HS spawns");
|
||||
//AddLabel(238, 224, 52, @"UO:ML spawns");
|
||||
//AddLabel(238, 244, 52, @"UO:KR, SA and HS spawns");
|
||||
//AddLabel(238, 264, 52, @"teste");
|
||||
AddButton(109, 227, 1210, 1209, 103, GumpButtonType.Reply, 0);
|
||||
AddButton(109, 247, 1210, 1209, 104, GumpButtonType.Reply, 0);
|
||||
AddButton(109, 267, 1210, 1209, 105, GumpButtonType.Reply, 0);
|
||||
//AddButton(221, 227, 1210, 1209, 106, GumpButtonType.Reply, 0);
|
||||
//AddButton(221, 247, 1210, 1209, 107, GumpButtonType.Reply, 0);
|
||||
//AddButton(221, 267, 1210, 1209, 108, GumpButtonType.Reply, 0);
|
||||
AddBlackAlpha(100, 294, 241, 89);
|
||||
AddLabel(109, 296, 52, @"REMOVE SPAWNS BY EXPANSION");
|
||||
AddLabel(126, 318, 52, @"UO Classic spawns (pre-T2A)");
|
||||
AddLabel(126, 338, 52, @"UO Mondain's Legacy spawns");
|
||||
AddLabel(126, 358, 52, @"UO KR, SA and HS spawns");
|
||||
//AddLabel(238, 318, 52, @"Ter Mur");
|
||||
//AddLabel(238, 338, 52, @"Tokuno");
|
||||
//AddLabel(238, 358, 52, @"Trammel");
|
||||
AddButton(109, 321, 1210, 1209, 109, GumpButtonType.Reply, 0);
|
||||
AddButton(109, 341, 1210, 1209, 110, GumpButtonType.Reply, 0);
|
||||
AddButton(109, 361, 1210, 1209, 111, GumpButtonType.Reply, 0);
|
||||
//AddButton(221, 321, 1210, 1209, 112, GumpButtonType.Reply, 0);
|
||||
//AddButton(221, 341, 1210, 1209, 113, GumpButtonType.Reply, 0);
|
||||
//AddButton(221, 361, 1210, 1209, 114, GumpButtonType.Reply, 0);
|
||||
AddBlackAlpha(100, 388, 241, 68);
|
||||
AddLabel(109, 391, 52, @"SMART PLAYER RANGE SENSITIVE");
|
||||
AddLabel(126, 413, 52, @"Generate Spawns' Overseer");
|
||||
AddLabel(126, 432, 52, @"Remove Spawns' Overseer");
|
||||
AddButton(109, 416, 1210, 1209, 115, GumpButtonType.Reply, 0);
|
||||
AddButton(109, 435, 1210, 1209, 116, GumpButtonType.Reply, 0);
|
||||
//Page change
|
||||
AddLabel(207, 463, 200, @"1/3");
|
||||
AddButton(235, 465, 5601, 5605, 0, GumpButtonType.Page, 2); //advance
|
||||
|
||||
// PAGE 2
|
||||
AddPage(2);
|
||||
AddBackground(93, 68, 256, 423, 9200);
|
||||
AddHtml( 98, 75, 244, 44, " PREMIUM SPAWNER<BR>" + "by Nerun Rev.154", (bool)true, (bool)false);
|
||||
AddBlackAlpha(100, 124, 241, 114);
|
||||
AddLabel(109, 126, 52, @"SAVE SPAWNERS");
|
||||
AddLabel(126, 148, 52, @"All spawns (spawns.map)");
|
||||
AddLabel(126, 170, 52, @"'By hand' spawns (byhand.map)");
|
||||
AddLabel(126, 192, 52, @"Spawns inside region (region.map)");
|
||||
AddLabel(126, 214, 52, @"Spawns inside coordinates");
|
||||
AddButton(109, 151, 1210, 1209, 117, GumpButtonType.Reply, 0);
|
||||
AddButton(109, 173, 1210, 1209, 118, GumpButtonType.Reply, 0);
|
||||
AddButton(109, 195, 1210, 1209, 119, GumpButtonType.Reply, 0);
|
||||
AddButton(109, 217, 1210, 1209, 120, GumpButtonType.Reply, 0);
|
||||
AddBlackAlpha(100, 244, 241, 134);
|
||||
AddLabel(109, 246, 52, @"REMOVE SPAWNERS");
|
||||
AddLabel(126, 268, 52, @"All spawners in ALL facets");
|
||||
AddLabel(126, 290, 52, @"All spawners in THIS facet");
|
||||
AddLabel(126, 312, 52, @"Remove spawners by SpawnID");
|
||||
AddLabel(126, 334, 52, @"Remove inside coordinates");
|
||||
AddLabel(126, 355, 52, @"Remove spawners inside region");
|
||||
AddButton(109, 271, 1210, 1209, 121, GumpButtonType.Reply, 0);
|
||||
AddButton(109, 293, 1210, 1209, 122, GumpButtonType.Reply, 0);
|
||||
AddButton(109, 315, 1210, 1209, 123, GumpButtonType.Reply, 0);
|
||||
AddButton(109, 337, 1210, 1209, 124, GumpButtonType.Reply, 0);
|
||||
AddButton(109, 358, 1210, 1209, 125, GumpButtonType.Reply, 0);
|
||||
AddBlackAlpha(100, 385, 241, 71);
|
||||
AddLabel(109, 387, 52, @"EDITOR");
|
||||
AddLabel(126, 408, 52, @"Spawn Editor (edit, find and list");
|
||||
AddLabel(126, 427, 52, @"all PremiumSpawners in the world)");
|
||||
AddButton(109, 411, 1210, 1209, 126, GumpButtonType.Reply, 0);
|
||||
//Page change
|
||||
AddLabel(207, 463, 200, @"2/3");
|
||||
AddButton(189, 465, 5603, 5607, 0, GumpButtonType.Page, 1); //back
|
||||
AddButton(235, 465, 5601, 5605, 0, GumpButtonType.Page, 3); //advance
|
||||
|
||||
//PAGE 3
|
||||
AddPage(3);
|
||||
AddBackground(93, 68, 256, 423, 9200);
|
||||
AddHtml( 98, 75, 244, 44, " PREMIUM SPAWNER<BR>" + "by Nerun Rev.154", (bool)true, (bool)false);
|
||||
AddBlackAlpha(101, 124, 241, 47);
|
||||
AddLabel(109, 126, 52, @"CONVERSION UTILITY");
|
||||
AddLabel(127, 148, 52, @"RunUO Spawners to Premium");
|
||||
AddButton(110, 151, 1210, 1209, 127, GumpButtonType.Reply, 0);
|
||||
AddBlackAlpha(101, 177, 241, 134);
|
||||
AddLabel(109, 179, 52, @"CUSTOM REGIONS IN A BOX");
|
||||
AddLabel(127, 201, 52, @"Add a Region Controler");
|
||||
AddLabel(127, 222, 52, @"(double-click the Region");
|
||||
AddLabel(127, 243, 52, @"Controller to configure it region.");
|
||||
AddLabel(127, 264, 52, @"Every Controller control one");
|
||||
AddLabel(127, 286, 52, @"region. Don't forget to prop)");
|
||||
AddButton(110, 204, 1210, 1209, 128, GumpButtonType.Reply, 0);
|
||||
//Page change
|
||||
AddLabel(207, 463, 200, @"3/3");
|
||||
AddButton(189, 465, 5603, 5607, 0, GumpButtonType.Page, 2); //back
|
||||
}
|
||||
|
||||
public static void DoThis( Mobile from, string command)
|
||||
{
|
||||
string prefix = Server.Commands.CommandSystem.Prefix;
|
||||
CommandSystem.Handle( from, String.Format( "{0}{1}", prefix, command ) );
|
||||
CommandSystem.Handle( from, String.Format( "{0}spawner", prefix ) );
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
Mobile from = sender.Mobile;
|
||||
|
||||
switch(info.ButtonID)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
//Quit
|
||||
break;
|
||||
}
|
||||
case 101:
|
||||
{
|
||||
DoThis( from, "createworld" );
|
||||
break;
|
||||
}
|
||||
case 102:
|
||||
{
|
||||
DoThis( from, "clearall" );
|
||||
break;
|
||||
}
|
||||
case 103:
|
||||
{
|
||||
from.Say( "SPAWNING UO Classic..." );
|
||||
DoThis( from, "spawngen uoclassic/UOClassic.map" );
|
||||
break;
|
||||
}
|
||||
case 104:
|
||||
{
|
||||
DoThis( from, "SpawnUOML" );
|
||||
break;
|
||||
}
|
||||
case 105:
|
||||
{
|
||||
DoThis( from, "SpawnCurrent" );
|
||||
break;
|
||||
}
|
||||
//DoThis( from106, "" );
|
||||
//DoThis( from107, "" );
|
||||
//DoThis( from108, "" );
|
||||
case 109:
|
||||
{
|
||||
DoThis( from, "spawngen unload 1000" );
|
||||
break;
|
||||
}
|
||||
case 110:
|
||||
{
|
||||
DoThis( from, "UnloadUOML" );
|
||||
break;
|
||||
}
|
||||
case 111:
|
||||
{
|
||||
DoThis( from, "UnloadCurrent" );
|
||||
break;
|
||||
}
|
||||
//DoThis( from112, "" );
|
||||
//DoThis( from113, "" );
|
||||
//DoThis( from114, "" );
|
||||
case 115:
|
||||
{
|
||||
DoThis( from, "GenSeers" );
|
||||
break;
|
||||
}
|
||||
case 116:
|
||||
{
|
||||
DoThis( from, "RemSeers" );
|
||||
break;
|
||||
}
|
||||
case 117:
|
||||
{
|
||||
DoThis( from, "spawngen save" );
|
||||
break;
|
||||
}
|
||||
case 118:
|
||||
{
|
||||
DoThis( from, "spawngen savebyhand" );
|
||||
break;
|
||||
}
|
||||
case 119:
|
||||
{
|
||||
DoThis( from, "GumpSaveRegion" );
|
||||
break;
|
||||
}
|
||||
case 120:
|
||||
{
|
||||
DoThis( from, "GumpSaveCoordinate" );
|
||||
break;
|
||||
}
|
||||
case 121:
|
||||
{
|
||||
DoThis( from, "spawngen remove" );
|
||||
break;
|
||||
}
|
||||
case 122:
|
||||
{
|
||||
DoThis( from, "spawngen cleanfacet" );
|
||||
break;
|
||||
}
|
||||
case 123:
|
||||
{
|
||||
DoThis( from, "GumpRemoveID" );
|
||||
break;
|
||||
}
|
||||
case 124:
|
||||
{
|
||||
DoThis( from, "GumpRemoveCoordinate" );
|
||||
break;
|
||||
}
|
||||
case 125:
|
||||
{
|
||||
DoThis( from, "GumpRemoveRegion" );
|
||||
break;
|
||||
}
|
||||
case 126:
|
||||
{
|
||||
DoThis( from, "SpawnEditor" );
|
||||
break;
|
||||
}
|
||||
case 127:
|
||||
{
|
||||
DoThis( from, "RunUOSpawnerExporter" );
|
||||
break;
|
||||
}
|
||||
case 128:
|
||||
{
|
||||
DoThis( from, "Add RegionControl" );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
161
Scripts/Engines/Spawner/PremiumSpawner/RunUOSpawnerExporter.cs
Normal file
161
Scripts/Engines/Spawner/PremiumSpawner/RunUOSpawnerExporter.cs
Normal file
|
|
@ -0,0 +1,161 @@
|
|||
//Engine r154
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Commands
|
||||
{
|
||||
public class RunUOSpawnerExporter
|
||||
{
|
||||
public const bool Enabled = true;
|
||||
|
||||
public static bool IsLinux
|
||||
{
|
||||
get
|
||||
{
|
||||
int p = (int) Environment.OSVersion.Platform;
|
||||
return (p == 4) || (p == 6) || (p == 128);
|
||||
}
|
||||
}
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
CommandSystem.Register( "RunUOSpawnerExporter" , AccessLevel.Administrator, new CommandEventHandler( RunUOSpawnerExporter_OnCommand ) );
|
||||
CommandSystem.Register( "RSE" , AccessLevel.Administrator, new CommandEventHandler( RunUOSpawnerExporter_OnCommand ) );
|
||||
}
|
||||
|
||||
public static int ConvertToInt( TimeSpan ts )
|
||||
{
|
||||
return ( ( ts.Hours * 60 ) + ts.Minutes + (ts.Seconds/60) );
|
||||
}
|
||||
|
||||
[Usage( "RunUOSpawnerExporter" )]
|
||||
[Aliases( "RSE" )]
|
||||
[Description( "Convert RunUO Spawners to PremiumSpawners." )]
|
||||
public static void RunUOSpawnerExporter_OnCommand( CommandEventArgs e )
|
||||
{
|
||||
Map map = e.Mobile.Map;
|
||||
List<Item> list = new List<Item>();
|
||||
|
||||
string bar = "\\";
|
||||
|
||||
if (IsLinux == true)
|
||||
bar = "/";
|
||||
|
||||
string path = @"."+bar+"Data"+bar+"Nerun's Distro"+bar+"Spawns"+bar;
|
||||
|
||||
if ( !Directory.Exists( path ) )
|
||||
Directory.CreateDirectory( path );
|
||||
|
||||
using ( StreamWriter op = new StreamWriter( String.Format( path+"{0}-exported.map", map ) ) )
|
||||
{
|
||||
|
||||
if ( map == null || map == Map.Internal )
|
||||
{
|
||||
e.Mobile.SendMessage( "You may not run that command here." );
|
||||
return;
|
||||
}
|
||||
|
||||
e.Mobile.SendMessage( "Converting Spawners..." );
|
||||
|
||||
op.WriteLine( "#######################################" );
|
||||
op.WriteLine( "## Converted By RunUOSpawnerExporter ##" );
|
||||
op.WriteLine( "## Developed by Nerun ##" );
|
||||
op.WriteLine( "#######################################" );
|
||||
|
||||
foreach ( Item item in World.Items.Values )
|
||||
{
|
||||
if ( item.Map == map && item.Parent == null && item is Spawner )
|
||||
list.Add( item );
|
||||
}
|
||||
|
||||
foreach ( Spawner spawner in list )
|
||||
{
|
||||
string mapfinal = "";
|
||||
|
||||
string walkrange = "";
|
||||
|
||||
if(map == Map.Maps[0])
|
||||
{
|
||||
mapfinal = "1";
|
||||
}
|
||||
else if(map == Map.Maps[1])
|
||||
{
|
||||
mapfinal = "2";
|
||||
}
|
||||
else if(map == Map.Maps[2])
|
||||
{
|
||||
mapfinal = "3";
|
||||
}
|
||||
else if(map == Map.Maps[3])
|
||||
{
|
||||
mapfinal = "4";
|
||||
}
|
||||
else if(map == Map.Maps[4])
|
||||
{
|
||||
mapfinal = "5";
|
||||
}
|
||||
else
|
||||
{
|
||||
mapfinal = "6";
|
||||
}
|
||||
|
||||
if( spawner.WalkingRange == -1 )
|
||||
{
|
||||
walkrange = spawner.HomeRange.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
walkrange = spawner.WalkingRange.ToString();
|
||||
}
|
||||
|
||||
int MinDelay = ConvertToInt(spawner.MinDelay);
|
||||
|
||||
if (MinDelay < 1)
|
||||
{
|
||||
MinDelay = 1;
|
||||
}
|
||||
|
||||
int MaxDelay = ConvertToInt(spawner.MaxDelay);
|
||||
|
||||
if (MaxDelay < MinDelay)
|
||||
{
|
||||
MaxDelay = MinDelay;
|
||||
}
|
||||
|
||||
string towrite = "*|";
|
||||
|
||||
if( spawner.SpawnNames.Count > 0 )
|
||||
{
|
||||
towrite = "*|" + spawner.SpawnNames[0];
|
||||
|
||||
for ( int i = 1; i < spawner.SpawnNames.Count; ++i )
|
||||
{
|
||||
towrite = towrite + ":" + spawner.SpawnNames[i].ToString();
|
||||
}
|
||||
}
|
||||
|
||||
if ( spawner.SpawnNames.Count > 0 && spawner.Running == true )
|
||||
{
|
||||
op.WriteLine( "{0}||||||{1}|{2}|{3}|{4}|{5}|{6}|{7}|{8}|1|{9}|0|0|0|0|0", towrite, spawner.X, spawner.Y, spawner.Z, mapfinal, MinDelay, MaxDelay, walkrange, spawner.HomeRange, spawner.Count);
|
||||
}
|
||||
|
||||
if( spawner.SpawnNames.Count == 0 )
|
||||
{
|
||||
op.WriteLine( "## Void: {0}||||||{1}|{2}|{3}|{4}|{5}|{6}|{7}|{8}|1|{9}|0|0|0|0|0", towrite, spawner.X, spawner.Y, spawner.Z, mapfinal, MinDelay, MaxDelay, walkrange, spawner.HomeRange, spawner.Count);
|
||||
}
|
||||
|
||||
if( spawner.SpawnNames.Count > 0 && spawner.Running == false )
|
||||
{
|
||||
op.WriteLine( "## Inactive: {0}||||||{1}|{2}|{3}|{4}|{5}|{6}|{7}|{8}|1|{9}|0|0|0|0|0", towrite, spawner.X, spawner.Y, spawner.Z, mapfinal, MinDelay, MaxDelay, walkrange, spawner.HomeRange, spawner.Count);
|
||||
}
|
||||
}
|
||||
e.Mobile.SendMessage( String.Format( "You exported {0} RunUO Spawner{1} from this facet.", list.Count, list.Count == 1 ? "" : "s" ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
1017
Scripts/Engines/Spawner/PremiumSpawner/SpawnEditor.cs
Normal file
1017
Scripts/Engines/Spawner/PremiumSpawner/SpawnEditor.cs
Normal file
File diff suppressed because it is too large
Load diff
642
Scripts/Engines/Spawner/PremiumSpawner/SpawnGen.cs
Normal file
642
Scripts/Engines/Spawner/PremiumSpawner/SpawnGen.cs
Normal file
|
|
@ -0,0 +1,642 @@
|
|||
//Engine r117
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
using Server.Commands;
|
||||
using Server.Regions;
|
||||
|
||||
namespace Server
|
||||
{
|
||||
public class SpawnGenerator
|
||||
{
|
||||
private static int m_Count;
|
||||
private static int m_MapOverride = -1;
|
||||
private static int m_IDOverride = -1;
|
||||
private static double m_MinTimeOverride = -1;
|
||||
private static double m_MaxTimeOverride = -1;
|
||||
private const bool TotalRespawn = true;
|
||||
private const int Team = 0;
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
CommandSystem.Register( "SpawnGen", AccessLevel.Administrator, new CommandEventHandler( SpawnGen_OnCommand ) );
|
||||
}
|
||||
|
||||
[Usage( "SpawnGen [<filename>]|[unload <id>]|[remove <region>|<rect>]|[save <region>|<rect>][savebyhand][cleanfacet]" )]
|
||||
[Description( "Complex command, it generate and remove spawners." )]
|
||||
private static void SpawnGen_OnCommand( CommandEventArgs e )
|
||||
{
|
||||
//wrong use
|
||||
if ( e.ArgString == null || e.ArgString == "" )
|
||||
{
|
||||
e.Mobile.SendMessage( "Usage: SpawnGen [<filename>]|[remove <region>|<rect>|<ID>]|[save <region>|<rect>|<ID>]" );
|
||||
}
|
||||
//[spawngen remove and [spawngen remove region
|
||||
else if ( e.Arguments[0].ToLower() == "remove" && e.Arguments.Length == 2 )
|
||||
{
|
||||
Remove( e.Mobile, e.Arguments[1].ToLower() );
|
||||
}
|
||||
//[spawngen remove x1 y1 x2 y2
|
||||
else if ( e.Arguments[0].ToLower() == "remove" && e.Arguments.Length == 5 )
|
||||
{
|
||||
int x1 = Utility.ToInt32( e.Arguments[1] );
|
||||
int y1 = Utility.ToInt32( e.Arguments[2] );
|
||||
int x2 = Utility.ToInt32( e.Arguments[3] );
|
||||
int y2 = Utility.ToInt32( e.Arguments[4] );
|
||||
RemoveByCoord( e.Mobile, x1, y1, x2, y2 );
|
||||
}
|
||||
//[spawngen remove
|
||||
else if ( e.ArgString.ToLower() == "remove" )
|
||||
{
|
||||
Remove( e.Mobile, "" );
|
||||
}
|
||||
//[spawngen save and [spawngen save region
|
||||
else if ( e.Arguments[0].ToLower() == "save" && e.Arguments.Length == 2 )
|
||||
{
|
||||
Save( e.Mobile, e.Arguments[1].ToLower() );
|
||||
}
|
||||
//[spawngen unload SpawnID
|
||||
else if ( e.Arguments[0].ToLower() == "unload" && e.Arguments.Length == 2 )
|
||||
{
|
||||
int ID = Utility.ToInt32( e.Arguments[1] );
|
||||
Unload( ID );
|
||||
}
|
||||
//[spawngen savebyhand
|
||||
else if ( e.Arguments[0].ToLower() == "savebyhand" )
|
||||
{
|
||||
SaveByHand();
|
||||
}
|
||||
//[spawngen cleanfacet
|
||||
else if ( e.Arguments[0].ToLower() == "cleanfacet" )
|
||||
{
|
||||
CleanFacet( e.Mobile );
|
||||
}
|
||||
////[spawngen save x1 y1 x2 y2
|
||||
else if ( e.Arguments[0].ToLower() == "save" && e.Arguments.Length == 5 )
|
||||
{
|
||||
int x1 = Utility.ToInt32( e.Arguments[1] );
|
||||
int y1 = Utility.ToInt32( e.Arguments[2] );
|
||||
int x2 = Utility.ToInt32( e.Arguments[3] );
|
||||
int y2 = Utility.ToInt32( e.Arguments[4] );
|
||||
SaveByCoord( e.Mobile, x1, y1, x2, y2 );
|
||||
}
|
||||
//[spawngen save
|
||||
else if ( e.ArgString.ToLower() == "save" )
|
||||
{
|
||||
Save( e.Mobile, "" );
|
||||
}
|
||||
else
|
||||
{
|
||||
Parse( e.Mobile, e.ArgString );
|
||||
}
|
||||
}
|
||||
|
||||
public static void Talk( string alfa )
|
||||
{
|
||||
World.Broadcast( 0x35, true, "Spawns are being {0}, please wait.", alfa );
|
||||
}
|
||||
|
||||
public static string GetRegion(Item item)
|
||||
{
|
||||
Region re = Region.Find(item.Location, item.Map);
|
||||
string regname = re.ToString().ToLower();
|
||||
return regname;
|
||||
}
|
||||
|
||||
//[spawngen remove and [spawngen remove region
|
||||
private static void Remove( Mobile from, string region )
|
||||
{
|
||||
DateTime aTime = DateTime.Now;
|
||||
int count = 0;
|
||||
List<Item> itemtodo = new List<Item>();
|
||||
|
||||
string prefix = Server.Commands.CommandSystem.Prefix;
|
||||
|
||||
if( region == null || region == "" )
|
||||
{
|
||||
CommandSystem.Handle( from, String.Format( "{0}Global remove where premiumspawner", prefix ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach( Item itemdel in World.Items.Values )
|
||||
{
|
||||
if( itemdel is PremiumSpawner && itemdel.Map == from.Map )
|
||||
{
|
||||
if( GetRegion(itemdel) == region )
|
||||
{
|
||||
itemtodo.Add(itemdel);
|
||||
count += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GenericRemove( itemtodo, count, aTime);
|
||||
}
|
||||
}
|
||||
|
||||
//[spawngen unload SpawnID
|
||||
private static void Unload( int ID )
|
||||
{
|
||||
DateTime aTime = DateTime.Now;
|
||||
int count = 0;
|
||||
List<Item> itemtodo = new List<Item>();
|
||||
|
||||
foreach ( Item itemremove in World.Items.Values )
|
||||
{
|
||||
if ( itemremove is PremiumSpawner && ((PremiumSpawner)itemremove).SpawnID == ID )
|
||||
{
|
||||
itemtodo.Add( itemremove );
|
||||
count +=1;
|
||||
}
|
||||
}
|
||||
|
||||
GenericRemove( itemtodo, count, aTime);
|
||||
}
|
||||
|
||||
//[spawngen remove x1 y1 x2 y2
|
||||
private static void RemoveByCoord( Mobile from, int x1, int y1, int x2, int y2 )
|
||||
{
|
||||
DateTime aTime = DateTime.Now;
|
||||
int count = 0;
|
||||
List<Item> itemtodo = new List<Item>();
|
||||
|
||||
foreach ( Item itemremove in World.Items.Values )
|
||||
{
|
||||
if ( itemremove is PremiumSpawner && ( ( itemremove.X >= x1 && itemremove.X <= x2 ) && ( itemremove.Y >= y1 && itemremove.Y <= y2 ) && itemremove.Map == from.Map ) )
|
||||
{
|
||||
itemtodo.Add( itemremove );
|
||||
count +=1;
|
||||
}
|
||||
}
|
||||
|
||||
GenericRemove( itemtodo, count, aTime);
|
||||
}
|
||||
|
||||
//[spawngen cleanfacet
|
||||
//this is the old [SpawnRem
|
||||
public static void CleanFacet( Mobile from )
|
||||
{
|
||||
DateTime aTime = DateTime.Now;
|
||||
int count = 0;
|
||||
List<Item> itemtodo = new List<Item>();
|
||||
|
||||
foreach ( Item itemremove in World.Items.Values )
|
||||
{
|
||||
if ( itemremove is PremiumSpawner && itemremove.Map == from.Map && itemremove.Parent == null )
|
||||
{
|
||||
itemtodo.Add( itemremove );
|
||||
count +=1;
|
||||
}
|
||||
}
|
||||
|
||||
GenericRemove( itemtodo, count, aTime);
|
||||
}
|
||||
|
||||
private static void GenericRemove( List<Item> colecao, int count, DateTime aTime )
|
||||
{
|
||||
if( colecao.Count == 0 )
|
||||
{
|
||||
World.Broadcast( 0x35, true, "There are no PremiumSpawners to be removed." );
|
||||
}
|
||||
else
|
||||
{
|
||||
Talk("removed");
|
||||
|
||||
foreach ( Item item in colecao )
|
||||
{
|
||||
item.Delete();
|
||||
}
|
||||
|
||||
DateTime bTime = DateTime.Now;
|
||||
World.Broadcast( 0x35, true, "{0} PremiumSpawners have been removed in {1:F1} seconds.", count, (bTime - aTime).TotalSeconds );
|
||||
}
|
||||
}
|
||||
|
||||
//[spawngen save and [spawngen save region
|
||||
private static void Save( Mobile from, string region )
|
||||
{
|
||||
DateTime aTime = DateTime.Now;
|
||||
int count = 0;
|
||||
List<Item> itemtodo = new List<Item>();
|
||||
string mapanome = region;
|
||||
|
||||
if( region == "" )
|
||||
mapanome = "Spawns";
|
||||
|
||||
foreach ( Item itemsave in World.Items.Values )
|
||||
{
|
||||
if ( itemsave is PremiumSpawner && ( region == null || region == "" ) )
|
||||
{
|
||||
itemtodo.Add( itemsave );
|
||||
count +=1;
|
||||
}
|
||||
|
||||
else if ( itemsave is PremiumSpawner && itemsave.Map == from.Map )
|
||||
{
|
||||
if ( GetRegion(itemsave) == region )
|
||||
{
|
||||
itemtodo.Add( itemsave );
|
||||
count += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GenericSave( itemtodo, mapanome, count, aTime );
|
||||
}
|
||||
|
||||
//[spawngen SaveByHand
|
||||
private static void SaveByHand()
|
||||
{
|
||||
DateTime aTime = DateTime.Now;
|
||||
int count = 0;
|
||||
List<Item> itemtodo = new List<Item>();
|
||||
string mapanome = "SpawnsByHand";
|
||||
|
||||
foreach ( Item itemsave in World.Items.Values )
|
||||
{
|
||||
if ( itemsave is PremiumSpawner && ((PremiumSpawner)itemsave).SpawnID == 99 )
|
||||
{
|
||||
itemtodo.Add( itemsave );
|
||||
count +=1;
|
||||
}
|
||||
}
|
||||
|
||||
GenericSave( itemtodo, mapanome, count, aTime );
|
||||
}
|
||||
|
||||
//[spawngen save x1 y1 x2 y2
|
||||
private static void SaveByCoord( Mobile from, int x1, int y1, int x2, int y2 )
|
||||
{
|
||||
DateTime aTime = DateTime.Now;
|
||||
int count = 0;
|
||||
List<Item> itemtodo = new List<Item>();
|
||||
string mapanome = "SpawnsByCoords";
|
||||
|
||||
foreach ( Item itemsave in World.Items.Values )
|
||||
{
|
||||
if ( itemsave is PremiumSpawner && ( ( itemsave.X >= x1 && itemsave.X <= x2 ) && ( itemsave.Y >= y1 && itemsave.Y <= y2 ) && itemsave.Map == from.Map ) )
|
||||
{
|
||||
itemtodo.Add( itemsave );
|
||||
count +=1;
|
||||
}
|
||||
}
|
||||
|
||||
GenericSave( itemtodo, mapanome, count, aTime );
|
||||
}
|
||||
|
||||
private static void GenericSave( List<Item> colecao, string mapa, int count, DateTime startTime )
|
||||
{
|
||||
List<Item> itemssave = new List<Item>( colecao );
|
||||
string mapanome = mapa;
|
||||
|
||||
if( itemssave.Count == 0 )
|
||||
{
|
||||
World.Broadcast( 0x35, true, "There are no PremiumSpawners to be saved." );
|
||||
}
|
||||
else
|
||||
{
|
||||
Talk("saved");
|
||||
|
||||
if ( !Directory.Exists( "Data/Spawns" ) )
|
||||
Directory.CreateDirectory( "Data/Spawns" );
|
||||
|
||||
string escreva = "Data/Spawns/" + mapanome + ".map";
|
||||
|
||||
using ( StreamWriter op = new StreamWriter( escreva ) )
|
||||
{
|
||||
foreach ( PremiumSpawner itemsave2 in itemssave )
|
||||
{
|
||||
int mapnumber = 0;
|
||||
switch ( itemsave2.Map.ToString() )
|
||||
{
|
||||
case "Vaelen":
|
||||
mapnumber = 1;
|
||||
break;
|
||||
case "Trammel":
|
||||
mapnumber = 2;
|
||||
break;
|
||||
case "Ilshenar":
|
||||
mapnumber = 3;
|
||||
break;
|
||||
case "Malas":
|
||||
mapnumber = 4;
|
||||
break;
|
||||
case "Tokuno":
|
||||
mapnumber = 5;
|
||||
break;
|
||||
case "TerMur":
|
||||
mapnumber = 6;
|
||||
break;
|
||||
default:
|
||||
mapnumber = 7;
|
||||
Console.WriteLine( "Monster Parser: Warning, unknown map {0}", itemsave2.Map );
|
||||
break;
|
||||
}
|
||||
|
||||
string timer1a = itemsave2.MinDelay.ToString();
|
||||
string[] timer1b = timer1a.Split( ':' ); //Broke the string hh:mm:ss in an array (hh, mm, ss)
|
||||
int timer1c = ( Utility.ToInt32( timer1b[0] ) * 60 ) + Utility.ToInt32( timer1b[1] ); //multiply hh * 60 to find mm, then add mm
|
||||
string timer1d = timer1c.ToString();
|
||||
if ( Utility.ToInt32( timer1b[0] ) == 0 && Utility.ToInt32( timer1b[1] ) == 0 ) //If hh and mm are 0, use seconds, else drop ss
|
||||
timer1d = Utility.ToInt32( timer1b[2] ) + "s";
|
||||
|
||||
string timer2a = itemsave2.MaxDelay.ToString();
|
||||
string[] timer2b = timer2a.Split( ':' );
|
||||
int timer2c = ( Utility.ToInt32( timer2b[0] ) * 60 ) + Utility.ToInt32( timer2b[1] );
|
||||
string timer2d = timer2c.ToString();
|
||||
if ( Utility.ToInt32( timer2b[0] ) == 0 && Utility.ToInt32( timer2b[1] ) == 0 )
|
||||
timer2d = Utility.ToInt32( timer2b[2] ) + "s";
|
||||
|
||||
string towrite = "";
|
||||
string towriteA = "";
|
||||
string towriteB = "";
|
||||
string towriteC = "";
|
||||
string towriteD = "";
|
||||
string towriteE = "";
|
||||
|
||||
if ( itemsave2.CreaturesName.Count > 0 )
|
||||
towrite = itemsave2.CreaturesName[0].ToString();
|
||||
|
||||
if ( itemsave2.SubSpawnerA.Count > 0 )
|
||||
towriteA = itemsave2.SubSpawnerA[0].ToString();
|
||||
|
||||
if ( itemsave2.SubSpawnerB.Count > 0 )
|
||||
towriteB = itemsave2.SubSpawnerB[0].ToString();
|
||||
|
||||
if ( itemsave2.SubSpawnerC.Count > 0 )
|
||||
towriteC = itemsave2.SubSpawnerC[0].ToString();
|
||||
|
||||
if ( itemsave2.SubSpawnerD.Count > 0 )
|
||||
towriteD = itemsave2.SubSpawnerD[0].ToString();
|
||||
|
||||
if ( itemsave2.SubSpawnerE.Count > 0 )
|
||||
towriteE = itemsave2.SubSpawnerE[0].ToString();
|
||||
|
||||
for ( int i = 1; i < itemsave2.CreaturesName.Count; ++i )
|
||||
{
|
||||
if ( itemsave2.CreaturesName.Count > 0 )
|
||||
towrite = towrite + ":" + itemsave2.CreaturesName[i].ToString();
|
||||
}
|
||||
|
||||
for ( int i = 1; i < itemsave2.SubSpawnerA.Count; ++i )
|
||||
{
|
||||
if ( itemsave2.SubSpawnerA.Count > 0 )
|
||||
towriteA = towriteA + ":" + itemsave2.SubSpawnerA[i].ToString();
|
||||
}
|
||||
|
||||
for ( int i = 1; i < itemsave2.SubSpawnerB.Count; ++i )
|
||||
{
|
||||
if ( itemsave2.SubSpawnerB.Count > 0 )
|
||||
towriteB = towriteB + ":" + itemsave2.SubSpawnerB[i].ToString();
|
||||
}
|
||||
|
||||
for ( int i = 1; i < itemsave2.SubSpawnerC.Count; ++i )
|
||||
{
|
||||
if ( itemsave2.SubSpawnerC.Count > 0 )
|
||||
towriteC = towriteC + ":" + itemsave2.SubSpawnerC[i].ToString();
|
||||
}
|
||||
|
||||
for ( int i = 1; i < itemsave2.SubSpawnerD.Count; ++i )
|
||||
{
|
||||
if ( itemsave2.SubSpawnerD.Count > 0 )
|
||||
towriteD = towriteD + ":" + itemsave2.SubSpawnerD[i].ToString();
|
||||
}
|
||||
|
||||
for ( int i = 1; i < itemsave2.SubSpawnerE.Count; ++i )
|
||||
{
|
||||
if ( itemsave2.SubSpawnerE.Count > 0 )
|
||||
towriteE = towriteE + ":" + itemsave2.SubSpawnerE[i].ToString();
|
||||
}
|
||||
|
||||
op.WriteLine( "*|{0}|{1}|{2}|{3}|{4}|{5}|{6}|{7}|{8}|{9}|{10}|{11}|{12}|{13}|{14}|{15}|{16}|{17}|{18}|{19}|{20}", towrite, towriteA, towriteB, towriteC, towriteD, towriteE, itemsave2.X, itemsave2.Y, itemsave2.Z, mapnumber, timer1d, timer2d, itemsave2.WalkingRange, itemsave2.HomeRange, itemsave2.SpawnID, itemsave2.Count, itemsave2.CountA, itemsave2.CountB, itemsave2.CountC, itemsave2.CountD, itemsave2.CountE );
|
||||
}
|
||||
}
|
||||
|
||||
DateTime endTime = DateTime.Now;
|
||||
World.Broadcast( 0x35, true, "{0} spawns have been saved. The entire process took {1:F1} seconds.", count, (endTime - startTime).TotalSeconds );
|
||||
}
|
||||
}
|
||||
|
||||
public static void Parse( Mobile from, string filename )
|
||||
{
|
||||
string monster_path1 = Path.Combine( Core.BaseDirectory, "Data/Spawns" );
|
||||
string monster_path = Path.Combine( monster_path1, filename );
|
||||
m_Count = 0;
|
||||
|
||||
if ( File.Exists( monster_path ) )
|
||||
{
|
||||
from.SendMessage( "Spawning {0}...", filename );
|
||||
m_MapOverride = -1;
|
||||
m_IDOverride = -1;
|
||||
m_MinTimeOverride = -1;
|
||||
m_MaxTimeOverride = -1;
|
||||
|
||||
using ( StreamReader ip = new StreamReader( monster_path ) )
|
||||
{
|
||||
string line;
|
||||
|
||||
while ( (line = ip.ReadLine()) != null )
|
||||
{
|
||||
string[] split = line.Split( '|' );
|
||||
string[] splitA = line.Split( ' ' );
|
||||
|
||||
if ( splitA.Length == 2 )
|
||||
{
|
||||
if ( splitA[0].ToLower() == "overridemap" )
|
||||
m_MapOverride = Utility.ToInt32( splitA[1] );
|
||||
if ( splitA[0].ToLower() == "overrideid" )
|
||||
m_IDOverride = Utility.ToInt32( splitA[1] );
|
||||
if ( splitA[0].ToLower() == "overridemintime" )
|
||||
m_MinTimeOverride = Utility.ToDouble( splitA[1] );
|
||||
if ( splitA[0].ToLower() == "overridemaxtime" )
|
||||
m_MaxTimeOverride = Utility.ToDouble( splitA[1] );
|
||||
}
|
||||
|
||||
if ( split.Length < 19 )
|
||||
continue;
|
||||
|
||||
switch( split[0].ToLower() )
|
||||
{
|
||||
//Comment Line
|
||||
case "##":
|
||||
break;
|
||||
//Place By class
|
||||
case "*":
|
||||
PlaceNPC( split[2].Split(':'), split[3].Split(':'), split[4].Split(':'), split[5].Split(':'), split[6].Split(':'), split[7], split[8], split[9], split[10], split[11], split[12], split[14], split[13], split[15], split[16], split[17], split[18], split[19], split[20], split[21], split[1].Split(':') );
|
||||
break;
|
||||
//Place By Type
|
||||
case "r":
|
||||
PlaceNPC( split[2].Split(':'), split[3].Split(':'), split[4].Split(':'), split[5].Split(':'), split[6].Split(':'), split[7], split[8], split[9], split[10], split[11], split[12], split[14], split[13], split[15], split[16], split[17], split[18], split[19], split[20], split[1], "bloodmoss", "sulfurousash", "spiderssilk", "mandrakeroot", "gravedust", "nightshade", "ginseng", "garlic", "batwing", "pigiron", "noxcrystal", "daemonblood", "blackpearl");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_MapOverride = -1;
|
||||
m_IDOverride = -1;
|
||||
m_MinTimeOverride = -1;
|
||||
m_MaxTimeOverride = -1;
|
||||
|
||||
from.SendMessage( "Done, added {0} spawners",m_Count );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage( "{0} not found!", monster_path );
|
||||
}
|
||||
}
|
||||
|
||||
public static void PlaceNPC( string[] fakespawnsA, string[] fakespawnsB, string[] fakespawnsC, string[] fakespawnsD, string[] fakespawnsE, string sx, string sy, string sz, string sm, string smintime, string smaxtime, string swalkingrange, string shomerange, string sspawnid, string snpccount, string sfakecountA, string sfakecountB, string sfakecountC, string sfakecountD, string sfakecountE, params string[] types )
|
||||
{
|
||||
if ( types.Length == 0 )
|
||||
return;
|
||||
|
||||
int x = Utility.ToInt32( sx );
|
||||
int y = Utility.ToInt32( sy );
|
||||
int z = Utility.ToInt32( sz );
|
||||
int map = Utility.ToInt32( sm );
|
||||
|
||||
//MinTime
|
||||
string samintime = smintime;
|
||||
|
||||
if ( smintime.Contains("s") || smintime.Contains("m") || smintime.Contains("h") )
|
||||
samintime = smintime.Remove(smintime.Length - 1);
|
||||
|
||||
double dmintime = Utility.ToDouble( samintime );
|
||||
|
||||
if ( m_MinTimeOverride != -1 )
|
||||
dmintime = m_MinTimeOverride;
|
||||
|
||||
TimeSpan mintime = TimeSpan.FromMinutes( dmintime );
|
||||
|
||||
if ( smintime.Contains("s") )
|
||||
mintime = TimeSpan.FromSeconds( dmintime );
|
||||
else if ( smintime.Contains("m") )
|
||||
mintime = TimeSpan.FromMinutes( dmintime );
|
||||
else if ( smintime.Contains("h") )
|
||||
mintime = TimeSpan.FromHours( dmintime );
|
||||
|
||||
//MaxTime
|
||||
|
||||
string samaxtime = smaxtime;
|
||||
|
||||
if ( smaxtime.Contains("s") || smaxtime.Contains("m") || smaxtime.Contains("h") )
|
||||
samaxtime = smaxtime.Remove(smaxtime.Length - 1);
|
||||
|
||||
double dmaxtime = Utility.ToDouble( samaxtime );
|
||||
|
||||
if ( m_MaxTimeOverride != -1 )
|
||||
{
|
||||
if ( m_MaxTimeOverride < dmintime )
|
||||
dmaxtime = dmintime;
|
||||
else
|
||||
dmaxtime = m_MaxTimeOverride;
|
||||
}
|
||||
|
||||
TimeSpan maxtime = TimeSpan.FromMinutes( dmaxtime );
|
||||
|
||||
if ( smaxtime.Contains("s") )
|
||||
maxtime = TimeSpan.FromSeconds( dmaxtime );
|
||||
else if ( smaxtime.Contains("m") )
|
||||
maxtime = TimeSpan.FromMinutes( dmaxtime );
|
||||
else if ( smaxtime.Contains("h") )
|
||||
maxtime = TimeSpan.FromHours( dmaxtime );
|
||||
|
||||
//
|
||||
int homerange = Utility.ToInt32( shomerange );
|
||||
int walkingrange = Utility.ToInt32( swalkingrange );
|
||||
int spawnid = Utility.ToInt32( sspawnid );
|
||||
int npccount = Utility.ToInt32( snpccount );
|
||||
int fakecountA = Utility.ToInt32( sfakecountA );
|
||||
int fakecountB = Utility.ToInt32( sfakecountB );
|
||||
int fakecountC = Utility.ToInt32( sfakecountC );
|
||||
int fakecountD = Utility.ToInt32( sfakecountD );
|
||||
int fakecountE = Utility.ToInt32( sfakecountE );
|
||||
|
||||
if ( m_MapOverride != -1 )
|
||||
map = m_MapOverride;
|
||||
|
||||
if ( m_IDOverride != -1 )
|
||||
spawnid = m_IDOverride;
|
||||
|
||||
switch ( map )
|
||||
{
|
||||
case 0://Trammel and Felucca
|
||||
MakeSpawner( types, fakespawnsA, fakespawnsB, fakespawnsC, fakespawnsD, fakespawnsE, x, y, z, Map.Felucca, mintime, maxtime, walkingrange, homerange, spawnid, npccount, fakecountA, fakecountB, fakecountC, fakecountD, fakecountE );
|
||||
MakeSpawner( types, fakespawnsA, fakespawnsB, fakespawnsC, fakespawnsD, fakespawnsE, x, y, z, Map.Trammel, mintime, maxtime, walkingrange, homerange, spawnid, npccount, fakecountA, fakecountB, fakecountC, fakecountD, fakecountE );
|
||||
break;
|
||||
case 1://Felucca
|
||||
MakeSpawner( types, fakespawnsA, fakespawnsB, fakespawnsC, fakespawnsD, fakespawnsE, x, y, z, Map.Felucca, mintime, maxtime, walkingrange, homerange, spawnid, npccount, fakecountA, fakecountB, fakecountC, fakecountD, fakecountE );
|
||||
break;
|
||||
case 2://Trammel
|
||||
MakeSpawner( types, fakespawnsA, fakespawnsB, fakespawnsC, fakespawnsD, fakespawnsE, x, y, z, Map.Trammel, mintime, maxtime, walkingrange, homerange, spawnid, npccount, fakecountA, fakecountB, fakecountC, fakecountD, fakecountE );
|
||||
break;
|
||||
case 3://Ilshenar
|
||||
MakeSpawner( types, fakespawnsA, fakespawnsB, fakespawnsC, fakespawnsD, fakespawnsE, x, y, z, Map.Ilshenar, mintime, maxtime, walkingrange, homerange, spawnid, npccount, fakecountA, fakecountB, fakecountC, fakecountD, fakecountE );
|
||||
break;
|
||||
case 4://Malas
|
||||
MakeSpawner( types, fakespawnsA, fakespawnsB, fakespawnsC, fakespawnsD, fakespawnsE, x, y, z, Map.Malas, mintime, maxtime, walkingrange, homerange, spawnid, npccount, fakecountA, fakecountB, fakecountC, fakecountD, fakecountE );
|
||||
break;
|
||||
case 5://Tokuno
|
||||
MakeSpawner( types, fakespawnsA, fakespawnsB, fakespawnsC, fakespawnsD, fakespawnsE, x, y, z, Map.Maps[4], mintime, maxtime, walkingrange, homerange, spawnid, npccount, fakecountA, fakecountB, fakecountC, fakecountD, fakecountE );
|
||||
break;
|
||||
case 6://TerMur
|
||||
MakeSpawner( types, fakespawnsA, fakespawnsB, fakespawnsC, fakespawnsD, fakespawnsE, x, y, z, Map.Maps[5], mintime, maxtime, walkingrange, homerange, spawnid, npccount, fakecountA, fakecountB, fakecountC, fakecountD, fakecountE );
|
||||
break;
|
||||
|
||||
default:
|
||||
Console.WriteLine( "Spawn Parser: Warning, unknown map {0}", map );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private static void MakeSpawner( string[] types, string[] fakespawnsA, string[] fakespawnsB, string[] fakespawnsC, string[] fakespawnsD, string[] fakespawnsE, int x, int y, int z, Map map, TimeSpan mintime, TimeSpan maxtime, int walkingrange, int homerange, int spawnid, int npccount, int fakecountA, int fakecountB, int fakecountC, int fakecountD, int fakecountE )
|
||||
{
|
||||
if ( types.Length == 0 )
|
||||
return;
|
||||
|
||||
List<string> tipos = new List<string>( types );
|
||||
List<string> noneA = new List<string>();
|
||||
List<string> noneB = new List<string>();
|
||||
List<string> noneC = new List<string>();
|
||||
List<string> noneD = new List<string>();
|
||||
List<string> noneE = new List<string>();
|
||||
|
||||
if ( fakespawnsA[0] != "" )
|
||||
noneA = new List<string>( fakespawnsA );
|
||||
|
||||
if ( fakespawnsB[0] != "" )
|
||||
noneB = new List<string>( fakespawnsB );
|
||||
|
||||
if ( fakespawnsC[0] != "" )
|
||||
noneC = new List<string>( fakespawnsC );
|
||||
|
||||
if ( fakespawnsD[0] != "" )
|
||||
noneD = new List<string>( fakespawnsD );
|
||||
|
||||
if ( fakespawnsE[0] != "" )
|
||||
noneE = new List<string>( fakespawnsE );
|
||||
|
||||
PremiumSpawner spawner = new PremiumSpawner( npccount, fakecountA, fakecountB, fakecountC, fakecountD, fakecountE, spawnid, mintime, maxtime, Team, walkingrange, homerange, tipos, noneA, noneB, noneC, noneD, noneE );
|
||||
|
||||
spawner.MoveToWorld( new Point3D( x, y, z ), map );
|
||||
|
||||
if ( TotalRespawn )
|
||||
{
|
||||
spawner.Respawn();
|
||||
|
||||
if ( ((PremiumSpawner)spawner).SpawnID == 132 ) // if is ChampionSpawn
|
||||
{
|
||||
spawner.BringToHome();
|
||||
}
|
||||
}
|
||||
|
||||
m_Count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
412
Scripts/Engines/Spawner/PremiumSpawner/SpawnMaps.cs
Normal file
412
Scripts/Engines/Spawner/PremiumSpawner/SpawnMaps.cs
Normal file
|
|
@ -0,0 +1,412 @@
|
|||
// Engine r133
|
||||
#define RunUo2_0
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
using Server.Commands;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class SpawnCurrentGump : Gump
|
||||
{
|
||||
Mobile caller;
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
#if(RunUo2_0)
|
||||
CommandSystem.Register("SpawnCurrent", AccessLevel.Administrator, new CommandEventHandler(SpawnCurrent_OnCommand));
|
||||
#else
|
||||
Register("SpawnCurrent", AccessLevel.Administrator, new CommandEventHandler(SpawnCurrent_OnCommand));
|
||||
#endif
|
||||
}
|
||||
|
||||
[Usage("SpawnCurrent")]
|
||||
[Description("Generate PremiumSpawners around the world with a gump.")]
|
||||
public static void SpawnCurrent_OnCommand(CommandEventArgs e)
|
||||
{
|
||||
Mobile from = e.Mobile;
|
||||
|
||||
if (from.HasGump(typeof(SpawnCurrentGump)))
|
||||
from.CloseGump(typeof(SpawnCurrentGump));
|
||||
from.SendGump(new SpawnCurrentGump(from));
|
||||
}
|
||||
|
||||
public SpawnCurrentGump(Mobile from) : this()
|
||||
{
|
||||
caller = from;
|
||||
}
|
||||
|
||||
public void AddBlackAlpha( int x, int y, int width, int height )
|
||||
{
|
||||
AddImageTiled( x, y, width, height, 2624 );
|
||||
AddAlphaRegion( x, y, width, height );
|
||||
}
|
||||
|
||||
public SpawnCurrentGump() : base( 30, 30 )
|
||||
{
|
||||
this.Closable=true;
|
||||
this.Disposable=true;
|
||||
this.Dragable=true;
|
||||
AddPage(1);
|
||||
AddBackground(58, 22, 474, 540, 9200);
|
||||
AddImage(305, 306, 1418); // Castle
|
||||
AddBlackAlpha(66, 30, 458, 33);
|
||||
AddLabel(213, 37, 52, @"SELECT MAPS TO SPAWN");
|
||||
AddBlackAlpha(66, 87, 239, 447);
|
||||
AddLabel(69, 67, 200, @"DUNGEONS");
|
||||
AddLabel(69, 90, 52, @"Blighted Grove");
|
||||
AddLabel(69, 112, 52, @"Britain Sewer");
|
||||
AddLabel(69, 133, 52, @"Covetous");
|
||||
AddLabel(69, 154, 52, @"Deceit");
|
||||
AddLabel(69, 174, 52, @"Despise");
|
||||
AddLabel(69, 196, 52, @"Destard");
|
||||
AddLabel(69, 217, 52, @"Fire");
|
||||
AddLabel(69, 237, 52, @"Graveyards");
|
||||
AddLabel(69, 258, 52, @"Hythloth");
|
||||
AddLabel(69, 280, 52, @"Ice");
|
||||
AddLabel(69, 301, 52, @"Khaldun");
|
||||
AddLabel(69, 322, 52, @"Orc Caves");
|
||||
AddLabel(69, 343, 52, @"Painted Caves");
|
||||
AddLabel(69, 363, 52, @"Palace of Paroxysmus");
|
||||
AddLabel(69, 384, 52, @"Prism of Light");
|
||||
AddLabel(69, 405, 52, @"Sanctuary");
|
||||
AddLabel(69, 427, 52, @"Shame");
|
||||
AddLabel(69, 448, 52, @"Solen Hive");
|
||||
AddLabel(69, 469, 52, @"Terathan Keep");
|
||||
AddLabel(69, 489, 52, @"Trinsic Passage");
|
||||
AddLabel(69, 510, 52, @"Wrong");
|
||||
AddLabel(194, 66, 200, @"Felucca");
|
||||
AddCheck(210, 91, 210, 211, true, 201);
|
||||
AddCheck(210, 112, 210, 211, true, 202);
|
||||
AddCheck(210, 133, 210, 211, true, 203);
|
||||
AddCheck(210, 154, 210, 211, true, 204);
|
||||
AddCheck(210, 175, 210, 211, true, 205);
|
||||
AddCheck(210, 196, 210, 211, true, 206);
|
||||
AddCheck(210, 217, 210, 211, true, 207);
|
||||
AddCheck(210, 238, 210, 211, true, 208);
|
||||
AddCheck(210, 259, 210, 211, true, 209);
|
||||
AddCheck(210, 280, 210, 211, true, 210);
|
||||
AddCheck(210, 301, 210, 211, true, 228);
|
||||
AddCheck(210, 322, 210, 211, true, 212);
|
||||
AddCheck(210, 343, 210, 211, true, 214);
|
||||
AddCheck(210, 364, 210, 211, true, 215);
|
||||
AddCheck(210, 385, 210, 211, true, 216);
|
||||
AddCheck(210, 406, 210, 211, true, 217);
|
||||
AddCheck(210, 427, 210, 211, true, 219);
|
||||
AddCheck(210, 448, 210, 211, true, 220);
|
||||
AddCheck(210, 469, 210, 211, true, 221);
|
||||
AddCheck(210, 490, 210, 211, true, 224);
|
||||
AddCheck(210, 511, 210, 211, true, 227);
|
||||
AddLabel(250, 66, 200, @"Trammel");
|
||||
AddCheck(268, 91, 210, 211, true, 101);
|
||||
AddCheck(268, 112, 210, 211, true, 102);
|
||||
AddCheck(268, 133, 210, 211, true, 103);
|
||||
AddCheck(268, 154, 210, 211, true, 104);
|
||||
AddCheck(268, 175, 210, 211, true, 105);
|
||||
AddCheck(268, 196, 210, 211, true, 106);
|
||||
AddCheck(268, 217, 210, 211, true, 107);
|
||||
AddCheck(268, 238, 210, 211, true, 108);
|
||||
AddCheck(268, 259, 210, 211, true, 109);
|
||||
AddCheck(268, 280, 210, 211, true, 110);
|
||||
//There is no Khaldun in Trammel (ID 128 reserved)
|
||||
AddCheck(268, 322, 210, 211, true, 112);
|
||||
AddCheck(268, 343, 210, 211, true, 114);
|
||||
AddCheck(268, 364, 210, 211, true, 115);
|
||||
AddCheck(268, 385, 210, 211, true, 116);
|
||||
AddCheck(268, 406, 210, 211, true, 117);
|
||||
AddCheck(268, 427, 210, 211, true, 119);
|
||||
AddCheck(268, 448, 210, 211, true, 120);
|
||||
AddCheck(268, 469, 210, 211, true, 121);
|
||||
AddCheck(268, 490, 210, 211, true, 124);
|
||||
AddCheck(268, 511, 210, 211, true, 127);
|
||||
AddBlackAlpha(311, 87, 213, 70);
|
||||
AddLabel(315, 67, 200, @"TOWNS");
|
||||
AddLabel(315, 91, 52, @"Animals");
|
||||
AddLabel(315, 112, 52, @"People (*)");
|
||||
AddLabel(315, 133, 52, @"Vendors");
|
||||
AddLabel(413, 66, 200, @"Felucca");
|
||||
AddCheck(429, 91, 210, 211, true, 222);
|
||||
AddCheck(429, 112, 210, 211, true, 223);
|
||||
AddCheck(429, 133, 210, 211, true, 225);
|
||||
AddLabel(469, 66, 200, @"Trammel");
|
||||
AddCheck(487, 91, 210, 211, true, 122);
|
||||
AddCheck(487, 112, 210, 211, true, 123);
|
||||
AddCheck(487, 133, 210, 211, true, 125);
|
||||
AddBlackAlpha(311, 183, 213, 114);
|
||||
AddLabel(315, 162, 200, @"OUTDOORS");
|
||||
AddLabel(316, 187, 52, @"Animals");
|
||||
AddLabel(316, 207, 52, @"Lost Lands");
|
||||
AddLabel(316, 229, 52, @"Spawns");
|
||||
AddLabel(316, 249, 52, @"Reagents");
|
||||
AddLabel(316, 270, 52, @"Sea Life");
|
||||
AddLabel(413, 162, 200, @"Felucca");
|
||||
AddCheck(429, 187, 210, 211, true, 226);
|
||||
AddCheck(429, 208, 210, 211, true, 211);
|
||||
AddCheck(429, 229, 210, 211, true, 213);
|
||||
AddCheck(429, 250, 210, 211, true, 229);
|
||||
AddCheck(429, 271, 210, 211, true, 218);
|
||||
AddLabel(469, 162, 200, @"Trammel");
|
||||
AddCheck(487, 187, 210, 211, true, 126);
|
||||
AddCheck(487, 208, 210, 211, true, 111);
|
||||
AddCheck(487, 229, 210, 211, true, 113);
|
||||
AddCheck(487, 250, 210, 211, true, 129);
|
||||
AddCheck(487, 271, 210, 211, true, 118);
|
||||
AddLabel(316, 305, 200, @"(*) Escortables, Hireables,");
|
||||
AddLabel(316, 324, 200, @"Town Criers, Order and Chaos");
|
||||
AddLabel(316, 344, 200, @"guards etc.");
|
||||
// END
|
||||
AddLabel(361, 453, 52, @"Page: 1/2"); //Page
|
||||
AddButton(423, 455, 5601, 5605, 0, GumpButtonType.Page, 2); // Change Page
|
||||
|
||||
//PAGE 2
|
||||
AddPage(2);
|
||||
AddBackground(58, 22, 474, 540, 9200);
|
||||
AddImage(305, 306, 1418); // Castle
|
||||
AddBlackAlpha(66, 30, 458, 33);
|
||||
AddLabel(213, 37, 52, @"SELECT MAPS TO SPAWN");
|
||||
AddBlackAlpha(66, 87, 174, 300);
|
||||
AddLabel(74, 67, 200, @"ILSHENAR");
|
||||
AddLabel(74, 90, 52, @"Ancient Lair");
|
||||
AddLabel(74, 112, 52, @"Ankh");
|
||||
AddLabel(74, 133, 52, @"Blood");
|
||||
AddLabel(74, 154, 52, @"Exodus");
|
||||
AddLabel(74, 174, 52, @"Mushroom");
|
||||
AddLabel(74, 196, 52, @"Outdoors");
|
||||
AddLabel(74, 217, 52, @"Ratman Cave");
|
||||
AddLabel(74, 237, 52, @"Rock");
|
||||
AddLabel(74, 258, 52, @"Sorcerers");
|
||||
AddLabel(74, 280, 52, @"Spectre");
|
||||
AddLabel(74, 301, 52, @"Towns");
|
||||
AddLabel(74, 322, 52, @"Twisted Weald");
|
||||
AddLabel(74, 343, 52, @"Vendors");
|
||||
AddLabel(74, 363, 52, @"Wisp");
|
||||
AddCheck(215, 91, 210, 211, true, 301);
|
||||
AddCheck(215, 112, 210, 211, true, 302);
|
||||
AddCheck(215, 133, 210, 211, true, 303);
|
||||
AddCheck(215, 154, 210, 211, true, 304);
|
||||
AddCheck(215, 175, 210, 211, true, 305);
|
||||
AddCheck(215, 196, 210, 211, true, 306);
|
||||
AddCheck(215, 217, 210, 211, true, 307);
|
||||
AddCheck(215, 238, 210, 211, true, 308);
|
||||
AddCheck(215, 259, 210, 211, true, 309);
|
||||
AddCheck(215, 280, 210, 211, true, 310);
|
||||
AddCheck(215, 301, 210, 211, true, 311);
|
||||
AddCheck(215, 322, 210, 211, true, 314);
|
||||
AddCheck(215, 343, 210, 211, true, 312);
|
||||
AddCheck(215, 364, 210, 211, true, 313);
|
||||
AddBlackAlpha(66, 414, 174, 133);
|
||||
AddLabel(74, 393, 200, @"TOKUNO");
|
||||
AddLabel(74, 416, 52, @"Fan Dancers Dojo");
|
||||
AddLabel(74, 438, 52, @"Outdoors");
|
||||
AddLabel(74, 459, 52, @"Towns Life");
|
||||
AddLabel(74, 480, 52, @"Vendors");
|
||||
AddLabel(74, 500, 52, @"Wild Life");
|
||||
AddLabel(74, 522, 52, @"Yomutso Mines");
|
||||
AddCheck(215, 417, 210, 211, true, 501);
|
||||
AddCheck(215, 438, 210, 211, true, 502);
|
||||
AddCheck(215, 459, 210, 211, true, 503);
|
||||
AddCheck(215, 480, 210, 211, true, 504);
|
||||
AddCheck(215, 501, 210, 211, true, 505);
|
||||
AddCheck(215, 522, 210, 211, true, 506);
|
||||
AddBlackAlpha(246, 87, 174, 178);
|
||||
AddLabel(253, 67, 200, @"MALAS");
|
||||
AddLabel(253, 90, 52, @"Bedlam");
|
||||
AddLabel(253, 112, 52, @"Citadel");
|
||||
AddLabel(253, 133, 52, @"Doom");
|
||||
AddLabel(253, 154, 52, @"Labyrinth");
|
||||
AddLabel(253, 174, 52, @"North (*)");
|
||||
AddLabel(253, 196, 52, @"Orc Forts");
|
||||
AddLabel(253, 217, 52, @"South (*)");
|
||||
AddLabel(253, 238, 52, @"Vendors");
|
||||
AddCheck(394, 91, 210, 211, true, 408);
|
||||
AddCheck(394, 112, 210, 211, true, 406);
|
||||
AddCheck(394, 133, 210, 211, true, 401);
|
||||
AddCheck(394, 154, 210, 211, true, 407);
|
||||
AddCheck(394, 175, 210, 211, true, 402);
|
||||
AddCheck(394, 196, 210, 211, true, 403);
|
||||
AddCheck(394, 217, 210, 211, true, 404);
|
||||
AddCheck(394, 238, 210, 211, true, 405);
|
||||
AddLabel(428, 91, 200, @"(*) Wild");
|
||||
AddLabel(428, 109, 200, @"Animals and");
|
||||
AddLabel(428, 129, 200, @"monsters.");
|
||||
AddBlackAlpha(246, 292, 174, 117);
|
||||
AddLabel(253, 272, 200, @"TER MUR");
|
||||
AddLabel(253, 295, 52, @"Abyss");
|
||||
AddLabel(253, 316, 52, @"TerMur");
|
||||
AddLabel(253, 337, 52, @"Underworld");
|
||||
AddLabel(253, 358, 52, @"Vendors");
|
||||
AddCheck(394, 296, 210, 211, true, 601);
|
||||
AddCheck(394, 317, 210, 211, true, 602);
|
||||
AddCheck(394, 338, 210, 211, true, 603);
|
||||
AddCheck(394, 359, 210, 211, true, 604);
|
||||
//END
|
||||
AddLabel(381, 453, 52, @"Page: 2/2"); //Page
|
||||
AddButton(361, 455, 5603, 5607, 0, GumpButtonType.Page, 1); //Change Page
|
||||
AddButton(282, 452, 240, 239, 1, GumpButtonType.Reply, 0); // Apply
|
||||
}
|
||||
|
||||
public static void SpawnThis( Mobile from, List<int> ListSwitches, int switche, int map, string mapfile)
|
||||
{
|
||||
string folder = "";
|
||||
|
||||
if( map == 1 )
|
||||
folder = "felucca";
|
||||
else if( map == 2)
|
||||
folder = "trammel";
|
||||
else if( map == 3)
|
||||
folder = "ilshenar";
|
||||
else if( map == 4)
|
||||
folder = "malas";
|
||||
else if( map == 5)
|
||||
folder = "tokuno";
|
||||
else if( map == 6)
|
||||
folder = "termur";
|
||||
|
||||
string prefix = Server.Commands.CommandSystem.Prefix;
|
||||
|
||||
if( ListSwitches.Contains( switche ) == true )
|
||||
CommandSystem.Handle( from, String.Format( "{0}Spawngen {1}/{2}.map", prefix, folder, mapfile ) );
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
Mobile from = sender.Mobile;
|
||||
|
||||
switch(info.ButtonID)
|
||||
{
|
||||
case 0: //Closed or Cancel
|
||||
{
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
// Make sure that the APPLY button was pressed
|
||||
if( info.ButtonID == 1 )
|
||||
{
|
||||
// Get the array of switches selected
|
||||
List<int> Selections = new List<int>( info.Switches );
|
||||
|
||||
//TRAMMEL
|
||||
from.Say( "SPAWNING TRAMMEL..." );
|
||||
// DUNGEONS
|
||||
SpawnThis(from, Selections, 101, 2, "BlightedGrove");
|
||||
SpawnThis(from, Selections, 102, 2, "BritainSewer");
|
||||
SpawnThis(from, Selections, 103, 2, "Covetous");
|
||||
SpawnThis(from, Selections, 104, 2, "Deceit");
|
||||
SpawnThis(from, Selections, 105, 2, "Despise");
|
||||
SpawnThis(from, Selections, 106, 2, "Destard");
|
||||
SpawnThis(from, Selections, 107, 2, "Fire");
|
||||
SpawnThis(from, Selections, 108, 2, "Graveyards");
|
||||
SpawnThis(from, Selections, 109, 2, "Hythloth");
|
||||
SpawnThis(from, Selections, 110, 2, "Ice");
|
||||
//There is no Khaldun (118)
|
||||
SpawnThis(from, Selections, 112, 2, "OrcCaves");
|
||||
SpawnThis(from, Selections, 114, 2, "PaintedCaves");
|
||||
SpawnThis(from, Selections, 115, 2, "PalaceOfParoxysmus");
|
||||
SpawnThis(from, Selections, 116, 2, "PrismOfLight");
|
||||
SpawnThis(from, Selections, 117, 2, "Sanctuary");
|
||||
SpawnThis(from, Selections, 119, 2, "Shame");
|
||||
SpawnThis(from, Selections, 120, 2, "SolenHive");
|
||||
SpawnThis(from, Selections, 121, 2, "TerathanKeep");
|
||||
SpawnThis(from, Selections, 124, 2, "TrinsicPassage");
|
||||
SpawnThis(from, Selections, 127, 2, "Wrong");
|
||||
//TOWNS
|
||||
SpawnThis(from, Selections, 122, 2, "TownsLife");
|
||||
SpawnThis(from, Selections, 123, 2, "TownsPeople");
|
||||
SpawnThis(from, Selections, 125, 2, "Vendors");
|
||||
//OUTDOORS
|
||||
SpawnThis(from, Selections, 126, 2, "WildLife");
|
||||
SpawnThis(from, Selections, 111, 2, "LostLands");
|
||||
SpawnThis(from, Selections, 113, 2, "Outdoors");
|
||||
SpawnThis(from, Selections, 129, 2, "Reagents");
|
||||
SpawnThis(from, Selections, 118, 2, "SeaLife");
|
||||
|
||||
//FELUCCA
|
||||
from.Say( "SPAWNING FELUCCA..." );
|
||||
// DUNGEONS
|
||||
SpawnThis(from, Selections, 201, 1, "BlightedGrove");
|
||||
SpawnThis(from, Selections, 202, 1, "BritainSewer");
|
||||
SpawnThis(from, Selections, 203, 1, "Covetous");
|
||||
SpawnThis(from, Selections, 204, 1, "Deceit");
|
||||
SpawnThis(from, Selections, 205, 1, "Despise");
|
||||
SpawnThis(from, Selections, 206, 1, "Destard");
|
||||
SpawnThis(from, Selections, 207, 1, "Fire");
|
||||
SpawnThis(from, Selections, 208, 1, "Graveyards");
|
||||
SpawnThis(from, Selections, 209, 1, "Hythloth");
|
||||
SpawnThis(from, Selections, 210, 1, "Ice");
|
||||
SpawnThis(from, Selections, 229, 1, "Khaldun");
|
||||
SpawnThis(from, Selections, 212, 1, "OrcCaves");
|
||||
SpawnThis(from, Selections, 214, 1, "PaintedCaves");
|
||||
SpawnThis(from, Selections, 215, 1, "PalaceOfParoxysmus");
|
||||
SpawnThis(from, Selections, 216, 1, "PrismOfLight");
|
||||
SpawnThis(from, Selections, 217, 1, "Sanctuary");
|
||||
SpawnThis(from, Selections, 219, 1, "Shame");
|
||||
SpawnThis(from, Selections, 220, 1, "SolenHive");
|
||||
SpawnThis(from, Selections, 221, 1, "TerathanKeep");
|
||||
SpawnThis(from, Selections, 224, 1, "TrinsicPassage");
|
||||
SpawnThis(from, Selections, 227, 1, "Wrong");
|
||||
//TOWNS
|
||||
SpawnThis(from, Selections, 222, 1, "TownsLife");
|
||||
SpawnThis(from, Selections, 223, 1, "TownsPeople");
|
||||
SpawnThis(from, Selections, 225, 1, "Vendors");
|
||||
//OUTDOORS
|
||||
SpawnThis(from, Selections, 226, 1, "WildLife");
|
||||
SpawnThis(from, Selections, 211, 1, "LostLands");
|
||||
SpawnThis(from, Selections, 213, 1, "Outdoors");
|
||||
SpawnThis(from, Selections, 229, 1, "Reagents");
|
||||
SpawnThis(from, Selections, 218, 1, "SeaLife");
|
||||
|
||||
//ILSHENAR
|
||||
from.Say( "SPAWNING ILSHENAR..." );
|
||||
SpawnThis(from, Selections, 301, 3, "Ancientlair");
|
||||
SpawnThis(from, Selections, 302, 3, "Ankh");
|
||||
SpawnThis(from, Selections, 303, 3, "Blood");
|
||||
SpawnThis(from, Selections, 304, 3, "Exodus");
|
||||
SpawnThis(from, Selections, 305, 3, "Mushroom");
|
||||
SpawnThis(from, Selections, 306, 3, "Outdoors");
|
||||
SpawnThis(from, Selections, 307, 3, "Ratmancave");
|
||||
SpawnThis(from, Selections, 308, 3, "Rock");
|
||||
SpawnThis(from, Selections, 309, 3, "Sorcerers");
|
||||
SpawnThis(from, Selections, 310, 3, "Spectre");
|
||||
SpawnThis(from, Selections, 311, 3, "Towns");
|
||||
SpawnThis(from, Selections, 314, 3, "TwistedWeald");
|
||||
SpawnThis(from, Selections, 312, 3, "Vendors");
|
||||
SpawnThis(from, Selections, 313, 3, "Wisp");
|
||||
|
||||
//MALAS
|
||||
from.Say( "SPAWNING MALAS..." );
|
||||
SpawnThis(from, Selections, 408, 4, "Bedlam");
|
||||
SpawnThis(from, Selections, 406, 4, "Citadel");
|
||||
SpawnThis(from, Selections, 401, 4, "Doom");
|
||||
SpawnThis(from, Selections, 407, 4, "Labyrinth");
|
||||
SpawnThis(from, Selections, 402, 4, "North");
|
||||
SpawnThis(from, Selections, 403, 4, "OrcForts");
|
||||
SpawnThis(from, Selections, 404, 4, "South");
|
||||
SpawnThis(from, Selections, 405, 4, "Vendors");
|
||||
|
||||
//TOKUNO
|
||||
from.Say( "SPAWNING TOKUNO..." );
|
||||
SpawnThis(from, Selections, 501, 5, "FanDancersDojo");
|
||||
SpawnThis(from, Selections, 502, 5, "Outdoors");
|
||||
SpawnThis(from, Selections, 503, 5, "TownsLife");
|
||||
SpawnThis(from, Selections, 504, 5, "Vendors");
|
||||
SpawnThis(from, Selections, 505, 5, "WildLife");
|
||||
SpawnThis(from, Selections, 506, 5, "YomutsoMines");
|
||||
|
||||
//TER MUR
|
||||
from.Say( "SPAWNING TER MUR..." );
|
||||
SpawnThis(from, Selections, 601, 6, "Abyss");
|
||||
SpawnThis(from, Selections, 602, 6, "TerMur");
|
||||
SpawnThis(from, Selections, 603, 6, "Underworld");
|
||||
SpawnThis(from, Selections, 604, 6, "Vendors");
|
||||
|
||||
from.Say( "SPAWN GENERATION COMPLETED" );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
393
Scripts/Engines/Spawner/PremiumSpawner/SpawnMapsUOML.cs
Normal file
393
Scripts/Engines/Spawner/PremiumSpawner/SpawnMapsUOML.cs
Normal file
|
|
@ -0,0 +1,393 @@
|
|||
// Engine r93
|
||||
#define RunUo2_0
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
using Server.Commands;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class SpawnUOMLGump : Gump
|
||||
{
|
||||
Mobile caller;
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
#if(RunUo2_0)
|
||||
CommandSystem.Register("SpawnUOML", AccessLevel.Administrator, new CommandEventHandler(SpawnUOML_OnCommand));
|
||||
#else
|
||||
Register("SpawnUOML", AccessLevel.Administrator, new CommandEventHandler(SpawnUOML_OnCommand));
|
||||
#endif
|
||||
}
|
||||
|
||||
[Usage("SpawnUOML")]
|
||||
[Description("Generate PremiumSpawners around the world with a gump.")]
|
||||
public static void SpawnUOML_OnCommand(CommandEventArgs e)
|
||||
{
|
||||
Mobile from = e.Mobile;
|
||||
|
||||
if (from.HasGump(typeof(SpawnUOMLGump)))
|
||||
from.CloseGump(typeof(SpawnUOMLGump));
|
||||
from.SendGump(new SpawnUOMLGump(from));
|
||||
}
|
||||
|
||||
public SpawnUOMLGump(Mobile from) : this()
|
||||
{
|
||||
caller = from;
|
||||
}
|
||||
|
||||
public void AddBlackAlpha( int x, int y, int width, int height )
|
||||
{
|
||||
AddImageTiled( x, y, width, height, 2624 );
|
||||
AddAlphaRegion( x, y, width, height );
|
||||
}
|
||||
|
||||
public SpawnUOMLGump() : base( 30, 30 )
|
||||
{
|
||||
this.Closable=true;
|
||||
this.Disposable=true;
|
||||
this.Dragable=true;
|
||||
AddPage(1);
|
||||
AddBackground(58, 22, 474, 540, 9200);
|
||||
AddImage(305, 306, 1418); // Castle
|
||||
AddBlackAlpha(66, 30, 458, 33);
|
||||
AddLabel(213, 37, 52, @"SELECT MAPS TO SPAWN");
|
||||
AddBlackAlpha(66, 87, 239, 447);
|
||||
AddLabel(69, 67, 200, @"DUNGEONS");
|
||||
AddLabel(69, 90, 52, @"Blighted Grove");
|
||||
AddLabel(69, 112, 52, @"Britain Sewer");
|
||||
AddLabel(69, 133, 52, @"Covetous");
|
||||
AddLabel(69, 154, 52, @"Deceit");
|
||||
AddLabel(69, 174, 52, @"Despise");
|
||||
AddLabel(69, 196, 52, @"Destard");
|
||||
AddLabel(69, 217, 52, @"Fire");
|
||||
AddLabel(69, 237, 52, @"Graveyards");
|
||||
AddLabel(69, 258, 52, @"Hythloth");
|
||||
AddLabel(69, 280, 52, @"Ice");
|
||||
AddLabel(69, 301, 52, @"Khaldun");
|
||||
AddLabel(69, 322, 52, @"Orc Caves");
|
||||
AddLabel(69, 343, 52, @"Painted Caves");
|
||||
AddLabel(69, 363, 52, @"Palace of Paroxysmus");
|
||||
AddLabel(69, 384, 52, @"Prism of Light");
|
||||
AddLabel(69, 405, 52, @"Sanctuary");
|
||||
AddLabel(69, 427, 52, @"Shame");
|
||||
AddLabel(69, 448, 52, @"Solen Hive");
|
||||
AddLabel(69, 469, 52, @"Terathan Keep");
|
||||
AddLabel(69, 489, 52, @"Trinsic Passage");
|
||||
AddLabel(69, 510, 52, @"Wrong");
|
||||
AddLabel(194, 66, 200, @"Felucca");
|
||||
AddCheck(210, 91, 210, 211, true, 201);
|
||||
AddCheck(210, 112, 210, 211, true, 202);
|
||||
AddCheck(210, 133, 210, 211, true, 203);
|
||||
AddCheck(210, 154, 210, 211, true, 204);
|
||||
AddCheck(210, 175, 210, 211, true, 205);
|
||||
AddCheck(210, 196, 210, 211, true, 206);
|
||||
AddCheck(210, 217, 210, 211, true, 207);
|
||||
AddCheck(210, 238, 210, 211, true, 208);
|
||||
AddCheck(210, 259, 210, 211, true, 209);
|
||||
AddCheck(210, 280, 210, 211, true, 210);
|
||||
AddCheck(210, 301, 210, 211, true, 228);
|
||||
AddCheck(210, 322, 210, 211, true, 212);
|
||||
AddCheck(210, 343, 210, 211, true, 214);
|
||||
AddCheck(210, 364, 210, 211, true, 215);
|
||||
AddCheck(210, 385, 210, 211, true, 216);
|
||||
AddCheck(210, 406, 210, 211, true, 217);
|
||||
AddCheck(210, 427, 210, 211, true, 219);
|
||||
AddCheck(210, 448, 210, 211, true, 220);
|
||||
AddCheck(210, 469, 210, 211, true, 221);
|
||||
AddCheck(210, 490, 210, 211, true, 224);
|
||||
AddCheck(210, 511, 210, 211, true, 227);
|
||||
AddLabel(250, 66, 200, @"Trammel");
|
||||
AddCheck(268, 91, 210, 211, true, 101);
|
||||
AddCheck(268, 112, 210, 211, true, 102);
|
||||
AddCheck(268, 133, 210, 211, true, 103);
|
||||
AddCheck(268, 154, 210, 211, true, 104);
|
||||
AddCheck(268, 175, 210, 211, true, 105);
|
||||
AddCheck(268, 196, 210, 211, true, 106);
|
||||
AddCheck(268, 217, 210, 211, true, 107);
|
||||
AddCheck(268, 238, 210, 211, true, 108);
|
||||
AddCheck(268, 259, 210, 211, true, 109);
|
||||
AddCheck(268, 280, 210, 211, true, 110);
|
||||
//There is no Khaldun in Trammel (ID 128 reserved)
|
||||
AddCheck(268, 322, 210, 211, true, 112);
|
||||
AddCheck(268, 343, 210, 211, true, 114);
|
||||
AddCheck(268, 364, 210, 211, true, 115);
|
||||
AddCheck(268, 385, 210, 211, true, 116);
|
||||
AddCheck(268, 406, 210, 211, true, 117);
|
||||
AddCheck(268, 427, 210, 211, true, 119);
|
||||
AddCheck(268, 448, 210, 211, true, 120);
|
||||
AddCheck(268, 469, 210, 211, true, 121);
|
||||
AddCheck(268, 490, 210, 211, true, 124);
|
||||
AddCheck(268, 511, 210, 211, true, 127);
|
||||
AddBlackAlpha(311, 87, 213, 70);
|
||||
AddLabel(315, 67, 200, @"TOWNS");
|
||||
AddLabel(315, 91, 52, @"Animals");
|
||||
AddLabel(315, 112, 52, @"People (*)");
|
||||
AddLabel(315, 133, 52, @"Vendors");
|
||||
AddLabel(413, 66, 200, @"Felucca");
|
||||
AddCheck(429, 91, 210, 211, true, 222);
|
||||
AddCheck(429, 112, 210, 211, true, 223);
|
||||
AddCheck(429, 133, 210, 211, true, 225);
|
||||
AddLabel(469, 66, 200, @"Trammel");
|
||||
AddCheck(487, 91, 210, 211, true, 122);
|
||||
AddCheck(487, 112, 210, 211, true, 123);
|
||||
AddCheck(487, 133, 210, 211, true, 125);
|
||||
AddBlackAlpha(311, 183, 213, 114);
|
||||
AddLabel(315, 162, 200, @"OUTDOORS");
|
||||
AddLabel(316, 187, 52, @"Animals");
|
||||
AddLabel(316, 207, 52, @"Lost Lands");
|
||||
AddLabel(316, 229, 52, @"Spawns");
|
||||
AddLabel(316, 249, 52, @"Reagents");
|
||||
AddLabel(316, 270, 52, @"Sea Life");
|
||||
AddLabel(413, 162, 200, @"Felucca");
|
||||
AddCheck(429, 187, 210, 211, true, 226);
|
||||
AddCheck(429, 208, 210, 211, true, 211);
|
||||
AddCheck(429, 229, 210, 211, true, 213);
|
||||
AddCheck(429, 250, 210, 211, true, 229);
|
||||
AddCheck(429, 271, 210, 211, true, 218);
|
||||
AddLabel(469, 162, 200, @"Trammel");
|
||||
AddCheck(487, 187, 210, 211, true, 126);
|
||||
AddCheck(487, 208, 210, 211, true, 111);
|
||||
AddCheck(487, 229, 210, 211, true, 113);
|
||||
AddCheck(487, 250, 210, 211, true, 129);
|
||||
AddCheck(487, 271, 210, 211, true, 118);
|
||||
AddLabel(316, 305, 200, @"(*) Escortables, Hireables,");
|
||||
AddLabel(316, 324, 200, @"Town Criers, Order and Chaos");
|
||||
AddLabel(316, 344, 200, @"guards etc.");
|
||||
// END
|
||||
AddLabel(361, 453, 52, @"Page: 1/2"); //Page
|
||||
AddButton(423, 455, 5601, 5605, 0, GumpButtonType.Page, 2); // Change Page
|
||||
|
||||
//PAGE 2
|
||||
AddPage(2);
|
||||
AddBackground(58, 22, 474, 540, 9200);
|
||||
AddImage(305, 306, 1418); // Castle
|
||||
AddBlackAlpha(66, 30, 458, 33);
|
||||
AddLabel(213, 37, 52, @"SELECT MAPS TO SPAWN");
|
||||
AddBlackAlpha(66, 87, 174, 300);
|
||||
AddLabel(74, 67, 200, @"ILSHENAR");
|
||||
AddLabel(74, 90, 52, @"Ancient Lair");
|
||||
AddLabel(74, 112, 52, @"Ankh");
|
||||
AddLabel(74, 133, 52, @"Blood");
|
||||
AddLabel(74, 154, 52, @"Exodus");
|
||||
AddLabel(74, 174, 52, @"Mushroom");
|
||||
AddLabel(74, 196, 52, @"Outdoors");
|
||||
AddLabel(74, 217, 52, @"Ratman Cave");
|
||||
AddLabel(74, 237, 52, @"Rock");
|
||||
AddLabel(74, 258, 52, @"Sorcerers");
|
||||
AddLabel(74, 280, 52, @"Spectre");
|
||||
AddLabel(74, 301, 52, @"Towns");
|
||||
AddLabel(74, 322, 52, @"Twisted Weald");
|
||||
AddLabel(74, 343, 52, @"Vendors");
|
||||
AddLabel(74, 363, 52, @"Wisp");
|
||||
AddCheck(215, 91, 210, 211, true, 301);
|
||||
AddCheck(215, 112, 210, 211, true, 302);
|
||||
AddCheck(215, 133, 210, 211, true, 303);
|
||||
AddCheck(215, 154, 210, 211, true, 304);
|
||||
AddCheck(215, 175, 210, 211, true, 305);
|
||||
AddCheck(215, 196, 210, 211, true, 306);
|
||||
AddCheck(215, 217, 210, 211, true, 307);
|
||||
AddCheck(215, 238, 210, 211, true, 308);
|
||||
AddCheck(215, 259, 210, 211, true, 309);
|
||||
AddCheck(215, 280, 210, 211, true, 310);
|
||||
AddCheck(215, 301, 210, 211, true, 311);
|
||||
AddCheck(215, 322, 210, 211, true, 314);
|
||||
AddCheck(215, 343, 210, 211, true, 312);
|
||||
AddCheck(215, 364, 210, 211, true, 313);
|
||||
AddBlackAlpha(66, 414, 174, 133);
|
||||
AddLabel(74, 393, 200, @"TOKUNO");
|
||||
AddLabel(74, 416, 52, @"Fan Dancers Dojo");
|
||||
AddLabel(74, 438, 52, @"Outdoors");
|
||||
AddLabel(74, 459, 52, @"Towns Life");
|
||||
AddLabel(74, 480, 52, @"Vendors");
|
||||
AddLabel(74, 500, 52, @"Wild Life");
|
||||
AddLabel(74, 522, 52, @"Yomutso Mines");
|
||||
AddCheck(215, 417, 210, 211, true, 501);
|
||||
AddCheck(215, 438, 210, 211, true, 502);
|
||||
AddCheck(215, 459, 210, 211, true, 503);
|
||||
AddCheck(215, 480, 210, 211, true, 504);
|
||||
AddCheck(215, 501, 210, 211, true, 505);
|
||||
AddCheck(215, 522, 210, 211, true, 506);
|
||||
AddBlackAlpha(246, 87, 174, 178);
|
||||
AddLabel(253, 67, 200, @"MALAS");
|
||||
AddLabel(253, 90, 52, @"Bedlam");
|
||||
AddLabel(253, 112, 52, @"Citadel");
|
||||
AddLabel(253, 133, 52, @"Doom");
|
||||
AddLabel(253, 154, 52, @"Labyrinth");
|
||||
AddLabel(253, 174, 52, @"North (*)");
|
||||
AddLabel(253, 196, 52, @"Orc Forts");
|
||||
AddLabel(253, 217, 52, @"South (*)");
|
||||
AddLabel(253, 238, 52, @"Vendors");
|
||||
AddCheck(394, 91, 210, 211, true, 408);
|
||||
AddCheck(394, 112, 210, 211, true, 406);
|
||||
AddCheck(394, 133, 210, 211, true, 401);
|
||||
AddCheck(394, 154, 210, 211, true, 407);
|
||||
AddCheck(394, 175, 210, 211, true, 402);
|
||||
AddCheck(394, 196, 210, 211, true, 403);
|
||||
AddCheck(394, 217, 210, 211, true, 404);
|
||||
AddCheck(394, 238, 210, 211, true, 405);
|
||||
AddLabel(428, 91, 200, @"(*) Wild");
|
||||
AddLabel(428, 109, 200, @"Animals and");
|
||||
AddLabel(428, 129, 200, @"monsters.");
|
||||
//END
|
||||
AddLabel(381, 453, 52, @"Page: 2/2"); //Page
|
||||
AddButton(361, 455, 5603, 5607, 0, GumpButtonType.Page, 1); //Change Page
|
||||
AddButton(282, 452, 240, 239, 1, GumpButtonType.Reply, 0); // Apply
|
||||
}
|
||||
|
||||
public static void SpawnThis( Mobile from, List<int> ListSwitches, int switche, int map, string mapfile)
|
||||
{
|
||||
string folder = "";
|
||||
|
||||
if( map == 1 )
|
||||
folder = "felucca";
|
||||
else if( map == 2)
|
||||
folder = "trammel";
|
||||
else if( map == 3)
|
||||
folder = "ilshenar";
|
||||
else if( map == 4)
|
||||
folder = "malas";
|
||||
else if( map == 5)
|
||||
folder = "tokuno";
|
||||
|
||||
string prefix = Server.Commands.CommandSystem.Prefix;
|
||||
|
||||
if( ListSwitches.Contains( switche ) == true )
|
||||
CommandSystem.Handle( from, String.Format( "{0}Spawngen uoml/{1}/{2}.map", prefix, folder, mapfile ) );
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
Mobile from = sender.Mobile;
|
||||
|
||||
switch(info.ButtonID)
|
||||
{
|
||||
case 0: //Closed or Cancel
|
||||
{
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
// Make sure that the APPLY button was pressed
|
||||
if( info.ButtonID == 1 )
|
||||
{
|
||||
// Get the array of switches selected
|
||||
List<int> Selections = new List<int>( info.Switches );
|
||||
|
||||
//TRAMMEL
|
||||
from.Say( "SPAWNING TRAMMEL..." );
|
||||
// DUNGEONS
|
||||
SpawnThis(from, Selections, 101, 2, "BlightedGrove");
|
||||
SpawnThis(from, Selections, 102, 2, "BritainSewer");
|
||||
SpawnThis(from, Selections, 103, 2, "Covetous");
|
||||
SpawnThis(from, Selections, 104, 2, "Deceit");
|
||||
SpawnThis(from, Selections, 105, 2, "Despise");
|
||||
SpawnThis(from, Selections, 106, 2, "Destard");
|
||||
SpawnThis(from, Selections, 107, 2, "Fire");
|
||||
SpawnThis(from, Selections, 108, 2, "Graveyards");
|
||||
SpawnThis(from, Selections, 109, 2, "Hythloth");
|
||||
SpawnThis(from, Selections, 110, 2, "Ice");
|
||||
//There is no Khaldun (118)
|
||||
SpawnThis(from, Selections, 112, 2, "OrcCaves");
|
||||
SpawnThis(from, Selections, 114, 2, "PaintedCaves");
|
||||
SpawnThis(from, Selections, 115, 2, "PalaceOfParoxysmus");
|
||||
SpawnThis(from, Selections, 116, 2, "PrismOfLight");
|
||||
SpawnThis(from, Selections, 117, 2, "Sanctuary");
|
||||
SpawnThis(from, Selections, 119, 2, "Shame");
|
||||
SpawnThis(from, Selections, 120, 2, "SolenHive");
|
||||
SpawnThis(from, Selections, 121, 2, "TerathanKeep");
|
||||
SpawnThis(from, Selections, 124, 2, "TrinsicPassage");
|
||||
SpawnThis(from, Selections, 127, 2, "Wrong");
|
||||
//TOWNS
|
||||
SpawnThis(from, Selections, 122, 2, "TownsLife");
|
||||
SpawnThis(from, Selections, 123, 2, "TownsPeople");
|
||||
SpawnThis(from, Selections, 125, 2, "Vendors");
|
||||
//OUTDOORS
|
||||
SpawnThis(from, Selections, 126, 2, "WildLife");
|
||||
SpawnThis(from, Selections, 111, 2, "LostLands");
|
||||
SpawnThis(from, Selections, 113, 2, "Outdoors");
|
||||
SpawnThis(from, Selections, 129, 2, "Reagents");
|
||||
SpawnThis(from, Selections, 118, 2, "SeaLife");
|
||||
|
||||
//FELUCCA
|
||||
from.Say( "SPAWNING FELUCCA..." );
|
||||
// DUNGEONS
|
||||
SpawnThis(from, Selections, 201, 1, "BlightedGrove");
|
||||
SpawnThis(from, Selections, 202, 1, "BritainSewer");
|
||||
SpawnThis(from, Selections, 203, 1, "Covetous");
|
||||
SpawnThis(from, Selections, 204, 1, "Deceit");
|
||||
SpawnThis(from, Selections, 205, 1, "Despise");
|
||||
SpawnThis(from, Selections, 206, 1, "Destard");
|
||||
SpawnThis(from, Selections, 207, 1, "Fire");
|
||||
SpawnThis(from, Selections, 208, 1, "Graveyards");
|
||||
SpawnThis(from, Selections, 209, 1, "Hythloth");
|
||||
SpawnThis(from, Selections, 210, 1, "Ice");
|
||||
SpawnThis(from, Selections, 229, 1, "Khaldun");
|
||||
SpawnThis(from, Selections, 212, 1, "OrcCaves");
|
||||
SpawnThis(from, Selections, 214, 1, "PaintedCaves");
|
||||
SpawnThis(from, Selections, 215, 1, "PalaceOfParoxysmus");
|
||||
SpawnThis(from, Selections, 216, 1, "PrismOfLight");
|
||||
SpawnThis(from, Selections, 217, 1, "Sanctuary");
|
||||
SpawnThis(from, Selections, 219, 1, "Shame");
|
||||
SpawnThis(from, Selections, 220, 1, "SolenHive");
|
||||
SpawnThis(from, Selections, 221, 1, "TerathanKeep");
|
||||
SpawnThis(from, Selections, 224, 1, "TrinsicPassage");
|
||||
SpawnThis(from, Selections, 227, 1, "Wrong");
|
||||
//TOWNS
|
||||
SpawnThis(from, Selections, 222, 1, "TownsLife");
|
||||
SpawnThis(from, Selections, 223, 1, "TownsPeople");
|
||||
SpawnThis(from, Selections, 225, 1, "Vendors");
|
||||
//OUTDOORS
|
||||
SpawnThis(from, Selections, 226, 1, "WildLife");
|
||||
SpawnThis(from, Selections, 211, 1, "LostLands");
|
||||
SpawnThis(from, Selections, 213, 1, "Outdoors");
|
||||
SpawnThis(from, Selections, 229, 1, "Reagents");
|
||||
SpawnThis(from, Selections, 218, 1, "SeaLife");
|
||||
|
||||
//ILSHENAR
|
||||
from.Say( "SPAWNING ILSHENAR..." );
|
||||
SpawnThis(from, Selections, 301, 3, "Ancientlair");
|
||||
SpawnThis(from, Selections, 302, 3, "Ankh");
|
||||
SpawnThis(from, Selections, 303, 3, "Blood");
|
||||
SpawnThis(from, Selections, 304, 3, "Exodus");
|
||||
SpawnThis(from, Selections, 305, 3, "Mushroom");
|
||||
SpawnThis(from, Selections, 306, 3, "Outdoors");
|
||||
SpawnThis(from, Selections, 307, 3, "Ratmancave");
|
||||
SpawnThis(from, Selections, 308, 3, "Rock");
|
||||
SpawnThis(from, Selections, 309, 3, "Sorcerers");
|
||||
SpawnThis(from, Selections, 310, 3, "Spectre");
|
||||
SpawnThis(from, Selections, 311, 3, "Towns");
|
||||
SpawnThis(from, Selections, 314, 3, "TwistedWeald");
|
||||
SpawnThis(from, Selections, 312, 3, "Vendors");
|
||||
SpawnThis(from, Selections, 313, 3, "Wisp");
|
||||
|
||||
//MALAS
|
||||
from.Say( "SPAWNING MALAS..." );
|
||||
SpawnThis(from, Selections, 408, 4, "Bedlam");
|
||||
SpawnThis(from, Selections, 406, 4, "Citadel");
|
||||
SpawnThis(from, Selections, 401, 4, "Doom");
|
||||
SpawnThis(from, Selections, 407, 4, "Labyrinth");
|
||||
SpawnThis(from, Selections, 402, 4, "North");
|
||||
SpawnThis(from, Selections, 403, 4, "OrcForts");
|
||||
SpawnThis(from, Selections, 404, 4, "South");
|
||||
SpawnThis(from, Selections, 405, 4, "Vendors");
|
||||
|
||||
//TOKUNO
|
||||
from.Say( "SPAWNING TOKUNO..." );
|
||||
SpawnThis(from, Selections, 501, 5, "FanDancersDojo");
|
||||
SpawnThis(from, Selections, 502, 5, "Outdoors");
|
||||
SpawnThis(from, Selections, 503, 5, "TownsLife");
|
||||
SpawnThis(from, Selections, 504, 5, "Vendors");
|
||||
SpawnThis(from, Selections, 505, 5, "WildLife");
|
||||
SpawnThis(from, Selections, 506, 5, "YomutsoMines");
|
||||
|
||||
from.Say( "SPAWN GENERATION COMPLETED" );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
369
Scripts/Engines/Spawner/PremiumSpawner/SpawnsOverseer.cs
Normal file
369
Scripts/Engines/Spawner/PremiumSpawner/SpawnsOverseer.cs
Normal file
|
|
@ -0,0 +1,369 @@
|
|||
/*************************
|
||||
* By Nerun *
|
||||
* Engine r103 *
|
||||
*************************
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using System.Collections.Generic;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SpawnsOverseer : Item
|
||||
{
|
||||
private int m_Range;
|
||||
private int m_InRangeDelay;
|
||||
private int m_OutRangeDelay;
|
||||
private int m_Overseeing;
|
||||
private CheckTimer m_Timer;
|
||||
private bool m_Enable;
|
||||
private bool m_Gatekeeper;
|
||||
private TimeSpan m_CurrentDelay; // players out dungeon
|
||||
private DateTime m_End;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool Enable
|
||||
{
|
||||
get { return m_Enable; }
|
||||
set
|
||||
{
|
||||
if ( value )
|
||||
Begin();
|
||||
|
||||
else
|
||||
End();
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool Gatekeeper
|
||||
{
|
||||
get { return m_Gatekeeper; }
|
||||
set { m_Gatekeeper = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Range
|
||||
{
|
||||
get { return m_Range; }
|
||||
set { m_Range = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public TimeSpan CurrentDelay
|
||||
{
|
||||
get { return m_CurrentDelay; }
|
||||
set { m_CurrentDelay = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public TimeSpan NextDelay
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( m_Enable )
|
||||
return m_End - DateTime.Now;
|
||||
else
|
||||
return TimeSpan.FromSeconds( 0 );
|
||||
}
|
||||
set
|
||||
{
|
||||
Begin();
|
||||
DoTimer( value );
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int InRangeDelay
|
||||
{
|
||||
get { return m_InRangeDelay; }
|
||||
set { m_InRangeDelay = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int OutRangeDelay
|
||||
{
|
||||
get { return m_OutRangeDelay; }
|
||||
set { m_OutRangeDelay = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Overseeing
|
||||
{
|
||||
get { return m_Overseeing; }
|
||||
set { m_Overseeing = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
public void Begin()
|
||||
{
|
||||
if ( !m_Enable )
|
||||
{
|
||||
m_Enable = true;
|
||||
DoTimer();
|
||||
}
|
||||
}
|
||||
|
||||
public void End()
|
||||
{
|
||||
if ( m_Enable )
|
||||
{
|
||||
m_Timer.Stop();
|
||||
m_Enable = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void Restart()
|
||||
{
|
||||
if ( m_Enable )
|
||||
{
|
||||
m_Timer.Stop();
|
||||
DoTimer();
|
||||
}
|
||||
}
|
||||
|
||||
public void DoTimer()
|
||||
{
|
||||
if ( !m_Enable )
|
||||
return;
|
||||
|
||||
int mSeconds = (int)m_CurrentDelay.TotalSeconds;
|
||||
|
||||
TimeSpan delay = TimeSpan.FromSeconds( mSeconds );
|
||||
DoTimer( delay );
|
||||
}
|
||||
|
||||
public void DoTimer( TimeSpan delay )
|
||||
{
|
||||
if ( !m_Enable )
|
||||
return;
|
||||
|
||||
if ( m_Timer != null )
|
||||
m_Timer.Stop();
|
||||
|
||||
m_End = DateTime.Now + delay;
|
||||
|
||||
m_Timer = new CheckTimer( this, delay );
|
||||
m_Timer.Start();
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SpawnsOverseer() : this( 20, 30, 5, 0 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SpawnsOverseer( int startrange ) : this( startrange, 30, 5, 0 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SpawnsOverseer( int startrange, int startIRD, int startORD, int startOverseeing ) : base( 0x1F1E )
|
||||
{
|
||||
InitSeer( startrange, startIRD, startORD, startOverseeing );
|
||||
}
|
||||
|
||||
private void InitSeer( int startrange, int startIRD, int startORD, int startOverseeing )
|
||||
{
|
||||
Name = "Spawns' Overseer";
|
||||
Movable = false;
|
||||
Light = LightType.Circle150;
|
||||
Weight = 1;
|
||||
Visible = false;
|
||||
Enable = true;
|
||||
Gatekeeper = false;
|
||||
Range = startrange;
|
||||
CurrentDelay = TimeSpan.FromSeconds( 5 );
|
||||
InRangeDelay = startIRD; //minutes
|
||||
OutRangeDelay = startORD; //seconds
|
||||
Overseeing = startOverseeing; //PremiumSpawners under control
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( m_Enable )
|
||||
{
|
||||
list.Add( 1060742 ); // active
|
||||
|
||||
list.Add( 1060662, "Range\t{0}", Range.ToString() );
|
||||
list.Add( 1060663, "In Range Delay\t{0} min", InRangeDelay.ToString() );
|
||||
list.Add( 1060661, "Out Range Delay\t{0} sec", OutRangeDelay.ToString() );
|
||||
list.Add( 1060658, "Overseeing\t{0} PremiumSpawners", Overseeing.ToString() );
|
||||
}
|
||||
else
|
||||
{
|
||||
list.Add( 1060743 ); // inactive
|
||||
}
|
||||
}
|
||||
|
||||
private class CheckTimer : Timer
|
||||
{
|
||||
private SpawnsOverseer m_SpawnsOverseer;
|
||||
|
||||
public CheckTimer( SpawnsOverseer Crystal, TimeSpan delay ) : base( delay, delay )
|
||||
{
|
||||
Priority = TimerPriority.OneSecond;
|
||||
|
||||
m_SpawnsOverseer = Crystal;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if ( ( m_SpawnsOverseer != null ) && ( !m_SpawnsOverseer.Deleted ) )
|
||||
{
|
||||
m_SpawnsOverseer.OnTickDoThis();
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void OnTickDoThis()
|
||||
{
|
||||
|
||||
if ( this.Gatekeeper == false) // Gatekeeper mode OFF
|
||||
{
|
||||
List<Item> ClosePremiumSpawners = new List<Item>();
|
||||
|
||||
List<Mobile> ClosePlayers = new List<Mobile>();
|
||||
|
||||
List<Mobile> MobsCleaning = new List<Mobile>();
|
||||
|
||||
List<Item> ItemsCleaning = new List<Item>();
|
||||
|
||||
foreach ( Item item in this.GetItemsInRange( Range ) )
|
||||
{
|
||||
if( item is PremiumSpawner )
|
||||
ClosePremiumSpawners.Add( item );
|
||||
}
|
||||
|
||||
if ( ClosePremiumSpawners.Count > 0 )
|
||||
{
|
||||
this.Overseeing = ClosePremiumSpawners.Count;
|
||||
|
||||
foreach ( Mobile m in this.GetMobilesInRange( Range ) )
|
||||
{
|
||||
if( m is PlayerMobile && m.AccessLevel == AccessLevel.Player || m is PlayerMobile && m.AccessLevel > AccessLevel.Player && m.Hidden == false ) // if player or GM not hidden
|
||||
ClosePlayers.Add( m );
|
||||
}
|
||||
|
||||
if ( ClosePlayers.Count > 0 ) // at least one player close
|
||||
{
|
||||
this.CurrentDelay = TimeSpan.FromMinutes( InRangeDelay ); // time to new check
|
||||
Restart();
|
||||
|
||||
foreach ( Item pspawner in ClosePremiumSpawners ) // for each PremiumSpawner close (in the List)
|
||||
{
|
||||
if ( ((PremiumSpawner)pspawner).Running == false ) // if it is inactive
|
||||
{
|
||||
((PremiumSpawner)pspawner).Running = true; // activate it!
|
||||
((PremiumSpawner)pspawner).NextSpawn = TimeSpan.FromSeconds( 1 ); // and do a total respawn of it!
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else if ( ClosePlayers.Count <= 0 ) // nobody close
|
||||
{
|
||||
this.CurrentDelay = TimeSpan.FromSeconds( OutRangeDelay ); // time to new check
|
||||
Restart();
|
||||
|
||||
foreach ( Item pspawner in ClosePremiumSpawners ) // for each PremiumSpawner close (in the List)
|
||||
{
|
||||
if ( ((PremiumSpawner)pspawner).Running == true ) // if it is active
|
||||
{
|
||||
((PremiumSpawner)pspawner).Running = false; // make inactive!
|
||||
|
||||
// NOW delete items and mobiles (not only the spawned, but all movable in range)
|
||||
|
||||
foreach ( Mobile mobdel in this.GetMobilesInRange( Range ) )
|
||||
{
|
||||
if( mobdel is BaseCreature || mobdel is TownCrier )
|
||||
MobsCleaning.Add( mobdel );
|
||||
}
|
||||
|
||||
if ( MobsCleaning.Count > 0 )
|
||||
{
|
||||
foreach ( Mobile mDel in MobsCleaning )
|
||||
mDel.Delete();
|
||||
}
|
||||
|
||||
foreach ( Item itemdel in this.GetItemsInRange( Range ) )
|
||||
{
|
||||
if( itemdel.Movable == true ) //se for um item móvel (não decoração)
|
||||
ItemsCleaning.Add( itemdel );
|
||||
}
|
||||
|
||||
if ( ItemsCleaning.Count > 0 )
|
||||
{
|
||||
foreach ( Item iDel in ItemsCleaning )
|
||||
iDel.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else if ( ClosePremiumSpawners.Count <= 0 ) // if SpawnsOverseer has no PremiumSpawner to seer, deactivate it
|
||||
{
|
||||
this.Enable = false;
|
||||
this.CurrentDelay = TimeSpan.FromSeconds( OutRangeDelay );
|
||||
this.Overseeing = ClosePremiumSpawners.Count;
|
||||
}
|
||||
}
|
||||
|
||||
else // Gatekeeper mode ON
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public SpawnsOverseer( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 );
|
||||
|
||||
writer.Write( m_Range );
|
||||
writer.Write( m_InRangeDelay );
|
||||
writer.Write( m_OutRangeDelay );
|
||||
writer.Write( m_Overseeing );
|
||||
writer.Write( m_Gatekeeper );
|
||||
writer.Write( m_Enable );
|
||||
if ( m_Enable )
|
||||
writer.WriteDeltaTime( m_End );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_Range = reader.ReadInt();
|
||||
m_InRangeDelay = reader.ReadInt();
|
||||
m_OutRangeDelay = reader.ReadInt();
|
||||
m_Overseeing = reader.ReadInt();
|
||||
m_Gatekeeper = reader.ReadBool();
|
||||
m_Enable = reader.ReadBool();
|
||||
TimeSpan ts = TimeSpan.Zero;
|
||||
if ( m_Enable )
|
||||
ts = reader.ReadDeltaTime() - DateTime.Now;
|
||||
DoTimer( ts );
|
||||
}
|
||||
}
|
||||
}
|
||||
459
Scripts/Engines/Spawner/PremiumSpawner/SpawnsOverseerCommand.cs
Normal file
459
Scripts/Engines/Spawner/PremiumSpawner/SpawnsOverseerCommand.cs
Normal file
|
|
@ -0,0 +1,459 @@
|
|||
// Engine r117
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Commands
|
||||
{
|
||||
public class GenOverseer
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
CommandSystem.Register( "GenSeers", AccessLevel.Administrator, new CommandEventHandler( GenOverseer_OnCommand ) );
|
||||
CommandSystem.Register( "GenOverseers", AccessLevel.Administrator, new CommandEventHandler( GenOverseer_OnCommand ) );
|
||||
CommandSystem.Register( "GenSeer", AccessLevel.Administrator, new CommandEventHandler( GenOverseer_OnCommand ) );
|
||||
CommandSystem.Register( "GenOverseer", AccessLevel.Administrator, new CommandEventHandler( GenOverseer_OnCommand ) );
|
||||
}
|
||||
|
||||
[Usage( "GenSeers" )]
|
||||
[Aliases( "GenSeer, GenOverseer and GenOverseers" )]
|
||||
[Description( "Generates Spawns' Overseers around the world." )]
|
||||
private static void GenOverseer_OnCommand( CommandEventArgs e )
|
||||
{
|
||||
m_Mobile = e.Mobile;
|
||||
m_Count = 0;
|
||||
|
||||
m_Mobile.SendMessage( "Generating Spawns' Overseers, please wait." );
|
||||
|
||||
Generate( "Data/Nerun's Distro/Spawns/overseers/trammel", Map.Trammel );
|
||||
Generate( "Data/Nerun's Distro/Spawns/overseers/felucca", Map.Felucca );
|
||||
Generate( "Data/Nerun's Distro/Spawns/overseers/ilshenar", Map.Ilshenar );
|
||||
Generate( "Data/Nerun's Distro/Spawns/overseers/malas", Map.Malas );
|
||||
Generate( "Data/Nerun's Distro/Spawns/overseers/tokuno", Map.Tokuno );
|
||||
Generate( "Data/Nerun's Distro/Spawns/overseers/termur", Map.TerMur );
|
||||
|
||||
m_Mobile.SendMessage( "Spawns' Overseers generation complete. {0} seers were generated.", m_Count );
|
||||
}
|
||||
|
||||
public static void Generate( string folder, params Map[] maps )
|
||||
{
|
||||
if ( !Directory.Exists( folder ) )
|
||||
return;
|
||||
|
||||
string[] files = Directory.GetFiles( folder, "*.cfg" );
|
||||
|
||||
for ( int i = 0; i < files.Length; ++i )
|
||||
{
|
||||
ArrayList list = DecorationListSeers.ReadAll( files[i] );
|
||||
|
||||
for ( int j = 0; j < list.Count; ++j )
|
||||
m_Count += ((DecorationListSeers)list[j]).Generate( maps );
|
||||
}
|
||||
}
|
||||
|
||||
private static Mobile m_Mobile;
|
||||
private static int m_Count;
|
||||
}
|
||||
|
||||
public class DecorationListSeers
|
||||
{
|
||||
private Type m_Type;
|
||||
private int m_ItemID;
|
||||
private string[] m_Params;
|
||||
private ArrayList m_Entries;
|
||||
|
||||
public DecorationListSeers()
|
||||
{
|
||||
}
|
||||
|
||||
private static Type typeofStatic = typeof( Static );
|
||||
private static Type typeofLocalizedStatic = typeof( LocalizedStatic );
|
||||
|
||||
public Item Construct()
|
||||
{
|
||||
Item item;
|
||||
|
||||
try
|
||||
{
|
||||
if ( m_Type == typeofStatic )
|
||||
{
|
||||
item = new Static( m_ItemID );
|
||||
}
|
||||
else if ( m_Type == typeofLocalizedStatic )
|
||||
{
|
||||
int labelNumber = 0;
|
||||
|
||||
for ( int i = 0; i < m_Params.Length; ++i )
|
||||
{
|
||||
if ( m_Params[i].StartsWith( "LabelNumber" ) )
|
||||
{
|
||||
int indexOf = m_Params[i].IndexOf( '=' );
|
||||
|
||||
if ( indexOf >= 0 )
|
||||
{
|
||||
labelNumber = Utility.ToInt32( m_Params[i].Substring( ++indexOf ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
item = new LocalizedStatic( m_ItemID, labelNumber );
|
||||
}
|
||||
else
|
||||
{
|
||||
item = (Item)Activator.CreateInstance( m_Type );
|
||||
}
|
||||
}
|
||||
catch ( Exception e )
|
||||
{
|
||||
throw new Exception( String.Format( "Bad type: {0}", m_Type ), e );
|
||||
}
|
||||
|
||||
if ( item is Server.Items.SpawnsOverseer )
|
||||
{
|
||||
Server.Items.SpawnsOverseer sp = (Server.Items.SpawnsOverseer)item;
|
||||
|
||||
for ( int i = 0; i < m_Params.Length; ++i )
|
||||
{
|
||||
if ( m_Params[i].StartsWith( "Range" ) )
|
||||
{
|
||||
int indexOf = m_Params[i].IndexOf( '=' );
|
||||
|
||||
if ( indexOf >= 0 )
|
||||
sp.Range = Utility.ToInt32( m_Params[i].Substring( ++indexOf ) );
|
||||
}
|
||||
else if ( m_Params[i].StartsWith( "InRangeDelay" ) )
|
||||
{
|
||||
int indexOf = m_Params[i].IndexOf( '=' );
|
||||
|
||||
if ( indexOf >= 0 )
|
||||
sp.InRangeDelay = Utility.ToInt32( m_Params[i].Substring( ++indexOf ) );
|
||||
}
|
||||
else if ( m_Params[i].StartsWith( "OutRangeDelay" ) )
|
||||
{
|
||||
int indexOf = m_Params[i].IndexOf( '=' );
|
||||
|
||||
if ( indexOf >= 0 )
|
||||
sp.OutRangeDelay = Utility.ToInt32( m_Params[i].Substring( ++indexOf ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
item.Movable = false;
|
||||
|
||||
for ( int i = 0; i < m_Params.Length; ++i )
|
||||
{
|
||||
if ( m_Params[i].StartsWith( "Light" ) )
|
||||
{
|
||||
int indexOf = m_Params[i].IndexOf( '=' );
|
||||
|
||||
if ( indexOf >= 0 )
|
||||
item.Light = (LightType)Enum.Parse( typeof( LightType ), m_Params[i].Substring( ++indexOf ), true );
|
||||
}
|
||||
else if ( m_Params[i].StartsWith( "Hue" ) )
|
||||
{
|
||||
int indexOf = m_Params[i].IndexOf( '=' );
|
||||
|
||||
if ( indexOf >= 0 )
|
||||
{
|
||||
int hue = Utility.ToInt32( m_Params[i].Substring( ++indexOf ) );
|
||||
|
||||
if ( item is DyeTub )
|
||||
((DyeTub)item).DyedHue = hue;
|
||||
else
|
||||
item.Hue = hue;
|
||||
}
|
||||
}
|
||||
else if ( m_Params[i].StartsWith( "Name" ) )
|
||||
{
|
||||
int indexOf = m_Params[i].IndexOf( '=' );
|
||||
|
||||
if ( indexOf >= 0 )
|
||||
item.Name = m_Params[i].Substring( ++indexOf );
|
||||
}
|
||||
else if ( m_Params[i].StartsWith( "Amount" ) )
|
||||
{
|
||||
int indexOf = m_Params[i].IndexOf( '=' );
|
||||
|
||||
if ( indexOf >= 0 )
|
||||
{
|
||||
// Must supress stackable warnings
|
||||
|
||||
bool wasStackable = item.Stackable;
|
||||
|
||||
item.Stackable = true;
|
||||
item.Amount = Utility.ToInt32( m_Params[i].Substring( ++indexOf ) );
|
||||
item.Stackable = wasStackable;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
private static Queue m_DeleteQueue = new Queue();
|
||||
|
||||
private static bool FindItem( int x, int y, int z, Map map, Item srcItem )
|
||||
{
|
||||
int itemID = srcItem.ItemID;
|
||||
|
||||
bool res = false;
|
||||
|
||||
IPooledEnumerable eable;
|
||||
|
||||
if ( (TileData.ItemTable[itemID & TileData.MaxItemValue].Flags & TileFlag.LightSource) != 0 )
|
||||
{
|
||||
eable = map.GetItemsInRange( new Point3D( x, y, z ), 0 );
|
||||
|
||||
LightType lt = srcItem.Light;
|
||||
string srcName = srcItem.ItemData.Name;
|
||||
|
||||
foreach ( Item item in eable )
|
||||
{
|
||||
if ( item.Z == z )
|
||||
{
|
||||
if ( item.ItemID == itemID )
|
||||
{
|
||||
if ( item.Light != lt )
|
||||
m_DeleteQueue.Enqueue( item );
|
||||
else
|
||||
res = true;
|
||||
}
|
||||
else if ( (item.ItemData.Flags & TileFlag.LightSource) != 0 && item.ItemData.Name == srcName )
|
||||
{
|
||||
m_DeleteQueue.Enqueue( item );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
eable = map.GetItemsInRange( new Point3D( x, y, z ), 0 );
|
||||
|
||||
foreach ( Item item in eable )
|
||||
{
|
||||
if ( item.Z == z && item.ItemID == itemID )
|
||||
{
|
||||
eable.Free();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
|
||||
while ( m_DeleteQueue.Count > 0 )
|
||||
((Item)m_DeleteQueue.Dequeue()).Delete();
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
public int Generate( Map[] maps )
|
||||
{
|
||||
int count = 0;
|
||||
|
||||
Item item = null;
|
||||
|
||||
for ( int i = 0; i < m_Entries.Count; ++i )
|
||||
{
|
||||
DecorationEntrySeers entry = (DecorationEntrySeers)m_Entries[i];
|
||||
Point3D loc = entry.Location;
|
||||
string extra = entry.Extra;
|
||||
|
||||
for ( int j = 0; j < maps.Length; ++j )
|
||||
{
|
||||
if ( item == null )
|
||||
item = Construct();
|
||||
|
||||
if ( item == null )
|
||||
continue;
|
||||
|
||||
if ( FindItem( loc.X, loc.Y, loc.Z, maps[j], item ) )
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
item.MoveToWorld( loc, maps[j] );
|
||||
++count;
|
||||
|
||||
item = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( item != null )
|
||||
item.Delete();
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
public static ArrayList ReadAll( string path )
|
||||
{
|
||||
using ( StreamReader ip = new StreamReader( path ) )
|
||||
{
|
||||
ArrayList list = new ArrayList();
|
||||
|
||||
for ( DecorationListSeers v = Read( ip ); v != null; v = Read( ip ) )
|
||||
list.Add( v );
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
private static string[] m_EmptyParams = new string[0];
|
||||
|
||||
public static DecorationListSeers Read( StreamReader ip )
|
||||
{
|
||||
string line;
|
||||
|
||||
while ( (line = ip.ReadLine()) != null )
|
||||
{
|
||||
line = line.Trim();
|
||||
|
||||
if ( line.Length > 0 && !line.StartsWith( "#" ) )
|
||||
break;
|
||||
}
|
||||
|
||||
if ( string.IsNullOrEmpty( line ) )
|
||||
return null;
|
||||
|
||||
DecorationListSeers list = new DecorationListSeers();
|
||||
|
||||
int indexOf = line.IndexOf( ' ' );
|
||||
|
||||
list.m_Type = ScriptCompiler.FindTypeByName( line.Substring( 0, indexOf++ ), true );
|
||||
|
||||
if ( list.m_Type == null )
|
||||
throw new ArgumentException( String.Format( "Type not found for header: '{0}'", line ) );
|
||||
|
||||
line = line.Substring( indexOf );
|
||||
indexOf = line.IndexOf( '(' );
|
||||
if ( indexOf >= 0 )
|
||||
{
|
||||
list.m_ItemID = Utility.ToInt32( line.Substring( 0, indexOf - 1 ) );
|
||||
|
||||
string parms = line.Substring( ++indexOf );
|
||||
|
||||
if ( line.EndsWith( ")" ) )
|
||||
parms = parms.Substring( 0, parms.Length - 1 );
|
||||
|
||||
list.m_Params = parms.Split( ';' );
|
||||
|
||||
for ( int i = 0; i < list.m_Params.Length; ++i )
|
||||
list.m_Params[i] = list.m_Params[i].Trim();
|
||||
}
|
||||
else
|
||||
{
|
||||
list.m_ItemID = Utility.ToInt32( line );
|
||||
list.m_Params = m_EmptyParams;
|
||||
}
|
||||
|
||||
list.m_Entries = new ArrayList();
|
||||
|
||||
while ( (line = ip.ReadLine()) != null )
|
||||
{
|
||||
line = line.Trim();
|
||||
|
||||
if ( line.Length == 0 )
|
||||
break;
|
||||
|
||||
if ( line.StartsWith( "#" ) )
|
||||
continue;
|
||||
|
||||
list.m_Entries.Add( new DecorationEntrySeers( line ) );
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
public class DecorationEntrySeers
|
||||
{
|
||||
private Point3D m_Location;
|
||||
private string m_Extra;
|
||||
|
||||
public Point3D Location{ get{ return m_Location; } }
|
||||
public string Extra{ get{ return m_Extra; } }
|
||||
|
||||
public DecorationEntrySeers( string line )
|
||||
{
|
||||
string x, y, z;
|
||||
|
||||
Pop( out x, ref line );
|
||||
Pop( out y, ref line );
|
||||
Pop( out z, ref line );
|
||||
|
||||
m_Location = new Point3D( Utility.ToInt32( x ), Utility.ToInt32( y ), Utility.ToInt32( z ) );
|
||||
m_Extra = line;
|
||||
}
|
||||
|
||||
public void Pop( out string v, ref string line )
|
||||
{
|
||||
int space = line.IndexOf( ' ' );
|
||||
|
||||
if ( space >= 0 )
|
||||
{
|
||||
v = line.Substring( 0, space++ );
|
||||
line = line.Substring( space );
|
||||
}
|
||||
else
|
||||
{
|
||||
v = line;
|
||||
line = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class RemOverseer
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
CommandSystem.Register( "RemOverseers", AccessLevel.Administrator, new CommandEventHandler( RemOverseers_OnCommand ) );
|
||||
CommandSystem.Register( "RemSeers", AccessLevel.Administrator, new CommandEventHandler( RemOverseers_OnCommand ) );
|
||||
CommandSystem.Register( "RemOverseer", AccessLevel.Administrator, new CommandEventHandler( RemOverseers_OnCommand ) );
|
||||
CommandSystem.Register( "RemSeer", AccessLevel.Administrator, new CommandEventHandler( RemOverseers_OnCommand ) );
|
||||
}
|
||||
|
||||
[Usage( "RemSeers" )]
|
||||
[Aliases( "RemSeer, RemOverseer, RemOverseers" )]
|
||||
[Description( "Remove all Overseers in all facets." )]
|
||||
public static void RemOverseers_OnCommand( CommandEventArgs e )
|
||||
{
|
||||
Mobile from = e.Mobile;
|
||||
World.Broadcast( 0x35, true, "Overseers are being removed, please wait." );
|
||||
DateTime startTime = DateTime.Now;
|
||||
int count = 0;
|
||||
List<Item> itemsremove = new List<Item>();
|
||||
|
||||
foreach ( Item itemremove in World.Items.Values )
|
||||
{
|
||||
if ( itemremove is SpawnsOverseer && itemremove.Parent == null )
|
||||
{
|
||||
itemsremove.Add( itemremove );
|
||||
count +=1;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ( Item itemremove2 in itemsremove )
|
||||
{
|
||||
itemremove2.Delete();
|
||||
}
|
||||
|
||||
foreach ( Item premiums in World.Items.Values )
|
||||
{
|
||||
if ( premiums is PremiumSpawner && premiums.Parent == null && ((PremiumSpawner)premiums).Running == false )
|
||||
{
|
||||
((PremiumSpawner)premiums).Running = true;
|
||||
((PremiumSpawner)premiums).NextSpawn = TimeSpan.FromSeconds( 1 );
|
||||
}
|
||||
}
|
||||
|
||||
DateTime endTime = DateTime.Now;
|
||||
World.Broadcast( 0x35, true, "{0} Overseers has been removed in {1:F1} seconds.", count, (endTime - startTime).TotalSeconds );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -370,7 +370,7 @@ namespace Server.Gumps
|
|||
AddButtonLabeled( 20, 175, GetButtonID( 3, 101 ), "Teleporters" );
|
||||
AddButtonLabeled( 220, 175, GetButtonID( 3, 102 ), "Moongates" );
|
||||
|
||||
AddButtonLabeled( 20, 200, GetButtonID( 3, 103 ), "Vendors" );
|
||||
AddButtonLabeled( 20, 200, GetButtonID( 3, 103 ), "--Empty--" );
|
||||
AddButtonLabeled( 220, 200, GetButtonID( 3, 106 ), "Decoration" );
|
||||
|
||||
AddButtonLabeled( 20, 225, GetButtonID( 3, 104 ), "Doors" );
|
||||
|
|
@ -1763,7 +1763,7 @@ namespace Server.Gumps
|
|||
case 100: InvokeCommand( "DocGen" ); notice = "Documentation has been generated."; break;
|
||||
case 101: InvokeCommand( "TelGen" ); notice = "Teleporters have been generated."; break;
|
||||
case 102: InvokeCommand( "MoonGen" ); notice = "Moongates have been generated."; break;
|
||||
case 103: InvokeCommand( "UOAMVendors" ); notice = "Vendor spawners have been generated."; break;
|
||||
case 103: InvokeCommand( "" ); notice = "--Empty--."; break;
|
||||
case 104: InvokeCommand( "DoorGen" ); notice = "Doors have been generated."; break;
|
||||
case 105: InvokeCommand( "SignGen" ); notice = "Signs have been generated."; break;
|
||||
case 106: InvokeCommand( "Decorate" ); notice = "Decoration has been generated."; break;
|
||||
|
|
@ -3048,4 +3048,4 @@ namespace Server.Gumps
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,353 +0,0 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using Server.Commands;
|
||||
|
||||
// Version 0.8
|
||||
|
||||
namespace Server
|
||||
{
|
||||
public class UOAMVendorGenerator
|
||||
{
|
||||
private static int m_Count;
|
||||
|
||||
//configuration
|
||||
private const int NPCCount = 2;//2 npcs per type (so a mage spawner will spawn 2 npcs, a alchemist and herbalist spawner will spawn 4 npcs total)
|
||||
private const int HomeRange = 5;//How far should they wander?
|
||||
private const bool TotalRespawn = true;//Should we spawn them up right away?
|
||||
private static TimeSpan MinTime = TimeSpan.FromMinutes( 2.5 );//min spawn time
|
||||
private static TimeSpan MaxTime = TimeSpan.FromMinutes( 10.0 );//max spawn time
|
||||
private const int Team = 0;//"team" the npcs are on
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
CommandSystem.Register( "UOAMVendors", AccessLevel.Administrator, new CommandEventHandler( Generate_OnCommand ) );
|
||||
}
|
||||
|
||||
[Usage( "UOAMVendors" )]
|
||||
[Description( "Generates vendor spawners from Data/Common.MAP (taken from UOAutoMap)" )]
|
||||
private static void Generate_OnCommand( CommandEventArgs e )
|
||||
{
|
||||
Parse( e.Mobile );
|
||||
}
|
||||
|
||||
public static void Parse( Mobile from )
|
||||
{
|
||||
string vendor_path = Path.Combine( Core.BaseDirectory, "Data/Common.map" );
|
||||
m_Count = 0;
|
||||
|
||||
if ( File.Exists( vendor_path ) )
|
||||
{
|
||||
ArrayList list = new ArrayList();
|
||||
from.SendMessage( "Generating Vendors..." );
|
||||
|
||||
using ( StreamReader ip = new StreamReader( vendor_path ) )
|
||||
{
|
||||
string line;
|
||||
|
||||
while ( (line = ip.ReadLine()) != null )
|
||||
{
|
||||
int indexOf = line.IndexOf( ':' );
|
||||
|
||||
if ( indexOf == -1 )
|
||||
continue;
|
||||
|
||||
string type = line.Substring( 0, ++indexOf ).Trim();
|
||||
string sub = line.Substring( indexOf ).Trim();
|
||||
|
||||
string[] split = sub.Split( ' ' );
|
||||
|
||||
if ( split.Length < 3 )
|
||||
continue;
|
||||
|
||||
split = new string[]{ type, split[0], split[1], split[2] };
|
||||
|
||||
switch(split[0].ToLower())
|
||||
{
|
||||
case "-healer:":
|
||||
PlaceNPC( split[1], split[2], split[3], "Healer", "HealerGuildmaster" );
|
||||
break;
|
||||
case "-baker:":
|
||||
PlaceNPC( split[1], split[2], split[3], "Baker" );
|
||||
break;
|
||||
case "-vet:":
|
||||
PlaceNPC( split[1], split[2], split[3], "Veterinarian" );
|
||||
break;
|
||||
case "-gypsymaiden:":
|
||||
PlaceNPC( split[1], split[2], split[3], "GypsyMaiden" );
|
||||
break;
|
||||
case "-gypsybank:":
|
||||
PlaceNPC( split[1], split[2], split[3], "GypsyBanker" );
|
||||
break;
|
||||
case "-bank:":
|
||||
PlaceNPC( split[1], split[2], split[3], "Banker", "Minter" );
|
||||
break;
|
||||
case "-inn:":
|
||||
PlaceNPC( split[1], split[2], split[3], "Innkeeper" );
|
||||
break;
|
||||
case "-provisioner:":
|
||||
PlaceNPC( split[1], split[2], split[3], "Provisioner", "Cobbler" );
|
||||
break;
|
||||
case "-tailor:":
|
||||
PlaceNPC( split[1], split[2], split[3], "Tailor", "Weaver", "TailorGuildmaster" );
|
||||
break;
|
||||
case "-tavern:":
|
||||
PlaceNPC( split[1], split[2], split[3], "Tavernkeeper", "Waiter", "Cook", "Barkeeper" );
|
||||
break;
|
||||
case "-reagents:":
|
||||
PlaceNPC( split[1], split[2], split[3], "Herbalist", "Alchemist", "CustomHairstylist" );
|
||||
break;
|
||||
case "-fortuneteller:":
|
||||
PlaceNPC( split[1], split[2], split[3], "FortuneTeller" );
|
||||
break;
|
||||
case "-holymage:":
|
||||
PlaceNPC( split[1], split[2], split[3], "HolyMage" );
|
||||
break;
|
||||
case "-chivalrykeeper:":
|
||||
PlaceNPC( split[1], split[2], split[3], "KeeperOfChivalry" );
|
||||
break;
|
||||
case "-mage:":
|
||||
PlaceNPC( split[1], split[2], split[3], "Mage", "Alchemist", "MageGuildmaster" );
|
||||
break;
|
||||
case "-arms:":
|
||||
PlaceNPC( split[1], split[2], split[3], "Armorer", "Weaponsmith" );
|
||||
break;
|
||||
case "-tinker:":
|
||||
PlaceNPC( split[1], split[2], split[3], "Tinker", "TinkerGuildmaster" );
|
||||
break;
|
||||
case "-gypsystable:":
|
||||
PlaceNPC( split[1], split[2], split[3], "GypsyAnimalTrainer" );
|
||||
break;
|
||||
case "-stable:":
|
||||
PlaceNPC( split[1], split[2], split[3], "AnimalTrainer" );
|
||||
break;
|
||||
case "-blacksmith:":
|
||||
PlaceNPC( split[1], split[2], split[3], "Blacksmith", "BlacksmithGuildmaster" );
|
||||
break;
|
||||
case "-bowyer:":
|
||||
case "-fletcher:":
|
||||
PlaceNPC( split[1], split[2], split[3], "Bowyer" );
|
||||
break;
|
||||
case "-carpenter:":
|
||||
PlaceNPC( split[1], split[2], split[3], "Carpenter", "Architect", "RealEstateBroker" );
|
||||
break;
|
||||
case "-butcher:":
|
||||
PlaceNPC( split[1], split[2], split[3], "Butcher" );
|
||||
break;
|
||||
case "-jeweler:":
|
||||
PlaceNPC( split[1], split[2], split[3], "Jeweler" );
|
||||
break;
|
||||
case "-tanner:":
|
||||
PlaceNPC( split[1], split[2], split[3], "Tanner", "Furtrader" );
|
||||
break;
|
||||
case "-bard:":
|
||||
PlaceNPC( split[1], split[2], split[3], "Bard", "BardGuildmaster" );
|
||||
break;
|
||||
case "-market:":
|
||||
PlaceNPC( split[1], split[2], split[3], "Butcher", "Farmer" );
|
||||
break;
|
||||
case "-library:":
|
||||
PlaceNPC( split[1], split[2], split[3], "Scribe" );
|
||||
break;
|
||||
case "-shipwright:":
|
||||
PlaceNPC( split[1], split[2], split[3], "Shipwright", "Mapmaker" );
|
||||
break;
|
||||
case "-docks:":
|
||||
PlaceNPC( split[1], split[2], split[3], "Fisherman" );
|
||||
break;
|
||||
|
||||
case "-beekeeper:":
|
||||
PlaceNPC( split[1], split[2], split[3], "Beekeeper" );
|
||||
break;
|
||||
|
||||
|
||||
// Guilds & Misc
|
||||
case "-tinkers guild:":
|
||||
PlaceNPC( split[1], split[2], split[3], "TinkerGuildmaster" );
|
||||
break;
|
||||
case "-blacksmiths guild:":
|
||||
PlaceNPC( split[1], split[2], split[3], "BlacksmithGuildmaster" );
|
||||
break;
|
||||
case "-sorcerors guild:":
|
||||
PlaceNPC( split[1], split[2], split[3], "MageGuildmaster" );
|
||||
break;
|
||||
case "-customs:": break;
|
||||
case "-painter:": break;
|
||||
case "-theater:": break;
|
||||
case "-warriors guild:":
|
||||
PlaceNPC( split[1], split[2], split[3], "WarriorGuildmaster" );
|
||||
break;
|
||||
case "-archers guild:":
|
||||
PlaceNPC( split[1], split[2], split[3], "RangerGuildmaster" );
|
||||
break;
|
||||
case "-thieves guild:":
|
||||
PlaceNPC( split[1], split[2], split[3], "ThiefGuildmaster" );
|
||||
break;
|
||||
case "-miners guild:":
|
||||
PlaceNPC( split[1], split[2], split[3], "MinerGuildmaster" );
|
||||
break;
|
||||
case "-fishermans guild:":
|
||||
PlaceNPC( split[1], split[2], split[3], "FisherGuildmaster" );
|
||||
break;
|
||||
case "-merchants guild:":
|
||||
PlaceNPC( split[1], split[2], split[3], "MerchantGuildmaster" );
|
||||
break;
|
||||
case "-illusionists guild:": break;
|
||||
case "-armourers guild:": break;
|
||||
case "-sorcerers guild:": break;
|
||||
case "-mages guild:":
|
||||
PlaceNPC( split[1], split[2], split[3], "MageGuildmaster" );
|
||||
break;
|
||||
case "-weapons guild:": break;
|
||||
case "-bardic guild:":
|
||||
PlaceNPC( split[1], split[2], split[3], "BardGuildmaster" );
|
||||
break;
|
||||
case "-rogues guild:":
|
||||
break;
|
||||
|
||||
// Skip
|
||||
case "+landmark:":
|
||||
case "-point of interest:":
|
||||
case "+shrine:":
|
||||
case "+moongate:":
|
||||
case "+dungeon:":
|
||||
case "+scenic:":
|
||||
case "-gate:":
|
||||
case "+Body of Water:":
|
||||
case "+ruins:":
|
||||
case "+teleporter:":
|
||||
case "+Terrain:":
|
||||
case "-exit:":
|
||||
case "-bridge:":
|
||||
case "-other:":
|
||||
case "+champion:":
|
||||
case "-stairs:":
|
||||
case "-guild:":
|
||||
case "+graveyard:":
|
||||
case "+Island:":
|
||||
case "+town:":
|
||||
break;
|
||||
/*default:
|
||||
Console.WriteLine(split[0]);
|
||||
break;*/
|
||||
}
|
||||
}
|
||||
}
|
||||
from.SendMessage( "Done, added {0} spawners",m_Count );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage( "{0} not found!", vendor_path );
|
||||
}
|
||||
}
|
||||
|
||||
public static void PlaceNPC( string sx, string sy, string sm, params string[] types )
|
||||
{
|
||||
if ( types.Length == 0 )
|
||||
return;
|
||||
|
||||
int x = Utility.ToInt32( sx );
|
||||
int y = Utility.ToInt32( sy );
|
||||
int map = Utility.ToInt32( sm );
|
||||
|
||||
switch ( map )
|
||||
{
|
||||
case 0://Trammel and Felucca
|
||||
MakeSpawner( types, x, y, Map.Felucca );
|
||||
MakeSpawner( types, x, y, Map.Trammel );
|
||||
break;
|
||||
case 1://Felucca
|
||||
MakeSpawner( types, x, y, Map.Felucca );
|
||||
break;
|
||||
case 2:
|
||||
MakeSpawner( types, x, y, Map.Trammel );
|
||||
break;
|
||||
case 3:
|
||||
MakeSpawner( types, x, y, Map.Ilshenar );
|
||||
break;
|
||||
case 4:
|
||||
MakeSpawner( types, x, y, Map.Malas );
|
||||
break;
|
||||
default:
|
||||
Console.WriteLine( "UOAM Vendor Parser: Warning, unknown map {0}", map );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public static int GetSpawnerZ( int x, int y, Map map )
|
||||
{
|
||||
int z = map.GetAverageZ( x, y );
|
||||
|
||||
if ( map.CanFit( x, y, z, 16, false, false, true ) )
|
||||
return z;
|
||||
|
||||
for ( int i = 1; i <= 20; ++i )
|
||||
{
|
||||
if ( map.CanFit( x, y, z + i, 16, false, false, true ) )
|
||||
return z + i;
|
||||
|
||||
if ( map.CanFit( x, y, z - i, 16, false, false, true ) )
|
||||
return z - i;
|
||||
}
|
||||
|
||||
return z;
|
||||
}
|
||||
|
||||
private static Queue m_ToDelete = new Queue();
|
||||
|
||||
public static void ClearSpawners( int x, int y, int z, Map map )
|
||||
{
|
||||
IPooledEnumerable eable = map.GetItemsInRange( new Point3D( x, y, z ), 0 );
|
||||
|
||||
foreach ( Item item in eable )
|
||||
{
|
||||
if ( item is Spawner && item.Z == z )
|
||||
m_ToDelete.Enqueue( item );
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
|
||||
while ( m_ToDelete.Count > 0 )
|
||||
((Item)m_ToDelete.Dequeue()).Delete();
|
||||
}
|
||||
|
||||
private static void MakeSpawner( string[] types, int x, int y, Map map )
|
||||
{
|
||||
if ( types.Length == 0 )
|
||||
return;
|
||||
|
||||
int z = GetSpawnerZ( x, y, map );
|
||||
|
||||
ClearSpawners( x, y, z, map );
|
||||
|
||||
for ( int i = 0; i < types.Length; ++i )
|
||||
{
|
||||
bool isGuildmaster = ( types[i].EndsWith( "Guildmaster" ) );
|
||||
|
||||
Spawner sp = new Spawner( types[i] );
|
||||
|
||||
if ( isGuildmaster )
|
||||
sp.Count = 1;
|
||||
else
|
||||
sp.Count = NPCCount;
|
||||
|
||||
sp.MinDelay = MinTime;
|
||||
sp.MaxDelay = MaxTime;
|
||||
sp.Team = Team;
|
||||
sp.HomeRange = HomeRange;
|
||||
|
||||
sp.MoveToWorld( new Point3D( x, y, z ), map );
|
||||
|
||||
if ( TotalRespawn )
|
||||
{
|
||||
sp.Respawn();
|
||||
sp.BringToHome();
|
||||
}
|
||||
|
||||
++m_Count;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue