diff --git a/Scripts/Items/Special/Holiday/HolidayBell.cs b/Scripts/Items/Special/Holiday/HolidayBell.cs new file mode 100644 index 000000000..12658cacd --- /dev/null +++ b/Scripts/Items/Special/Holiday/HolidayBell.cs @@ -0,0 +1,109 @@ +using System; + +namespace Server.Items +{ + public class HolidayBell : Item + { + private static string[] m_StaffNames = new string[] + { + "Adrick", + "Alai", + "Bulldoz", + "Evocare", + "FierY-iCe", + "Greyburn", + "Hanse", + "Ignatz", + "Jalek", + "LadyMOI", + "Lord Krum", + "Malantus", + "Nimrond", + "Oaks", + "Prophet", + "Runesabre", + "Sage", + "Stellerex", + "T-Bone", + "Tajima", + "Tyrant", + "Vex" + }; + private static int[] m_Hues = new int[] + { + 0xA, 0x24, 0x42, 0x56, 0x1A, 0x4C, 0x3C, 0x60, 0x2E, 0x55, 0x23, 0x38, 0x482, 0x6, 0x10 + }; + + [CommandProperty(AccessLevel.GameMaster)] + public int SoundID + { + get { return m_SoundID; } + set { m_SoundID = value; InvalidateProperties(); } + } + + [CommandProperty(AccessLevel.GameMaster)] + public string Giver { get { return m_Maker; } set { m_Maker = value; } } + + public override string DefaultName + { + get { return String.Format("A Holiday Bell From {0}", Giver); } + } + + private string m_Maker; + private int m_SoundID; + + [Constructable] + public HolidayBell() + : this(m_StaffNames[Utility.Random(m_StaffNames.Length)]) + { + } + + [Constructable] + public HolidayBell(string maker) + : base(0x1C12) + { + m_Maker = maker; + + LootType = LootType.Blessed; + Hue = m_Hues[Utility.Random(m_Hues.Length)]; + SoundID = 0x0F5 + Utility.Random(14); + } + + public override void OnDoubleClick(Mobile from) + { + if (!from.InRange(GetWorldLocation(), 2)) + { + from.SendLocalizedMessage(500446); // That is too far away. + } + else from.PlaySound(m_SoundID); + } + + public HolidayBell(Serial serial) + : base(serial) + { + } + + public override void Serialize(GenericWriter writer) + { + base.Serialize(writer); + + writer.Write((int)0); // version + + writer.Write((string)m_Maker); + + writer.WriteEncodedInt((int)m_SoundID); + } + + public override void Deserialize(GenericReader reader) + { + base.Deserialize(reader); + + int version = reader.ReadInt(); + + m_Maker = reader.ReadString(); + m_SoundID = reader.ReadEncodedInt(); + + Utility.Intern(ref m_Maker); + } + } +} \ No newline at end of file diff --git a/Scripts/Items/Special/Holiday/Icecicles.cs b/Scripts/Items/Special/Holiday/Icecicles.cs new file mode 100644 index 000000000..d0afa9182 --- /dev/null +++ b/Scripts/Items/Special/Holiday/Icecicles.cs @@ -0,0 +1,167 @@ +using System; + +namespace Server.Items +{ + public class IcicleLargeSouth : Item + { + [Constructable] + public IcicleLargeSouth() + : base(0x4572) + { + } + + public IcicleLargeSouth(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 IcicleMedSouth : Item + { + [Constructable] + public IcicleMedSouth () + : base(0x4573) + { + } + + public IcicleMedSouth (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 IcicleSmallSouth : Item + { + [Constructable] + public IcicleSmallSouth () + : base(0x4574) + { + } + + public IcicleSmallSouth (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 IcicleLargeEast : Item + { + [Constructable] + public IcicleLargeEast () + : base(0x4575) + { + } + + public IcicleLargeEast (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 IcicleMedEast : Item + { + [Constructable] + public IcicleMedEast () + : base(0x4576) + { + } + + public IcicleMedEast (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 IcicleSmallEast : Item + { + [Constructable] + public IcicleSmallEast () + : base(0x4577) + { + } + + public IcicleSmallEast(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(); + } + } +} \ No newline at end of file diff --git a/Scripts/Items/Special/Holiday/IceyPatch.cs b/Scripts/Items/Special/Holiday/IceyPatch.cs new file mode 100644 index 000000000..40aa2dd1c --- /dev/null +++ b/Scripts/Items/Special/Holiday/IceyPatch.cs @@ -0,0 +1,124 @@ +using System; +using Server.Mobiles; +using Server.Spells; + +namespace Server.Items +{ + public class IceyPatch : Item + { + public override int LabelNumber { get { return 1095159; } } //An Icy Patch + + /* On OSI, the iceypatch with itemid 0x122a is "rarer", so we will give it 1:10 chance of creating it that way */ + + [Constructable] + public IceyPatch() + : this((Utility.Random(10) == 0) ? 0x122A : 0x122F) + { + } + + public IceyPatch(int itemid) + : base (itemid) + { + Hue = 0x481; + } + + public IceyPatch(Serial serial) + : base(serial) + { + } + + public override bool OnMoveOver(Mobile m) + { + if (m is PlayerMobile && m.Alive && m.AccessLevel == AccessLevel.Player) + { + switch (Utility.Random(3)) + { + case 0: RunSequence(m, 1095160, false); break; //You steadily walk over the slippery surface. + case 1: RunSequence(m, 1095161, true); break; //You skillfully manage to maintain your balance. + default: RunSequence(m, 1095162, true); break; //You lose your footing and ungracefully splatter on the ground. + } + } + return base.OnMoveOver(m); + } + + public virtual void RunSequence(Mobile m, int message, bool freeze) + { + object[] arg = null; + + if (freeze) + { + m.CantWalk = freeze; + Timer.DelayCall(TimeSpan.FromSeconds((message==1095162) ? 2.25 : 1.25), new TimerStateCallback(EndFall_Callback), m); + } + + m.SendLocalizedMessage(message); + + if (message == 1095162) + { + if (m.Mounted) + { + m.Mount.Rider = null; + } + + Point3D p = new Point3D(Location); + + if (SpellHelper.FindValidSpawnLocation(Map, ref p, true)) + { + Timer.DelayCall(TimeSpan.FromSeconds(0), new TimerStateCallback(Relocate_Callback), new object[] { m, p }); + } + + arg = new object[] { m, (21 + Utility.Random(2)), !m.Female ? 0x426 : 0x317 }; + } + else if (message == 1095161) + { + arg = new object[] { m, 17, !m.Female ? 0x429 : 0x319 }; + } + if (arg != null) + { + Timer.DelayCall(TimeSpan.FromSeconds(.25), new TimerStateCallback(BeginFall_Callback), arg); + } + } + + private static void Relocate_Callback(object state) + { + object[] states = (object[])state; + Mobile m = (Mobile)states[0]; + Point3D to = (Point3D)states[1]; + + m.MoveToWorld(to, m.Map); + } + + private static void BeginFall_Callback(object state) + { + object[] states = (object[])state; + + Mobile m = (Mobile)states[0]; + int action = (int)states[1]; + int sound = (int)states[2]; + if (!m.Mounted) + { + m.Animate(action, 1, 1, false, true, 0); + } + m.PlaySound(sound); + } + + private static void EndFall_Callback(object state) + { + ((Mobile)state).CantWalk = false; + } + + 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(); + } + } +} \ No newline at end of file diff --git a/Scripts/Items/Special/Holiday/SnowPiles.cs b/Scripts/Items/Special/Holiday/SnowPiles.cs new file mode 100644 index 000000000..d6af9811b --- /dev/null +++ b/Scripts/Items/Special/Holiday/SnowPiles.cs @@ -0,0 +1,42 @@ +namespace Server.Items +{ + public class SnowPileDeco : Item + { + public override string DefaultName{ get { return "Snow Pile"; } } + public override double DefaultWeight{ get { return 2.0; } } + + private static readonly int[] m_Types = new int[] { 0x8E2, 0x8E0, 0x8E6, 0x8E5, 0x8E3 }; + + [Constructable] + public SnowPileDeco() + : this(m_Types[Utility.Random(m_Types.Length)]) + { + } + + [Constructable] + public SnowPileDeco( int itemid ) + : base(itemid) + { + Hue = 0x481; + } + + public SnowPileDeco(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(); + } + } +} \ No newline at end of file