From 91537da9b28a486caa80391983a7f42c90d95814 Mon Sep 17 00:00:00 2001 From: athena Date: Sat, 17 Dec 2011 00:08:49 +0000 Subject: [PATCH] Christmas items --- .../Items/Special/Holiday/AngelDecoration.cs | 33 ++ .../Special/Holiday/HolidayPottedPlant.cs | 155 +++++++++ .../Items/Special/Holiday/HolidayTimepiece.cs | 39 +++ Scripts/Items/Special/Holiday/RockingHorse.cs | 35 ++ Scripts/Items/Special/Holiday/SnowGlobes.cs | 311 ++++++++++++++++++ Scripts/Items/Special/Holiday/SnowStatue.cs | 246 ++++++++++++++ Scripts/Items/Special/Holiday/WristWatch.cs | 39 +++ 7 files changed, 858 insertions(+) create mode 100644 Scripts/Items/Special/Holiday/AngelDecoration.cs create mode 100644 Scripts/Items/Special/Holiday/HolidayPottedPlant.cs create mode 100644 Scripts/Items/Special/Holiday/HolidayTimepiece.cs create mode 100644 Scripts/Items/Special/Holiday/RockingHorse.cs create mode 100644 Scripts/Items/Special/Holiday/SnowGlobes.cs create mode 100644 Scripts/Items/Special/Holiday/SnowStatue.cs create mode 100644 Scripts/Items/Special/Holiday/WristWatch.cs diff --git a/Scripts/Items/Special/Holiday/AngelDecoration.cs b/Scripts/Items/Special/Holiday/AngelDecoration.cs new file mode 100644 index 000000000..f39270f80 --- /dev/null +++ b/Scripts/Items/Special/Holiday/AngelDecoration.cs @@ -0,0 +1,33 @@ +using System; +using Server; + +namespace Server.Items +{ + [Flipable( 0x46FA, 0x46FB )] + public class AngelDecoration : Item + { + [Constructable] + public AngelDecoration() : base( 0x46FA ) + { + LootType = LootType.Blessed; + } + + public AngelDecoration( 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(); + } + } +} diff --git a/Scripts/Items/Special/Holiday/HolidayPottedPlant.cs b/Scripts/Items/Special/Holiday/HolidayPottedPlant.cs new file mode 100644 index 000000000..fb0bbe509 --- /dev/null +++ b/Scripts/Items/Special/Holiday/HolidayPottedPlant.cs @@ -0,0 +1,155 @@ +using System; +using Server; +using Server.Gumps; +using Server.Network; + +namespace Server.Items +{ + public class HolidayPottedPlant : Item + { + public override bool ForceShowProperties { get { return ObjectPropertyList.Enabled; } } + + [Constructable] + public HolidayPottedPlant() + : this( Utility.RandomMinMax( 0x11C8, 0x11CC ) ) + { + } + + [Constructable] + public HolidayPottedPlant( int itemID ) + : base( itemID ) + { + } + + public HolidayPottedPlant( Serial serial ) + : base( serial ) + { + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.WriteEncodedInt( 0 ); // version + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + int version = reader.ReadEncodedInt(); + } + } + + public class PottedPlantDeed : Item + { + public override int LabelNumber { get { return 1041114; } } // A deed for a potted plant. + public override double DefaultWeight { get { return 1.0; } } + + [Constructable] + public PottedPlantDeed() + : base( 0x14F0 ) + { + LootType = LootType.Blessed; + } + + public PottedPlantDeed( Serial serial ) + : base( serial ) + { + } + + public override void OnDoubleClick( Mobile from ) + { + if ( IsChildOf( from.Backpack ) ) + { + from.CloseGump( typeof( InternalGump ) ); + from.SendGump( new InternalGump( this ) ); + } + else + { + from.SendLocalizedMessage( 1042038 ); // You must have the object in your backpack to use it. + } + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.WriteEncodedInt( 0 ); // version + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + int version = reader.ReadEncodedInt(); + } + + private class InternalGump : Gump + { + private PottedPlantDeed m_Deed; + + public InternalGump( PottedPlantDeed deed ) : base( 100, 200 ) + { + m_Deed = deed; + + Closable = true; + Disposable = true; + Dragable = true; + Resizable = false; + + AddPage( 0 ); + AddBackground( 0, 0, 360, 195, 0xA28 ); + + AddPage( 1 ); + AddLabel( 45, 15, 0, "Choose a Potted Plant:" ); + + AddItem( 45, 75, 0x11C8 ); + AddButton( 55, 50, 0x845, 0x846, 1, GumpButtonType.Reply, 0 ); + + AddItem( 100, 75, 0x11C9 ); + AddButton( 115, 50, 0x845, 0x846, 2, GumpButtonType.Reply, 0 ); + + AddItem( 160, 75, 0x11CA ); + AddButton( 175, 50, 0x845, 0x846, 3, GumpButtonType.Reply, 0 ); + + AddItem( 225, 75, 0x11CB ); + AddButton( 235, 50, 0x845, 0x846, 4, GumpButtonType.Reply, 0 ); + + AddItem( 280, 75, 0x11CC ); + AddButton( 295, 50, 0x845, 0x846, 5, GumpButtonType.Reply, 0 ); + } + + public override void OnResponse( NetState sender, RelayInfo info ) + { + if ( m_Deed == null || m_Deed.Deleted ) + return; + + Mobile from = sender.Mobile; + + if ( !m_Deed.IsChildOf( from.Backpack ) ) + { + from.SendLocalizedMessage( 1042038 ); // You must have the object in your backpack to use it + return; + } + + int index = info.ButtonID - 1; + + if ( index >= 0 && index <= 4 ) + { + HolidayPottedPlant plant = new HolidayPottedPlant( 0x11C8 + index ); + + if ( !from.PlaceInBackpack( plant ) ) + { + plant.Delete(); + from.SendLocalizedMessage( 1078837 ); // Your backpack is full! Please make room and try again. + } + else + { + m_Deed.Delete(); + } + } + } + } + } +} diff --git a/Scripts/Items/Special/Holiday/HolidayTimepiece.cs b/Scripts/Items/Special/Holiday/HolidayTimepiece.cs new file mode 100644 index 000000000..f53118cd0 --- /dev/null +++ b/Scripts/Items/Special/Holiday/HolidayTimepiece.cs @@ -0,0 +1,39 @@ +using System; +using Server; + +namespace Server.Items +{ + public class HolidayTimepiece : Clock + { + public override int LabelNumber { get { return 1041113; } } // a holiday timepiece + public override double DefaultWeight { get { return 1.0; } } + + [Constructable] + public HolidayTimepiece() + : base( 0x1086 ) + { + Weight = DefaultWeight; + LootType = LootType.Blessed; + Layer = Layer.Bracelet; + } + + public HolidayTimepiece( 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(); + } + } +} diff --git a/Scripts/Items/Special/Holiday/RockingHorse.cs b/Scripts/Items/Special/Holiday/RockingHorse.cs new file mode 100644 index 000000000..3e7c9769d --- /dev/null +++ b/Scripts/Items/Special/Holiday/RockingHorse.cs @@ -0,0 +1,35 @@ +using System; +using Server; + +namespace Server.Items +{ + [Flipable( 0x4214, 0x4215 )] + public class RockingHorse : Item + { + public override double DefaultWeight { get { return 30.0; } } + + [Constructable] + public RockingHorse() : base( 0x4214 ) + { + LootType = LootType.Blessed; + } + + public RockingHorse( 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(); + } + } +} diff --git a/Scripts/Items/Special/Holiday/SnowGlobes.cs b/Scripts/Items/Special/Holiday/SnowGlobes.cs new file mode 100644 index 000000000..65d92426c --- /dev/null +++ b/Scripts/Items/Special/Holiday/SnowGlobes.cs @@ -0,0 +1,311 @@ +using System; +using Server; + +namespace Server.Items +{ + public class SnowGlobe : Item + { + public override double DefaultWeight { get { return 1.0; } } + + public SnowGlobe() + : base( 0xE2F ) + { + LootType = LootType.Blessed; + Light = LightType.Circle150; + } + + public SnowGlobe( 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 enum SnowGlobeTypeOne + { + Britain, + Moonglow, + Minoc, + Magincia, + BuccaneersDen, + Trinsic, + Yew, + SkaraBrae, + Jhelom, + Nujelm, + Papua, + Delucia, + Cove, + Ocllo, + SerpentsHold, + EmpathAbbey, + TheLycaeum, + Vesper, + Wind + } + + public class SnowGlobeOne : SnowGlobe + { + private SnowGlobeTypeOne m_Type; + + [CommandProperty( AccessLevel.GameMaster )] + public SnowGlobeTypeOne Place + { + get { return m_Type; } + set { m_Type = value; InvalidateProperties(); } + } + + public override int LabelNumber { get { return 1041454 + (int) m_Type; } } + + [Constructable] + public SnowGlobeOne() + : this( (SnowGlobeTypeOne) Utility.Random( 19 ) ) + { + } + + [Constructable] + public SnowGlobeOne( SnowGlobeTypeOne type ) + { + m_Type = type; + } + + public SnowGlobeOne( Serial serial ) + : base( serial ) + { + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.Write( (int) 0 ); // version + writer.WriteEncodedInt( (int) m_Type ); + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + int version = reader.ReadInt(); + + switch ( version ) + { + case 0: + { + m_Type = (SnowGlobeTypeOne) reader.ReadEncodedInt(); + break; + } + } + } + } + + public enum SnowGlobeTypeTwo + { + AncientCitadel, + BlackthornesCastle, + CityofMontor, + CityofMistas, + ExodusLair, + LakeofFire, + Lakeshire, + PassofKarnaugh, + TheEtherealFortress, + TwinOaksTavern, + ChaosShrine, + ShrineofHumility, + ShrineofSacrifice, + ShrineofCompassion, + ShrineofHonor, + ShrineofHonesty, + ShrineofSpirituality, + ShrineofJustice, + ShrineofValor + } + + public class SnowGlobeTwo : SnowGlobe + { + /* Oddly, these are not localized. */ + private static readonly string[] m_PlaceNames = new string[] + { + /* AncientCitadel */ "Ancient Citadel", + /* BlackthornesCastle */ "Blackthorne's Castle", + /* CityofMontor */ "City of Montor", + /* CityofMistas */ "City of Mistas", + /* ExodusLair */ "Exodus' Lair", + /* LakeofFire */ "Lake of Fire", + /* Lakeshire */ "Lakeshire", + /* PassofKarnaugh */ "Pass of Karnaugh", + /* TheEtherealFortress */ "The Etheral Fortress", + /* TwinOaksTavern */ "Twin Oaks Tavern", + /* ChaosShrine */ "Chaos Shrine", + /* ShrineofHumility */ "Shrine of Humility", + /* ShrineofSacrifice */ "Shrine of Sacrifice", + /* ShrineofCompassion */ "Shrine of Compassion", + /* ShrineofHonor */ "Shrine of Honor", + /* ShrineofHonesty */ "Shrine of Honesty", + /* ShrineofSpirituality */ "Shrine of Spirituality", + /* ShrineofJustice */ "Shrine of Justice", + /* ShrineofValor */ "Shrine of Valor" + }; + + private SnowGlobeTypeTwo m_Type; + + [CommandProperty( AccessLevel.GameMaster )] + public SnowGlobeTypeTwo Place + { + get { return m_Type; } + set { m_Type = value; InvalidateProperties(); } + } + + public override string DefaultName + { + get + { + int idx = (int) m_Type; + + if ( idx < 0 || idx >= m_PlaceNames.Length ) + return "a snowy scene"; + + return String.Format( "a snowy scene of {0}", m_PlaceNames[idx] ); + } + } + + [Constructable] + public SnowGlobeTwo() + : this( (SnowGlobeTypeTwo) Utility.Random( 19 ) ) + { + } + + [Constructable] + public SnowGlobeTwo( SnowGlobeTypeTwo type ) + { + m_Type = type; + } + + public SnowGlobeTwo( Serial serial ) + : base( serial ) + { + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.Write( (int) 0 ); // version + writer.WriteEncodedInt( (int) m_Type ); + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + int version = reader.ReadInt(); + + switch ( version ) + { + case 0: + { + m_Type = (SnowGlobeTypeTwo) reader.ReadEncodedInt(); + break; + } + } + } + } + + public enum SnowGlobeTypeThree + { + Luna, + Umbra, + Zento, + Heartwood, + Covetous, + Deceit, + Destard, + Hythloth, + Khaldun, + Shame, + Wrong, + Doom, + TheCitadel, + ThePalaceofParoxysmus, + TheBlightedGrove, + ThePrismofLight + } + + public class SnowGlobeThree : SnowGlobe + { + private SnowGlobeTypeThree m_Type; + + [CommandProperty( AccessLevel.GameMaster )] + public SnowGlobeTypeThree Place + { + get { return m_Type; } + set { m_Type = value; InvalidateProperties(); } + } + + public override int LabelNumber + { + get + { + if ( m_Type >= SnowGlobeTypeThree.Covetous ) + return 1075440 + ( (int) m_Type - 4 ); + + return 1075294 + (int) m_Type; + } + } + + [Constructable] + public SnowGlobeThree() + : this( (SnowGlobeTypeThree) Utility.Random( 16 ) ) + { + } + + [Constructable] + public SnowGlobeThree( SnowGlobeTypeThree type ) + { + m_Type = type; + } + + public SnowGlobeThree( Serial serial ) + : base( serial ) + { + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.Write( (int) 0 ); // version + writer.WriteEncodedInt( (int) m_Type ); + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + int version = reader.ReadInt(); + + switch ( version ) + { + case 0: + { + m_Type = (SnowGlobeTypeThree) reader.ReadEncodedInt(); + break; + } + } + } + } +} diff --git a/Scripts/Items/Special/Holiday/SnowStatue.cs b/Scripts/Items/Special/Holiday/SnowStatue.cs new file mode 100644 index 000000000..2a096a21a --- /dev/null +++ b/Scripts/Items/Special/Holiday/SnowStatue.cs @@ -0,0 +1,246 @@ +using System; +using Server; +using Server.Gumps; +using Server.Network; + +namespace Server.Items +{ + [Flipable( 0x456E, 0x456F )] + public class SnowStatuePegasus : Item + { + public override bool ForceShowProperties { get { return ObjectPropertyList.Enabled; } } + + [Constructable] + public SnowStatuePegasus() + : base( 0x456E ) + { + } + + public SnowStatuePegasus( Serial serial ) + : base( serial ) + { + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.WriteEncodedInt( 0 ); // version + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + int version = reader.ReadEncodedInt(); + } + } + + [Flipable( 0x4578, 0x4579 )] + public class SnowStatueSeahorse : Item + { + public override bool ForceShowProperties { get { return ObjectPropertyList.Enabled; } } + + [Constructable] + public SnowStatueSeahorse() + : base( 0x4578 ) + { + } + + public SnowStatueSeahorse( Serial serial ) + : base( serial ) + { + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.WriteEncodedInt( 0 ); // version + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + int version = reader.ReadEncodedInt(); + } + } + + [Flipable( 0x457A, 0x457B )] + public class SnowStatueMermaid : Item + { + public override bool ForceShowProperties { get { return ObjectPropertyList.Enabled; } } + + [Constructable] + public SnowStatueMermaid() + : base( 0x457A ) + { + } + + public SnowStatueMermaid( Serial serial ) + : base( serial ) + { + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.WriteEncodedInt( 0 ); // version + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + int version = reader.ReadEncodedInt(); + } + } + + [Flipable( 0x457C, 0x457D )] + public class SnowStatueGriffon : Item + { + public override bool ForceShowProperties { get { return ObjectPropertyList.Enabled; } } + + [Constructable] + public SnowStatueGriffon() + : base( 0x457C ) + { + } + + public SnowStatueGriffon( Serial serial ) + : base( serial ) + { + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.WriteEncodedInt( 0 ); // version + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + int version = reader.ReadEncodedInt(); + } + } + + public class SnowStatueDeed : Item + { + public override int LabelNumber { get { return 1114296; } } // snow statue deed + public override double DefaultWeight { get { return 1.0; } } + + [Constructable] + public SnowStatueDeed() + : base( 0x14F0 ) + { + LootType = LootType.Blessed; + } + + public SnowStatueDeed( Serial serial ) + : base( serial ) + { + } + + public override void OnDoubleClick( Mobile from ) + { + if ( IsChildOf( from.Backpack ) ) + { + from.CloseGump( typeof( InternalGump ) ); + from.SendGump( new InternalGump( this ) ); + } + else + { + from.SendLocalizedMessage( 1042038 ); // You must have the object in your backpack to use it. + } + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.WriteEncodedInt( 0 ); // version + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + int version = reader.ReadEncodedInt(); + } + + private class InternalGump : Gump + { + private SnowStatueDeed m_Deed; + + public InternalGump( SnowStatueDeed deed ) : base( 100, 200 ) + { + m_Deed = deed; + + Closable = true; + Disposable = true; + Dragable = true; + Resizable = false; + + AddPage( 0 ); + AddBackground( 0, 0, 360, 225, 0xA28 ); + + AddPage( 1 ); + AddLabel( 45, 15, 0, "Select One:" ); + + AddItem( 35, 75, 0x456E ); + AddButton( 65, 50, 0x845, 0x846, 1, GumpButtonType.Reply, 0 ); + + AddItem( 120, 75, 0x4578 ); + AddButton( 135, 50, 0x845, 0x846, 2, GumpButtonType.Reply, 0 ); + + AddItem( 190, 75, 0x457A ); + AddButton( 205, 50, 0x845, 0x846, 3, GumpButtonType.Reply, 0 ); + + AddItem( 250, 75, 0x457C ); + AddButton( 275, 50, 0x845, 0x846, 4, GumpButtonType.Reply, 0 ); + } + + public override void OnResponse( NetState sender, RelayInfo info ) + { + if ( m_Deed == null || m_Deed.Deleted ) + return; + + Mobile from = sender.Mobile; + + if ( !m_Deed.IsChildOf( from.Backpack ) ) + { + from.SendLocalizedMessage( 1042038 ); // You must have the object in your backpack to use it + return; + } + + Item statue = null; + + switch ( info.ButtonID ) + { + case 1: statue = new SnowStatuePegasus(); break; + case 2: statue = new SnowStatueSeahorse(); break; + case 3: statue = new SnowStatueMermaid(); break; + case 4: statue = new SnowStatueGriffon(); break; + } + + if ( statue == null ) + return; + + if ( !from.PlaceInBackpack( statue ) ) + { + statue.Delete(); + from.SendLocalizedMessage( 1078837 ); // Your backpack is full! Please make room and try again. + } + else + { + m_Deed.Delete(); + } + } + } + } +} diff --git a/Scripts/Items/Special/Holiday/WristWatch.cs b/Scripts/Items/Special/Holiday/WristWatch.cs new file mode 100644 index 000000000..5e1d98fd7 --- /dev/null +++ b/Scripts/Items/Special/Holiday/WristWatch.cs @@ -0,0 +1,39 @@ +using System; +using Server; + +namespace Server.Items +{ + public class WristWatch : Clock + { + public override int LabelNumber { get { return 1041421; } } // a wrist watch + public override double DefaultWeight { get { return 1.0; } } + + [Constructable] + public WristWatch() + : base( 0x1086 ) + { + Weight = DefaultWeight; + LootType = LootType.Blessed; + Layer = Layer.Bracelet; + } + + public WristWatch( 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(); + } + } +}