#region Header
// /**************************************************************
// * ____ __ _ __ __ __ ______ *
// * / __ \___ / /_ (_)____/ /_/ /_ / / / / __ \ *
// * / /_/ / _ \/ __ \/ / ___/ __/ __ \/ / / / / / / *
// * / _, _/ __/ /_/ / / / / /_/ / / / /_/ / /_/ / *
// * /_/ |_|\___/_.___/_/_/ \__/_/ /_/\____/\____/ *
// ***************************************************************/
#endregion
#region References
using System;
using System.Drawing;
using VitaNex.Network; // Reference for Cliloc Hack
#endregion
// Reference to Windows and Web Colors
namespace Server.Items
{
public class EAGiftBox1 : Backpack
{
//Var to Save the Year
[Constructable]
public EAGiftBox1() // Default Constructor for base code
{
Name = "A Shiny Giftbox";
ItemID = 0x9A92;
Weight = 1.0;
m_Year = DateTime.Now.Year; // Sets var Year to the current Year
Hue = Utility.RandomMinMax(0, 3000); // Set Random Color between 0 and 3000
}
[Constructable]
public EAGiftBox1(int hue)
: this() //Calls EAGiftBox1() then overwrite the Hue
{
Hue = hue;
}
public EAGiftBox1(Serial serial)
: base(serial)
{
}
public override int DefaultGumpID
{
get
{
return 30586; // Overwrites the Gump of Container
}
}
private int m_Year { get; set; }
public override void GetProperties(ObjectPropertyList list)
{
base.GetProperties(list); // Loading Base ToolTip
var l = new ExtendedOPL(list); // Apply Tooltip to Cliloc Hack
l.Add(("Merry Christmas " + m_Year).WrapUOHtmlColor(Color.Purple));
// Adds Text with Year and Colored via ClilocHack
l.Apply(); // Applys the Cliloc Hack
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write(0); // version
writer.Write(m_Year); //Saves the written Year
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
m_Year = reader.ReadInt(); // Reads the written Year
}
}
}