From 96a37544fdbfe068fa379e4a480e40f512d1a21a Mon Sep 17 00:00:00 2001 From: mark Date: Fri, 30 Jan 2009 23:12:13 +0000 Subject: [PATCH] --- .../Engines/VeteranRewards/RewardSystem.cs | 4 +- Scripts/Gumps/HouseDemolishGump.cs | 60 +++--- Scripts/Items/Containers/Strongbox.cs | 5 +- Scripts/Items/Deeds/CommodityDeed.cs | 9 +- Scripts/Items/Misc/Corpses/Corpse.cs | 9 +- Scripts/Items/Skill Items/Magical/Runebook.cs | 2 +- .../Items/Special/Solen Items/BagOfSending.cs | 7 +- Scripts/Items/Weapons/BaseWeapon.cs | 4 + Scripts/Mobiles/Animals/Mounts/BaseMount.cs | 2 + Scripts/Mobiles/Vendors/BaseVendor.cs | 181 +++++++++--------- Scripts/Multis/HouseFoundation.cs | 50 ++--- Scripts/Multis/HousePlacement.cs | 1 - Scripts/Spells/Base/SpellHelper.cs | 6 + Server/Items/Container.cs | 2 +- Server/Map.cs | 22 ++- Server/Mobile.cs | 6 +- Server/SecureTrade.cs | 4 +- 17 files changed, 211 insertions(+), 163 deletions(-) diff --git a/Scripts/Engines/VeteranRewards/RewardSystem.cs b/Scripts/Engines/VeteranRewards/RewardSystem.cs index 066e420fb..9dc5312f0 100644 --- a/Scripts/Engines/VeteranRewards/RewardSystem.cs +++ b/Scripts/Engines/VeteranRewards/RewardSystem.cs @@ -320,8 +320,8 @@ namespace Server.Engines.VeteranRewards new RewardEntry( etherealSteeds, 1049748, typeof( EtherealBeetle ) ) /*new RewardEntry( houseAddOns, 0, typeof( AnkhDecoration ) )*/ } ), - //TODO: 6th year player statue MArkers - //TODO: 7th year Decorative CAnnon + //TODO: 6th year player statue Markers + //TODO: 7th year Decorative Cannon //TODO: 8th year Weapon Engraving Tool //TODO: 9th year Ridable polar bear }; diff --git a/Scripts/Gumps/HouseDemolishGump.cs b/Scripts/Gumps/HouseDemolishGump.cs index 276da3ba7..83bc0604c 100644 --- a/Scripts/Gumps/HouseDemolishGump.cs +++ b/Scripts/Gumps/HouseDemolishGump.cs @@ -88,45 +88,53 @@ namespace Server.Gumps return; } - Item toGive = null; - if ( m_House.IsAosRules ) + if ( m_Mobile.AccessLevel >= AccessLevel.GameMaster ) { - if ( m_House.Price > 0 ) - toGive = new BankCheck( m_House.Price ); + m_Mobile.SendMessage( "You do not get a refund for your house as you are not a player" ); + } + else + { + Item toGive = null; + + if ( m_House.IsAosRules ) + { + if ( m_House.Price > 0 ) + toGive = new BankCheck( m_House.Price ); + else + toGive = m_House.GetDeed(); + } else + { toGive = m_House.GetDeed(); - } - else - { - toGive = m_House.GetDeed(); - if ( toGive == null && m_House.Price > 0 ) - toGive = new BankCheck( m_House.Price ); - } + if ( toGive == null && m_House.Price > 0 ) + toGive = new BankCheck( m_House.Price ); + } - if ( toGive != null ) - { - BankBox box = m_Mobile.BankBox; - - if ( box.TryDropItem( m_Mobile, toGive, false ) ) + if ( toGive != null ) { - if ( toGive is BankCheck ) - m_Mobile.SendLocalizedMessage( 1060397, ((BankCheck)toGive).Worth.ToString() ); // ~1_AMOUNT~ gold has been deposited into your bank box. + BankBox box = m_Mobile.BankBox; - m_House.RemoveKeys( m_Mobile ); - m_House.Delete(); + if ( box.TryDropItem( m_Mobile, toGive, false ) ) + { + if ( toGive is BankCheck ) + m_Mobile.SendLocalizedMessage( 1060397, ( (BankCheck)toGive ).Worth.ToString() ); // ~1_AMOUNT~ gold has been deposited into your bank box. + + m_House.RemoveKeys( m_Mobile ); + m_House.Delete(); + } + else + { + toGive.Delete(); + m_Mobile.SendLocalizedMessage( 500390 ); // Your bank box is full. + } } else { - toGive.Delete(); - m_Mobile.SendLocalizedMessage( 500390 ); // Your bank box is full. + m_Mobile.SendMessage( "Unable to refund house." ); } } - else - { - m_Mobile.SendMessage( "Unable to refund house." ); - } } else { diff --git a/Scripts/Items/Containers/Strongbox.cs b/Scripts/Items/Containers/Strongbox.cs index 9ecf137f7..157490a9c 100644 --- a/Scripts/Items/Containers/Strongbox.cs +++ b/Scripts/Items/Containers/Strongbox.cs @@ -6,12 +6,15 @@ using Server.Network; namespace Server.Items { - [FlipableAttribute( 0xe80, 0x9a8 )] + [FlipableAttribute( 0xE80, 0x9A8 )] public class StrongBox : BaseContainer, IChopable { private Mobile m_Owner; private BaseHouse m_House; + public override double DefaultWeight{ get{ return 100; } } + public override int LabelNumber { get { return 1023712; } } + public StrongBox( Mobile owner, BaseHouse house ) : base( 0xE80 ) { m_Owner = owner; diff --git a/Scripts/Items/Deeds/CommodityDeed.cs b/Scripts/Items/Deeds/CommodityDeed.cs index c492c2b85..fd5154721 100644 --- a/Scripts/Items/Deeds/CommodityDeed.cs +++ b/Scripts/Items/Deeds/CommodityDeed.cs @@ -65,6 +65,11 @@ namespace Server.Items break; } } + + if ( !( m_Commodity is ICommodity ) ) //Apparently, there may be items out there with this. Funky. + { + Timer.DelayCall( TimeSpan.Zero, this.Delete ); + } } public CommodityDeed( Item commodity ) : base( 0x14F0 ) @@ -100,7 +105,7 @@ namespace Server.Items { base.GetProperties( list ); - if ( m_Commodity != null ) + if ( m_Commodity != null && m_Commodity is ICommodity ) list.Add( 1060658, "#{0}\t{1}", ((ICommodity)m_Commodity).DescriptionNumber, m_Commodity.Amount ); // ~1_val~: ~2_val~ } @@ -108,7 +113,7 @@ namespace Server.Items { base.OnSingleClick( from ); - if ( m_Commodity != null ) + if ( m_Commodity != null && m_Commodity is ICommodity ) from.Send( new UnicodeMessage( Serial, ItemID, MessageType.Label, 0x3B2, 3, "ENU", "", ((ICommodity)m_Commodity).Description ) ); } diff --git a/Scripts/Items/Misc/Corpses/Corpse.cs b/Scripts/Items/Misc/Corpses/Corpse.cs index 0b3cc5a85..092980dfd 100644 --- a/Scripts/Items/Misc/Corpses/Corpse.cs +++ b/Scripts/Items/Misc/Corpses/Corpse.cs @@ -296,15 +296,8 @@ namespace Server.Items m_FacialHair = facialhair; -#if false - // This corpse does not turn to bones if: - // (the owner is not a player) and (the owner doesn't have a human body) - m_NoBones = !owner.Player && !owner.Body.IsHuman; -#else - // This corpse does not turn to bones if: - // (the owner is not a player) + // This corpse does not turn to bones if: the owner is not a player m_NoBones = !owner.Player; -#endif m_Looters = new List(); m_EquipItems = equipItems; diff --git a/Scripts/Items/Skill Items/Magical/Runebook.cs b/Scripts/Items/Skill Items/Magical/Runebook.cs index f8dab84e9..2849dacd3 100644 --- a/Scripts/Items/Skill Items/Magical/Runebook.cs +++ b/Scripts/Items/Skill Items/Magical/Runebook.cs @@ -301,7 +301,7 @@ namespace Server.Items if ( book == null ) return; - book.m_Entries = new List(); //Currently, when duping, it just copies over the ref over the already made blank ArrayList + book.m_Entries = new List(); for ( int i = 0; i < m_Entries.Count; i++ ) { diff --git a/Scripts/Items/Special/Solen Items/BagOfSending.cs b/Scripts/Items/Special/Solen Items/BagOfSending.cs index 893cda8d0..0eb6706d3 100644 --- a/Scripts/Items/Special/Solen Items/BagOfSending.cs +++ b/Scripts/Items/Special/Solen Items/BagOfSending.cs @@ -202,6 +202,7 @@ namespace Server.Items else if ( targeted is Item ) { Item item = (Item)targeted; + int reqCharges = (int)Math.Max( 1, Math.Ceiling( item.TotalWeight / 10.0 ) ); if ( !item.IsChildOf( from.Backpack ) ) { @@ -227,9 +228,13 @@ namespace Server.Items { MessageHelper.SendLocalizedMessageTo( m_Bag, from, 1054110, 0x59 ); // Your bank box is full. } + else if ( Core.ML && reqCharges > m_Bag.Charges ) + { + from.SendLocalizedMessage( 1079932 ); //You don't have enough charges to send that much weight + } else { - m_Bag.Charges--; + m_Bag.Charges -= (Core.ML ? reqCharges : 1); MessageHelper.SendLocalizedMessageTo( m_Bag, from, 1054150, 0x59 ); // The item was placed in your bank box. } diff --git a/Scripts/Items/Weapons/BaseWeapon.cs b/Scripts/Items/Weapons/BaseWeapon.cs index 30f0286a1..9eb72c552 100644 --- a/Scripts/Items/Weapons/BaseWeapon.cs +++ b/Scripts/Items/Weapons/BaseWeapon.cs @@ -3351,6 +3351,10 @@ namespace Server.Items if( Core.ML ) { Attributes.WeaponDamage += (int)(from.Skills.ArmsLore.Value / 20); + + if ( Attributes.WeaponDamage > 50 ) + Attributes.WeaponDamage = 50; + from.CheckSkill( SkillName.ArmsLore, 0, 100 ); } } diff --git a/Scripts/Mobiles/Animals/Mounts/BaseMount.cs b/Scripts/Mobiles/Animals/Mounts/BaseMount.cs index 36ed6d040..31fc54abc 100644 --- a/Scripts/Mobiles/Animals/Mounts/BaseMount.cs +++ b/Scripts/Mobiles/Animals/Mounts/BaseMount.cs @@ -382,6 +382,8 @@ namespace Server.Mobiles { private BaseMount m_Mount; + public override double DefaultWeight { get { return 0; } } + public MountItem( BaseMount mount, int itemID ) : base( itemID ) { Layer = Layer.Mount; diff --git a/Scripts/Mobiles/Vendors/BaseVendor.cs b/Scripts/Mobiles/Vendors/BaseVendor.cs index 143ea17c3..7882f0288 100644 --- a/Scripts/Mobiles/Vendors/BaseVendor.cs +++ b/Scripts/Mobiles/Vendors/BaseVendor.cs @@ -25,26 +25,26 @@ namespace Server.Mobiles { private const int MaxSell = 500; - protected abstract ArrayList SBInfos{ get; } + protected abstract ArrayList SBInfos { get; } private ArrayList m_ArmorBuyInfo = new ArrayList(); private ArrayList m_ArmorSellInfo = new ArrayList(); private DateTime m_LastRestock; - public override bool CanTeach{ get{ return true; } } + public override bool CanTeach { get { return true; } } - public override bool PlayerRangeSensitive{ get{ return true; } } + public override bool PlayerRangeSensitive { get { return true; } } - public virtual bool IsActiveVendor{ get{ return true; } } - public virtual bool IsActiveBuyer{ get{ return IsActiveVendor; } } // response to vendor SELL - public virtual bool IsActiveSeller{ get{ return IsActiveVendor; } } // repsonse to vendor BUY + public virtual bool IsActiveVendor { get { return true; } } + public virtual bool IsActiveBuyer { get { return IsActiveVendor; } } // response to vendor SELL + public virtual bool IsActiveSeller { get { return IsActiveVendor; } } // repsonse to vendor BUY - public virtual NpcGuild NpcGuild{ get{ return NpcGuild.None; } } + public virtual NpcGuild NpcGuild { get { return NpcGuild.None; } } - public virtual bool IsInvulnerable{ get{ return true; } } + public virtual bool IsInvulnerable { get { return true; } } - public override bool ShowFameTitle{ get{ return false; } } + public override bool ShowFameTitle { get { return false; } } public virtual bool IsValidBulkOrder( Item item ) { @@ -76,7 +76,7 @@ namespace Server.Mobiles Town town = Town.FromRegion( this.Region ); if ( town != null ) - return (100 + town.Tax); + return ( 100 + town.Tax ); return 100; } @@ -84,7 +84,7 @@ namespace Server.Mobiles public void UpdateBuyInfo() { int priceScalar = GetPriceScalar(); - + IBuyItemInfo[] buyinfo = (IBuyItemInfo[])m_ArmorBuyInfo.ToArray( typeof( IBuyItemInfo ) ); if ( buyinfo != null ) @@ -100,7 +100,8 @@ namespace Server.Mobiles private Mobile m_From; private BaseVendor m_Vendor; - public BulkOrderInfoEntry( Mobile from, BaseVendor vendor ) : base( 6152, 6 ) + public BulkOrderInfoEntry( Mobile from, BaseVendor vendor ) + : base( 6152, 6 ) { m_From = from; m_Vendor = vendor; @@ -113,10 +114,10 @@ namespace Server.Mobiles TimeSpan ts = m_Vendor.GetNextBulkOrder( m_From ); int totalSeconds = (int)ts.TotalSeconds; - int totalHours = (totalSeconds + 3599) / 3600; - int totalMinutes = (totalSeconds + 59) / 60; + int totalHours = ( totalSeconds + 3599 ) / 3600; + int totalMinutes = ( totalSeconds + 59 ) / 60; - if ( ((Core.SE ) ? totalMinutes == 0 : totalHours == 0) ) + if ( ( ( Core.SE ) ? totalMinutes == 0 : totalHours == 0 ) ) { m_From.SendLocalizedMessage( 1049038 ); // You can get an order now. @@ -134,8 +135,8 @@ namespace Server.Mobiles { int oldSpeechHue = m_Vendor.SpeechHue; m_Vendor.SpeechHue = 0x3B2; - - if( Core.SE ) + + if ( Core.SE ) m_Vendor.SayTo( m_From, 1072058, totalMinutes.ToString() ); // An offer may be available in about ~1_minutes~ minutes. else m_Vendor.SayTo( m_From, 1049039, totalHours.ToString() ); // An offer may be available in about ~1_hours~ hours. @@ -146,7 +147,8 @@ namespace Server.Mobiles } } - public BaseVendor( string title ) : base( AIType.AI_Vendor, FightMode.None, 2, 1, 0.5, 2 ) + public BaseVendor( string title ) + : base( AIType.AI_Vendor, FightMode.None, 2, 1, 0.5, 2 ) { LoadSBInfo(); @@ -170,8 +172,9 @@ namespace Server.Mobiles m_LastRestock = DateTime.Now; } - - public BaseVendor( Serial serial ) : base( serial ) + + public BaseVendor( Serial serial ) + : base( serial ) { } @@ -215,7 +218,7 @@ namespace Server.Mobiles public abstract void InitSBInfo(); - public virtual bool IsTokunoVendor{ get{ return ( Map == Map.Tokuno ); } } + public virtual bool IsTokunoVendor { get { return ( Map == Map.Tokuno ); } } protected void LoadSBInfo() { @@ -294,7 +297,7 @@ namespace Server.Mobiles public virtual VendorShoeType ShoeType { - get{ return VendorShoeType.Shoes; } + get { return VendorShoeType.Shoes; } } public virtual int RandomBrightHue() @@ -352,7 +355,7 @@ namespace Server.Mobiles if ( !Region.IsPartOf( "Gargoyle City" ) ) return false; - if ( Body != 0x2F6 || (Hue & 0x8000) == 0 ) + if ( Body != 0x2F6 || ( Hue & 0x8000 ) == 0 ) TurnToGargoyle(); return true; @@ -551,7 +554,7 @@ namespace Server.Mobiles List opls = null; - for (int idx=0;idx item.Amount ) amount = item.Amount; @@ -1104,14 +1107,14 @@ namespace Server.Mobiles public virtual bool CheckVendorAccess( Mobile from ) { - GuardedRegion reg = (GuardedRegion) this.Region.GetRegion( typeof( GuardedRegion ) ); + GuardedRegion reg = (GuardedRegion)this.Region.GetRegion( typeof( GuardedRegion ) ); if ( reg != null && !reg.CheckVendorAccess( this, from ) ) return false; if ( this.Region != from.Region ) { - reg = (GuardedRegion) from.Region.GetRegion( typeof( GuardedRegion ) ); + reg = (GuardedRegion)from.Region.GetRegion( typeof( GuardedRegion ) ); if ( reg != null && !reg.CheckVendorAccess( this, from ) ) return false; @@ -1146,10 +1149,10 @@ namespace Server.Mobiles foreach ( SellItemResponse resp in list ) { - if ( resp.Item.RootParent != seller || resp.Amount <= 0 || !resp.Item.IsStandardLoot() || !resp.Item.Movable || (resp.Item is Container && ((Container)resp.Item).Items.Count != 0) ) + if ( resp.Item.RootParent != seller || resp.Amount <= 0 || !resp.Item.IsStandardLoot() || !resp.Item.Movable || ( resp.Item is Container && ( (Container)resp.Item ).Items.Count != 0 ) ) continue; - foreach( IShopSellInfo ssi in info ) + foreach ( IShopSellInfo ssi in info ) { if ( ssi.IsSellable( resp.Item ) ) { @@ -1163,7 +1166,7 @@ namespace Server.Mobiles { SayTo( seller, true, "You may only sell {0} items at a time!", MaxSell ); return false; - } + } else if ( Sold == 0 ) { return true; @@ -1171,10 +1174,10 @@ namespace Server.Mobiles foreach ( SellItemResponse resp in list ) { - if ( resp.Item.RootParent != seller || resp.Amount <= 0 || !resp.Item.IsStandardLoot() || !resp.Item.Movable || (resp.Item is Container && ((Container)resp.Item).Items.Count != 0) ) + if ( resp.Item.RootParent != seller || resp.Amount <= 0 || !resp.Item.IsStandardLoot() || !resp.Item.Movable || ( resp.Item is Container && ( (Container)resp.Item ).Items.Count != 0 ) ) continue; - foreach( IShopSellInfo ssi in info ) + foreach ( IShopSellInfo ssi in info ) { if ( ssi.IsSellable( resp.Item ) ) { @@ -1232,7 +1235,7 @@ namespace Server.Mobiles resp.Item.Delete(); } - GiveGold += ssi.GetSellPriceFor( resp.Item )*amount; + GiveGold += ssi.GetSellPriceFor( resp.Item ) * amount; break; } } @@ -1262,7 +1265,7 @@ namespace Server.Mobiles } //no cliloc for this? //SayTo( seller, true, "Thank you! I bought {0} item{1}. Here is your {2}gp.", Sold, (Sold > 1 ? "s" : ""), GiveGold ); - + return true; } @@ -1270,7 +1273,7 @@ namespace Server.Mobiles { base.Serialize( writer ); - writer.Write( (int) 1 ); // version + writer.Write( (int)1 ); // version ArrayList sbInfos = this.SBInfos; @@ -1298,7 +1301,7 @@ namespace Server.Mobiles if ( doubled > 0 ) { - writer.WriteEncodedInt( 1 + ((j * sbInfos.Count) + i) ); + writer.WriteEncodedInt( 1 + ( ( j * sbInfos.Count ) + i ) ); writer.WriteEncodedInt( doubled ); } } @@ -1320,48 +1323,48 @@ namespace Server.Mobiles switch ( version ) { case 1: - { - int index; - - while ( (index = reader.ReadEncodedInt()) > 0 ) { - int doubled = reader.ReadEncodedInt(); + int index; - if ( sbInfos != null ) + while ( ( index = reader.ReadEncodedInt() ) > 0 ) { - index -= 1; - int sbInfoIndex = index % sbInfos.Count; - int buyInfoIndex = index / sbInfos.Count; - - if ( sbInfoIndex >= 0 && sbInfoIndex < sbInfos.Count ) + int doubled = reader.ReadEncodedInt(); + + if ( sbInfos != null ) { - SBInfo sbInfo = (SBInfo)sbInfos[sbInfoIndex]; - ArrayList buyInfo = sbInfo.BuyInfo; + index -= 1; + int sbInfoIndex = index % sbInfos.Count; + int buyInfoIndex = index / sbInfos.Count; - if ( buyInfo != null && buyInfoIndex >= 0 && buyInfoIndex < buyInfo.Count ) + if ( sbInfoIndex >= 0 && sbInfoIndex < sbInfos.Count ) { - GenericBuyInfo gbi = (GenericBuyInfo)buyInfo[buyInfoIndex]; + SBInfo sbInfo = (SBInfo)sbInfos[sbInfoIndex]; + ArrayList buyInfo = sbInfo.BuyInfo; - int amount = 20; - - switch ( doubled ) + if ( buyInfo != null && buyInfoIndex >= 0 && buyInfoIndex < buyInfo.Count ) { - case 1: amount = 40; break; - case 2: amount = 80; break; - case 3: amount = 160; break; - case 4: amount = 320; break; - case 5: amount = 640; break; - case 6: amount = 999; break; - } + GenericBuyInfo gbi = (GenericBuyInfo)buyInfo[buyInfoIndex]; - gbi.Amount = gbi.MaxAmount = amount; + int amount = 20; + + switch ( doubled ) + { + case 1: amount = 40; break; + case 2: amount = 80; break; + case 3: amount = 160; break; + case 4: amount = 320; break; + case 5: amount = 640; break; + case 6: amount = 999; break; + } + + gbi.Amount = gbi.MaxAmount = amount; + } } } } - } - break; - } + break; + } } if ( IsParagon ) @@ -1413,7 +1416,8 @@ namespace Server.ContextMenus { private BaseVendor m_Vendor; - public VendorBuyEntry( Mobile from, BaseVendor vendor ) : base( 6103, 8 ) + public VendorBuyEntry( Mobile from, BaseVendor vendor ) + : base( 6103, 8 ) { m_Vendor = vendor; Enabled = vendor.CheckVendorAccess( from ); @@ -1429,7 +1433,8 @@ namespace Server.ContextMenus { private BaseVendor m_Vendor; - public VendorSellEntry( Mobile from, BaseVendor vendor ) : base( 6104, 8 ) + public VendorSellEntry( Mobile from, BaseVendor vendor ) + : base( 6104, 8 ) { m_Vendor = vendor; Enabled = vendor.CheckVendorAccess( from ); @@ -1459,7 +1464,7 @@ namespace Server bool IsSellable( Item item ); //What do we sell? - Type[] Types{ get; } + Type[] Types { get; } //does the vendor resell this item? bool IsResellable( Item item ); @@ -1470,27 +1475,27 @@ namespace Server //get a new instance of an object (we just bought it) IEntity GetEntity(); - int ControlSlots{ get; } + int ControlSlots { get; } - int PriceScalar{ get; set; } + int PriceScalar { get; set; } //display price of the item - int Price{ get; } + int Price { get; } //display name of the item - string Name{ get; } + string Name { get; } //display hue - int Hue{ get; } + int Hue { get; } //display id - int ItemID{ get; } + int ItemID { get; } //amount in stock - int Amount{ get; set; } + int Amount { get; set; } //max amount in stock - int MaxAmount{ get; } + int MaxAmount { get; } //Attempt to restock with item, (return true if restock sucessful) bool Restock( Item item, int amount ); diff --git a/Scripts/Multis/HouseFoundation.cs b/Scripts/Multis/HouseFoundation.cs index 6fde6273f..c5ddc0f63 100644 --- a/Scripts/Multis/HouseFoundation.cs +++ b/Scripts/Multis/HouseFoundation.cs @@ -894,32 +894,32 @@ namespace Server.Multis int cost = newPrice - oldPrice; if ( !this.Deleted ) { // Temporary Fix. We should be booting a client out of customization mode in the delete handler. - if ( from.AccessLevel >= AccessLevel.GameMaster && cost != 0 ) - { - from.SendMessage( "{0} gold would have been {1} your bank if you were not a GM.", cost.ToString(), ((cost > 0 )? "withdrawn from" : "deposited into" ) ); - } - else - { - if ( cost > 0 ) - { - if ( Banker.Withdraw( from, cost ) ) - { - from.SendLocalizedMessage( 1060398, cost.ToString() ); // ~1_AMOUNT~ gold has been withdrawn from your bank box. - } - else - { - from.SendLocalizedMessage( 1061903 ); // You cannot commit this house design, because you do not have the necessary funds in your bank box to pay for the upgrade. Please back up your design, obtain the required funds, and commit your design again. - return; - } - } - else if ( cost < 0 ) - { + if ( from.AccessLevel >= AccessLevel.GameMaster && cost != 0 ) + { + from.SendMessage( "{0} gold would have been {1} your bank if you were not a GM.", cost.ToString(), ((cost > 0 )? "withdrawn from" : "deposited into" ) ); + } + else + { + if ( cost > 0 ) + { + if ( Banker.Withdraw( from, cost ) ) + { + from.SendLocalizedMessage( 1060398, cost.ToString() ); // ~1_AMOUNT~ gold has been withdrawn from your bank box. + } + else + { + from.SendLocalizedMessage( 1061903 ); // You cannot commit this house design, because you do not have the necessary funds in your bank box to pay for the upgrade. Please back up your design, obtain the required funds, and commit your design again. + return; + } + } + else if ( cost < 0 ) + { if ( Banker.Deposit( from, -cost ) ) - from.SendLocalizedMessage( 1060397, ( -cost ).ToString() ); // ~1_AMOUNT~ gold has been deposited into your bank box. - else - return; - } - } + from.SendLocalizedMessage( 1060397, ( -cost ).ToString() ); // ~1_AMOUNT~ gold has been deposited into your bank box. + else + return; + } + } } /* Client chose to commit current design state diff --git a/Scripts/Multis/HousePlacement.cs b/Scripts/Multis/HousePlacement.cs index 7aecd46da..0259888df 100644 --- a/Scripts/Multis/HousePlacement.cs +++ b/Scripts/Multis/HousePlacement.cs @@ -2,7 +2,6 @@ using System; using System.Collections; using System.Collections.Generic; using Server; -using Server.Items; using Server.Regions; namespace Server.Multis diff --git a/Scripts/Spells/Base/SpellHelper.cs b/Scripts/Spells/Base/SpellHelper.cs index 36207c98d..b27d88ffe 100644 --- a/Scripts/Spells/Base/SpellHelper.cs +++ b/Scripts/Spells/Base/SpellHelper.cs @@ -583,6 +583,12 @@ namespace Server.Spells return false; } + if( caster != null && caster.AccessLevel == AccessLevel.Player && caster.Region.IsPartOf( typeof( Regions.Jail ) ) ) + { + caster.SendLocalizedMessage( 1042632 ); // You'll need a better jailbreak plan then that! + return false; + } + m_TravelCaster = caster; m_TravelType = type; diff --git a/Server/Items/Container.cs b/Server/Items/Container.cs index bd2b33af3..36dcb985c 100644 --- a/Server/Items/Container.cs +++ b/Server/Items/Container.cs @@ -100,7 +100,7 @@ namespace Server.Items public int MaxItems { get{ return ( m_MaxItems == -1 ? DefaultMaxItems : m_MaxItems ); } - set{ m_MaxItems = value; } + set{ m_MaxItems = value; InvalidateProperties(); } } [CommandProperty( AccessLevel.GameMaster )] diff --git a/Server/Map.cs b/Server/Map.cs index 34483e29e..af4e9ac09 100644 --- a/Server/Map.cs +++ b/Server/Map.cs @@ -1245,7 +1245,16 @@ namespace Server { if ( m_Enumerator.MoveNext() ) { - object o = m_Enumerator.Current; + object o; + + try + { + o = m_Enumerator.Current; + } + catch + { + continue; + } if ( o is Mobile ) { @@ -1503,7 +1512,16 @@ namespace Server { if ( m_Enumerator.MoveNext() ) { - object o = m_Enumerator.Current; + object o; + + try + { + o = m_Enumerator.Current; + } + catch + { + continue; + } if ( o is Mobile ) { diff --git a/Server/Mobile.cs b/Server/Mobile.cs index 5fd4d870c..9ef3f569f 100644 --- a/Server/Mobile.cs +++ b/Server/Mobile.cs @@ -774,8 +774,8 @@ namespace Server #endregion - private static TimeSpan WarmodeSpamCatch = TimeSpan.FromSeconds( 0.5 ); - private static TimeSpan WarmodeSpamDelay = TimeSpan.FromSeconds( 2.0 ); + private static readonly TimeSpan WarmodeSpamCatch = TimeSpan.FromSeconds( (Core.SE ? 1.0 : 0.5) ); + private static readonly TimeSpan WarmodeSpamDelay = TimeSpan.FromSeconds( (Core.SE ? 4.0 : 2.0) ); private const int WarmodeCatchCount = 4; // Allow four warmode changes in 0.5 seconds, any more will be delay for two seconds [CommandProperty( AccessLevel.GameMaster )] @@ -1182,7 +1182,7 @@ namespace Server UpdateAggrExpire(); } - public List Stabled { get { return m_Stabled; } set { m_Stabled = value; } } + public List Stabled { get { return m_Stabled; } } [CommandProperty( AccessLevel.Counselor, AccessLevel.GameMaster )] public VirtueInfo Virtues { get { return m_Virtues; } set { } } diff --git a/Server/SecureTrade.cs b/Server/SecureTrade.cs index f7af27493..7a58c7cb4 100644 --- a/Server/SecureTrade.cs +++ b/Server/SecureTrade.cs @@ -113,8 +113,8 @@ namespace Server if ( ns != null ) ns.RemoveTrade( this ); - m_From.Container.Delete(); - m_To.Container.Delete(); + Timer.DelayCall( TimeSpan.Zero, delegate{ m_From.Container.Delete(); } ); + Timer.DelayCall( TimeSpan.Zero, delegate{ m_To.Container.Delete(); } ); } public void Update()