region Header ____ __ __ __ __ ______ __ ___ ____ __ __ ___ __ __ __ _

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#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
}
}
}