From 49b5e968505dd0258537c94205c9ce4f979cf7c0 Mon Sep 17 00:00:00 2001 From: mark Date: Thu, 19 Feb 2009 08:27:47 +0000 Subject: [PATCH] --- Scripts/Commands/Decorate.cs | 2 +- Scripts/Engines/Craft/DefTailoring.cs | 1 - Scripts/Engines/Virtues/Justice.cs | 2 ++ Scripts/Gumps/HouseGumpAOS.cs | 7 +++-- Scripts/Gumps/PolymorphGump.cs | 2 -- Scripts/Gumps/ResurrectGump.cs | 9 +++++- Scripts/Mobiles/Vendors/PlayerVendor.cs | 2 +- Scripts/Multis/BaseHouse.cs | 14 --------- Scripts/Multis/HousePlacement.cs | 40 +++++++++++++++++++++---- 9 files changed, 52 insertions(+), 27 deletions(-) diff --git a/Scripts/Commands/Decorate.cs b/Scripts/Commands/Decorate.cs index fe2daf250..3a58d8317 100644 --- a/Scripts/Commands/Decorate.cs +++ b/Scripts/Commands/Decorate.cs @@ -1,11 +1,11 @@ using System; using System.IO; using System.Collections; +using System.Collections.Generic; using Server; using Server.Items; using Server.Engines.Quests.Haven; using Server.Engines.Quests.Necro; -using System.Collections.Generic; namespace Server.Commands { diff --git a/Scripts/Engines/Craft/DefTailoring.cs b/Scripts/Engines/Craft/DefTailoring.cs index 73477063d..8b69359ae 100644 --- a/Scripts/Engines/Craft/DefTailoring.cs +++ b/Scripts/Engines/Craft/DefTailoring.cs @@ -145,7 +145,6 @@ namespace Server.Engines.Craft SetNeededExpansion( index, Expansion.SE ); } - // Pants #endregion #region Pants diff --git a/Scripts/Engines/Virtues/Justice.cs b/Scripts/Engines/Virtues/Justice.cs index bdc89de3a..d4e4f28ce 100644 --- a/Scripts/Engines/Virtues/Justice.cs +++ b/Scripts/Engines/Virtues/Justice.cs @@ -99,6 +99,8 @@ namespace Server protector.SendLocalizedMessage( 1049436 ); // That player cannot be protected. else if ( pm.JusticeProtectors.Count > 0 ) protector.SendLocalizedMessage( 1049369 ); // You cannot protect that player right now. + else if ( pm.HasGump( typeof( AcceptProtectorGump ) ) ) + protector.SendLocalizedMessage( 1049369 ); // You cannot protect that player right now. else pm.SendGump( new AcceptProtectorGump( protector, pm ) ); } diff --git a/Scripts/Gumps/HouseGumpAOS.cs b/Scripts/Gumps/HouseGumpAOS.cs index 019a7a508..71f218e39 100644 --- a/Scripts/Gumps/HouseGumpAOS.cs +++ b/Scripts/Gumps/HouseGumpAOS.cs @@ -1200,10 +1200,13 @@ namespace Server.Gumps { if ( isOwner && m_House.MovingCrate == null && m_House.InternalizedVendors.Count == 0 ) { - if( !Guilds.Guild.NewGuildSystem && m_House.FindGuildstone() != null ) + if( !Guilds.Guild.NewGuildSystem && m_House.FindGuildstone() != null ) { from.SendLocalizedMessage( 501389 ); // You cannot redeed a house with a guildstone inside. - else + } + else { + from.CloseGump( typeof( HouseDemolishGump ) ); from.SendGump( new HouseDemolishGump( from, m_House ) ); + } } break; diff --git a/Scripts/Gumps/PolymorphGump.cs b/Scripts/Gumps/PolymorphGump.cs index c3b9e1eeb..3d103c428 100644 --- a/Scripts/Gumps/PolymorphGump.cs +++ b/Scripts/Gumps/PolymorphGump.cs @@ -156,7 +156,6 @@ namespace Server.Gumps } } - public class NewPolymorphGump : Gump { private static readonly PolymorphEntry[] m_Entries = new PolymorphEntry[] @@ -181,7 +180,6 @@ namespace Server.Gumps PolymorphEntry.Daemon }; - private Mobile m_Caster; private Item m_Scroll; diff --git a/Scripts/Gumps/ResurrectGump.cs b/Scripts/Gumps/ResurrectGump.cs index f39df6ed3..f8182e129 100644 --- a/Scripts/Gumps/ResurrectGump.cs +++ b/Scripts/Gumps/ResurrectGump.cs @@ -48,6 +48,11 @@ namespace Server.Gumps { } + public ResurrectGump( Mobile owner, Mobile healer, ResurrectMessage msg ) + : this( owner, healer, msg, false ) + { + } + public ResurrectGump( Mobile owner, Mobile healer, ResurrectMessage msg, bool fromSacrifice ) : this( owner, healer, msg, fromSacrifice, 0.0 ) { @@ -138,6 +143,8 @@ namespace Server.Gumps { Mobile from = state.Mobile; + from.CloseGump( typeof( ResurrectGump ) ); + if( info.ButtonID == 1 || info.ButtonID == 2 ) { if( from.Map == null || !from.Map.CanFit( from.Location, 16, false, false ) ) @@ -241,4 +248,4 @@ namespace Server.Gumps } } } -} +} \ No newline at end of file diff --git a/Scripts/Mobiles/Vendors/PlayerVendor.cs b/Scripts/Mobiles/Vendors/PlayerVendor.cs index c66d4b682..fd6e237d0 100644 --- a/Scripts/Mobiles/Vendors/PlayerVendor.cs +++ b/Scripts/Mobiles/Vendors/PlayerVendor.cs @@ -1719,4 +1719,4 @@ namespace Server.Mobiles Timer.DelayCall( TimeSpan.Zero, new TimerCallback( Delete ) ); } } -} +} \ No newline at end of file diff --git a/Scripts/Multis/BaseHouse.cs b/Scripts/Multis/BaseHouse.cs index cdc4814a7..0218f4fbc 100644 --- a/Scripts/Multis/BaseHouse.cs +++ b/Scripts/Multis/BaseHouse.cs @@ -2833,20 +2833,6 @@ namespace Server.Multis public override void OnDelete() { - /*Map map = this.Map; - - if ( map != null ) - { - MultiComponentList mcl = Components; - IPooledEnumerable eable = map.GetItemsInBounds( new Rectangle2D( X + mcl.Min.X, Y + mcl.Min.Y, mcl.Width, mcl.Height ) ); - - foreach ( Item item in eable ) - if ( item is Guildstone && Contains( item ) ) - item.Delete(); - - eable.Free(); - }*/ - RestoreRelocatedEntities(); new FixColumnTimer( this ).Start(); diff --git a/Scripts/Multis/HousePlacement.cs b/Scripts/Multis/HousePlacement.cs index 54ed811ad..fda59f3a4 100644 --- a/Scripts/Multis/HousePlacement.cs +++ b/Scripts/Multis/HousePlacement.cs @@ -2,7 +2,11 @@ using System; using System.Collections; using System.Collections.Generic; using Server; +using Server.Guilds; +using Server.Items; +using Server.Misc; using Server.Regions; +using Server.Spells; namespace Server.Multis { @@ -56,8 +60,8 @@ namespace Server.Multis if ( from.AccessLevel >= AccessLevel.GameMaster ) return HousePlacementResult.Valid; // Staff can place anywhere - if ( map == Map.Ilshenar ) - return HousePlacementResult.BadRegion; // No houses in Ilshenar + if ( map == Map.Ilshenar || SpellHelper.IsFeluccaT2A( map, center ) ) + return HousePlacementResult.BadRegion; // No houses in Ilshenar/T2A NoHousingRegion noHousingRegion = (NoHousingRegion) Region.Find( center, map ).GetRegion( typeof( NoHousingRegion ) ); @@ -319,9 +323,36 @@ namespace Server.Multis } } + List _sectors = new List(); + List _houses = new List(); + + for ( int i = 0; i < yard.Count; i++ ) { + Sector sector = map.GetSector( yard[i] ); + + if ( !_sectors.Contains( sector ) ) { + _sectors.Add( sector ); + + if ( sector.Multis != null ) { + for ( int j = 0; j < sector.Multis.Count; j++ ) { + if ( sector.Multis[j] is BaseHouse ) { + BaseHouse _house = (BaseHouse)sector.Multis[j]; + if ( !_houses.Contains( _house ) ) { + _houses.Add( _house ); + } + } + } + } + } + } + for ( int i = 0; i < yard.Count; ++i ) { - Point2D yardPoint = yard[i]; + foreach ( BaseHouse b in _houses ) { + if ( b.Contains( yard[i] ) ) + return HousePlacementResult.BadStatic; // Broke rule #3 + } + + /*Point2D yardPoint = yard[i]; IPooledEnumerable eable = map.GetMultiTilesAt( yardPoint.X, yardPoint.Y ); @@ -337,11 +368,10 @@ namespace Server.Multis } } - eable.Free(); + eable.Free();*/ } return HousePlacementResult.Valid; - } } } \ No newline at end of file