Open & Closeable Treasure Chests with Artwork Description This is a bunch of new images I made along with 2 scripts to get your started. What it does is when you double click the chest to open them the images change to a open chest image. This is not drag and drop. You have to use MulPatcher + scripts. Credits - The original wooden chest images came from uo-pixel.de. I took the 16 uo-pixel.de open chest images & 8 uo-pixel.de closed chest images and created the other 96 images biased on those. - The code for the image swapping code comes strait form RunUO FurnitureContainer.cs I only changes it a little bit to get it to work for this. - Special thanks to Lord_Greywofl for all his help! Installation READ THIS FULLY BEFORE YOU START!!! 1. This is not drag and drop. You first need to add all of your images. The 6 oringnal UO chests do not need to be re-added. But all the other images in the zip need to be added some where with MulPatcher. If you don’t know how to do that please read Custom Artwork How-To 2. Once the images are added, you will notice that there are only 2 scripts. You will need to create 1 script for every open chest type that you add. One scrip will have both an east facing chest and a south facing chest in it. 3. I included the 1st two scripts. The will not work by just dragging and drop. The ItemID numbers will be different when you do them. You will have to change all of the ItemID to be what ever they are in your mul files. 4. In the scripts you will also have to change ALL of the following as the scripts. increase. The replace button in notepad works great for that. Chest_01 to Chest_02 DynamicFurniture_Chest_1 to DynamicFurniture_Chest_2 FurnitureTimer_Chest_1 to FurnitureTimer_Chest_2 DefaultGumpID{ get{ return 0x49; } } This need to be what ever gump you want for you chest. That’s Pretty much it. I will put the text in red for everything that will need to be changed. The next script would be _03 & _3... then _04 & _4... etc Chest_1.cs Code: using System; using System.Collections.Generic; using Server; using Server.Multis; using Server.Network; namespace Server.Items { [Furniture] [Flipable( 0xE42, 0xE43 )] public class Chest_01 : BaseContainer { public override int DefaultGumpID{ get{ return 0x49; } } //Wooden Chest Gump [Constructable] public Chest_01() : base( 0xE42 ) { Name = "Chest"; Weight = 1.0; } public override void DisplayTo( Mobile m ) { if ( DynamicFurniture_Chest_1.Open( this, m ) ) base.DisplayTo( m ); } public Chest_01( 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(); DynamicFurniture_Chest_1.Close( this ); } } public class DynamicFurniture_Chest_1 { private static Dictionary m_Table = new Dictionary(); public static bool Open( Container c, Mobile m ) { if ( m_Table.ContainsKey( c ) ) { c.SendRemovePacket(); Close( c ); c.Delta( ItemDelta.Update ); c.ProcessDelta(); return false; } if ( c is Chest_01 ) { Timer t = new FurnitureTimer_Chest_1( c, m ); t.Start(); m_Table[c] = t; switch ( c.ItemID ) { case 0xE42: c.ItemID = 0x3C19; break; //Chest Open case 0xE43: c.ItemID = 0x3C1A; break; //Chest Open } } return true; } public static void Close( Container c ) { Timer t = null; m_Table.TryGetValue( c, out t ); if ( t != null ) { t.Stop(); m_Table.Remove( c ); } if ( c is Chest_01 ) { switch ( c.ItemID ) { case 0x3C19: c.ItemID = 0xE42; break; //Chest Close case 0x3C1A: c.ItemID = 0xE43; break; //Chest Close } } } } public class FurnitureTimer_Chest_1 : Timer { private Container m_Container; private Mobile m_Mobile; public FurnitureTimer_Chest_1( Container c, Mobile m ) : base( TimeSpan.FromSeconds( 0.5 ), TimeSpan.FromSeconds( 0.5 ) ) { Priority = TimerPriority.TwoFiftyMS; m_Container = c; m_Mobile = m; } protected override void OnTick() { if ( m_Mobile.Map != m_Container.Map || !m_Mobile.InRange( m_Container.GetWorldLocation(), 3 ) ) DynamicFurniture_Chest_1.Close( m_Container ); } } }Chest_2.cs Code: using System; using System.Collections.Generic; using Server; using Server.Multis; using Server.Network; namespace Server.Items { [Furniture] [Flipable( 0xE40, 0xE41 )] public class Chest_02 : BaseContainer { public override int DefaultGumpID{ get{ return 0x42; } } //Metal Chest Gold Rim Gump [Constructable] public Chest_02() : base( 0xE40 ) { Name = "Chest"; Weight = 1.0; } public override void DisplayTo( Mobile m ) { if ( DynamicFurniture_Chest_2.Open( this, m ) ) base.DisplayTo( m ); } public Chest_02( 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(); DynamicFurniture_Chest_2.Close( this ); } } public class DynamicFurniture_Chest_2 { private static Dictionary m_Table = new Dictionary(); public static bool Open( Container c, Mobile m ) { if ( m_Table.ContainsKey( c ) ) { c.SendRemovePacket(); Close( c ); c.Delta( ItemDelta.Update ); c.ProcessDelta(); return false; } if ( c is Chest_02 ) { Timer t = new FurnitureTimer_Chest_2( c, m ); t.Start(); m_Table[c] = t; switch ( c.ItemID ) { case 0xE40: c.ItemID = 0x3C1D; break; //Chest Open 0xE40 = Closed Chest East ... 0x3C1D = Open Chest Image East case 0xE41: c.ItemID = 0x3C1E; break; //Chest Open 0xE41 = Closed Chest South ... 0x3C1E = Open Chest Image South } } return true; } public static void Close( Container c ) { Timer t = null; m_Table.TryGetValue( c, out t ); if ( t != null ) { t.Stop(); m_Table.Remove( c ); } if ( c is Chest_02 ) { switch ( c.ItemID ) { case 0x3C1D: c.ItemID = 0xE40; break; //Chest Close 0x3C1D = Open Chest Image East ... 0xE40 = Closed Chest East case 0x3C1E: c.ItemID = 0xE41; break; //Chest Close 0x3C1E = Open Chest Image South ... 0xE41 = Closed Chest South } } } } public class FurnitureTimer_Chest_2 : Timer { private Container m_Container; private Mobile m_Mobile; public FurnitureTimer_Chest_2( Container c, Mobile m ) : base( TimeSpan.FromSeconds( 0.5 ), TimeSpan.FromSeconds( 0.5 ) ) { Priority = TimerPriority.TwoFiftyMS; m_Container = c; m_Mobile = m; } protected override void OnTick() { if ( m_Mobile.Map != m_Container.Map || !m_Mobile.InRange( m_Container.GetWorldLocation(), 3 ) ) DynamicFurniture_Chest_2.Close( m_Container ); } } } Attached Thumbnails