diff --git a/Scripts/Engines/Craft/Core/CraftItem.cs b/Scripts/Engines/Craft/Core/CraftItem.cs index 6bc4f48a0..8a8242541 100644 --- a/Scripts/Engines/Craft/Core/CraftItem.cs +++ b/Scripts/Engines/Craft/Core/CraftItem.cs @@ -815,11 +815,24 @@ namespace Server.Engines.Craft if( m_ForceNonExceptional ) return 0.0; + double bonus = 0.0; + + if ( from.Talisman is BaseTalisman ) + { + BaseTalisman talisman = (BaseTalisman) from.Talisman; + + if ( talisman.Skill == system.MainSkill ) + { + chance -= talisman.SuccessBonus / 100.0; + bonus = talisman.ExceptionalBonus / 100.0; + } + } + switch ( system.ECA ) { default: - case CraftECA.ChanceMinusSixty: return chance - 0.6; - case CraftECA.FiftyPercentChanceMinusTenPercent: return (chance * 0.5) - 0.1; + case CraftECA.ChanceMinusSixty: chance -= 0.6; break; + case CraftECA.FiftyPercentChanceMinusTenPercent: chance = chance * 0.5 - 0.1; break; case CraftECA.ChanceMinusSixtyToFourtyFive: { double offset = 0.60 - ((from.Skills[system.MainSkill].Value - 95.0) * 0.03); @@ -829,9 +842,15 @@ namespace Server.Engines.Craft else if ( offset > 0.60 ) offset = 0.60; - return chance - offset; + chance -= offset; + break; } } + + if ( chance > 0 ) + return chance + bonus; + + return chance; } public bool CheckSkills( Mobile from, Type typeRes, CraftSystem craftSystem, ref int quality, ref bool allRequiredSkills ) @@ -886,6 +905,14 @@ namespace Server.Engines.Craft else chance = 0.0; + if ( allRequiredSkills && from.Talisman is BaseTalisman ) + { + BaseTalisman talisman = (BaseTalisman) from.Talisman; + + if ( talisman.Skill == craftSystem.MainSkill ) + chance += talisman.SuccessBonus / 100.0; + } + if ( allRequiredSkills && valMainSkill == maxMainSkill ) chance = 1.0; diff --git a/Scripts/Engines/Craft/DefCarpentry.cs b/Scripts/Engines/Craft/DefCarpentry.cs index 1b3d55fe0..813ea7be2 100644 --- a/Scripts/Engines/Craft/DefCarpentry.cs +++ b/Scripts/Engines/Craft/DefCarpentry.cs @@ -125,6 +125,15 @@ namespace Server.Engines.Craft AddRes( index, typeof( Cloth ), 1044286, 5, 1044287 ); } + if ( Core.ML ) + { + index = AddCraft( typeof( RunedSwitch ), 1044294, 1072896, 70.0, 120.0, typeof( Log ), 1044041, 2, 1044351 ); + AddRes( index, typeof( EnchantedSwitch ), 1072893, 1, 1053098 ); + AddRes( index, typeof( RunedPrism ), 1073465, 1, 1053098 ); + AddRes( index, typeof( JeweledFiligree ), 1072894, 1, 1053098 ); + SetNeededExpansion( index, Expansion.ML ); + } + // Furniture AddCraft( typeof( FootStool ), 1044291, 1022910, 11.0, 36.0, typeof( Log ), 1044041, 9, 1044351 ); AddCraft( typeof( Stool ), 1044291, 1022602, 11.0, 36.0, typeof( Log ), 1044041, 9, 1044351 ); diff --git a/Scripts/Engines/Craft/DefGlassblowing.cs b/Scripts/Engines/Craft/DefGlassblowing.cs index d9ed9e656..56ff8c448 100644 --- a/Scripts/Engines/Craft/DefGlassblowing.cs +++ b/Scripts/Engines/Craft/DefGlassblowing.cs @@ -128,6 +128,12 @@ namespace Server.Engines.Craft AddCraft( typeof( EmptyVialsWRack ), 1044050, 1044616, 65.0, 115.0, typeof( Sand ), 1044625, 8, 1044627 ); AddCraft( typeof( FullVialsWRack ), 1044050, 1044617, 65.0, 115.0, typeof( Sand ), 1044625, 9, 1044627 ); AddCraft( typeof( SpinningHourglass ), 1044050, 1044618, 75.0, 125.0, typeof( Sand ), 1044625, 10, 1044627 ); + + if ( Core.ML ) + { + index = AddCraft( typeof( HollowPrism ), 1044050, 1072895, 100.0, 150.0, typeof( Sand ), 1044625, 8, 1044627 ); + SetNeededExpansion( index, Expansion.ML ); + } } } } \ No newline at end of file diff --git a/Scripts/Engines/Craft/DefInscription.cs b/Scripts/Engines/Craft/DefInscription.cs index 04c308c75..2a262d813 100644 --- a/Scripts/Engines/Craft/DefInscription.cs +++ b/Scripts/Engines/Craft/DefInscription.cs @@ -293,12 +293,30 @@ namespace Server.Engines.Craft AddNecroSpell(16, 40, 79.6, typeof(ExorcismScroll), Reagent.NoxCrystal, Reagent.GraveDust); } - int index; + int index; + + if ( Core.ML ) + { + index = AddCraft( typeof( EnchantedSwitch ), 1044294, 1072893, 45.0, 95.0, typeof( BlankScroll ), 1044377, 1, 1044378 ); + AddRes( index, typeof( SpidersSilk ), 1044360, 1, 1044253 ); + AddRes( index, typeof( BlackPearl ), 1044353, 1, 1044253 ); + AddRes( index, typeof( SwitchItem ), 1073464, 1, 1044253 ); + ForceNonExceptional( index ); + SetNeededExpansion( index, Expansion.ML ); + + index = AddCraft( typeof( RunedPrism ), 1044294, 1073465, 45.0, 95.0, typeof( BlankScroll ), 1044377, 1, 1044378 ); + AddRes( index, typeof( SpidersSilk ), 1044360, 1, 1044253 ); + AddRes( index, typeof( BlackPearl ), 1044353, 1, 1044253 ); + AddRes( index, typeof( HollowPrism ), 1072895, 1, 1044253 ); + ForceNonExceptional( index ); + SetNeededExpansion( index, Expansion.ML ); + } + // Runebook - index = AddCraft(typeof(Runebook), 1044294, 1041267, 45.0, 95.0, typeof(BlankScroll), 1044377, 8, 1044378); - AddRes(index, typeof(RecallScroll), 1044445, 1, 1044253); - AddRes(index, typeof(GateTravelScroll), 1044446, 1, 1044253); + index = AddCraft( typeof( Runebook ), 1044294, 1041267, 45.0, 95.0, typeof( BlankScroll ), 1044377, 8, 1044378 ); + AddRes( index, typeof( RecallScroll ), 1044445, 1, 1044253 ); + AddRes( index, typeof( GateTravelScroll ), 1044446, 1, 1044253 ); if (Core.AOS) { diff --git a/Scripts/Engines/Craft/DefTinkering.cs b/Scripts/Engines/Craft/DefTinkering.cs index f6a2259db..f25a33262 100644 --- a/Scripts/Engines/Craft/DefTinkering.cs +++ b/Scripts/Engines/Craft/DefTinkering.cs @@ -201,6 +201,15 @@ namespace Server.Engines.Craft AddCraft( typeof( BarrelHoops ), 1044047, 1024321, -15.0, 35.0, typeof( IronIngot ), 1044036, 5, 1044037 ); AddCraft( typeof( Hinge ), 1044047, 1024181, 5.0, 55.0, typeof( IronIngot ), 1044036, 2, 1044037 ); AddCraft( typeof( BolaBall ), 1044047, 1023699, 45.0, 95.0, typeof( IronIngot ), 1044036, 10, 1044037 ); + + if ( Core.ML ) + { + index = AddCraft( typeof( JeweledFiligree ), 1044047, 1072894, 70.0, 110.0, typeof( IronIngot ), 1044036, 2, 1044037 ); + AddRes( index, typeof( StarSapphire ), 1044231, 1, 1044253 ); + AddRes( index, typeof( Ruby ), 1044234, 1, 1044253 ); + SetNeededExpansion( index, Expansion.ML ); + } + #endregion #region Utensils diff --git a/Scripts/Engines/Treasures of Tokuno/BasePigmentsOfTokuno.cs b/Scripts/Engines/Treasures of Tokuno/BasePigmentsOfTokuno.cs index f920f3fa0..f1125da16 100644 --- a/Scripts/Engines/Treasures of Tokuno/BasePigmentsOfTokuno.cs +++ b/Scripts/Engines/Treasures of Tokuno/BasePigmentsOfTokuno.cs @@ -157,6 +157,9 @@ namespace Server.Items if( !CraftResources.IsStandard( resource ) ) return true; + if ( i is ITokunoDyable ) + return true; + return( IsInTypeList( t, TreasuresOfTokuno.LesserArtifactsTotal ) || IsInTypeList( t, TreasuresOfTokuno.GreaterArtifacts ) diff --git a/Scripts/Gumps/ConfirmHeritageGump.cs b/Scripts/Gumps/ConfirmHeritageGump.cs new file mode 100644 index 000000000..a91326e1a --- /dev/null +++ b/Scripts/Gumps/ConfirmHeritageGump.cs @@ -0,0 +1,74 @@ +using System; +using Server; +using Server.Items; +using Server.Network; + +namespace Server.Gumps +{ + public class ConfirmHeritageGump : Gump + { + private HeritageToken m_Token; + private Type[] m_Selected; + + private enum Buttons + { + Cancel, + Okay + } + + public ConfirmHeritageGump( HeritageToken token, Type[] selected, int cliloc ) : base( 60, 36 ) + { + m_Token = token; + m_Selected = selected; + + AddPage( 0 ); + + AddBackground( 0, 0, 291, 99, 0x13BE ); + AddImageTiled( 5, 6, 280, 20, 0xA40 ); + AddHtmlLocalized( 9, 8, 280, 20, 1070972, 0x7FFF, false, false ); // Click "OKAY" to redeem the following promotional item: + AddImageTiled( 5, 31, 280, 40, 0xA40 ); + AddHtmlLocalized( 9, 35, 272, 40, cliloc, 0x7FFF, false, false ); + AddButton( 180, 73, 0xFB7, 0xFB8, (int) Buttons.Okay, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 215, 75, 100, 20, 1011036, 0x7FFF, false, false ); // OKAY + AddButton( 5, 73, 0xFB1, 0xFB2, (int) Buttons.Cancel, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 40, 75, 100, 20, 1060051, 0x7FFF, false, false ); // CANCEL + } + + public override void OnResponse( NetState sender, RelayInfo info ) + { + if ( m_Token == null || m_Token.Deleted ) + return; + + switch ( info.ButtonID ) + { + case (int) Buttons.Okay: + + Item item = null; + + foreach ( Type type in m_Selected ) + { + try + { + item = Activator.CreateInstance( type ) as Item; + } + catch ( Exception ex ) + { + Console.WriteLine( ex.Message ); + Console.WriteLine( ex.StackTrace ); + } + + if ( item != null ) + { + m_Token.Delete(); + sender.Mobile.AddToBackpack( item ); + } + } + + break; + case (int) Buttons.Cancel: + sender.Mobile.SendGump( new HeritageTokenGump( m_Token ) ); + break; + } + } + } +} diff --git a/Scripts/Gumps/DawnsMusicBoxGump.cs b/Scripts/Gumps/DawnsMusicBoxGump.cs new file mode 100644 index 000000000..e448883aa --- /dev/null +++ b/Scripts/Gumps/DawnsMusicBoxGump.cs @@ -0,0 +1,84 @@ +using System; +using Server; +using Server.Network; +using Server.Items; + +namespace Server.Gumps +{ + public class DawnsMusicBoxGump : Gump + { + private DawnsMusicBox m_Box; + + public DawnsMusicBoxGump( DawnsMusicBox box ) + : base( 60, 36 ) + { + m_Box = box; + + AddPage( 0 ); + + AddBackground( 0, 0, 273, 324, 0x13BE ); + AddImageTiled( 10, 10, 253, 20, 0xA40 ); + AddImageTiled( 10, 40, 253, 244, 0xA40 ); + AddImageTiled( 10, 294, 253, 20, 0xA40 ); + AddAlphaRegion( 10, 10, 253, 304 ); + AddButton( 10, 294, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 45, 296, 450, 20, 1060051, 0x7FFF, false, false ); // CANCEL + AddHtmlLocalized( 14, 12, 273, 20, 1075130, 0x7FFF, false, false ); // Choose a track to play + + int page = 1; + int i, y = 49; + + AddPage( page ); + + for ( i = 0; i < m_Box.Tracks.Count; i++, y += 24 ) + { + DawnsMusicInfo info = DawnsMusicBox.GetInfo( m_Box.Tracks[ i ] ); + + if ( i > 0 && i % 10 == 0 ) + { + AddButton( 228, 294, 0xFA5, 0xFA6, 0, GumpButtonType.Page, page + 1 ); + + AddPage( page + 1 ); + y = 49; + + AddButton( 193, 294, 0xFAE, 0xFAF, 0, GumpButtonType.Page, page ); + + page++; + } + + AddButton( 19, y, 0x845, 0x846, 100 + i, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 44, y - 2, 213, 20, info.Name, 0x7FFF, false, false ); + } + + if ( i % 10 == 0 ) + { + AddButton( 228, 294, 0xFA5, 0xFA6, 0, GumpButtonType.Page, page + 1 ); + + AddPage( page + 1 ); + y = 49; + + AddButton( 193, 294, 0xFAE, 0xFAF, 0, GumpButtonType.Page, page ); + } + + AddButton( 19, y, 0x845, 0x846, 1, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 44, y - 2, 213, 20, 1075207, 0x7FFF, false, false ); // Stop Song + } + + public override void OnResponse( NetState sender, RelayInfo info ) + { + if ( m_Box == null || m_Box.Deleted ) + return; + + Mobile m = sender.Mobile; + + if ( !m_Box.IsChildOf( m.Backpack ) && !m_Box.IsLockedDown ) + m.SendLocalizedMessage( 1061856 ); // You must have the item in your backpack or locked down in order to use it. + else if ( m_Box.IsLockedDown && !m_Box.HasAccces( m ) ) + m.SendLocalizedMessage( 502691 ); // You must be the owner to use this. + else if ( info.ButtonID == 1 ) + m_Box.EndMusic( m ); + else if ( info.ButtonID >= 100 && info.ButtonID - 100 < m_Box.Tracks.Count ) + m_Box.PlayMusic( m, m_Box.Tracks[ info.ButtonID - 100 ] ); + } + } +} diff --git a/Scripts/Gumps/HeritageTokenGump.cs b/Scripts/Gumps/HeritageTokenGump.cs new file mode 100644 index 000000000..54f821d2a --- /dev/null +++ b/Scripts/Gumps/HeritageTokenGump.cs @@ -0,0 +1,389 @@ +using System; +using System.Collections.Generic; +using Server; +using Server.Items; +using Server.Network; + +namespace Server.Gumps +{ + public class HeritageTokenGump : Gump + { + private HeritageToken m_Token; + + public HeritageTokenGump( HeritageToken token ) : base( 60, 36 ) + { + m_Token = token; + + AddPage( 0 ); + + AddBackground( 0, 0, 520, 404, 0x13BE ); + AddImageTiled( 10, 10, 500, 20, 0xA40 ); + AddImageTiled( 10, 40, 500, 324, 0xA40 ); + AddImageTiled( 10, 374, 500, 20, 0xA40 ); + AddAlphaRegion( 10, 10, 500, 384 ); + AddButton( 10, 374, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 45, 376, 450, 20, 1060051, 0x7FFF, false, false ); // CANCEL + AddHtmlLocalized( 14, 12, 500, 20, 1075576, 0x7FFF, false, false ); // Choose your item from the following pages + + AddPage( 1 ); + + AddImageTiledButton( 14, 44, 0x918, 0x919, 0x64, GumpButtonType.Reply, 0, 0x1411, 0x2C, 18, 8 ); + AddTooltip( 1062912 ); + AddHtmlLocalized( 98, 44, 250, 60, 1078147, 0x7FFF, false, false ); // Royal Leggings of Embers + AddImageTiledButton( 264, 44, 0x918, 0x919, 0x65, GumpButtonType.Reply, 0, 0x234D, 0x0, 18, 12 ); + AddTooltip( 1062914 ); + AddHtmlLocalized( 348, 44, 250, 60, 1062913, 0x7FFF, false, false ); // Rose of Trinsic + AddImageTiledButton( 14, 108, 0x918, 0x919, 0x66, GumpButtonType.Reply, 0, 0x26C3, 0x504, 18, 8 ); + AddTooltip( 1062916 ); + AddHtmlLocalized( 98, 108, 250, 60, 1062915, 0x7FFF, false, false ); // Shamino’s Best Crossbow + AddImageTiledButton( 264, 108, 0x918, 0x919, 0x67, GumpButtonType.Reply, 0, 0x3F1D, 0x0, 18, 8 ); + AddTooltip( 1062918 ); + AddHtmlLocalized( 348, 108, 250, 60, 1062917, 0x7FFF, false, false ); // The Tapestry of Sosaria + AddImageTiledButton( 14, 172, 0x918, 0x919, 0x68, GumpButtonType.Reply, 0, 0x3F14, 0x0, 18, 8 ); + AddTooltip( 1062920 ); + AddHtmlLocalized( 98, 172, 250, 60, 1062919, 0x7FFF, false, false ); // Hearth of the Home Fire + AddImageTiledButton( 264, 172, 0x918, 0x919, 0x69, GumpButtonType.Reply, 0, 0xF60, 0x482, -1, 10 ); + AddTooltip( 1062922 ); + AddHtmlLocalized( 348, 172, 250, 60, 1062921, 0x7FFF, false, false ); // The Holy Sword + AddImageTiledButton( 14, 236, 0x918, 0x919, 0x6A, GumpButtonType.Reply, 0, 0x236C, 0x0, 18, 6 ); + AddTooltip( 1062924 ); + AddHtmlLocalized( 98, 236, 250, 60, 1062923, 0x7FFF, false, false ); // Ancient Samurai Helm + AddImageTiledButton( 264, 236, 0x918, 0x919, 0x6B, GumpButtonType.Reply, 0, 0x2B10, 0x226, 18, 11 ); + AddTooltip( 1075223 ); + AddHtmlLocalized( 348, 236, 250, 60, 1075188, 0x7FFF, false, false ); // Helm of Spirituality + AddImageTiledButton( 14, 300, 0x918, 0x919, 0x6C, GumpButtonType.Reply, 0, 0x2B0C, 0x226, 18, 15 ); + AddTooltip( 1075224 ); + AddHtmlLocalized( 98, 300, 250, 60, 1075192, 0x7FFF, false, false ); // Gauntlets of Valor + AddImageTiledButton( 264, 300, 0x918, 0x919, 0x6D, GumpButtonType.Reply, 0, 0x2B01, 0x0, 18, 9 ); + AddTooltip( 1075225 ); + AddHtmlLocalized( 348, 300, 250, 60, 1075196, 0x7FFF, false, false ); // Dupre’s Shield + AddButton( 400, 374, 0xFA5, 0xFA7, 0, GumpButtonType.Page, 2 ); + AddHtmlLocalized( 440, 376, 60, 20, 1043353, 0x7FFF, false, false ); // Next + + AddPage( 2 ); + + AddButton( 300, 374, 0xFAE, 0xFB0, 0, GumpButtonType.Page, 1 ); + AddHtmlLocalized( 340, 376, 60, 20, 1011393, 0x7FFF, false, false ); // Back + AddImageTiledButton( 14, 44, 0x918, 0x919, 0x6E, GumpButtonType.Reply, 0, 0x2AC6, 0x0, 29, 0 ); + AddTooltip( 1075226 ); + AddHtmlLocalized( 98, 44, 250, 60, 1075197, 0x7FFF, false, false ); // Fountain of Life + AddImageTiledButton( 264, 44, 0x918, 0x919, 0x6F, GumpButtonType.Reply, 0, 0x2AF9, 0x0, -4, -5 ); + AddTooltip( 1075227 ); + AddHtmlLocalized( 348, 44, 250, 60, 1075198, 0x7FFF, false, false ); // Dawn’s Music Box + AddImageTiledButton( 14, 108, 0x918, 0x919, 0x70, GumpButtonType.Reply, 0, 0x2253, 0x0, 18, 12 ); + AddTooltip( 1075228 ); + AddHtmlLocalized( 98, 108, 250, 60, 1078148, 0x7FFF, false, false ); // Ossian Grimoire + AddImageTiledButton( 264, 108, 0x918, 0x919, 0x71, GumpButtonType.Reply, 0, 0x2D98, 0x0, 19, 13 ); + AddTooltip( 1078527 ); + AddHtmlLocalized( 348, 108, 250, 60, 1078142, 0x7FFF, false, false ); // Talisman of the Fey:
Ferret + AddImageTiledButton( 14, 172, 0x918, 0x919, 0x72, GumpButtonType.Reply, 0, 0x2D97, 0x0, 19, 13 ); + AddTooltip( 1078528 ); + AddHtmlLocalized( 98, 172, 250, 60, 1078143, 0x7FFF, false, false ); // Talisman of the Fey:
Squirrel + AddImageTiledButton( 264, 172, 0x918, 0x919, 0x73, GumpButtonType.Reply, 0, 0x2D96, 0x0, 19, 8 ); + AddTooltip( 1078529 ); + AddHtmlLocalized( 348, 172, 250, 60, 1078144, 0x7FFF, false, false ); // Talisman of the Fey:
Cu Sidhe + AddImageTiledButton( 14, 236, 0x918, 0x919, 0x74, GumpButtonType.Reply, 0, 0x2D95, 0x0, -4, 2 ); + AddTooltip( 1078530 ); + AddHtmlLocalized( 98, 236, 250, 60, 1078145, 0x7FFF, false, false ); // Talisman of the Fey:
Reptalon + AddImageTiledButton( 264, 236, 0x918, 0x919, 0x75, GumpButtonType.Reply, 0, 0x2B02, 0x0, -2, 9 ); + AddTooltip( 1078526 ); + AddHtmlLocalized( 348, 236, 250, 60, 1075201, 0x7FFF, false, false ); // Quiver of Infinity + AddImageTiledButton( 14, 300, 0x918, 0x919, 0x76, GumpButtonType.Reply, 0, 0x2A91, 0x0, 25, 5 ); + AddTooltip( 1075986 ); + AddHtmlLocalized( 98, 300, 250, 60, 1074797, 0x7FFF, false, false ); // Bone Throne, Bone Couch
and Bone Table + AddImageTiledButton( 264, 300, 0x918, 0x919, 0x77, GumpButtonType.Reply, 0, 0x2A99, 0x0, 18, 1 ); + AddTooltip( 1075987 ); + AddHtmlLocalized( 348, 300, 250, 60, 1078146, 0x7FFF, false, false ); // Creepy Portraits + AddButton( 400, 374, 0xFA5, 0xFA7, 0, GumpButtonType.Page, 3 ); + AddHtmlLocalized( 440, 376, 60, 20, 1043353, 0x7FFF, false, false ); // Next + + AddPage( 3 ); + + AddButton( 300, 374, 0xFAE, 0xFB0, 0, GumpButtonType.Page, 2 ); + AddHtmlLocalized( 340, 376, 60, 20, 1011393, 0x7FFF, false, false ); // Back + AddImageTiledButton( 14, 44, 0x918, 0x919, 0x78, GumpButtonType.Reply, 0, 0x2A71, 0x0, 13, 5 ); + AddTooltip( 1075988 ); + AddHtmlLocalized( 98, 44, 250, 60, 1074799, 0x7FFF, false, false ); // Mounted Pixies (5) + AddImageTiledButton( 264, 44, 0x918, 0x919, 0x79, GumpButtonType.Reply, 0, 0x2A98, 0x0, 26, 1 ); + AddTooltip( 1075990 ); + AddHtmlLocalized( 348, 44, 250, 60, 1074800, 0x7FFF, false, false ); // Haunted Mirror + AddImageTiledButton( 14, 108, 0x918, 0x919, 0x7A, GumpButtonType.Reply, 0, 0x2A92, 0x0, 18, 1 ); + AddTooltip( 1075989 ); + AddHtmlLocalized( 98, 108, 250, 60, 1074801, 0x7FFF, false, false ); // Bed of Nails + AddImageTiledButton( 264, 108, 0x918, 0x919, 0x7B, GumpButtonType.Reply, 0, 0x2AB8, 0x0, 18, 1 ); + AddTooltip( 1075991 ); + AddHtmlLocalized( 348, 108, 250, 60, 1074818, 0x7FFF, false, false ); // Sacrificial Altar + AddImageTiledButton( 14, 172, 0x918, 0x919, 0x7C, GumpButtonType.Reply, 0, 0x3F26, 0x0, 18, 8 ); + AddTooltip( 1076610 ); + AddHtmlLocalized( 98, 172, 250, 60, 1076257, 0x7FFF, false, false ); // Broken Covered Chair + AddImageTiledButton( 264, 172, 0x918, 0x919, 0x7D, GumpButtonType.Reply, 0, 0x3F22, 0x0, 18, 8 ); + AddTooltip( 1076610 ); + AddHtmlLocalized( 348, 172, 250, 60, 1076258, 0x7FFF, false, false ); // Broken Bookcase + AddImageTiledButton( 14, 236, 0x918, 0x919, 0x7E, GumpButtonType.Reply, 0, 0x3F24, 0x0, 18, 8 ); + AddTooltip( 1076610 ); + AddHtmlLocalized( 98, 236, 250, 60, 1076259, 0x7FFF, false, false ); // Standing Broken Chair + AddImageTiledButton( 264, 236, 0x918, 0x919, 0x7F, GumpButtonType.Reply, 0, 0x3F25, 0x0, 18, 8 ); + AddTooltip( 1076610 ); + AddHtmlLocalized( 348, 236, 250, 60, 1076260, 0x7FFF, false, false ); // Broken Vanity + AddImageTiledButton( 14, 300, 0x918, 0x919, 0x80, GumpButtonType.Reply, 0, 0x3F23, 0x0, 18, 8 ); + AddTooltip( 1076610 ); + AddHtmlLocalized( 98, 300, 250, 60, 1076261, 0x7FFF, false, false ); // Broken Chest of Drawers + AddImageTiledButton( 264, 300, 0x918, 0x919, 0x81, GumpButtonType.Reply, 0, 0x3F21, 0x0, 18, 8 ); + AddTooltip( 1076610 ); + AddHtmlLocalized( 348, 300, 250, 60, 1076262, 0x7FFF, false, false ); // Broken Armoire + AddButton( 400, 374, 0xFA5, 0xFA7, 0, GumpButtonType.Page, 4 ); + AddHtmlLocalized( 440, 376, 60, 20, 1043353, 0x7FFF, false, false ); // Next + + AddPage( 4 ); + + AddButton( 300, 374, 0xFAE, 0xFB0, 0, GumpButtonType.Page, 3 ); + AddHtmlLocalized( 340, 376, 60, 20, 1011393, 0x7FFF, false, false ); // Back + AddImageTiledButton( 14, 44, 0x918, 0x919, 0x82, GumpButtonType.Reply, 0, 0x3F0B, 0x0, 18, 8 ); + AddTooltip( 1076610 ); + AddHtmlLocalized( 98, 44, 250, 60, 1076263, 0x7FFF, false, false ); // Broken Bed + AddImageTiledButton( 264, 44, 0x918, 0x919, 0x83, GumpButtonType.Reply, 0, 0xC19, 0x0, 13, 8 ); + AddTooltip( 1076610 ); + AddHtmlLocalized( 348, 44, 250, 60, 1076264, 0x7FFF, false, false ); // Broken Fallen Chair + AddImageTiledButton( 14, 108, 0x918, 0x919, 0x84, GumpButtonType.Reply, 0, 0x3DAA, 0x0, 20, -3 ); + AddTooltip( 1076611 ); + AddHtmlLocalized( 98, 108, 250, 60, 1076265, 0x7FFF, false, false ); // Suit of Gold Armor + AddImageTiledButton( 264, 108, 0x918, 0x919, 0x85, GumpButtonType.Reply, 0, 0x151C, 0x0, -20, -3 ); + AddTooltip( 1076612 ); + AddHtmlLocalized( 348, 108, 250, 60, 1076266, 0x7FFF, false, false ); // Suit of Silver Armor + AddImageTiledButton( 14, 172, 0x918, 0x919, 0x86, GumpButtonType.Reply, 0, 0x3DB1, 0x0, 18, 8 ); + AddTooltip( 1076613 ); + AddHtmlLocalized( 98, 172, 250, 60, 1076267, 0x7FFF, false, false ); // Boiling Cauldron + AddImageTiledButton( 264, 172, 0x918, 0x919, 0x87, GumpButtonType.Reply, 0, 0x3F27, 0x0, 18, 8 ); + AddTooltip( 1076614 ); + AddHtmlLocalized( 348, 172, 250, 60, 1024656, 0x7FFF, false, false ); // Guillotine + AddImageTiledButton( 14, 236, 0x918, 0x919, 0x88, GumpButtonType.Reply, 0, 0x3F0C, 0x0, 18, 8 ); + AddTooltip( 1076615 ); + AddHtmlLocalized( 98, 236, 250, 60, 1076268, 0x7FFF, false, false ); // Cherry Blossom Tree + AddImageTiledButton( 264, 236, 0x918, 0x919, 0x89, GumpButtonType.Reply, 0, 0x3F07, 0x0, 18, 8 ); + AddTooltip( 1076616 ); + AddHtmlLocalized( 348, 236, 250, 60, 1076269, 0x7FFF, false, false ); // Apple Tree + AddImageTiledButton( 14, 300, 0x918, 0x919, 0x8A, GumpButtonType.Reply, 0, 0x3F16, 0x0, 18, 8 ); + AddTooltip( 1076617 ); + AddHtmlLocalized( 98, 300, 250, 60, 1076270, 0x7FFF, false, false ); // Peach Tree + AddImageTiledButton( 264, 300, 0x918, 0x919, 0x8B, GumpButtonType.Reply, 0, 0x3F12, 0x0, 18, 8 ); + AddTooltip( 1076618 ); + AddHtmlLocalized( 348, 300, 250, 60, 1076271, 0x7FFF, false, false ); // Hanging Axes + AddButton( 400, 374, 0xFA5, 0xFA7, 0, GumpButtonType.Page, 5 ); + AddHtmlLocalized( 440, 376, 60, 20, 1043353, 0x7FFF, false, false ); // Next + + AddPage( 5 ); + + AddButton( 300, 374, 0xFAE, 0xFB0, 0, GumpButtonType.Page, 4 ); + AddHtmlLocalized( 340, 376, 60, 20, 1011393, 0x7FFF, false, false ); // Back + AddImageTiledButton( 14, 44, 0x918, 0x919, 0x8C, GumpButtonType.Reply, 0, 0x3F13, 0x0, 18, 8 ); + AddTooltip( 1076619 ); + AddHtmlLocalized( 98, 44, 250, 60, 1076272, 0x7FFF, false, false ); // Hanging Swords + AddImageTiledButton( 264, 44, 0x918, 0x919, 0x8D, GumpButtonType.Reply, 0, 0x3F09, 0x0, 18, 8 ); + AddTooltip( 1076620 ); + AddHtmlLocalized( 348, 44, 250, 60, 1076273, 0x7FFF, false, false ); // Blue fancy rug + AddImageTiledButton( 14, 108, 0x918, 0x919, 0x8E, GumpButtonType.Reply, 0, 0x3F0E, 0x0, 18, 8 ); + AddTooltip( 1076621 ); + AddHtmlLocalized( 98, 108, 250, 60, 1076274, 0x7FFF, false, false ); // Coffin + AddImageTiledButton( 264, 108, 0x918, 0x919, 0x8F, GumpButtonType.Reply, 0, 0x3F1F, 0x0, 18, 8 ); + AddTooltip( 1076623 ); + AddHtmlLocalized( 348, 108, 250, 60, 1074027, 0x7FFF, false, false ); // Vanity + AddImageTiledButton( 14, 172, 0x918, 0x919, 0x90, GumpButtonType.Reply, 0, 0x118B, 0x0, -4, -9 ); + AddTooltip( 1076624 ); + AddHtmlLocalized( 98, 172, 250, 60, 1076635, 0x7FFF, false, false ); // Table With A Purple
Tablecloth + AddImageTiledButton( 264, 172, 0x918, 0x919, 0x91, GumpButtonType.Reply, 0, 0x118C, 0x0, -4, -9 ); + AddTooltip( 1076624 ); + AddHtmlLocalized( 348, 172, 250, 60, 1076636, 0x7FFF, false, false ); // Table With A Blue
Tablecloth + AddImageTiledButton( 14, 236, 0x918, 0x919, 0x92, GumpButtonType.Reply, 0, 0x118D, 0x0, -4, -9 ); + AddTooltip( 1076624 ); + AddHtmlLocalized( 98, 236, 250, 60, 1076637, 0x7FFF, false, false ); // Table With A Red
Tablecloth + AddImageTiledButton( 264, 236, 0x918, 0x919, 0x93, GumpButtonType.Reply, 0, 0x118E, 0x0, -4, -9 ); + AddTooltip( 1076624 ); + AddHtmlLocalized( 348, 236, 250, 60, 1076638, 0x7FFF, false, false ); // Table With An Orange
Tablecloth + AddImageTiledButton( 14, 300, 0x918, 0x919, 0x94, GumpButtonType.Reply, 0, 0x3F1E, 0x0, 18, 8 ); + AddTooltip( 1076625 ); + AddHtmlLocalized( 98, 300, 250, 60, 1076279, 0x7FFF, false, false ); // Unmade Bed + AddImageTiledButton( 264, 300, 0x918, 0x919, 0x95, GumpButtonType.Reply, 0, 0x3F0F, 0x0, 18, 8 ); + AddTooltip( 1076626 ); + AddHtmlLocalized( 348, 300, 250, 60, 1076280, 0x7FFF, false, false ); // Curtains + AddButton( 400, 374, 0xFA5, 0xFA7, 0, GumpButtonType.Page, 6 ); + AddHtmlLocalized( 440, 376, 60, 20, 1043353, 0x7FFF, false, false ); // Next + + AddPage( 6 ); + + AddButton( 300, 374, 0xFAE, 0xFB0, 0, GumpButtonType.Page, 5 ); + AddHtmlLocalized( 340, 376, 60, 20, 1011393, 0x7FFF, false, false ); // Back + AddImageTiledButton( 14, 44, 0x918, 0x919, 0x96, GumpButtonType.Reply, 0, 0x1E34, 0x0, 18, -17 ); + AddTooltip( 1076627 ); + AddHtmlLocalized( 98, 44, 250, 60, 1076281, 0x7FFF, false, false ); // Scarecrow + AddImageTiledButton( 264, 44, 0x918, 0x919, 0x97, GumpButtonType.Reply, 0, 0xA0C, 0x0, 18, 8 ); + AddTooltip( 1076628 ); + AddHtmlLocalized( 348, 44, 250, 60, 1076282, 0x7FFF, false, false ); // Wall Torch + AddImageTiledButton( 14, 108, 0x918, 0x919, 0x98, GumpButtonType.Reply, 0, 0x3F10, 0x0, 18, 9 ); + AddTooltip( 1076629 ); + AddHtmlLocalized( 98, 108, 250, 60, 1076283, 0x7FFF, false, false ); // Fountain + AddImageTiledButton( 264, 108, 0x918, 0x919, 0x99, GumpButtonType.Reply, 0, 0x3F19, 0x0, 18, 8 ); + AddTooltip( 1076630 ); + AddHtmlLocalized( 348, 108, 250, 60, 1076284, 0x7FFF, false, false ); // Statue + AddImageTiledButton( 14, 172, 0x918, 0x919, 0x9A, GumpButtonType.Reply, 0, 0x1EA5, 0x0, 5, -25 ); + AddTooltip( 1076631 ); + AddHtmlLocalized( 98, 172, 250, 60, 1076285, 0x7FFF, false, false ); // Large Fish Net + AddImageTiledButton( 264, 172, 0x918, 0x919, 0x9B, GumpButtonType.Reply, 0, 0x1EA3, 0x0, 18, -27 ); + AddTooltip( 1076632 ); + AddHtmlLocalized( 348, 172, 250, 60, 1076286, 0x7FFF, false, false ); // Small Fish Net + AddImageTiledButton( 14, 236, 0x918, 0x919, 0x9C, GumpButtonType.Reply, 0, 0x2FDF, 0x0, 18, -36 ); + AddTooltip( 1076633 ); + AddHtmlLocalized( 98, 236, 250, 60, 1076287, 0x7FFF, false, false ); // Ladder + AddImageTiledButton( 264, 236, 0x918, 0x919, 0x9D, GumpButtonType.Reply, 0, 0x3F15, 0x0, 18, 8 ); + AddTooltip( 1076622 ); + AddHtmlLocalized( 348, 236, 250, 60, 1076288, 0x7FFF, false, false ); // Iron Maiden + AddImageTiledButton( 14, 300, 0x918, 0x919, 0x9E, GumpButtonType.Reply, 0, 0x3F0A, 0x0, 18, 8 ); + AddTooltip( 1076620 ); + AddHtmlLocalized( 98, 300, 250, 60, 1076585, 0x7FFF, false, false ); // Blue plain rug + AddImageTiledButton( 264, 300, 0x918, 0x919, 0x9F, GumpButtonType.Reply, 0, 0x3F11, 0x0, 18, 8 ); + AddTooltip( 1076620 ); + AddHtmlLocalized( 348, 300, 250, 60, 1076586, 0x7FFF, false, false ); // Golden decorative rug + AddButton( 400, 374, 0xFA5, 0xFA7, 0, GumpButtonType.Page, 7 ); + AddHtmlLocalized( 440, 376, 60, 20, 1043353, 0x7FFF, false, false ); // Next + + AddPage( 7 ); + + AddButton( 300, 374, 0xFAE, 0xFB0, 0, GumpButtonType.Page, 6 ); + AddHtmlLocalized( 340, 376, 60, 20, 1011393, 0x7FFF, false, false ); // Back + AddImageTiledButton( 14, 44, 0x918, 0x919, 0xA0, GumpButtonType.Reply, 0, 0x3F0D, 0x0, 18, 8 ); + AddTooltip( 1076620 ); + AddHtmlLocalized( 98, 44, 250, 60, 1076587, 0x7FFF, false, false ); // Cinnamon fancy rug + AddImageTiledButton( 264, 44, 0x918, 0x919, 0xA1, GumpButtonType.Reply, 0, 0x3F18, 0x0, 18, 8 ); + AddTooltip( 1076620 ); + AddHtmlLocalized( 348, 44, 250, 60, 1076588, 0x7FFF, false, false ); // Red plain rug + AddImageTiledButton( 14, 108, 0x918, 0x919, 0xA2, GumpButtonType.Reply, 0, 0x3F08, 0x0, 18, 8 ); + AddTooltip( 1076620 ); + AddHtmlLocalized( 98, 108, 250, 60, 1076589, 0x7FFF, false, false ); // Blue decorative rug + AddImageTiledButton( 264, 108, 0x918, 0x919, 0xA3, GumpButtonType.Reply, 0, 0x3F17, 0x0, 18, 8 ); + AddTooltip( 1076620 ); + AddHtmlLocalized( 348, 108, 250, 60, 1076590, 0x7FFF, false, false ); // Pink fancy rug + AddImageTiledButton( 14, 172, 0x918, 0x919, 0xA4, GumpButtonType.Reply, 0, 0x312A, 0x0, 18, 8 ); + AddTooltip( 1076615 ); + AddHtmlLocalized( 98, 172, 250, 60, 1076784, 0x7FFF, false, false ); // Cherry Blossom Trunk + AddImageTiledButton( 264, 172, 0x918, 0x919, 0xA5, GumpButtonType.Reply, 0, 0x3128, 0x0, 18, 8 ); + AddTooltip( 1076616 ); + AddHtmlLocalized( 348, 172, 250, 60, 1076785, 0x7FFF, false, false ); // Apple Trunk + AddImageTiledButton( 14, 236, 0x918, 0x919, 0xA6, GumpButtonType.Reply, 0, 0x3129, 0x0, 18, 8 ); + AddTooltip( 1076617 ); + AddHtmlLocalized( 98, 236, 250, 60, 1076786, 0x7FFF, false, false ); // Peach Trunk + } + + public override void OnResponse( NetState sender, RelayInfo info ) + { + if ( m_Token == null || m_Token.Deleted || info.ButtonID == 0 ) + return; + + List types = new List(); + int cliloc = 0; + + switch ( info.ButtonID ) + { + // 7th anniversary + case 0x64: types.Add( typeof( LeggingsOfEmbers ) ); cliloc = 1078147; break; + case 0x65: types.Add( typeof( RoseOfTrinsic ) ); cliloc = 1062913; break; + case 0x66: types.Add( typeof( ShaminoCrossbow ) ); cliloc = 1062915; break; + case 0x67: types.Add( typeof( TapestryOfSosaria ) ); cliloc = 1062917; break; + case 0x68: types.Add( typeof( HearthOfHomeFireDeed ) ); cliloc = 1062919; break; + case 0x69: types.Add( typeof( HolySword ) ); cliloc = 1062921; break; + case 0x6A: types.Add( typeof( SamuraiHelm ) ); cliloc = 1062923; break; + + // 8th anniversary + /*case 0x6B: types.Add( typeof( SpiritualityHelm ) ); cliloc = 1075188; break; + case 0x6C: types.Add( typeof( ValorGauntlets ) ); cliloc = 1075192; break;*/ + case 0x6D: types.Add( typeof( DupresShield ) ); cliloc = 1075196; break; + case 0x6E: types.Add( typeof( FountainOfLifeDeed ) ); cliloc = 1075197; break; + case 0x6F: types.Add( typeof( DawnsMusicBox ) ); cliloc = 1075198; break; + case 0x70: types.Add( typeof( OssianGrimoire ) ); cliloc = 1078148; break; + case 0x71: types.Add( typeof( FerretFormTalisman ) ); cliloc = 1078142; break; + case 0x72: types.Add( typeof( SquirrelFormTalisman ) ); cliloc = 1078143; break; + case 0x73: types.Add( typeof( CuSidheFormTalisman ) ); cliloc = 1078144; break; + case 0x74: types.Add( typeof( ReptalonFormTalisman ) ); cliloc = 1078145; break; + case 0x75: types.Add( typeof( QuiverOfInfinity ) ); cliloc = 1075201; break; + + // evil home decor + case 0x76: + types.Add( typeof( BoneThroneDeed ) ); + types.Add( typeof( BoneCouchDeed ) ); + types.Add( typeof( BoneTableDeed ) ); + cliloc = 1074797; + break; + case 0x77: + types.Add( typeof( CreepyPortraitDeed ) ); + types.Add( typeof( DisturbingPortraitDeed ) ); + types.Add( typeof( UnsettlingPortraitDeed ) ); + cliloc = 1078146; + break; + case 0x78: + types.Add( typeof( MountedPixieBlueDeed ) ); + types.Add( typeof( MountedPixieGreenDeed ) ); + types.Add( typeof( MountedPixieLimeDeed ) ); + types.Add( typeof( MountedPixieOrangeDeed ) ); + types.Add( typeof( MountedPixieWhiteDeed ) ); + cliloc = 1074799; + break; + case 0x79: types.Add( typeof( HaunterMirrorDeed ) ); cliloc = 1074800; break; + case 0x7A: types.Add( typeof( BedOfNailsDeed ) ); cliloc = 1074801; break; + case 0x7B: types.Add( typeof( SacrificialAltarDeed ) ); cliloc = 1074818; break; + + // broken furniture + case 0x7C: types.Add( typeof( BrokenCoveredChairDeed ) ); cliloc = 1076257; break; + case 0x7D: types.Add( typeof( BrokenBookcaseDeed ) ); cliloc = 1076258; break; + case 0x7E: types.Add( typeof( StandingBrokenChairDeed ) ); cliloc = 1076259; break; + case 0x7F: types.Add( typeof( BrokenVanityDeed ) ); cliloc = 1076260; break; + case 0x80: types.Add( typeof( BrokenChestOfDrawersDeed ) ); cliloc = 1076261; break; + case 0x81: types.Add( typeof( BrokenArmoireDeed ) ); cliloc = 1076262; break; + case 0x82: types.Add( typeof( BrokenBedDeed ) ); cliloc = 1076263; break; + case 0x83: types.Add( typeof( BrokenFallenChairDeed ) ); cliloc = 1076264; break; + + // other + case 0x84: types.Add( typeof( SuitOfGoldArmorDeed ) ); cliloc = 1076265; break; + case 0x85: types.Add( typeof( SuitOfSilverArmorDeed ) ); cliloc = 1076266; break; + case 0x86: types.Add( typeof( BoilingCauldronDeed ) ); cliloc = 1076267; break; + case 0x87: types.Add( typeof( GuillotineDeed ) ); cliloc = 1024656; break; + case 0x88: types.Add( typeof( CherryBlossomTreeDeed ) ); cliloc = 1076268; break; + case 0x89: types.Add( typeof( AppleTreeDeed ) ); cliloc = 1076269; break; + case 0x8A: types.Add( typeof( PeachTreeDeed ) ); cliloc = 1076270; break; + case 0x8B: types.Add( typeof( HangingAxesDeed ) ); cliloc = 1076271; break; + case 0x8C: types.Add( typeof( HangingSwordsDeed ) ); cliloc = 1076272; break; + case 0x8D: types.Add( typeof( BlueFancyRugDeed ) ); cliloc = 1076273; break; + case 0x8E: types.Add( typeof( WoodenCoffinDeed ) ); cliloc = 1076274; break; + case 0x8F: types.Add( typeof( VanityDeed ) ); cliloc = 1074027; break; + case 0x90: types.Add( typeof( TableWithPurpleClothDeed ) ); cliloc = 1076635; break; + case 0x91: types.Add( typeof( TableWithBlueClothDeed ) ); cliloc = 1076636; break; + case 0x92: types.Add( typeof( TableWithRedClothDeed ) ); cliloc = 1076637; break; + case 0x93: types.Add( typeof( TableWithOrangeClothDeed ) ); cliloc = 1076638; break; + case 0x94: types.Add( typeof( UnmadeBedDeed ) ); cliloc = 1076279; break; + case 0x95: types.Add( typeof( CurtainsDeed ) ); cliloc = 1076280; break; + case 0x96: types.Add( typeof( ScarecrowDeed ) ); cliloc = 1076281; break; + case 0x97: types.Add( typeof( WallTorchDeed ) ); cliloc = 1076282; break; + case 0x98: types.Add( typeof( FountainDeed ) ); cliloc = 1076283; break; + case 0x99: types.Add( typeof( StoneStatueDeed ) ); cliloc = 1076284; break; + case 0x9A: types.Add( typeof( LargeFishingNetDeed ) ); cliloc = 1076285; break; + case 0x9B: types.Add( typeof( SmallFishingNetDeed ) ); cliloc = 1076286; break; + case 0x9C: types.Add( typeof( HouseLadderDeed ) ); cliloc = 1076287; break; + case 0x9D: types.Add( typeof( IronMaidenDeed ) ); cliloc = 1076288; break; + case 0x9E: types.Add( typeof( BluePlainRugDeed ) ); cliloc = 1076585; break; + case 0x9F: types.Add( typeof( GoldenDecorativeRugDeed ) ); cliloc = 1076586; break; + case 0xA0: types.Add( typeof( CinnamonFancyRugDeed ) ); cliloc = 1076587; break; + case 0xA1: types.Add( typeof( RedPlainRugDeed ) ); cliloc = 1076588; break; + case 0xA2: types.Add( typeof( BlueDecorativeRugDeed ) ); cliloc = 1076589; break; + case 0xA3: types.Add( typeof( PinkFancyRugDeed ) ); cliloc = 1076590; break; + case 0xA4: types.Add( typeof( CherryBlossomTrunkDeed ) ); cliloc = 1076784; break; + case 0xA5: types.Add( typeof( AppleTrunkDeed ) ); cliloc = 1076785; break; + case 0xA6: types.Add( typeof( PeachTrunkDeed ) ); cliloc = 1076786; break; + } + + if ( types.Count > 0 && cliloc > 0 ) + { + sender.Mobile.CloseGump( typeof( ConfirmHeritageGump ) ); + sender.Mobile.SendGump( new ConfirmHeritageGump( m_Token, types.ToArray(), cliloc ) ); + } + else + sender.Mobile.SendLocalizedMessage( 501311 ); // This option is currently disabled, while we evaluate it for game balance. + } + } +} diff --git a/Scripts/Items/Addons/AddonContainerComponent.cs b/Scripts/Items/Addons/AddonContainerComponent.cs new file mode 100644 index 000000000..c6c93a360 --- /dev/null +++ b/Scripts/Items/Addons/AddonContainerComponent.cs @@ -0,0 +1,171 @@ +using System; +using System.Collections.Generic; +using Server; +using Server.ContextMenus; + +namespace Server.Items +{ + public class AddonContainerComponent : Item, IChopable + { + public virtual bool NeedsWall { get { return false; } } + public virtual Point3D WallPosition { get { return Point3D.Zero; } } + + private Point3D m_Offset; + private BaseAddonContainer m_Addon; + + [CommandProperty( AccessLevel.GameMaster )] + public BaseAddonContainer Addon + { + get { return m_Addon; } + set { m_Addon = value; } + } + + [CommandProperty( AccessLevel.GameMaster )] + public Point3D Offset + { + get { return m_Offset; } + set { m_Offset = value; } + } + + [Hue, CommandProperty( AccessLevel.GameMaster )] + public override int Hue + { + get { return base.Hue; } + set + { + base.Hue = value; + + if ( m_Addon != null && m_Addon.ShareHue ) + m_Addon.Hue = value; + } + } + + [Constructable] + public AddonContainerComponent( int itemID ) : base( itemID ) + { + Movable = false; + + AddonComponent.ApplyLightTo( this ); + } + + public AddonContainerComponent( Serial serial ) : base( serial ) + { + } + + public override bool OnDragDrop( Mobile from, Item dropped ) + { + if ( Addon != null ) + return Addon.OnDragDrop( from, dropped ); + + return false; + } + + public override void OnDoubleClick( Mobile from ) + { + if ( m_Addon != null ) + m_Addon.OnComponentUsed( this, from ); + } + + public override void OnLocationChange( Point3D old ) + { + if ( m_Addon != null ) + m_Addon.Location = new Point3D( X - m_Offset.X, Y - m_Offset.Y, Z - m_Offset.Z ); + } + + public override void GetContextMenuEntries( Mobile from, List list ) + { + if ( m_Addon != null ) + m_Addon.GetContextMenuEntries( from, list ); + } + + public override void OnMapChange() + { + if ( m_Addon != null ) + m_Addon.Map = Map; + } + + public override void OnAfterDelete() + { + base.OnAfterDelete(); + + if ( m_Addon != null ) + m_Addon.Delete(); + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.Write( (int) 0 ); // version + + writer.Write( m_Addon ); + writer.Write( m_Offset ); + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + int version = reader.ReadInt(); + + m_Addon = reader.ReadItem() as BaseAddonContainer; + m_Offset = reader.ReadPoint3D(); + + if ( m_Addon != null ) + m_Addon.OnComponentLoaded( this ); + + AddonComponent.ApplyLightTo( this ); + } + + public virtual void OnChop( Mobile from ) + { + if ( m_Addon != null && from.InRange( GetWorldLocation(), 3 ) ) + m_Addon.OnChop( from ); + else + from.SendLocalizedMessage( 500446 ); // That is too far away. + } + } + + public class LocalizedContainerComponent : AddonContainerComponent + { + private int m_LabelNumber; + + public override int LabelNumber + { + get + { + if ( m_LabelNumber > 0 ) + return m_LabelNumber; + + return base.LabelNumber; + } + } + + public LocalizedContainerComponent( int itemID, int labelNumber ) : base( itemID ) + { + m_LabelNumber = labelNumber; + } + + public LocalizedContainerComponent( Serial serial ) : base( serial ) + { + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.Write( (int) 0 ); // version + + writer.Write( m_LabelNumber ); + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + int version = reader.ReadInt(); + + m_LabelNumber = reader.ReadInt(); + } + } +} diff --git a/Scripts/Items/Addons/BaseAddon.cs b/Scripts/Items/Addons/BaseAddon.cs index 75d40890b..168288fb9 100644 --- a/Scripts/Items/Addons/BaseAddon.cs +++ b/Scripts/Items/Addons/BaseAddon.cs @@ -13,7 +13,8 @@ namespace Server.Items Blocked, NotInHouse, DoorTooClose, - NoWall + NoWall, + DoorsNotClosed } public interface IAddon diff --git a/Scripts/Items/Addons/BaseAddonContainer.cs b/Scripts/Items/Addons/BaseAddonContainer.cs new file mode 100644 index 000000000..c871f66f6 --- /dev/null +++ b/Scripts/Items/Addons/BaseAddonContainer.cs @@ -0,0 +1,307 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using Server; +using Server.Multis; +using Server.Regions; + +namespace Server.Items +{ + public abstract class BaseAddonContainer : BaseContainer, IChopable, IAddon + { + public override bool DisplayWeight { get { return false; } } + + [Hue, CommandProperty( AccessLevel.GameMaster )] + public override int Hue + { + get + { + return base.Hue; + } + set + { + if ( base.Hue != value ) + { + base.Hue = value; + + if ( !Deleted && this.ShareHue && m_Components != null ) + { + Hue = value; + + foreach ( AddonContainerComponent c in m_Components ) + c.Hue = value; + } + } + } + } + + private CraftResource m_Resource; + + [CommandProperty( AccessLevel.GameMaster )] + public CraftResource Resource + { + get { return m_Resource; } + set + { + if ( m_Resource != value ) + { + m_Resource = value; + Hue = CraftResources.GetHue( m_Resource ); + + InvalidateProperties(); + } + } + } + + Item IAddon.Deed + { + get { return this.Deed; } + } + + public virtual bool RetainDeedHue { get { return false; } } + public virtual bool NeedsWall { get { return false; } } + public virtual bool ShareHue { get { return true; } } + public virtual Point3D WallPosition { get { return Point3D.Zero; } } + public virtual BaseAddonContainerDeed Deed { get { return null; } } + + private List m_Components; + + public List Components + { + get { return m_Components; } + } + + public BaseAddonContainer( int itemID ) : base( itemID ) + { + AddonComponent.ApplyLightTo( this ); + + m_Components = new List(); + } + + public BaseAddonContainer( Serial serial ) : base( serial ) + { + } + + public override void OnLocationChange( Point3D oldLoc ) + { + base.OnLocationChange( oldLoc ); + + if ( Deleted ) + return; + + foreach ( AddonContainerComponent c in m_Components ) + c.Location = new Point3D( X + c.Offset.X, Y + c.Offset.Y, Z + c.Offset.Z ); + } + + public override void OnMapChange() + { + base.OnMapChange(); + + if ( Deleted ) + return; + + foreach ( AddonContainerComponent c in m_Components ) + c.Map = Map; + } + + public override void OnDelete() + { + BaseHouse house = BaseHouse.FindHouseAt( this ); + + if ( house != null ) + house.Addons.Remove( this ); + + base.OnDelete(); + } + + public override void GetProperties( ObjectPropertyList list ) + { + base.GetProperties( list ); + + if ( !CraftResources.IsStandard( m_Resource ) ) + list.Add( CraftResources.GetLocalizationNumber( m_Resource ) ); + } + + public override void OnAfterDelete() + { + base.OnAfterDelete(); + + foreach ( AddonContainerComponent c in m_Components ) + c.Delete(); + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.Write( (int) 0 ); // version + + writer.WriteItemList( m_Components ); + writer.Write( (int) m_Resource ); + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + int version = reader.ReadInt(); + + m_Components = reader.ReadStrongItemList(); + m_Resource = (CraftResource) reader.ReadInt(); + + AddonComponent.ApplyLightTo( this ); + } + + public void DropItemsToGround() + { + for ( int i = Items.Count - 1; i >= 0; i-- ) + Items[ i ].MoveToWorld( Location ); + } + + public void AddComponent( AddonContainerComponent c, int x, int y, int z ) + { + if ( Deleted ) + return; + + m_Components.Add( c ); + + c.Addon = this; + c.Offset = new Point3D( x, y, z ); + c.MoveToWorld( new Point3D( X + x, Y + y, Z + z ), Map ); + } + + public AddonFitResult CouldFit( IPoint3D p, Map map, Mobile from, ref BaseHouse house ) + { + if ( Deleted ) + return AddonFitResult.Blocked; + + foreach ( AddonContainerComponent c in m_Components ) + { + Point3D p3D = new Point3D( p.X + c.Offset.X, p.Y + c.Offset.Y, p.Z + c.Offset.Z ); + + if ( !map.CanFit( p3D.X, p3D.Y, p3D.Z, c.ItemData.Height, false, true, ( c.Z == 0 ) ) ) + return AddonFitResult.Blocked; + else if ( !BaseAddon.CheckHouse( from, p3D, map, c.ItemData.Height, ref house ) ) + return AddonFitResult.NotInHouse; + + if ( c.NeedsWall ) + { + Point3D wall = c.WallPosition; + + if ( !BaseAddon.IsWall( p3D.X + wall.X, p3D.Y + wall.Y, p3D.Z + wall.Z, map ) ) + return AddonFitResult.NoWall; + } + } + + Point3D p3 = new Point3D( p.X, p.Y, p.Z ); + + if ( !map.CanFit( p3.X, p3.Y, p3.Z, ItemData.Height, false, true, ( Z == 0 ) ) ) + return AddonFitResult.Blocked; + else if ( !BaseAddon.CheckHouse( from, p3, map, ItemData.Height, ref house ) ) + return AddonFitResult.NotInHouse; + + if ( NeedsWall ) + { + Point3D wall = WallPosition; + + if ( !BaseAddon.IsWall( p3.X + wall.X, p3.Y + wall.Y, p3.Z + wall.Z, map ) ) + return AddonFitResult.NoWall; + } + + if ( house != null ) + { + ArrayList doors = house.Doors; + + for ( int i = 0; i < doors.Count; ++i ) + { + BaseDoor door = doors[ i ] as BaseDoor; + + if ( door != null && door.Open ) + return AddonFitResult.DoorsNotClosed; + + Point3D doorLoc = door.GetWorldLocation(); + int doorHeight = door.ItemData.CalcHeight; + + foreach ( AddonContainerComponent c in m_Components ) + { + Point3D addonLoc = new Point3D( p.X + c.Offset.X, p.Y + c.Offset.Y, p.Z + c.Offset.Z ); + int addonHeight = c.ItemData.CalcHeight; + + if ( Utility.InRange( doorLoc, addonLoc, 1 ) && ( addonLoc.Z == doorLoc.Z || ( ( addonLoc.Z + addonHeight ) > doorLoc.Z && ( doorLoc.Z + doorHeight ) > addonLoc.Z ) ) ) + return AddonFitResult.DoorTooClose; + } + + Point3D addonLo = new Point3D( p.X, p.Y, p.Z ); + int addonHeigh = ItemData.CalcHeight; + + if ( Utility.InRange( doorLoc, addonLo, 1 ) && ( addonLo.Z == doorLoc.Z || ( ( addonLo.Z + addonHeigh ) > doorLoc.Z && ( doorLoc.Z + doorHeight ) > addonLo.Z ) ) ) + return AddonFitResult.DoorTooClose; + } + } + + return AddonFitResult.Valid; + } + + public bool CouldFit( IPoint3D p, Map map ) + { + BaseHouse house = null; + + return ( CouldFit( p, map, null, ref house ) == AddonFitResult.Valid ); + } + + public virtual void OnChop( Mobile from ) + { + BaseHouse house = BaseHouse.FindHouseAt( this ); + + if ( house != null && house.IsOwner( from ) ) + { + if ( !IsSecure ) + { + Effects.PlaySound( GetWorldLocation(), Map, 0x3B3 ); + from.SendLocalizedMessage( 500461 ); // You destroy the item. + + int hue = 0; + + if ( RetainDeedHue ) + { + for ( int i = 0; hue == 0 && i < m_Components.Count; ++i ) + { + AddonContainerComponent c = m_Components[ i ]; + + if ( c.Hue != 0 ) + hue = c.Hue; + } + } + + DropItemsToGround(); + + Delete(); + + house.Addons.Remove( this ); + + BaseAddonContainerDeed deed = Deed; + + if ( deed != null ) + { + deed.Resource = Resource; + + if ( RetainDeedHue ) + deed.Hue = hue; + + from.AddToBackpack( deed ); + } + } + else + from.SendLocalizedMessage( 1074870 ); // This item must be unlocked/unsecured before re-deeding it. + } + } + + public virtual void OnComponentLoaded( AddonContainerComponent c ) + { + } + + public virtual void OnComponentUsed( AddonContainerComponent c, Mobile from ) + { + } + } +} diff --git a/Scripts/Items/Addons/BaseAddonContainerDeed.cs b/Scripts/Items/Addons/BaseAddonContainerDeed.cs new file mode 100644 index 000000000..a44320ccc --- /dev/null +++ b/Scripts/Items/Addons/BaseAddonContainerDeed.cs @@ -0,0 +1,165 @@ +using System; + +using Server; +using Server.Multis; +using Server.Targeting; +using Server.Engines.Craft; + +namespace Server.Items +{ + [Flipable( 0x14F0, 0x14EF )] + public abstract class BaseAddonContainerDeed : Item, ICraftable + { + public abstract BaseAddonContainer Addon{ get; } + + private CraftResource m_Resource; + + [CommandProperty( AccessLevel.GameMaster )] + public CraftResource Resource + { + get{ return m_Resource; } + set + { + if ( m_Resource != value ) + { + m_Resource = value; + Hue = CraftResources.GetHue( m_Resource ); + + InvalidateProperties(); + } + } + } + + public BaseAddonContainerDeed() : base( 0x14F0 ) + { + Weight = 1.0; + + if ( !Core.AOS ) + LootType = LootType.Newbied; + } + + public BaseAddonContainerDeed( Serial serial ) : base( serial ) + { + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.Write( (int) 1 ); // version + + // version 1 + writer.Write( (int) m_Resource ); + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + int version = reader.ReadInt(); + + switch ( version ) + { + case 1: + m_Resource = (CraftResource) reader.ReadInt(); + break; + } + } + + public override void OnDoubleClick( Mobile from ) + { + if ( IsChildOf( from.Backpack ) ) + from.Target = new InternalTarget( this ); + else + from.SendLocalizedMessage( 1062334 ); // This item must be in your backpack to be used. + } + + public override void GetProperties( ObjectPropertyList list ) + { + base.GetProperties( list ); + + if ( !CraftResources.IsStandard( m_Resource ) ) + list.Add( CraftResources.GetLocalizationNumber( m_Resource ) ); + } + + #region ICraftable + public virtual int OnCraft( int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue ) + { + Type resourceType = typeRes; + + if ( resourceType == null ) + resourceType = craftItem.Resources.GetAt( 0 ).ItemType; + + Resource = CraftResources.GetFromType( resourceType ); + + CraftContext context = craftSystem.GetContext( from ); + + if ( context != null && context.DoNotColor ) + Hue = 0; + + return quality; + } + #endregion + + private class InternalTarget : Target + { + private BaseAddonContainerDeed m_Deed; + + public InternalTarget( BaseAddonContainerDeed deed ) : base( -1, true, TargetFlags.None ) + { + m_Deed = deed; + + CheckLOS = false; + } + + protected override void OnTarget( Mobile from, object targeted ) + { + IPoint3D p = targeted as IPoint3D; + Map map = from.Map; + + if ( p == null || map == null || m_Deed.Deleted ) + return; + + if ( m_Deed.IsChildOf( from.Backpack ) ) + { + BaseAddonContainer addon = m_Deed.Addon; + addon.Resource = m_Deed.Resource; + + Server.Spells.SpellHelper.GetSurfaceTop( ref p ); + + BaseHouse house = null; + + AddonFitResult res = addon.CouldFit( p, map, from, ref house ); + + if ( res == AddonFitResult.Valid ) + addon.MoveToWorld( new Point3D( p ), map ); + else if ( res == AddonFitResult.Blocked ) + from.SendLocalizedMessage( 500269 ); // You cannot build that there. + else if ( res == AddonFitResult.NotInHouse ) + from.SendLocalizedMessage( 500274 ); // You can only place this in a house that you own! + else if ( res == AddonFitResult.DoorsNotClosed ) + from.SendMessage( "You must close all house doors before placing this." ); + else if ( res == AddonFitResult.DoorTooClose ) + from.SendLocalizedMessage( 500271 ); // You cannot build near the door. + else if ( res == AddonFitResult.NoWall ) + from.SendLocalizedMessage( 500268 ); // This object needs to be mounted on something. + + if ( res == AddonFitResult.Valid ) + { + m_Deed.Delete(); + house.Addons.Add( addon ); + house.AddSecure( from, addon ); + } + else + { + addon.Delete(); + } + } + else + { + from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it. + } + } + } + } +} diff --git a/Scripts/Items/Minor Artifacts/ML/BloodwoodSpirit.cs b/Scripts/Items/Minor Artifacts/ML/BloodwoodSpirit.cs new file mode 100644 index 000000000..84a52d513 --- /dev/null +++ b/Scripts/Items/Minor Artifacts/ML/BloodwoodSpirit.cs @@ -0,0 +1,43 @@ +using System; +using Server; + +namespace Server.Items +{ + public class BloodwoodSpirit : BaseTalisman + { + public override int LabelNumber{ get{ return 1075034; } } // Bloodwood Spirit + public override bool ForceShowName{ get{ return true; } } + + [Constructable] + public BloodwoodSpirit() : base( 0x2F5A ) + { + Hue = 0x27; + MaxChargeTime = 1200; + + Removal = TalismanRemoval.Damage; + Blessed = GetRandomBlessed(); + Protection = GetRandomProtection(); + + SkillBonuses.SetValues( 0, SkillName.SpiritSpeak, 10.0 ); + SkillBonuses.SetValues( 1, SkillName.Necromancy, 5.0 ); + } + + public BloodwoodSpirit( 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/Minor Artifacts/ML/TotemOfVoid.cs b/Scripts/Items/Minor Artifacts/ML/TotemOfVoid.cs new file mode 100644 index 000000000..2b220c66b --- /dev/null +++ b/Scripts/Items/Minor Artifacts/ML/TotemOfVoid.cs @@ -0,0 +1,48 @@ +using System; +using Server; +using Server.Mobiles; + +namespace Server.Items +{ + public class TotemOfVoid : BaseTalisman + { + public override int LabelNumber{ get{ return 1075035; } } // Totem of the Void + public override bool ForceShowName{ get{ return true; } } + + [Constructable] + public TotemOfVoid() : base( 0x2F5B ) + { + Hue = 0x2D0; + MaxChargeTime = 1800; + + Blessed = GetRandomBlessed(); + Protection = GetRandomProtection(); + + Attributes.RegenHits = 2; + Attributes.LowerManaCost = 10; + } + + public TotemOfVoid( Serial serial ) : base( serial ) + { + } + + public override Type GetSummoner() + { + return Utility.RandomBool() ? typeof( SummonedSkeletalKnight ) : typeof( SummonedSheep ); + } + + 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/Misc/FlipableAddonAttribute.cs b/Scripts/Items/Misc/FlipableAddonAttribute.cs new file mode 100644 index 000000000..d03997fd5 --- /dev/null +++ b/Scripts/Items/Misc/FlipableAddonAttribute.cs @@ -0,0 +1,130 @@ +using System; +using System.Reflection; +using System.Collections.Generic; +using Server.Multis; + +namespace Server.Items +{ + [AttributeUsage( AttributeTargets.Class )] + public class FlipableAddonAttribute : Attribute + { + private static string m_MethodName = "Flip"; + + private static Type[] m_Params = new Type[] + { + typeof( Mobile ), typeof( Direction ) + }; + + private Direction[] m_Directions; + + public Direction[] Directions + { + get { return m_Directions; } + } + + public FlipableAddonAttribute( params Direction[] directions ) + { + m_Directions = directions; + } + + public virtual void Flip( Mobile from, Item addon ) + { + if ( m_Directions != null && m_Directions.Length > 1 ) + { + try + { + MethodInfo flipMethod = addon.GetType().GetMethod( m_MethodName, m_Params ); + + if ( flipMethod != null ) + { + int index = 0; + + for ( int i = 0; i < m_Directions.Length; i++ ) + { + if ( addon.Direction == m_Directions[ i ] ) + { + index = i + 1; + break; + } + } + + if ( index >= m_Directions.Length ) + index = 0; + + ClearComponents( addon ); + + flipMethod.Invoke( addon, new object[ 2 ] { from, m_Directions[ index ] } ); + + BaseHouse house = null; + AddonFitResult result = AddonFitResult.Valid; + + addon.Map = Map.Internal; + + if ( addon is BaseAddon ) + result = ( (BaseAddon) addon ).CouldFit( addon.Location, from.Map, from, ref house ); + else if ( addon is BaseAddonContainer ) + result = ( (BaseAddonContainer) addon ).CouldFit( addon.Location, from.Map, from, ref house ); + + addon.Map = from.Map; + + if ( result != AddonFitResult.Valid ) + { + if ( index == 0 ) + index = m_Directions.Length - 1; + else + index -= 1; + + ClearComponents( addon ); + + flipMethod.Invoke( addon, new object[ 2 ] { from, m_Directions[ index ] } ); + + if ( result == AddonFitResult.Blocked ) + from.SendLocalizedMessage( 500269 ); // You cannot build that there. + else if ( result == AddonFitResult.NotInHouse ) + from.SendLocalizedMessage( 500274 ); // You can only place this in a house that you own! + else if ( result == AddonFitResult.DoorsNotClosed ) + from.SendMessage( "You must close all house doors before placing this." ); + else if ( result == AddonFitResult.DoorTooClose ) + from.SendLocalizedMessage( 500271 ); // You cannot build near the door. + else if ( result == AddonFitResult.NoWall ) + from.SendLocalizedMessage( 500268 ); // This object needs to be mounted on something. + } + + addon.Direction = m_Directions[ index ]; + } + } + catch + { + } + } + } + + private void ClearComponents( Item item ) + { + if ( item is BaseAddon ) + { + BaseAddon addon = (BaseAddon) item; + + foreach ( AddonComponent c in addon.Components ) + { + c.Addon = null; + c.Delete(); + } + + addon.Components.Clear(); + } + else if ( item is BaseAddonContainer ) + { + BaseAddonContainer addon = (BaseAddonContainer) item; + + foreach ( AddonContainerComponent c in addon.Components ) + { + c.Addon = null; + c.Delete(); + } + + addon.Components.Clear(); + } + } + } +} diff --git a/Scripts/Items/Misc/InteriorDecorator.cs b/Scripts/Items/Misc/InteriorDecorator.cs index 86bb8c028..30b630744 100644 --- a/Scripts/Items/Misc/InteriorDecorator.cs +++ b/Scripts/Items/Misc/InteriorDecorator.cs @@ -157,10 +157,42 @@ namespace Server.Items bool isDecorableComponent = false; - if ( item is AddonComponent ) - if ( ((AddonComponent)item).Addon.Components.Count == 1 && Core.SE ) + if ( item is AddonComponent || item is AddonContainerComponent || item is BaseAddonContainer ) + { + object addon = null; + int count = 0; + + if ( item is AddonComponent ) + { + AddonComponent component = (AddonComponent) item; + count = component.Addon.Components.Count; + addon = component.Addon; + } + else if ( item is AddonContainerComponent ) + { + AddonContainerComponent component = (AddonContainerComponent) item; + count = component.Addon.Components.Count; + addon = component.Addon; + } + else if ( item is BaseAddonContainer ) + { + BaseAddonContainer container = (BaseAddonContainer) item; + count = container.Components.Count; + addon = container; + } + + if ( count == 1 && Core.SE ) isDecorableComponent = true; + if ( m_Decorator.Command == DecorateCommand.Turn ) + { + FlipableAddonAttribute[] attributes = (FlipableAddonAttribute[]) addon.GetType().GetCustomAttributes( typeof( FlipableAddonAttribute ), false ); + + if ( attributes.Length > 0 ) + isDecorableComponent = true; + } + } + if ( house == null || !house.IsCoOwner( from ) ) { from.SendLocalizedMessage( 502092 ); // You must be in your house to do this. @@ -208,10 +240,30 @@ namespace Server.Items private static void Turn( Item item, Mobile from ) { - FlipableAttribute[] attributes = (FlipableAttribute[])item.GetType().GetCustomAttributes( typeof( FlipableAttribute ), false ); + if ( item is AddonComponent || item is AddonContainerComponent || item is BaseAddonContainer ) + { + object addon = null; - if( attributes.Length > 0 ) - attributes[0].Flip( item ); + if ( item is AddonComponent ) + addon = ((AddonComponent) item).Addon; + else if ( item is AddonContainerComponent ) + addon = ((AddonContainerComponent) item).Addon; + else if ( item is BaseAddonContainer ) + addon = (BaseAddonContainer) item; + + FlipableAddonAttribute[] aAttributes = (FlipableAddonAttribute[]) addon.GetType().GetCustomAttributes( typeof( FlipableAddonAttribute ), false ); + + if ( aAttributes.Length > 0 ) + { + aAttributes[ 0 ].Flip( from, (Item) addon ); + return; + } + } + + FlipableAttribute[] attributes = (FlipableAttribute[]) item.GetType().GetCustomAttributes( typeof( FlipableAttribute ), false ); + + if ( attributes.Length > 0 ) + attributes[ 0 ].Flip( item ); else from.SendLocalizedMessage( 1042273 ); // You cannot turn that. } diff --git a/Scripts/Items/Skill Items/Misc/Bandage.cs b/Scripts/Items/Skill Items/Misc/Bandage.cs index 627bd84ef..5c765e664 100644 --- a/Scripts/Items/Skill Items/Misc/Bandage.cs +++ b/Scripts/Items/Skill Items/Misc/Bandage.cs @@ -34,7 +34,7 @@ namespace Server.Items { } - public bool Dye( Mobile from, DyeTub sender ) + public virtual bool Dye( Mobile from, DyeTub sender ) { if ( Deleted ) return false; diff --git a/Scripts/Items/Special/8th Anniversary Items/Dawn's Music Box/DawnsMusicBox.cs b/Scripts/Items/Special/8th Anniversary Items/Dawn's Music Box/DawnsMusicBox.cs new file mode 100644 index 000000000..229843178 --- /dev/null +++ b/Scripts/Items/Special/8th Anniversary Items/Dawn's Music Box/DawnsMusicBox.cs @@ -0,0 +1,315 @@ +using System; +using System.Collections.Generic; +using Server.ContextMenus; +using Server.Gumps; +using Server.Multis; +using Server.Network; + +namespace Server.Items +{ + public sealed class StopMusic : Packet + { + public static readonly Packet Instance = Packet.SetStatic( new StopMusic() ); + + public StopMusic() : base( 0x6D, 3 ) + { + m_Stream.Write( (short) 0x1FFF ); + } + } + + [Flipable( 0x2AF9, 0x2AFD )] + public class DawnsMusicBox : Item, ISecurable + { + public override int LabelNumber { get { return 1075198; } } // Dawn’s Music Box + + private List m_Tracks; + + public List Tracks + { + get { return m_Tracks; } + } + + private SecureLevel m_Level; + + [CommandProperty( AccessLevel.GameMaster )] + public SecureLevel Level + { + get { return m_Level; } + set { m_Level = value; } + } + + [Constructable] + public DawnsMusicBox() : base( 0x2AF9 ) + { + Weight = 1.0; + + m_Tracks = new List(); + + while ( m_Tracks.Count < 4 ) + { + MusicName name = RandomTrack( DawnsMusicRarity.Common ); + + if ( !m_Tracks.Contains( name ) ) + m_Tracks.Add( name ); + } + } + + public DawnsMusicBox( Serial serial ) : base( serial ) + { + } + + public override void OnAfterDuped( Item newItem ) + { + DawnsMusicBox box = newItem as DawnsMusicBox; + + if ( box == null ) + return; + + box.m_Tracks = new List(); + box.m_Tracks.AddRange( m_Tracks ); + } + + public override void GetProperties( ObjectPropertyList list ) + { + base.GetProperties( list ); + + int commonSongs = 0; + int uncommonSongs = 0; + int rareSongs = 0; + + for ( int i = 0; i < m_Tracks.Count; i++ ) + { + DawnsMusicInfo info = GetInfo( m_Tracks[ i ] ); + + switch ( info.Rarity ) + { + case DawnsMusicRarity.Common: commonSongs++; break; + case DawnsMusicRarity.Uncommon: uncommonSongs++; break; + case DawnsMusicRarity.Rare: rareSongs++; break; + } + } + + if ( commonSongs > 0 ) + list.Add( 1075234, commonSongs.ToString() ); // ~1_NUMBER~ Common Tracks + if ( uncommonSongs > 0 ) + list.Add( 1075235, uncommonSongs.ToString() ); // ~1_NUMBER~ Uncommon Tracks + if ( rareSongs > 0 ) + list.Add( 1075236, rareSongs.ToString() ); // ~1_NUMBER~ Rare Tracks + } + + public override void GetContextMenuEntries( Mobile from, List list ) + { + base.GetContextMenuEntries( from, list ); + + SetSecureLevelEntry.AddTo( from, this, list ); // Set secure level + } + + public override void OnDoubleClick( Mobile from ) + { + if ( !IsChildOf( from.Backpack ) && !IsLockedDown ) + from.SendLocalizedMessage( 1061856 ); // You must have the item in your backpack or locked down in order to use it. + else if ( IsLockedDown && !HasAccces( from ) ) + from.SendLocalizedMessage( 502436 ); // That is not accessible. + else + { + from.CloseGump( typeof( DawnsMusicBoxGump ) ); + from.SendGump( new DawnsMusicBoxGump( this ) ); + } + } + + public bool HasAccces( Mobile m ) + { + if ( m.AccessLevel >= AccessLevel.GameMaster ) + return true; + + BaseHouse house = BaseHouse.FindHouseAt( this ); + + return ( house != null && house.HasAccess( m ) ); + } + + private Timer m_Timer; + private int m_ItemID = 0; + private int m_Count = 0; + + public void PlayMusic( Mobile m, MusicName music ) + { + if ( m_Timer != null && m_Timer.Running ) + EndMusic( m ); + else + m_ItemID = ItemID; + + m.Send( new PlayMusic( music ) ); + m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 0.5 ), TimeSpan.FromSeconds( 0.5 ), 4, new TimerCallback( Animate ) ); + } + + public void EndMusic( Mobile m ) + { + if ( m_Timer != null && m_Timer.Running ) + m_Timer.Stop(); + + m.Send( StopMusic.Instance ); + + if ( m_Count > 0 ) + ItemID = m_ItemID; + + m_Count = 0; + } + + private void Animate() + { + m_Count++; + + if ( m_Count >= 4 ) + { + m_Count = 0; + ItemID = m_ItemID; + } + else + ItemID++; + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.WriteEncodedInt( 0 ); // version + + writer.Write( (int) m_Tracks.Count ); + + for ( int i = 0; i < m_Tracks.Count; i++ ) + writer.Write( (int) m_Tracks[ i ] ); + + writer.Write( (int) m_Level ); + writer.Write( (int) m_ItemID ); + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + int version = reader.ReadEncodedInt(); + + int count = reader.ReadInt(); + m_Tracks = new List(); + + for ( int i = 0; i < count; i++ ) + m_Tracks.Add( (MusicName) reader.ReadInt() ); + + m_Level = (SecureLevel) reader.ReadInt(); + m_ItemID = reader.ReadInt(); + } + + private static Dictionary m_Info = new Dictionary(); + + public static void Initialize() + { + m_Info.Add( MusicName.Samlethe, new DawnsMusicInfo( 1075152, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.Sailing, new DawnsMusicInfo( 1075163, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.Britain2, new DawnsMusicInfo( 1075145, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.Britain1, new DawnsMusicInfo( 1075144, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.Bucsden, new DawnsMusicInfo( 1075146, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.Forest_a, new DawnsMusicInfo( 1075161, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.Cove, new DawnsMusicInfo( 1075176, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.Death, new DawnsMusicInfo( 1075171, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.Dungeon9, new DawnsMusicInfo( 1075160, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.Dungeon2, new DawnsMusicInfo( 1075175, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.Cave01, new DawnsMusicInfo( 1075159, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.Combat3, new DawnsMusicInfo( 1075170, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.Combat1, new DawnsMusicInfo( 1075168, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.Combat2, new DawnsMusicInfo( 1075169, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.Jhelom, new DawnsMusicInfo( 1075147, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.Linelle, new DawnsMusicInfo( 1075185, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.LBCastle, new DawnsMusicInfo( 1075148, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.Minoc, new DawnsMusicInfo( 1075150, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.Moonglow, new DawnsMusicInfo( 1075177, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.Magincia, new DawnsMusicInfo( 1075149, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.Nujelm, new DawnsMusicInfo( 1075174, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.BTCastle, new DawnsMusicInfo( 1075173, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.Tavern04, new DawnsMusicInfo( 1075167, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.Skarabra, new DawnsMusicInfo( 1075154, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.Stones2, new DawnsMusicInfo( 1075143, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.Serpents, new DawnsMusicInfo( 1075153, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.Taiko, new DawnsMusicInfo( 1075180, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.Tavern01, new DawnsMusicInfo( 1075164, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.Tavern02, new DawnsMusicInfo( 1075165, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.Tavern03, new DawnsMusicInfo( 1075166, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.TokunoDungeon, new DawnsMusicInfo( 1075179, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.Trinsic, new DawnsMusicInfo( 1075155, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.OldUlt01, new DawnsMusicInfo( 1075142, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.Ocllo, new DawnsMusicInfo( 1075151, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.Vesper, new DawnsMusicInfo( 1075156, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.Victory, new DawnsMusicInfo( 1075172, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.Mountn_a, new DawnsMusicInfo( 1075162, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.Wind, new DawnsMusicInfo( 1075157, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.Yew, new DawnsMusicInfo( 1075158, DawnsMusicRarity.Common ) ); + m_Info.Add( MusicName.Zento, new DawnsMusicInfo( 1075178, DawnsMusicRarity.Common ) ); + + m_Info.Add( MusicName.GwennoConversation, new DawnsMusicInfo( 1075131, DawnsMusicRarity.Uncommon ) ); + m_Info.Add( MusicName.DreadHornArea, new DawnsMusicInfo( 1075181, DawnsMusicRarity.Uncommon ) ); + m_Info.Add( MusicName.ElfCity, new DawnsMusicInfo( 1075182, DawnsMusicRarity.Uncommon ) ); + m_Info.Add( MusicName.GoodEndGame, new DawnsMusicInfo( 1075132, DawnsMusicRarity.Uncommon ) ); + m_Info.Add( MusicName.GoodVsEvil, new DawnsMusicInfo( 1075133, DawnsMusicRarity.Uncommon ) ); + m_Info.Add( MusicName.GreatEarthSerpents, new DawnsMusicInfo( 1075134, DawnsMusicRarity.Uncommon ) ); + m_Info.Add( MusicName.GrizzleDungeon, new DawnsMusicInfo( 1075186, DawnsMusicRarity.Uncommon ) ); + m_Info.Add( MusicName.Humanoids_U9, new DawnsMusicInfo( 1075135, DawnsMusicRarity.Uncommon ) ); + m_Info.Add( MusicName.MelisandesLair, new DawnsMusicInfo( 1075183, DawnsMusicRarity.Uncommon ) ); + m_Info.Add( MusicName.MinocNegative, new DawnsMusicInfo( 1075136, DawnsMusicRarity.Uncommon ) ); + m_Info.Add( MusicName.ParoxysmusLair, new DawnsMusicInfo( 1075184, DawnsMusicRarity.Uncommon ) ); + m_Info.Add( MusicName.Paws, new DawnsMusicInfo( 1075137, DawnsMusicRarity.Uncommon ) ); + + m_Info.Add( MusicName.SelimsBar, new DawnsMusicInfo( 1075138, DawnsMusicRarity.Rare ) ); + m_Info.Add( MusicName.SerpentIsleCombat_U7, new DawnsMusicInfo( 1075139, DawnsMusicRarity.Rare ) ); + m_Info.Add( MusicName.ValoriaShips, new DawnsMusicInfo( 1075140, DawnsMusicRarity.Rare ) ); + } + + public static MusicName[] m_CommonTracks = new MusicName[] + { + MusicName.Samlethe, MusicName.Sailing, MusicName.Britain2, MusicName.Britain1, + MusicName.Bucsden, MusicName.Forest_a, MusicName.Cove, MusicName.Death, + MusicName.Dungeon9, MusicName.Dungeon2, MusicName.Cave01, MusicName.Combat3, + MusicName.Combat1, MusicName.Combat2, MusicName.Jhelom, MusicName.Linelle, + MusicName.LBCastle, MusicName.Minoc, MusicName.Moonglow, MusicName.Magincia, + MusicName.Nujelm, MusicName.BTCastle, MusicName.Tavern04, MusicName.Skarabra, + MusicName.Stones2, MusicName.Serpents, MusicName.Taiko, MusicName.Tavern01, + MusicName.Tavern02, MusicName.Tavern03, MusicName.TokunoDungeon, MusicName.Trinsic, + MusicName.OldUlt01, MusicName.Ocllo, MusicName.Vesper, MusicName.Victory, + MusicName.Mountn_a, MusicName.Wind, MusicName.Yew, MusicName.Zento + }; + + public static MusicName[] m_UncommonTracks = new MusicName[] + { + MusicName.GwennoConversation, MusicName.DreadHornArea, MusicName.ElfCity, + MusicName.GoodEndGame, MusicName.GoodVsEvil, MusicName.GreatEarthSerpents, + MusicName.GrizzleDungeon, MusicName.Humanoids_U9, MusicName.MelisandesLair, + MusicName.MinocNegative, MusicName.ParoxysmusLair, MusicName.Paws + }; + + public static MusicName[] m_RareTracks = new MusicName[] + { + MusicName.SelimsBar, MusicName.SerpentIsleCombat_U7, MusicName.ValoriaShips + }; + + public static DawnsMusicInfo GetInfo( MusicName name ) + { + if ( m_Info.ContainsKey( name ) ) + return m_Info[ name ]; + + return null; + } + + public static MusicName RandomTrack( DawnsMusicRarity rarity ) + { + MusicName[] list = null; + + switch ( rarity ) + { + default: + case DawnsMusicRarity.Common: list = m_CommonTracks; break; + case DawnsMusicRarity.Uncommon: list = m_UncommonTracks; break; + case DawnsMusicRarity.Rare: list = m_RareTracks; break; + } + + return list[ Utility.Random( list.Length ) ]; + } + } +} diff --git a/Scripts/Items/Special/8th Anniversary Items/Dawn's Music Box/DawnsMusicGear.cs b/Scripts/Items/Special/8th Anniversary Items/Dawn's Music Box/DawnsMusicGear.cs new file mode 100644 index 000000000..1864a62ca --- /dev/null +++ b/Scripts/Items/Special/8th Anniversary Items/Dawn's Music Box/DawnsMusicGear.cs @@ -0,0 +1,123 @@ +using System; +using Server.Targeting; + +namespace Server.Items +{ + [Flipable( 0x1053, 0x1054 )] + public class DawnsMusicGear : Item + { + public static DawnsMusicGear RandomCommon + { + get { return new DawnsMusicGear( DawnsMusicBox.RandomTrack( DawnsMusicRarity.Common ) ); } + } + + public static DawnsMusicGear RandomUncommon + { + get { return new DawnsMusicGear( DawnsMusicBox.RandomTrack( DawnsMusicRarity.Uncommon ) ); } + } + + public static DawnsMusicGear RandomRare + { + get { return new DawnsMusicGear( DawnsMusicBox.RandomTrack( DawnsMusicRarity.Rare ) ); } + } + + private MusicName m_Music; + + [CommandProperty( AccessLevel.GameMaster )] + public MusicName Music + { + get { return m_Music; } + set { m_Music = value; } + } + + [Constructable] + public DawnsMusicGear() : this( DawnsMusicBox.RandomTrack( DawnsMusicRarity.Common ) ) + { + } + + [Constructable] + public DawnsMusicGear( MusicName music ) : base( 0x1053 ) + { + m_Music = music; + + Weight = 1.0; + } + + public DawnsMusicGear( Serial serial ) : base( serial ) + { + } + + public override void AddNameProperty( ObjectPropertyList list ) + { + DawnsMusicInfo info = DawnsMusicBox.GetInfo( m_Music ); + + if ( info != null ) + { + if ( info.Rarity == DawnsMusicRarity.Common ) + list.Add( 1075204 ); // Gear for Dawn's Music Box (Common) + else if ( info.Rarity == DawnsMusicRarity.Uncommon ) + list.Add( 1075205 ); // Gear for Dawn's Music Box (Uncommon) + else if ( info.Rarity == DawnsMusicRarity.Rare ) + list.Add( 1075206 ); // Gear for Dawn's Music Box (Rare) + + list.Add( info.Name ); + } + else + base.AddNameProperty( list ); + } + + public override void OnDoubleClick( Mobile from ) + { + from.Target = new InternalTarget( this ); + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.WriteEncodedInt( (int) 0 ); // version + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + int version = reader.ReadEncodedInt(); + } + + public class InternalTarget : Target + { + private DawnsMusicGear m_Gear; + + public InternalTarget( DawnsMusicGear gear ) : base( 2, false, TargetFlags.None ) + { + m_Gear = gear; + } + + protected override void OnTarget( Mobile from, object targeted ) + { + if ( m_Gear == null || m_Gear.Deleted ) + return; + + DawnsMusicBox box = targeted as DawnsMusicBox; + + if ( box != null ) + { + if ( !box.Tracks.Contains( m_Gear.Music ) ) + { + box.Tracks.Add( m_Gear.Music ); + box.InvalidateProperties(); + + m_Gear.Delete(); + + from.SendLocalizedMessage( 1071961 ); // This song has been added to the musicbox. + } + else + from.SendLocalizedMessage( 1071962 ); // This song track is already in the musicbox. + } + else + from.SendLocalizedMessage( 1071964 ); // Gears can only be put into a musicbox. + } + } + } +} diff --git a/Scripts/Items/Special/8th Anniversary Items/Dawn's Music Box/DawnsMusicInfo.cs b/Scripts/Items/Special/8th Anniversary Items/Dawn's Music Box/DawnsMusicInfo.cs new file mode 100644 index 000000000..abcba105d --- /dev/null +++ b/Scripts/Items/Special/8th Anniversary Items/Dawn's Music Box/DawnsMusicInfo.cs @@ -0,0 +1,34 @@ +using System; + +namespace Server.Items +{ + public enum DawnsMusicRarity + { + Common, + Uncommon, + Rare, + } + + public class DawnsMusicInfo + { + private int m_Name; + + public int Name + { + get { return m_Name; } + } + + private DawnsMusicRarity m_Rarity; + + public DawnsMusicRarity Rarity + { + get { return m_Rarity; } + } + + public DawnsMusicInfo( int name, DawnsMusicRarity rarity ) + { + m_Name = name; + m_Rarity = rarity; + } + } +} diff --git a/Scripts/Items/Special/8th Anniversary Items/DupresShield.cs b/Scripts/Items/Special/8th Anniversary Items/DupresShield.cs new file mode 100644 index 000000000..936225d43 --- /dev/null +++ b/Scripts/Items/Special/8th Anniversary Items/DupresShield.cs @@ -0,0 +1,53 @@ +using System; +using Server; + +namespace Server.Items +{ + public class DupresShield : BaseShield, ITokunoDyable + { + public override int LabelNumber { get { return 1075196; } } // Dupre’s Shield + + public override int BasePhysicalResistance { get { return 1; } } + public override int BaseFireResistance { get { return 0; } } + public override int BaseColdResistance { get { return 0; } } + public override int BasePoisonResistance { get { return 0; } } + public override int BaseEnergyResistance { get { return 1; } } + + public override int InitMinHits { get { return 255; } } + public override int InitMaxHits { get { return 255; } } + + public override int AosStrReq { get { return 50; } } + + public override int ArmorBase { get { return 15; } } + + [Constructable] + public DupresShield() : base( 0x2B01 ) + { + LootType = LootType.Blessed; + Weight = 6.0; + + Attributes.BonusHits = 5; + Attributes.RegenHits = 1; + + SkillBonuses.SetValues( 0, SkillName.Parry, 5 ); + } + + public DupresShield( 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(); + } + } +} diff --git a/Scripts/Items/Special/8th Anniversary Items/FountainOfLife.cs b/Scripts/Items/Special/8th Anniversary Items/FountainOfLife.cs new file mode 100644 index 000000000..5048bf296 --- /dev/null +++ b/Scripts/Items/Special/8th Anniversary Items/FountainOfLife.cs @@ -0,0 +1,256 @@ +using System; +using Server.Multis; +using System.Collections.Generic; +using Server.Gumps; + +namespace Server.Items +{ + public class EnhancedBandage : Bandage + { + public static int HealingBonus { get { return 10; } } + + [Constructable] + public EnhancedBandage() : this( 1 ) + { + } + + [Constructable] + public EnhancedBandage( int amount ) : base( amount ) + { + Hue = 0x8A5; + } + + public EnhancedBandage( Serial serial ) : base( serial ) + { + } + + public override bool Dye( Mobile from, DyeTub sender ) + { + return false; + } + + public override void GetProperties( ObjectPropertyList list ) + { + base.GetProperties( list ); + + list.Add( 1075216 ); // these bandages have been enhanced + } + + 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(); + } + } + + [FlipableAttribute( 0x2AC0, 0x2AC3 )] + public class FountainOfLife : BaseAddonContainer + { + public override BaseAddonContainerDeed Deed + { + get { return new FountainOfLifeDeed( m_Charges ); } + } + + public virtual TimeSpan RechargeTime { get { return TimeSpan.FromDays( 1 ); } } + + public override int LabelNumber { get { return 1075197; } } // Fountain of Life + public override int DefaultGumpID { get { return 0x484; } } + public override int DefaultDropSound { get { return 66; } } + public override int DefaultMaxItems { get { return 125; } } + + private int m_Charges; + + [CommandProperty( AccessLevel.GameMaster )] + public int Charges + { + get { return m_Charges; } + set { m_Charges = Math.Min( value, 10 ); InvalidateProperties(); } + } + + private Timer m_Timer; + + [Constructable] + public FountainOfLife() : this( 10 ) + { + } + + [Constructable] + public FountainOfLife( int charges ) : base( 0x2AC0 ) + { + m_Charges = charges; + + m_Timer = Timer.DelayCall( RechargeTime, RechargeTime, new TimerCallback( Recharge ) ); + } + + public FountainOfLife( Serial serial ) : base( serial ) + { + } + + public override bool OnDragDrop( Mobile from, Item dropped ) + { + if ( dropped is Bandage ) + { + bool allow = base.OnDragDrop( from, dropped ); + + if ( allow ) + Enhance(); + + return allow; + } + else + { + from.SendLocalizedMessage( 1075209 ); // Only bandages may be dropped into the fountain. + return false; + } + } + + public override bool OnDragDropInto( Mobile from, Item item, Point3D p ) + { + if ( item is Bandage ) + { + bool allow = base.OnDragDropInto( from, item, p ); + + if ( allow ) + Enhance(); + + return allow; + } + else + { + from.SendLocalizedMessage( 1075209 ); // Only bandages may be dropped into the fountain. + return false; + } + } + + public override void GetProperties( ObjectPropertyList list ) + { + base.GetProperties( list ); + + list.Add( 1075217, m_Charges.ToString() ); // ~1_val~ charges remaining + } + + public override void OnDelete() + { + if ( m_Timer != null ) + m_Timer.Stop(); + + base.OnDelete(); + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.WriteEncodedInt( 0 ); //version + + writer.Write( m_Charges ); + writer.Write( (DateTime) m_Timer.Next ); + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + int version = reader.ReadEncodedInt(); + + m_Charges = reader.ReadInt(); + + DateTime next = reader.ReadDateTime(); + + if ( next < DateTime.Now ) + m_Timer = Timer.DelayCall( TimeSpan.Zero, RechargeTime, new TimerCallback( Recharge ) ); + else + m_Timer = Timer.DelayCall( next - DateTime.Now, RechargeTime, new TimerCallback( Recharge ) ); + } + + public void Recharge() + { + m_Charges = 10; + + Enhance(); + } + + public void Enhance() + { + for ( int i = Items.Count - 1; i >= 0 && m_Charges > 0; i-- ) + { + Bandage bandage = Items[ i ] as Bandage; + + if ( bandage != null ) + { + if ( bandage.Amount > m_Charges ) + { + bandage.Amount -= m_Charges; + DropItem( new EnhancedBandage( m_Charges ) ); + m_Charges = 0; + } + else + { + DropItem( new EnhancedBandage( bandage.Amount ) ); + m_Charges -= bandage.Amount; + bandage.Delete(); + } + + InvalidateProperties(); + } + } + } + } + + public class FountainOfLifeDeed : BaseAddonContainerDeed + { + public override int LabelNumber { get { return 1075197; } } // Fountain of Life + public override BaseAddonContainer Addon { get { return new FountainOfLife( m_Charges ); } } + + private int m_Charges; + + [CommandProperty( AccessLevel.GameMaster )] + public int Charges + { + get { return m_Charges; } + set { m_Charges = Math.Min( value, 10 ); InvalidateProperties(); } + } + + [Constructable] + public FountainOfLifeDeed() : this( 10 ) + { + } + + [Constructable] + public FountainOfLifeDeed( int charges ) : base() + { + LootType = LootType.Blessed; + m_Charges = charges; + } + + public FountainOfLifeDeed( Serial serial ) : base( serial ) + { + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.WriteEncodedInt( 0 ); //version + + writer.Write( m_Charges ); + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + int version = reader.ReadEncodedInt(); + + m_Charges = reader.ReadInt(); + } + } +} diff --git a/Scripts/Items/Special/8th Anniversary Items/OssianGrimoire.cs b/Scripts/Items/Special/8th Anniversary Items/OssianGrimoire.cs new file mode 100644 index 000000000..b9e3061bc --- /dev/null +++ b/Scripts/Items/Special/8th Anniversary Items/OssianGrimoire.cs @@ -0,0 +1,38 @@ +using System; + +namespace Server.Items +{ + public class OssianGrimoire : NecromancerSpellbook, ITokunoDyable + { + public override int LabelNumber { get { return 1078148; } } // Ossian Grimoire + + [Constructable] + public OssianGrimoire() : base() + { + LootType = LootType.Blessed; + + SkillBonuses.SetValues( 0, SkillName.Necromancy, 10.0 ); + Attributes.RegenMana = 1; + Attributes.CastSpeed = 1; + //Attributes.IncreasedKarmaLoss = 5; + } + + public OssianGrimoire( 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(); + } + } +} diff --git a/Scripts/Items/Special/8th Anniversary Items/QuiverOfInfinity.cs b/Scripts/Items/Special/8th Anniversary Items/QuiverOfInfinity.cs new file mode 100644 index 000000000..6b5609346 --- /dev/null +++ b/Scripts/Items/Special/8th Anniversary Items/QuiverOfInfinity.cs @@ -0,0 +1,40 @@ +using System; + +namespace Server.Items +{ + public class QuiverOfInfinity : BaseQuiver, ITokunoDyable + { + public override int LabelNumber { get { return 1075201; } } // Quiver of Infinity + + [Constructable] + public QuiverOfInfinity() : base( 0x2B02 ) + { + LootType = LootType.Blessed; + Weight = 8.0; + + WeightReduction = 30; + LowerAmmoCost = 20; + + Attributes.DefendChance = 5; + Attributes.WeaponDamage = 10; + } + + public QuiverOfInfinity( 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(); + } + } +} diff --git a/Scripts/Items/Special/8th Anniversary Items/Talismans.cs b/Scripts/Items/Special/8th Anniversary Items/Talismans.cs new file mode 100644 index 000000000..cede77d9f --- /dev/null +++ b/Scripts/Items/Special/8th Anniversary Items/Talismans.cs @@ -0,0 +1,187 @@ +using System; +using Server.Mobiles; +using Server.Spells.Ninjitsu; + +namespace Server.Items +{ + public enum TalismanForm + { + Ferret = 1031672, + Squirrel = 1031671, + CuSidhe = 1031670, + Reptalon = 1075202 + } + + public class BaseFormTalisman : Item, ITokunoDyable + { + public virtual TalismanForm Form { get { return TalismanForm.Squirrel; } } + + public BaseFormTalisman() : base( 0x2F59 ) + { + LootType = LootType.Blessed; + Layer = Layer.Talisman; + Weight = 1.0; + } + + public BaseFormTalisman( Serial serial ) : base( serial ) + { + } + + public override void AddNameProperty( ObjectPropertyList list ) + { + list.Add( 1075200, String.Format( "#{0}", (int) Form ) ); + } + + 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 override void OnRemoved( object parent ) + { + base.OnRemoved( parent ); + + if ( parent is Mobile ) + { + Mobile m = (Mobile) parent; + + AnimalForm.RemoveContext( m, true ); + } + } + + public static bool EntryEnabled( Mobile m, Type type ) + { + if ( type == typeof( Squirrel ) ) + return m.Talisman is SquirrelFormTalisman; + else if ( type == typeof( Ferret ) ) + return m.Talisman is FerretFormTalisman; + else if ( type == typeof( CuSidhe ) ) + return m.Talisman is CuSidheFormTalisman; + else if ( type == typeof( Reptalon ) ) + return m.Talisman is ReptalonFormTalisman; + + return true; + } + } + + public class FerretFormTalisman : BaseFormTalisman + { + public override TalismanForm Form { get { return TalismanForm.Ferret; } } + + [Constructable] + public FerretFormTalisman() : base() + { + } + + public FerretFormTalisman( 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 SquirrelFormTalisman : BaseFormTalisman + { + public override TalismanForm Form { get { return TalismanForm.Squirrel; } } + + [Constructable] + public SquirrelFormTalisman () : base() + { + } + + public SquirrelFormTalisman ( 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 CuSidheFormTalisman : BaseFormTalisman + { + public override TalismanForm Form { get { return TalismanForm.CuSidhe; } } + + [Constructable] + public CuSidheFormTalisman() : base() + { + } + + public CuSidheFormTalisman( 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 ReptalonFormTalisman : BaseFormTalisman + { + public override TalismanForm Form { get { return TalismanForm.Reptalon; } } + + [Constructable] + public ReptalonFormTalisman() : base() + { + } + + public ReptalonFormTalisman( 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(); + } + } +} diff --git a/Scripts/Items/Special/Broken Furniture Collection/BrokenArmoire.cs b/Scripts/Items/Special/Broken Furniture Collection/BrokenArmoire.cs new file mode 100644 index 000000000..5e9cc4a63 --- /dev/null +++ b/Scripts/Items/Special/Broken Furniture Collection/BrokenArmoire.cs @@ -0,0 +1,91 @@ +using System; + +namespace Server.Items +{ + [Flipable( 0xC12, 0xC13 )] + public class BrokenArmoireComponent : AddonComponent + { + public override int LabelNumber { get { return 1076262; } } // Broken Armoire + + public BrokenArmoireComponent() : base( 0xC12 ) + { + } + + public BrokenArmoireComponent( 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 BrokenArmoireAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new BrokenArmoireDeed(); } } + + [Constructable] + public BrokenArmoireAddon() : base() + { + AddComponent( new BrokenArmoireComponent(), 0, 0, 0 ); + } + + public BrokenArmoireAddon( 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 BrokenArmoireDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new BrokenArmoireAddon(); } } + public override int LabelNumber { get { return 1076262; } } // Broken Armoire + + [Constructable] + public BrokenArmoireDeed() : base() + { + LootType = LootType.Blessed; + } + + public BrokenArmoireDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Broken Furniture Collection/BrokenBed.cs b/Scripts/Items/Special/Broken Furniture Collection/BrokenBed.cs new file mode 100644 index 000000000..e66e0e1b7 --- /dev/null +++ b/Scripts/Items/Special/Broken Furniture Collection/BrokenBed.cs @@ -0,0 +1,134 @@ +using System; +using Server; +using Server.Gumps; +using Server.Network; + +namespace Server.Items +{ + public class BrokenBedAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new BrokenBedDeed(); } } + + [Constructable] + public BrokenBedAddon( bool east ) : base() + { + if ( east ) // east + { + AddComponent( new LocalizedAddonComponent( 0x1895, 1076263 ), 0, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0x1894, 1076263 ), 0, 1, 0 ); + AddComponent( new LocalizedAddonComponent( 0x1897, 1076263 ), 1, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0x1896, 1076263 ), 1, 1, 0 ); + } + else // south + { + AddComponent( new LocalizedAddonComponent( 0x1899, 1076263 ), 0, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0x1898, 1076263 ), 1, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0x189B, 1076263 ), 0, 1, 0 ); + AddComponent( new LocalizedAddonComponent( 0x189A, 1076263 ), 1, 1, 0 ); + } + } + + public BrokenBedAddon( 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 BrokenBedDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new BrokenBedAddon( m_East ); } } + public override int LabelNumber { get { return 1076263; } } // Broken Bed + + private bool m_East; + + [Constructable] + public BrokenBedDeed() : base() + { + LootType = LootType.Blessed; + } + + public BrokenBedDeed( 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( 1062334 ); // This item must be in your backpack to be used. + } + + private void SendTarget( Mobile m ) + { + base.OnDoubleClick( m ); + } + + 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 BrokenBedDeed m_Deed; + + public InternalGump( BrokenBedDeed deed ) : base( 60, 36 ) + { + m_Deed = deed; + + AddPage( 0 ); + + AddBackground( 0, 0, 273, 324, 0x13BE ); + AddImageTiled( 10, 10, 253, 20, 0xA40 ); + AddImageTiled( 10, 40, 253, 244, 0xA40 ); + AddImageTiled( 10, 294, 253, 20, 0xA40 ); + AddAlphaRegion( 10, 10, 253, 304 ); + AddButton( 10, 294, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 45, 296, 450, 20, 1060051, 0x7FFF, false, false ); // CANCEL + AddHtmlLocalized( 14, 12, 273, 20, 1076749, 0x7FFF, false, false ); // Please select your broken bed position + + AddPage( 1 ); + + AddButton( 19, 49, 0x845, 0x846, 1, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 44, 47, 213, 20, 1075386, 0x7FFF, false, false ); // South + AddButton( 19, 73, 0x845, 0x846, 2, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 44, 71, 213, 20, 1075387, 0x7FFF, false, false ); // East + } + + public override void OnResponse( NetState sender, RelayInfo info ) + { + if ( m_Deed == null || m_Deed.Deleted || info.ButtonID == 0 ) + return; + + m_Deed.m_East = ( info.ButtonID != 1 ); + m_Deed.SendTarget( sender.Mobile ); + } + } + } +} diff --git a/Scripts/Items/Special/Broken Furniture Collection/BrokenBookcase.cs b/Scripts/Items/Special/Broken Furniture Collection/BrokenBookcase.cs new file mode 100644 index 000000000..b8ba954a7 --- /dev/null +++ b/Scripts/Items/Special/Broken Furniture Collection/BrokenBookcase.cs @@ -0,0 +1,91 @@ +using System; + +namespace Server.Items +{ + [Flipable( 0xC14, 0xC15 )] + public class BrokenBookcaseComponent : AddonComponent + { + public override int LabelNumber { get { return 1076258; } } // Broken Bookcase + + public BrokenBookcaseComponent() : base( 0xC14 ) + { + } + + public BrokenBookcaseComponent( 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 BrokenBookcaseAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new BrokenBookcaseDeed(); } } + + [Constructable] + public BrokenBookcaseAddon() : base() + { + AddComponent( new BrokenBookcaseComponent(), 0, 0, 0 ); + } + + public BrokenBookcaseAddon( 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 BrokenBookcaseDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new BrokenBookcaseAddon(); } } + public override int LabelNumber { get { return 1076258; } } // Broken Bookcase + + [Constructable] + public BrokenBookcaseDeed() : base() + { + LootType = LootType.Blessed; + } + + public BrokenBookcaseDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Broken Furniture Collection/BrokenChestOfDrawers.cs b/Scripts/Items/Special/Broken Furniture Collection/BrokenChestOfDrawers.cs new file mode 100644 index 000000000..374f0ebbf --- /dev/null +++ b/Scripts/Items/Special/Broken Furniture Collection/BrokenChestOfDrawers.cs @@ -0,0 +1,91 @@ +using System; + +namespace Server.Items +{ + [Flipable( 0xC24, 0xC25 )] + public class BrokenChestOfDrawersComponent : AddonComponent + { + public override int LabelNumber { get { return 1076261; } } // Broken Chest of Drawers + + public BrokenChestOfDrawersComponent() : base( 0xC24 ) + { + } + + public BrokenChestOfDrawersComponent( 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 BrokenChestOfDrawersAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new BrokenChestOfDrawersDeed(); } } + + [Constructable] + public BrokenChestOfDrawersAddon() : base() + { + AddComponent( new BrokenChestOfDrawersComponent(), 0, 0, 0 ); + } + + public BrokenChestOfDrawersAddon( 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 BrokenChestOfDrawersDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new BrokenChestOfDrawersAddon(); } } + public override int LabelNumber { get { return 1076261; } } // Broken Chest of Drawers + + [Constructable] + public BrokenChestOfDrawersDeed() : base() + { + LootType = LootType.Blessed; + } + + public BrokenChestOfDrawersDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Broken Furniture Collection/BrokenCoveredChair.cs b/Scripts/Items/Special/Broken Furniture Collection/BrokenCoveredChair.cs new file mode 100644 index 000000000..3b72a99c0 --- /dev/null +++ b/Scripts/Items/Special/Broken Furniture Collection/BrokenCoveredChair.cs @@ -0,0 +1,91 @@ +using System; + +namespace Server.Items +{ + [Flipable( 0xC17, 0xC18 )] + public class BrokenCoveredChairComponent : AddonComponent + { + public override int LabelNumber { get { return 1076257; } } // Broken Covered Chair + + public BrokenCoveredChairComponent() : base( 0xC17 ) + { + } + + public BrokenCoveredChairComponent( 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 BrokenCoveredChairAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new BrokenCoveredChairDeed(); } } + + [Constructable] + public BrokenCoveredChairAddon() : base() + { + AddComponent( new BrokenCoveredChairComponent(), 0, 0, 0 ); + } + + public BrokenCoveredChairAddon( 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 BrokenCoveredChairDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new BrokenCoveredChairAddon(); } } + public override int LabelNumber { get { return 1076257; } } // Broken Covered Chair + + [Constructable] + public BrokenCoveredChairDeed() : base() + { + LootType = LootType.Blessed; + } + + public BrokenCoveredChairDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Broken Furniture Collection/BrokenFallenChair.cs b/Scripts/Items/Special/Broken Furniture Collection/BrokenFallenChair.cs new file mode 100644 index 000000000..9200348b1 --- /dev/null +++ b/Scripts/Items/Special/Broken Furniture Collection/BrokenFallenChair.cs @@ -0,0 +1,91 @@ +using System; + +namespace Server.Items +{ + [Flipable( 0xC17, 0xC17 )] + public class BrokenFallenChairComponent : AddonComponent + { + public override int LabelNumber { get { return 1076264; } } // Broken Fallen Chair + + public BrokenFallenChairComponent() : base( 0xC17 ) + { + } + + public BrokenFallenChairComponent( 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 BrokenFallenChairAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new BrokenFallenChairDeed(); } } + + [Constructable] + public BrokenFallenChairAddon() : base() + { + AddComponent( new BrokenFallenChairComponent(), 0, 0, 0 ); + } + + public BrokenFallenChairAddon( 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 BrokenFallenChairDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new BrokenFallenChairAddon(); } } + public override int LabelNumber { get { return 1076264; } } // Broken Fallen Chair + + [Constructable] + public BrokenFallenChairDeed() : base() + { + LootType = LootType.Blessed; + } + + public BrokenFallenChairDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Broken Furniture Collection/BrokenVanity.cs b/Scripts/Items/Special/Broken Furniture Collection/BrokenVanity.cs new file mode 100644 index 000000000..4f7405e7d --- /dev/null +++ b/Scripts/Items/Special/Broken Furniture Collection/BrokenVanity.cs @@ -0,0 +1,130 @@ +using System; +using Server; +using Server.Gumps; +using Server.Network; + +namespace Server.Items +{ + public class BrokenVanityAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new BrokenVanityDeed(); } } + + [Constructable] + public BrokenVanityAddon( bool east ) : base() + { + if ( east ) // east + { + AddComponent( new LocalizedAddonComponent( 0xC20, 1076260 ), 0, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0xC21, 1076260 ), 0, -1, 0 ); + } + else // south + { + AddComponent( new LocalizedAddonComponent( 0xC22, 1076260 ), 0, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0xC23, 1076260 ), -1, 0, 0 ); + } + } + + public BrokenVanityAddon( 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 BrokenVanityDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new BrokenVanityAddon( m_East ); } } + public override int LabelNumber { get { return 1076260; } } // Broken Vanity + + private bool m_East; + + [Constructable] + public BrokenVanityDeed() : base() + { + LootType = LootType.Blessed; + } + + public BrokenVanityDeed( 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( 1062334 ); // This item must be in your backpack to be used. + } + + private void SendTarget( Mobile m ) + { + base.OnDoubleClick( m ); + } + + 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 BrokenVanityDeed m_Deed; + + public InternalGump( BrokenVanityDeed deed ) : base( 60, 63 ) + { + m_Deed = deed; + + AddPage( 0 ); + + AddBackground( 0, 0, 273, 324, 0x13BE ); + AddImageTiled( 10, 10, 253, 20, 0xA40 ); + AddImageTiled( 10, 40, 253, 244, 0xA40 ); + AddImageTiled( 10, 294, 253, 20, 0xA40 ); + AddAlphaRegion( 10, 10, 253, 304 ); + AddButton( 10, 294, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 45, 296, 450, 20, 1060051, 0x7FFF, false, false ); // CANCEL + AddHtmlLocalized( 14, 12, 273, 20, 1076747, 0x7FFF, false, false ); // Please select your broken vanity position + + AddPage( 1 ); + + AddButton( 19, 49, 0x845, 0x846, 1, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 44, 47, 213, 20, 1075386, 0x7FFF, false, false ); // South + AddButton( 19, 73, 0x845, 0x846, 2, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 44, 71, 213, 20, 1075387, 0x7FFF, false, false ); // East + } + + public override void OnResponse( NetState sender, RelayInfo info ) + { + if ( m_Deed == null || m_Deed.Deleted || info.ButtonID == 0 ) + return; + + m_Deed.m_East = ( info.ButtonID != 1 ); + m_Deed.SendTarget( sender.Mobile ); + } + } + } +} diff --git a/Scripts/Items/Special/Broken Furniture Collection/StandingBrokenChair.cs b/Scripts/Items/Special/Broken Furniture Collection/StandingBrokenChair.cs new file mode 100644 index 000000000..85c67cae8 --- /dev/null +++ b/Scripts/Items/Special/Broken Furniture Collection/StandingBrokenChair.cs @@ -0,0 +1,91 @@ +using System; + +namespace Server.Items +{ + [Flipable( 0xC1B, 0xC1C, 0xC1E, 0xC1D )] + public class StandingBrokenChairComponent : AddonComponent + { + public override int LabelNumber { get { return 1076259; } } // Standing Broken Chair + + public StandingBrokenChairComponent() : base( 0xC1B ) + { + } + + public StandingBrokenChairComponent( 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 StandingBrokenChairAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new StandingBrokenChairDeed(); } } + + [Constructable] + public StandingBrokenChairAddon() : base() + { + AddComponent( new StandingBrokenChairComponent(), 0, 0, 0 ); + } + + public StandingBrokenChairAddon( 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 StandingBrokenChairDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new StandingBrokenChairAddon(); } } + public override int LabelNumber { get { return 1076259; } } // Standing Broken Chair + + [Constructable] + public StandingBrokenChairDeed() : base() + { + LootType = LootType.Blessed; + } + + public StandingBrokenChairDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Evil Home Décor Collection/AwesomeDisturbingPortrait.cs b/Scripts/Items/Special/Evil Home Décor Collection/AwesomeDisturbingPortrait.cs new file mode 100644 index 000000000..170f79dc2 --- /dev/null +++ b/Scripts/Items/Special/Evil Home Décor Collection/AwesomeDisturbingPortrait.cs @@ -0,0 +1,188 @@ +using System; +using Server; +using Server.Network; + +namespace Server.Items +{ + [Flipable( 0x2A5D, 0x2A61 )] + public class AwesomeDisturbingPortraitComponent : AddonComponent + { + public override int LabelNumber { get { return 1074479; } } // Disturbing portrait + public bool FacingSouth { get { return ItemID < 0x2A61; } } + + private InternalTimer m_Timer; + + public AwesomeDisturbingPortraitComponent() : base( 0x2A5D ) + { + m_Timer = new InternalTimer( this, TimeSpan.FromSeconds( 1 ) ); + m_Timer.Start(); + } + + public AwesomeDisturbingPortraitComponent( Serial serial ) : base( serial ) + { + } + + public override void OnDoubleClick( Mobile from ) + { + if ( Utility.InRange( Location, from.Location, 2 ) ) + { + int hours; + int minutes; + + Clock.GetTime( Map, X, Y, out hours, out minutes ); + + if ( hours < 4 || hours > 20 ) + Effects.PlaySound( Location, Map, 0x569 ); + + UpdateImage(); + } + else + from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. + } + + public override void OnAfterDelete() + { + base.OnAfterDelete(); + + if ( m_Timer != null && m_Timer.Running ) + m_Timer.Stop(); + } + + 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(); + + m_Timer = new InternalTimer( this, TimeSpan.Zero ); + m_Timer.Start(); + } + + private void UpdateImage() + { + int hours; + int minutes; + + Clock.GetTime( Map, X, Y, out hours, out minutes ); + + if ( FacingSouth ) + { + if ( hours < 4 ) + ItemID = 0x2A60; + else if ( hours < 6 ) + ItemID = 0x2A5F; + else if ( hours < 8 ) + ItemID = 0x2A5E; + else if ( hours < 16 ) + ItemID = 0x2A5D; + else if ( hours < 18 ) + ItemID = 0x2A5E; + else if ( hours < 20 ) + ItemID = 0x2A5F; + else + ItemID = 0x2A60; + } + else + { + if ( hours < 4 ) + ItemID = 0x2A64; + else if ( hours < 6 ) + ItemID = 0x2A63; + else if ( hours < 8 ) + ItemID = 0x2A62; + else if ( hours < 16 ) + ItemID = 0x2A61; + else if ( hours < 18 ) + ItemID = 0x2A62; + else if ( hours < 20 ) + ItemID = 0x2A63; + else + ItemID = 0x2A64; + } + } + + private class InternalTimer : Timer + { + private AwesomeDisturbingPortraitComponent m_Component; + + public InternalTimer( AwesomeDisturbingPortraitComponent c, TimeSpan delay ) : base( delay, TimeSpan.FromMinutes( 10 ) ) + { + m_Component = c; + + Priority = TimerPriority.OneMinute; + } + + protected override void OnTick() + { + if ( m_Component != null && !m_Component.Deleted ) + m_Component.UpdateImage(); + } + } + } + + public class AwesomeDisturbingPortraitAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new AwesomeDisturbingPortraitDeed(); } } + + [Constructable] + public AwesomeDisturbingPortraitAddon() : base() + { + AddComponent( new AwesomeDisturbingPortraitComponent(), 0, 0, 0 ); + } + + public AwesomeDisturbingPortraitAddon( 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 AwesomeDisturbingPortraitDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new AwesomeDisturbingPortraitAddon(); } } + public override int LabelNumber { get { return 1074479; } } // Disturbing portrait + + [Constructable] + public AwesomeDisturbingPortraitDeed() : base() + { + LootType = LootType.Blessed; + } + + public AwesomeDisturbingPortraitDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Evil Home Décor Collection/BedOfNails.cs b/Scripts/Items/Special/Evil Home Décor Collection/BedOfNails.cs new file mode 100644 index 000000000..a2c47cc1c --- /dev/null +++ b/Scripts/Items/Special/Evil Home Décor Collection/BedOfNails.cs @@ -0,0 +1,180 @@ +using System; + +namespace Server.Items +{ + public class BedOfNailsComponent : AddonComponent + { + public override int LabelNumber { get { return 1074801; } } // Bed of Nails + + public BedOfNailsComponent( int itemID ) : base( itemID ) + { + } + + public BedOfNailsComponent( Serial serial ) : base( serial ) + { + } + + public override bool OnMoveOver( Mobile m ) + { + bool allow = base.OnMoveOver( m ); + + if ( allow && Addon is BedOfNailsAddon ) + ( (BedOfNailsAddon) Addon ).OnMoveOver( m ); + + return allow; + } + + 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(); + } + } + + [FlipableAddon( Direction.South, Direction.East )] + public class BedOfNailsAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new BedOfNailsDeed(); } } + + private InternalTimer m_Timer; + + [Constructable] + public BedOfNailsAddon() : base() + { + Direction = Direction.South; + + AddComponent( new BedOfNailsComponent( 0x2A81 ), 0, 0, 0 ); + AddComponent( new BedOfNailsComponent( 0x2A82 ), 0, -1, 0 ); + } + + public BedOfNailsAddon( Serial serial ) : base( serial ) + { + } + + public override bool OnMoveOver( Mobile m ) + { + if ( m.Alive && ( m.AccessLevel == AccessLevel.Player || !m.Hidden ) ) + { + if ( m.Player ) + { + if ( m.Female ) + Effects.PlaySound( Location, Map, Utility.RandomMinMax( 0x53B, 0x53D ) ); + else + Effects.PlaySound( Location, Map, Utility.RandomMinMax( 0x53E, 0x540 ) ); + } + + if ( m_Timer == null || !m_Timer.Running ) + ( m_Timer = new InternalTimer( m ) ).Start(); + } + + return true; + } + + 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 virtual void Flip( Mobile from, Direction direction ) + { + switch ( direction ) + { + case Direction.East: + AddComponent( new BedOfNailsComponent( 0x2A89 ), 0, 0, 0 ); + AddComponent( new BedOfNailsComponent( 0x2A8A ), -1, 0, 0 ); + break; + case Direction.South: + AddComponent( new BedOfNailsComponent( 0x2A81 ), 0, 0, 0 ); + AddComponent( new BedOfNailsComponent( 0x2A82 ), 0, -1, 0 ); + break; + } + } + + private class InternalTimer : Timer + { + private Mobile m_Mobile; + private Point3D m_Location; + + public InternalTimer( Mobile m ) : base( TimeSpan.Zero, TimeSpan.FromSeconds( 1 ), 5 ) + { + m_Mobile = m; + m_Location = Point3D.Zero; + } + + protected override void OnTick() + { + if ( m_Location != m_Mobile.Location ) + { + int amount = Utility.RandomMinMax( 0, 7 ); + + for ( int i = 0; i < amount; i++ ) + { + int x = m_Mobile.X + Utility.RandomMinMax( -1, 1 ); + int y = m_Mobile.Y + Utility.RandomMinMax( -1, 1 ); + int z = m_Mobile.Z; + + if ( !m_Mobile.Map.CanFit( x, y, z, 1, false, false, true ) ) + { + z = m_Mobile.Map.GetAverageZ( x, y ); + + if ( !m_Mobile.Map.CanFit( x, y, z, 1, false, false, true ) ) + continue; + } + + Blood blood = new Blood( Utility.RandomMinMax( 0x122C, 0x122F ) ); + blood.MoveToWorld( new Point3D( x, y, z ), m_Mobile.Map ); + } + + m_Location = m_Mobile.Location; + } + } + } + } + + public class BedOfNailsDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new BedOfNailsAddon(); } } + public override int LabelNumber { get { return 1074801; } } // Bed of Nails + + [Constructable] + public BedOfNailsDeed() : base() + { + LootType = LootType.Blessed; + } + + public BedOfNailsDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Evil Home Décor Collection/BoneCouch.cs b/Scripts/Items/Special/Evil Home Décor Collection/BoneCouch.cs new file mode 100644 index 000000000..f6da54ed1 --- /dev/null +++ b/Scripts/Items/Special/Evil Home Décor Collection/BoneCouch.cs @@ -0,0 +1,119 @@ +using System; + +namespace Server.Items +{ + public class BoneCouchComponent : AddonComponent + { + public override int LabelNumber { get { return 1074477; } } // Bone couch + + public BoneCouchComponent( int itemID ) : base( itemID ) + { + } + + public BoneCouchComponent( Serial serial ) : base( serial ) + { + } + + public override bool OnMoveOver( Mobile m ) + { + bool allow = base.OnMoveOver( m ); + + if ( allow && m.Alive && m.Player && ( m.AccessLevel == AccessLevel.Player || !m.Hidden ) ) + Effects.PlaySound( Location, Map, Utility.RandomMinMax( 0x547, 0x54A ) ); + + return allow; + } + + 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(); + } + } + + [FlipableAddon( Direction.South, Direction.East )] + public class BoneCouchAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new BoneCouchDeed(); } } + + [Constructable] + public BoneCouchAddon() : base() + { + Direction = Direction.South; + + AddComponent( new BoneCouchComponent( 0x2A5A ), 0, 0, 0 ); + AddComponent( new BoneCouchComponent( 0x2A5B ), -1, 0, 0 ); + } + + public BoneCouchAddon( 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 virtual void Flip( Mobile from, Direction direction ) + { + switch ( direction ) + { + case Direction.East: + AddComponent( new BoneCouchComponent( 0x2A80 ), 0, 0, 0 ); + AddComponent( new BoneCouchComponent( 0x2A7F ), 0, 1, 0 ); + break; + case Direction.South: + AddComponent( new BoneCouchComponent( 0x2A5A ), 0, 0, 0 ); + AddComponent( new BoneCouchComponent( 0x2A5B ), -1, 0, 0 ); + break; + } + } + } + + public class BoneCouchDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new BoneCouchAddon(); } } + public override int LabelNumber { get { return 1074477; } } // Bone couch + + [Constructable] + public BoneCouchDeed() : base() + { + LootType = LootType.Blessed; + } + + public BoneCouchDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Evil Home Décor Collection/BoneTable.cs b/Scripts/Items/Special/Evil Home Décor Collection/BoneTable.cs new file mode 100644 index 000000000..6ca87c926 --- /dev/null +++ b/Scripts/Items/Special/Evil Home Décor Collection/BoneTable.cs @@ -0,0 +1,63 @@ +using System; + +namespace Server.Items +{ + public class BoneTableAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new BoneTableDeed(); } } + + [Constructable] + public BoneTableAddon() : base() + { + AddComponent( new LocalizedAddonComponent( 0x2A5C, 1074478 ), 0, 0, 0 ); + } + + public BoneTableAddon( 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 BoneTableDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new BoneTableAddon(); } } + public override int LabelNumber { get { return 1074478; } } // Bone table + + [Constructable] + public BoneTableDeed() : base() + { + LootType = LootType.Blessed; + } + + public BoneTableDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Evil Home Décor Collection/BoneThrone.cs b/Scripts/Items/Special/Evil Home Décor Collection/BoneThrone.cs new file mode 100644 index 000000000..1e0d31d39 --- /dev/null +++ b/Scripts/Items/Special/Evil Home Décor Collection/BoneThrone.cs @@ -0,0 +1,101 @@ +using System; + +namespace Server.Items +{ + [Flipable( 0x2A58, 0x2A59 )] + public class BoneThroneComponent : AddonComponent + { + public override int LabelNumber { get { return 1074476; } } // Bone throne + + public BoneThroneComponent() : base( 0x2A58 ) + { + } + + public BoneThroneComponent( Serial serial ) : base( serial ) + { + } + + public override bool OnMoveOver( Mobile m ) + { + bool allow = base.OnMoveOver( m ); + + if ( allow && m.Alive && m.Player && ( m.AccessLevel == AccessLevel.Player || !m.Hidden ) ) + Effects.PlaySound( Location, Map, Utility.RandomMinMax( 0x54B, 0x54D ) ); + + return allow; + } + + 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 BoneThroneAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new BoneThroneDeed(); } } + + [Constructable] + public BoneThroneAddon() : base() + { + AddComponent( new BoneThroneComponent(), 0, 0, 0 ); + } + + public BoneThroneAddon( 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 BoneThroneDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new BoneThroneAddon(); } } + public override int LabelNumber { get { return 1074476; } } // Bone throne + + [Constructable] + public BoneThroneDeed() : base() + { + LootType = LootType.Blessed; + } + + public BoneThroneDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Evil Home Décor Collection/CreepyPortrait.cs b/Scripts/Items/Special/Evil Home Décor Collection/CreepyPortrait.cs new file mode 100644 index 000000000..52e81e80b --- /dev/null +++ b/Scripts/Items/Special/Evil Home Décor Collection/CreepyPortrait.cs @@ -0,0 +1,129 @@ +using System; +using Server; +using Server.Network; + +namespace Server.Items +{ + [Flipable( 0x2A69, 0x2A6D )] + public class CreepyPortraitComponent : AddonComponent + { + public override int LabelNumber { get { return 1074481; } } // Creepy portrait + public override bool HandlesOnMovement { get { return true; } } + + public CreepyPortraitComponent() : base( 0x2A69 ) + { + } + + public CreepyPortraitComponent( Serial serial ) : base( serial ) + { + } + + public override void OnDoubleClick( Mobile from ) + { + if ( Utility.InRange( Location, from.Location, 2 ) ) + Effects.PlaySound( Location, Map, Utility.RandomMinMax( 0x565, 0x566 ) ); + else + from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. + } + + public override void OnMovement( Mobile m, Point3D old ) + { + if ( m.Alive && m.Player && ( m.AccessLevel == AccessLevel.Player || !m.Hidden ) ) + { + if ( !Utility.InRange( old, Location, 2 ) && Utility.InRange( m.Location, Location, 2 ) ) + { + if ( ItemID == 0x2A69 || ItemID == 0x2A6D ) + Timer.DelayCall( TimeSpan.FromSeconds( 0.5 ), TimeSpan.FromSeconds( 0.5 ), 3, new TimerCallback( Up ) ); + } + else if ( Utility.InRange( old, Location, 2 ) && !Utility.InRange( m.Location, Location, 2 ) ) + { + if ( ItemID == 0x2A6C || ItemID == 0x2A70 ) + Timer.DelayCall( TimeSpan.FromSeconds( 0.5 ), TimeSpan.FromSeconds( 0.5 ), 3, new TimerCallback( Down ) ); + } + } + } + + private void Up() + { + ItemID += 1; + } + + private void Down() + { + ItemID -= 1; + } + + 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 CreepyPortraitAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new CreepyPortraitDeed(); } } + + [Constructable] + public CreepyPortraitAddon() : base() + { + AddComponent( new CreepyPortraitComponent(), 0, 0, 0 ); + } + + public CreepyPortraitAddon( 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 CreepyPortraitDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new CreepyPortraitAddon(); } } + public override int LabelNumber { get { return 1074481; } } // Creepy portrait + + [Constructable] + public CreepyPortraitDeed() : base() + { + LootType = LootType.Blessed; + } + + public CreepyPortraitDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Evil Home Décor Collection/DisturbingPortrait.cs b/Scripts/Items/Special/Evil Home Décor Collection/DisturbingPortrait.cs new file mode 100644 index 000000000..db7b3a5b4 --- /dev/null +++ b/Scripts/Items/Special/Evil Home Décor Collection/DisturbingPortrait.cs @@ -0,0 +1,122 @@ +using System; +using Server; +using Server.Network; + +namespace Server.Items +{ + [Flipable( 0x2A5D, 0x2A61 )] + public class DisturbingPortraitComponent : AddonComponent + { + public override int LabelNumber { get { return 1074479; } } // Disturbing portrait + + private Timer m_Timer; + + public DisturbingPortraitComponent() : base( 0x2A5D ) + { + m_Timer = Timer.DelayCall( TimeSpan.FromMinutes( 3 ), TimeSpan.FromMinutes( 3 ), new TimerCallback( Change ) ); + } + + public DisturbingPortraitComponent( Serial serial ) : base( serial ) + { + } + + public override void OnDoubleClick( Mobile from ) + { + if ( Utility.InRange( Location, from.Location, 2 ) ) + Effects.PlaySound( Location, Map, Utility.RandomMinMax( 0x567, 0x568 ) ); + else + from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. + } + + public override void OnAfterDelete() + { + base.OnAfterDelete(); + + if ( m_Timer != null && m_Timer.Running ) + m_Timer.Stop(); + } + + 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(); + + m_Timer = Timer.DelayCall( TimeSpan.FromMinutes( 3 ), TimeSpan.FromMinutes( 3 ), new TimerCallback( Change ) ); + } + + private void Change() + { + if ( ItemID < 0x2A61 ) + ItemID = Utility.RandomMinMax( 0x2A5D, 0x2A60 ); + else + ItemID = Utility.RandomMinMax( 0x2A61, 0x2A64 ); + } + } + + public class DisturbingPortraitAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new DisturbingPortraitDeed(); } } + + [Constructable] + public DisturbingPortraitAddon() : base() + { + AddComponent( new DisturbingPortraitComponent(), 0, 0, 0 ); + } + + public DisturbingPortraitAddon( 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 DisturbingPortraitDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new DisturbingPortraitAddon(); } } + public override int LabelNumber { get { return 1074479; } } // Disturbing portrait + + [Constructable] + public DisturbingPortraitDeed() : base() + { + LootType = LootType.Blessed; + } + + public DisturbingPortraitDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Evil Home Décor Collection/HauntedMirror.cs b/Scripts/Items/Special/Evil Home Décor Collection/HauntedMirror.cs new file mode 100644 index 000000000..4bed3b977 --- /dev/null +++ b/Scripts/Items/Special/Evil Home Décor Collection/HauntedMirror.cs @@ -0,0 +1,114 @@ +using System; + +namespace Server.Items +{ + [Flipable( 0x2A7B, 0x2A7D )] + public class HaunterMirrorComponent : AddonComponent + { + public override int LabelNumber { get { return 1074800; } } // Haunted Mirror + public override bool HandlesOnMovement { get { return true; } } + + public HaunterMirrorComponent() : base( 0x2A7B ) + { + } + + public HaunterMirrorComponent( Serial serial ) : base( serial ) + { + } + + public override void OnMovement( Mobile m, Point3D old ) + { + base.OnMovement( m, old ); + + if ( m.Alive && m.Player && ( m.AccessLevel == AccessLevel.Player || !m.Hidden ) ) + { + if ( !Utility.InRange( old, Location, 2 ) && Utility.InRange( m.Location, Location, 2 ) ) + { + if ( ItemID == 0x2A7B || ItemID == 0x2A7D ) + { + Effects.PlaySound( Location, Map, Utility.RandomMinMax( 0x551, 0x553 ) ); + ItemID += 1; + } + } + else if ( Utility.InRange( old, Location, 2 ) && !Utility.InRange( m.Location, Location, 2 ) ) + { + if ( ItemID == 0x2A7C || ItemID == 0x2A7E ) + ItemID -= 1; + } + } + } + + 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 HaunterMirrorAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new HaunterMirrorDeed(); } } + + [Constructable] + public HaunterMirrorAddon() : base() + { + AddComponent( new HaunterMirrorComponent(), 0, 0, 0 ); + } + + public HaunterMirrorAddon( 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 HaunterMirrorDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new HaunterMirrorAddon(); } } + public override int LabelNumber { get { return 1074800; } } // Haunted Mirror + + [Constructable] + public HaunterMirrorDeed() : base() + { + LootType = LootType.Blessed; + } + + public HaunterMirrorDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Evil Home Décor Collection/MountedPixieBlue.cs b/Scripts/Items/Special/Evil Home Décor Collection/MountedPixieBlue.cs new file mode 100644 index 000000000..715cf5b43 --- /dev/null +++ b/Scripts/Items/Special/Evil Home Décor Collection/MountedPixieBlue.cs @@ -0,0 +1,100 @@ +using System; +using Server; +using Server.Network; + +namespace Server.Items +{ + [Flipable( 0x2A75, 0x2A76 )] + public class MountedPixieBlueComponent : AddonComponent + { + public override int LabelNumber { get { return 1074482; } } // Mounted pixie + + public MountedPixieBlueComponent() : base( 0x2A75 ) + { + } + + public MountedPixieBlueComponent( Serial serial ) : base( serial ) + { + } + + public override void OnDoubleClick( Mobile from ) + { + if ( Utility.InRange( Location, from.Location, 2 ) ) + Effects.PlaySound( Location, Map, Utility.RandomMinMax( 0x55C, 0x55E ) ); + else + from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. + } + + 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 MountedPixieBlueAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new MountedPixieBlueDeed(); } } + + public MountedPixieBlueAddon() : base() + { + AddComponent( new MountedPixieBlueComponent(), 0, 0, 0 ); + } + + public MountedPixieBlueAddon( 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 MountedPixieBlueDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new MountedPixieBlueAddon(); } } + public override int LabelNumber { get { return 1074482; } } // Mounted pixie + + [Constructable] + public MountedPixieBlueDeed() : base() + { + LootType = LootType.Blessed; + } + + public MountedPixieBlueDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Evil Home Décor Collection/MountedPixieGreen.cs b/Scripts/Items/Special/Evil Home Décor Collection/MountedPixieGreen.cs new file mode 100644 index 000000000..9a1943ea7 --- /dev/null +++ b/Scripts/Items/Special/Evil Home Décor Collection/MountedPixieGreen.cs @@ -0,0 +1,100 @@ +using System; +using Server; +using Server.Network; + +namespace Server.Items +{ + [Flipable( 0x2A71, 0x2A72 )] + public class MountedPixieGreenComponent : AddonComponent + { + public override int LabelNumber { get { return 1074482; } } // Mounted pixie + + public MountedPixieGreenComponent() : base( 0x2A71 ) + { + } + + public MountedPixieGreenComponent( Serial serial ) : base( serial ) + { + } + + public override void OnDoubleClick( Mobile from ) + { + if ( Utility.InRange( Location, from.Location, 2 ) ) + Effects.PlaySound( Location, Map, Utility.RandomMinMax( 0x554, 0x557 ) ); + else + from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. + } + + 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 MountedPixieGreenAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new MountedPixieGreenDeed(); } } + + public MountedPixieGreenAddon() : base() + { + AddComponent( new MountedPixieGreenComponent(), 0, 0, 0 ); + } + + public MountedPixieGreenAddon( 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 MountedPixieGreenDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new MountedPixieGreenAddon(); } } + public override int LabelNumber { get { return 1074482; } } // Mounted pixie + + [Constructable] + public MountedPixieGreenDeed() : base() + { + LootType = LootType.Blessed; + } + + public MountedPixieGreenDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Evil Home Décor Collection/MountedPixieLime.cs b/Scripts/Items/Special/Evil Home Décor Collection/MountedPixieLime.cs new file mode 100644 index 000000000..1a0ca7497 --- /dev/null +++ b/Scripts/Items/Special/Evil Home Décor Collection/MountedPixieLime.cs @@ -0,0 +1,100 @@ +using System; +using Server; +using Server.Network; + +namespace Server.Items +{ + [Flipable( 0x2A77, 0x2A78 )] + public class MountedPixieLimeComponent : AddonComponent + { + public override int LabelNumber { get { return 1074482; } } // Mounted pixie + + public MountedPixieLimeComponent() : base( 0x2A77 ) + { + } + + public MountedPixieLimeComponent( Serial serial ) : base( serial ) + { + } + + public override void OnDoubleClick( Mobile from ) + { + if ( Utility.InRange( Location, from.Location, 2 ) ) + Effects.PlaySound( Location, Map, Utility.RandomMinMax( 0x55F, 0x561 ) ); + else + from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. + } + + 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 MountedPixieLimeAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new MountedPixieLimeDeed(); } } + + public MountedPixieLimeAddon() : base() + { + AddComponent( new MountedPixieLimeComponent(), 0, 0, 0 ); + } + + public MountedPixieLimeAddon( 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 MountedPixieLimeDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new MountedPixieLimeAddon(); } } + public override int LabelNumber { get { return 1074482; } } // Mounted pixie + + [Constructable] + public MountedPixieLimeDeed() : base() + { + LootType = LootType.Blessed; + } + + public MountedPixieLimeDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Evil Home Décor Collection/MountedPixieOrange.cs b/Scripts/Items/Special/Evil Home Décor Collection/MountedPixieOrange.cs new file mode 100644 index 000000000..983d98e42 --- /dev/null +++ b/Scripts/Items/Special/Evil Home Décor Collection/MountedPixieOrange.cs @@ -0,0 +1,100 @@ +using System; +using Server; +using Server.Network; + +namespace Server.Items +{ + [Flipable( 0x2A73, 0x2A74 )] + public class MountedPixieOrangeComponent : AddonComponent + { + public override int LabelNumber { get { return 1074482; } } // Mounted pixie + + public MountedPixieOrangeComponent() : base( 0x2A73 ) + { + } + + public MountedPixieOrangeComponent( Serial serial ) : base( serial ) + { + } + + public override void OnDoubleClick( Mobile from ) + { + if ( Utility.InRange( Location, from.Location, 2 ) ) + Effects.PlaySound( Location, Map, Utility.RandomMinMax( 0x558, 0x55B ) ); + else + from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. + } + + 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 MountedPixieOrangeAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new MountedPixieOrangeDeed(); } } + + public MountedPixieOrangeAddon() : base() + { + AddComponent( new MountedPixieOrangeComponent(), 0, 0, 0 ); + } + + public MountedPixieOrangeAddon( 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 MountedPixieOrangeDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new MountedPixieOrangeAddon(); } } + public override int LabelNumber { get { return 1074482; } } // Mounted pixie + + [Constructable] + public MountedPixieOrangeDeed() : base() + { + LootType = LootType.Blessed; + } + + public MountedPixieOrangeDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Evil Home Décor Collection/MountedPixieWhite.cs b/Scripts/Items/Special/Evil Home Décor Collection/MountedPixieWhite.cs new file mode 100644 index 000000000..866bf3009 --- /dev/null +++ b/Scripts/Items/Special/Evil Home Décor Collection/MountedPixieWhite.cs @@ -0,0 +1,100 @@ +using System; +using Server; +using Server.Network; + +namespace Server.Items +{ + [Flipable( 0x2A79, 0x2A7A )] + public class MountedPixieWhiteComponent : AddonComponent + { + public override int LabelNumber { get { return 1074482; } } // Mounted pixie + + public MountedPixieWhiteComponent() : base( 0x2A79 ) + { + } + + public MountedPixieWhiteComponent( Serial serial ) : base( serial ) + { + } + + public override void OnDoubleClick( Mobile from ) + { + if ( Utility.InRange( Location, from.Location, 2 ) ) + Effects.PlaySound( Location, Map, Utility.RandomMinMax( 0x562, 0x564 ) ); + else + from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. + } + + 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 MountedPixieWhiteAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new MountedPixieWhiteDeed(); } } + + public MountedPixieWhiteAddon() : base() + { + AddComponent( new MountedPixieWhiteComponent(), 0, 0, 0 ); + } + + public MountedPixieWhiteAddon( 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 MountedPixieWhiteDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new MountedPixieWhiteAddon(); } } + public override int LabelNumber { get { return 1074482; } } // Mounted pixie + + [Constructable] + public MountedPixieWhiteDeed() : base() + { + LootType = LootType.Blessed; + } + + public MountedPixieWhiteDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Evil Home Décor Collection/SacrificialAltar.cs b/Scripts/Items/Special/Evil Home Décor Collection/SacrificialAltar.cs new file mode 100644 index 000000000..bcdfd81bc --- /dev/null +++ b/Scripts/Items/Special/Evil Home Décor Collection/SacrificialAltar.cs @@ -0,0 +1,164 @@ +using System; + +namespace Server.Items +{ + [FlipableAddon( Direction.South, Direction.East )] + public class SacrificialAltarAddon : BaseAddonContainer + { + public override BaseAddonContainerDeed Deed { get { return new SacrificialAltarDeed(); } } + public override int LabelNumber { get { return 1074818; } } // Sacrificial Altar + public override int DefaultMaxWeight { get { return 0; } } + public override int DefaultGumpID { get { return 0x107; } } + public override int DefaultDropSound { get { return 0x42; } } + + private Timer m_Timer; + + [Constructable] + public SacrificialAltarAddon() : base( 0x2A9B ) + { + Direction = Direction.South; + + AddComponent( new LocalizedContainerComponent( 0x2A9A, 1074818 ), 1, 0, 0 ); + } + + public SacrificialAltarAddon( Serial serial ) : base( serial ) + { + } + + public override bool OnDragDrop( Mobile from, Item dropped ) + { + if ( !base.OnDragDrop( from, dropped ) ) + return false; + + if ( TotalItems >= 50 ) + { + SendLocalizedMessageTo( from, 501478 ); // The trash is full! Emptying! + Empty(); + } + else + { + SendLocalizedMessageTo( from, 1010442 ); // The item will be deleted in three minutes + + if ( m_Timer != null ) + m_Timer.Stop(); + + m_Timer = Timer.DelayCall( TimeSpan.FromMinutes( 3 ), new TimerCallback( Empty ) ); + } + + return true; + } + + public override bool OnDragDropInto( Mobile from, Item item, Point3D p ) + { + if ( !base.OnDragDropInto( from, item, p ) ) + return false; + + if ( TotalItems >= 50 ) + { + SendLocalizedMessageTo( from, 501478 ); // The trash is full! Emptying! + Empty(); + } + else + { + SendLocalizedMessageTo( from, 1010442 ); // The item will be deleted in three minutes + + if ( m_Timer != null ) + m_Timer.Stop(); + + m_Timer = Timer.DelayCall( TimeSpan.FromMinutes( 3 ), new TimerCallback( Empty ) ); + } + + return true; + } + + 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(); + + if ( Items.Count > 0 ) + m_Timer = Timer.DelayCall( TimeSpan.FromMinutes( 3 ), new TimerCallback( Empty ) ); + } + + public virtual void Flip( Mobile from, Direction direction ) + { + switch ( direction ) + { + case Direction.East: + ItemID = 0x2A9C; + AddComponent( new LocalizedContainerComponent( 0x2A9D, 1074818 ), 0, -1, 0 ); + break; + case Direction.South: + ItemID = 0x2A9B; + AddComponent( new LocalizedContainerComponent( 0x2A9A, 1074818 ), 1, 0, 0 ); + break; + } + } + + public virtual void Empty() + { + if ( Items.Count > 0 ) + { + Point3D location = Location; + location.Z += 10; + + Effects.SendLocationEffect( location, Map, 0x3709, 10, 10, 0x356, 0 ); + Effects.PlaySound( location, Map, 0x32E ); + + if ( Items.Count > 0 ) + { + for ( int i = Items.Count - 1; i >= 0; --i ) + { + if ( i >= Items.Count ) + continue; + + Items[ i ].Delete(); + } + } + } + + if ( m_Timer != null ) + m_Timer.Stop(); + + m_Timer = null; + } + } + + public class SacrificialAltarDeed : BaseAddonContainerDeed + { + public override BaseAddonContainer Addon { get { return new SacrificialAltarAddon(); } } + public override int LabelNumber { get { return 1074818; } } // Sacrificial Altar + + [Constructable] + public SacrificialAltarDeed() : base() + { + LootType = LootType.Blessed; + } + + public SacrificialAltarDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Evil Home Décor Collection/UnsettlingPortrait.cs b/Scripts/Items/Special/Evil Home Décor Collection/UnsettlingPortrait.cs new file mode 100644 index 000000000..c81b8404e --- /dev/null +++ b/Scripts/Items/Special/Evil Home Décor Collection/UnsettlingPortrait.cs @@ -0,0 +1,126 @@ +using System; +using Server; +using Server.Network; + +namespace Server.Items +{ + [Flipable( 0x2A65, 0x2A67 )] + public class UnsettlingPortraitComponent : AddonComponent + { + public override int LabelNumber { get { return 1074480; } } // Unsettling portrait + + private Timer m_Timer; + + public UnsettlingPortraitComponent() : base( 0x2A65 ) + { + m_Timer = Timer.DelayCall( TimeSpan.FromMinutes( 3 ), TimeSpan.FromMinutes( 3 ), new TimerCallback( ChangeDirection ) ); + } + + public UnsettlingPortraitComponent( Serial serial ) : base( serial ) + { + } + + public override void OnDoubleClick( Mobile from ) + { + if ( Utility.InRange( Location, from.Location, 2 ) ) + Effects.PlaySound( Location, Map, Utility.RandomMinMax( 0x567, 0x568 ) ); + else + from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. + } + + public override void OnAfterDelete() + { + base.OnAfterDelete(); + + if ( m_Timer != null ) + m_Timer.Stop(); + } + + 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(); + + m_Timer = Timer.DelayCall( TimeSpan.FromMinutes( 3 ), TimeSpan.FromMinutes( 3 ), new TimerCallback( ChangeDirection ) ); + } + + private void ChangeDirection() + { + if ( ItemID == 0x2A65 ) + ItemID += 1; + else if ( ItemID == 0x2A66 ) + ItemID -= 1; + else if ( ItemID == 0x2A67 ) + ItemID += 1; + else if ( ItemID == 0x2A68 ) + ItemID -= 1; + } + } + + public class UnsettlingPortraitAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new UnsettlingPortraitDeed(); } } + + [Constructable] + public UnsettlingPortraitAddon() : base() + { + AddComponent( new UnsettlingPortraitComponent(), 0, 0, 0 ); + } + + public UnsettlingPortraitAddon( 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 UnsettlingPortraitDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new UnsettlingPortraitAddon(); } } + public override int LabelNumber { get { return 1074480; } } // Unsettling portrait + + [Constructable] + public UnsettlingPortraitDeed() : base() + { + LootType = LootType.Blessed; + } + + public UnsettlingPortraitDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Heritage Items/AppleTrunk.cs b/Scripts/Items/Special/Heritage Items/AppleTrunk.cs new file mode 100644 index 000000000..b4c6c6156 --- /dev/null +++ b/Scripts/Items/Special/Heritage Items/AppleTrunk.cs @@ -0,0 +1,63 @@ +using System; + +namespace Server.Items +{ + public class AppleTrunkAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new AppleTrunkDeed(); } } + + [Constructable] + public AppleTrunkAddon() : base() + { + AddComponent( new LocalizedAddonComponent( 0xD98, 1076785 ), 0, 0, 0 ); + } + + public AppleTrunkAddon( 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 AppleTrunkDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new AppleTrunkAddon(); } } + public override int LabelNumber { get { return 1076785; } } // Apple Trunk + + [Constructable] + public AppleTrunkDeed() : base() + { + LootType = LootType.Blessed; + } + + public AppleTrunkDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Heritage Items/BlueDecorativeRug.cs b/Scripts/Items/Special/Heritage Items/BlueDecorativeRug.cs new file mode 100644 index 000000000..0ab4c58bb --- /dev/null +++ b/Scripts/Items/Special/Heritage Items/BlueDecorativeRug.cs @@ -0,0 +1,71 @@ +using System; + +namespace Server.Items +{ + public class BlueDecorativeRugAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new BlueDecorativeRugDeed(); } } + + [Constructable] + public BlueDecorativeRugAddon() : base() + { + AddComponent( new LocalizedAddonComponent( 0xAD2, 1076589 ), 1, 1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAD3, 1076589 ), -1, -1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAD4, 1076589 ), -1, 1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAD5, 1076589 ), 1, -1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAD6, 1076589 ), -1, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAD7, 1076589 ), 0, -1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAD8, 1076589 ), 1, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAD9, 1076589 ), 0, 1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAD1, 1076589 ), 0, 0, 0 ); + } + + public BlueDecorativeRugAddon( 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 BlueDecorativeRugDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new BlueDecorativeRugAddon(); } } + public override int LabelNumber { get { return 1076589; } } // Blue decorative rug + + [Constructable] + public BlueDecorativeRugDeed() : base() + { + LootType = LootType.Blessed; + } + + public BlueDecorativeRugDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Heritage Items/BlueFancyRug.cs b/Scripts/Items/Special/Heritage Items/BlueFancyRug.cs new file mode 100644 index 000000000..8170c3bed --- /dev/null +++ b/Scripts/Items/Special/Heritage Items/BlueFancyRug.cs @@ -0,0 +1,71 @@ +using System; + +namespace Server.Items +{ + public class BlueFancyRugAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new BlueFancyRugDeed(); } } + + [Constructable] + public BlueFancyRugAddon() : base() + { + AddComponent( new LocalizedAddonComponent( 0xAC2, 1076273 ), 1, 1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAC3, 1076273 ), -1, -1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAC4, 1076273 ), -1, 1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAC5, 1076273 ), 1, -1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAF6, 1076273 ), -1, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAF7, 1076273 ), 0, -1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAF8, 1076273 ), 1, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAF9, 1076273 ), 0, 1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAFA, 1076273 ), 0, 0, 0 ); + } + + public BlueFancyRugAddon( 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 BlueFancyRugDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new BlueFancyRugAddon(); } } + public override int LabelNumber { get { return 1076273; } } // Blue fancy rug + + [Constructable] + public BlueFancyRugDeed() : base() + { + LootType = LootType.Blessed; + } + + public BlueFancyRugDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Heritage Items/BluePlainRug.cs b/Scripts/Items/Special/Heritage Items/BluePlainRug.cs new file mode 100644 index 000000000..548e99979 --- /dev/null +++ b/Scripts/Items/Special/Heritage Items/BluePlainRug.cs @@ -0,0 +1,71 @@ +using System; + +namespace Server.Items +{ + public class BluePlainRugAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new BluePlainRugDeed(); } } + + [Constructable] + public BluePlainRugAddon() : base() + { + AddComponent( new LocalizedAddonComponent( 0xAC2, 1076585 ), 1, 1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAC3, 1076585 ), -1, -1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAC4, 1076585 ), -1, 1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAC5, 1076585 ), 1, -1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAF6, 1076585 ), -1, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAF7, 1076585 ), 0, -1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAF8, 1076585 ), 1, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAF9, 1076585 ), 0, 1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAC0, 1076585 ), 0, 0, 0 ); + } + + public BluePlainRugAddon( 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 BluePlainRugDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new BluePlainRugAddon(); } } + public override int LabelNumber { get { return 1076585; } } // Blue plain rug + + [Constructable] + public BluePlainRugDeed() : base() + { + LootType = LootType.Blessed; + } + + public BluePlainRugDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Heritage Items/BoilingCauldron.cs b/Scripts/Items/Special/Heritage Items/BoilingCauldron.cs new file mode 100644 index 000000000..8a71010f5 --- /dev/null +++ b/Scripts/Items/Special/Heritage Items/BoilingCauldron.cs @@ -0,0 +1,68 @@ +using System; + +namespace Server.Items +{ + [Flipable( 0x2068, 0x207A )] + public class BoilingCauldronAddon : BaseAddonContainer + { + public override BaseAddonContainerDeed Deed { get { return new BoilingCauldronDeed(); } } + public override int LabelNumber { get { return 1076267; } } // Boiling Cauldron + public override int DefaultGumpID { get { return 0x9; } } + public override int DefaultDropSound { get { return 0x42; } } + + [Constructable] + public BoilingCauldronAddon() : base( 0x2068 ) + { + AddComponent( new LocalizedContainerComponent( 0xFAC, 1076267 ), 0, 0, 0 ); + AddComponent( new LocalizedContainerComponent( 0x970, 1076267 ), 0, 0, 8 ); + } + + public BoilingCauldronAddon( 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 BoilingCauldronDeed : BaseAddonContainerDeed + { + public override BaseAddonContainer Addon { get { return new BoilingCauldronAddon(); } } + public override int LabelNumber { get { return 1076267; } } // Boiling Cauldron + + [Constructable] + public BoilingCauldronDeed() : base() + { + LootType = LootType.Blessed; + } + + public BoilingCauldronDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Heritage Items/CherryBlossomTree.cs b/Scripts/Items/Special/Heritage Items/CherryBlossomTree.cs new file mode 100644 index 000000000..e7aba717f --- /dev/null +++ b/Scripts/Items/Special/Heritage Items/CherryBlossomTree.cs @@ -0,0 +1,64 @@ +using System; + +namespace Server.Items +{ + public class CherryBlossomTreeAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new CherryBlossomTreeDeed(); } } + + [Constructable] + public CherryBlossomTreeAddon() : base() + { + AddComponent( new LocalizedAddonComponent( 0x26EE, 1076268 ), 0, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0x3122, 1076268 ), 0, 0, 0 ); + } + + public CherryBlossomTreeAddon( 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 CherryBlossomTreeDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new CherryBlossomTreeAddon(); } } + public override int LabelNumber { get { return 1076268; } } // Cherry Blossom Tree + + [Constructable] + public CherryBlossomTreeDeed() : base() + { + LootType = LootType.Blessed; + } + + public CherryBlossomTreeDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Heritage Items/CherryBlossomTrunk.cs b/Scripts/Items/Special/Heritage Items/CherryBlossomTrunk.cs new file mode 100644 index 000000000..93d55c9d8 --- /dev/null +++ b/Scripts/Items/Special/Heritage Items/CherryBlossomTrunk.cs @@ -0,0 +1,63 @@ +using System; + +namespace Server.Items +{ + public class CherryBlossomTrunkAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new CherryBlossomTrunkDeed(); } } + + [Constructable] + public CherryBlossomTrunkAddon() : base() + { + AddComponent( new LocalizedAddonComponent( 0x26EE, 1076784 ), 0, 0, 0 ); + } + + public CherryBlossomTrunkAddon( 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 CherryBlossomTrunkDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new CherryBlossomTrunkAddon(); } } + public override int LabelNumber { get { return 1076784; } } // Cherry Blossom Trunk + + [Constructable] + public CherryBlossomTrunkDeed() : base() + { + LootType = LootType.Blessed; + } + + public CherryBlossomTrunkDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Heritage Items/CinnamonFancyRug.cs b/Scripts/Items/Special/Heritage Items/CinnamonFancyRug.cs new file mode 100644 index 000000000..33a121792 --- /dev/null +++ b/Scripts/Items/Special/Heritage Items/CinnamonFancyRug.cs @@ -0,0 +1,71 @@ +using System; + +namespace Server.Items +{ + public class CinnamonFancyRugAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new CinnamonFancyRugDeed(); } } + + [Constructable] + public CinnamonFancyRugAddon() : base() + { + AddComponent( new LocalizedAddonComponent( 0xAE3, 1076587 ), 1, 1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAE4, 1076587 ), -1, -1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAE5, 1076587 ), -1, 1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAE6, 1076587 ), 1, -1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAE7, 1076587 ), -1, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAE8, 1076587 ), 0, -1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAE9, 1076587 ), 1, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAEA, 1076587 ), 0, 1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAEB, 1076587 ), 0, 0, 0 ); + } + + public CinnamonFancyRugAddon( 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 CinnamonFancyRugDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new CinnamonFancyRugAddon(); } } + public override int LabelNumber { get { return 1076587; } } // Cinnamon fancy rug + + [Constructable] + public CinnamonFancyRugDeed() : base() + { + LootType = LootType.Blessed; + } + + public CinnamonFancyRugDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Heritage Items/Curtains.cs b/Scripts/Items/Special/Heritage Items/Curtains.cs new file mode 100644 index 000000000..f5a8841cc --- /dev/null +++ b/Scripts/Items/Special/Heritage Items/Curtains.cs @@ -0,0 +1,213 @@ +using System; +using Server; +using Server.Gumps; +using Server.Network; + +namespace Server.Items +{ + public class CurtainsComponent : AddonComponent, IDyable + { + public override int LabelNumber { get { return 1076280; } } // Curtains + public override bool DisplayWeight { get { return false; } } + + private int m_ClosedID; + + [CommandProperty( AccessLevel.GameMaster )] + public int ClosedID + { + get { return m_ClosedID; } + set { m_ClosedID = value; } + } + + public CurtainsComponent( int itemID, int closedID ) : base( itemID ) + { + m_ClosedID = closedID; + } + + public CurtainsComponent( Serial serial ) : base( serial ) + { + } + + public override void OnDoubleClick( Mobile from ) + { + base.OnDoubleClick( from ); + + if ( Addon != null ) + { + if ( from.InRange( Location, 1 ) ) + { + foreach ( AddonComponent c in Addon.Components ) + { + if ( c is CurtainsComponent ) + { + CurtainsComponent curtain = (CurtainsComponent) c; + + int temp = curtain.ItemID; + curtain.ItemID = curtain.ClosedID; + curtain.ClosedID = temp; + } + } + } + else + from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. + } + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.WriteEncodedInt( 0 ); // version + + writer.Write( (int) m_ClosedID ); + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + int version = reader.ReadEncodedInt(); + + m_ClosedID = reader.ReadInt(); + } + + #region IDyable + public virtual bool Dye( Mobile from, DyeTub sender ) + { + if ( Deleted ) + return false; + + Hue = sender.DyedHue; + return true; + } + #endregion + } + + public class CurtainsAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new CurtainsDeed(); } } + public override bool RetainDeedHue { get { return true; } } + + [Constructable] + public CurtainsAddon( bool east ) : base() + { + if ( east ) // east + { + AddComponent( new CurtainsComponent( 0x3D9E, 0x3DA8 ), 0, -1, 0 ); + AddComponent( new CurtainsComponent( 0x3DAC, 0x3DAE ), 0, 0, 0 ); + AddComponent( new CurtainsComponent( 0x3DA0, 0x3DA6 ), 0, 2, 0 ); + AddComponent( new CurtainsComponent( 0x3D9F, 0x3DA7 ), 0, 1, 0 ); + } + else // south + { + AddComponent( new CurtainsComponent( 0x3D9C, 0x3DAD ), 0, 0, 0 ); + AddComponent( new CurtainsComponent( 0x3D9D, 0x3DA3 ), -1, 0, 0 ); + AddComponent( new CurtainsComponent( 0x3DA1, 0x3DA5 ), 2, 0, 0 ); + AddComponent( new CurtainsComponent( 0x3DAB, 0x3DA4 ), 1, 0, 0 ); + } + } + + public CurtainsAddon( 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 CurtainsDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new CurtainsAddon( m_East ); } } + public override int LabelNumber { get { return 1076280; } } // Curtains + + private bool m_East; + + [Constructable] + public CurtainsDeed() : base() + { + LootType = LootType.Blessed; + } + + public CurtainsDeed( 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( 1062334 ); // This item must be in your backpack to be used. + } + + private void SendTarget( Mobile m ) + { + base.OnDoubleClick( m ); + } + + 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 CurtainsDeed m_Deed; + + public InternalGump( CurtainsDeed deed ) : base( 60, 36 ) + { + m_Deed = deed; + + AddPage( 0 ); + + AddBackground( 0, 0, 273, 324, 0x13BE ); + AddImageTiled( 10, 10, 253, 20, 0xA40 ); + AddImageTiled( 10, 40, 253, 244, 0xA40 ); + AddImageTiled( 10, 294, 253, 20, 0xA40 ); + AddAlphaRegion( 10, 10, 253, 304 ); + AddButton( 10, 294, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 45, 296, 450, 20, 1060051, 0x7FFF, false, false ); // CANCEL + AddHtmlLocalized( 14, 12, 273, 20, 1076581, 0x7FFF, false, false ); // Please select your curtain position + + AddPage( 1 ); + + AddButton( 19, 49, 0x845, 0x846, 1, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 44, 47, 213, 20, 1075386, 0x7FFF, false, false ); // South + AddButton( 19, 73, 0x845, 0x846, 2, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 44, 71, 213, 20, 1075387, 0x7FFF, false, false ); // East + } + + public override void OnResponse( NetState sender, RelayInfo info ) + { + if ( m_Deed == null || m_Deed.Deleted || info.ButtonID == 0 ) + return; + + m_Deed.m_East = ( info.ButtonID != 1 ); + m_Deed.SendTarget( sender.Mobile ); + } + } + } +} diff --git a/Scripts/Items/Special/Heritage Items/Fountain.cs b/Scripts/Items/Special/Heritage Items/Fountain.cs new file mode 100644 index 000000000..1ce408c04 --- /dev/null +++ b/Scripts/Items/Special/Heritage Items/Fountain.cs @@ -0,0 +1,62 @@ +using System; + +namespace Server.Items +{ + public class FountainAddon : StoneFountainAddon + { + public override BaseAddonDeed Deed { get { return new FountainDeed(); } } + + [Constructable] + public FountainAddon() : base() + { + } + + public FountainAddon( 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 FountainDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new FountainAddon(); } } + public override int LabelNumber { get { return 1076283; } } // Fountain + + [Constructable] + public FountainDeed() : base() + { + LootType = LootType.Blessed; + } + + public FountainDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Heritage Items/FruitTrees.cs b/Scripts/Items/Special/Heritage Items/FruitTrees.cs new file mode 100644 index 000000000..7f15e0b4d --- /dev/null +++ b/Scripts/Items/Special/Heritage Items/FruitTrees.cs @@ -0,0 +1,215 @@ +using System; +using Server; +using Server.Network; + +namespace Server.Items +{ + public abstract class BaseFruitTreeAddon : BaseAddon + { + public override abstract BaseAddonDeed Deed { get; } + public abstract Item Fruit { get; } + + private int m_Fruits; + + [CommandProperty( AccessLevel.GameMaster )] + public int Fruits + { + get { return m_Fruits; } + set + { + if ( value < 0 ) + m_Fruits = 0; + else + m_Fruits = value; + } + } + + public BaseFruitTreeAddon() : base() + { + Timer.DelayCall( TimeSpan.FromMinutes( 5 ), new TimerCallback( Respawn ) ); + } + + public BaseFruitTreeAddon( Serial serial ) : base( serial ) + { + } + + public override void OnComponentUsed( AddonComponent c, Mobile from ) + { + if ( from.InRange( c.Location, 2 ) ) + { + if ( m_Fruits > 0 ) + { + Item fruit = Fruit; + + if ( fruit == null ) + return; + + if ( !from.PlaceInBackpack( fruit ) ) + { + fruit.Delete(); + from.SendLocalizedMessage( 501015 ); // There is no room in your backpack for the fruit. + } + else + { + if ( --m_Fruits == 0 ) + Timer.DelayCall( TimeSpan.FromMinutes( 30 ), new TimerCallback( Respawn ) ); + + from.SendLocalizedMessage( 501016 ); // You pick some fruit and put it in your backpack. + } + } + else + from.SendLocalizedMessage( 501017 ); // There is no more fruit on this tree + } + else + from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. + } + + private void Respawn() + { + m_Fruits = Utility.RandomMinMax( 1, 4 ); + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.WriteEncodedInt( 0 ); // version + + writer.Write( (int) m_Fruits ); + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + int version = reader.ReadEncodedInt(); + + m_Fruits = reader.ReadInt(); + + if ( m_Fruits == 0 ) + Respawn(); + } + } + + public class AppleTreeAddon : BaseFruitTreeAddon + { + public override BaseAddonDeed Deed { get { return new AppleTreeDeed(); } } + public override Item Fruit { get { return new Apple(); } } + + [Constructable] + public AppleTreeAddon() : base() + { + AddComponent( new LocalizedAddonComponent( 0xD98, 1076269 ), 0, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0x3124, 1076269 ), 0, 0, 0 ); + } + + public AppleTreeAddon( 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 AppleTreeDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new AppleTreeAddon(); } } + public override int LabelNumber { get { return 1076269; } } // Apple Tree + + [Constructable] + public AppleTreeDeed() : base() + { + LootType = LootType.Blessed; + } + + public AppleTreeDeed( 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 PeachTreeAddon : BaseFruitTreeAddon + { + public override BaseAddonDeed Deed { get { return new PeachTreeDeed(); } } + public override Item Fruit { get { return new Peach(); } } + + [Constructable] + public PeachTreeAddon() : base() + { + AddComponent( new LocalizedAddonComponent( 0xD9C, 1076270 ), 0, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0x3123, 1076270 ), 0, 0, 0 ); + } + + public PeachTreeAddon( 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 PeachTreeDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new PeachTreeAddon(); } } + public override int LabelNumber { get { return 1076270; } } // Peach Tree + + [Constructable] + public PeachTreeDeed() : base() + { + LootType = LootType.Blessed; + } + + public PeachTreeDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Heritage Items/GoldenDecorativeRug.cs b/Scripts/Items/Special/Heritage Items/GoldenDecorativeRug.cs new file mode 100644 index 000000000..480504ad9 --- /dev/null +++ b/Scripts/Items/Special/Heritage Items/GoldenDecorativeRug.cs @@ -0,0 +1,71 @@ +using System; + +namespace Server.Items +{ + public class GoldenDecorativeRugAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new GoldenDecorativeRugDeed(); } } + + [Constructable] + public GoldenDecorativeRugAddon() : base() + { + AddComponent( new LocalizedAddonComponent( 0xADB, 1076586 ), 1, 1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xADC, 1076586 ), -1, -1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xADD, 1076586 ), -1, 1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xADE, 1076586 ), 1, -1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xADF, 1076586 ), -1, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAE0, 1076586 ), 0, -1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAE1, 1076586 ), 1, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAE2, 1076586 ), 0, 1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xADA, 1076586 ), 0, 0, 0 ); + } + + public GoldenDecorativeRugAddon( 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 GoldenDecorativeRugDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new GoldenDecorativeRugAddon(); } } + public override int LabelNumber { get { return 1076586; } } // Golden decorative rug + + [Constructable] + public GoldenDecorativeRugDeed() : base() + { + LootType = LootType.Blessed; + } + + public GoldenDecorativeRugDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Heritage Items/Guillotine.cs b/Scripts/Items/Special/Heritage Items/Guillotine.cs new file mode 100644 index 000000000..5811513e9 --- /dev/null +++ b/Scripts/Items/Special/Heritage Items/Guillotine.cs @@ -0,0 +1,174 @@ +using System; +using Server; +using Server.Spells; +using Server.Network; + +namespace Server.Items +{ + [Flipable( 0x125E, 0x1230 )] + public class GuillotineComponent : AddonComponent + { + public override int LabelNumber { get { return 1024656; } } // Guillotine + + public GuillotineComponent() : base( 0x125E ) + { + } + + public GuillotineComponent( 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 GuillotineAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new GuillotineDeed(); } } + + public GuillotineAddon() : base() + { + AddComponent( new GuillotineComponent(), 0, 0, 0 ); + } + + public GuillotineAddon( Serial serial ) : base( serial ) + { + } + + public override void OnComponentUsed( AddonComponent c, Mobile from ) + { + if ( from.InRange( Location, 2 ) ) + { + if ( Utility.RandomBool() ) + { + from.Location = Location; + + Timer.DelayCall( TimeSpan.FromSeconds( 0.5 ), new TimerStateCallback( Activate ), new object[] { c, from } ); + } + else + from.LocalOverheadMessage( MessageType.Regular, 0, 501777 ); // Hmm... you suspect that if you used this again, it might hurt. + } + else + from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. + } + + 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 void Activate( object obj ) + { + object[] param = (object[]) obj; + + if ( param[ 0 ] is AddonComponent && param[ 1 ] is Mobile ) + Activate( (AddonComponent) param[ 0 ], (Mobile) param[ 1 ] ); + } + + public virtual void Activate( AddonComponent c, Mobile from ) + { + if ( c.ItemID == 0x125E ) + c.ItemID = 0x1269; + else + c.ItemID = 0x1247; + + // blood + int amount = Utility.RandomMinMax( 3, 7 ); + + for ( int i = 0; i < amount; i++ ) + { + int x = c.X + Utility.RandomMinMax( -1, 1 ); + int y = c.Y + Utility.RandomMinMax( -1, 1 ); + int z = c.Z; + + if ( !c.Map.CanFit( x, y, z, 1, false, false, true ) ) + { + z = c.Map.GetAverageZ( x, y ); + + if ( !c.Map.CanFit( x, y, z, 1, false, false, true ) ) + continue; + } + + Blood blood = new Blood( Utility.RandomMinMax( 0x122C, 0x122F ) ); + blood.MoveToWorld( new Point3D( x, y, z ), c.Map ); + } + + if ( from.Female ) + from.PlaySound( Utility.RandomMinMax( 0x150, 0x153 ) ); + else + from.PlaySound( Utility.RandomMinMax( 0x15A, 0x15D ) ); + + from.LocalOverheadMessage( MessageType.Regular, 0, 501777 ); // Hmm... you suspect that if you used this again, it might hurt. + SpellHelper.Damage( TimeSpan.Zero, from, Utility.Dice( 2, 10, 5 ) ); + + Timer.DelayCall( TimeSpan.FromSeconds( 0.5 ), TimeSpan.FromSeconds( 0.5 ), 2, new TimerStateCallback( Deactivate ), c ); + } + + private void Deactivate( object obj ) + { + if ( obj is AddonComponent ) + { + AddonComponent c = (AddonComponent) obj; + + if ( c.ItemID == 0x1269 ) + c.ItemID = 0x1260; + else if ( c.ItemID == 0x1260 ) + c.ItemID = 0x125E; + else if ( c.ItemID == 0x1247 ) + c.ItemID = 0x1246; + else if ( c.ItemID == 0x1246 ) + c.ItemID = 0x1230; + } + } + } + + public class GuillotineDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new GuillotineAddon(); } } + public override int LabelNumber { get { return 1024656; } } // Guillotine + + [Constructable] + public GuillotineDeed() : base() + { + LootType = LootType.Blessed; + } + + public GuillotineDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Heritage Items/HangingAxes.cs b/Scripts/Items/Special/Heritage Items/HangingAxes.cs new file mode 100644 index 000000000..2dba420b9 --- /dev/null +++ b/Scripts/Items/Special/Heritage Items/HangingAxes.cs @@ -0,0 +1,130 @@ +using System; +using Server; +using Server.Gumps; +using Server.Network; + +namespace Server.Items +{ + public class HangingAxesAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new HangingAxesDeed(); } } + + [Constructable] + public HangingAxesAddon( bool east ) : base() + { + if ( east ) // east + { + AddComponent( new LocalizedAddonComponent( 0x156A, 1076271 ), 0, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0x156B, 1076271 ), 0, -1, 0 ); + } + else // south + { + AddComponent( new LocalizedAddonComponent( 0x1568, 1076271 ), 0, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0x1569, 1076271 ), 1, 0, 0 ); + } + } + + public HangingAxesAddon( 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 HangingAxesDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new HangingAxesAddon( m_East ); } } + public override int LabelNumber { get { return 1076271; } } // Hanging Axes + + private bool m_East; + + [Constructable] + public HangingAxesDeed() : base() + { + LootType = LootType.Blessed; + } + + public HangingAxesDeed( 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( 1062334 ); // This item must be in your backpack to be used. + } + + private void SendTarget( Mobile m ) + { + base.OnDoubleClick( m ); + } + + 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 HangingAxesDeed m_Deed; + + public InternalGump( HangingAxesDeed deed ) : base( 60, 36 ) + { + m_Deed = deed; + + AddPage( 0 ); + + AddBackground( 0, 0, 273, 324, 0x13BE ); + AddImageTiled( 10, 10, 253, 20, 0xA40 ); + AddImageTiled( 10, 40, 253, 244, 0xA40 ); + AddImageTiled( 10, 294, 253, 20, 0xA40 ); + AddAlphaRegion( 10, 10, 253, 304 ); + AddButton( 10, 294, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 45, 296, 450, 20, 1060051, 0x7FFF, false, false ); // CANCEL + AddHtmlLocalized( 14, 12, 273, 20, 1076745, 0x7FFF, false, false ); // Please select your hanging axe position + + AddPage( 1 ); + + AddButton( 19, 49, 0x845, 0x846, 1, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 44, 47, 213, 20, 1075386, 0x7FFF, false, false ); // South + AddButton( 19, 73, 0x845, 0x846, 2, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 44, 71, 213, 20, 1075387, 0x7FFF, false, false ); // East + } + + public override void OnResponse( NetState sender, RelayInfo info ) + { + if ( m_Deed == null || m_Deed.Deleted || info.ButtonID == 0 ) + return; + + m_Deed.m_East = ( info.ButtonID != 1 ); + m_Deed.SendTarget( sender.Mobile ); + } + } + } +} diff --git a/Scripts/Items/Special/Heritage Items/HangingSwords.cs b/Scripts/Items/Special/Heritage Items/HangingSwords.cs new file mode 100644 index 000000000..2dd819c7e --- /dev/null +++ b/Scripts/Items/Special/Heritage Items/HangingSwords.cs @@ -0,0 +1,130 @@ +using System; +using Server; +using Server.Gumps; +using Server.Network; + +namespace Server.Items +{ + public class HangingSwordsAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new HangingSwordsDeed(); } } + + [Constructable] + public HangingSwordsAddon( bool east ) : base() + { + if ( east ) // east + { + AddComponent( new LocalizedAddonComponent( 0x1566, 1076272 ), 0, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0x1567, 1076272 ), 0, -1, 0 ); + } + else // south + { + AddComponent( new LocalizedAddonComponent( 0x1564, 1076272 ), 0, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0x1565, 1076272 ), 1, 0, 0 ); + } + } + + public HangingSwordsAddon( 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 HangingSwordsDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new HangingSwordsAddon( m_East ); } } + public override int LabelNumber { get { return 1076272; } } // Hanging Swords + + private bool m_East; + + [Constructable] + public HangingSwordsDeed() : base() + { + LootType = LootType.Blessed; + } + + public HangingSwordsDeed( 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( 1062334 ); // This item must be in your backpack to be used. + } + + private void SendTarget( Mobile m ) + { + base.OnDoubleClick( m ); + } + + 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 HangingSwordsDeed m_Deed; + + public InternalGump( HangingSwordsDeed deed ) : base( 60, 36 ) + { + m_Deed = deed; + + AddPage( 0 ); + + AddBackground( 0, 0, 273, 324, 0x13BE ); + AddImageTiled( 10, 10, 253, 20, 0xA40 ); + AddImageTiled( 10, 40, 253, 244, 0xA40 ); + AddImageTiled( 10, 294, 253, 20, 0xA40 ); + AddAlphaRegion( 10, 10, 253, 304 ); + AddButton( 10, 294, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 45, 296, 450, 20, 1060051, 0x7FFF, false, false ); // CANCEL + AddHtmlLocalized( 14, 12, 273, 20, 1076746, 0x7FFF, false, false ); // Please select your hanging sword position + + AddPage( 1 ); + + AddButton( 19, 49, 0x845, 0x846, 1, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 44, 47, 213, 20, 1075386, 0x7FFF, false, false ); // South + AddButton( 19, 73, 0x845, 0x846, 2, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 44, 71, 213, 20, 1075387, 0x7FFF, false, false ); // East + } + + public override void OnResponse( NetState sender, RelayInfo info ) + { + if ( m_Deed == null || m_Deed.Deleted || info.ButtonID == 0 ) + return; + + m_Deed.m_East = ( info.ButtonID != 1 ); + m_Deed.SendTarget( sender.Mobile ); + } + } + } +} diff --git a/Scripts/Items/Special/Heritage Items/HouseLadder.cs b/Scripts/Items/Special/Heritage Items/HouseLadder.cs new file mode 100644 index 000000000..5aec22e11 --- /dev/null +++ b/Scripts/Items/Special/Heritage Items/HouseLadder.cs @@ -0,0 +1,170 @@ +using System; +using Server; +using Server.Gumps; +using Server.Network; + +namespace Server.Items +{ + public class HouseLadderAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new HouseLadderDeed(); } } + + [Constructable] + public HouseLadderAddon( int type ) : base() + { + switch ( type ) + { + case 0: // castle south + AddComponent( new LocalizedAddonComponent( 0x3DB2, 1076791 ), 0, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0x3F28, 1076791 ), 0, 1, 28 ); + AddComponent( new LocalizedAddonComponent( 0x3DB4, 1076791 ), 0, 2, 20 ); + break; + case 1: // castle east + AddComponent( new LocalizedAddonComponent( 0x3DB3, 1076791 ), 0, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0x3F28, 1076791 ), 1, 0, 28 ); + AddComponent( new LocalizedAddonComponent( 0x3DB5, 1076791 ), 2, 0, 20 ); + break; + case 2: // castle north + AddComponent( new LocalizedAddonComponent( 0x2FDF, 1076791 ), 0, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0x3F28, 1076791 ), 0, -1, 28 ); + AddComponent( new LocalizedAddonComponent( 0x3DB6, 1076791 ), 0, -2, 20 ); + break; + case 3: // castle west + AddComponent( new LocalizedAddonComponent( 0x2FDE, 1076791 ), 0, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0x3F28, 1076791 ), -1, 0, 28 ); + AddComponent( new LocalizedAddonComponent( 0x3DB7, 1076791 ), -2, 0, 20 ); + break; + case 4: // south + AddComponent( new LocalizedAddonComponent( 0x3DB2, 1076287 ), 0, 0, 0 ); + break; + case 5: // east + AddComponent( new LocalizedAddonComponent( 0x3DB3, 1076287 ), 0, 0, 0 ); + break; + case 6: // north + AddComponent( new LocalizedAddonComponent( 0x2FDF, 1076287 ), 0, 0, 0 ); + break; + case 7: // west + AddComponent( new LocalizedAddonComponent( 0x2FDE, 1076287 ), 0, 0, 0 ); + break; + } + } + + public HouseLadderAddon( 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 HouseLadderDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new HouseLadderAddon( m_Type ); } } + public override int LabelNumber { get { return 1076287; } } // Ladder + + private int m_Type; + + [Constructable] + public HouseLadderDeed() : base() + { + LootType = LootType.Blessed; + } + + public HouseLadderDeed( 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( 1062334 ); // This item must be in your backpack to be used. + } + + private void SendTarget( Mobile m ) + { + base.OnDoubleClick( m ); + } + + 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 HouseLadderDeed m_Deed; + + public InternalGump( HouseLadderDeed deed ) : base( 60, 36 ) + { + m_Deed = deed; + + AddPage( 0 ); + + AddBackground( 0, 0, 273, 324, 0x13BE ); + AddImageTiled( 10, 10, 253, 20, 0xA40 ); + AddImageTiled( 10, 40, 253, 244, 0xA40 ); + AddImageTiled( 10, 294, 253, 20, 0xA40 ); + AddAlphaRegion( 10, 10, 253, 304 ); + AddButton( 10, 294, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 45, 296, 450, 20, 1060051, 0x7FFF, false, false ); // CANCEL + AddHtmlLocalized( 14, 12, 273, 20, 1076780, 0x7FFF, false, false ); // Please select your ladder position.
Use the ladders marked (castle)
for accessing the tops of keeps
and castles. + + AddPage( 1 ); + + AddButton( 19, 49, 0x845, 0x846, 1, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 44, 47, 213, 20, 1076794, 0x7FFF, false, false ); // South (Castle) + AddButton( 19, 73, 0x845, 0x846, 2, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 44, 71, 213, 20, 1076795, 0x7FFF, false, false ); // East (Castle) + AddButton( 19, 97, 0x845, 0x846, 3, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 44, 95, 213, 20, 1076792, 0x7FFF, false, false ); // North (Castle) + AddButton( 19, 121, 0x845, 0x846, 4, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 44, 119, 213, 20, 1076793, 0x7FFF, false, false ); // West (Castle) + AddButton( 19, 145, 0x845, 0x846, 5, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 44, 143, 213, 20, 1075386, 0x7FFF, false, false ); // South + AddButton( 19, 169, 0x845, 0x846, 6, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 44, 167, 213, 20, 1075387, 0x7FFF, false, false ); // East + AddButton( 19, 193, 0x845, 0x846, 7, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 44, 191, 213, 20, 1075389, 0x7FFF, false, false ); // North + AddButton( 19, 217, 0x845, 0x846, 8, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 44, 215, 213, 20, 1075390, 0x7FFF, false, false ); // West + } + + public override void OnResponse( NetState sender, RelayInfo info ) + { + if ( m_Deed == null || m_Deed.Deleted || info.ButtonID == 0 ) + return; + + if ( info.ButtonID >= 1 && info.ButtonID <= 8 ) + { + m_Deed.m_Type = info.ButtonID - 1; + m_Deed.SendTarget( sender.Mobile ); + } + } + } + } +} diff --git a/Scripts/Items/Special/Heritage Items/IronMaiden.cs b/Scripts/Items/Special/Heritage Items/IronMaiden.cs new file mode 100644 index 000000000..7623e8c94 --- /dev/null +++ b/Scripts/Items/Special/Heritage Items/IronMaiden.cs @@ -0,0 +1,136 @@ +using System; +using Server; +using Server.Spells; +using Server.Network; + +namespace Server.Items +{ + public class IronMaidenAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new IronMaidenDeed(); } } + + public IronMaidenAddon() : base() + { + AddComponent( new LocalizedAddonComponent( 0x1249, 1076288 ), 0, 0, 0 ); + } + + public IronMaidenAddon( Serial serial ) : base( serial ) + { + } + + public override void OnComponentUsed( AddonComponent c, Mobile from ) + { + if ( from.InRange( Location, 2 ) ) + { + if ( Utility.RandomBool() ) + { + from.Location = Location; + c.ItemID = 0x124A; + + Timer.DelayCall( TimeSpan.FromSeconds( 0.5 ), TimeSpan.FromSeconds( 0.5 ), 3, new TimerStateCallback( Activate ), new object[] { c, from } ); + } + else + from.LocalOverheadMessage( MessageType.Regular, 0, 501777 ); // Hmm... you suspect that if you used this again, it might hurt. + } + else + from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. + } + + 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 void Activate( object obj ) + { + object[] param = (object[]) obj; + + if ( param[ 0 ] is AddonComponent && param[ 1 ] is Mobile ) + Activate( (AddonComponent) param[ 0 ], (Mobile) param[ 1 ] ); + } + + public virtual void Activate( AddonComponent c, Mobile from ) + { + c.ItemID += 1; + + if ( c.ItemID >= 0x124D ) + { + // blood + int amount = Utility.RandomMinMax( 3, 7 ); + + for ( int i = 0; i < amount; i++ ) + { + int x = c.X + Utility.RandomMinMax( -1, 1 ); + int y = c.Y + Utility.RandomMinMax( -1, 1 ); + int z = c.Z; + + if ( !c.Map.CanFit( x, y, z, 1, false, false, true ) ) + { + z = c.Map.GetAverageZ( x, y ); + + if ( !c.Map.CanFit( x, y, z, 1, false, false, true ) ) + continue; + } + + Blood blood = new Blood( Utility.RandomMinMax( 0x122C, 0x122F ) ); + blood.MoveToWorld( new Point3D( x, y, z ), c.Map ); + } + + if ( from.Female ) + from.PlaySound( Utility.RandomMinMax( 0x150, 0x153 ) ); + else + from.PlaySound( Utility.RandomMinMax( 0x15A, 0x15D ) ); + + from.LocalOverheadMessage( MessageType.Regular, 0, 501777 ); // Hmm... you suspect that if you used this again, it might hurt. + SpellHelper.Damage( TimeSpan.Zero, from, Utility.Dice( 2, 10, 5 ) ); + + Timer.DelayCall( TimeSpan.FromSeconds( 1 ), new TimerStateCallback( Deactivate ), c ); + } + } + + private void Deactivate( object obj ) + { + if ( obj is AddonComponent ) + ( (AddonComponent) obj ).ItemID = 0x1249; + } + } + + public class IronMaidenDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new IronMaidenAddon(); } } + public override int LabelNumber { get { return 1076288; } } // Iron Maiden + + [Constructable] + public IronMaidenDeed() : base() + { + LootType = LootType.Blessed; + } + + public IronMaidenDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Heritage Items/LargeFishingNet.cs b/Scripts/Items/Special/Heritage Items/LargeFishingNet.cs new file mode 100644 index 000000000..6ce068db2 --- /dev/null +++ b/Scripts/Items/Special/Heritage Items/LargeFishingNet.cs @@ -0,0 +1,91 @@ +using System; + +namespace Server.Items +{ + [Flipable( 0x3D8E, 0x3D8F )] + public class LargeFishingNetComponent : AddonComponent + { + public override int LabelNumber { get { return 1076285; } } // Large Fish Net + + public LargeFishingNetComponent() : base( 0x3D8E ) + { + } + + public LargeFishingNetComponent( 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 LargeFishingNetAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new LargeFishingNetDeed(); } } + + [Constructable] + public LargeFishingNetAddon() : base() + { + AddComponent( new LargeFishingNetComponent(), 0, 0, 0 ); + } + + public LargeFishingNetAddon( 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 LargeFishingNetDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new LargeFishingNetAddon(); } } + public override int LabelNumber { get { return 1076285; } } // Large Fish Net + + [Constructable] + public LargeFishingNetDeed() : base() + { + LootType = LootType.Blessed; + } + + public LargeFishingNetDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Heritage Items/PeachTrunk.cs b/Scripts/Items/Special/Heritage Items/PeachTrunk.cs new file mode 100644 index 000000000..2b238b682 --- /dev/null +++ b/Scripts/Items/Special/Heritage Items/PeachTrunk.cs @@ -0,0 +1,63 @@ +using System; + +namespace Server.Items +{ + public class PeachTrunkAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new PeachTrunkDeed(); } } + + [Constructable] + public PeachTrunkAddon() : base() + { + AddComponent( new LocalizedAddonComponent( 0xD9C, 1076786 ), 0, 0, 0 ); + } + + public PeachTrunkAddon( 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 PeachTrunkDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new PeachTrunkAddon(); } } + public override int LabelNumber { get { return 1076786; } } // Peach Trunk + + [Constructable] + public PeachTrunkDeed() : base() + { + LootType = LootType.Blessed; + } + + public PeachTrunkDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Heritage Items/PinkFancyRug.cs b/Scripts/Items/Special/Heritage Items/PinkFancyRug.cs new file mode 100644 index 000000000..39dde0b6c --- /dev/null +++ b/Scripts/Items/Special/Heritage Items/PinkFancyRug.cs @@ -0,0 +1,71 @@ +using System; + +namespace Server.Items +{ + public class PinkFancyRugAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new PinkFancyRugDeed(); } } + + [Constructable] + public PinkFancyRugAddon() : base() + { + AddComponent( new LocalizedAddonComponent( 0xAEE, 1076590 ), 1, 1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAEF, 1076590 ), -1, -1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAF0, 1076590 ), -1, 1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAF1, 1076590 ), 1, -1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAF2, 1076590 ), -1, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAF3, 1076590 ), 0, -1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAF4, 1076590 ), 1, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAF5, 1076590 ), 0, 1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAEC, 1076590 ), 0, 0, 0 ); + } + + public PinkFancyRugAddon( 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 PinkFancyRugDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new PinkFancyRugAddon(); } } + public override int LabelNumber { get { return 1076590; } } // Pink fancy rug + + [Constructable] + public PinkFancyRugDeed() : base() + { + LootType = LootType.Blessed; + } + + public PinkFancyRugDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Heritage Items/RedPlainRug.cs b/Scripts/Items/Special/Heritage Items/RedPlainRug.cs new file mode 100644 index 000000000..9f6a0e699 --- /dev/null +++ b/Scripts/Items/Special/Heritage Items/RedPlainRug.cs @@ -0,0 +1,71 @@ +using System; + +namespace Server.Items +{ + public class RedPlainRugAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new RedPlainRugDeed(); } } + + [Constructable] + public RedPlainRugAddon() : base() + { + AddComponent( new LocalizedAddonComponent( 0xAC9, 1076588 ), 1, 1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xACA, 1076588 ), -1, -1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xACB, 1076588 ), -1, 1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xACC, 1076588 ), 1, -1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xACD, 1076588 ), -1, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0xACE, 1076588 ), 0, -1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xACF, 1076588 ), 1, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAD0, 1076588 ), 0, 1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xAC6, 1076588 ), 0, 0, 0 ); + } + + public RedPlainRugAddon( 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 RedPlainRugDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new RedPlainRugAddon(); } } + public override int LabelNumber { get { return 1076588; } } // Red plain rug + + [Constructable] + public RedPlainRugDeed() : base() + { + LootType = LootType.Blessed; + } + + public RedPlainRugDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Heritage Items/Scarecrow.cs b/Scripts/Items/Special/Heritage Items/Scarecrow.cs new file mode 100644 index 000000000..01a5df3f6 --- /dev/null +++ b/Scripts/Items/Special/Heritage Items/Scarecrow.cs @@ -0,0 +1,91 @@ +using System; + +namespace Server.Items +{ + [Flipable( 0x1E34, 0x1E35 )] + public class ScarecrowComponent : AddonComponent + { + public override int LabelNumber { get { return 1076608; } } // Scarecrow + + public ScarecrowComponent() : base( 0x1E34 ) + { + } + + public ScarecrowComponent( 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 ScarecrowAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new ScarecrowDeed(); } } + + [Constructable] + public ScarecrowAddon() : base() + { + AddComponent( new ScarecrowComponent(), 0, 0, 0 ); + } + + public ScarecrowAddon( 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 ScarecrowDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new ScarecrowAddon(); } } + public override int LabelNumber { get { return 1076608; } } // Scarecrow + + [Constructable] + public ScarecrowDeed() : base() + { + LootType = LootType.Blessed; + } + + public ScarecrowDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Heritage Items/SmallFishingNet.cs b/Scripts/Items/Special/Heritage Items/SmallFishingNet.cs new file mode 100644 index 000000000..e79e4be04 --- /dev/null +++ b/Scripts/Items/Special/Heritage Items/SmallFishingNet.cs @@ -0,0 +1,91 @@ +using System; + +namespace Server.Items +{ + [Flipable( 0x1EA3, 0x1EA4 )] + public class SmallFishingNetComponent : AddonComponent + { + public override int LabelNumber { get { return 1076286; } } // Small Fish Net + + public SmallFishingNetComponent() : base( 0x1EA3 ) + { + } + + public SmallFishingNetComponent( 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 SmallFishingNetAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new SmallFishingNetDeed(); } } + + [Constructable] + public SmallFishingNetAddon() : base() + { + AddComponent( new SmallFishingNetComponent(), 0, 0, 0 ); + } + + public SmallFishingNetAddon( 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 SmallFishingNetDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new SmallFishingNetAddon(); } } + public override int LabelNumber { get { return 1076286; } } // Small Fish Net + + [Constructable] + public SmallFishingNetDeed() : base() + { + LootType = LootType.Blessed; + } + + public SmallFishingNetDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Heritage Items/Statue.cs b/Scripts/Items/Special/Heritage Items/Statue.cs new file mode 100644 index 000000000..83bc7915e --- /dev/null +++ b/Scripts/Items/Special/Heritage Items/Statue.cs @@ -0,0 +1,132 @@ +using System; +using Server; +using Server.Gumps; +using Server.Network; + +namespace Server.Items +{ + public class StoneStatueAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new StoneStatueDeed(); } } + + [Constructable] + public StoneStatueAddon( bool east ) : base() + { + if ( east ) // east + { + AddComponent( new LocalizedAddonComponent( 0x139E, 1076284 ), 0, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0x139F, 1076284 ), -1, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0x13A0, 1076284 ), 0, -1, 0 ); + } + else // south + { + AddComponent( new LocalizedAddonComponent( 0x129F, 1076284 ), 0, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0x12A0, 1076284 ), 0, -1, 0 ); + AddComponent( new LocalizedAddonComponent( 0x12A1, 1076284 ), -1, 0, 0 ); + } + } + + public StoneStatueAddon( 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 StoneStatueDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new StoneStatueAddon( m_East ); } } + public override int LabelNumber { get { return 1076284; } } // Statue + + private bool m_East; + + [Constructable] + public StoneStatueDeed() : base() + { + LootType = LootType.Blessed; + } + + public StoneStatueDeed( 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( 1062334 ); // This item must be in your backpack to be used. + } + + private void SendTarget( Mobile m ) + { + base.OnDoubleClick( m ); + } + + 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 StoneStatueDeed m_Deed; + + public InternalGump( StoneStatueDeed deed ) : base( 60, 36 ) + { + m_Deed = deed; + + AddPage( 0 ); + + AddBackground( 0, 0, 273, 324, 0x13BE ); + AddImageTiled( 10, 10, 253, 20, 0xA40 ); + AddImageTiled( 10, 40, 253, 244, 0xA40 ); + AddImageTiled( 10, 294, 253, 20, 0xA40 ); + AddAlphaRegion( 10, 10, 253, 304 ); + AddButton( 10, 294, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 45, 296, 450, 20, 1060051, 0x7FFF, false, false ); // CANCEL + AddHtmlLocalized( 14, 12, 273, 20, 1076579, 0x7FFF, false, false ); // Please select your statue position + + AddPage( 1 ); + + AddButton( 19, 49, 0x845, 0x846, 1, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 44, 47, 213, 20, 1075386, 0x7FFF, false, false ); // South + AddButton( 19, 73, 0x845, 0x846, 2, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 44, 71, 213, 20, 1075387, 0x7FFF, false, false ); // East + } + + public override void OnResponse( NetState sender, RelayInfo info ) + { + if ( m_Deed == null || m_Deed.Deleted || info.ButtonID == 0 ) + return; + + m_Deed.m_East = ( info.ButtonID != 1 ); + m_Deed.SendTarget( sender.Mobile ); + } + } + } +} diff --git a/Scripts/Items/Special/Heritage Items/SuitOfGoldArmor.cs b/Scripts/Items/Special/Heritage Items/SuitOfGoldArmor.cs new file mode 100644 index 000000000..4ca7ca854 --- /dev/null +++ b/Scripts/Items/Special/Heritage Items/SuitOfGoldArmor.cs @@ -0,0 +1,91 @@ +using System; + +namespace Server.Items +{ + [Flipable( 0x3DAA, 0x3DA9 )] + public class SuitOfGoldArmorComponent : AddonComponent + { + public override int LabelNumber { get { return 1076265; } } // Suit of Gold Armor + + public SuitOfGoldArmorComponent() : base( 0x3DAA ) + { + } + + public SuitOfGoldArmorComponent( 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 SuitOfGoldArmorAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new SuitOfGoldArmorDeed(); } } + + [Constructable] + public SuitOfGoldArmorAddon() : base() + { + AddComponent( new SuitOfGoldArmorComponent(), 0, 0, 0 ); + } + + public SuitOfGoldArmorAddon( 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 SuitOfGoldArmorDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new SuitOfGoldArmorAddon(); } } + public override int LabelNumber { get { return 1076265; } } // Suit of Gold Armor + + [Constructable] + public SuitOfGoldArmorDeed() : base() + { + LootType = LootType.Blessed; + } + + public SuitOfGoldArmorDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Heritage Items/SuitOfSilverArmor.cs b/Scripts/Items/Special/Heritage Items/SuitOfSilverArmor.cs new file mode 100644 index 000000000..433e428f2 --- /dev/null +++ b/Scripts/Items/Special/Heritage Items/SuitOfSilverArmor.cs @@ -0,0 +1,91 @@ +using System; + +namespace Server.Items +{ + [Flipable( 0x3D86, 0x3D87 )] + public class SuitOfSilverArmorComponent : AddonComponent + { + public override int LabelNumber { get { return 1076266; } } // Suit of Silver Armor + + public SuitOfSilverArmorComponent() : base( 0x3D86 ) + { + } + + public SuitOfSilverArmorComponent( 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 SuitOfSilverArmorAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new SuitOfSilverArmorDeed(); } } + + [Constructable] + public SuitOfSilverArmorAddon() : base() + { + AddComponent( new SuitOfSilverArmorComponent(), 0, 0, 0 ); + } + + public SuitOfSilverArmorAddon( 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 SuitOfSilverArmorDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new SuitOfSilverArmorAddon(); } } + public override int LabelNumber { get { return 1076266; } } // Suit of Silver Armor + + [Constructable] + public SuitOfSilverArmorDeed() : base() + { + LootType = LootType.Blessed; + } + + public SuitOfSilverArmorDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Heritage Items/TableWithBlueCloth.cs b/Scripts/Items/Special/Heritage Items/TableWithBlueCloth.cs new file mode 100644 index 000000000..44e8e319c --- /dev/null +++ b/Scripts/Items/Special/Heritage Items/TableWithBlueCloth.cs @@ -0,0 +1,63 @@ +using System; + +namespace Server.Items +{ + public class TableWithBlueClothAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new TableWithBlueClothDeed(); } } + + [Constructable] + public TableWithBlueClothAddon() : base() + { + AddComponent( new LocalizedAddonComponent( 0x118C, 1076276 ), 0, 0, 0 ); + } + + public TableWithBlueClothAddon( 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 TableWithBlueClothDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new TableWithBlueClothAddon(); } } + public override int LabelNumber { get { return 1076276; } } // Table With A Blue Tablecloth + + [Constructable] + public TableWithBlueClothDeed() : base() + { + LootType = LootType.Blessed; + } + + public TableWithBlueClothDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Heritage Items/TableWithOrangeCloth.cs b/Scripts/Items/Special/Heritage Items/TableWithOrangeCloth.cs new file mode 100644 index 000000000..221652da9 --- /dev/null +++ b/Scripts/Items/Special/Heritage Items/TableWithOrangeCloth.cs @@ -0,0 +1,63 @@ +using System; + +namespace Server.Items +{ + public class TableWithOrangeClothAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new TableWithOrangeClothDeed(); } } + + [Constructable] + public TableWithOrangeClothAddon() : base() + { + AddComponent( new LocalizedAddonComponent( 0x118E, 1076278 ), 0, 0, 0 ); + } + + public TableWithOrangeClothAddon( 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 TableWithOrangeClothDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new TableWithOrangeClothAddon(); } } + public override int LabelNumber { get { return 1076278; } } // Table With An Orange Tablecloth + + [Constructable] + public TableWithOrangeClothDeed() : base() + { + LootType = LootType.Blessed; + } + + public TableWithOrangeClothDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Heritage Items/TableWithPurpleCloth.cs b/Scripts/Items/Special/Heritage Items/TableWithPurpleCloth.cs new file mode 100644 index 000000000..41aec8d9e --- /dev/null +++ b/Scripts/Items/Special/Heritage Items/TableWithPurpleCloth.cs @@ -0,0 +1,63 @@ +using System; + +namespace Server.Items +{ + public class TableWithPurpleClothAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new TableWithPurpleClothDeed(); } } + + [Constructable] + public TableWithPurpleClothAddon() : base() + { + AddComponent( new LocalizedAddonComponent( 0x118B, 1076275 ), 0, 0, 0 ); + } + + public TableWithPurpleClothAddon( 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 TableWithPurpleClothDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new TableWithPurpleClothAddon(); } } + public override int LabelNumber { get { return 1076275; } } // Table With A Purple Tablecloth + + [Constructable] + public TableWithPurpleClothDeed() : base() + { + LootType = LootType.Blessed; + } + + public TableWithPurpleClothDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Heritage Items/TableWithRedCloth.cs b/Scripts/Items/Special/Heritage Items/TableWithRedCloth.cs new file mode 100644 index 000000000..b7a159df3 --- /dev/null +++ b/Scripts/Items/Special/Heritage Items/TableWithRedCloth.cs @@ -0,0 +1,63 @@ +using System; + +namespace Server.Items +{ + public class TableWithRedClothAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new TableWithRedClothDeed(); } } + + [Constructable] + public TableWithRedClothAddon() : base() + { + AddComponent( new LocalizedAddonComponent( 0x118D, 1076277 ), 0, 0, 0 ); + } + + public TableWithRedClothAddon( 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 TableWithRedClothDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new TableWithRedClothAddon(); } } + public override int LabelNumber { get { return 1076277; } } // Table With A Red Tablecloth + + [Constructable] + public TableWithRedClothDeed() : base() + { + LootType = LootType.Blessed; + } + + public TableWithRedClothDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Heritage Items/UnmadeBed.cs b/Scripts/Items/Special/Heritage Items/UnmadeBed.cs new file mode 100644 index 000000000..4d3be6097 --- /dev/null +++ b/Scripts/Items/Special/Heritage Items/UnmadeBed.cs @@ -0,0 +1,134 @@ +using System; +using Server; +using Server.Gumps; +using Server.Network; + +namespace Server.Items +{ + public class UnmadeBedAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new UnmadeBedDeed(); } } + + [Constructable] + public UnmadeBedAddon( bool east ) : base() + { + if ( east ) // east + { + AddComponent( new LocalizedAddonComponent( 0xA8C, 1076279 ), 0, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0xA8D, 1076279 ), 0, -1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xA90, 1076279 ), -1, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0xA91, 1076279 ), -1, -1, 0 ); + } + else // south + { + AddComponent( new LocalizedAddonComponent( 0xDB0, 1076279 ), 0, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0xDB1, 1076279 ), -1, 0, 0 ); + AddComponent( new LocalizedAddonComponent( 0xDB4, 1076279 ), 0, -1, 0 ); + AddComponent( new LocalizedAddonComponent( 0xDB5, 1076279 ), -1, -1, 0 ); + } + } + + public UnmadeBedAddon( 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 UnmadeBedDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new UnmadeBedAddon( m_East ); } } + public override int LabelNumber { get { return 1076279; } } // Unmade Bed + + private bool m_East; + + [Constructable] + public UnmadeBedDeed() : base() + { + LootType = LootType.Blessed; + } + + public UnmadeBedDeed( 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( 1062334 ); // This item must be in your backpack to be used. + } + + private void SendTarget( Mobile m ) + { + base.OnDoubleClick( m ); + } + + 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 UnmadeBedDeed m_Deed; + + public InternalGump( UnmadeBedDeed deed ) : base( 60, 36 ) + { + m_Deed = deed; + + AddPage( 0 ); + + AddBackground( 0, 0, 273, 324, 0x13BE ); + AddImageTiled( 10, 10, 253, 20, 0xA40 ); + AddImageTiled( 10, 40, 253, 244, 0xA40 ); + AddImageTiled( 10, 294, 253, 20, 0xA40 ); + AddAlphaRegion( 10, 10, 253, 304 ); + AddButton( 10, 294, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 45, 296, 450, 20, 1060051, 0x7FFF, false, false ); // CANCEL + AddHtmlLocalized( 14, 12, 273, 20, 1076580, 0x7FFF, false, false ); // Pleae select your unmade bed position + + AddPage( 1 ); + + AddButton( 19, 49, 0x845, 0x846, 1, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 44, 47, 213, 20, 1075386, 0x7FFF, false, false ); // South + AddButton( 19, 73, 0x845, 0x846, 2, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 44, 71, 213, 20, 1075387, 0x7FFF, false, false ); // East + } + + public override void OnResponse( NetState sender, RelayInfo info ) + { + if ( m_Deed == null || m_Deed.Deleted || info.ButtonID == 0 ) + return; + + m_Deed.m_East = ( info.ButtonID != 1 ); + m_Deed.SendTarget( sender.Mobile ); + } + } + } +} diff --git a/Scripts/Items/Special/Heritage Items/Vanity.cs b/Scripts/Items/Special/Heritage Items/Vanity.cs new file mode 100644 index 000000000..d85f5c682 --- /dev/null +++ b/Scripts/Items/Special/Heritage Items/Vanity.cs @@ -0,0 +1,131 @@ +using System; +using Server; +using Server.Gumps; +using Server.Network; + +namespace Server.Items +{ + public class VanityAddon : BaseAddonContainer + { + public override BaseAddonContainerDeed Deed { get { return new VanityDeed(); } } + public override int LabelNumber { get { return 1074027; } } // Vanity + public override int DefaultGumpID { get { return 0x51; } } + public override int DefaultDropSound { get { return 0x42; } } + + [Constructable] + public VanityAddon( bool east ) : base( east ? 0xA44 : 0xA3C ) + { + if ( east ) // east + { + AddComponent( new AddonContainerComponent( 0xA45 ), 0, -1, 0 ); + } + else // south + { + AddComponent( new AddonContainerComponent( 0xA3D ), -1, 0, 0 ); + } + } + + public VanityAddon( 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 VanityDeed : BaseAddonContainerDeed + { + public override BaseAddonContainer Addon { get { return new VanityAddon( m_East ); } } + public override int LabelNumber { get { return 1074027; } } // Vanity + + private bool m_East; + + [Constructable] + public VanityDeed() : base() + { + LootType = LootType.Blessed; + } + + public VanityDeed( 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( 1062334 ); // This item must be in your backpack to be used. + } + + private void SendTarget( Mobile m ) + { + base.OnDoubleClick( m ); + } + + 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 VanityDeed m_Deed; + + public InternalGump( VanityDeed deed ) : base( 60, 36 ) + { + m_Deed = deed; + + AddPage( 0 ); + + AddBackground( 0, 0, 273, 324, 0x13BE ); + AddImageTiled( 10, 10, 253, 20, 0xA40 ); + AddImageTiled( 10, 40, 253, 244, 0xA40 ); + AddImageTiled( 10, 294, 253, 20, 0xA40 ); + AddAlphaRegion( 10, 10, 253, 304 ); + AddButton( 10, 294, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 45, 296, 450, 20, 1060051, 0x7FFF, false, false ); // CANCEL + AddHtmlLocalized( 14, 12, 273, 20, 1076744, 0x7FFF, false, false ); // Please select your vanity position. + + AddPage( 1 ); + + AddButton( 19, 49, 0x845, 0x846, 1, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 44, 47, 213, 20, 1075386, 0x7FFF, false, false ); // South + AddButton( 19, 73, 0x845, 0x846, 2, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 44, 71, 213, 20, 1075387, 0x7FFF, false, false ); // East + } + + public override void OnResponse( NetState sender, RelayInfo info ) + { + if ( m_Deed == null || m_Deed.Deleted || info.ButtonID == 0 ) + return; + + m_Deed.m_East = ( info.ButtonID != 1 ); + m_Deed.SendTarget( sender.Mobile ); + } + } + } +} diff --git a/Scripts/Items/Special/Heritage Items/WallTorch.cs b/Scripts/Items/Special/Heritage Items/WallTorch.cs new file mode 100644 index 000000000..8e8830ae8 --- /dev/null +++ b/Scripts/Items/Special/Heritage Items/WallTorch.cs @@ -0,0 +1,112 @@ +using System; +using Server; +using Server.Spells; +using Server.Network; + +namespace Server.Items +{ + [Flipable( 0x3D98, 0x3D94 )] + public class WallTorchComponent : AddonComponent + { + public override int LabelNumber { get { return 1076282; } } // Wall Torch + + public WallTorchComponent() : base( 0x3D98 ) + { + } + + public WallTorchComponent( Serial serial ) : base( serial ) + { + } + + public override void OnDoubleClick( Mobile from ) + { + if ( from.InRange( Location, 2 ) ) + { + switch ( ItemID ) + { + case 0x3D98: ItemID = 0x3D9B; break; + case 0x3D9B: ItemID = 0x3D98; break; + case 0x3D94: ItemID = 0x3D97; break; + case 0x3D97: ItemID = 0x3D94; break; + } + + Effects.PlaySound( Location, Map, 0x3BE ); + } + else + from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. + } + + 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 WallTorchAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new WallTorchDeed(); } } + + public WallTorchAddon() : base() + { + AddComponent( new WallTorchComponent(), 0, 0, 0 ); + } + + public WallTorchAddon( 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 WallTorchDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new WallTorchAddon(); } } + public override int LabelNumber { get { return 1076282; } } // Wall Torch + + [Constructable] + public WallTorchDeed() : base() + { + LootType = LootType.Blessed; + } + + public WallTorchDeed( 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(); + } + } +} diff --git a/Scripts/Items/Special/Heritage Items/WoodenCoffin.cs b/Scripts/Items/Special/Heritage Items/WoodenCoffin.cs new file mode 100644 index 000000000..b542eee6f --- /dev/null +++ b/Scripts/Items/Special/Heritage Items/WoodenCoffin.cs @@ -0,0 +1,159 @@ +using System; +using Server; +using Server.Gumps; +using Server.Network; + +namespace Server.Items +{ + public class WoodenCoffinComponent : AddonComponent + { + public override int LabelNumber { get { return 1076274; } } // Coffin + + public WoodenCoffinComponent( int itemID ) : base( itemID ) + { + } + + public WoodenCoffinComponent( 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 WoodenCoffinAddon : BaseAddon + { + public override BaseAddonDeed Deed { get { return new WoodenCoffinDeed(); } } + + [Constructable] + public WoodenCoffinAddon( bool east ) : base() + { + if ( east ) // east + { + AddComponent( new WoodenCoffinComponent( 0x1C41 ), 0, 0, 0 ); + AddComponent( new WoodenCoffinComponent( 0x1C42 ), 1, 0, 0 ); + AddComponent( new WoodenCoffinComponent( 0x1C43 ), 2, 0, 0 ); + } + else // south + { + AddComponent( new WoodenCoffinComponent( 0x1C4F ), 0, 0, 0 ); + AddComponent( new WoodenCoffinComponent( 0x1C50 ), 0, 1, 0 ); + AddComponent( new WoodenCoffinComponent( 0x1C51 ), 0, 2, 0 ); + } + } + + public WoodenCoffinAddon( 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 WoodenCoffinDeed : BaseAddonDeed + { + public override BaseAddon Addon { get { return new WoodenCoffinAddon( m_East ); } } + public override int LabelNumber { get { return 1076274; } } // Coffin + + private bool m_East; + + [Constructable] + public WoodenCoffinDeed() : base() + { + LootType = LootType.Blessed; + } + + public WoodenCoffinDeed( 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( 1062334 ); // This item must be in your backpack to be used. + } + + private void SendTarget( Mobile m ) + { + base.OnDoubleClick( m ); + } + + 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 WoodenCoffinDeed m_Deed; + + public InternalGump( WoodenCoffinDeed deed ) : base( 60, 36 ) + { + m_Deed = deed; + + AddPage( 0 ); + + AddBackground( 0, 0, 273, 324, 0x13BE ); + AddImageTiled( 10, 10, 253, 20, 0xA40 ); + AddImageTiled( 10, 40, 253, 244, 0xA40 ); + AddImageTiled( 10, 294, 253, 20, 0xA40 ); + AddAlphaRegion( 10, 10, 253, 304 ); + AddButton( 10, 294, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 45, 296, 450, 20, 1060051, 0x7FFF, false, false ); // CANCEL + AddHtmlLocalized( 14, 12, 273, 20, 1076748, 0x7FFF, false, false ); // Please select your coffin position + + AddPage( 1 ); + + AddButton( 19, 49, 0x845, 0x846, 1, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 44, 47, 213, 20, 1075386, 0x7FFF, false, false ); // South + AddButton( 19, 73, 0x845, 0x846, 2, GumpButtonType.Reply, 0 ); + AddHtmlLocalized( 44, 71, 213, 20, 1075387, 0x7FFF, false, false ); // East + } + + public override void OnResponse( NetState sender, RelayInfo info ) + { + if ( m_Deed == null || m_Deed.Deleted || info.ButtonID == 0 ) + return; + + m_Deed.m_East = ( info.ButtonID != 1 ); + m_Deed.SendTarget( sender.Mobile ); + } + } + } +} diff --git a/Scripts/Items/Special/HeritageToken.cs b/Scripts/Items/Special/HeritageToken.cs new file mode 100644 index 000000000..bfca8a164 --- /dev/null +++ b/Scripts/Items/Special/HeritageToken.cs @@ -0,0 +1,58 @@ +using System; +using Server; +using Server.Gumps; + +namespace Server.Items +{ + public interface ITokunoDyable + { + } + + public class HeritageToken : Item + { + public override int LabelNumber { get { return 1076596; } } // A Heritage Token + + [Constructable] + public HeritageToken() : base( 0x367A ) + { + LootType = LootType.Blessed; + Weight = 5.0; + } + + public HeritageToken( Serial serial ) : base( serial ) + { + } + + public override void OnDoubleClick( Mobile from ) + { + if ( IsChildOf( from.Backpack ) ) + { + from.CloseGump( typeof( HeritageTokenGump ) ); + from.SendGump( new HeritageTokenGump( this ) ); + } + else + from.SendLocalizedMessage( 1062334 ); // This item must be in your backpack to be used. + } + + public override void GetProperties( ObjectPropertyList list ) + { + base.GetProperties( list ); + + list.Add( 1070998, String.Format( "#{0}", 1076595 ) ); // Use this to redeem
Your Heritage Items + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.WriteEncodedInt( (int) 0 ); // version + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + int version = reader.ReadEncodedInt(); + } + } +} diff --git a/Scripts/Items/Talismans/BaseTalisman.cs b/Scripts/Items/Talismans/BaseTalisman.cs new file mode 100644 index 000000000..dc8931b43 --- /dev/null +++ b/Scripts/Items/Talismans/BaseTalisman.cs @@ -0,0 +1,1096 @@ +using System; +using Server.Commands; +using Server.Mobiles; +using Server.Spells.Fifth; +using Server.Spells.First; +using Server.Spells.Fourth; +using Server.Spells.Necromancy; +using Server.Spells.Second; +using Server.Targeting; + +namespace Server.Items +{ + public enum TalismanRemoval + { + None = 0, + Ward = 390, + Damage = 404, + Curse = 407, + Wildfire = 2843 + } + + public class BaseTalisman : Item + { + public static void Initialize() + { + CommandSystem.Register("RandomTalisman", AccessLevel.GameMaster, new CommandEventHandler(RandomTalisman_OnCommand)); + } + + [Usage("RandomTalisman ")] + [Description("Generates random talismans in your backback.")] + public static void RandomTalisman_OnCommand(CommandEventArgs e) + { + Mobile m = e.Mobile; + int count = e.GetInt32(0); + + for (int i = 0; i < count; i++) + { + m.AddToBackpack(Loot.RandomTalisman()); + } + } + + public override int LabelNumber { get { return 1071023; } } // Talisman + public virtual bool ForceShowName { get { return false; } } // used to override default summoner/removal name + + private int m_KarmaLoss; + private int m_MaxCharges; + private int m_Charges; + private int m_MaxChargeTime; + private int m_ChargeTime; + private bool m_Blessed; + + [CommandProperty(AccessLevel.GameMaster)] + public int KarmaLoss + { + get { return m_KarmaLoss; } + set { m_KarmaLoss = value; InvalidateProperties(); } + } + + [CommandProperty(AccessLevel.GameMaster)] + public int MaxCharges + { + get { return m_MaxCharges; } + set { m_MaxCharges = value; InvalidateProperties(); } + } + + [CommandProperty(AccessLevel.GameMaster)] + public int Charges + { + get { return m_Charges; } + set + { + m_Charges = value; + + if (m_ChargeTime > 0) + StartTimer(); + + InvalidateProperties(); + } + } + + [CommandProperty(AccessLevel.GameMaster)] + public int MaxChargeTime + { + get { return m_MaxChargeTime; } + set { m_MaxChargeTime = value; InvalidateProperties(); } + } + + public int ChargeTime + { + get { return m_ChargeTime; } + set { m_ChargeTime = value; InvalidateProperties(); } + } + + [CommandProperty(AccessLevel.GameMaster)] + public bool Blessed + { + get { return m_Blessed; } + set { m_Blessed = value; InvalidateProperties(); } + } + + #region Slayer + private TalismanSlayerName m_Slayer; + + [CommandProperty(AccessLevel.GameMaster)] + public TalismanSlayerName Slayer + { + get { return m_Slayer; } + set { m_Slayer = value; InvalidateProperties(); } + } + #endregion + + #region Summoner/Removal + private TalismanAttribute m_Summoner; + private TalismanRemoval m_Removal; + private Mobile m_Creature; + + [CommandProperty(AccessLevel.GameMaster)] + public TalismanAttribute Summoner + { + get { return m_Summoner; } + set { m_Summoner = value; InvalidateProperties(); } + } + + [CommandProperty(AccessLevel.GameMaster)] + public TalismanRemoval Removal + { + get { return m_Removal; } + set { m_Removal = value; InvalidateProperties(); } + } + #endregion + + #region Protection/Killer + private TalismanAttribute m_Protection; + private TalismanAttribute m_Killer; + + [CommandProperty(AccessLevel.GameMaster)] + public TalismanAttribute Protection + { + get { return m_Protection; } + set { m_Protection = value; InvalidateProperties(); } + } + + [CommandProperty(AccessLevel.GameMaster)] + public TalismanAttribute Killer + { + get { return m_Killer; } + set { m_Killer = value; InvalidateProperties(); } + } + #endregion + + #region Craft bonuses + private SkillName m_Skill; + private int m_SuccessBonus; + private int m_ExceptionalBonus; + + [CommandProperty(AccessLevel.GameMaster)] + public SkillName Skill + { + get { return m_Skill; } + set { m_Skill = value; InvalidateProperties(); } + } + + [CommandProperty(AccessLevel.GameMaster)] + public int SuccessBonus + { + get { return m_SuccessBonus; } + set { m_SuccessBonus = value; InvalidateProperties(); } + } + + [CommandProperty(AccessLevel.GameMaster)] + public int ExceptionalBonus + { + get { return m_ExceptionalBonus; } + set { m_ExceptionalBonus = value; InvalidateProperties(); } + } + #endregion + + #region AOS bonuses + private AosAttributes m_AosAttributes; + private AosSkillBonuses m_AosSkillBonuses; + + [CommandProperty(AccessLevel.GameMaster)] + public AosAttributes Attributes + { + get { return m_AosAttributes; } + set { } + } + + [CommandProperty(AccessLevel.GameMaster)] + public AosSkillBonuses SkillBonuses + { + get { return m_AosSkillBonuses; } + set { } + } + #endregion + + public BaseTalisman() + : this(GetRandomItemID()) + { + } + + public BaseTalisman(int itemID) + : base(itemID) + { + Layer = Layer.Talisman; + Weight = 1.0; + + m_Protection = new TalismanAttribute(); + m_Killer = new TalismanAttribute(); + m_Summoner = new TalismanAttribute(); + m_AosAttributes = new AosAttributes(this); + m_AosSkillBonuses = new AosSkillBonuses(this); + } + + public BaseTalisman(Serial serial) + : base(serial) + { + } + + public override void OnAfterDuped(Item newItem) + { + BaseTalisman talisman = newItem as BaseTalisman; + + if (talisman == null) + return; + + talisman.m_Summoner = new TalismanAttribute(m_Summoner); + talisman.m_Protection = new TalismanAttribute(m_Protection); + talisman.m_Killer = new TalismanAttribute(m_Killer); + talisman.m_AosAttributes = new AosAttributes(newItem, m_AosAttributes); + talisman.m_AosSkillBonuses = new AosSkillBonuses(newItem, m_AosSkillBonuses); + } + + public override bool CanEquip(Mobile m) + { + if (BlessedFor == null || BlessedFor == m) + return base.CanEquip(m); + + return false; + } + + public override void OnAdded(object parent) + { + if (parent is Mobile) + { + Mobile from = (Mobile)parent; + + m_AosSkillBonuses.AddTo(from); + m_AosAttributes.AddStatBonuses(from); + + if (m_Blessed && BlessedFor == null) + { + BlessedFor = from; + LootType = LootType.Blessed; + } + + if (m_ChargeTime > 0) + { + m_ChargeTime = m_MaxChargeTime; + StartTimer(); + } + } + + InvalidateProperties(); + } + + public override void OnRemoved(object parent) + { + if (parent is Mobile) + { + Mobile from = (Mobile)parent; + + m_AosSkillBonuses.Remove(); + m_AosAttributes.RemoveStatBonuses(from); + + if (m_Creature != null && !m_Creature.Deleted) + { + Effects.SendLocationParticles(EffectItem.Create(m_Creature.Location, m_Creature.Map, EffectItem.DefaultDuration), 0x3728, 8, 20, 5042); + Effects.PlaySound(m_Creature, m_Creature.Map, 0x201); + + m_Creature.Delete(); + } + + StopTimer(); + } + + InvalidateProperties(); + } + + public override void OnDoubleClick(Mobile from) + { + if (from.Talisman != this) + from.SendLocalizedMessage(502641); // You must equip this item to use it. + else if (m_ChargeTime > 0) + from.SendLocalizedMessage(1074882, m_ChargeTime.ToString()); // You must wait ~1_val~ seconds for this to recharge. + else if (m_Charges == 0 && m_MaxCharges > 0) + from.SendLocalizedMessage(1042544); // This item is out of charges. + else + { + Type type = GetSummoner(); + + if (m_Summoner != null && !m_Summoner.IsEmpty) + type = m_Summoner.Type; + + if (type != null) + { + object obj; + + try { obj = Activator.CreateInstance(type); } + catch { obj = null; } + + if (obj is Item) + { + Item item = (Item)obj; + int count = 1; + + if (m_Summoner != null && m_Summoner.Amount > 1) + { + if (item.Stackable) + item.Amount = m_Summoner.Amount; + else + count = m_Summoner.Amount; + } + + if (from.Backpack == null || count * item.Weight > from.Backpack.MaxWeight || + from.Backpack.Items.Count + count > from.Backpack.MaxItems) + { + from.SendLocalizedMessage(500720); // You don't have enough room in your backpack! + item.Delete(); + item = null; + return; + } + + for (int i = 0; i < count; i++) + { + from.PlaceInBackpack(item); + + if (i + 1 < count) + item = Activator.CreateInstance(type) as Item; + } + + if (item is Board) + from.SendLocalizedMessage(1075000); // You have been given some wooden boards. + else if (item is IronIngot) + from.SendLocalizedMessage(1075001); // You have been given some ingots. + else if (item is Bandage) + from.SendLocalizedMessage(1075002); // You have been given some clean bandages. + else if (m_Summoner.Name != null) + from.SendLocalizedMessage(1074853, m_Summoner.Name.ToString()); // You have been given ~1_name~ + } + else if (obj is BaseCreature) + { + BaseCreature mob = (BaseCreature)obj; + + if ((m_Creature != null && m_Creature.Deleted) || from.Followers + mob.ControlSlots > from.FollowersMax) + { + from.SendLocalizedMessage(1074270); // You have too many followers to summon another one. + mob.Delete(); + return; + } + + BaseCreature.Summon(mob, from, from.Location, mob.BaseSoundID, TimeSpan.FromMinutes(10)); + Effects.SendLocationParticles(EffectItem.Create(mob.Location, mob.Map, EffectItem.DefaultDuration), 0x3728, 1, 10, 0x26B6); + + mob.Summoned = false; + mob.ControlOrder = OrderType.Friend; + + m_Creature = mob; + } + + OnAfterUse(from); + } + + if (m_Removal != TalismanRemoval.None) + { + from.Target = new TalismanTarget(this); + } + } + } + + public override void AddNameProperty(ObjectPropertyList list) + { + if (ForceShowName) + base.AddNameProperty(list); + else if (m_Summoner != null && !m_Summoner.IsEmpty) + list.Add(1072400, m_Summoner.Name != null ? m_Summoner.Name.ToString() : "Unknown"); // Talisman of ~1_name~ Summoning + else if (m_Removal != TalismanRemoval.None) + list.Add(1072389, "#" + (1072000 + (int)m_Removal)); // Talisman of ~1_name~ + else + base.AddNameProperty(list); + } + + public override void GetProperties(ObjectPropertyList list) + { + base.GetProperties(list); + + if (Blessed) + { + if (BlessedFor != null) + list.Add(1072304, !String.IsNullOrEmpty(BlessedFor.Name) ? BlessedFor.Name : "Unnamed Warrior"); // Owned by ~1_name~ + else + list.Add(1072304, "Nobody"); // Owned by ~1_name~ + } + + if (Parent is Mobile && m_MaxChargeTime > 0) + { + if (m_ChargeTime > 0) + list.Add(1074884, m_ChargeTime.ToString()); // Charge time left: ~1_val~ + else + list.Add(1074883); // Fully Charged + } + + list.Add(1075085); // Requirement: Mondain's Legacy + + if (m_Killer != null && !m_Killer.IsEmpty && m_Killer.Amount > 0) + list.Add(1072388, "{0}\t{1}", m_Killer.Name != null ? m_Killer.Name.ToString() : "Unknown", m_Killer.Amount); // ~1_NAME~ Killer: +~2_val~% + + if (m_Protection != null && !m_Protection.IsEmpty && m_Protection.Amount > 0) + list.Add(1072387, "{0}\t{1}", m_Protection.Name != null ? m_Protection.Name.ToString() : "Unknown", m_Protection.Amount); // ~1_NAME~ Protection: +~2_val~% + + if (m_ExceptionalBonus != 0) + list.Add(1072395, "#{0}\t{1}", 1044060 + (int)m_Skill, m_ExceptionalBonus); // ~1_NAME~ Exceptional Bonus: ~2_val~% + + if (m_SuccessBonus != 0) + list.Add(1072394, "#{0}\t{1}", 1044060 + (int)m_Skill, m_SuccessBonus); // ~1_NAME~ Bonus: ~2_val~% + + m_AosSkillBonuses.GetProperties(list); + + int prop; + + if ((prop = m_AosAttributes.WeaponDamage) != 0) + list.Add(1060401, prop.ToString()); // damage increase ~1_val~% + + if ((prop = m_AosAttributes.DefendChance) != 0) + list.Add(1060408, prop.ToString()); // defense chance increase ~1_val~% + + if ((prop = m_AosAttributes.BonusDex) != 0) + list.Add(1060409, prop.ToString()); // dexterity bonus ~1_val~ + + if ((prop = m_AosAttributes.EnhancePotions) != 0) + list.Add(1060411, prop.ToString()); // enhance potions ~1_val~% + + if ((prop = m_AosAttributes.CastRecovery) != 0) + list.Add(1060412, prop.ToString()); // faster cast recovery ~1_val~ + + if ((prop = m_AosAttributes.CastSpeed) != 0) + list.Add(1060413, prop.ToString()); // faster casting ~1_val~ + + if ((prop = m_AosAttributes.AttackChance) != 0) + list.Add(1060415, prop.ToString()); // hit chance increase ~1_val~% + + if ((prop = m_AosAttributes.BonusHits) != 0) + list.Add(1060431, prop.ToString()); // hit point increase ~1_val~ + + if ((prop = m_AosAttributes.BonusInt) != 0) + list.Add(1060432, prop.ToString()); // intelligence bonus ~1_val~ + + if ((prop = m_AosAttributes.LowerManaCost) != 0) + list.Add(1060433, prop.ToString()); // lower mana cost ~1_val~% + + if ((prop = m_AosAttributes.LowerRegCost) != 0) + list.Add(1060434, prop.ToString()); // lower reagent cost ~1_val~% + + if ((prop = m_AosAttributes.Luck) != 0) + list.Add(1060436, prop.ToString()); // luck ~1_val~ + + if ((prop = m_AosAttributes.BonusMana) != 0) + list.Add(1060439, prop.ToString()); // mana increase ~1_val~ + + if ((prop = m_AosAttributes.RegenMana) != 0) + list.Add(1060440, prop.ToString()); // mana regeneration ~1_val~ + + if ((prop = m_AosAttributes.NightSight) != 0) + list.Add(1060441); // night sight + + if ((prop = m_AosAttributes.ReflectPhysical) != 0) + list.Add(1060442, prop.ToString()); // reflect physical damage ~1_val~% + + if ((prop = m_AosAttributes.RegenStam) != 0) + list.Add(1060443, prop.ToString()); // stamina regeneration ~1_val~ + + if ((prop = m_AosAttributes.RegenHits) != 0) + list.Add(1060444, prop.ToString()); // hit point regeneration ~1_val~ + + if ((prop = m_AosAttributes.SpellChanneling) != 0) + list.Add(1060482); // spell channeling + + if ((prop = m_AosAttributes.SpellDamage) != 0) + list.Add(1060483, prop.ToString()); // spell damage increase ~1_val~% + + if ((prop = m_AosAttributes.BonusStam) != 0) + list.Add(1060484, prop.ToString()); // stamina increase ~1_val~ + + if ((prop = m_AosAttributes.BonusStr) != 0) + list.Add(1060485, prop.ToString()); // strength bonus ~1_val~ + + if ((prop = m_AosAttributes.WeaponSpeed) != 0) + list.Add(1060486, prop.ToString()); // swing speed increase ~1_val~% + + if (m_KarmaLoss != 0) + list.Add(1075210, m_KarmaLoss.ToString()); // Increased Karma Loss ~1val~% + + if (m_MaxCharges > 0) + list.Add(1060741, m_Charges.ToString()); // charges: ~1_val~ + + if (m_Slayer != TalismanSlayerName.None) + list.Add(1072503 + (int)m_Slayer); + } + + private static void SetSaveFlag(ref SaveFlag flags, SaveFlag toSet, bool setIf) + { + if (setIf) + flags |= toSet; + } + + private static bool GetSaveFlag(SaveFlag flags, SaveFlag toGet) + { + return ((flags & toGet) != 0); + } + + [Flags] + private enum SaveFlag + { + None = 0x00000000, + Attributes = 0x00000001, + SkillBonuses = 0x00000002, + Owner = 0x00000004, + Protection = 0x00000008, + Killer = 0x00000010, + Summoner = 0x00000020, + Removal = 0x00000040, + KarmaLoss = 0x00000080, + Skill = 0x00000100, + SuccessBonus = 0x00000200, + ExceptionalBonus = 0x00000400, + MaxCharges = 0x00000800, + Charges = 0x00001000, + MaxChargeTime = 0x00002000, + ChargeTime = 0x00004000, + Blessed = 0x00008000, + Slayer = 0x00010000, + } + + public override void Serialize(GenericWriter writer) + { + base.Serialize(writer); + + writer.Write((int)0); // version + + SaveFlag flags = SaveFlag.None; + + SetSaveFlag(ref flags, SaveFlag.Attributes, !m_AosAttributes.IsEmpty); + SetSaveFlag(ref flags, SaveFlag.SkillBonuses, !m_AosSkillBonuses.IsEmpty); + SetSaveFlag(ref flags, SaveFlag.Protection, m_Protection != null && !m_Protection.IsEmpty); + SetSaveFlag(ref flags, SaveFlag.Killer, m_Killer != null && !m_Killer.IsEmpty); + SetSaveFlag(ref flags, SaveFlag.Summoner, !m_Summoner.IsEmpty); + SetSaveFlag(ref flags, SaveFlag.Removal, m_Removal != TalismanRemoval.None); + SetSaveFlag(ref flags, SaveFlag.KarmaLoss, m_KarmaLoss != 0); + SetSaveFlag(ref flags, SaveFlag.Skill, (int)m_Skill != 0); + SetSaveFlag(ref flags, SaveFlag.SuccessBonus, m_SuccessBonus != 0); + SetSaveFlag(ref flags, SaveFlag.ExceptionalBonus, m_ExceptionalBonus != 0); + SetSaveFlag(ref flags, SaveFlag.MaxCharges, m_MaxCharges != 0); + SetSaveFlag(ref flags, SaveFlag.Charges, m_Charges != 0); + SetSaveFlag(ref flags, SaveFlag.MaxChargeTime, m_MaxChargeTime != 0); + SetSaveFlag(ref flags, SaveFlag.ChargeTime, m_ChargeTime != 0); + SetSaveFlag(ref flags, SaveFlag.Blessed, m_Blessed); + SetSaveFlag(ref flags, SaveFlag.Slayer, m_Slayer != TalismanSlayerName.None); + + writer.WriteEncodedInt((int)flags); + + if (GetSaveFlag(flags, SaveFlag.Attributes)) + m_AosAttributes.Serialize(writer); + + if (GetSaveFlag(flags, SaveFlag.SkillBonuses)) + m_AosSkillBonuses.Serialize(writer); + + if (GetSaveFlag(flags, SaveFlag.Protection)) + m_Protection.Serialize(writer); + + if (GetSaveFlag(flags, SaveFlag.Killer)) + m_Killer.Serialize(writer); + + if (GetSaveFlag(flags, SaveFlag.Summoner)) + m_Summoner.Serialize(writer); + + if (GetSaveFlag(flags, SaveFlag.Removal)) + writer.WriteEncodedInt((int)m_Removal); + + if (GetSaveFlag(flags, SaveFlag.KarmaLoss)) + writer.WriteEncodedInt(m_KarmaLoss); + + if (GetSaveFlag(flags, SaveFlag.Skill)) + writer.WriteEncodedInt((int)m_Skill); + + if (GetSaveFlag(flags, SaveFlag.SuccessBonus)) + writer.WriteEncodedInt(m_SuccessBonus); + + if (GetSaveFlag(flags, SaveFlag.ExceptionalBonus)) + writer.WriteEncodedInt(m_ExceptionalBonus); + + if (GetSaveFlag(flags, SaveFlag.MaxCharges)) + writer.WriteEncodedInt(m_MaxCharges); + + if (GetSaveFlag(flags, SaveFlag.Charges)) + writer.WriteEncodedInt(m_Charges); + + if (GetSaveFlag(flags, SaveFlag.MaxChargeTime)) + writer.WriteEncodedInt(m_MaxChargeTime); + + if (GetSaveFlag(flags, SaveFlag.ChargeTime)) + writer.WriteEncodedInt(m_ChargeTime); + + if (GetSaveFlag(flags, SaveFlag.Slayer)) + writer.WriteEncodedInt((int)m_Slayer); + } + + public override void Deserialize(GenericReader reader) + { + base.Deserialize(reader); + + int version = reader.ReadInt(); + + switch (version) + { + case 0: + { + SaveFlag flags = (SaveFlag)reader.ReadEncodedInt(); + + if (GetSaveFlag(flags, SaveFlag.Attributes)) + m_AosAttributes = new AosAttributes(this, reader); + else + m_AosAttributes = new AosAttributes(this); + + if (GetSaveFlag(flags, SaveFlag.SkillBonuses)) + m_AosSkillBonuses = new AosSkillBonuses(this, reader); + else + m_AosSkillBonuses = new AosSkillBonuses(this); + + // Backward compatibility + if (GetSaveFlag(flags, SaveFlag.Owner)) + BlessedFor = reader.ReadMobile(); + + if (GetSaveFlag(flags, SaveFlag.Protection)) + m_Protection = new TalismanAttribute(reader); + else + m_Protection = new TalismanAttribute(); + + if (GetSaveFlag(flags, SaveFlag.Killer)) + m_Killer = new TalismanAttribute(reader); + else + m_Killer = new TalismanAttribute(); + + if (GetSaveFlag(flags, SaveFlag.Summoner)) + m_Summoner = new TalismanAttribute(reader); + else + m_Summoner = new TalismanAttribute(); + + if (GetSaveFlag(flags, SaveFlag.Removal)) + m_Removal = (TalismanRemoval)reader.ReadEncodedInt(); + + if (GetSaveFlag(flags, SaveFlag.KarmaLoss)) + m_KarmaLoss = reader.ReadEncodedInt(); + + if (GetSaveFlag(flags, SaveFlag.Skill)) + m_Skill = (SkillName)reader.ReadEncodedInt(); + + if (GetSaveFlag(flags, SaveFlag.SuccessBonus)) + m_SuccessBonus = reader.ReadEncodedInt(); + + if (GetSaveFlag(flags, SaveFlag.ExceptionalBonus)) + m_ExceptionalBonus = reader.ReadEncodedInt(); + + if (GetSaveFlag(flags, SaveFlag.MaxCharges)) + m_MaxCharges = reader.ReadEncodedInt(); + + if (GetSaveFlag(flags, SaveFlag.Charges)) + m_Charges = reader.ReadEncodedInt(); + + if (GetSaveFlag(flags, SaveFlag.MaxChargeTime)) + m_MaxChargeTime = reader.ReadEncodedInt(); + + if (GetSaveFlag(flags, SaveFlag.ChargeTime)) + m_ChargeTime = reader.ReadEncodedInt(); + + if (GetSaveFlag(flags, SaveFlag.Slayer)) + m_Slayer = (TalismanSlayerName)reader.ReadEncodedInt(); + + m_Blessed = GetSaveFlag(flags, SaveFlag.Blessed); + + break; + } + } + + if (Parent is Mobile) + { + Mobile m = (Mobile)Parent; + + m_AosAttributes.AddStatBonuses(m); + m_AosSkillBonuses.AddTo(m); + + if (m_ChargeTime > 0) + StartTimer(); + } + } + + public virtual void OnAfterUse(Mobile m) + { + m_ChargeTime = m_MaxChargeTime; + + if (m_Charges > 0 && m_MaxCharges > 0) + m_Charges -= 1; + + if (m_ChargeTime > 0) + StartTimer(); + + InvalidateProperties(); + } + + public virtual Type GetSummoner() + { + return null; + } + + public virtual void SetSummoner(Type type, TextDefinition name) + { + m_Summoner = new TalismanAttribute(type, name); + } + + public virtual void SetProtection(Type type, TextDefinition name, int amount) + { + m_Protection = new TalismanAttribute(type, name, amount); + } + + public virtual void SetKiller(Type type, TextDefinition name, int amount) + { + m_Killer = new TalismanAttribute(type, name, amount); + } + + #region Timer + private Timer m_Timer; + + public virtual void StartTimer() + { + if (m_Timer == null || !m_Timer.Running) + m_Timer = Timer.DelayCall(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(10), new TimerCallback(Slice)); + } + + public virtual void StopTimer() + { + if (m_Timer != null) + m_Timer.Stop(); + + m_Timer = null; + } + + public virtual void Slice() + { + if (m_ChargeTime - 10 > 0) + m_ChargeTime -= 10; + else + { + m_ChargeTime = 0; + + StopTimer(); + } + + InvalidateProperties(); + } + #endregion + + #region Randomize + private static int[] m_ItemIDs = new int[] + { + 0x2F58, 0x2F59, 0x2F5A, 0x2F5B + }; + + public static int GetRandomItemID() + { + return Utility.RandomList(m_ItemIDs); + } + + private static Type[] m_Summons = new Type[] + { + typeof( SummonedAntLion ), + typeof( SummonedCow ), + typeof( SummonedLavaSerpent ), + typeof( SummonedOrcBrute ), + typeof( SummonedFrostSpider ), + typeof( SummonedPanther ), + typeof( SummonedDoppleganger ), + typeof( SummonedGreatHart ), + typeof( SummonedBullFrog ), + typeof( SummonedArcticOgreLord ), + typeof( SummonedBogling ), + typeof( SummonedBakeKitsune ), + typeof( SummonedSheep ), + typeof( SummonedSkeletalKnight ), + typeof( SummonedWailingBanshee ), + typeof( SummonedChicken ), + typeof( SummonedVorpalBunny ), + + typeof( Board ), + typeof( IronIngot ), + typeof( Bandage ), + }; + + private static int[] m_SummonLabels = new int[] + { + 1075211, // Ant Lion + 1072494, // Cow + 1072434, // Lava Serpent + 1072414, // Orc Brute + 1072476, // Frost Spider + 1029653, // Panther + 1029741, // Doppleganger + 1018292, // great hart + 1028496, // bullfrog + 1018227, // arctic ogre lord + 1029735, // Bogling + 1030083, // bake-kitsune + 1018285, // sheep + 1018239, // skeletal knight + 1072399, // Wailing Banshee + 1072459, // Chicken + 1072401, // Vorpal Bunny + + 1015101, // Boards + 1044036, // Ingots + 1023817, // clean bandage + }; + + public static Type GetRandomSummonType() + { + return m_Summons[Utility.Random(m_Summons.Length)]; + } + + public static TalismanAttribute GetRandomSummoner() + { + if (0.025 > Utility.RandomDouble()) + { + int num = Utility.Random(m_Summons.Length); + + if (num > 14) + return new TalismanAttribute(m_Summons[num], m_SummonLabels[num], 10); + else + return new TalismanAttribute(m_Summons[num], m_SummonLabels[num]); + } + + return new TalismanAttribute(); + } + + public static TalismanRemoval GetRandomRemoval() + { + if (0.65 > Utility.RandomDouble()) + return (TalismanRemoval)Utility.RandomList(390, 404, 407); + + return TalismanRemoval.None; + } + + private static Type[] m_Killers = new Type[] + { + typeof( OrcBomber ), typeof( OrcBrute ), typeof( Sewerrat ), typeof( Rat ), typeof( GiantRat ), + typeof( Ratman ), typeof( RatmanArcher ), typeof( GiantSpider ), typeof( FrostSpider ), typeof( GiantBlackWidow ), + typeof( DreadSpider ), typeof( SilverSerpent ), typeof( DeepSeaSerpent ), typeof( GiantSerpent ), typeof( Snake ), + typeof( IceSnake ), typeof( IceSerpent ), typeof( LavaSerpent ), typeof( LavaSnake ), typeof( Yamandon ), + typeof( StrongMongbat ),typeof( Mongbat ), typeof( VampireBat ), typeof( Lich ), typeof( EvilMage ), + typeof( LichLord ), typeof( EvilMageLord ), typeof( SkeletalMage ), typeof( KhaldunZealot ), typeof( AncientLich ), + typeof( JukaMage ), typeof( MeerMage ), typeof( Beetle ), typeof( DeathwatchBeetle ), typeof( RuneBeetle ), + typeof( FireBeetle ), typeof( DeathwatchBeetleHatchling), typeof( Bird ), typeof( Chicken ), typeof( Eagle ), + typeof( TropicalBird ), typeof( Phoenix ), typeof( DesertOstard ), typeof( FrenziedOstard ), typeof( ForestOstard ), + typeof( Crane ), typeof( SnowLeopard ), typeof( IceFiend ), typeof( FrostOoze ), typeof( FrostTroll ), + typeof( IceElemental ), typeof( SnowElemental ), typeof( GiantIceWorm ), typeof( LadyOfTheSnow ), typeof( FireElemental ), + typeof( FireSteed ), typeof( HellHound ), typeof( HellCat ), typeof( PredatorHellCat ), typeof( LavaLizard ), + typeof( FireBeetle ), typeof( Cow ), typeof( Bull ), typeof( Gaman )//, typeof( Minotaur) + // TODO Meraktus, Tormented Minotaur, Minotaur + }; + + private static int[] m_KillerLabels = new int[] + { + 1072413, 1072414, 1072418, 1072419, 1072420, + 1072421, 1072423, 1072424, 1072425, 1072426, + 1072427, 1072428, 1072429, 1072430, 1072431, + 1072432, 1072433, 1072434, 1072435, 1072438, + 1072440, 1072441, 1072443, 1072444, 1072445, + 1072446, 1072447, 1072448, 1072449, 1072450, + 1072451, 1072452, 1072453, 1072454, 1072455, + 1072456, 1072457, 1072458, 1072459, 1072461, + 1072462, 1072465, 1072468, 1072469, 1072470, + 1072473, 1072474, 1072477, 1072478, 1072479, + 1072480, 1072481, 1072483, 1072485, 1072486, + 1072487, 1072489, 1072490, 1072491, 1072492, + 1072493, 1072494, 1072495, 1072498, + }; + + public static TalismanAttribute GetRandomKiller() + { + if (0.5 > Utility.RandomDouble()) + { + int num = Utility.Random(m_Killers.Length); + + return new TalismanAttribute(m_Killers[num], m_KillerLabels[num], Utility.RandomMinMax(10, 100)); + } + + return new TalismanAttribute(); + } + + public static TalismanAttribute GetRandomProtection() + { + if (0.5 > Utility.RandomDouble()) + { + int num = Utility.Random(m_Killers.Length); + + return new TalismanAttribute(m_Killers[num], m_KillerLabels[num], Utility.RandomMinMax(5, 60)); + } + + return new TalismanAttribute(); + } + + private static SkillName[] m_Skills = new SkillName[] + { + SkillName.Alchemy, + SkillName.Blacksmith, + SkillName.Carpentry, + SkillName.Cartography, + SkillName.Cooking, + SkillName.Fletching, + SkillName.Inscribe, + SkillName.Tailoring, + SkillName.Tinkering, + }; + + public static SkillName GetRandomSkill() + { + return m_Skills[Utility.Random(m_Skills.Length)]; + } + + public static int GetRandomExceptional() + { + if (0.3 > Utility.RandomDouble()) + { + double num = 40 - Math.Log(Utility.RandomMinMax(7, 403)) * 5; + + return (int)Math.Round(num); + } + + return 0; + } + + public static int GetRandomSuccessful() + { + if (0.75 > Utility.RandomDouble()) + { + double num = 40 - Math.Log(Utility.RandomMinMax(7, 403)) * 5; + + return (int)Math.Round(num); + } + + return 0; + } + + public static bool GetRandomBlessed() + { + if (0.02 > Utility.RandomDouble()) + return true; + + return false; + } + + public static TalismanSlayerName GetRandomSlayer() + { + if (0.01 > Utility.RandomDouble()) + return (TalismanSlayerName)Utility.RandomMinMax(1, 9); + + return TalismanSlayerName.None; + } + + public static int GetRandomCharges() + { + if (0.5 > Utility.RandomDouble()) + return Utility.RandomMinMax(10, 50); + + return 0; + } + #endregion + + private class TalismanTarget : Target + { + private BaseTalisman m_Talisman; + + public TalismanTarget(BaseTalisman talisman) + : base(12, false, TargetFlags.Beneficial) + { + m_Talisman = talisman; + } + + protected override void OnTarget(Mobile from, object o) + { + if (m_Talisman == null || m_Talisman.Deleted) + return; + + Mobile target = o as Mobile; + + if (from.Talisman != m_Talisman) + from.SendLocalizedMessage(502641); // You must equip this item to use it. + else if (target == null) + from.SendLocalizedMessage(1046439); // That is not a valid target. + else if (m_Talisman.ChargeTime > 0) + from.SendLocalizedMessage(1074882, m_Talisman.ChargeTime.ToString()); // You must wait ~1_val~ seconds for this to recharge. + else if (m_Talisman.Charges == 0 && m_Talisman.MaxCharges > 0) + from.SendLocalizedMessage(1042544); // This item is out of charges. + else + { + switch (m_Talisman.Removal) + { + case TalismanRemoval.Curse: + target.PlaySound(0xF6); + target.PlaySound(0x1F7); + target.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head); + + IEntity mfrom = new Entity(Serial.Zero, new Point3D(target.X, target.Y, target.Z - 10), from.Map); + IEntity mto = new Entity(Serial.Zero, new Point3D(target.X, target.Y, target.Z + 50), from.Map); + Effects.SendMovingParticles(mfrom, mto, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100); + + StatMod mod; + + mod = target.GetStatMod("[Magic] Str Offset"); + if (mod != null && mod.Offset < 0) + target.RemoveStatMod("[Magic] Str Offset"); + + mod = target.GetStatMod("[Magic] Dex Offset"); + if (mod != null && mod.Offset < 0) + target.RemoveStatMod("[Magic] Dex Offset"); + + mod = target.GetStatMod("[Magic] Int Offset"); + if (mod != null && mod.Offset < 0) + target.RemoveStatMod("[Magic] Int Offset"); + + target.Paralyzed = false; + + EvilOmenSpell.TryEndEffect(target); + StrangleSpell.RemoveCurse(target); + CorpseSkinSpell.RemoveCurse(target); + CurseSpell.RemoveEffect(target); + + BuffInfo.RemoveBuff(target, BuffIcon.Clumsy); + BuffInfo.RemoveBuff(target, BuffIcon.FeebleMind); + BuffInfo.RemoveBuff(target, BuffIcon.Weaken); + BuffInfo.RemoveBuff(target, BuffIcon.MassCurse); + + target.SendLocalizedMessage(1072408); // Any curses on you have been lifted + + if (target != from) + from.SendLocalizedMessage(1072409); // Your targets curses have been lifted + + break; + case TalismanRemoval.Damage: + target.PlaySound(0x201); + Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x3728, 1, 13, 0x834, 0, 0x13B2, 0); + + BleedAttack.EndBleed(target, true); + MortalStrike.EndWound(target); + + BuffInfo.RemoveBuff(target, BuffIcon.Bleed); + BuffInfo.RemoveBuff(target, BuffIcon.MortalStrike); + + target.SendLocalizedMessage(1072405); // Your lasting damage effects have been removed! + + if (target != from) + from.SendLocalizedMessage(1072406); // Your Targets lasting damage effects have been removed! + + break; + case TalismanRemoval.Ward: + target.PlaySound(0x201); + Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x3728, 1, 13, 0x834, 0, 0x13B2, 0); + + MagicReflectSpell.EndReflect(target); + ReactiveArmorSpell.EndArmor(target); + ProtectionSpell.EndProtection(target); + + target.SendLocalizedMessage(1072402); // Your wards have been removed! + + if (target != from) + from.SendLocalizedMessage(1072403); // Your target's wards have been removed! + + break; + case TalismanRemoval.Wildfire: + // TODO + break; + } + + m_Talisman.OnAfterUse(from); + } + } + } + } +} \ No newline at end of file diff --git a/Scripts/Items/Talismans/Items/EnchantedSwitch.cs b/Scripts/Items/Talismans/Items/EnchantedSwitch.cs new file mode 100644 index 000000000..3e16a7dc0 --- /dev/null +++ b/Scripts/Items/Talismans/Items/EnchantedSwitch.cs @@ -0,0 +1,33 @@ +using System; + +namespace Server.Items +{ + public class EnchantedSwitch : Item + { + public override int LabelNumber{ get{ return 1072893; } } // enchanted switch + + [Constructable] + public EnchantedSwitch() : base( 0x2F5C ) + { + Weight = 1.0; + } + + public EnchantedSwitch( 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/Talismans/Items/HollowPrism.cs b/Scripts/Items/Talismans/Items/HollowPrism.cs new file mode 100644 index 000000000..c2ed5441c --- /dev/null +++ b/Scripts/Items/Talismans/Items/HollowPrism.cs @@ -0,0 +1,34 @@ +using System; + +namespace Server.Items +{ + public class HollowPrism : Item + { + public override int LabelNumber{ get{ return 1072895; } } // hollow prism + + [Constructable] + public HollowPrism() : base( 0x2F5D ) + { + Weight = 1.0; + } + + public HollowPrism( 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/Talismans/Items/JeweledFiligree.cs b/Scripts/Items/Talismans/Items/JeweledFiligree.cs new file mode 100644 index 000000000..45ab81035 --- /dev/null +++ b/Scripts/Items/Talismans/Items/JeweledFiligree.cs @@ -0,0 +1,34 @@ +using System; + +namespace Server.Items +{ + public class JeweledFiligree : Item + { + public override int LabelNumber{ get{ return 1072894; } } // jeweled filigree + + [Constructable] + public JeweledFiligree() : base( 0x2F5E ) + { + Weight = 1.0; + } + + public JeweledFiligree( 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/Talismans/Items/RunedPrism.cs b/Scripts/Items/Talismans/Items/RunedPrism.cs new file mode 100644 index 000000000..78ddc3920 --- /dev/null +++ b/Scripts/Items/Talismans/Items/RunedPrism.cs @@ -0,0 +1,34 @@ +using System; + +namespace Server.Items +{ + public class RunedPrism : Item + { + public override int LabelNumber{ get{ return 1073465; } } // runed prism + + [Constructable] + public RunedPrism() : base( 0x2F57 ) + { + Weight = 1.0; + } + + public RunedPrism( 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/Talismans/Items/RunedSwitch.cs b/Scripts/Items/Talismans/Items/RunedSwitch.cs new file mode 100644 index 000000000..e3d2bcd3f --- /dev/null +++ b/Scripts/Items/Talismans/Items/RunedSwitch.cs @@ -0,0 +1,79 @@ +using System; +using Server; +using Server.Targeting; + +namespace Server.Items +{ + public class RunedSwitch : Item + { + public override int LabelNumber{ get{ return 1072896; } } // runed switch + + [Constructable] + public RunedSwitch() : base( 0x2F61 ) + { + Weight = 1.0; + } + + public RunedSwitch( Serial serial ) : base( serial ) + { + } + + public override void OnDoubleClick( Mobile from ) + { + if ( IsChildOf( from.Backpack ) ) + { + from.SendLocalizedMessage( 1075101 ); // Please select an item to recharge. + from.Target = new InternalTarget( this ); + } + else + from.SendLocalizedMessage( 1060640 ); // The item must be in your backpack to use it. + } + + 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(); + } + + private class InternalTarget : Target + { + private RunedSwitch m_Item; + + public InternalTarget( RunedSwitch item ) : base( 0, false, TargetFlags.None ) + { + m_Item = item; + } + + protected override void OnTarget( Mobile from, object o ) + { + if ( m_Item == null || m_Item.Deleted ) + return; + + if ( o is BaseTalisman ) + { + BaseTalisman talisman = (BaseTalisman) o; + + if ( talisman.Charges == 0 ) + { + talisman.Charges = talisman.MaxCharges; + m_Item.Delete(); + from.SendLocalizedMessage( 1075100 ); // The item has been recharged. + } + else + from.SendLocalizedMessage( 1075099 ); // You cannot recharge that item until all of its current charges have been used. + } + else + from.SendLocalizedMessage( 1046439 ); // That is not a valid target. + } + } + } +} + diff --git a/Scripts/Items/Talismans/RandomTalisman.cs b/Scripts/Items/Talismans/RandomTalisman.cs new file mode 100644 index 000000000..dfbf37496 --- /dev/null +++ b/Scripts/Items/Talismans/RandomTalisman.cs @@ -0,0 +1,63 @@ +using System; +using Server; +using Server.Mobiles; +using Server.Items; + +namespace Server.Items +{ + public class RandomTalisman : BaseTalisman + { + [Constructable] + public RandomTalisman() : base( GetRandomItemID() ) + { + Summoner = BaseTalisman.GetRandomSummoner(); + + if ( Summoner.IsEmpty ) + { + Removal = BaseTalisman.GetRandomRemoval(); + + if ( Removal != TalismanRemoval.None ) + { + MaxCharges = BaseTalisman.GetRandomCharges(); + MaxChargeTime = 1200; + } + } + else + { + MaxCharges = Utility.RandomMinMax( 10, 50 ); + + if ( Summoner.IsItem ) + MaxChargeTime = 60; + else + MaxChargeTime = 1800; + } + + Blessed = BaseTalisman.GetRandomBlessed(); + Slayer = BaseTalisman.GetRandomSlayer(); + Protection = BaseTalisman.GetRandomProtection(); + Killer = BaseTalisman.GetRandomKiller(); + Skill = BaseTalisman.GetRandomSkill(); + ExceptionalBonus = BaseTalisman.GetRandomExceptional(); + SuccessBonus = BaseTalisman.GetRandomSuccessful(); + Charges = MaxCharges; + } + + public RandomTalisman( 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/Talismans/TalismanAttribute.cs b/Scripts/Items/Talismans/TalismanAttribute.cs new file mode 100644 index 000000000..08fc82c4d --- /dev/null +++ b/Scripts/Items/Talismans/TalismanAttribute.cs @@ -0,0 +1,145 @@ +using System; +using Server; + +namespace Server.Items +{ + [PropertyObject] + public class TalismanAttribute + { + private Type m_Type; + private TextDefinition m_Name; + private int m_Amount; + + [CommandProperty( AccessLevel.GameMaster )] + public Type Type + { + get{ return m_Type; } + set{ m_Type = value; } + } + + [CommandProperty( AccessLevel.GameMaster )] + public TextDefinition Name + { + get{ return m_Name; } + set{ m_Name = value; } + } + + [CommandProperty( AccessLevel.GameMaster )] + public int Amount + { + get { return m_Amount; } + set { m_Amount = value; } + } + + [CommandProperty( AccessLevel.GameMaster )] + public bool IsEmpty + { + get { return m_Type == null; } + } + + [CommandProperty( AccessLevel.GameMaster )] + public bool IsItem + { + get { return m_Type != null && m_Type.Namespace.Equals( "Server.Items" ); } + } + + public TalismanAttribute() : this( null, 0, 0 ) + { + } + + public TalismanAttribute( TalismanAttribute copy ) + { + if ( copy != null ) + { + m_Type = copy.Type; + m_Name = copy.Name; + m_Amount = copy.Amount; + } + } + + public TalismanAttribute( Type type, TextDefinition name ) : this( type, name, 0 ) + { + } + + public TalismanAttribute( Type type, TextDefinition name, int amount ) + { + m_Type = type; + m_Name = name; + m_Amount = amount; + } + + public TalismanAttribute( GenericReader reader ) + { + int version = reader.ReadInt(); + + SaveFlag flags = (SaveFlag) reader.ReadEncodedInt(); + + if ( GetSaveFlag( flags, SaveFlag.Type ) ) + m_Type = ScriptCompiler.FindTypeByFullName( reader.ReadString(), false ); + + if ( GetSaveFlag( flags, SaveFlag.Name ) ) + m_Name = new TextDefinition( reader ); + + if ( GetSaveFlag( flags, SaveFlag.Amount ) ) + m_Amount = reader.ReadEncodedInt(); + } + + public override string ToString() + { + if ( m_Type != null ) + return m_Type.Name; + + return "None"; + } + + private static void SetSaveFlag( ref SaveFlag flags, SaveFlag toSet, bool setIf ) + { + if ( setIf ) + flags |= toSet; + } + + private static bool GetSaveFlag( SaveFlag flags, SaveFlag toGet ) + { + return ( (flags & toGet) != 0 ); + } + + [Flags] + private enum SaveFlag + { + None = 0x00000000, + Type = 0x00000001, + Name = 0x00000002, + Amount = 0x00000004, + } + + public virtual void Serialize( GenericWriter writer ) + { + writer.Write( (int) 0 ); // version + + SaveFlag flags = SaveFlag.None; + + SetSaveFlag( ref flags, SaveFlag.Type, m_Type != null ); + SetSaveFlag( ref flags, SaveFlag.Name, m_Name != null ); + SetSaveFlag( ref flags, SaveFlag.Amount, m_Amount != 0 ); + + writer.WriteEncodedInt( (int) flags ); + + if ( GetSaveFlag( flags, SaveFlag.Type ) ) + writer.Write( m_Type.FullName ); + + if ( GetSaveFlag( flags, SaveFlag.Name ) ) + m_Name.Serialize( writer ); + + if ( GetSaveFlag( flags, SaveFlag.Amount ) ) + writer.WriteEncodedInt( m_Amount ); + } + + public int DamageBonus( Mobile to ) + { + if ( to != null && to.GetType() == m_Type ) + return m_Amount; + + return 0; + } + } +} diff --git a/Scripts/Items/Talismans/TalismanSlayer.cs b/Scripts/Items/Talismans/TalismanSlayer.cs new file mode 100644 index 000000000..3ed125683 --- /dev/null +++ b/Scripts/Items/Talismans/TalismanSlayer.cs @@ -0,0 +1,114 @@ +using System; +using System.Collections.Generic; +using Server; +using Server.Mobiles; + +namespace Server.Items +{ + public enum TalismanSlayerName + { + None, + Bear, + Vermin, + Bat, + Mage, + Beetle, + Bird, + Ice, + Flame, + Bovine + } + + public static class TalismanSlayer + { + private static Dictionary m_Table = new Dictionary(); + + public static void Initialize() + { + m_Table[ TalismanSlayerName.Bear ] = new Type[] + { + typeof( GrizzlyBear ), typeof( BlackBear ), typeof( BrownBear ), typeof( PolarBear ) //, typeof( Grobu ) + }; + + m_Table[ TalismanSlayerName.Vermin ] = new Type[] + { + typeof( RatmanMage ), typeof( RatmanMage ), typeof( RatmanArcher ), typeof( Barracoon), + typeof( Ratman ), typeof( Sewerrat ), typeof( Rat ), typeof( GiantRat ) //, typeof( Chiikkaha ) + }; + + m_Table[ TalismanSlayerName.Bat ] = new Type[] + { + typeof( Mongbat ), typeof( StrongMongbat ), typeof( VampireBat ) + }; + + m_Table[ TalismanSlayerName.Mage ] = new Type[] + { + typeof( EvilMage ), typeof( EvilMageLord ), typeof( AncientLich ), typeof( Lich ), typeof( LichLord ), + typeof( SkeletalMage ), typeof( BoneMagi ), typeof( OrcishMage ), typeof( KhaldunZealot ), typeof( JukaMage ), + }; + + m_Table[ TalismanSlayerName.Beetle ] = new Type[] + { + typeof( Beetle ), typeof( RuneBeetle ), typeof( FireBeetle ), typeof( DeathwatchBeetle ), + typeof( DeathwatchBeetleHatchling ) + }; + + m_Table[ TalismanSlayerName.Bird ] = new Type[] + { + typeof( Bird ), typeof( TropicalBird ), typeof( Chicken ), typeof( Crane ), + typeof( DesertOstard ), typeof( Eagle ), typeof( ForestOstard ), typeof( FrenziedOstard ), + typeof( Phoenix ), /*typeof( Pyre ), typeof( Swoop ), typeof( Saliva ),*/ typeof( Harpy ), + typeof( StoneHarpy ) // ????? + }; + + m_Table[ TalismanSlayerName.Ice ] = new Type[] + { + typeof( ArcticOgreLord ), typeof( IceElemental ), typeof( SnowElemental ), typeof( FrostOoze ), + typeof( IceFiend ), /*typeof( UnfrozenMummy ),*/ typeof( FrostSpider ), typeof( LadyOfTheSnow ), + typeof( FrostTroll ), + + // TODO WinterReaper, check + typeof( IceSnake ), typeof( SnowLeopard ), typeof( PolarBear ), typeof( IceSerpent ), typeof( GiantIceWorm ) + }; + + m_Table[ TalismanSlayerName.Flame ] = new Type[] + { + typeof( FireBeetle ), typeof( HellHound ), typeof( LavaSerpent ), typeof( FireElemental ), + typeof( PredatorHellCat ), typeof( Phoenix ), typeof( FireGargoyle ), typeof( HellCat ), + /*typeof( Pyre ),*/ typeof( FireSteed ), typeof( LavaLizard ), + + // TODO check + typeof( LavaSnake ), + }; + + m_Table[ TalismanSlayerName.Bovine ] = new Type[] + { + typeof( Cow ), typeof( Bull ), typeof( Gaman ) /*, typeof( MinotaurCaptain ), + typeof( MinotaurScout ), typeof( Minotaur )*/ + + // TODO TormentedMinotaur + }; + } + + public static bool Slays( TalismanSlayerName name, Mobile m ) + { + if ( !m_Table.ContainsKey( name ) ) + return false; + + Type[] types = m_Table[ name ]; + + if ( types == null || m == null ) + return false; + + Type type = m.GetType(); + + for ( int i = 0; i < types.Length; i++ ) + { + if ( types[ i ] == type ) + return true; + } + + return false; + } + } +} diff --git a/Scripts/Items/Talismans/TalismanSummons.cs b/Scripts/Items/Talismans/TalismanSummons.cs new file mode 100644 index 000000000..520d6f08a --- /dev/null +++ b/Scripts/Items/Talismans/TalismanSummons.cs @@ -0,0 +1,614 @@ +using System; +using System.Collections.Generic; + +using Server.ContextMenus; +using Server.Regions; +using Server.Items; + +using BunnyHole = Server.Mobiles.VorpalBunny.BunnyHole; + +namespace Server.Mobiles +{ + public class BaseTalismanSummon : BaseCreature + { + public override bool Commandable{ get{ return false; } } + public override bool InitialInnocent{ get{ return true; } } + public virtual bool IsInvulnerable{ get{ return true; } } + + public BaseTalismanSummon() : base( AIType.AI_Melee, FightMode.None, 10, 1, 0.2, 0.4 ) + { + } + + public BaseTalismanSummon( Serial serial ) : base( serial ) + { + } + + public override void AddCustomContextEntries( Mobile from, List list ) + { + if ( from.Alive && ControlMaster == from ) + list.Add( new TalismanReleaseEntry( this ) ); + } + + 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 TalismanReleaseEntry : ContextMenuEntry + { + private Mobile m_Mobile; + + public TalismanReleaseEntry( Mobile m ) : base( 6118, 3 ) + { + m_Mobile = m; + } + + public override void OnClick() + { + Effects.SendLocationParticles( EffectItem.Create( m_Mobile.Location, m_Mobile.Map, EffectItem.DefaultDuration ), 0x3728, 8, 20, 5042 ); + Effects.PlaySound( m_Mobile, m_Mobile.Map, 0x201 ); + + m_Mobile.Delete(); + } + } + } + + public class SummonedAntLion : BaseTalismanSummon + { + [Constructable] + public SummonedAntLion() : base() + { + Name = "an ant lion"; + Body = 787; + BaseSoundID = 1006; + } + + public SummonedAntLion( 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 SummonedArcticOgreLord : BaseTalismanSummon + { + [Constructable] + public SummonedArcticOgreLord() : base() + { + Name = "an arctic ogre lord"; + Body = 135; + BaseSoundID = 427; + } + + public SummonedArcticOgreLord( 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 SummonedBakeKitsune : BaseTalismanSummon + { + [Constructable] + public SummonedBakeKitsune() : base() + { + Name = "a bake kitsune"; + Body = 246; + BaseSoundID = 0x4DD; + } + + public SummonedBakeKitsune( 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 SummonedBogling : BaseTalismanSummon + { + [Constructable] + public SummonedBogling() : base() + { + Name = "a bogling"; + Body = 779; + BaseSoundID = 422; + } + + public SummonedBogling( 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 SummonedBullFrog : BaseTalismanSummon + { + [Constructable] + public SummonedBullFrog() : base() + { + Name = "a bull frog"; + Body = 81; + Hue = Utility.RandomList( 0x5AC, 0x5A3, 0x59A, 0x591, 0x588, 0x57F ); + BaseSoundID = 0x266; + } + + public SummonedBullFrog( 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 SummonedChicken : BaseTalismanSummon + { + [Constructable] + public SummonedChicken() : base() + { + Name = "a chicken"; + Body = 0xD0; + BaseSoundID = 0x6E; + } + + public SummonedChicken( 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 SummonedCow : BaseTalismanSummon + { + [Constructable] + public SummonedCow() : base() + { + Name = "a cow"; + Body = Utility.RandomList( 0xD8, 0xE7 ); + BaseSoundID = 0x78; + } + + public SummonedCow( 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 SummonedDoppleganger : BaseTalismanSummon + { + [Constructable] + public SummonedDoppleganger() : base() + { + Name = "a doppleganger"; + Body = 0x309; + BaseSoundID = 0x451; + } + + public SummonedDoppleganger( 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 SummonedFrostSpider : BaseTalismanSummon + { + [Constructable] + public SummonedFrostSpider() : base() + { + Name = "a frost spider"; + Body = 20; + BaseSoundID = 0x388; + } + + public SummonedFrostSpider( 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 SummonedGreatHart : BaseTalismanSummon + { + [Constructable] + public SummonedGreatHart() : base() + { + Name = "a great hart"; + Body = 0xEA; + BaseSoundID = 0x82; + } + + public SummonedGreatHart( 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 SummonedLavaSerpent : BaseTalismanSummon + { + [Constructable] + public SummonedLavaSerpent() : base() + { + Name = "a lava serpent"; + Body = 90; + BaseSoundID = 219; + } + + public SummonedLavaSerpent( Serial serial ) : base( serial ) + { + } + + public override void OnThink() + { + if ( m_NextWave < DateTime.Now ) + AreaHeatDamage(); + } + + 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 DateTime m_NextWave; + + public void AreaHeatDamage() + { + Mobile mob = ControlMaster; + + if ( mob != null ) + { + if ( mob.InRange( Location, 2 ) ) + { + if ( mob.AccessLevel != AccessLevel.Player ) + { + AOS.Damage( mob, Utility.Random( 2, 3 ), 0, 100, 0, 0, 0 ); + mob.SendLocalizedMessage( 1008112 ); // The intense heat is damaging you! + } + } + + GuardedRegion r = Region as GuardedRegion; + + if ( r != null && mob.Alive ) + { + foreach ( Mobile m in GetMobilesInRange( 2 ) ) + { + if ( !mob.CanBeHarmful( m ) ) + mob.CriminalAction( false ); + } + } + } + + m_NextWave = DateTime.Now + TimeSpan.FromSeconds( 3 ); + } + } + + public class SummonedOrcBrute : BaseTalismanSummon + { + [Constructable] + public SummonedOrcBrute() : base() + { + Body = 189; + Name = "an orc brute"; + BaseSoundID = 0x45A; + } + + public SummonedOrcBrute( 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 SummonedPanther : BaseTalismanSummon + { + [Constructable] + public SummonedPanther() : base() + { + Name = "a panther"; + Body = 0xD6; + Hue = 0x901; + BaseSoundID = 0x462; + } + + public SummonedPanther( 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 SummonedSheep : BaseTalismanSummon + { + [Constructable] + public SummonedSheep() : base() + { + Name = "a sheep"; + Body = 0xCF; + BaseSoundID = 0xD6; + } + + public SummonedSheep( 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 SummonedSkeletalKnight : BaseTalismanSummon + { + [Constructable] + public SummonedSkeletalKnight() : base() + { + Name = "a skeletal knight"; + Body = 147; + BaseSoundID = 451; + } + + public SummonedSkeletalKnight( 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 SummonedVorpalBunny : BaseTalismanSummon + { + [Constructable] + public SummonedVorpalBunny() : base() + { + Name = "a vorpal bunny"; + Body = 205; + Hue = 0x480; + BaseSoundID = 0xC9; + + Timer.DelayCall( TimeSpan.FromMinutes( 30.0 ), new TimerCallback( BeginTunnel ) ); + } + + public SummonedVorpalBunny( Serial serial ) : base( serial ) + { + } + + public virtual void BeginTunnel() + { + if ( Deleted ) + return; + + new BunnyHole().MoveToWorld( Location, Map ); + + Frozen = true; + Say( "* The bunny begins to dig a tunnel back to its underground lair *" ); + PlaySound( 0x247 ); + + Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), new TimerCallback( Delete ) ); + } + + 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 SummonedWailingBanshee : BaseTalismanSummon + { + [Constructable] + public SummonedWailingBanshee() : base() + { + Name = "a wailing banshee"; + Body = 310; + BaseSoundID = 0x482; + } + + public SummonedWailingBanshee( 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(); + } + } +} diff --git a/Scripts/Items/Weapons/BaseWeapon.cs b/Scripts/Items/Weapons/BaseWeapon.cs index 456f69765..03daa639d 100644 --- a/Scripts/Items/Weapons/BaseWeapon.cs +++ b/Scripts/Items/Weapons/BaseWeapon.cs @@ -1495,6 +1495,11 @@ namespace Server.Items //if ( factor > 3.0 ) // factor = 3.0; + BaseTalisman talisman = attacker.Talisman as BaseTalisman; + + if ( talisman != null && talisman.Killer != null ) + percentageBonus += talisman.Killer.DamageBonus( defender ); + percentageBonus = Math.Min( percentageBonus, 300 ); //damage = (int)(damage * factor); @@ -1943,6 +1948,11 @@ namespace Server.Items if ( atkSlayer != null && atkSlayer.Slays( defender ) || atkSlayer2 != null && atkSlayer2.Slays( defender ) ) return CheckSlayerResult.Slayer; + BaseTalisman talisman = attacker.Talisman as BaseTalisman; + + if ( talisman != null && TalismanSlayer.Slays( talisman.Slayer, defender ) ) + return CheckSlayerResult.Slayer; + if ( !Core.SE ) { ISlayer defISlayer = Spellbook.FindEquippedSpellbook( defender ); diff --git a/Scripts/Misc/AOS.cs b/Scripts/Misc/AOS.cs index f3d4de8c4..0feb941e7 100644 --- a/Scripts/Misc/AOS.cs +++ b/Scripts/Misc/AOS.cs @@ -303,7 +303,14 @@ namespace Server if( attrs != null ) value += attrs[attribute]; - } + } + else if ( obj is BaseTalisman ) + { + AosAttributes attrs = ((BaseTalisman)obj).Attributes; + + if (attrs != null) + value += attrs[attribute]; + } } return value; diff --git a/Scripts/Misc/Loot.cs b/Scripts/Misc/Loot.cs index 94cd7727d..8d32ed0e9 100644 --- a/Scripts/Misc/Loot.cs +++ b/Scripts/Misc/Loot.cs @@ -630,6 +630,44 @@ namespace Server { return Construct( m_LibraryBookTypes ) as BaseBook; } + + public static BaseTalisman RandomTalisman() + { + BaseTalisman talisman = new BaseTalisman( BaseTalisman.GetRandomItemID() ); + + talisman.Summoner = BaseTalisman.GetRandomSummoner(); + + if ( talisman.Summoner.IsEmpty ) + { + talisman.Removal = BaseTalisman.GetRandomRemoval(); + + if ( talisman.Removal != TalismanRemoval.None ) + { + talisman.MaxCharges = BaseTalisman.GetRandomCharges(); + talisman.MaxChargeTime = 1200; + } + } + else + { + talisman.MaxCharges = Utility.RandomMinMax( 10, 50 ); + + if ( talisman.Summoner.IsItem ) + talisman.MaxChargeTime = 60; + else + talisman.MaxChargeTime = 1800; + } + + talisman.Blessed = BaseTalisman.GetRandomBlessed(); + talisman.Slayer = BaseTalisman.GetRandomSlayer(); + talisman.Protection = BaseTalisman.GetRandomProtection(); + talisman.Killer = BaseTalisman.GetRandomKiller(); + talisman.Skill = BaseTalisman.GetRandomSkill(); + talisman.ExceptionalBonus = BaseTalisman.GetRandomExceptional(); + talisman.SuccessBonus = BaseTalisman.GetRandomSuccessful(); + talisman.Charges = talisman.MaxCharges; + + return talisman; + } #endregion #region Construction methods diff --git a/Scripts/Misc/TextDefinition.cs b/Scripts/Misc/TextDefinition.cs index 7c5d37d6d..6a41ff56b 100644 --- a/Scripts/Misc/TextDefinition.cs +++ b/Scripts/Misc/TextDefinition.cs @@ -24,6 +24,18 @@ namespace Server m_String = text; } + public TextDefinition( GenericReader reader ) + { + int type = reader.ReadEncodedInt(); + + switch ( type ) + { + case 1: m_Number = reader.ReadEncodedInt(); m_String = null; break; + case 2: m_Number = 0; m_String = reader.ReadString(); break; + default: m_Number = 0; m_String = null; break; + } + } + public override string ToString() { if ( m_Number > 0 ) @@ -34,6 +46,22 @@ namespace Server return "(empty)"; } + public virtual void Serialize( GenericWriter writer ) + { + if ( m_Number > 0 ) + { + writer.WriteEncodedInt( 1 ); + writer.WriteEncodedInt( m_Number ); + } + else if ( m_String != null ) + { + writer.WriteEncodedInt( 2 ); + writer.Write( m_String ); + } + else + writer.WriteEncodedInt( 0 ); + } + public static void AddTo( ObjectPropertyList list, TextDefinition def ) { if ( def != null && def.m_Number > 0 ) diff --git a/Scripts/Mobiles/Monsters/Humanoid/Magic/Betrayer.cs b/Scripts/Mobiles/Monsters/Humanoid/Magic/Betrayer.cs index 703693920..b4a23549c 100644 --- a/Scripts/Mobiles/Monsters/Humanoid/Magic/Betrayer.cs +++ b/Scripts/Mobiles/Monsters/Humanoid/Magic/Betrayer.cs @@ -56,6 +56,24 @@ namespace Server.Mobiles m_NextAbilityTime = DateTime.Now + TimeSpan.FromSeconds( Utility.RandomMinMax( 5, 30 ) ); } + public override void OnDeath( Container c ) + { + base.OnDeath( c ); + + if ( 0.05 > Utility.RandomDouble() ) + { + if ( !IsParagon ) + { + if ( 0.75 > Utility.RandomDouble() ) + c.DropItem( DawnsMusicGear.RandomCommon ); + else + c.DropItem( DawnsMusicGear.RandomUncommon ); + } + else + c.DropItem( DawnsMusicGear.RandomRare ); + } + } + public override int GetDeathSound() { return 0x423; @@ -148,7 +166,8 @@ namespace Server.Mobiles } } - public Betrayer( Serial serial ) : base( serial ) + public Betrayer( Serial serial ) + : base( serial ) { } diff --git a/Scripts/Mobiles/Monsters/Humanoid/Melee/Juggernaut.cs b/Scripts/Mobiles/Monsters/Humanoid/Melee/Juggernaut.cs index 30a76cfc2..5782d07eb 100644 --- a/Scripts/Mobiles/Monsters/Humanoid/Melee/Juggernaut.cs +++ b/Scripts/Mobiles/Monsters/Humanoid/Melee/Juggernaut.cs @@ -52,6 +52,25 @@ namespace Server.Mobiles if ( 0.4 > Utility.RandomDouble() ) PackItem( new ClockworkAssembly() ); } + + public override void OnDeath( Container c ) + { + base.OnDeath( c ); + + if ( 0.05 > Utility.RandomDouble() ) + { + if ( !IsParagon ) + { + if ( 0.75 > Utility.RandomDouble() ) + c.DropItem( DawnsMusicGear.RandomCommon ); + else + c.DropItem( DawnsMusicGear.RandomUncommon ); + } + else + c.DropItem( DawnsMusicGear.RandomRare ); + } + } + public override void GenerateLoot() { AddLoot( LootPack.Rich ); diff --git a/Scripts/Mobiles/Monsters/ML/Animal/Ferret.cs b/Scripts/Mobiles/Monsters/ML/Animal/Ferret.cs new file mode 100644 index 000000000..ec4e2cb1c --- /dev/null +++ b/Scripts/Mobiles/Monsters/ML/Animal/Ferret.cs @@ -0,0 +1,104 @@ +using System; +using Server; +using Server.Engines.Quests; + +namespace Server.Mobiles +{ + [CorpseName( "a ferret corpse" )] + public class Ferret : BaseCreature + { + [Constructable] + public Ferret() : base( AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4 ) + { + Name = "a ferret"; + Body = 0x117; + + SetStr( 41, 48 ); + SetDex( 55 ); + SetInt( 75 ); + + SetHits( 45, 50 ); + + SetDamage( 7, 9 ); + + SetDamageType( ResistanceType.Physical, 100 ); + + SetResistance( ResistanceType.Physical, 45, 50 ); + SetResistance( ResistanceType.Fire, 10, 14 ); + SetResistance( ResistanceType.Cold, 30, 40 ); + SetResistance( ResistanceType.Poison, 21, 25 ); + SetResistance( ResistanceType.Energy, 20, 25 ); + + SetSkill( SkillName.MagicResist, 4.0 ); + SetSkill( SkillName.Tactics, 4.0 ); + SetSkill( SkillName.Wrestling, 4.0 ); + + Tamable = true; + ControlSlots = 1; + MinTameSkill = -21.3; + + m_CanTalk = true; + } + + public override int Meat{ get{ return 1; } } + public override FoodType FavoriteFood{ get{ return FoodType.Fish; } } + + public Ferret( Serial serial ) : base( serial ) + { + } + + public override void OnMovement( Mobile m, Point3D oldLocation ) + { + if ( m is Ferret && m.InRange( this, 3 ) && m.Alive ) + Talk( (Ferret) m ); + } + + private static string[] m_Vocabulary = new string[] + { + "dook", + "dook dook", + "dook dook dook!" + }; + + private bool m_CanTalk; + + public void Talk() + { + Talk( null ); + } + + public void Talk( Ferret to ) + { + if ( m_CanTalk ) + { + if ( to != null ) + QuestSystem.FocusTo( this, to ); + + Say( m_Vocabulary[ Utility.Random( m_Vocabulary.Length ) ] ); + + if ( to != null && Utility.RandomBool() ) + Timer.DelayCall( TimeSpan.FromSeconds( Utility.RandomMinMax( 5, 8 ) ), new TimerCallback( delegate() { to.Talk(); } ) ); + + m_CanTalk = false; + + Timer.DelayCall( TimeSpan.FromSeconds( Utility.RandomMinMax( 20, 30 ) ), new TimerCallback( delegate() { m_CanTalk = true; } ) ); + } + } + + 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(); + + m_CanTalk = true; + } + } +} diff --git a/Scripts/Mobiles/Monsters/ML/Animal/Squirrel.cs b/Scripts/Mobiles/Monsters/ML/Animal/Squirrel.cs new file mode 100644 index 000000000..a9c9cef84 --- /dev/null +++ b/Scripts/Mobiles/Monsters/ML/Animal/Squirrel.cs @@ -0,0 +1,62 @@ +using System; +using Server; +using Server.Mobiles; + +namespace Server.Mobiles +{ + [CorpseName( "a squirrel corpse" )] + public class Squirrel : BaseCreature + { + [Constructable] + public Squirrel() : base( AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4 ) + { + Name = "a squirrel"; + Body = 0x116; + + SetStr( 44, 50 ); + SetDex( 35 ); + SetInt( 5 ); + + SetHits( 42, 50 ); + + SetDamage( 1, 2 ); + + SetDamageType( ResistanceType.Physical, 100 ); + + SetResistance( ResistanceType.Physical, 30, 34 ); + SetResistance( ResistanceType.Fire, 10, 14 ); + SetResistance( ResistanceType.Cold, 30, 35 ); + SetResistance( ResistanceType.Poison, 20, 25 ); + SetResistance( ResistanceType.Energy, 20, 25 ); + + SetSkill( SkillName.MagicResist, 4.0 ); + SetSkill( SkillName.Tactics, 4.0 ); + SetSkill( SkillName.Wrestling, 4.0 ); + + Tamable = true; + ControlSlots = 1; + MinTameSkill = -21.3; + } + + public override int Meat{ get{ return 1; } } + public override FoodType FavoriteFood{ get{ return FoodType.FruitsAndVegies; } } + + public Squirrel( 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/Mobiles/Monsters/ML/Misc/Melee/Reptalon.cs b/Scripts/Mobiles/Monsters/ML/Misc/Melee/Reptalon.cs new file mode 100644 index 000000000..af916be6d --- /dev/null +++ b/Scripts/Mobiles/Monsters/ML/Misc/Melee/Reptalon.cs @@ -0,0 +1,79 @@ +using System; +using Server; +using Server.Items; + +namespace Server.Mobiles +{ + [CorpseName( "a reptalon corpse" )] + public class Reptalon : BaseMount + { + [Constructable] + public Reptalon() : base( "a reptalon", 0x114, 0x3E90, AIType.AI_Melee, FightMode.Closest, 10, 1, 0.1, 0.2 ) + { + BaseSoundID = 0x16A; // TODO check + + SetStr( 1001, 1025 ); + SetDex( 152, 164 ); + SetInt( 251, 289 ); + + SetHits( 833, 931 ); + + SetDamage( 21, 28 ); + + SetDamageType( ResistanceType.Physical, 0 ); + SetDamageType( ResistanceType.Poison, 25 ); + SetDamageType( ResistanceType.Energy, 75 ); + + SetResistance( ResistanceType.Physical, 53, 64 ); + SetResistance( ResistanceType.Fire, 35, 45 ); + SetResistance( ResistanceType.Cold, 36, 45 ); + SetResistance( ResistanceType.Poison, 52, 63 ); + SetResistance( ResistanceType.Energy, 71, 83 ); + + SetSkill( SkillName.Wrestling, 101.5, 118.2 ); + SetSkill( SkillName.Tactics, 101.7, 108.2 ); + SetSkill( SkillName.MagicResist, 76.4, 89.9 ); + SetSkill( SkillName.Anatomy, 56.4, 59.7 ); + + Tamable = true; + ControlSlots = 4; + MinTameSkill = 101.1; + } + + public override void GenerateLoot() + { + AddLoot( LootPack.AosUltraRich, 3 ); + } + + public override WeaponAbility GetWeaponAbility() + { + return WeaponAbility.ParalyzingBlow; + } + + public override int TreasureMapLevel{ get{ return 5; } } + public override int Meat{ get{ return 5; } } + public override int Hides{ get{ return 10; } } + public override bool CanBreath{ get{ return true; } } + public override bool CanAngerOnTame{ get { return true; } } + public override bool StatLossAfterTame{ get{ return true; } } + public override FoodType FavoriteFood{ get{ return FoodType.Meat; } } + + public Reptalon( 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/Mobiles/Monsters/Misc/Melee/Golem.cs b/Scripts/Mobiles/Monsters/Misc/Melee/Golem.cs index 85ea63031..74e3f52e1 100644 --- a/Scripts/Mobiles/Monsters/Misc/Melee/Golem.cs +++ b/Scripts/Mobiles/Monsters/Misc/Melee/Golem.cs @@ -86,6 +86,24 @@ namespace Server.Mobiles ControlSlots = 3; } + public override void OnDeath( Container c ) + { + base.OnDeath( c ); + + if ( 0.05 > Utility.RandomDouble() ) + { + if ( !IsParagon ) + { + if ( 0.75 > Utility.RandomDouble() ) + c.DropItem( DawnsMusicGear.RandomCommon ); + else + c.DropItem( DawnsMusicGear.RandomUncommon ); + } + else + c.DropItem( DawnsMusicGear.RandomRare ); + } + } + public override bool DeleteOnRelease{ get{ return true; } } public override int GetAngerSound() diff --git a/Scripts/Mobiles/PlayerMobile.cs b/Scripts/Mobiles/PlayerMobile.cs index 37b259437..22bad9874 100644 --- a/Scripts/Mobiles/PlayerMobile.cs +++ b/Scripts/Mobiles/PlayerMobile.cs @@ -2567,6 +2567,19 @@ namespace Server.Mobiles } } + if ( from != null && Talisman is BaseTalisman ) + { + BaseTalisman talisman = (BaseTalisman) Talisman; + + if ( talisman.Protection != null && talisman.Protection.Type != null ) + { + Type type = talisman.Protection.Type; + + if ( type == from.GetType() ) + amount *= 1 - (int) ( ( (double) talisman.Protection.Amount ) / 100 ); + } + } + base.Damage( amount, from ); } diff --git a/Scripts/Spells/Fifth/MagicReflect.cs b/Scripts/Spells/Fifth/MagicReflect.cs index 8f5c75bd0..44c7684c1 100644 --- a/Scripts/Spells/Fifth/MagicReflect.cs +++ b/Scripts/Spells/Fifth/MagicReflect.cs @@ -134,5 +134,22 @@ namespace Server.Spells.Fifth FinishSequence(); } } + + public static void EndReflect( Mobile m ) + { + if ( m_Table.Contains( m ) ) + { + ResistanceMod[] mods = (ResistanceMod[]) m_Table[ m ]; + + if ( mods != null ) + { + for ( int i = 0; i < mods.Length; ++i ) + m.RemoveResistanceMod( mods[ i ] ); + } + + m_Table.Remove( m ); + BuffInfo.RemoveBuff( m, BuffIcon.MagicReflection ); + } + } } } diff --git a/Scripts/Spells/First/ReactiveArmor.cs b/Scripts/Spells/First/ReactiveArmor.cs index 3af807519..f5114674e 100644 --- a/Scripts/Spells/First/ReactiveArmor.cs +++ b/Scripts/Spells/First/ReactiveArmor.cs @@ -137,5 +137,22 @@ namespace Server.Spells.First FinishSequence(); } } + + public static void EndArmor( Mobile m ) + { + if ( m_Table.Contains( m ) ) + { + ResistanceMod[] mods = (ResistanceMod[]) m_Table[ m ]; + + if ( mods != null ) + { + for ( int i = 0; i < mods.Length; ++i ) + m.RemoveResistanceMod( mods[ i ] ); + } + + m_Table.Remove( m ); + BuffInfo.RemoveBuff( m, BuffIcon.ReactiveArmor ); + } + } } } \ No newline at end of file diff --git a/Scripts/Spells/Ninjitsu/AnimalForm.cs b/Scripts/Spells/Ninjitsu/AnimalForm.cs index 0b5747a2a..5ac37db40 100644 --- a/Scripts/Spells/Ninjitsu/AnimalForm.cs +++ b/Scripts/Spells/Ninjitsu/AnimalForm.cs @@ -1,10 +1,9 @@ using System; using System.Collections; -using Server; using Server.Gumps; -using Server.Network; -using Server.Mobiles; using Server.Items; +using Server.Mobiles; +using Server.Network; using Server.Spells.Fifth; using Server.Spells.Seventh; @@ -12,18 +11,17 @@ namespace Server.Spells.Ninjitsu { public class AnimalForm : NinjaSpell { - public static void Initialize() { - EventSink.Login += new LoginEventHandler( OnLogin ); + EventSink.Login += new LoginEventHandler(OnLogin); } - public static void OnLogin( LoginEventArgs e ) + public static void OnLogin(LoginEventArgs e) { - AnimalFormContext context = AnimalForm.GetContext( e.Mobile ); + AnimalFormContext context = AnimalForm.GetContext(e.Mobile); - if( context != null && context.SpeedBoost ) - e.Mobile.Send( SpeedControl.MountSpeed ); + if (context != null && context.SpeedBoost) + e.Mobile.Send(SpeedControl.MountSpeed); } private static SpellInfo m_Info = new SpellInfo( @@ -32,40 +30,41 @@ namespace Server.Spells.Ninjitsu 9002 ); - public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds( 1.0 ); } } + public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds(1.0); } } - public override double RequiredSkill{ get{ return 0.0; } } - public override int RequiredMana{ get{ return (Core.ML ? 10 : 0); } } - public override int CastRecoveryBase{ get { return (Core.ML ? 10 : base.CastRecoveryBase); } } + public override double RequiredSkill { get { return 0.0; } } + public override int RequiredMana { get { return (Core.ML ? 10 : 0); } } + public override int CastRecoveryBase { get { return (Core.ML ? 10 : base.CastRecoveryBase); } } - public override bool BlockedByAnimalForm{ get{ return false; } } + public override bool BlockedByAnimalForm { get { return false; } } - public AnimalForm( Mobile caster, Item scroll ) : base( caster, scroll, m_Info ) + public AnimalForm(Mobile caster, Item scroll) + : base(caster, scroll, m_Info) { } public override bool CheckCast() { - if ( !Caster.CanBeginAction( typeof( PolymorphSpell ) ) ) + if (!Caster.CanBeginAction(typeof(PolymorphSpell))) { - Caster.SendLocalizedMessage( 1061628 ); // You can't do that while polymorphed. + Caster.SendLocalizedMessage(1061628); // You can't do that while polymorphed. return false; } - else if ( TransformationSpellHelper.UnderTransformation( Caster ) ) + else if (TransformationSpellHelper.UnderTransformation(Caster)) { - Caster.SendLocalizedMessage( 1063219 ); // You cannot mimic an animal while in that form. + Caster.SendLocalizedMessage(1063219); // You cannot mimic an animal while in that form. return false; } - else if ( DisguiseTimers.IsDisguised( Caster ) ) + else if (DisguiseTimers.IsDisguised(Caster)) { - Caster.SendLocalizedMessage( 1061631 ); // You can't do that while disguised. + Caster.SendLocalizedMessage(1061631); // You can't do that while disguised. return false; } return base.CheckCast(); } - public override bool CheckDisturb( DisturbType type, bool firstCircle, bool resistable ) + public override bool CheckDisturb(DisturbType type, bool firstCircle, bool resistable) { return false; } @@ -74,7 +73,7 @@ namespace Server.Spells.Ninjitsu { base.OnBeginCast(); - Caster.FixedEffect( 0x37C4, 10, 14, 4, 3 ); + Caster.FixedEffect(0x37C4, 10, 14, 4, 3); } public override bool CheckFizzle() @@ -85,42 +84,42 @@ namespace Server.Spells.Ninjitsu public override void OnCast() { - if ( !Caster.CanBeginAction( typeof( PolymorphSpell ) ) ) + if (!Caster.CanBeginAction(typeof(PolymorphSpell))) { - Caster.SendLocalizedMessage( 1061628 ); // You can't do that while polymorphed. + Caster.SendLocalizedMessage(1061628); // You can't do that while polymorphed. } - else if( TransformationSpellHelper.UnderTransformation( Caster ) ) + else if (TransformationSpellHelper.UnderTransformation(Caster)) { - Caster.SendLocalizedMessage( 1063219 ); // You cannot mimic an animal while in that form. + Caster.SendLocalizedMessage(1063219); // You cannot mimic an animal while in that form. } - else if ( !Caster.CanBeginAction( typeof( IncognitoSpell ) ) || (Caster.IsBodyMod && GetContext( Caster ) == null) ) + else if (!Caster.CanBeginAction(typeof(IncognitoSpell)) || (Caster.IsBodyMod && GetContext(Caster) == null)) { DoFizzle(); } - else if ( CheckSequence() ) + else if (CheckSequence()) { - AnimalFormContext context = GetContext( Caster ); + AnimalFormContext context = GetContext(Caster); - int mana = ScaleMana( RequiredMana ); - if ( mana > Caster.Mana ) + int mana = ScaleMana(RequiredMana); + if (mana > Caster.Mana) { - Caster.SendLocalizedMessage( 1060174, mana.ToString() ); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability. + Caster.SendLocalizedMessage(1060174, mana.ToString()); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability. } - else if ( context != null ) + else if (context != null) { - RemoveContext( Caster, context, true ); - Caster.Mana -= mana; + RemoveContext(Caster, context, true); + Caster.Mana -= mana; } - else if ( Caster is PlayerMobile ) + else if (Caster is PlayerMobile) { - if ( GetLastAnimalForm( Caster ) == -1 || DateTime.Now - Caster.LastMoveTime > Caster.ComputeMovementSpeed( Caster.Direction ) ) + if (GetLastAnimalForm(Caster) == -1 || DateTime.Now - Caster.LastMoveTime > Caster.ComputeMovementSpeed(Caster.Direction)) { - Caster.CloseGump( typeof( AnimalFormGump ) ); - Caster.SendGump( new AnimalFormGump( Caster, m_Entries, this ) ); + Caster.CloseGump(typeof(AnimalFormGump)); + Caster.SendGump(new AnimalFormGump(Caster, m_Entries, this)); } else { - if ( Morph( Caster, GetLastAnimalForm( Caster ) ) == MorphResult.Fail ) + if (Morph(Caster, GetLastAnimalForm(Caster)) == MorphResult.Fail) DoFizzle(); else Caster.Mana -= mana; @@ -128,7 +127,7 @@ namespace Server.Spells.Ninjitsu } else { - if ( Morph( Caster, GetLastAnimalForm( Caster ) ) == MorphResult.Fail ) + if (Morph(Caster, GetLastAnimalForm(Caster)) == MorphResult.Fail) DoFizzle(); else Caster.Mana -= mana; @@ -140,9 +139,9 @@ namespace Server.Spells.Ninjitsu private static Hashtable m_LastAnimalForms = new Hashtable(); - public int GetLastAnimalForm( Mobile m ) + public int GetLastAnimalForm(Mobile m) { - if ( m_LastAnimalForms.Contains( m ) ) + if (m_LastAnimalForms.Contains(m)) return (int)m_LastAnimalForms[m]; return -1; @@ -155,131 +154,146 @@ namespace Server.Spells.Ninjitsu NoSkill } - public static MorphResult Morph( Mobile m, int entryID ) + public static MorphResult Morph(Mobile m, int entryID) { - if ( entryID < 0 || entryID >= m_Entries.Length ) + if (entryID < 0 || entryID >= m_Entries.Length) return MorphResult.Fail; AnimalFormEntry entry = m_Entries[entryID]; m_LastAnimalForms[m] = entryID; //On OSI, it's the last /attempted/ one not the last succeeded one - if ( m.Skills.Ninjitsu.Value < entry.ReqSkill ) + if (m.Skills.Ninjitsu.Value < entry.ReqSkill) { - string args = String.Format( "{0}\t{1}\t ", entry.ReqSkill.ToString( "F1" ), SkillName.Ninjitsu ); - m.SendLocalizedMessage( 1063013, args ); // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability. + string args = String.Format("{0}\t{1}\t ", entry.ReqSkill.ToString("F1"), SkillName.Ninjitsu); + m.SendLocalizedMessage(1063013, args); // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability. return MorphResult.NoSkill; } /* if( !m.CheckSkill( SkillName.Ninjitsu, entry.ReqSkill, entry.ReqSkill + 37.5 ) ) return MorphResult.Fail; - * - * On OSI,it seems you can only gain starting at '0' using Animal form. + * + * On OSI,it seems you can only gain starting at '0' using Animal form. */ - + double ninjitsu = m.Skills.Ninjitsu.Value; - if ( ninjitsu < entry.ReqSkill + 37.5 ) + if (ninjitsu < entry.ReqSkill + 37.5) { double chance = (ninjitsu - entry.ReqSkill) / 37.5; - if ( chance < Utility.RandomDouble() ) + if (chance < Utility.RandomDouble()) return MorphResult.Fail; } - m.CheckSkill( SkillName.Ninjitsu, 0.0, 37.5 ); + m.CheckSkill(SkillName.Ninjitsu, 0.0, 37.5); - BaseMount.Dismount( m ); + BaseMount.Dismount(m); m.BodyMod = entry.BodyMod; - if ( entry.HueMod > 0 ) + if (entry.HueMod > 0) m.HueMod = entry.HueMod; - if ( entry.SpeedBoost ) - m.Send( SpeedControl.MountSpeed ); + if (entry.SpeedBoost) + m.Send(SpeedControl.MountSpeed); SkillMod mod = null; - if ( entry.StealthBonus ) + if (entry.StealthBonus) { - mod = new DefaultSkillMod( SkillName.Stealth, true, 20.0 ); + mod = new DefaultSkillMod(SkillName.Stealth, true, 20.0); mod.ObeyCap = true; - m.AddSkillMod( mod ); + m.AddSkillMod(mod); } - Timer timer = new AnimalFormTimer( m, entry.BodyMod, entry.HueMod ); + SkillMod stealingMod = null; + + if (entry.StealingBonus) + { + stealingMod = new DefaultSkillMod(SkillName.Stealing, true, 10.0); + stealingMod.ObeyCap = true; + m.AddSkillMod(stealingMod); + } + + Timer timer = new AnimalFormTimer(m, entry.BodyMod, entry.HueMod); timer.Start(); - AddContext( m, new AnimalFormContext( timer, mod, entry.SpeedBoost, entry.Type ) ); + AddContext(m, new AnimalFormContext(timer, mod, entry.SpeedBoost, entry.Type, stealingMod)); m.CheckStatTimers(); return MorphResult.Success; } - private static Hashtable m_Table = new Hashtable(); - public static void AddContext( Mobile m, AnimalFormContext context ) + public static void AddContext(Mobile m, AnimalFormContext context) { m_Table[m] = context; - if ( context.Type == typeof( BakeKitsune ) || context.Type == typeof( GreyWolf ) ) + if (context.Type == typeof(BakeKitsune) || context.Type == typeof(GreyWolf)) m.CheckStatTimers(); } - public static void RemoveContext( Mobile m, bool resetGraphics ) + public static void RemoveContext(Mobile m, bool resetGraphics) { - AnimalFormContext context = GetContext( m ); + AnimalFormContext context = GetContext(m); - if ( context != null ) - RemoveContext( m, context, resetGraphics ); + if (context != null) + RemoveContext(m, context, resetGraphics); } - public static void RemoveContext( Mobile m, AnimalFormContext context, bool resetGraphics ) + public static void RemoveContext(Mobile m, AnimalFormContext context, bool resetGraphics) { - m_Table.Remove( m ); + m_Table.Remove(m); - if ( context.SpeedBoost ) - m.Send( SpeedControl.Disable ); + if (context.SpeedBoost) + m.Send(SpeedControl.Disable); SkillMod mod = context.Mod; - if ( mod != null ) - m.RemoveSkillMod( mod ); + if (mod != null) + m.RemoveSkillMod(mod); - if ( resetGraphics ) + mod = context.StealingMod; + + if (mod != null) + m.RemoveSkillMod(mod); + + if (resetGraphics) { m.HueMod = -1; m.BodyMod = 0; } - - m.FixedParticles( 0x3728, 10, 13, 2023, EffectLayer.Waist ); + + m.FixedParticles(0x3728, 10, 13, 2023, EffectLayer.Waist); context.Timer.Stop(); } - public static AnimalFormContext GetContext( Mobile m ) + public static AnimalFormContext GetContext(Mobile m) { - return ( m_Table[m] as AnimalFormContext ); + return (m_Table[m] as AnimalFormContext); } - public static bool UnderTransformation( Mobile m ) + public static bool UnderTransformation(Mobile m) { - return ( GetContext( m ) != null ); + return (GetContext(m) != null); } - public static bool UnderTransformation( Mobile m, Type type ) + public static bool UnderTransformation(Mobile m, Type type) { - AnimalFormContext context = GetContext( m ); + AnimalFormContext context = GetContext(m); - return ( context != null && context.Type == type ); + return (context != null && context.Type == type); } -/* - private delegate void AnimalFormCallback( Mobile from ); - private delegate bool AnimalFormRequirementCallback( Mobile from ); -*/ - public class AnimalFormEntry + + /* + private delegate void AnimalFormCallback( Mobile from ); + private delegate bool AnimalFormRequirementCallback( Mobile from ); + */ + + public class AnimalFormEntry { private Type m_Type; private TextDefinition m_Name; @@ -291,28 +305,31 @@ namespace Server.Spells.Ninjitsu private int m_HueMod; private bool m_StealthBonus; private bool m_SpeedBoost; + private bool m_StealingBonus; - public Type Type{ get{ return m_Type; } } - public TextDefinition Name{ get{ return m_Name; } } - public int ItemID{ get{ return m_ItemID; } } - public int Hue{ get{ return m_Hue; } } - public int Tooltip{ get{ return m_Tooltip; } } - public double ReqSkill{ get{ return m_ReqSkill; } } - public int BodyMod{ get{ return m_BodyMod; } } - public int HueMod{ get{ return m_HueMod; } } - public bool StealthBonus{ get{ return m_StealthBonus; } } - public bool SpeedBoost{ get{ return m_SpeedBoost; } } + public Type Type { get { return m_Type; } } + public TextDefinition Name { get { return m_Name; } } + public int ItemID { get { return m_ItemID; } } + public int Hue { get { return m_Hue; } } + public int Tooltip { get { return m_Tooltip; } } + public double ReqSkill { get { return m_ReqSkill; } } + public int BodyMod { get { return m_BodyMod; } } + public int HueMod { get { return m_HueMod; } } + public bool StealthBonus { get { return m_StealthBonus; } } + public bool SpeedBoost { get { return m_SpeedBoost; } } + public bool StealingBonus { get { return m_StealingBonus; } } /* private AnimalFormCallback m_TransformCallback; private AnimalFormCallback m_UntransformCallback; private AnimalFormRequirementCallback m_RequirementCallback; */ - public AnimalFormEntry( Type type, TextDefinition name, int itemID, int hue, int tooltip, double reqSkill, int bodyMod, bool stealthBonus, bool speedBoost ) - : this( type, name, itemID, hue, tooltip, reqSkill, bodyMod, 0, stealthBonus, speedBoost ) + + public AnimalFormEntry(Type type, TextDefinition name, int itemID, int hue, int tooltip, double reqSkill, int bodyMod, bool stealthBonus, bool speedBoost, bool stealingBonus) + : this(type, name, itemID, hue, tooltip, reqSkill, bodyMod, 0, stealthBonus, speedBoost, stealingBonus) { } - public AnimalFormEntry( Type type, TextDefinition name, int itemID, int hue, int tooltip, double reqSkill, int bodyMod, int hueMod, bool stealthBonus, bool speedBoost ) + public AnimalFormEntry(Type type, TextDefinition name, int itemID, int hue, int tooltip, double reqSkill, int bodyMod, int hueMod, bool stealthBonus, bool speedBoost, bool stealingBonus) { m_Type = type; m_Name = name; @@ -324,113 +341,123 @@ namespace Server.Spells.Ninjitsu m_HueMod = hueMod; m_StealthBonus = stealthBonus; m_SpeedBoost = speedBoost; + m_StealingBonus = stealingBonus; } } private static AnimalFormEntry[] m_Entries = new AnimalFormEntry[] { - new AnimalFormEntry( typeof( Kirin ), 1029632, 9632, 0, 1070811, 100.0, 0x84, false, true ), - new AnimalFormEntry( typeof( Unicorn ), 1018214, 9678, 0, 1070812, 100.0, 0x7A, false, true ), - new AnimalFormEntry( typeof( BakeKitsune ), 1030083, 10083, 0, 1070810, 82.5, 0xF6, false, true ), - new AnimalFormEntry( typeof( GreyWolf ), 1028482, 9681, 2309, 1070810, 82.5, 0x19, false, true ), - new AnimalFormEntry( typeof( Llama ), 1028438, 8438, 0, 1070809, 70.0, 0xDC, false, true ), - new AnimalFormEntry( typeof( ForestOstard ), 1018273, 8503, 2212, 1070809, 70.0, 0xDA, false, true ), - new AnimalFormEntry( typeof( BullFrog ), 1028496, 8496, 2003, 1070807, 50.0, 0x51, 0x5A3, false, false ), - new AnimalFormEntry( typeof( GiantSerpent ), 1018114, 9663, 2009, 1070808, 50.0, 0x15, false, false ), - new AnimalFormEntry( typeof( Dog ), 1018280, 8476, 2309, 1070806, 40.0, 0xD9, false, false ), - new AnimalFormEntry( typeof( Cat ), 1018264, 8475, 2309, 1070806, 40.0, 0xC9, false, false ), - new AnimalFormEntry( typeof( Rat ), 1018294, 8483, 2309, 1070805, 20.0, 0xEE, true, false ), - new AnimalFormEntry( typeof( Rabbit ), 1028485, 8485, 2309, 1070805, 20.0, 0xCD, true, false ) + new AnimalFormEntry( typeof( Kirin ), 1029632, 9632, 0, 1070811, 100.0, 0x84, false, true, false ), + new AnimalFormEntry( typeof( Unicorn ), 1018214, 9678, 0, 1070812, 100.0, 0x7A, false, true, false ), + new AnimalFormEntry( typeof( BakeKitsune ), 1030083, 10083, 0, 1070810, 82.5, 0xF6, false, true, false ), + new AnimalFormEntry( typeof( GreyWolf ), 1028482, 9681, 2309, 1070810, 82.5, 0x19, false, true, false ), + new AnimalFormEntry( typeof( Llama ), 1028438, 8438, 0, 1070809, 70.0, 0xDC, false, true, false ), + new AnimalFormEntry( typeof( ForestOstard ), 1018273, 8503, 2212, 1070809, 70.0, 0xDA, false, true, false ), + new AnimalFormEntry( typeof( BullFrog ), 1028496, 8496, 2003, 1070807, 50.0, 0x51, 0x5A3, false, false, false ), + new AnimalFormEntry( typeof( GiantSerpent ), 1018114, 9663, 2009, 1070808, 50.0, 0x15, false, false, false ), + new AnimalFormEntry( typeof( Dog ), 1018280, 8476, 2309, 1070806, 40.0, 0xD9, false, false, false ), + new AnimalFormEntry( typeof( Cat ), 1018264, 8475, 2309, 1070806, 40.0, 0xC9, false, false, false ), + new AnimalFormEntry( typeof( Rat ), 1018294, 8483, 2309, 1070805, 20.0, 0xEE, true, false, false ), + new AnimalFormEntry( typeof( Rabbit ), 1028485, 8485, 2309, 1070805, 20.0, 0xCD, true, false, false ), + new AnimalFormEntry( typeof( Squirrel ), 1031671, 11671, 0, 0, 20.0, 0x116, false, false, false ), + new AnimalFormEntry( typeof( Ferret ), 1031672, 11672, 0, 1075220, 40.0, 0x117, false, false, true ), + new AnimalFormEntry( typeof( CuSidhe ), 1031670, 11670, 0, 1075221, 60.0, 0x115, false, false, false ), + new AnimalFormEntry( typeof( Reptalon ), 1075202, 11669, 0, 1075222, 90.0, 0x114, false, false, false ), }; - public static AnimalFormEntry[] Entries{ get{ return m_Entries; } } + public static AnimalFormEntry[] Entries { get { return m_Entries; } } public class AnimalFormGump : Gump { //TODO: Convert this for ML to the BaseImageTileButtonsgump private Mobile m_Caster; private AnimalForm m_Spell; + private Item m_Talisman; - public AnimalFormGump( Mobile caster, AnimalFormEntry[] entries, AnimalForm spell ) : base( 50, 50 ) + public AnimalFormGump(Mobile caster, AnimalFormEntry[] entries, AnimalForm spell) + : base(50, 50) { m_Caster = caster; m_Spell = spell; - - AddPage( 0 ); + m_Talisman = caster.Talisman; - AddBackground( 0, 0, 520, 404, 0x13BE ); - AddImageTiled( 10, 10, 500, 20, 0xA40 ); - AddImageTiled( 10, 40, 500, 324, 0xA40 ); - AddImageTiled( 10, 374, 500, 20, 0xA40 ); - AddAlphaRegion( 10, 10, 500, 384 ); - - AddHtmlLocalized( 14, 12, 500, 20, 1063394, 0x7FFF, false, false ); //
Polymorph Selection Menu
+ AddPage(0); + + AddBackground(0, 0, 520, 404, 0x13BE); + AddImageTiled(10, 10, 500, 20, 0xA40); + AddImageTiled(10, 40, 500, 324, 0xA40); + AddImageTiled(10, 374, 500, 20, 0xA40); + AddAlphaRegion(10, 10, 500, 384); + + AddHtmlLocalized(14, 12, 500, 20, 1063394, 0x7FFF, false, false); //
Polymorph Selection Menu
+ + AddButton(10, 374, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0); + AddHtmlLocalized(45, 376, 450, 20, 1011012, 0x7FFF, false, false); // CANCEL - AddButton( 10, 374, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0 ); - AddHtmlLocalized( 45, 376, 450, 20, 1011012, 0x7FFF, false, false ); // CANCEL - double ninjitsu = caster.Skills.Ninjitsu.Value; - + int current = 0; - for ( int i = 0; i < entries.Length; ++i ) + for (int i = 0; i < entries.Length; ++i) { - bool enabled = ( ninjitsu >= entries[i].ReqSkill ); - + bool enabled = (ninjitsu >= entries[i].ReqSkill && BaseFormTalisman.EntryEnabled(caster, entries[i].Type)); + int page = current / 10 + 1; int pos = current % 10; - if ( pos == 0 ) + if (pos == 0) { - if ( page > 1 ) + if (page > 1) { - AddButton( 400, 374, 0xFA5, 0xFA7, 0, GumpButtonType.Page, page ); - AddHtmlLocalized( 440, 376, 60, 20, 1043353, 0x7FFF, false, false ); // Next + AddButton(400, 374, 0xFA5, 0xFA7, 0, GumpButtonType.Page, page); + AddHtmlLocalized(440, 376, 60, 20, 1043353, 0x7FFF, false, false); // Next } - AddPage( page ); + AddPage(page); - if ( page > 1 ) + if (page > 1) { - AddButton( 300, 374, 0xFAE, 0xFB0, 0, GumpButtonType.Page, 1 ); - AddHtmlLocalized( 340, 376, 60, 20, 1011393, 0x7FFF, false, false ); // Back + AddButton(300, 374, 0xFAE, 0xFB0, 0, GumpButtonType.Page, 1); + AddHtmlLocalized(340, 376, 60, 20, 1011393, 0x7FFF, false, false); // Back } } - - if( enabled ) + + if (enabled) { - int x = ( pos % 2 == 0 ) ? 14 : 264; - int y = ( pos / 2 ) * 64 + 44; - - Rectangle2D b = ItemBounds.Table[ entries[ i ].ItemID ]; - - AddImageTiledButton( x, y, 0x918, 0x919, i + 1, GumpButtonType.Reply, 0, entries[i].ItemID, 0x0, 40 - b.Width / 2 - b.X, 30 - b.Height / 2 - b.Y, entries[i].Tooltip ); - AddHtmlLocalized( x + 84, y, 250, 60, entries[i].Name, 0x7FFF, false, false ); - + int x = (pos % 2 == 0) ? 14 : 264; + int y = (pos / 2) * 64 + 44; + + Rectangle2D b = ItemBounds.Table[entries[i].ItemID]; + + AddImageTiledButton(x, y, 0x918, 0x919, i + 1, GumpButtonType.Reply, 0, entries[i].ItemID, 0x0, 40 - b.Width / 2 - b.X, 30 - b.Height / 2 - b.Y, entries[i].Tooltip); + AddHtmlLocalized(x + 84, y, 250, 60, entries[i].Name, 0x7FFF, false, false); + current++; } } } - public override void OnResponse( NetState sender, RelayInfo info ) + public override void OnResponse(NetState sender, RelayInfo info) { int entryID = info.ButtonID - 1; - - if ( entryID < 0 || entryID >= m_Entries.Length ) + + if (entryID < 0 || entryID >= m_Entries.Length) return; - int mana = m_Spell.ScaleMana( m_Spell.RequiredMana ); - if ( mana > m_Caster.Mana ) + int mana = m_Spell.ScaleMana(m_Spell.RequiredMana); + AnimalFormEntry entry = AnimalForm.Entries[entryID]; + + if (mana > m_Caster.Mana) { - m_Caster.SendLocalizedMessage( 1060174, mana.ToString() ); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability. + m_Caster.SendLocalizedMessage(1060174, mana.ToString()); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability. } - else + else if (BaseFormTalisman.EntryEnabled(sender.Mobile, entry.Type)) { - if ( AnimalForm.Morph( m_Caster, entryID ) == MorphResult.Fail ) + if (AnimalForm.Morph(m_Caster, entryID) == MorphResult.Fail) { - m_Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 502632 ); // The spell fizzles. - m_Caster.FixedParticles( 0x3735, 1, 30, 9503, EffectLayer.Waist ); - m_Caster.PlaySound( 0x5C ); + m_Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 502632); // The spell fizzles. + m_Caster.FixedParticles(0x3735, 1, 30, 9503, EffectLayer.Waist); + m_Caster.PlaySound(0x5C); } else { @@ -447,18 +474,21 @@ namespace Server.Spells.Ninjitsu private SkillMod m_Mod; private bool m_SpeedBoost; private Type m_Type; + private SkillMod m_StealingMod; - public Timer Timer{ get{ return m_Timer; } } - public SkillMod Mod{ get{ return m_Mod; } } - public bool SpeedBoost{ get{ return m_SpeedBoost; } } - public Type Type{ get{ return m_Type; } } + public Timer Timer { get { return m_Timer; } } + public SkillMod Mod { get { return m_Mod; } } + public bool SpeedBoost { get { return m_SpeedBoost; } } + public Type Type { get { return m_Type; } } + public SkillMod StealingMod { get { return m_StealingMod; } } - public AnimalFormContext( Timer timer, SkillMod mod, bool speedBoost, Type type ) + public AnimalFormContext(Timer timer, SkillMod mod, bool speedBoost, Type type, SkillMod stealingMod) { m_Timer = timer; m_Mod = mod; m_SpeedBoost = speedBoost; m_Type = type; + m_StealingMod = stealingMod; } } @@ -467,23 +497,92 @@ namespace Server.Spells.Ninjitsu private Mobile m_Mobile; private int m_Body; private int m_Hue; + private int m_Counter; + private Mobile m_LastTarget; - public AnimalFormTimer( Mobile from, int body, int hue ) : base( TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 1.0 ) ) + public AnimalFormTimer(Mobile from, int body, int hue) + : base(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.0)) { m_Mobile = from; m_Body = body; m_Hue = hue; + m_Counter = 0; Priority = TimerPriority.FiftyMS; } protected override void OnTick() { - if ( m_Mobile.Deleted || !m_Mobile.Alive || m_Mobile.Body != m_Body || (m_Hue != 0 && m_Mobile.Hue != m_Hue) ) + if (m_Mobile.Deleted || !m_Mobile.Alive || m_Mobile.Body != m_Body || (m_Hue != 0 && m_Mobile.Hue != m_Hue)) { - AnimalForm.RemoveContext( m_Mobile, true ); + AnimalForm.RemoveContext(m_Mobile, true); Stop(); } + else + { + if (m_Body == 0x115) // Cu Sidhe + { + if (m_Counter++ >= 8) + { + if (m_Mobile.Hits < m_Mobile.HitsMax && m_Mobile.Backpack != null) + { + Bandage b = m_Mobile.Backpack.FindItemByType(typeof(Bandage)) as Bandage; + + if (b != null) + { + m_Mobile.Hits += Utility.RandomMinMax(20, 50); + b.Consume(); + } + } + + m_Counter = 0; + } + } + else if (m_Body == 0x114) // Reptalon + { + if (m_Mobile.Combatant != null && m_Mobile.Combatant != m_LastTarget) + { + m_Counter = 1; + m_LastTarget = m_Mobile.Combatant; + } + + if (m_Mobile.Warmode && m_LastTarget != null && m_LastTarget.Alive && !m_LastTarget.Deleted && m_Counter-- <= 0) + { + if (m_Mobile.CanBeHarmful(m_LastTarget) && m_LastTarget.Map == m_Mobile.Map && m_LastTarget.InRange(m_Mobile.Location, BaseCreature.DefaultRangePerception) && m_Mobile.InLOS(m_LastTarget)) + { + m_Mobile.Direction = m_Mobile.GetDirectionTo(m_LastTarget); + m_Mobile.Freeze(TimeSpan.FromSeconds(1)); + m_Mobile.PlaySound(0x16A); + + Timer.DelayCall(TimeSpan.FromSeconds(1.3), new TimerStateCallback(BreathEffect_Callback), m_LastTarget); + } + + m_Counter = Math.Min((int)m_Mobile.GetDistanceToSqrt(m_LastTarget), 10); + } + } + } + } + + public void BreathEffect_Callback(Mobile target) + { + if (m_Mobile.CanBeHarmful(target)) + { + m_Mobile.RevealingAction(); + m_Mobile.PlaySound(0x227); + Effects.SendMovingEffect(m_Mobile, target, 0x36D4, 5, 0, false, false, 0, 0); + + Timer.DelayCall(TimeSpan.FromSeconds(1), new TimerStateCallback(BreathDamage_Callback), target); + } + } + + public void BreathDamage_Callback(Mobile target) + { + if (m_Mobile.CanBeHarmful(target)) + { + m_Mobile.RevealingAction(); + m_Mobile.DoHarmful(target); + AOS.Damage(target, m_Mobile, 20, !target.Player, 0, 100, 0, 0, 0); + } } } } \ No newline at end of file diff --git a/Scripts/Spells/Second/Protection.cs b/Scripts/Spells/Second/Protection.cs index c6dacd7f8..8e0e99362 100644 --- a/Scripts/Spells/Second/Protection.cs +++ b/Scripts/Spells/Second/Protection.cs @@ -96,6 +96,22 @@ namespace Server.Spells.Second } } + public static void EndProtection( Mobile m ) + { + if ( m_Table.Contains( m ) ) + { + object[] mods = (object[]) m_Table[ m ]; + + m_Table.Remove( m ); + Registry.Remove( m ); + + m.RemoveResistanceMod( (ResistanceMod) mods[ 0 ] ); + m.RemoveSkillMod( (SkillMod) mods[ 1 ] ); + + BuffInfo.RemoveBuff( m, BuffIcon.Protection ); + } + } + public override void OnCast() { if ( Core.AOS )