using System;
using System.Collections;
using Server;
using Server.Mobiles;
using Server.Items;
namespace Server
{
public class GenerateRares
{
public GenerateRares()
{
}
public static void Initialize()
{
Server.Commands.Register( "RareGen", AccessLevel.Administrator, new CommandEventHandler( GenerateRares_OnCommand ) );
}
[Usage( "RareGen" )]
[Description( "Generates steable rares in doom." )]
public static void GenerateRares_OnCommand( CommandEventArgs e )
{
e.Mobile.SendMessage( "Please hold generating doom rare system." );
e.Mobile.SendMessage( "Generating... " );
DecoreGen.CreateDecore();
e.Mobile.SendMessage( "Decore Done." );
e.Mobile.SendMessage( "Generating Teleporters... Please hold..." );
LampRoomTeleporter.CreateTeleporters();
e.Mobile.SendMessage( "Teleporters Done." );
e.Mobile.SendMessage( "Generating DoomSpawners... Please hold..." );
RareSpawner.PlacePremiumSpawners();
e.Mobile.SendMessage( "DoomSpawners Done." );
e.Mobile.SendMessage( "All Doom stealable rares generated." );
}
public class DecoreGen
{
public DecoreGen()
{
}
private static Queue m_Queue = new Queue();
public static bool FindDecore( Map map, Point3D p )
{
IPooledEnumerable eable = map.GetItemsInRange( p, 0 );
foreach ( Item item in eable )
{
if ( item is Nightstand )
{
int delta = item.Z - p.Z;
if ( delta >= -12 && delta <= 12 )
m_Queue.Enqueue( item );
}
else if ( item is Nightstand )
{
int delta = item.Z - p.Z;
if ( delta >= -12 && delta <= 12 )
m_Queue.Enqueue( item );
}
}
eable.Free();
while ( m_Queue.Count > 0 )
((Item)m_Queue.Dequeue()).Delete();
return false;
}
public static void CreateDecore( Point3D pointLocation, Map mapLocation )
{
Point3D table1 = new Point3D( 445, 9, 0 );
Point3D table2 = new Point3D( 483, 18, -1 );
Point3D table3 = new Point3D( 460, 9, 0 );
Point3D table4 = new Point3D( 467, 92, -1 );
if ( !FindDecore( mapLocation, pointLocation ) )
{
if ( pointLocation == table1 )
{
Nightstand table = new Nightstand();
table.Movable = false;
table.Visible = false;
table.Name = "DO NOT REMOVE! SPAWN HELPER!";
table.MoveToWorld( pointLocation, mapLocation );
}
else if ( pointLocation == table2 )
{
Nightstand table = new Nightstand();
table.Movable = false;
table.Visible = false;
table.Name = "DO NOT REMOVE! SPAWN HELPER!";
table.MoveToWorld( pointLocation, mapLocation );
}
else if ( pointLocation == table3 )
{
Nightstand table = new Nightstand();
table.Movable = false;
table.Visible = false;
table.Name = "DO NOT REMOVE! SPAWN HELPER!";
table.MoveToWorld( pointLocation, mapLocation );
}
else if ( pointLocation == table4 )
{
Nightstand table = new Nightstand();
table.Movable = false;
table.MoveToWorld( pointLocation, mapLocation );
}
}
}
public static void CreateDecore( int xLoc, int yLoc, int zLoc, Map map )
{
CreateDecore( new Point3D( xLoc, yLoc, zLoc ), map);
}
public static void CreateDecoreMalas( Map map )
{
CreateDecore( 445, 9, 0, map );
CreateDecore( 483, 18, -1, map );
CreateDecore( 460, 9, 0, map );
CreateDecore( 467, 92, -1, map );
}
public static void CreateDecore()
{
CreateDecoreMalas( Map.Malas );
}
}
public class LampRoomTeleporter
{
public LampRoomTeleporter()
{
}
private static Queue m_Queue = new Queue();
public static bool FindTeleporter( Map map, Point3D p )
{
IPooledEnumerable eable = map.GetItemsInRange( p, 0 );
foreach ( Item item in eable )
{
if ( item is Teleporter )
{
int delta = item.Z - p.Z;
if ( delta >= -12 && delta <= 12 )
m_Queue.Enqueue( item );
}
}
eable.Free();
while ( m_Queue.Count > 0 )
((Item)m_Queue.Dequeue()).Delete();
return false;
}
public static void CreateTeleporter( Point3D pointLocation, Map mapLocation )
{
Point3D white = new Point3D( 468, 92, -1 );
Point3D brown = new Point3D( 469, 92, -1 );
Point3D red = new Point3D( 470, 92, -1 );
if ( !FindTeleporter( mapLocation, pointLocation ) )
{
if ( pointLocation == white )
{
Teleporter port = new Teleporter();
port.ItemID = 6173;
port.Visible = true;
port.Name = "alchemical symbol";
port.Hue = 1154;
port.MapDest = Map.Malas;
port.PointDest = new Point3D( 2341, 1265, -110 );
port.SoundID = 510;
port.DestEffect = true;
port.SourceEffect = true;
port.MoveToWorld( pointLocation, mapLocation );
}
else if ( pointLocation == brown )
{
Teleporter port = new Teleporter();
port.ItemID = 6177;
port.Visible = true;
port.Name = "alchemical symbol";
port.Hue = 1839; //TODO This the right hue?
port.MapDest = Map.Malas;
port.PointDest = new Point3D( 476, 92, -1 );
port.SoundID = 510;
port.DestEffect = true;
port.SourceEffect = true;
port.MoveToWorld( pointLocation, mapLocation );
}
else if ( pointLocation == red )
{
Teleporter port = new Teleporter();
port.ItemID = 6181;
port.Visible = true;
port.Name = "alchemical symbol";
port.Hue = 2118;
port.MapDest = Map.Malas;
port.PointDest = new Point3D( 323, 63, -1 );
port.SoundID = 510;
port.DestEffect = true;
port.SourceEffect = true;
port.MoveToWorld( pointLocation, mapLocation );
}
}
}
public static void CreateTeleporter( int xLoc, int yLoc, int zLoc, Map map )
{
CreateTeleporter( new Point3D( xLoc, yLoc, zLoc ), map);
}
public static void CreateTeleportersLampRoom( Map map )
{
CreateTeleporter( 468, 92, -1, map );
CreateTeleporter( 469, 92, -1, map );
CreateTeleporter( 470, 92, -1, map );
}
public static void CreateTeleporters()
{
CreateTeleportersLampRoom( Map.Malas );
}
}
public class RareSpawner
{
//configuration
private const bool TotalRespawn = true;//Should we spawn them up right away?
private static TimeSpan MinTime = TimeSpan.FromMinutes( 75 );//min spawn time
private static TimeSpan MaxTime = TimeSpan.FromMinutes( 90 );//max spawn time
public RareSpawner()
{
}
//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 PremiumSpawner && item.Z == z )
m_ToDelete.Enqueue( item );
}
eable.Free();
while ( m_ToDelete.Count > 0 )
((Item)m_ToDelete.Dequeue()).Delete();
}*/
public static void PlacePremiumSpawners()
{
//Rares
PlaceRareSpawns( 312, 55, -1, "Rock" );
PlaceRareSpawns( 347, 41, -1, "SkinnedGoat" );
PlaceRareSpawns( 352, 32, -1, "SkinnedDeer" );
PlaceRareSpawns( 361, 31, 5, "SkullCandle" );
PlaceRareSpawns( 422, 25, 0, "EggCase" );
PlaceRareSpawns( 423, 23, -1, "Cocoon" );
PlaceRareSpawns( 432, 19, -1, "StretchedHide" );
PlaceRareSpawns( 432, 12, -1, "Saddle" );
PlaceRareSpawns( 462, 10, -1, "Brazier" );
PlaceRareSpawns( 498, 54, -1, "GruesomeStandard" );
PlaceRareSpawns( 471, 92, -1, "LampPost" );
PlaceRareSpawns( 429, 193, -1, "Books" );
PlaceRareSpawns( 427, 189, -1, "StackedBooks1" );
PlaceRareSpawns( 418, 198, 0, "StackedBooks" );
PlaceRareSpawns( 460, 9, 6, "HangingLeatherTunic" );
PlaceRareSpawns( 492, 8, 5, "HangingStuddedTunicSouth" );
PlaceRareSpawns( 483, 18, 5, "HangingStuddedTunicEast" );
PlaceRareSpawns( 445, 9, 6, "HangingStuddedLeggingsSouth" );
PlaceRareSpawns( 381, 375, 10, "BloodyWater" );
PlaceRareSpawns( 378, 372, 0, "DamagedBooks" );
PlaceRareSpawns( 369, 371, 0, "Bottle" );
PlaceRareSpawns( 489, 370, 5, "Tarot" );
PlaceRareSpawns( 497, 368, 12, "ReversedBackpack" );
PlaceRareSpawns( 488, 364, -1, "RuinedPainting" );
//Artifacts
PlaceRareSpawns( 354, 176, 8, "DRTitansHammer" );
PlaceRareSpawns( 467, 92, 4, "DRInquisitorsResolution" );
PlaceRareSpawns( 259, 72, -1, "DRZyronicClaw" );
PlaceRareSpawns( 369, 389, -1, "DRBladeOfTheRighteous" );
}
public static void PlaceRareSpawns( int x, int y, int z, string types )
{
switch ( types )
{
case "Rock1":
MakePremiumSpawner( "DRRock", x, y, z, Map.Malas, true );
MinTime = TimeSpan.FromMinutes( 75 );
MaxTime = TimeSpan.FromMinutes( 90 );
break;
case "SkinnedGoat":
MakePremiumSpawner( "DRSkinnedGoat", x, y, z, Map.Malas, true );
MinTime = TimeSpan.FromHours( 24 );
MaxTime = TimeSpan.FromHours( 32 );
break;
case "SkinnedDeer":
MakePremiumSpawner( "DRSkinnedDeer", x, y, z, Map.Malas, true );
MinTime = TimeSpan.FromHours( 96 );
MaxTime = TimeSpan.FromHours( 96 );
break;
case "SkullCandle":
MakePremiumSpawner( "DRSkullCandle", x, y, z, Map.Malas, true );
MinTime = TimeSpan.FromMinutes( 75 );
MaxTime = TimeSpan.FromMinutes( 90 );
break;
case "EggCase":
MakePremiumSpawner( "DREggCase", x, y, z, Map.Malas, true );
MinTime = TimeSpan.FromHours( 24 );
MaxTime = TimeSpan.FromHours( 32 );
break;
case "Cocoon":
MakePremiumSpawner( "DRCocoon", x, y, z, Map.Malas, true );
MinTime = TimeSpan.FromHours( 96 );
MaxTime = TimeSpan.FromHours( 96 );
break;
case "StretchedHide":
MakePremiumSpawner( "DRStretchedHide", x, y, z, Map.Malas, true );
MinTime = TimeSpan.FromHours( 3 );
MaxTime = TimeSpan.FromHours( 6 );
break;
case "DoomSaddle":
MakePremiumSpawner( "DRSaddle", x, y, z, Map.Malas, true );
MinTime = TimeSpan.FromHours( 384 );
MaxTime = TimeSpan.FromHours( 386 );
break;
case "DoomBrazier":
MakePremiumSpawner( "DRBrazier", x, y, z, Map.Malas, true );
MinTime = TimeSpan.FromHours( 3 );
MaxTime = TimeSpan.FromHours( 6 );
break;
case "GruesomeStandard":
MakePremiumSpawner( "DRGruesomeStandard", x, y, z, Map.Malas, true );
MinTime = TimeSpan.FromHours( 24 );
MaxTime = TimeSpan.FromHours( 32 );
break;
case "DoomLampPost":
MakePremiumSpawner( "DRLampPost", x, y, z, Map.Malas, true );
MinTime = TimeSpan.FromHours( 6 );
MaxTime = TimeSpan.FromHours( 8 );
break;
case "DoomBooks":
MakePremiumSpawner( "DRBooks", x, y, z, Map.Malas, true );
MinTime = TimeSpan.FromHours( 6 );
MaxTime = TimeSpan.FromHours( 8 );
break;
case "StackedBooks1":
MakePremiumSpawner( "DRStackedBooks1", x, y, z, Map.Malas, true );
MinTime = TimeSpan.FromHours( 6 );
MaxTime = TimeSpan.FromHours( 8 );
break;
case "StackedBooks":
MakePremiumSpawner( "DRStackedBooks", x, y, z, Map.Malas, true );
MinTime = TimeSpan.FromHours( 6 );
MaxTime = TimeSpan.FromHours( 8 );
break;
case "HangingLeatherTunic":
MakePremiumSpawner( "DRHangingLeatherTunic", x, y, z, Map.Malas, true );
MinTime = TimeSpan.FromHours( 384 );
MaxTime = TimeSpan.FromHours( 384 );
break;
case "HangingStuddedTunicSouth":
MakePremiumSpawner( "DRHangingStuddedTunicSouth", x, y, z, Map.Malas, true );
MinTime = TimeSpan.FromHours( 96 );
MaxTime = TimeSpan.FromHours( 96 );
break;
case "HangingStuddedTunicEast":
MakePremiumSpawner( "DRHangingStuddedTunicEast", x, y, z, Map.Malas, true );
MinTime = TimeSpan.FromHours( 96 );
MaxTime = TimeSpan.FromHours( 96 );
break;
case "HangingStuddedLeggingsSouth":
MakePremiumSpawner( "DRHangingStuddedLeggingsSouth", x, y, z, Map.Malas, true );
MinTime = TimeSpan.FromHours( 24 );
MaxTime = TimeSpan.FromHours( 32 );
break;
case "BloodyWater":
MakePremiumSpawner( "DRBloodyWater", x, y, z, Map.Malas, true );
MinTime = TimeSpan.FromHours( 24 );
MaxTime = TimeSpan.FromHours( 32 );
break;
case "DamagedBooks":
MakePremiumSpawner( "DRDamagedBooks", x, y, z, Map.Malas, true );
MinTime = TimeSpan.FromMinutes( 75 );
MaxTime = TimeSpan.FromMinutes( 90 );
break;
case "DoomBottle":
MakePremiumSpawner( "DRBottle", x, y, z, Map.Malas, true );
MinTime = TimeSpan.FromMinutes( 75 );
MaxTime = TimeSpan.FromMinutes( 90 );
break;
case "DoomTarot":
MakePremiumSpawner( "DRTarot", x, y, z, Map.Malas, true );
MinTime = TimeSpan.FromHours( 24 );
MaxTime = TimeSpan.FromHours( 32 );
break;
case "ReversedBackpack":
MakePremiumSpawner( "DRReversedBackpack", x, y, z, Map.Malas, true );
MinTime = TimeSpan.FromHours( 24 );
MaxTime = TimeSpan.FromHours( 32 );
break;
case "RuinedPainting":
MakePremiumSpawner( "DRRuinedPainting", x, y, z, Map.Malas, true );
MinTime = TimeSpan.FromHours( 720 );
MaxTime = TimeSpan.FromHours( 720 );
break;
case "TitansHammer":
MakePremiumSpawner( "DRTitansHammer", x, y, z, Map.Malas, true );
MinTime = TimeSpan.FromHours( 720 );
MaxTime = TimeSpan.FromHours( 720 );
break;
case "InquisitorsResolution":
MakePremiumSpawner( "DRInquisitorsResolution", x, y, z, Map.Malas, true );
MinTime = TimeSpan.FromHours( 720 );
MaxTime = TimeSpan.FromHours( 720 );
break;
case "ZyronicClaw":
MakePremiumSpawner( "DRZyronicClaw", x, y, z, Map.Malas, true );
MinTime = TimeSpan.FromHours( 720 );
MaxTime = TimeSpan.FromHours( 720 );
break;
case "BladeOfTheRighteous":
MakePremiumSpawner( "DRBladeOfTheRighteous", x, y, z, Map.Malas, true );
MinTime = TimeSpan.FromHours( 720 );
MaxTime = TimeSpan.FromHours( 720 );
break;
default:
break;
}
}
private static void MakePremiumSpawner( string types, int x, int y, int z, Map map, bool start )
{
//ClearSpawners( x, y, z, map );
Spawner sp = new Spawner( types );
sp.Count = 1;
sp.Running = true;
sp.HomeRange = 1;
// sp.SpawnRange = 1;
sp.MinDelay = MinTime;
sp.MaxDelay = MaxTime;
sp.MoveToWorld( new Point3D( x, y, z ), map );
}
}
}
}