diff --git a/Scripts/Accounting/AccessRestrictions.cs b/Scripts/Accounting/AccessRestrictions.cs index 00ecad3b..71d2efb7 100644 --- a/Scripts/Accounting/AccessRestrictions.cs +++ b/Scripts/Accounting/AccessRestrictions.cs @@ -31,7 +31,7 @@ namespace Server Console.WriteLine( "Client: {0}: Past IP limit threshold", ip ); using ( StreamWriter op = new StreamWriter( "ipLimits.log", true ) ) - op.WriteLine( "{0}\tPast IP limit threshold\t{1}", ip, DateTime.UtcNow ); + op.WriteLine( "{0}\tPast IP limit threshold\t{1}", ip, DateTime.Now ); e.AllowConnection = false; return; diff --git a/Scripts/Accounting/Account.cs b/Scripts/Accounting/Account.cs index f776d387..0143e19d 100644 --- a/Scripts/Accounting/Account.cs +++ b/Scripts/Accounting/Account.cs @@ -763,6 +763,7 @@ namespace Server.Accounting public Account( XmlElement node ) { m_Username = Utility.GetText( node["username"], "empty" ); + m_Email = Utility.GetText( node["email"], "none" ); string plainPassword = Utility.GetText( node["password"], null ); string cryptPassword = Utility.GetText( node["cryptPassword"], null ); @@ -1128,6 +1129,10 @@ namespace Server.Accounting xml.WriteString( m_Username ); xml.WriteEndElement(); + xml.WriteStartElement( "email" ); + xml.WriteString( m_Email ); + xml.WriteEndElement(); + if ( m_PlainPassword != null ) { xml.WriteStartElement( "password" ); diff --git a/Scripts/Accounting/AccountHandler.cs b/Scripts/Accounting/AccountHandler.cs index f130bed7..e82e4e93 100644 --- a/Scripts/Accounting/AccountHandler.cs +++ b/Scripts/Accounting/AccountHandler.cs @@ -214,6 +214,7 @@ namespace Server.Misc acct.Comments.Add( new AccountComment( "System", String.Format( "Character #{0} {1} deleted by {2}", index + 1, m, state ) ) ); m.Delete(); + state.Send( new CharacterListUpdate( acct ) ); } } @@ -306,7 +307,7 @@ namespace Server.Misc Console.WriteLine( "Login: {0}: Past IP limit threshold", e.State ); using ( StreamWriter op = new StreamWriter( "ipLimits.log", true ) ) - op.WriteLine( "{0}\tPast IP limit threshold\t{1}", e.State, DateTime.UtcNow ); + op.WriteLine( "{0}\tPast IP limit threshold\t{1}", e.State, DateTime.Now ); return; } @@ -370,7 +371,7 @@ namespace Server.Misc Console.WriteLine( "Login: {0}: Past IP limit threshold", e.State ); using ( StreamWriter op = new StreamWriter( "ipLimits.log", true ) ) - op.WriteLine( "{0}\tPast IP limit threshold\t{1}", e.State, DateTime.UtcNow ); + op.WriteLine( "{0}\tPast IP limit threshold\t{1}", e.State, DateTime.Now ); return; } diff --git a/Scripts/Engines/MyRunUO/MyRunUO.cs b/Scripts/Engines/MyRunUO/MyRunUO.cs index 96cc10d8..57875fe4 100644 --- a/Scripts/Engines/MyRunUO/MyRunUO.cs +++ b/Scripts/Engines/MyRunUO/MyRunUO.cs @@ -91,7 +91,7 @@ namespace Server.Engines.MyRunUO { if ( m_Command != null && !m_Command.HasCompleted ) return; - DateTime start = DateTime.Now; + Console.WriteLine( "MyRunUO: Creating tables" ); try { diff --git a/Scripts/Gumps/Go/GoGump.cs b/Scripts/Gumps/Go/GoGump.cs index d8554092..f542c21a 100644 --- a/Scripts/Gumps/Go/GoGump.cs +++ b/Scripts/Gumps/Go/GoGump.cs @@ -12,6 +12,7 @@ namespace Server.Gumps public static readonly LocationTree Ilshenar = new LocationTree( "ilshenar.xml", Map.Ilshenar ); public static readonly LocationTree Malas = new LocationTree( "malas.xml", Map.Malas ); public static readonly LocationTree Tokuno = new LocationTree( "tokuno.xml", Map.Tokuno ); + public static readonly LocationTree TerMur = new LocationTree( "termur.xml", Map.TerMur ); public static bool OldStyle = PropsConfig.OldStyle; @@ -76,8 +77,10 @@ namespace Server.Gumps tree = Trammel; else if ( from.Map == Map.Malas ) tree = Malas; - else + else if ( from.Map == Map.Tokuno ) tree = Tokuno; + else + tree = TerMur; ParentNode branch = null; tree.LastBranch.TryGetValue( from, out branch ); diff --git a/Scripts/Mobiles/Townfolk/Banker.cs b/Scripts/Mobiles/Townfolk/Banker.cs index b6fd9529..3fe0c02a 100644 --- a/Scripts/Mobiles/Townfolk/Banker.cs +++ b/Scripts/Mobiles/Townfolk/Banker.cs @@ -63,11 +63,13 @@ namespace Server.Mobiles if (AccountGold.Enabled && m.Account != null) { int goldStub; + m.Account.GetGoldBalance(out goldStub, out balance); if (balance > Int32.MaxValue) { gold = checks = new Item[0]; + return Int32.MaxValue; } } @@ -182,6 +184,7 @@ namespace Server.Mobiles else { item.Delete(); + foreach (var curItem in items) { curItem.Delete(); @@ -210,6 +213,7 @@ namespace Server.Mobiles } var amountLeft = amount; + while (amountLeft > 0) { Item item; diff --git a/Scripts/Mobiles/Vendors/BaseVendor.cs b/Scripts/Mobiles/Vendors/BaseVendor.cs index 92dc85ca..7063a27a 100644 --- a/Scripts/Mobiles/Vendors/BaseVendor.cs +++ b/Scripts/Mobiles/Vendors/BaseVendor.cs @@ -77,7 +77,7 @@ namespace Server.Mobiles } #region Faction - public virtual int GetPriceScalar() + public virtual int GetPriceScalar( Mobile buyer ) { Town town = Town.FromRegion( this.Region ); @@ -87,9 +87,9 @@ namespace Server.Mobiles return 100; } - public void UpdateBuyInfo() + public void UpdateBuyInfo( Mobile buyer ) { - int priceScalar = GetPriceScalar(); + int priceScalar = GetPriceScalar( buyer ); IBuyItemInfo[] buyinfo = (IBuyItemInfo[])m_ArmorBuyInfo.ToArray( typeof( IBuyItemInfo ) ); @@ -512,7 +512,7 @@ namespace Server.Mobiles { m_LastRestock = DateTime.UtcNow; - IBuyItemInfo[] buyInfo = this.GetBuyInfo(); + IBuyItemInfo[] buyInfo = this.GetBuyInfo( ); foreach ( IBuyItemInfo bii in buyInfo ) bii.OnRestock(); @@ -537,7 +537,7 @@ namespace Server.Mobiles if ( DateTime.UtcNow - m_LastRestock > RestockDelay ) Restock(); - UpdateBuyInfo(); + UpdateBuyInfo( from ); int count = 0; List list; @@ -710,7 +710,7 @@ namespace Server.Mobiles { IShopSellInfo[] info = GetSellInfo(); - Dictionary table = new Dictionary(); + List table = new List(); foreach ( IShopSellInfo ssi in info ) { @@ -721,8 +721,13 @@ namespace Server.Mobiles if ( item is Container && ( (Container)item ).Items.Count != 0 ) continue; + LockableContainer parentcon = item.Parent as LockableContainer; + + if ( parentcon != null && parentcon.Locked ) + continue; + if ( item.IsStandardLoot() && item.Movable && ssi.IsSellable( item ) ) - table[item] = new SellItemState( item, ssi.GetSellPriceFor( item ), ssi.GetNameFor( item ) ); + table.Add( new SellItemState( item, ssi.GetSellPriceFor( item ), ssi.GetNameFor( item ) ) ); } } @@ -730,7 +735,7 @@ namespace Server.Mobiles { SendPacksTo( from ); - from.Send( new VendorSellList( this, table.Values ) ); + from.Send( new VendorSellList( this, table ) ); } else { @@ -928,7 +933,7 @@ namespace Server.Mobiles return false; } - UpdateBuyInfo(); + UpdateBuyInfo( buyer ); IBuyItemInfo[] buyInfo = this.GetBuyInfo(); IShopSellInfo[] info = GetSellInfo(); @@ -1282,8 +1287,6 @@ namespace Server.Mobiles seller.SendGump( new SmallBODAcceptGump( seller, (SmallBOD)bulkOrder ) ); } } - //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; } @@ -1389,7 +1392,7 @@ namespace Server.Mobiles if ( IsParagon ) IsParagon = false; - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( CheckMorph ) ); + Timer.DelayCall( CheckMorph ); } public override void AddCustomContextEntries( Mobile from, List list ) @@ -1409,12 +1412,12 @@ namespace Server.Mobiles base.AddCustomContextEntries( from, list ); } - public virtual IShopSellInfo[] GetSellInfo() + public virtual IShopSellInfo[] GetSellInfo( ) { return (IShopSellInfo[])m_ArmorSellInfo.ToArray( typeof( IShopSellInfo ) ); } - public virtual IBuyItemInfo[] GetBuyInfo() + public virtual IBuyItemInfo[] GetBuyInfo( ) { return (IBuyItemInfo[])m_ArmorBuyInfo.ToArray( typeof( IBuyItemInfo ) ); } @@ -1514,4 +1517,4 @@ namespace Server //called when its time for the whole shop to restock void OnRestock(); } -} \ No newline at end of file +} diff --git a/Scripts/Scripts.csproj b/Scripts/Scripts.csproj index 34b3a2ae..4331ea3d 100644 --- a/Scripts/Scripts.csproj +++ b/Scripts/Scripts.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -7,7 +7,7 @@ Library false Scripts.CS - v4.0 + v4.5.2 512 @@ -21,6 +21,7 @@ prompt 4 false + false pdbonly @@ -30,6 +31,7 @@ prompt 4 false + false Server @@ -43,6 +45,7 @@ prompt MinimumRecommendedRules.ruleset false + false Output\ @@ -53,6 +56,7 @@ prompt MinimumRecommendedRules.ruleset false + false diff --git a/Scripts/Spells/Mysticism/SpellPlagueSpell.cs b/Scripts/Spells/Mysticism/SpellPlagueSpell.cs index b35c9e5d..7168cd8f 100644 --- a/Scripts/Spells/Mysticism/SpellPlagueSpell.cs +++ b/Scripts/Spells/Mysticism/SpellPlagueSpell.cs @@ -157,7 +157,7 @@ namespace Server.Spells.Mysticism public void OnDamage() { - if ( DateTime.Now > ( m_LastExploded + TimeSpan.FromSeconds( 2.0 ) ) ) + if ( DateTime.UtcNow > ( m_LastExploded + TimeSpan.FromSeconds( 2.0 ) ) ) { var exploChance = 90 - ( m_Explosions * 30 ); @@ -173,7 +173,7 @@ namespace Server.Spells.Mysticism var damage = m_Owner.GetNewAosDamage( 15 + ( m_Explosions * 3 ), 1, 5, m_Target ); m_Explosions++; - m_LastExploded = DateTime.Now; + m_LastExploded = DateTime.UtcNow; var types = new int[4]; types[Utility.Random( types.Length )] = 100;