/**********************************************************
RunUO AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by Red Squirrel on Jan-01-2012 10:09:12pm
Filepath: scripts\events and scenarios\Christmas\items\Decoration.cs
Lines of code: 510

Description: 

***********************************************************/


using System;
using Server;

namespace Server.Items
{

	public class ChristmasDecorationBag : Bag 
	{ 
		[Constructable] 
		public ChristmasDecorationBag() : this( 5 ) 
		{ 
		} 

		[Constructable] 
		public ChristmasDecorationBag( int amount ) 
		{			
			for(int i=0;i<amount;i++)
			{			
				DropItem( SurpriseStocking.RandomDecoration() ); 
			}
		} 

		public ChristmasDecorationBag( Serial serial ) : base( serial ) 
		{ 
		} 

		public override void Serialize( GenericWriter writer ) 
		{ 
			base.Serialize( writer ); 

			writer.Write( (int) 0 ); // version 
		} 

		public override void Deserialize( GenericReader reader ) 
		{ 
			base.Deserialize( reader ); 

			int version = reader.ReadInt(); 
		} 
	} 
	
	
	
	
	
	
	
	public class ChristmasDecoration : Item
	{
		public override bool DisplayWeight { get { return false; } }
		private int m_Year;
		
		public int Year {get { return m_Year;} set {m_Year = value;}}
		
		
		
		
		public ChristmasDecoration(int itemid) : base(itemid)
		{
			DateTime now = DateTime.Now - TimeSpan.FromDays(40);  //Offset year so decoration received in January counts for the year before
			
			
			m_Year=now.Year;  //be sure to change this every year!
			
			
			LootType = LootType.Blessed;
		}
		
		
		
		public override void GetProperties( ObjectPropertyList list )
		{
			base.GetProperties( list );

			if(m_Year!=0)list.Add(String.Format("Christmas {0}",m_Year));
		}
		
		
		public ChristmasDecoration( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 1 );
			
			writer.Write( (int) m_Year);
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
			
			m_Year = reader.ReadInt();
			
			
			if(version==0)m_Year=0;
		}
	}



	[Flipable( 0x2328, 0x2329 )]
	public class Snowman : ChristmasDecoration
	{
		public static string GetRandomTitle()
		{
			// All hail OSI staff
			string[] titles = new string[]
				{
					/*  1 */ "Backflash",
					/*  2 */ "Carbon",
					/*  3 */ "Colbalistic",
					/*  4 */ "Comforl",
					/*  5 */ "Coppacchia",
					/*  6 */ "Cyrus",
					/*  7 */ "DannyB",
					/*  8 */ "DJSoul",
					/*  9 */ "DraconisRex",
					/* 10 */ "Earia",
					/* 11 */ "Foster",
					/* 12 */ "Gonzo",
					/* 13 */ "Haan",
					/* 14 */ "Halona",
					/* 15 */ "Hugo",
					/* 16 */ "Hyacinth",
					/* 17 */ "Imirian",
					/* 18 */ "Jinsol",
					/* 19 */ "Liciatia",
					/* 20 */ "Loewen",
					/* 21 */ "Loke",
					/* 22 */ "Magnus",
					/* 23 */ "Maleki",
					/* 24 */ "Morpheus",
					/* 25 */ "Obberron",
					/* 26 */ "Odee",
					/* 27 */ "Orbeus",
					/* 28 */ "Pax",
					/* 29 */ "Phields",
					/* 30 */ "Pigpen",
					/* 31 */ "Platinum",
					/* 32 */ "Polpol",
					/* 33 */ "Prume",
					/* 34 */ "Quinnly",
					/* 35 */ "Ragnarok",
					/* 36 */ "Rend",
					/* 37 */ "Roland",
					/* 38 */ "RyanM",
					/* 39 */ "Screach",
					/* 40 */ "Seraph",
					/* 41 */ "Silvani",
					/* 42 */ "Sherbear",
					/* 43 */ "SkyWalker",
					/* 44 */ "Snark",
					/* 45 */ "Sowl",
					/* 46 */ "Spada",
					/* 47 */ "Starblade",
					/* 48 */ "Tenacious",
					/* 49 */ "Tnez",
					/* 50 */ "Wasia",
					/* 51 */ "Zilo",
					/* 52 */ "Zippy",
					/* 53 */ "Zoer"
				};

			if ( titles.Length > 0 )
				return titles[Utility.Random( titles.Length )];

			return null;
		}

		private string m_Title;

		[CommandProperty( AccessLevel.GameMaster )]
		public string Title
		{
			get{ return m_Title; }
			set{ m_Title = value; InvalidateProperties(); Modify();}
		}

		[Constructable]
		public Snowman() : this( Utility.RandomDyedHue(), GetRandomTitle() )
		{
		}

		[Constructable]
		public Snowman( int hue ) : this( hue, GetRandomTitle() )
		{
		}

		[Constructable]
		public Snowman( string title ) : this( Utility.RandomDyedHue(), title )
		{
		}

		[Constructable]
		public Snowman( int hue, string title ) : base( Utility.Random( 0x2328, 2 ) )
		{
			Weight = 10.0;
			Hue = hue;			

			m_Title = title;
		}

		public override void GetProperties( ObjectPropertyList list )
		{
			base.GetProperties( list );

			if ( m_Title != null )
				list.Add( 1062841, m_Title ); // ~1_NAME~ the Snowman
		}

		public bool Dye( Mobile from, DyeTub sender )
		{
			if ( Deleted )
				return false;

			Hue = sender.DyedHue;

			return true;
		}

		public Snowman( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 1 ); // version

			writer.Write( (string) m_Title );
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
				case 1:
				{
					m_Title = reader.ReadString();
					break;
				}
			}

			Utility.Intern( ref m_Title );
		}
	}
	
	
	
	[FlipableAttribute( 0x232c, 0x232d )]
	public class Wreath : ChristmasDecoration
	{
				
		
		[Constructable]
		public Wreath() : base(0x232c)
		{
			Weight = 1;	
		}	

		public Wreath( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 0 );
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
		}
	}
	
	
	
	
	
	public class SnowFlake : ChristmasDecoration
	{
		public override bool DisplayWeight { get { return false; } }		
		
		[Constructable]
		public SnowFlake() : base(Utility.RandomBool() ? 0x232e : 0x232f)
		{
			Weight = 1;	
		}	

		public SnowFlake( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 0 );
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
		}
	}
	
	
	
	
	
	public class RedPoinsettia : ChristmasDecoration
	{
		public override bool DisplayWeight { get { return false; } }		
		
		[Constructable]
		public RedPoinsettia() : base(0x2330)
		{
			Weight = 1;	
		}	

		public RedPoinsettia( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 0 );
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
		}
	}
	
	
	
	public class WhitePoinsettia : ChristmasDecoration
	{
		public override bool DisplayWeight { get { return false; } }		
		
		[Constructable]
		public WhitePoinsettia() : base(0x2331)
		{
			Weight = 1;	
		}	

		public WhitePoinsettia( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 0 );
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
		}
	}

	
	[FlipableAttribute( 0x236e, 0x2371 )]
	public class ChristmasCandle : ChristmasDecoration
	{
		public override bool DisplayWeight { get { return false; } }	
		public override string DefaultName { get { return "Christmas Candle"; } }
		
		[Constructable]		
		public ChristmasCandle() : base(0x236e)
		{
			Weight = 1;	
		}	

		public ChristmasCandle( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 0 );
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
		}
	}
	
	
	
	
	
	
	
	
	
	
	[FlipableAttribute( 0x2374, 0x2375 )]
	public class MistleToe : ChristmasDecoration
	{
		public override bool DisplayWeight { get { return false; } }		
		
		[Constructable]
		public MistleToe() : base(0x2374)
		{
			Weight = 0.5;	
		}	

		public MistleToe( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 0 );
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
		}
	}
	
	
	
	
	
	
	
	
	
	
	public class FestiveCactus : ChristmasDecoration
	{
		public override bool DisplayWeight { get { return false; } }		
		
		[Constructable]		
		public FestiveCactus() : base(0x2376)
		{
			Weight = 3;	
		}	

		public FestiveCactus( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 0 );
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
		}
	}
	
	
	
	
	
	
	
	
	
	
	public class SnowyTree : ChristmasDecoration
	{
		public override bool DisplayWeight { get { return false; } }		
		
		[Constructable]
		public SnowyTree() : base(0x2377)
		{
			Weight = 5;	
		}	

		public SnowyTree( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 0 );
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
		}
	}
	
	
	
	
	
	
	
	
	
	
	public class DecorativeTopiary : ChristmasDecoration
	{
		public override bool DisplayWeight { get { return false; } }		
		
		[Constructable]
		public DecorativeTopiary() : base(0x2378)
		{
			Weight = 1;	
		}	

		public DecorativeTopiary( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 0 );
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
		}
	}
	
	
	
	
	
	
	
	

	[FlipableAttribute( 0x46ec, 0x46ef )]
	public class NutCracker : ChristmasDecoration
	{
		public override bool DisplayWeight { get { return false; } }		
		
		[Constructable]
		public NutCracker() : base(0x46ec)
		{
			Weight = 2;	
		}	

		public NutCracker( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 0 );
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
		}
	}
	
	
	
	[FlipableAttribute( 0x46f2, 0x46f5 )]
	public class BigNutCracker : ChristmasDecoration
	{
		public override bool DisplayWeight { get { return false; } }		
		
		[Constructable]
		public BigNutCracker() : base(0x46f2)
		{
			Weight = 5;	
		}	

		public BigNutCracker( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 0 );
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
		}
	}
	
	
	
	
	
	[FlipableAttribute( 0x46fa, 0x46fb )]
	public class ChristmasTreeAngel : ChristmasDecoration
	{
		public override bool DisplayWeight { get { return false; } }		
		
		[Constructable]
		public ChristmasTreeAngel() : base(0x46fa)
		{
			Weight = 1;	
		}	

		public ChristmasTreeAngel( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 0 );
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
		}
	}
	
	
	
	
	
	
	[FlipableAttribute( 11229, 11230 )]
	public class RedCandyCane : ChristmasDecoration
	{
		public override bool DisplayWeight { get { return false; } }		
		
		[Constructable]
		public RedCandyCane() : base(11229)
		{
			Weight = 0.1;	
		}	

		public RedCandyCane( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 0 );
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
		}
	}
	
	
	
	
	
	
	[FlipableAttribute( 11231, 11232 )]
	public class GreenCandyCane : ChristmasDecoration
	{
		public override bool DisplayWeight { get { return false; } }		
		
		[Constructable]
		public GreenCandyCane() : base(11231)
		{
			Weight = 0.1;	
		}	

		public GreenCandyCane( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 0 );
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
		}
	}
	
	
	
}