diff --git a/Scripts/Items/TreasureChests/TreasureChestLevel1.cs b/Scripts/Items/TreasureChests/TreasureChestLevel1.cs index a80aba134..e91c41735 100644 --- a/Scripts/Items/TreasureChests/TreasureChestLevel1.cs +++ b/Scripts/Items/TreasureChests/TreasureChestLevel1.cs @@ -1,124 +1,119 @@ using System; -using System.Collections; -using Server; -using Server.Gumps; -using Server.Multis; -using Server.Network; -using Server.ContextMenus; -using Server.Engines.PartySystem; namespace Server.Items { - public class TreasureChestLevel1 : LockableContainer - { - private const int m_Level = 1; + public class TreasureChestLevel1 : LockableContainer + { + private const int m_Level = 1; - public override bool Decays{ get{ return true; } } + public override bool Decays { get { return true; } } - public override bool IsDecoContainer{ get{ return false; } } + public override bool IsDecoContainer { get { return false; } } - public override TimeSpan DecayTime{ get{ return TimeSpan.FromMinutes( Utility.Random( 15, 60 ) ); } } + public override TimeSpan DecayTime { get { return TimeSpan.FromMinutes( Utility.Random( 15, 60 ) ); } } - private void SetChestAppearance() - { - bool UseFirstItemId = Utility.RandomBool(); + private void SetChestAppearance() + { + bool UseFirstItemId = Utility.RandomBool(); - switch( Utility.RandomList( 0, 1, 2 ) ) - { - case 0:// Large Crate - this.ItemID = ( UseFirstItemId ? 0xe3c : 0xe3d ); - this.GumpID = 0x44; - break; + switch( Utility.RandomList( 0, 1, 2 ) ) + { + case 0:// Large Crate + this.ItemID = ( UseFirstItemId ? 0xe3c : 0xe3d ); + this.GumpID = 0x44; + break; - case 1:// Medium Crate - this.ItemID = ( UseFirstItemId ? 0xe3e : 0xe3f ); - this.GumpID = 0x44; - break; + case 1:// Medium Crate + this.ItemID = ( UseFirstItemId ? 0xe3e : 0xe3f ); + this.GumpID = 0x44; + break; - case 2:// Small Crate - this.ItemID = ( UseFirstItemId ? 0x9a9 : 0xe7e ); - this.GumpID = 0x44; - break; - - } - } + case 2:// Small Crate + this.ItemID = ( UseFirstItemId ? 0x9a9 : 0xe7e ); + this.GumpID = 0x44; + break; + } + } - public override int DefaultGumpID{ get{ return 0x42; } } - public override int DefaultDropSound{ get{ return 0x42; } } + public override int DefaultGumpID { get { return 0x42; } } - public override Rectangle2D Bounds - { - get{ return new Rectangle2D( 18, 105, 144, 73 ); } - } + public override int DefaultDropSound { get { return 0x42; } } - [Constructable] - public TreasureChestLevel1() : base( 0xE41 ) - { - this.SetChestAppearance(); - Movable = false; + public override Rectangle2D Bounds + { + get { return new Rectangle2D( 18, 105, 144, 73 ); } + } - TrapType = TrapType.DartTrap; - TrapPower = m_Level * Utility.Random( 1, 25 ); - Locked = true; + [Constructable] + public TreasureChestLevel1() + : base( 0xE41 ) + { + this.SetChestAppearance(); + Movable = false; - RequiredSkill = 57; - LockLevel = this.RequiredSkill - Utility.Random( 1, 10 ); - MaxLockLevel = this.RequiredSkill + Utility.Random( 1, 10 ); + TrapType = TrapType.DartTrap; + TrapPower = m_Level * Utility.Random( 1, 25 ); + Locked = true; - // According to OSI, loot in level 1 chest is: - // Gold 25 - 50 - // Bolts 10 - // Gems - // Normal weapon - // Normal armour - // Normal clothing - // Normal jewelry + RequiredSkill = 57; + LockLevel = this.RequiredSkill - Utility.Random( 1, 10 ); + MaxLockLevel = this.RequiredSkill + Utility.Random( 1, 10 ); - // Gold - DropItem( new Gold( Utility.Random( 30, 100 ) ) ); - - // Drop bolts - //DropItem( new Bolt( 10 ) ); + // According to OSI, loot in level 1 chest is: + // Gold 25 - 50 + // Bolts 10 + // Gems + // Normal weapon + // Normal armour + // Normal clothing + // Normal jewelry - // Gems - if( Utility.RandomBool() == true ) - { - Item GemLoot = Loot.RandomGem(); - GemLoot.Amount = Utility.Random( 1, 3 ); - DropItem( GemLoot ); - } + // Gold + DropItem( new Gold( Utility.Random( 30, 100 ) ) ); - // Weapon - if( Utility.RandomBool() == true ) - DropItem( Loot.RandomWeapon() ); - - // Armour - if( Utility.RandomBool() == true ) - DropItem( Loot.RandomArmorOrShield() ); + // Drop bolts + //DropItem( new Bolt( 10 ) ); - // Clothing - if( Utility.RandomBool() == true ) - DropItem( Loot.RandomClothing() ); + // Gems + if( Utility.RandomBool() == true ) + { + Item GemLoot = Loot.RandomGem(); + GemLoot.Amount = Utility.Random( 1, 3 ); + DropItem( GemLoot ); + } - // Jewelry - if( Utility.RandomBool() == true ) - DropItem( Loot.RandomJewelry() ); - } + // Weapon + if( Utility.RandomBool() == true ) + DropItem( Loot.RandomWeapon() ); - public TreasureChestLevel1( Serial serial ) : base( serial ) - { - } + // Armour + if( Utility.RandomBool() == true ) + DropItem( Loot.RandomArmorOrShield() ); - public override void Serialize( GenericWriter writer ) - { - base.Serialize( writer ); - writer.Write( (int) 1 ); // version - } + // Clothing + if( Utility.RandomBool() == true ) + DropItem( Loot.RandomClothing() ); - public override void Deserialize( GenericReader reader ) - { - base.Deserialize( reader ); - int version = reader.ReadInt(); - } - } -} + // Jewelry + if( Utility.RandomBool() == true ) + DropItem( Loot.RandomJewelry() ); + } + + public TreasureChestLevel1( Serial serial ) + : base( serial ) + { + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + writer.Write( ( int )1 ); // version + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + int version = reader.ReadInt(); + } + } +} \ No newline at end of file diff --git a/Scripts/Items/TreasureChests/TreasureChestLevel2.cs b/Scripts/Items/TreasureChests/TreasureChestLevel2.cs index b42d87944..a2f76d8b4 100644 --- a/Scripts/Items/TreasureChests/TreasureChestLevel2.cs +++ b/Scripts/Items/TreasureChests/TreasureChestLevel2.cs @@ -1,156 +1,150 @@ using System; -using System.Collections; -using Server; -using Server.Gumps; -using Server.Multis; -using Server.Network; -using Server.ContextMenus; -using Server.Engines.PartySystem; namespace Server.Items { - public class TreasureChestLevel2 : LockableContainer - { - private const int m_Level = 2; + public class TreasureChestLevel2 : LockableContainer + { + private const int m_Level = 2; - public override bool Decays{ get{ return true; } } + public override bool Decays { get { return true; } } - public override bool IsDecoContainer{ get{ return false; } } + public override bool IsDecoContainer { get { return false; } } - public override TimeSpan DecayTime{ get{ return TimeSpan.FromMinutes( Utility.Random( 15, 60 ) ); } } + public override TimeSpan DecayTime { get { return TimeSpan.FromMinutes( Utility.Random( 15, 60 ) ); } } - private void SetChestAppearance() - { - - bool UseFirstItemId = Utility.RandomBool(); + private void SetChestAppearance() + { + bool UseFirstItemId = Utility.RandomBool(); - switch( Utility.RandomList( 0, 1, 2, 3, 4, 5, 6, 7 ) ) - { - case 0:// Large Crate - this.ItemID = ( UseFirstItemId ? 0xe3c : 0xe3d ); - this.GumpID = 0x44; - break; + switch( Utility.RandomList( 0, 1, 2, 3, 4, 5, 6, 7 ) ) + { + case 0:// Large Crate + this.ItemID = ( UseFirstItemId ? 0xe3c : 0xe3d ); + this.GumpID = 0x44; + break; - case 1:// Medium Crate - this.ItemID = ( UseFirstItemId ? 0xe3e : 0xe3f ); - this.GumpID = 0x44; - break; + case 1:// Medium Crate + this.ItemID = ( UseFirstItemId ? 0xe3e : 0xe3f ); + this.GumpID = 0x44; + break; - case 2:// Small Crate - this.ItemID = ( UseFirstItemId ? 0x9a9 : 0xe7e ); - this.GumpID = 0x44; - break; + case 2:// Small Crate + this.ItemID = ( UseFirstItemId ? 0x9a9 : 0xe7e ); + this.GumpID = 0x44; + break; - case 3:// Wooden Chest - this.ItemID = ( UseFirstItemId ? 0xe42 : 0xe43 ); - this.GumpID = 0x49; - break; + case 3:// Wooden Chest + this.ItemID = ( UseFirstItemId ? 0xe42 : 0xe43 ); + this.GumpID = 0x49; + break; - case 4:// Metal Chest - this.ItemID = ( UseFirstItemId ? 0x9ab : 0xe7c ); - this.GumpID = 0x4A; - break; + case 4:// Metal Chest + this.ItemID = ( UseFirstItemId ? 0x9ab : 0xe7c ); + this.GumpID = 0x4A; + break; - case 5:// Metal Golden Chest - this.ItemID = ( UseFirstItemId ? 0xe40 : 0xe41 ); - this.GumpID = 0x42; - break; + case 5:// Metal Golden Chest + this.ItemID = ( UseFirstItemId ? 0xe40 : 0xe41 ); + this.GumpID = 0x42; + break; - case 6:// Keg - this.ItemID = ( UseFirstItemId ? 0xe7f : 0xe7f ); - this.GumpID = 0x3e; - break; + case 6:// Keg + this.ItemID = ( UseFirstItemId ? 0xe7f : 0xe7f ); + this.GumpID = 0x3e; + break; - case 7:// Barrel - this.ItemID = ( UseFirstItemId ? 0xe77 : 0xe77 ); - this.GumpID = 0x3e; - break; - - } - } + case 7:// Barrel + this.ItemID = ( UseFirstItemId ? 0xe77 : 0xe77 ); + this.GumpID = 0x3e; + break; + } + } - public override int DefaultGumpID{ get{ return 0x42; } } - public override int DefaultDropSound{ get{ return 0x42; } } + public override int DefaultGumpID { get { return 0x42; } } - public override Rectangle2D Bounds - { - get{ return new Rectangle2D( 18, 105, 144, 73 ); } - } + public override int DefaultDropSound { get { return 0x42; } } - [Constructable] - public TreasureChestLevel2() : base( 0xE41 ) - { - this.SetChestAppearance(); - Movable = false; + public override Rectangle2D Bounds + { + get { return new Rectangle2D( 18, 105, 144, 73 ); } + } - TrapType = TrapType.ExplosionTrap; - TrapPower = m_Level * Utility.Random( 1, 25 ); - Locked = true; + [Constructable] + public TreasureChestLevel2() + : base( 0xE41 ) + { + this.SetChestAppearance(); + Movable = false; - RequiredSkill = 72; - LockLevel = this.RequiredSkill - Utility.Random( 1, 10 ); - MaxLockLevel = this.RequiredSkill + Utility.Random( 1, 10 );; + TrapType = TrapType.ExplosionTrap; + TrapPower = m_Level * Utility.Random( 1, 25 ); + Locked = true; - // According to OSI, loot in level 2 chest is: - // Gold 80 - 150 - // Arrows 10 - // Reagents - // Scrolls - // Potions - // Gems + RequiredSkill = 72; + LockLevel = this.RequiredSkill - Utility.Random( 1, 10 ); + MaxLockLevel = this.RequiredSkill + Utility.Random( 1, 10 ); ; - // Gold - DropItem( new Gold( Utility.Random( 70, 100 ) ) ); - - // Drop bolts - //DropItem( new Arrow( 10 ) ); + // According to OSI, loot in level 2 chest is: + // Gold 80 - 150 + // Arrows 10 + // Reagents + // Scrolls + // Potions + // Gems - // Reagents - for( int i = Utility.Random( 1, m_Level ); i > 1; i-- ) - { - Item ReagentLoot = Loot.RandomReagent(); - ReagentLoot.Amount = Utility.Random( 1, m_Level ); - DropItem( ReagentLoot ); - } + // Gold + DropItem( new Gold( Utility.Random( 70, 100 ) ) ); - // Scrolls - for( int i = Utility.Random( 1, m_Level ); i > 1; i-- ) - { - Item ScrollLoot = Loot.RandomScroll( 0, 39, SpellbookType.Regular ); - ScrollLoot.Amount = Utility.Random( 1, 8 ); - DropItem( ScrollLoot ); - } + // Drop bolts + //DropItem( new Arrow( 10 ) ); - // Potions - for ( int i = Utility.Random( 1, m_Level ); i > 1; i-- ) - { - Item PotionLoot = Loot.RandomPotion(); - DropItem( PotionLoot ); - } + // Reagents + for( int i = Utility.Random( 1, m_Level ); i > 1; i-- ) + { + Item ReagentLoot = Loot.RandomReagent(); + ReagentLoot.Amount = Utility.Random( 1, m_Level ); + DropItem( ReagentLoot ); + } - // Gems - for( int i = Utility.Random( 1, m_Level ); i > 1; i-- ) - { - Item GemLoot = Loot.RandomGem(); - GemLoot.Amount = Utility.Random( 1, 6 ); - DropItem( GemLoot ); - } - } + // Scrolls + for( int i = Utility.Random( 1, m_Level ); i > 1; i-- ) + { + Item ScrollLoot = Loot.RandomScroll( 0, 39, SpellbookType.Regular ); + ScrollLoot.Amount = Utility.Random( 1, 8 ); + DropItem( ScrollLoot ); + } - public TreasureChestLevel2( Serial serial ) : base( serial ) - { - } + // Potions + for( int i = Utility.Random( 1, m_Level ); i > 1; i-- ) + { + Item PotionLoot = Loot.RandomPotion(); + DropItem( PotionLoot ); + } - public override void Serialize( GenericWriter writer ) - { - base.Serialize( writer ); - writer.Write( (int) 1 ); // version - } + // Gems + for( int i = Utility.Random( 1, m_Level ); i > 1; i-- ) + { + Item GemLoot = Loot.RandomGem(); + GemLoot.Amount = Utility.Random( 1, 6 ); + DropItem( GemLoot ); + } + } - public override void Deserialize( GenericReader reader ) - { - base.Deserialize( reader ); - int version = reader.ReadInt(); - } - } -} + public TreasureChestLevel2( Serial serial ) + : base( serial ) + { + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + writer.Write( ( int )1 ); // version + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + int version = reader.ReadInt(); + } + } +} \ No newline at end of file diff --git a/Scripts/Items/TreasureChests/TreasureChestLevel3.cs b/Scripts/Items/TreasureChests/TreasureChestLevel3.cs index 713585c95..5a767e69f 100644 --- a/Scripts/Items/TreasureChests/TreasureChestLevel3.cs +++ b/Scripts/Items/TreasureChests/TreasureChestLevel3.cs @@ -1,170 +1,165 @@ using System; -using System.Collections; -using Server; -using Server.Gumps; -using Server.Multis; -using Server.Network; -using Server.ContextMenus; -using Server.Engines.PartySystem; namespace Server.Items { - public class TreasureChestLevel3 : LockableContainer - { - private const int m_Level = 3; + public class TreasureChestLevel3 : LockableContainer + { + private const int m_Level = 3; - public override bool Decays{ get{ return true; } } + public override bool Decays { get { return true; } } - public override bool IsDecoContainer{ get{ return false; } } + public override bool IsDecoContainer { get { return false; } } - public override TimeSpan DecayTime{ get{ return TimeSpan.FromMinutes( Utility.Random( 15, 60 ) ); } } + public override TimeSpan DecayTime { get { return TimeSpan.FromMinutes( Utility.Random( 15, 60 ) ); } } - private void SetChestAppearance() - { - bool UseFirstItemId = Utility.RandomBool(); - switch( Utility.RandomList( 0, 1, 2 ) ) - { - case 0:// Wooden Chest - this.ItemID = ( UseFirstItemId ? 0xe42 : 0xe43 ); - this.GumpID = 0x49; - break; + private void SetChestAppearance() + { + bool UseFirstItemId = Utility.RandomBool(); + switch( Utility.RandomList( 0, 1, 2 ) ) + { + case 0:// Wooden Chest + this.ItemID = ( UseFirstItemId ? 0xe42 : 0xe43 ); + this.GumpID = 0x49; + break; - case 1:// Metal Chest - this.ItemID = ( UseFirstItemId ? 0x9ab : 0xe7c ); - this.GumpID = 0x4A; - break; + case 1:// Metal Chest + this.ItemID = ( UseFirstItemId ? 0x9ab : 0xe7c ); + this.GumpID = 0x4A; + break; - case 2:// Metal Golden Chest - this.ItemID = ( UseFirstItemId ? 0xe40 : 0xe41 ); - this.GumpID = 0x42; - break; - } + case 2:// Metal Golden Chest + this.ItemID = ( UseFirstItemId ? 0xe40 : 0xe41 ); + this.GumpID = 0x42; + break; + } + } - } + public override int DefaultGumpID { get { return 0x42; } } - public override int DefaultGumpID{ get{ return 0x42; } } - public override int DefaultDropSound{ get{ return 0x42; } } + public override int DefaultDropSound { get { return 0x42; } } - public override Rectangle2D Bounds - { - get{ return new Rectangle2D( 18, 105, 144, 73 ); } - } + public override Rectangle2D Bounds + { + get { return new Rectangle2D( 18, 105, 144, 73 ); } + } - [Constructable] - public TreasureChestLevel3() : base( 0xE41 ) - { - this.SetChestAppearance(); - Movable = false; + [Constructable] + public TreasureChestLevel3() + : base( 0xE41 ) + { + this.SetChestAppearance(); + Movable = false; - TrapType = TrapType.PoisonTrap; - TrapPower = m_Level * Utility.Random( 1, 25 ); - Locked = true; + TrapType = TrapType.PoisonTrap; + TrapPower = m_Level * Utility.Random( 1, 25 ); + Locked = true; - RequiredSkill = 84; - LockLevel = this.RequiredSkill - Utility.Random( 1, 10 ); - MaxLockLevel = this.RequiredSkill + Utility.Random( 1, 10 );; + RequiredSkill = 84; + LockLevel = this.RequiredSkill - Utility.Random( 1, 10 ); + MaxLockLevel = this.RequiredSkill + Utility.Random( 1, 10 ); ; - // According to OSI, loot in level 3 chest is: - // Gold 250 - 350 - // Arrows 10 - // Reagents - // Scrolls - // Potions - // Gems - // Magic Wand - // Magic weapon - // Magic armour - // Magic clothing (not implemented) - // Magic jewelry (not implemented) + // According to OSI, loot in level 3 chest is: + // Gold 250 - 350 + // Arrows 10 + // Reagents + // Scrolls + // Potions + // Gems + // Magic Wand + // Magic weapon + // Magic armour + // Magic clothing (not implemented) + // Magic jewelry (not implemented) - // Gold - DropItem( new Gold( Utility.Random( 180, 240 ) ) ); - - // Drop bolts - //DropItem( new Arrow( 10 ) ); + // Gold + DropItem( new Gold( Utility.Random( 180, 240 ) ) ); - // Reagents - for( int i = Utility.Random( 1, m_Level ); i > 1; i-- ) - { - Item ReagentLoot = Loot.RandomReagent(); - ReagentLoot.Amount = Utility.Random( 1, 9 ); - DropItem( ReagentLoot ); - } + // Drop bolts + //DropItem( new Arrow( 10 ) ); - // Scrolls - for( int i = Utility.Random( 1, m_Level ); i > 1; i-- ) - { - Item ScrollLoot = Loot.RandomScroll( 0, 47, SpellbookType.Regular ); - ScrollLoot.Amount = Utility.Random( 1, 12 ); - DropItem( ScrollLoot ); - } + // Reagents + for( int i = Utility.Random( 1, m_Level ); i > 1; i-- ) + { + Item ReagentLoot = Loot.RandomReagent(); + ReagentLoot.Amount = Utility.Random( 1, 9 ); + DropItem( ReagentLoot ); + } - // Potions - for ( int i = Utility.Random( 1, m_Level ); i > 1; i-- ) - { - Item PotionLoot = Loot.RandomPotion(); - DropItem( PotionLoot ); - } + // Scrolls + for( int i = Utility.Random( 1, m_Level ); i > 1; i-- ) + { + Item ScrollLoot = Loot.RandomScroll( 0, 47, SpellbookType.Regular ); + ScrollLoot.Amount = Utility.Random( 1, 12 ); + DropItem( ScrollLoot ); + } - // Gems - for( int i = Utility.Random( 1, m_Level ); i > 1; i-- ) - { - Item GemLoot = Loot.RandomGem(); - GemLoot.Amount = Utility.Random( 1, 9 ); - DropItem( GemLoot ); - } + // Potions + for( int i = Utility.Random( 1, m_Level ); i > 1; i-- ) + { + Item PotionLoot = Loot.RandomPotion(); + DropItem( PotionLoot ); + } - // Magic Wand - for( int i = Utility.Random( 1, m_Level ); i > 1; i-- ) - DropItem( Loot.RandomWand() ); + // Gems + for( int i = Utility.Random( 1, m_Level ); i > 1; i-- ) + { + Item GemLoot = Loot.RandomGem(); + GemLoot.Amount = Utility.Random( 1, 9 ); + DropItem( GemLoot ); + } - // Equipment - for( int i = Utility.Random( 1, m_Level ); i > 1; i-- ) - { - Item item = Loot.RandomArmorOrShieldOrWeapon(); + // Magic Wand + for( int i = Utility.Random( 1, m_Level ); i > 1; i-- ) + DropItem( Loot.RandomWand() ); - if( item is BaseWeapon ) - { - BaseWeapon weapon = (BaseWeapon)item; - weapon.DamageLevel = (WeaponDamageLevel)Utility.Random( m_Level ); - weapon.AccuracyLevel = (WeaponAccuracyLevel)Utility.Random( m_Level ); - weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random( m_Level ); - weapon.Quality = WeaponQuality.Regular; - } - else if( item is BaseArmor ) - { - BaseArmor armor = (BaseArmor)item; - armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random( m_Level ); - armor.Durability = (ArmorDurabilityLevel)Utility.Random( m_Level ); - armor.Quality = ArmorQuality.Regular; - } + // Equipment + for( int i = Utility.Random( 1, m_Level ); i > 1; i-- ) + { + Item item = Loot.RandomArmorOrShieldOrWeapon(); - DropItem( item ); - } + if( item is BaseWeapon ) + { + BaseWeapon weapon = ( BaseWeapon )item; + weapon.DamageLevel = ( WeaponDamageLevel )Utility.Random( m_Level ); + weapon.AccuracyLevel = ( WeaponAccuracyLevel )Utility.Random( m_Level ); + weapon.DurabilityLevel = ( WeaponDurabilityLevel )Utility.Random( m_Level ); + weapon.Quality = WeaponQuality.Regular; + } + else if( item is BaseArmor ) + { + BaseArmor armor = ( BaseArmor )item; + armor.ProtectionLevel = ( ArmorProtectionLevel )Utility.Random( m_Level ); + armor.Durability = ( ArmorDurabilityLevel )Utility.Random( m_Level ); + armor.Quality = ArmorQuality.Regular; + } - // Clothing - for( int i = Utility.Random( 1, 2 ); i > 1; i-- ) - DropItem( Loot.RandomClothing() ); + DropItem( item ); + } - // Jewelry - for( int i = Utility.Random( 1, 2 ); i > 1; i-- ) - DropItem( Loot.RandomJewelry() ); - } + // Clothing + for( int i = Utility.Random( 1, 2 ); i > 1; i-- ) + DropItem( Loot.RandomClothing() ); - public TreasureChestLevel3( Serial serial ) : base( serial ) - { - } + // Jewelry + for( int i = Utility.Random( 1, 2 ); i > 1; i-- ) + DropItem( Loot.RandomJewelry() ); + } - public override void Serialize( GenericWriter writer ) - { - base.Serialize( writer ); - writer.Write( (int) 1 ); // version - } + public TreasureChestLevel3( Serial serial ) + : base( serial ) + { + } - public override void Deserialize( GenericReader reader ) - { - base.Deserialize( reader ); - int version = reader.ReadInt(); - } - } -} + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + writer.Write( ( int )1 ); // version + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + int version = reader.ReadInt(); + } + } +} \ No newline at end of file diff --git a/Scripts/Items/TreasureChests/TreasureChestLevel4.cs b/Scripts/Items/TreasureChests/TreasureChestLevel4.cs index 5e84df198..aeddb71b4 100644 --- a/Scripts/Items/TreasureChests/TreasureChestLevel4.cs +++ b/Scripts/Items/TreasureChests/TreasureChestLevel4.cs @@ -1,174 +1,169 @@ using System; -using System.Collections; -using Server; -using Server.Gumps; -using Server.Multis; -using Server.Network; -using Server.ContextMenus; -using Server.Engines.PartySystem; namespace Server.Items { - public class TreasureChestLevel4 : LockableContainer - { - private const int m_Level = 4; + public class TreasureChestLevel4 : LockableContainer + { + private const int m_Level = 4; - public override bool Decays{ get{ return true; } } + public override bool Decays { get { return true; } } - public override bool IsDecoContainer{ get{ return false; } } + public override bool IsDecoContainer { get { return false; } } - public override TimeSpan DecayTime{ get{ return TimeSpan.FromMinutes( Utility.Random( 15, 60 ) ); } } + public override TimeSpan DecayTime { get { return TimeSpan.FromMinutes( Utility.Random( 15, 60 ) ); } } - private void SetChestAppearance() - { + private void SetChestAppearance() + { + bool UseFirstItemId = Utility.RandomBool(); - bool UseFirstItemId = Utility.RandomBool(); + switch( Utility.RandomList( 0, 1, 2 ) ) + { + case 0:// Wooden Chest + this.ItemID = ( UseFirstItemId ? 0xe42 : 0xe43 ); + this.GumpID = 0x49; + break; - switch( Utility.RandomList( 0, 1, 2 ) ) - { - case 0:// Wooden Chest - this.ItemID = ( UseFirstItemId ? 0xe42 : 0xe43 ); - this.GumpID = 0x49; - break; + case 1:// Metal Chest + this.ItemID = ( UseFirstItemId ? 0x9ab : 0xe7c ); + this.GumpID = 0x4A; + break; - case 1:// Metal Chest - this.ItemID = ( UseFirstItemId ? 0x9ab : 0xe7c ); - this.GumpID = 0x4A; - break; + case 2:// Metal Golden Chest + this.ItemID = ( UseFirstItemId ? 0xe40 : 0xe41 ); + this.GumpID = 0x42; + break; + } + } - case 2:// Metal Golden Chest - this.ItemID = ( UseFirstItemId ? 0xe40 : 0xe41 ); - this.GumpID = 0x42; - break; - } - } + public override int DefaultGumpID { get { return 0x42; } } - public override int DefaultGumpID{ get{ return 0x42; } } - public override int DefaultDropSound{ get{ return 0x42; } } + public override int DefaultDropSound { get { return 0x42; } } - public override Rectangle2D Bounds - { - get{ return new Rectangle2D( 18, 105, 144, 73 ); } - } + public override Rectangle2D Bounds + { + get { return new Rectangle2D( 18, 105, 144, 73 ); } + } - [Constructable] - public TreasureChestLevel4() : base( 0xE41 ) - { - this.SetChestAppearance(); - Movable = false; + [Constructable] + public TreasureChestLevel4() + : base( 0xE41 ) + { + this.SetChestAppearance(); + Movable = false; - TrapType = TrapType.ExplosionTrap; - TrapPower = m_Level * Utility.Random( 10, 25 ); - Locked = true; + TrapType = TrapType.ExplosionTrap; + TrapPower = m_Level * Utility.Random( 10, 25 ); + Locked = true; - RequiredSkill = 92; - LockLevel = this.RequiredSkill - Utility.Random( 1, 10 ); - MaxLockLevel = this.RequiredSkill + Utility.Random( 1, 10 );; + RequiredSkill = 92; + LockLevel = this.RequiredSkill - Utility.Random( 1, 10 ); + MaxLockLevel = this.RequiredSkill + Utility.Random( 1, 10 ); ; - // According to OSI, loot in level 4 chest is: - // Gold 500 - 900 - // Reagents - // Scrolls - // Blank scrolls - // Potions - // Gems - // Magic Wand - // Magic weapon - // Magic armour - // Magic clothing (not implemented) - // Magic jewelry (not implemented) - // Crystal ball (not implemented) + // According to OSI, loot in level 4 chest is: + // Gold 500 - 900 + // Reagents + // Scrolls + // Blank scrolls + // Potions + // Gems + // Magic Wand + // Magic weapon + // Magic armour + // Magic clothing (not implemented) + // Magic jewelry (not implemented) + // Crystal ball (not implemented) - // Gold - DropItem( new Gold( Utility.Random( 200, 400 ) ) ); - - // Reagents - for( int i = Utility.Random( 1, m_Level ); i > 1; i-- ) - { - Item ReagentLoot = Loot.RandomReagent(); - ReagentLoot.Amount = 12; - DropItem( ReagentLoot ); - } + // Gold + DropItem( new Gold( Utility.Random( 200, 400 ) ) ); - // Scrolls - for( int i = Utility.Random( 1, m_Level ); i > 1; i-- ) - { - Item ScrollLoot = Loot.RandomScroll( 0, 47, SpellbookType.Regular ); - ScrollLoot.Amount = 16; - DropItem( ScrollLoot ); - } + // Reagents + for( int i = Utility.Random( 1, m_Level ); i > 1; i-- ) + { + Item ReagentLoot = Loot.RandomReagent(); + ReagentLoot.Amount = 12; + DropItem( ReagentLoot ); + } - // Drop blank scrolls - DropItem( new BlankScroll( Utility.Random( 1, m_Level ) ) ); + // Scrolls + for( int i = Utility.Random( 1, m_Level ); i > 1; i-- ) + { + Item ScrollLoot = Loot.RandomScroll( 0, 47, SpellbookType.Regular ); + ScrollLoot.Amount = 16; + DropItem( ScrollLoot ); + } - // Potions - for ( int i = Utility.Random( 1, m_Level ); i > 1; i-- ) - { - Item PotionLoot = Loot.RandomPotion(); - DropItem( PotionLoot ); - } + // Drop blank scrolls + DropItem( new BlankScroll( Utility.Random( 1, m_Level ) ) ); - // Gems - for( int i = Utility.Random( 1, m_Level ); i > 1; i-- ) - { - Item GemLoot = Loot.RandomGem(); - GemLoot.Amount = 12; - DropItem( GemLoot ); - } + // Potions + for( int i = Utility.Random( 1, m_Level ); i > 1; i-- ) + { + Item PotionLoot = Loot.RandomPotion(); + DropItem( PotionLoot ); + } - // Magic Wand - for( int i = Utility.Random( 1, m_Level ); i > 1; i-- ) - DropItem( Loot.RandomWand() ); + // Gems + for( int i = Utility.Random( 1, m_Level ); i > 1; i-- ) + { + Item GemLoot = Loot.RandomGem(); + GemLoot.Amount = 12; + DropItem( GemLoot ); + } - // Equipment - for( int i = Utility.Random( 1, m_Level ); i > 1; i-- ) - { - Item item = Loot.RandomArmorOrShieldOrWeapon(); + // Magic Wand + for( int i = Utility.Random( 1, m_Level ); i > 1; i-- ) + DropItem( Loot.RandomWand() ); - if( item is BaseWeapon ) - { - BaseWeapon weapon = (BaseWeapon)item; - weapon.DamageLevel = (WeaponDamageLevel)Utility.Random( m_Level ); - weapon.AccuracyLevel = (WeaponAccuracyLevel)Utility.Random( m_Level ); - weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random( m_Level ); - weapon.Quality = WeaponQuality.Regular; - } - else if( item is BaseArmor ) - { - BaseArmor armor = (BaseArmor)item; - armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random( m_Level ); - armor.Durability = (ArmorDurabilityLevel)Utility.Random( m_Level ); - armor.Quality = ArmorQuality.Regular; - } + // Equipment + for( int i = Utility.Random( 1, m_Level ); i > 1; i-- ) + { + Item item = Loot.RandomArmorOrShieldOrWeapon(); - DropItem( item ); - } + if( item is BaseWeapon ) + { + BaseWeapon weapon = ( BaseWeapon )item; + weapon.DamageLevel = ( WeaponDamageLevel )Utility.Random( m_Level ); + weapon.AccuracyLevel = ( WeaponAccuracyLevel )Utility.Random( m_Level ); + weapon.DurabilityLevel = ( WeaponDurabilityLevel )Utility.Random( m_Level ); + weapon.Quality = WeaponQuality.Regular; + } + else if( item is BaseArmor ) + { + BaseArmor armor = ( BaseArmor )item; + armor.ProtectionLevel = ( ArmorProtectionLevel )Utility.Random( m_Level ); + armor.Durability = ( ArmorDurabilityLevel )Utility.Random( m_Level ); + armor.Quality = ArmorQuality.Regular; + } - // Clothing - for( int i = Utility.Random( 1, 2 ); i > 1; i-- ) - DropItem( Loot.RandomClothing() ); + DropItem( item ); + } - // Jewelry - for( int i = Utility.Random( 1, 2 ); i > 1; i-- ) - DropItem( Loot.RandomJewelry() ); + // Clothing + for( int i = Utility.Random( 1, 2 ); i > 1; i-- ) + DropItem( Loot.RandomClothing() ); - // Crystal ball (not implemented) - } + // Jewelry + for( int i = Utility.Random( 1, 2 ); i > 1; i-- ) + DropItem( Loot.RandomJewelry() ); - public TreasureChestLevel4( Serial serial ) : base( serial ) - { - } + // Crystal ball (not implemented) + } - public override void Serialize( GenericWriter writer ) - { - base.Serialize( writer ); - writer.Write( (int) 1 ); // version - } + public TreasureChestLevel4( Serial serial ) + : base( serial ) + { + } - public override void Deserialize( GenericReader reader ) - { - base.Deserialize( reader ); - int version = reader.ReadInt(); - } - } -} + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + writer.Write( ( int )1 ); // version + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + int version = reader.ReadInt(); + } + } +} \ No newline at end of file