diff --git a/Projects/Scripts/Accounting/Account.cs b/Projects/Scripts/Accounting/Account.cs index e8e75fa4b..76c87ac5e 100644 --- a/Projects/Scripts/Accounting/Account.cs +++ b/Projects/Scripts/Accounting/Account.cs @@ -11,801 +11,798 @@ using Server.Network; namespace Server.Accounting { - public class Account : IAccount, IComparable - { - public static readonly TimeSpan YoungDuration = TimeSpan.FromHours( 40.0 ); + public class Account : IAccount, IComparable + { + public static readonly TimeSpan YoungDuration = TimeSpan.FromHours( 40.0 ); - public static readonly TimeSpan InactiveDuration = TimeSpan.FromDays( 180.0 ); + public static readonly TimeSpan InactiveDuration = TimeSpan.FromDays( 180.0 ); - public static readonly TimeSpan EmptyInactiveDuration = TimeSpan.FromDays(30.0); + public static readonly TimeSpan EmptyInactiveDuration = TimeSpan.FromDays(30.0); - private AccessLevel m_AccessLevel; - private TimeSpan m_TotalGameTime; - private List m_Comments; - private List m_Tags; - private Mobile[] m_Mobiles; - - /// - /// Deletes the account, all characters of the account, and all houses of those characters - /// - public void Delete() - { - for ( int i = 0; i < Length; ++i ) - { - Mobile m = this[i]; - - if ( m == null ) - continue; - - List list = BaseHouse.GetHouses( m ); - - for ( int j = 0; j < list.Count; ++j ) - list[j].Delete(); - - m.Delete(); - - m.Account = null; - m_Mobiles[i] = null; - } - - if ( LoginIPs.Length != 0 && AccountHandler.IPTable.ContainsKey( LoginIPs[0] ) ) - --AccountHandler.IPTable[LoginIPs[0]]; - - Accounts.Remove( Username ); - } - - /// - /// Object detailing information about the hardware of the last person to log into this account - /// - public HardwareInfo HardwareInfo { get; set; } - - /// - /// List of IP addresses for restricted access. '*' wildcard supported. If the array contains zero entries, all IP addresses are allowed. - /// - public string[] IPRestrictions { get; set; } - - /// - /// List of IP addresses which have successfully logged into this account. - /// - public IPAddress[] LoginIPs { get; set; } - - /// - /// List of account comments. Type of contained objects is AccountComment. - /// - public List Comments => m_Comments ?? (m_Comments = new List()); + private AccessLevel m_AccessLevel; + private TimeSpan m_TotalGameTime; + private List m_Comments; + private List m_Tags; + private Mobile[] m_Mobiles; /// - /// List of account tags. Type of contained objects is AccountTag. - /// - public List Tags => m_Tags ?? (m_Tags = new List()); + /// Deletes the account, all characters of the account, and all houses of those characters + /// + public void Delete() + { + for ( int i = 0; i < Length; ++i ) + { + Mobile m = this[i]; + + if ( m == null ) + continue; + + List list = BaseHouse.GetHouses( m ); + + for ( int j = 0; j < list.Count; ++j ) + list[j].Delete(); + + m.Delete(); + + m.Account = null; + m_Mobiles[i] = null; + } + + if ( LoginIPs.Length != 0 && AccountHandler.IPTable.ContainsKey( LoginIPs[0] ) ) + --AccountHandler.IPTable[LoginIPs[0]]; + + Accounts.Remove( Username ); + } /// - /// Account username. Case insensitive validation. - /// - public string Username { get; set; } + /// Object detailing information about the hardware of the last person to log into this account + /// + public HardwareInfo HardwareInfo { get; set; } - /// - /// Account email address. - /// - public string Email { get; set; } + /// + /// List of IP addresses for restricted access. '*' wildcard supported. If the array contains zero entries, all IP addresses are allowed. + /// + public string[] IPRestrictions { get; set; } - /// - /// Account password. Plain text. Case sensitive validation. May be null. - /// - public string PlainPassword { get; set; } + /// + /// List of IP addresses which have successfully logged into this account. + /// + public IPAddress[] LoginIPs { get; set; } - /// - /// Account password. Hashed with MD5. May be null. - /// - public string CryptPassword { get; set; } + /// + /// List of account comments. Type of contained objects is AccountComment. + /// + public List Comments => m_Comments ?? (m_Comments = new List()); - /// - /// Account username and password hashed with SHA1. May be null. - /// - public string NewCryptPassword { get; set; } + /// + /// List of account tags. Type of contained objects is AccountTag. + /// + public List Tags => m_Tags ?? (m_Tags = new List()); - /// - /// Initial AccessLevel for new characters created on this account. - /// - public AccessLevel AccessLevel - { - get => m_AccessLevel; - set => m_AccessLevel = value; - } + /// + /// Account username. Case insensitive validation. + /// + public string Username { get; set; } - /// - /// Internal bitfield of account flags. Consider using direct access properties (Banned, Young), or GetFlag/SetFlag methods - /// - public int Flags { get; set; } + /// + /// Account email address. + /// + public string Email { get; set; } - /// - /// Gets or sets a flag indicating if this account is banned. - /// - public bool Banned - { - get - { - bool isBanned = GetFlag( 0 ); + /// + /// Account password. Plain text. Case sensitive validation. May be null. + /// + public string PlainPassword { get; set; } - if ( !isBanned ) - return false; + /// + /// Account password. Hashed with MD5. May be null. + /// + public string CryptPassword { get; set; } + + /// + /// Account username and password hashed with SHA1. May be null. + /// + public string NewCryptPassword { get; set; } + + /// + /// Initial AccessLevel for new characters created on this account. + /// + public AccessLevel AccessLevel + { + get => m_AccessLevel; + set => m_AccessLevel = value; + } + + /// + /// Internal bitfield of account flags. Consider using direct access properties (Banned, Young), or GetFlag/SetFlag methods + /// + public int Flags { get; set; } + + /// + /// Gets or sets a flag indicating if this account is banned. + /// + public bool Banned + { + get + { + bool isBanned = GetFlag( 0 ); + + if ( !isBanned ) + return false; if ( GetBanTags( out DateTime banTime, out TimeSpan banDuration ) ) - { - if ( banDuration != TimeSpan.MaxValue && DateTime.UtcNow >= ( banTime + banDuration ) ) - { - SetUnspecifiedBan( null ); // clear - Banned = false; - return false; - } - } + { + if ( banDuration != TimeSpan.MaxValue && DateTime.UtcNow >= ( banTime + banDuration ) ) + { + SetUnspecifiedBan( null ); // clear + Banned = false; + return false; + } + } - return true; - } - set => SetFlag( 0, value ); - } + return true; + } + set => SetFlag( 0, value ); + } - /// - /// Gets or sets a flag indicating if the characters created on this account will have the young status. - /// - public bool Young - { - get => !GetFlag( 1 ); - set - { - SetFlag( 1, !value ); + /// + /// Gets or sets a flag indicating if the characters created on this account will have the young status. + /// + public bool Young + { + get => !GetFlag( 1 ); + set + { + SetFlag( 1, !value ); m_YoungTimer?.Stop(); m_YoungTimer = null; - } - } - - /// - /// The date and time of when this account was created. - /// - public DateTime Created { get; } - - /// - /// Gets or sets the date and time when this account was last accessed. - /// - public DateTime LastLogin { get; set; } - - /// - /// An account is considered inactive based upon LastLogin and InactiveDuration. If the account is empty, it is based upon EmptyInactiveDuration - /// - public bool Inactive - { - get - { - if ( AccessLevel != AccessLevel.Player ) - return false; - - TimeSpan inactiveLength = DateTime.UtcNow - LastLogin; - - return (inactiveLength > ((Count == 0) ? EmptyInactiveDuration : InactiveDuration)); - } - } - - /// - /// Gets the total game time of this account, also considering the game time of characters - /// that have been deleted. - /// - public TimeSpan TotalGameTime - { - get - { - for ( int i = 0; i < m_Mobiles.Length; i++ ) - { - if ( m_Mobiles[i] is PlayerMobile m && m.NetState != null ) - return m_TotalGameTime + ( DateTime.UtcNow - m.SessionStart ); - } - - return m_TotalGameTime; - } - } - - /// - /// Gets the value of a specific flag in the Flags bitfield. - /// - /// The zero-based flag index. - public bool GetFlag( int index ) - { - return ( Flags & ( 1 << index ) ) != 0; - } - - /// - /// Sets the value of a specific flag in the Flags bitfield. - /// - /// The zero-based flag index. - /// The value to set. - public void SetFlag( int index, bool value ) - { - if ( value ) - Flags |= ( 1 << index ); - else - Flags &= ~( 1 << index ); - } - - /// - /// Adds a new tag to this account. This method does not check for duplicate names. - /// - /// New tag name. - /// New tag value. - public void AddTag( string name, string value ) - { - Tags.Add( new AccountTag( name, value ) ); - } - - /// - /// Removes all tags with the specified name from this account. - /// - /// Tag name to remove. - public void RemoveTag( string name ) - { - for ( int i = Tags.Count - 1; i >= 0; --i ) - { - if ( i >= Tags.Count ) - continue; - - AccountTag tag = Tags[i]; - - if ( tag.Name == name ) - Tags.RemoveAt( i ); - } - } - - /// - /// Modifies an existing tag or adds a new tag if no tag exists. - /// - /// Tag name. - /// Tag value. - public void SetTag( string name, string value ) - { - for ( int i = 0; i < Tags.Count; ++i ) - { - AccountTag tag = Tags[i]; - - if ( tag.Name == name ) - { - tag.Value = value; - return; - } - } - - AddTag( name, value ); - } - - /// - /// Gets the value of a tag -or- null if there are no tags with the specified name. - /// - /// Name of the desired tag value. - public string GetTag( string name ) - { - for ( int i = 0; i < Tags.Count; ++i ) - { - AccountTag tag = Tags[i]; - - if ( tag.Name == name ) - return tag.Value; - } - - return null; - } - - public void SetUnspecifiedBan( Mobile from ) - { - SetBanTags( from, DateTime.MinValue, TimeSpan.Zero ); - } - - public void SetBanTags( Mobile from, DateTime banTime, TimeSpan banDuration ) - { - if ( from == null ) - RemoveTag( "BanDealer" ); - else - SetTag( "BanDealer", from.ToString() ); - - if ( banTime == DateTime.MinValue ) - RemoveTag( "BanTime" ); - else - SetTag( "BanTime", XmlConvert.ToString( banTime, XmlDateTimeSerializationMode.Utc ) ); - - if ( banDuration == TimeSpan.Zero ) - RemoveTag( "BanDuration" ); - else - SetTag( "BanDuration", banDuration.ToString() ); - } - - public bool GetBanTags( out DateTime banTime, out TimeSpan banDuration ) - { - string tagTime = GetTag( "BanTime" ); - string tagDuration = GetTag( "BanDuration" ); - - if ( tagTime != null ) - banTime = Utility.GetXMLDateTime( tagTime, DateTime.MinValue ); - else - banTime = DateTime.MinValue; - - if ( tagDuration == "Infinite" ) - { - banDuration = TimeSpan.MaxValue; - } - else if ( tagDuration != null ) - { - banDuration = Utility.ToTimeSpan( tagDuration ); - } - else - { - banDuration = TimeSpan.Zero; - } - - return ( banTime != DateTime.MinValue && banDuration != TimeSpan.Zero ); - } - - private static MD5CryptoServiceProvider m_MD5HashProvider; - private static SHA1CryptoServiceProvider m_SHA1HashProvider; - private static byte[] m_HashBuffer; - - public static string HashMD5( string phrase ) - { - if ( m_MD5HashProvider == null ) - m_MD5HashProvider = new MD5CryptoServiceProvider(); - - if ( m_HashBuffer == null ) - m_HashBuffer = new byte[256]; - - int length = Encoding.ASCII.GetBytes( phrase, 0, phrase.Length > 256 ? 256 : phrase.Length, m_HashBuffer, 0 ); - byte[] hashed = m_MD5HashProvider.ComputeHash( m_HashBuffer, 0, length ); - - return BitConverter.ToString( hashed ); - } - - public static string HashSHA1( string phrase ) - { - if ( m_SHA1HashProvider == null ) - m_SHA1HashProvider = new SHA1CryptoServiceProvider(); - - if ( m_HashBuffer == null ) - m_HashBuffer = new byte[256]; - - int length = Encoding.ASCII.GetBytes( phrase, 0, phrase.Length > 256 ? 256 : phrase.Length, m_HashBuffer, 0 ); - byte[] hashed = m_SHA1HashProvider.ComputeHash( m_HashBuffer, 0, length ); - - return BitConverter.ToString( hashed ); - } - - public void SetPassword( string plainPassword ) - { - switch ( AccountHandler.ProtectPasswords ) - { - case PasswordProtection.None: - { - PlainPassword = plainPassword; - CryptPassword = null; - NewCryptPassword = null; - - break; - } - case PasswordProtection.Crypt: - { - PlainPassword = null; - CryptPassword = HashMD5( plainPassword ); - NewCryptPassword = null; - - break; - } - default: // PasswordProtection.NewCrypt - { - PlainPassword = null; - CryptPassword = null; - NewCryptPassword = HashSHA1( Username + plainPassword ); - - break; - } - } - } - - public bool CheckPassword( string plainPassword ) - { - bool ok; - PasswordProtection curProt; - - if ( PlainPassword != null ) - { - ok = ( PlainPassword == plainPassword ); - curProt = PasswordProtection.None; - } - else if ( CryptPassword != null ) - { - ok = ( CryptPassword == HashMD5( plainPassword ) ); - curProt = PasswordProtection.Crypt; - } - else - { - ok = ( NewCryptPassword == HashSHA1( Username + plainPassword ) ); - curProt = PasswordProtection.NewCrypt; - } - - if ( ok && curProt != AccountHandler.ProtectPasswords ) - SetPassword( plainPassword ); - - return ok; - } - - private Timer m_YoungTimer; - - public static void Initialize() - { - EventSink.Connected += EventSink_Connected; - EventSink.Disconnected += EventSink_Disconnected; - EventSink.Login += EventSink_Login; - } - - private static void EventSink_Connected( ConnectedEventArgs e ) - { - if ( !(e.Mobile.Account is Account acc) ) - return; - - if ( acc.Young && acc.m_YoungTimer == null ) - { - acc.m_YoungTimer = new YoungTimer( acc ); - acc.m_YoungTimer.Start(); - } - } - - private static void EventSink_Disconnected( DisconnectedEventArgs e ) - { - if ( !(e.Mobile.Account is Account acc) ) - return; - - if ( acc.m_YoungTimer != null ) - { - acc.m_YoungTimer.Stop(); - acc.m_YoungTimer = null; - } - - if ( !(e.Mobile is PlayerMobile m) ) - return; - - acc.m_TotalGameTime += DateTime.UtcNow - m.SessionStart; - } - - private static void EventSink_Login( LoginEventArgs e ) - { - if ( !(e.Mobile is PlayerMobile m) ) - return; - - if ( !(m.Account is Account acc) ) - return; - - if ( m.Young && acc.Young ) - { - TimeSpan ts = YoungDuration - acc.TotalGameTime; - int hours = Math.Max( (int) ts.TotalHours, 0 ); - - m.SendAsciiMessage( "You will enjoy the benefits and relatively safe status of a young player for {0} more hour{1}.", hours, hours != 1 ? "s" : "" ); - } - } - - public void RemoveYoungStatus( int message ) - { - Young = false; - - for ( int i = 0; i < m_Mobiles.Length; i++ ) - { - if ( m_Mobiles[i] is PlayerMobile m && m.Young ) - { - m.Young = false; - - if ( m.NetState != null ) - { - if ( message > 0 ) - m.SendLocalizedMessage( message ); - - m.SendLocalizedMessage( 1019039 ); // You are no longer considered a young player of Ultima Online, and are no longer subject to the limitations and benefits of being in that caste. - } - } - } - } - - public void CheckYoung() - { - if ( TotalGameTime >= YoungDuration ) - RemoveYoungStatus( 1019038 ); // You are old enough to be considered an adult, and have outgrown your status as a young player! - } - - private class YoungTimer : Timer - { - private Account m_Account; - - public YoungTimer( Account account ) - : base( TimeSpan.FromMinutes( 1.0 ), TimeSpan.FromMinutes( 1.0 ) ) - { - m_Account = account; - - Priority = TimerPriority.FiveSeconds; - } - - protected override void OnTick() - { - m_Account.CheckYoung(); - } - } - - public Account( string username, string password ) - { - Username = username; - - SetPassword( password ); - - m_AccessLevel = AccessLevel.Player; - - Created = LastLogin = DateTime.UtcNow; - m_TotalGameTime = TimeSpan.Zero; - - m_Mobiles = new Mobile[7]; - - IPRestrictions = new string[0]; - LoginIPs = new IPAddress[0]; - - Accounts.Add( this ); - } - - public Account( XmlElement node ) - { - Username = Utility.GetText( node["username"], "empty" ); - - string plainPassword = Utility.GetText( node["password"], null ); - string cryptPassword = Utility.GetText( node["cryptPassword"], null ); - string newCryptPassword = Utility.GetText( node["newCryptPassword"], null ); - - switch ( AccountHandler.ProtectPasswords ) - { - case PasswordProtection.None: - { - if ( plainPassword != null ) - SetPassword( plainPassword ); - else if ( newCryptPassword != null ) - NewCryptPassword = newCryptPassword; - else if ( cryptPassword != null ) - CryptPassword = cryptPassword; - else - SetPassword( "empty" ); - - break; - } - case PasswordProtection.Crypt: - { - if ( cryptPassword != null ) - CryptPassword = cryptPassword; - else if ( plainPassword != null ) - SetPassword( plainPassword ); - else if ( newCryptPassword != null ) - NewCryptPassword = newCryptPassword; - else - SetPassword( "empty" ); - - break; - } - default: // PasswordProtection.NewCrypt - { - if ( newCryptPassword != null ) - NewCryptPassword = newCryptPassword; - else if ( plainPassword != null ) - SetPassword( plainPassword ); - else if ( cryptPassword != null ) - CryptPassword = cryptPassword; - else - SetPassword( "empty" ); - - break; - } - } - - Enum.TryParse( Utility.GetText( node["accessLevel"], "Player" ), true, out m_AccessLevel ); - Flags = Utility.GetXMLInt32( Utility.GetText( node["flags"], "0" ), 0 ); - Created = Utility.GetXMLDateTime( Utility.GetText( node["created"], null ), DateTime.UtcNow ); - LastLogin = Utility.GetXMLDateTime( Utility.GetText( node["lastLogin"], null ), DateTime.UtcNow ); - - TotalGold = Utility.GetXMLInt32( Utility.GetText(node["totalGold"], "0" ), 0 ); - TotalPlat = Utility.GetXMLInt32(Utility.GetText(node["totalPlat"], "0"), 0); - - m_Mobiles = LoadMobiles( node ); - m_Comments = LoadComments( node ); - m_Tags = LoadTags( node ); - LoginIPs = LoadAddressList( node ); - IPRestrictions = LoadAccessCheck( node ); - - for ( int i = 0; i < m_Mobiles.Length; ++i ) - { - if ( m_Mobiles[i] != null ) - m_Mobiles[i].Account = this; - } - - TimeSpan totalGameTime = Utility.GetXMLTimeSpan( Utility.GetText( node["totalGameTime"], null ), TimeSpan.Zero ); - if ( totalGameTime == TimeSpan.Zero ) - { - for ( int i = 0; i < m_Mobiles.Length; i++ ) - { - if ( m_Mobiles[i] is PlayerMobile m ) - totalGameTime += m.GameTime; - } - } - m_TotalGameTime = totalGameTime; - - if ( Young ) - CheckYoung(); - - Accounts.Add( this ); - } - - /// - /// Deserializes a list of string values from an xml element. Null values are not added to the list. - /// - /// The XmlElement from which to deserialize. - /// String list. Value will never be null. - public static string[] LoadAccessCheck( XmlElement node ) - { - string[] stringList; - XmlElement accessCheck = node["accessCheck"]; - - if ( accessCheck != null ) - { - List list = new List(); - - foreach ( XmlElement ip in accessCheck.GetElementsByTagName( "ip" ) ) - { - string text = Utility.GetText( ip, null ); - - if ( text != null ) - list.Add( text ); - } - - stringList = list.ToArray(); - } - else - { - stringList = new string[0]; - } - - return stringList; - } - - /// - /// Deserializes a list of IPAddress values from an xml element. - /// - /// The XmlElement from which to deserialize. - /// Address list. Value will never be null. - public static IPAddress[] LoadAddressList( XmlElement node ) - { - IPAddress[] list; - XmlElement addressList = node["addressList"]; - - if ( addressList != null ) - { - int count = Utility.GetXMLInt32( Utility.GetAttribute( addressList, "count", "0" ), 0 ); - - list = new IPAddress[count]; - - count = 0; - - foreach ( XmlElement ip in addressList.GetElementsByTagName( "ip" ) ) - { - if ( count < list.Length ) - { + } + } + + /// + /// The date and time of when this account was created. + /// + public DateTime Created { get; } + + /// + /// Gets or sets the date and time when this account was last accessed. + /// + public DateTime LastLogin { get; set; } + + /// + /// An account is considered inactive based upon LastLogin and InactiveDuration. If the account is empty, it is based upon EmptyInactiveDuration + /// + public bool Inactive + { + get + { + if ( AccessLevel != AccessLevel.Player ) + return false; + + TimeSpan inactiveLength = DateTime.UtcNow - LastLogin; + + return (inactiveLength > ((Count == 0) ? EmptyInactiveDuration : InactiveDuration)); + } + } + + /// + /// Gets the total game time of this account, also considering the game time of characters + /// that have been deleted. + /// + public TimeSpan TotalGameTime + { + get + { + for ( int i = 0; i < m_Mobiles.Length; i++ ) + { + if ( m_Mobiles[i] is PlayerMobile m && m.NetState != null ) + return m_TotalGameTime + ( DateTime.UtcNow - m.SessionStart ); + } + + return m_TotalGameTime; + } + } + + /// + /// Gets the value of a specific flag in the Flags bitfield. + /// + /// The zero-based flag index. + public bool GetFlag( int index ) => ( Flags & ( 1 << index ) ) != 0; + + /// + /// Sets the value of a specific flag in the Flags bitfield. + /// + /// The zero-based flag index. + /// The value to set. + public void SetFlag( int index, bool value ) + { + if ( value ) + Flags |= ( 1 << index ); + else + Flags &= ~( 1 << index ); + } + + /// + /// Adds a new tag to this account. This method does not check for duplicate names. + /// + /// New tag name. + /// New tag value. + public void AddTag( string name, string value ) + { + Tags.Add( new AccountTag( name, value ) ); + } + + /// + /// Removes all tags with the specified name from this account. + /// + /// Tag name to remove. + public void RemoveTag( string name ) + { + for ( int i = Tags.Count - 1; i >= 0; --i ) + { + if ( i >= Tags.Count ) + continue; + + AccountTag tag = Tags[i]; + + if ( tag.Name == name ) + Tags.RemoveAt( i ); + } + } + + /// + /// Modifies an existing tag or adds a new tag if no tag exists. + /// + /// Tag name. + /// Tag value. + public void SetTag( string name, string value ) + { + for ( int i = 0; i < Tags.Count; ++i ) + { + AccountTag tag = Tags[i]; + + if ( tag.Name == name ) + { + tag.Value = value; + return; + } + } + + AddTag( name, value ); + } + + /// + /// Gets the value of a tag -or- null if there are no tags with the specified name. + /// + /// Name of the desired tag value. + public string GetTag( string name ) + { + for ( int i = 0; i < Tags.Count; ++i ) + { + AccountTag tag = Tags[i]; + + if ( tag.Name == name ) + return tag.Value; + } + + return null; + } + + public void SetUnspecifiedBan( Mobile from ) + { + SetBanTags( from, DateTime.MinValue, TimeSpan.Zero ); + } + + public void SetBanTags( Mobile from, DateTime banTime, TimeSpan banDuration ) + { + if ( from == null ) + RemoveTag( "BanDealer" ); + else + SetTag( "BanDealer", from.ToString() ); + + if ( banTime == DateTime.MinValue ) + RemoveTag( "BanTime" ); + else + SetTag( "BanTime", XmlConvert.ToString( banTime, XmlDateTimeSerializationMode.Utc ) ); + + if ( banDuration == TimeSpan.Zero ) + RemoveTag( "BanDuration" ); + else + SetTag( "BanDuration", banDuration.ToString() ); + } + + public bool GetBanTags( out DateTime banTime, out TimeSpan banDuration ) + { + string tagTime = GetTag( "BanTime" ); + string tagDuration = GetTag( "BanDuration" ); + + if ( tagTime != null ) + banTime = Utility.GetXMLDateTime( tagTime, DateTime.MinValue ); + else + banTime = DateTime.MinValue; + + if ( tagDuration == "Infinite" ) + { + banDuration = TimeSpan.MaxValue; + } + else if ( tagDuration != null ) + { + banDuration = Utility.ToTimeSpan( tagDuration ); + } + else + { + banDuration = TimeSpan.Zero; + } + + return ( banTime != DateTime.MinValue && banDuration != TimeSpan.Zero ); + } + + private static MD5CryptoServiceProvider m_MD5HashProvider; + private static SHA1CryptoServiceProvider m_SHA1HashProvider; + private static byte[] m_HashBuffer; + + public static string HashMD5( string phrase ) + { + if ( m_MD5HashProvider == null ) + m_MD5HashProvider = new MD5CryptoServiceProvider(); + + if ( m_HashBuffer == null ) + m_HashBuffer = new byte[256]; + + int length = Encoding.ASCII.GetBytes( phrase, 0, phrase.Length > 256 ? 256 : phrase.Length, m_HashBuffer, 0 ); + byte[] hashed = m_MD5HashProvider.ComputeHash( m_HashBuffer, 0, length ); + + return BitConverter.ToString( hashed ); + } + + public static string HashSHA1( string phrase ) + { + if ( m_SHA1HashProvider == null ) + m_SHA1HashProvider = new SHA1CryptoServiceProvider(); + + if ( m_HashBuffer == null ) + m_HashBuffer = new byte[256]; + + int length = Encoding.ASCII.GetBytes( phrase, 0, phrase.Length > 256 ? 256 : phrase.Length, m_HashBuffer, 0 ); + byte[] hashed = m_SHA1HashProvider.ComputeHash( m_HashBuffer, 0, length ); + + return BitConverter.ToString( hashed ); + } + + public void SetPassword( string plainPassword ) + { + switch ( AccountHandler.ProtectPasswords ) + { + case PasswordProtection.None: + { + PlainPassword = plainPassword; + CryptPassword = null; + NewCryptPassword = null; + + break; + } + case PasswordProtection.Crypt: + { + PlainPassword = null; + CryptPassword = HashMD5( plainPassword ); + NewCryptPassword = null; + + break; + } + default: // PasswordProtection.NewCrypt + { + PlainPassword = null; + CryptPassword = null; + NewCryptPassword = HashSHA1( Username + plainPassword ); + + break; + } + } + } + + public bool CheckPassword( string plainPassword ) + { + bool ok; + PasswordProtection curProt; + + if ( PlainPassword != null ) + { + ok = ( PlainPassword == plainPassword ); + curProt = PasswordProtection.None; + } + else if ( CryptPassword != null ) + { + ok = ( CryptPassword == HashMD5( plainPassword ) ); + curProt = PasswordProtection.Crypt; + } + else + { + ok = ( NewCryptPassword == HashSHA1( Username + plainPassword ) ); + curProt = PasswordProtection.NewCrypt; + } + + if ( ok && curProt != AccountHandler.ProtectPasswords ) + SetPassword( plainPassword ); + + return ok; + } + + private Timer m_YoungTimer; + + public static void Initialize() + { + EventSink.Connected += EventSink_Connected; + EventSink.Disconnected += EventSink_Disconnected; + EventSink.Login += EventSink_Login; + } + + private static void EventSink_Connected( ConnectedEventArgs e ) + { + if ( !(e.Mobile.Account is Account acc) ) + return; + + if ( acc.Young && acc.m_YoungTimer == null ) + { + acc.m_YoungTimer = new YoungTimer( acc ); + acc.m_YoungTimer.Start(); + } + } + + private static void EventSink_Disconnected( DisconnectedEventArgs e ) + { + if ( !(e.Mobile.Account is Account acc) ) + return; + + if ( acc.m_YoungTimer != null ) + { + acc.m_YoungTimer.Stop(); + acc.m_YoungTimer = null; + } + + if ( !(e.Mobile is PlayerMobile m) ) + return; + + acc.m_TotalGameTime += DateTime.UtcNow - m.SessionStart; + } + + private static void EventSink_Login( LoginEventArgs e ) + { + if ( !(e.Mobile is PlayerMobile m) ) + return; + + if ( !(m.Account is Account acc) ) + return; + + if ( m.Young && acc.Young ) + { + TimeSpan ts = YoungDuration - acc.TotalGameTime; + int hours = Math.Max( (int) ts.TotalHours, 0 ); + + m.SendAsciiMessage( "You will enjoy the benefits and relatively safe status of a young player for {0} more hour{1}.", hours, hours != 1 ? "s" : "" ); + } + } + + public void RemoveYoungStatus( int message ) + { + Young = false; + + for ( int i = 0; i < m_Mobiles.Length; i++ ) + { + if ( m_Mobiles[i] is PlayerMobile m && m.Young ) + { + m.Young = false; + + if ( m.NetState != null ) + { + if ( message > 0 ) + m.SendLocalizedMessage( message ); + + m.SendLocalizedMessage( 1019039 ); // You are no longer considered a young player of Ultima Online, and are no longer subject to the limitations and benefits of being in that caste. + } + } + } + } + + public void CheckYoung() + { + if ( TotalGameTime >= YoungDuration ) + RemoveYoungStatus( 1019038 ); // You are old enough to be considered an adult, and have outgrown your status as a young player! + } + + private class YoungTimer : Timer + { + private Account m_Account; + + public YoungTimer( Account account ) + : base( TimeSpan.FromMinutes( 1.0 ), TimeSpan.FromMinutes( 1.0 ) ) + { + m_Account = account; + + Priority = TimerPriority.FiveSeconds; + } + + protected override void OnTick() + { + m_Account.CheckYoung(); + } + } + + public Account( string username, string password ) + { + Username = username; + + SetPassword( password ); + + m_AccessLevel = AccessLevel.Player; + + Created = LastLogin = DateTime.UtcNow; + m_TotalGameTime = TimeSpan.Zero; + + m_Mobiles = new Mobile[7]; + + IPRestrictions = new string[0]; + LoginIPs = new IPAddress[0]; + + Accounts.Add( this ); + } + + public Account( XmlElement node ) + { + Username = Utility.GetText( node["username"], "empty" ); + + string plainPassword = Utility.GetText( node["password"], null ); + string cryptPassword = Utility.GetText( node["cryptPassword"], null ); + string newCryptPassword = Utility.GetText( node["newCryptPassword"], null ); + + switch ( AccountHandler.ProtectPasswords ) + { + case PasswordProtection.None: + { + if ( plainPassword != null ) + SetPassword( plainPassword ); + else if ( newCryptPassword != null ) + NewCryptPassword = newCryptPassword; + else if ( cryptPassword != null ) + CryptPassword = cryptPassword; + else + SetPassword( "empty" ); + + break; + } + case PasswordProtection.Crypt: + { + if ( cryptPassword != null ) + CryptPassword = cryptPassword; + else if ( plainPassword != null ) + SetPassword( plainPassword ); + else if ( newCryptPassword != null ) + NewCryptPassword = newCryptPassword; + else + SetPassword( "empty" ); + + break; + } + default: // PasswordProtection.NewCrypt + { + if ( newCryptPassword != null ) + NewCryptPassword = newCryptPassword; + else if ( plainPassword != null ) + SetPassword( plainPassword ); + else if ( cryptPassword != null ) + CryptPassword = cryptPassword; + else + SetPassword( "empty" ); + + break; + } + } + + Enum.TryParse( Utility.GetText( node["accessLevel"], "Player" ), true, out m_AccessLevel ); + Flags = Utility.GetXMLInt32( Utility.GetText( node["flags"], "0" ), 0 ); + Created = Utility.GetXMLDateTime( Utility.GetText( node["created"], null ), DateTime.UtcNow ); + LastLogin = Utility.GetXMLDateTime( Utility.GetText( node["lastLogin"], null ), DateTime.UtcNow ); + + TotalGold = Utility.GetXMLInt32( Utility.GetText(node["totalGold"], "0" ), 0 ); + TotalPlat = Utility.GetXMLInt32(Utility.GetText(node["totalPlat"], "0"), 0); + + m_Mobiles = LoadMobiles( node ); + m_Comments = LoadComments( node ); + m_Tags = LoadTags( node ); + LoginIPs = LoadAddressList( node ); + IPRestrictions = LoadAccessCheck( node ); + + for ( int i = 0; i < m_Mobiles.Length; ++i ) + { + if ( m_Mobiles[i] != null ) + m_Mobiles[i].Account = this; + } + + TimeSpan totalGameTime = Utility.GetXMLTimeSpan( Utility.GetText( node["totalGameTime"], null ), TimeSpan.Zero ); + if ( totalGameTime == TimeSpan.Zero ) + { + for ( int i = 0; i < m_Mobiles.Length; i++ ) + { + if ( m_Mobiles[i] is PlayerMobile m ) + totalGameTime += m.GameTime; + } + } + m_TotalGameTime = totalGameTime; + + if ( Young ) + CheckYoung(); + + Accounts.Add( this ); + } + + /// + /// Deserializes a list of string values from an xml element. Null values are not added to the list. + /// + /// The XmlElement from which to deserialize. + /// String list. Value will never be null. + public static string[] LoadAccessCheck( XmlElement node ) + { + string[] stringList; + XmlElement accessCheck = node["accessCheck"]; + + if ( accessCheck != null ) + { + List list = new List(); + + foreach ( XmlElement ip in accessCheck.GetElementsByTagName( "ip" ) ) + { + string text = Utility.GetText( ip, null ); + + if ( text != null ) + list.Add( text ); + } + + stringList = list.ToArray(); + } + else + { + stringList = new string[0]; + } + + return stringList; + } + + /// + /// Deserializes a list of IPAddress values from an xml element. + /// + /// The XmlElement from which to deserialize. + /// Address list. Value will never be null. + public static IPAddress[] LoadAddressList( XmlElement node ) + { + IPAddress[] list; + XmlElement addressList = node["addressList"]; + + if ( addressList != null ) + { + int count = Utility.GetXMLInt32( Utility.GetAttribute( addressList, "count", "0" ), 0 ); + + list = new IPAddress[count]; + + count = 0; + + foreach ( XmlElement ip in addressList.GetElementsByTagName( "ip" ) ) + { + if ( count < list.Length ) + { if ( IPAddress.TryParse( Utility.GetText( ip, null ), out IPAddress address ) ) - { - list[count] = Utility.Intern( address ); - count++; - } - } - } + { + list[count] = Utility.Intern( address ); + count++; + } + } + } - if ( count != list.Length ) - { - IPAddress[] old = list; - list = new IPAddress[count]; + if ( count != list.Length ) + { + IPAddress[] old = list; + list = new IPAddress[count]; - for ( int i = 0; i < count && i < old.Length; ++i ) - list[i] = old[i]; - } - } - else - { - list = new IPAddress[0]; - } + for ( int i = 0; i < count && i < old.Length; ++i ) + list[i] = old[i]; + } + } + else + { + list = new IPAddress[0]; + } - return list; - } + return list; + } - /// - /// Deserializes a list of Mobile instances from an xml element. - /// - /// The XmlElement instance from which to deserialize. - /// Mobile list. Value will never be null. - public static Mobile[] LoadMobiles( XmlElement node ) - { - Mobile[] list = new Mobile[7]; - XmlElement chars = node["chars"]; + /// + /// Deserializes a list of Mobile instances from an xml element. + /// + /// The XmlElement instance from which to deserialize. + /// Mobile list. Value will never be null. + public static Mobile[] LoadMobiles( XmlElement node ) + { + Mobile[] list = new Mobile[7]; + XmlElement chars = node["chars"]; - //int length = Accounts.GetInt32( Accounts.GetAttribute( chars, "length", "6" ), 6 ); - //list = new Mobile[length]; - //Above is legacy, no longer used + //int length = Accounts.GetInt32( Accounts.GetAttribute( chars, "length", "6" ), 6 ); + //list = new Mobile[length]; + //Above is legacy, no longer used - if ( chars != null ) - { - foreach ( XmlElement ele in chars.GetElementsByTagName( "char" ) ) - { - try - { - int index = Utility.GetXMLInt32( Utility.GetAttribute( ele, "index", "0" ), 0 ); - uint serial = Utility.GetXMLUInt32( Utility.GetText( ele, "0" ), 0 ); + if ( chars != null ) + { + foreach ( XmlElement ele in chars.GetElementsByTagName( "char" ) ) + { + try + { + int index = Utility.GetXMLInt32( Utility.GetAttribute( ele, "index", "0" ), 0 ); + uint serial = Utility.GetXMLUInt32( Utility.GetText( ele, "0" ), 0 ); - if ( index >= 0 && index < list.Length ) - list[index] = World.FindMobile( serial ); - } - catch - { - // ignored - } - } - } + if ( index >= 0 && index < list.Length ) + list[index] = World.FindMobile( serial ); + } + catch + { + // ignored + } + } + } - return list; - } + return list; + } - /// - /// Deserializes a list of AccountComment instances from an xml element. - /// - /// The XmlElement from which to deserialize. - /// Comment list. Value will never be null. - public static List LoadComments( XmlElement node ) - { - List list = null; - XmlElement comments = node["comments"]; + /// + /// Deserializes a list of AccountComment instances from an xml element. + /// + /// The XmlElement from which to deserialize. + /// Comment list. Value will never be null. + public static List LoadComments( XmlElement node ) + { + List list = null; + XmlElement comments = node["comments"]; - if ( comments != null ) - { - list = new List(); + if ( comments != null ) + { + list = new List(); - foreach ( XmlElement comment in comments.GetElementsByTagName( "comment" ) ) - { - try { list.Add( new AccountComment( comment ) ); } - catch - { - // ignored - } - } - } + foreach ( XmlElement comment in comments.GetElementsByTagName( "comment" ) ) + { + try { list.Add( new AccountComment( comment ) ); } + catch + { + // ignored + } + } + } - return list; - } + return list; + } - /// - /// Deserializes a list of AccountTag instances from an xml element. - /// - /// The XmlElement from which to deserialize. - /// Tag list. Value will never be null. - public static List LoadTags( XmlElement node ) - { - List list = null; - XmlElement tags = node["tags"]; + /// + /// Deserializes a list of AccountTag instances from an xml element. + /// + /// The XmlElement from which to deserialize. + /// Tag list. Value will never be null. + public static List LoadTags( XmlElement node ) + { + List list = null; + XmlElement tags = node["tags"]; - if ( tags != null ) - { - list = new List(); + if ( tags != null ) + { + list = new List(); - foreach ( XmlElement tag in tags.GetElementsByTagName( "tag" ) ) - { - try { list.Add( new AccountTag( tag ) ); } - catch - { - // ignored - } - } - } + foreach ( XmlElement tag in tags.GetElementsByTagName( "tag" ) ) + { + try { list.Add( new AccountTag( tag ) ); } + catch + { + // ignored + } + } + } - return list; - } + return list; + } /// /// Checks if a specific NetState is allowed access to this account. @@ -816,407 +813,393 @@ namespace Server.Accounting public bool HasAccess( IPAddress ipAddress ) { - AccessLevel level = AccountHandler.LockdownLevel; + AccessLevel level = AccountHandler.LockdownLevel; - if ( level > AccessLevel.Player ) - { - bool hasAccess = false; + if ( level > AccessLevel.Player ) + { + bool hasAccess = false; - if ( m_AccessLevel >= level ) - hasAccess = true; - else - { - for ( int i = 0; !hasAccess && i < Length; ++i ) - { - Mobile m = this[i]; + if ( m_AccessLevel >= level ) + hasAccess = true; + else + { + for ( int i = 0; !hasAccess && i < Length; ++i ) + { + Mobile m = this[i]; - if ( m?.AccessLevel >= level ) - hasAccess = true; - } - } + if ( m?.AccessLevel >= level ) + hasAccess = true; + } + } Console.WriteLine("{0} {1}", hasAccess ? "yes" : "no", m_AccessLevel); if ( !hasAccess ) - return false; - } + return false; + } - bool accessAllowed = IPRestrictions.Length == 0 || IPLimiter.IsExempt( ipAddress ); + bool accessAllowed = IPRestrictions.Length == 0 || IPLimiter.IsExempt( ipAddress ); - for ( int i = 0; !accessAllowed && i < IPRestrictions.Length; ++i ) - accessAllowed = Utility.IPMatch( IPRestrictions[i], ipAddress ); + for ( int i = 0; !accessAllowed && i < IPRestrictions.Length; ++i ) + accessAllowed = Utility.IPMatch( IPRestrictions[i], ipAddress ); - return accessAllowed; - } - - /// - /// Records the IP address of 'ns' in its 'LoginIPs' list. - /// - /// NetState instance to record. - public void LogAccess( NetState ns ) - { - if ( ns != null ) { - LogAccess( ns.Address ); - } - } - - public void LogAccess( IPAddress ipAddress ) { - if ( IPLimiter.IsExempt( ipAddress ) ) - return; - - if ( LoginIPs.Length == 0 ) { - if ( AccountHandler.IPTable.ContainsKey( ipAddress ) ) - AccountHandler.IPTable[ipAddress]++; - else - AccountHandler.IPTable[ipAddress] = 1; - } - - bool contains = false; - - for ( int i = 0; !contains && i < LoginIPs.Length; ++i ) - contains = LoginIPs[i].Equals( ipAddress ); - - if ( contains ) - return; - - IPAddress[] old = LoginIPs; - LoginIPs = new IPAddress[old.Length + 1]; - - for ( int i = 0; i < old.Length; ++i ) - LoginIPs[i] = old[i]; - - LoginIPs[old.Length] = ipAddress; - } - - /// - /// Checks if a specific NetState is allowed access to this account. If true, the NetState IPAddress is added to the address list. - /// - /// NetState instance to check. - /// True if allowed, false if not. - public bool CheckAccess( NetState ns ) - { - return ( ns != null && CheckAccess( ns.Address ) ); - } - - public bool CheckAccess( IPAddress ipAddress ) { - bool hasAccess = HasAccess( ipAddress ); - - if ( hasAccess ) - LogAccess( ipAddress ); - - return hasAccess; - } - - /// - /// Serializes this Account instance to an XmlTextWriter. - /// - /// The XmlTextWriter instance from which to serialize. - public void Save( XmlTextWriter xml ) - { - xml.WriteStartElement( "account" ); - - xml.WriteStartElement( "username" ); - xml.WriteString( Username ); - xml.WriteEndElement(); - - if ( PlainPassword != null ) - { - xml.WriteStartElement( "password" ); - xml.WriteString( PlainPassword ); - xml.WriteEndElement(); - } - - if ( CryptPassword != null ) - { - xml.WriteStartElement( "cryptPassword" ); - xml.WriteString( CryptPassword ); - xml.WriteEndElement(); - } - - if ( NewCryptPassword != null ) - { - xml.WriteStartElement( "newCryptPassword" ); - xml.WriteString( NewCryptPassword ); - xml.WriteEndElement(); - } - - if ( m_AccessLevel != AccessLevel.Player ) - { - xml.WriteStartElement( "accessLevel" ); - xml.WriteString( m_AccessLevel.ToString() ); - xml.WriteEndElement(); - } - - if ( Flags != 0 ) - { - xml.WriteStartElement( "flags" ); - xml.WriteString( XmlConvert.ToString( Flags ) ); - xml.WriteEndElement(); - } - - xml.WriteStartElement( "created" ); - xml.WriteString( XmlConvert.ToString( Created, XmlDateTimeSerializationMode.Utc ) ); - xml.WriteEndElement(); - - xml.WriteStartElement( "lastLogin" ); - xml.WriteString( XmlConvert.ToString( LastLogin, XmlDateTimeSerializationMode.Utc ) ); - xml.WriteEndElement(); - - xml.WriteStartElement( "totalGameTime" ); - xml.WriteString( XmlConvert.ToString( TotalGameTime ) ); - xml.WriteEndElement(); - - xml.WriteStartElement( "chars" ); - - //xml.WriteAttributeString( "length", m_Mobiles.Length.ToString() ); //Legacy, Not used anymore - - for ( int i = 0; i < m_Mobiles.Length; ++i ) - { - Mobile m = m_Mobiles[i]; - - if (m?.Deleted == false) - { - xml.WriteStartElement( "char" ); - xml.WriteAttributeString( "index", i.ToString() ); - xml.WriteString( m.Serial.Value.ToString() ); - xml.WriteEndElement(); - } - } - - xml.WriteEndElement(); - - if (m_Comments?.Count > 0) - { - xml.WriteStartElement( "comments" ); - - for ( int i = 0; i < m_Comments.Count; ++i ) - m_Comments[i].Save( xml ); - - xml.WriteEndElement(); - } - - if (m_Tags?.Count > 0) - { - xml.WriteStartElement( "tags" ); - - for ( int i = 0; i < m_Tags.Count; ++i ) - m_Tags[i].Save( xml ); - - xml.WriteEndElement(); - } - - if ( LoginIPs.Length > 0 ) - { - xml.WriteStartElement( "addressList" ); - - xml.WriteAttributeString( "count", LoginIPs.Length.ToString() ); - - for ( int i = 0; i < LoginIPs.Length; ++i ) - { - xml.WriteStartElement( "ip" ); - xml.WriteString( LoginIPs[i].ToString() ); - xml.WriteEndElement(); - } - - xml.WriteEndElement(); - } - - if ( IPRestrictions.Length > 0 ) - { - xml.WriteStartElement( "accessCheck" ); - - for ( int i = 0; i < IPRestrictions.Length; ++i ) - { - xml.WriteStartElement( "ip" ); - xml.WriteString( IPRestrictions[i] ); - xml.WriteEndElement(); - } - - xml.WriteEndElement(); - } - - xml.WriteStartElement("totalGold"); - xml.WriteString(XmlConvert.ToString(TotalGold)); - xml.WriteEndElement(); - - xml.WriteStartElement("totalPlat"); - xml.WriteString(XmlConvert.ToString(TotalPlat)); - xml.WriteEndElement(); - - xml.WriteEndElement(); - } - - /// - /// Gets the current number of characters on this account. - /// - public int Count - { - get - { - int count = 0; - - for ( int i = 0; i < Length; ++i ) - { - if ( this[i] != null ) - ++count; - } - - return count; - } - } - - /// - /// Gets the maximum amount of characters allowed to be created on this account. Values other than 1, 5, 6, or 7 are not supported by the client. - /// - public int Limit => ( Core.SA ? 7 : Core.AOS ? 6 : 5 ); - - /// - /// Gets the maximum amount of characters that this account can hold. - /// - public int Length => m_Mobiles.Length; - - /// - /// Gets or sets the character at a specified index for this account. Out of bound index values are handled; null returned for get, ignored for set. - /// - public Mobile this[int index] - { - get - { - if ( index >= 0 && index < m_Mobiles.Length ) - { - Mobile m = m_Mobiles[index]; - - if (m?.Deleted == true) - { - m.Account = null; - m_Mobiles[index] = m = null; - } - - return m; - } - - return null; - } - set - { - if ( index >= 0 && index < m_Mobiles.Length ) - { - if ( m_Mobiles[index] != null ) - m_Mobiles[index].Account = null; - - m_Mobiles[index] = value; - - if ( m_Mobiles[index] != null ) - m_Mobiles[index].Account = this; - } - } - } - - public override string ToString() - { - return Username; - } - - public int CompareTo( Account other ) - { - return other == null ? 1 : Username.CompareTo( other.Username ); + return accessAllowed; } - public int CompareTo( IAccount other ) + /// + /// Records the IP address of 'ns' in its 'LoginIPs' list. + /// + /// NetState instance to record. + public void LogAccess( NetState ns ) { - return other == null ? 1 : Username.CompareTo( other.Username ); + if ( ns != null ) { + LogAccess( ns.Address ); + } } - #region Gold Account - /// - /// This amount represents the current amount of Gold owned by the player. - /// The value does not include the value of Platinum and ranges from - /// 0 to 999,999,999 by default. - /// - [CommandProperty(AccessLevel.Administrator)] - public int TotalGold { get; private set; } + public void LogAccess( IPAddress ipAddress ) { + if ( IPLimiter.IsExempt( ipAddress ) ) + return; - /// - /// This amount represents the current amount of Platinum owned by the player. - /// The value does not include the value of Gold and ranges from - /// 0 to 2,147,483,647 by default. - /// One Platinum represents the value of CurrencyThreshold in Gold. - /// - [CommandProperty(AccessLevel.Administrator)] - public int TotalPlat { get; private set; } + if ( LoginIPs.Length == 0 ) { + if ( AccountHandler.IPTable.ContainsKey( ipAddress ) ) + AccountHandler.IPTable[ipAddress]++; + else + AccountHandler.IPTable[ipAddress] = 1; + } - /// - /// Attempts to deposit the given amount of Gold into this account. - /// If the given amount is greater than the CurrencyThreshold, - /// Platinum will be deposited to offset the difference. - /// - /// Amount to deposit. - /// True if successful, false if amount given is less than or equal to zero. - public bool DepositGold(int amount) - { - if (amount <= 0) { return false; } + bool contains = false; - int plat = Math.DivRem(amount, AccountGold.CurrencyThreshold, out int gold); - TotalPlat += plat; - TotalGold += gold; + for ( int i = 0; !contains && i < LoginIPs.Length; ++i ) + contains = LoginIPs[i].Equals( ipAddress ); - return true; - } + if ( contains ) + return; - /// - /// Attempts to deposit the given amount of Platinum into this account. - /// - /// Amount to deposit. - /// True if successful, false if amount given is less than or equal to zero. - public bool DepositPlat(int amount) - { - if (amount <= 0) { return false; } + IPAddress[] old = LoginIPs; + LoginIPs = new IPAddress[old.Length + 1]; - TotalPlat += amount; - return true; - } + for ( int i = 0; i < old.Length; ++i ) + LoginIPs[i] = old[i]; - /// - /// Attempts to withdraw the given amount of Gold from this account. - /// If the given amount is greater than the CurrencyThreshold, - /// Platinum will be withdrawn to offset the difference. - /// - /// Amount to withdraw. - /// True if successful, false if balance was too low. - public bool WithdrawGold(int amount) - { - if (amount <= 0) { return true; } - if (amount > TotalGold) { return false; } + LoginIPs[old.Length] = ipAddress; + } - TotalGold -= amount; + /// + /// Checks if a specific NetState is allowed access to this account. If true, the NetState IPAddress is added to the address list. + /// + /// NetState instance to check. + /// True if allowed, false if not. + public bool CheckAccess( NetState ns ) => ( ns != null && CheckAccess( ns.Address ) ); - return true; - } + public bool CheckAccess( IPAddress ipAddress ) { + bool hasAccess = HasAccess( ipAddress ); - /// - /// Attempts to withdraw the given amount of Platinum from this account. - /// - /// Amount to withdraw. - /// True if successful, false if balance was too low. - public bool WithdrawPlat(int amount) - { - if (amount <= 0) { return true; } - if (amount > TotalPlat) { return false; } + if ( hasAccess ) + LogAccess( ipAddress ); - TotalPlat -= amount; + return hasAccess; + } - return true; - } + /// + /// Serializes this Account instance to an XmlTextWriter. + /// + /// The XmlTextWriter instance from which to serialize. + public void Save( XmlTextWriter xml ) + { + xml.WriteStartElement( "account" ); - /// - /// Returns total gold inclusive of platinum. - /// This is strictly for backwards compatibility - /// - /// Total gold, capped at Int32.MaxValue - public long GetTotalGold() - { - return TotalGold + TotalPlat * AccountGold.CurrencyThreshold; - } - #endregion - } + xml.WriteStartElement( "username" ); + xml.WriteString( Username ); + xml.WriteEndElement(); + + if ( PlainPassword != null ) + { + xml.WriteStartElement( "password" ); + xml.WriteString( PlainPassword ); + xml.WriteEndElement(); + } + + if ( CryptPassword != null ) + { + xml.WriteStartElement( "cryptPassword" ); + xml.WriteString( CryptPassword ); + xml.WriteEndElement(); + } + + if ( NewCryptPassword != null ) + { + xml.WriteStartElement( "newCryptPassword" ); + xml.WriteString( NewCryptPassword ); + xml.WriteEndElement(); + } + + if ( m_AccessLevel != AccessLevel.Player ) + { + xml.WriteStartElement( "accessLevel" ); + xml.WriteString( m_AccessLevel.ToString() ); + xml.WriteEndElement(); + } + + if ( Flags != 0 ) + { + xml.WriteStartElement( "flags" ); + xml.WriteString( XmlConvert.ToString( Flags ) ); + xml.WriteEndElement(); + } + + xml.WriteStartElement( "created" ); + xml.WriteString( XmlConvert.ToString( Created, XmlDateTimeSerializationMode.Utc ) ); + xml.WriteEndElement(); + + xml.WriteStartElement( "lastLogin" ); + xml.WriteString( XmlConvert.ToString( LastLogin, XmlDateTimeSerializationMode.Utc ) ); + xml.WriteEndElement(); + + xml.WriteStartElement( "totalGameTime" ); + xml.WriteString( XmlConvert.ToString( TotalGameTime ) ); + xml.WriteEndElement(); + + xml.WriteStartElement( "chars" ); + + //xml.WriteAttributeString( "length", m_Mobiles.Length.ToString() ); //Legacy, Not used anymore + + for ( int i = 0; i < m_Mobiles.Length; ++i ) + { + Mobile m = m_Mobiles[i]; + + if (m?.Deleted == false) + { + xml.WriteStartElement( "char" ); + xml.WriteAttributeString( "index", i.ToString() ); + xml.WriteString( m.Serial.Value.ToString() ); + xml.WriteEndElement(); + } + } + + xml.WriteEndElement(); + + if (m_Comments?.Count > 0) + { + xml.WriteStartElement( "comments" ); + + for ( int i = 0; i < m_Comments.Count; ++i ) + m_Comments[i].Save( xml ); + + xml.WriteEndElement(); + } + + if (m_Tags?.Count > 0) + { + xml.WriteStartElement( "tags" ); + + for ( int i = 0; i < m_Tags.Count; ++i ) + m_Tags[i].Save( xml ); + + xml.WriteEndElement(); + } + + if ( LoginIPs.Length > 0 ) + { + xml.WriteStartElement( "addressList" ); + + xml.WriteAttributeString( "count", LoginIPs.Length.ToString() ); + + for ( int i = 0; i < LoginIPs.Length; ++i ) + { + xml.WriteStartElement( "ip" ); + xml.WriteString( LoginIPs[i].ToString() ); + xml.WriteEndElement(); + } + + xml.WriteEndElement(); + } + + if ( IPRestrictions.Length > 0 ) + { + xml.WriteStartElement( "accessCheck" ); + + for ( int i = 0; i < IPRestrictions.Length; ++i ) + { + xml.WriteStartElement( "ip" ); + xml.WriteString( IPRestrictions[i] ); + xml.WriteEndElement(); + } + + xml.WriteEndElement(); + } + + xml.WriteStartElement("totalGold"); + xml.WriteString(XmlConvert.ToString(TotalGold)); + xml.WriteEndElement(); + + xml.WriteStartElement("totalPlat"); + xml.WriteString(XmlConvert.ToString(TotalPlat)); + xml.WriteEndElement(); + + xml.WriteEndElement(); + } + + /// + /// Gets the current number of characters on this account. + /// + public int Count + { + get + { + int count = 0; + + for ( int i = 0; i < Length; ++i ) + { + if ( this[i] != null ) + ++count; + } + + return count; + } + } + + /// + /// Gets the maximum amount of characters allowed to be created on this account. Values other than 1, 5, 6, or 7 are not supported by the client. + /// + public int Limit => ( Core.SA ? 7 : Core.AOS ? 6 : 5 ); + + /// + /// Gets the maximum amount of characters that this account can hold. + /// + public int Length => m_Mobiles.Length; + + /// + /// Gets or sets the character at a specified index for this account. Out of bound index values are handled; null returned for get, ignored for set. + /// + public Mobile this[int index] + { + get + { + if ( index >= 0 && index < m_Mobiles.Length ) + { + Mobile m = m_Mobiles[index]; + + if (m?.Deleted == true) + { + m.Account = null; + m_Mobiles[index] = m = null; + } + + return m; + } + + return null; + } + set + { + if ( index >= 0 && index < m_Mobiles.Length ) + { + if ( m_Mobiles[index] != null ) + m_Mobiles[index].Account = null; + + m_Mobiles[index] = value; + + if ( m_Mobiles[index] != null ) + m_Mobiles[index].Account = this; + } + } + } + + public override string ToString() => Username; + + public int CompareTo( Account other ) => other == null ? 1 : Username.CompareTo( other.Username ); + + public int CompareTo( IAccount other ) => other == null ? 1 : Username.CompareTo( other.Username ); + + #region Gold Account + /// + /// This amount represents the current amount of Gold owned by the player. + /// The value does not include the value of Platinum and ranges from + /// 0 to 999,999,999 by default. + /// + [CommandProperty(AccessLevel.Administrator)] + public int TotalGold { get; private set; } + + /// + /// This amount represents the current amount of Platinum owned by the player. + /// The value does not include the value of Gold and ranges from + /// 0 to 2,147,483,647 by default. + /// One Platinum represents the value of CurrencyThreshold in Gold. + /// + [CommandProperty(AccessLevel.Administrator)] + public int TotalPlat { get; private set; } + + /// + /// Attempts to deposit the given amount of Gold into this account. + /// If the given amount is greater than the CurrencyThreshold, + /// Platinum will be deposited to offset the difference. + /// + /// Amount to deposit. + /// True if successful, false if amount given is less than or equal to zero. + public bool DepositGold(int amount) + { + if (amount <= 0) { return false; } + + int plat = Math.DivRem(amount, AccountGold.CurrencyThreshold, out int gold); + TotalPlat += plat; + TotalGold += gold; + + return true; + } + + /// + /// Attempts to deposit the given amount of Platinum into this account. + /// + /// Amount to deposit. + /// True if successful, false if amount given is less than or equal to zero. + public bool DepositPlat(int amount) + { + if (amount <= 0) { return false; } + + TotalPlat += amount; + return true; + } + + /// + /// Attempts to withdraw the given amount of Gold from this account. + /// If the given amount is greater than the CurrencyThreshold, + /// Platinum will be withdrawn to offset the difference. + /// + /// Amount to withdraw. + /// True if successful, false if balance was too low. + public bool WithdrawGold(int amount) + { + if (amount <= 0) { return true; } + if (amount > TotalGold) { return false; } + + TotalGold -= amount; + + return true; + } + + /// + /// Attempts to withdraw the given amount of Platinum from this account. + /// + /// Amount to withdraw. + /// True if successful, false if balance was too low. + public bool WithdrawPlat(int amount) + { + if (amount <= 0) { return true; } + if (amount > TotalPlat) { return false; } + + TotalPlat -= amount; + + return true; + } + + /// + /// Returns total gold inclusive of platinum. + /// This is strictly for backwards compatibility + /// + /// Total gold, capped at Int32.MaxValue + public long GetTotalGold() => TotalGold + TotalPlat * AccountGold.CurrencyThreshold; + + #endregion + } } diff --git a/Projects/Scripts/Accounting/AccountAttackLimiter.cs b/Projects/Scripts/Accounting/AccountAttackLimiter.cs index 742fe0ad7..f302c22f3 100644 --- a/Projects/Scripts/Accounting/AccountAttackLimiter.cs +++ b/Projects/Scripts/Accounting/AccountAttackLimiter.cs @@ -70,15 +70,13 @@ namespace Server.Accounting if (accessLog.Counts >= 3) try { - using (StreamWriter op = new StreamWriter("throttle.log", true)) - { - op.WriteLine( - "{0}\t{1}\t{2}", - DateTime.UtcNow, - ns, - accessLog.Counts - ); - } + using StreamWriter op = new StreamWriter("throttle.log", true); + op.WriteLine( + "{0}\t{1}\t{2}", + DateTime.UtcNow, + ns, + accessLog.Counts + ); } catch { diff --git a/Projects/Scripts/Accounting/Accounts.cs b/Projects/Scripts/Accounting/Accounts.cs index 8acf522a9..8bf7e5446 100644 --- a/Projects/Scripts/Accounting/Accounts.cs +++ b/Projects/Scripts/Accounting/Accounts.cs @@ -21,10 +21,7 @@ namespace Server.Accounting EventSink.WorldSave += Save; } - public static ICollection GetAccounts() - { - return m_Accounts.Values; - } + public static ICollection GetAccounts() => m_Accounts.Values; public static IAccount GetAccount(string username) { @@ -75,24 +72,22 @@ namespace Server.Accounting string filePath = Path.Combine("Saves/Accounts", "accounts.xml"); - using (StreamWriter op = new StreamWriter(filePath)) - { - XmlTextWriter xml = new XmlTextWriter(op) { Formatting = Formatting.Indented, IndentChar = '\t', Indentation = 1 }; + using StreamWriter op = new StreamWriter(filePath); + XmlTextWriter xml = new XmlTextWriter(op) { Formatting = Formatting.Indented, IndentChar = '\t', Indentation = 1 }; - xml.WriteStartDocument(true); + xml.WriteStartDocument(true); - xml.WriteStartElement("accounts"); + xml.WriteStartElement("accounts"); - xml.WriteAttributeString("count", m_Accounts.Count.ToString()); + xml.WriteAttributeString("count", m_Accounts.Count.ToString()); - foreach (Account a in GetAccounts()) - a.Save(xml); + foreach (Account a in GetAccounts()) + a.Save(xml); - xml.WriteEndElement(); + xml.WriteEndElement(); - xml.Close(); - } + xml.Close(); } } } \ No newline at end of file diff --git a/Projects/Scripts/Accounting/Firewall.cs b/Projects/Scripts/Accounting/Firewall.cs index d07fc7e6f..4946ff9c6 100644 --- a/Projects/Scripts/Accounting/Firewall.cs +++ b/Projects/Scripts/Accounting/Firewall.cs @@ -13,20 +13,20 @@ namespace Server string path = "firewall.cfg"; if (File.Exists(path)) - using (StreamReader ip = new StreamReader(path)) + { + using StreamReader ip = new StreamReader(path); + string line; + + while ((line = ip.ReadLine()) != null) { - string line; + line = line.Trim(); - while ((line = ip.ReadLine()) != null) - { - line = line.Trim(); + if (line.Length == 0) + continue; - if (line.Length == 0) - continue; + List.Add(ToFirewallEntry(line)); - List.Add(ToFirewallEntry(line)); - - /* + /* object toAdd; IPAddress addr; @@ -37,8 +37,8 @@ namespace Server m_Blocked.Add( toAdd.ToString() ); * */ - } } + } } public static List List{ get; } @@ -130,11 +130,9 @@ namespace Server { string path = "firewall.cfg"; - using (StreamWriter op = new StreamWriter(path)) - { - for (int i = 0; i < List.Count; ++i) - op.WriteLine(List[i]); - } + using StreamWriter op = new StreamWriter(path); + for (int i = 0; i < List.Count; ++i) + op.WriteLine(List[i]); } public static bool IsBlocked(IPAddress ip) @@ -177,20 +175,11 @@ namespace Server { private IPAddress m_Address; - public IPFirewallEntry(IPAddress address) - { - m_Address = address; - } + public IPFirewallEntry(IPAddress address) => m_Address = address; - public bool IsBlocked(IPAddress address) - { - return m_Address.Equals(address); - } + public bool IsBlocked(IPAddress address) => m_Address.Equals(address); - public override string ToString() - { - return m_Address.ToString(); - } + public override string ToString() => m_Address.ToString(); public override bool Equals(object obj) { @@ -209,10 +198,7 @@ namespace Server return false; } - public override int GetHashCode() - { - return m_Address.GetHashCode(); - } + public override int GetHashCode() => m_Address.GetHashCode(); } public class CIDRFirewallEntry : IFirewallEntry @@ -226,15 +212,9 @@ namespace Server m_CIDRLength = cidrLength; } - public bool IsBlocked(IPAddress address) - { - return Utility.IPMatchCIDR(m_CIDRPrefix, address, m_CIDRLength); - } + public bool IsBlocked(IPAddress address) => Utility.IPMatchCIDR(m_CIDRPrefix, address, m_CIDRLength); - public override string ToString() - { - return $"{m_CIDRPrefix}/{m_CIDRLength}"; - } + public override string ToString() => $"{m_CIDRPrefix}/{m_CIDRLength}"; public override bool Equals(object obj) { @@ -255,10 +235,7 @@ namespace Server return false; } - public override int GetHashCode() - { - return m_CIDRPrefix.GetHashCode() ^ m_CIDRLength.GetHashCode(); - } + public override int GetHashCode() => m_CIDRPrefix.GetHashCode() ^ m_CIDRLength.GetHashCode(); } public class WildcardIPFirewallEntry : IFirewallEntry @@ -267,10 +244,7 @@ namespace Server private bool m_Valid; - public WildcardIPFirewallEntry(string entry) - { - m_Entry = entry; - } + public WildcardIPFirewallEntry(string entry) => m_Entry = entry; public bool IsBlocked(IPAddress address) { @@ -282,10 +256,7 @@ namespace Server return matched; } - public override string ToString() - { - return m_Entry; - } + public override string ToString() => m_Entry; public override bool Equals(object obj) { @@ -295,10 +266,7 @@ namespace Server return obj is WildcardIPFirewallEntry entry && m_Entry.Equals(entry.m_Entry); } - public override int GetHashCode() - { - return m_Entry.GetHashCode(); - } + public override int GetHashCode() => m_Entry.GetHashCode(); } #endregion diff --git a/Projects/Scripts/Commands/Add.cs b/Projects/Scripts/Commands/Add.cs index 4b9c110e5..60e144037 100644 --- a/Projects/Scripts/Commands/Add.cs +++ b/Projects/Scripts/Commands/Add.cs @@ -616,10 +616,7 @@ namespace Server.Commands InternalAvg_OnCommand(e, true); } - public static bool IsEntity(Type t) - { - return m_EntityType.IsAssignableFrom(t); - } + public static bool IsEntity(Type t) => m_EntityType.IsAssignableFrom(t); public static bool IsConstructible(ConstructorInfo ctor, AccessLevel accessLevel) { @@ -628,20 +625,11 @@ namespace Server.Commands return attrs.Length != 0 && accessLevel >= ((ConstructibleAttribute)attrs[0]).AccessLevel; } - public static bool IsEnum(Type type) - { - return type.IsSubclassOf(m_EnumType); - } + public static bool IsEnum(Type type) => type.IsSubclassOf(m_EnumType); - public static bool IsType(Type type) - { - return type == m_TypeType || type.IsSubclassOf(m_TypeType); - } + public static bool IsType(Type type) => type == m_TypeType || type.IsSubclassOf(m_TypeType); - public static bool IsParsable(Type type) - { - return type.IsDefined(m_ParsableType, false); - } + public static bool IsParsable(Type type) => type.IsDefined(m_ParsableType, false); public static object ParseParsable(Type type, string value) { diff --git a/Projects/Scripts/Commands/Attributes.cs b/Projects/Scripts/Commands/Attributes.cs index b51fd21f5..7a20c6832 100644 --- a/Projects/Scripts/Commands/Attributes.cs +++ b/Projects/Scripts/Commands/Attributes.cs @@ -4,30 +4,21 @@ namespace Server { public class UsageAttribute : Attribute { - public UsageAttribute(string usage) - { - Usage = usage; - } + public UsageAttribute(string usage) => Usage = usage; public string Usage{ get; } } public class DescriptionAttribute : Attribute { - public DescriptionAttribute(string description) - { - Description = description; - } + public DescriptionAttribute(string description) => Description = description; public string Description{ get; } } public class AliasesAttribute : Attribute { - public AliasesAttribute(params string[] aliases) - { - Aliases = aliases; - } + public AliasesAttribute(params string[] aliases) => Aliases = aliases; public string[] Aliases{ get; } } diff --git a/Projects/Scripts/Commands/Decorate.cs b/Projects/Scripts/Commands/Decorate.cs index 8ba35751a..5475fb6eb 100644 --- a/Projects/Scripts/Commands/Decorate.cs +++ b/Projects/Scripts/Commands/Decorate.cs @@ -985,16 +985,14 @@ namespace Server.Commands public static List ReadAll(string path) { - using (StreamReader ip = new StreamReader(path)) - { - List list = new List(); - DecorationList v; + using StreamReader ip = new StreamReader(path); + List list = new List(); + DecorationList v; - while ((v = Read(ip)) != null) - list.Add(v); + while ((v = Read(ip)) != null) + list.Add(v); - return list; - } + return list; } public static DecorationList Read(StreamReader ip) diff --git a/Projects/Scripts/Commands/DecorateMag.cs b/Projects/Scripts/Commands/DecorateMag.cs index cb99856fc..38997aaad 100644 --- a/Projects/Scripts/Commands/DecorateMag.cs +++ b/Projects/Scripts/Commands/DecorateMag.cs @@ -983,16 +983,14 @@ namespace Server.Commands public static List ReadAll(string path) { - using (StreamReader ip = new StreamReader(path)) - { - List list = new List(); + using StreamReader ip = new StreamReader(path); + List list = new List(); - DecorationListMag v; - while ((v = Read(ip)) != null) - list.Add(v); + DecorationListMag v; + while ((v = Read(ip)) != null) + list.Add(v); - return list; - } + return list; } public static DecorationListMag Read(StreamReader ip) diff --git a/Projects/Scripts/Commands/Docs.cs b/Projects/Scripts/Commands/Docs.cs index dc4a627d5..bd9bd0616 100644 --- a/Projects/Scripts/Commands/Docs.cs +++ b/Projects/Scripts/Commands/Docs.cs @@ -136,29 +136,27 @@ namespace Server.Commands private static void DocumentLoadedTypes() { - using (StreamWriter indexHtml = GetWriter("docs/", "overview.html")) + using StreamWriter indexHtml = GetWriter("docs/", "overview.html"); + indexHtml.WriteLine(""); + indexHtml.WriteLine(" "); + indexHtml.WriteLine(" RunUO Documentation - Class Overview"); + indexHtml.WriteLine(" "); + indexHtml.WriteLine( + " "); + indexHtml.WriteLine("

Back to the index

"); + indexHtml.WriteLine("

Namespaces

"); + + SortedList> nspaces = new SortedList>(m_Namespaces); + + foreach (KeyValuePair> kvp in nspaces) { - indexHtml.WriteLine(""); - indexHtml.WriteLine(" "); - indexHtml.WriteLine(" RunUO Documentation - Class Overview"); - indexHtml.WriteLine(" "); - indexHtml.WriteLine( - " "); - indexHtml.WriteLine("

Back to the index

"); - indexHtml.WriteLine("

Namespaces

"); + kvp.Value.Sort(new TypeComparer()); - SortedList> nspaces = new SortedList>(m_Namespaces); - - foreach (KeyValuePair> kvp in nspaces) - { - kvp.Value.Sort(new TypeComparer()); - - SaveNamespace(kvp.Key, kvp.Value, indexHtml); - } - - indexHtml.WriteLine(" "); - indexHtml.WriteLine(""); + SaveNamespace(kvp.Key, kvp.Value, indexHtml); } + + indexHtml.WriteLine(" "); + indexHtml.WriteLine(""); } private static void SaveNamespace(string name, List types, StreamWriter indexHtml) @@ -167,23 +165,21 @@ namespace Server.Commands indexHtml.WriteLine(" {1}
", fileName, name); - using (StreamWriter nsHtml = GetWriter("docs/namespaces/", fileName)) - { - nsHtml.WriteLine(""); - nsHtml.WriteLine(" "); - nsHtml.WriteLine(" RunUO Documentation - Class Overview - {0}", name); - nsHtml.WriteLine(" "); - nsHtml.WriteLine( - " "); - nsHtml.WriteLine("

Back to the namespace index

"); - nsHtml.WriteLine("

{0}

", name); + using StreamWriter nsHtml = GetWriter("docs/namespaces/", fileName); + nsHtml.WriteLine(""); + nsHtml.WriteLine(" "); + nsHtml.WriteLine(" RunUO Documentation - Class Overview - {0}", name); + nsHtml.WriteLine(" "); + nsHtml.WriteLine( + " "); + nsHtml.WriteLine("

Back to the namespace index

"); + nsHtml.WriteLine("

{0}

", name); - for (int i = 0; i < types.Count; ++i) - SaveType(types[i], nsHtml, fileName, name); + for (int i = 0; i < types.Count; ++i) + SaveType(types[i], nsHtml, fileName, name); - nsHtml.WriteLine(" "); - nsHtml.WriteLine(""); - } + nsHtml.WriteLine(" "); + nsHtml.WriteLine(""); } private static void SaveType(TypeInfo info, StreamWriter nsHtml, string nsFileName, string nsName) @@ -191,24 +187,22 @@ namespace Server.Commands if (info.m_Declaring == null) nsHtml.WriteLine(" " + info.LinkName("../types/") + "
"); - using (StreamWriter typeHtml = GetWriter(info.FileName)) - { - typeHtml.WriteLine(""); - typeHtml.WriteLine(" "); - typeHtml.WriteLine(" RunUO Documentation - Class Overview - {0}", info.TypeName); - typeHtml.WriteLine(" "); - typeHtml.WriteLine( - " "); - typeHtml.WriteLine("

Back to {1}

", nsFileName, nsName); + using StreamWriter typeHtml = GetWriter(info.FileName); + typeHtml.WriteLine(""); + typeHtml.WriteLine(" "); + typeHtml.WriteLine(" RunUO Documentation - Class Overview - {0}", info.TypeName); + typeHtml.WriteLine(" "); + typeHtml.WriteLine( + " "); + typeHtml.WriteLine("

Back to {1}

", nsFileName, nsName); - if (info.m_Type.IsEnum) - WriteEnum(info, typeHtml); - else - WriteType(info, typeHtml); + if (info.m_Type.IsEnum) + WriteEnum(info, typeHtml); + else + WriteType(info, typeHtml); - typeHtml.WriteLine(" "); - typeHtml.WriteLine(""); - } + typeHtml.WriteLine(" "); + typeHtml.WriteLine(""); } public static void FormatGeneric(Type type, out string typeName, out string fileName, out string linkName) @@ -420,19 +414,14 @@ namespace Server.Commands return false; } - private string GetNameFrom(ConstructorInfo ctor, PropertyInfo prop, MethodInfo method) - { - return ctor?.DeclaringType?.Name ?? prop?.Name ?? method?.Name ?? ""; - } + private string GetNameFrom(ConstructorInfo ctor, PropertyInfo prop, MethodInfo method) => ctor?.DeclaringType?.Name ?? prop?.Name ?? method?.Name ?? ""; } private class TypeComparer : IComparer { - public int Compare(TypeInfo x, TypeInfo y) - { - return x == null && y == null ? 0 : x == null ? -1 : y == null ? 1 : - x.TypeName.CompareTo(y.TypeName); - } + public int Compare(TypeInfo x, TypeInfo y) => + x == null && y == null ? 0 : x == null ? -1 : y == null ? 1 : + x.TypeName.CompareTo(y.TypeName); } private class TypeInfo @@ -456,10 +445,7 @@ namespace Server.Commands public string FileName => m_FileName; public string TypeName => m_TypeName; - public string LinkName(string dirRoot) - { - return m_LinkName.Replace("@directory@", dirRoot); - } + public string LinkName(string dirRoot) => m_LinkName.Replace("@directory@", dirRoot); } #region FileSystem @@ -503,15 +489,9 @@ namespace Server.Commands Directory.Delete(path, true); } - private static StreamWriter GetWriter(string root, string name) - { - return new StreamWriter(Path.Combine(Path.Combine(m_RootDirectory, root), name)); - } + private static StreamWriter GetWriter(string root, string name) => new StreamWriter(Path.Combine(Path.Combine(m_RootDirectory, root), name)); - private static StreamWriter GetWriter(string path) - { - return new StreamWriter(Path.Combine(m_RootDirectory, path)); - } + private static StreamWriter GetWriter(string path) => new StreamWriter(Path.Combine(m_RootDirectory, path)); #endregion @@ -688,65 +668,61 @@ namespace Server.Commands private static void GenerateStyles() { - using (StreamWriter css = GetWriter("docs/", "styles.css")) - { - css.WriteLine("body { background-color: #FFFFFF; font-family: verdana, arial; font-size: 11px; }"); - css.WriteLine("a { color: #28435E; }"); - css.WriteLine("a:hover { color: #4878A9; }"); - css.WriteLine("td.header { background-color: #9696AA; font-weight: bold; font-size: 12px; }"); - css.WriteLine("td.lentry { background-color: #D7D7EB; width: 10%; }"); - css.WriteLine("td.rentry { background-color: #FFFFFF; width: 90%; }"); - css.WriteLine("td.entry { background-color: #FFFFFF; }"); - css.WriteLine("td { font-size: 11px; }"); - css.WriteLine(".tbl-border { background-color: #46465A; }"); + using StreamWriter css = GetWriter("docs/", "styles.css"); + css.WriteLine("body { background-color: #FFFFFF; font-family: verdana, arial; font-size: 11px; }"); + css.WriteLine("a { color: #28435E; }"); + css.WriteLine("a:hover { color: #4878A9; }"); + css.WriteLine("td.header { background-color: #9696AA; font-weight: bold; font-size: 12px; }"); + css.WriteLine("td.lentry { background-color: #D7D7EB; width: 10%; }"); + css.WriteLine("td.rentry { background-color: #FFFFFF; width: 90%; }"); + css.WriteLine("td.entry { background-color: #FFFFFF; }"); + css.WriteLine("td { font-size: 11px; }"); + css.WriteLine(".tbl-border { background-color: #46465A; }"); - css.WriteLine("td.ir {{ background-color: #{0:X6}; }}", Iron); - css.WriteLine("td.du {{ background-color: #{0:X6}; }}", DullCopper); - css.WriteLine("td.sh {{ background-color: #{0:X6}; }}", ShadowIron); - css.WriteLine("td.co {{ background-color: #{0:X6}; }}", Copper); - css.WriteLine("td.br {{ background-color: #{0:X6}; }}", Bronze); - css.WriteLine("td.go {{ background-color: #{0:X6}; }}", Gold); - css.WriteLine("td.ag {{ background-color: #{0:X6}; }}", Agapite); - css.WriteLine("td.ve {{ background-color: #{0:X6}; }}", Verite); - css.WriteLine("td.va {{ background-color: #{0:X6}; }}", Valorite); + css.WriteLine("td.ir {{ background-color: #{0:X6}; }}", Iron); + css.WriteLine("td.du {{ background-color: #{0:X6}; }}", DullCopper); + css.WriteLine("td.sh {{ background-color: #{0:X6}; }}", ShadowIron); + css.WriteLine("td.co {{ background-color: #{0:X6}; }}", Copper); + css.WriteLine("td.br {{ background-color: #{0:X6}; }}", Bronze); + css.WriteLine("td.go {{ background-color: #{0:X6}; }}", Gold); + css.WriteLine("td.ag {{ background-color: #{0:X6}; }}", Agapite); + css.WriteLine("td.ve {{ background-color: #{0:X6}; }}", Verite); + css.WriteLine("td.va {{ background-color: #{0:X6}; }}", Valorite); - css.WriteLine("td.cl {{ background-color: #{0:X6}; }}", Cloth); - css.WriteLine("td.pl {{ background-color: #{0:X6}; }}", Plain); - css.WriteLine("td.sp {{ background-color: #{0:X6}; }}", Core.AOS ? SpinedAOS : SpinedLBR); - css.WriteLine("td.ho {{ background-color: #{0:X6}; }}", Core.AOS ? HornedAOS : HornedLBR); - css.WriteLine("td.ba {{ background-color: #{0:X6}; }}", Core.AOS ? BarbedAOS : BarbedLBR); - } + css.WriteLine("td.cl {{ background-color: #{0:X6}; }}", Cloth); + css.WriteLine("td.pl {{ background-color: #{0:X6}; }}", Plain); + css.WriteLine("td.sp {{ background-color: #{0:X6}; }}", Core.AOS ? SpinedAOS : SpinedLBR); + css.WriteLine("td.ho {{ background-color: #{0:X6}; }}", Core.AOS ? HornedAOS : HornedLBR); + css.WriteLine("td.ba {{ background-color: #{0:X6}; }}", Core.AOS ? BarbedAOS : BarbedLBR); } private static void GenerateIndex() { - using (StreamWriter html = GetWriter("docs/", "index.html")) - { - html.WriteLine(""); - html.WriteLine(" "); - html.WriteLine(" RunUO Documentation - Index"); - html.WriteLine(" "); - html.WriteLine(" "); - html.WriteLine(" "); + using StreamWriter html = GetWriter("docs/", "index.html"); + html.WriteLine(""); + html.WriteLine(" "); + html.WriteLine(" RunUO Documentation - Index"); + html.WriteLine(" "); + html.WriteLine(" "); + html.WriteLine(" "); - AddIndexLink(html, "commands.html", "Commands", - "Every available command. This contains command name, usage, aliases, and description."); - AddIndexLink(html, "objects.html", "Constructible Objects", - "Every constructible item or npc. This contains object name and usage. Hover mouse over parameters to see type description."); - AddIndexLink(html, "keywords.html", "Speech Keywords", - "Lists speech keyword numbers and associated match patterns. These are used in some scripts for multi-language matching of client speech."); - AddIndexLink(html, "bodies.html", "Body List", - "Every usable body number and name. Table is generated from a UO:3D client datafile. If you do not have UO:3D installed, this may be blank."); - AddIndexLink(html, "overview.html", "Class Overview", - "Scripting reference. Contains every class type and contained methods in the core and scripts."); - AddIndexLink(html, "bods/bod_smith_rewards.html", "Bulk Order Rewards: Smithing", - "Reference table for large and small smithing bulk order deed rewards."); - AddIndexLink(html, "bods/bod_tailor_rewards.html", "Bulk Order Rewards: Tailoring", - "Reference table for large and small tailoring bulk order deed rewards."); + AddIndexLink(html, "commands.html", "Commands", + "Every available command. This contains command name, usage, aliases, and description."); + AddIndexLink(html, "objects.html", "Constructible Objects", + "Every constructible item or npc. This contains object name and usage. Hover mouse over parameters to see type description."); + AddIndexLink(html, "keywords.html", "Speech Keywords", + "Lists speech keyword numbers and associated match patterns. These are used in some scripts for multi-language matching of client speech."); + AddIndexLink(html, "bodies.html", "Body List", + "Every usable body number and name. Table is generated from a UO:3D client datafile. If you do not have UO:3D installed, this may be blank."); + AddIndexLink(html, "overview.html", "Class Overview", + "Scripting reference. Contains every class type and contained methods in the core and scripts."); + AddIndexLink(html, "bods/bod_smith_rewards.html", "Bulk Order Rewards: Smithing", + "Reference table for large and small smithing bulk order deed rewards."); + AddIndexLink(html, "bods/bod_tailor_rewards.html", "Bulk Order Rewards: Tailoring", + "Reference table for large and small tailoring bulk order deed rewards."); - html.WriteLine(" "); - html.WriteLine(""); - } + html.WriteLine(" "); + html.WriteLine(""); } #endregion @@ -1613,32 +1589,32 @@ namespace Server.Commands string path = Core.FindDataFile("models/models.txt"); if (File.Exists(path)) - using (StreamReader ip = new StreamReader(path)) + { + using StreamReader ip = new StreamReader(path); + string line; + + while ((line = ip.ReadLine()) != null) { - string line; + line = line.Trim(); - while ((line = ip.ReadLine()) != null) + if (line.Length == 0 || line.StartsWith("#")) + continue; + + string[] split = line.Split('\t'); + + if (split.Length >= 9) { - line = line.Trim(); + Body body = Utility.ToInt32(split[0]); + ModelBodyType type = (ModelBodyType)Utility.ToInt32(split[1]); + string name = split[8]; - if (line.Length == 0 || line.StartsWith("#")) - continue; + BodyEntry entry = new BodyEntry(body, type, name); - string[] split = line.Split('\t'); - - if (split.Length >= 9) - { - Body body = Utility.ToInt32(split[0]); - ModelBodyType type = (ModelBodyType)Utility.ToInt32(split[1]); - string name = split[8]; - - BodyEntry entry = new BodyEntry(body, type, name); - - if (!list.Contains(entry)) - list.Add(entry); - } + if (!list.Contains(entry)) + list.Add(entry); } } + } return list; } @@ -1647,84 +1623,82 @@ namespace Server.Commands { List list = LoadBodies(); - using (StreamWriter html = GetWriter("docs/", "bodies.html")) + using StreamWriter html = GetWriter("docs/", "bodies.html"); + html.WriteLine(""); + html.WriteLine(" "); + html.WriteLine(" RunUO Documentation - Body List"); + html.WriteLine(" "); + html.WriteLine(" "); + html.WriteLine(" "); + html.WriteLine(" "); + html.WriteLine("

Back to the index

"); + + if (list.Count > 0) { - html.WriteLine(""); - html.WriteLine(" "); - html.WriteLine(" RunUO Documentation - Body List"); - html.WriteLine(" "); - html.WriteLine(" "); - html.WriteLine(" "); - html.WriteLine(" "); - html.WriteLine("

Back to the index

"); + html.WriteLine("

Body List

"); - if (list.Count > 0) + list.Sort(new BodyEntrySorter()); + + ModelBodyType lastType = ModelBodyType.Invalid; + + for (int i = 0; i < list.Count; ++i) { - html.WriteLine("

Body List

"); + BodyEntry entry = list[i]; + ModelBodyType type = entry.BodyType; - list.Sort(new BodyEntrySorter()); - - ModelBodyType lastType = ModelBodyType.Invalid; - - for (int i = 0; i < list.Count; ++i) + if (type != lastType) { - BodyEntry entry = list[i]; - ModelBodyType type = entry.BodyType; + if (lastType != ModelBodyType.Invalid) + html.WriteLine("
"); - if (type != lastType) + lastType = type; + + html.WriteLine(" ", type); + + switch (type) { - if (lastType != ModelBodyType.Invalid) - html.WriteLine("
"); - - lastType = type; - - html.WriteLine("
", type); - - switch (type) - { - case ModelBodyType.Monsters: - html.WriteLine( - " Monsters | Sea | Animals | Human | Equipment

"); - break; - case ModelBodyType.Sea: - html.WriteLine( - " Monsters | Sea | Animals | Human | Equipment

"); - break; - case ModelBodyType.Animals: - html.WriteLine( - " Monsters | Sea | Animals | Human | Equipment

"); - break; - case ModelBodyType.Human: - html.WriteLine( - " Monsters | Sea | Animals | Human | Equipment

"); - break; - case ModelBodyType.Equipment: - html.WriteLine( - " Monsters | Sea | Animals | Human | Equipment

"); - break; - } - - html.WriteLine(" "); - html.WriteLine("
"); - html.WriteLine(" "); - html.WriteLine(" ", - type); + case ModelBodyType.Monsters: + html.WriteLine( + " Monsters | Sea | Animals | Human | Equipment

"); + break; + case ModelBodyType.Sea: + html.WriteLine( + " Monsters | Sea | Animals | Human | Equipment

"); + break; + case ModelBodyType.Animals: + html.WriteLine( + " Monsters | Sea | Animals | Human | Equipment

"); + break; + case ModelBodyType.Human: + html.WriteLine( + " Monsters | Sea | Animals | Human | Equipment

"); + break; + case ModelBodyType.Equipment: + html.WriteLine( + " Monsters | Sea | Animals | Human | Equipment

"); + break; } - html.WriteLine(" ", - entry.Body.BodyID, entry.Name); + html.WriteLine("
{0}
{0}{1}
"); + html.WriteLine(" ", + entry.Body.BodyID, entry.Name); } - html.WriteLine(" "); - html.WriteLine(""); + html.WriteLine("
"); + html.WriteLine(" "); + html.WriteLine(" ", + type); } - html.WriteLine("
{0}
"); - } - else - { - html.WriteLine(" This feature requires a UO:3D installation."); + html.WriteLine("
{0}{1}
"); } + else + { + html.WriteLine(" This feature requires a UO:3D installation."); + } + + html.WriteLine(" "); + html.WriteLine(""); } #endregion @@ -1735,77 +1709,75 @@ namespace Server.Commands { List> tables = LoadSpeechFile(); - using (StreamWriter html = GetWriter("docs/", "keywords.html")) + using StreamWriter html = GetWriter("docs/", "keywords.html"); + html.WriteLine(""); + html.WriteLine(" "); + html.WriteLine(" RunUO Documentation - Speech Keywords"); + html.WriteLine(" "); + html.WriteLine(" "); + html.WriteLine(" "); + html.WriteLine("

Back to the index

"); + html.WriteLine("

Speech Keywords

"); + + for (int p = 0; p < 1 && p < tables.Count; ++p) { - html.WriteLine(""); - html.WriteLine(" "); - html.WriteLine(" RunUO Documentation - Speech Keywords"); - html.WriteLine(" "); - html.WriteLine(" "); - html.WriteLine(" "); - html.WriteLine("

Back to the index

"); - html.WriteLine("

Speech Keywords

"); + Dictionary table = tables[p]; - for (int p = 0; p < 1 && p < tables.Count; ++p) + if (p > 0) + html.WriteLine("
"); + + html.WriteLine(" "); + html.WriteLine("
"); + html.WriteLine(" "); + html.WriteLine(" "); + + List list = new List(table.Values); + list.Sort(new SpeechEntrySorter()); + + for (int i = 0; i < list.Count; ++i) { - Dictionary table = tables[p]; + SpeechEntry entry = list[i]; - if (p > 0) - html.WriteLine("
"); + html.Write("
"); } - html.WriteLine(" "); - html.WriteLine(""); + html.WriteLine("
NumberText
0x{0:X4}", entry.Index); - html.WriteLine(" "); - html.WriteLine("
"); - html.WriteLine(" "); - html.WriteLine(" "); + entry.Strings.Sort(); //( new EnglishPrioStringSorter() ); - List list = new List(table.Values); - list.Sort(new SpeechEntrySorter()); - - for (int i = 0; i < list.Count; ++i) + for (int j = 0; j < entry.Strings.Count; ++j) { - SpeechEntry entry = list[i]; + if (j > 0) + html.Write("
"); - html.Write("
"); } - html.WriteLine("
NumberText
0x{0:X4}", entry.Index); + string v = entry.Strings[j]; - entry.Strings.Sort(); //( new EnglishPrioStringSorter() ); - - for (int j = 0; j < entry.Strings.Count; ++j) + for (int k = 0; k < v.Length; ++k) { - if (j > 0) - html.Write("
"); + char c = v[k]; - string v = entry.Strings[j]; - - for (int k = 0; k < v.Length; ++k) - { - char c = v[k]; - - if (c == '<') - html.Write("<"); - else if (c == '>') - html.Write(">"); - else if (c == '&') - html.Write("&"); - else if (c == '"') - html.Write("""); - else if (c == '\'') - html.Write("'"); - else if (c >= 0x20 && c < 0x7F) - html.Write(c); - else - html.Write("&#{0};", (int)c); - } + if (c == '<') + html.Write("<"); + else if (c == '>') + html.Write(">"); + else if (c == '&') + html.Write("&"); + else if (c == '"') + html.Write("""); + else if (c == '\'') + html.Write("'"); + else if (c >= 0x20 && c < 0x7F) + html.Write(c); + else + html.Write("&#{0};", (int)c); } - - html.WriteLine("
"); + html.WriteLine("
"); } + + html.WriteLine(" "); + html.WriteLine(""); } private class SpeechEntry @@ -1840,35 +1812,35 @@ namespace Server.Commands string path = Core.FindDataFile("speech.mul"); if (File.Exists(path)) - using (FileStream ip = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read)) + { + using FileStream ip = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read); + BinaryReader bin = new BinaryReader(ip); + + while (bin.PeekChar() >= 0) { - BinaryReader bin = new BinaryReader(ip); + int index = (bin.ReadByte() << 8) | bin.ReadByte(); + int length = (bin.ReadByte() << 8) | bin.ReadByte(); + string text = Encoding.UTF8.GetString(bin.ReadBytes(length)).Trim(); - while (bin.PeekChar() >= 0) + if (text.Length == 0) + continue; + + if (table == null || lastIndex > index) { - int index = (bin.ReadByte() << 8) | bin.ReadByte(); - int length = (bin.ReadByte() << 8) | bin.ReadByte(); - string text = Encoding.UTF8.GetString(bin.ReadBytes(length)).Trim(); - - if (text.Length == 0) - continue; - - if (table == null || lastIndex > index) - { - if (index == 0 && text == "*withdraw*") - tables.Insert(0, table = new Dictionary()); - else - tables.Add(table = new Dictionary()); - } - - lastIndex = index; - - if (!table.TryGetValue(index, out SpeechEntry entry)) - table[index] = entry = new SpeechEntry(index); - - entry.Strings.Add(text); + if (index == 0 && text == "*withdraw*") + tables.Insert(0, table = new Dictionary()); + else + tables.Add(table = new Dictionary()); } + + lastIndex = index; + + if (!table.TryGetValue(index, out SpeechEntry entry)) + table[index] = entry = new SpeechEntry(index); + + entry.Strings.Add(text); } + } return tables; } @@ -1916,191 +1888,189 @@ namespace Server.Commands private static void DocumentCommands() { - using (StreamWriter html = GetWriter("docs/", "commands.html")) + using StreamWriter html = GetWriter("docs/", "commands.html"); + html.WriteLine(""); + html.WriteLine(" "); + html.WriteLine(" RunUO Documentation - Commands"); + html.WriteLine(" "); + html.WriteLine(" "); + html.WriteLine(" "); + html.WriteLine(" "); + html.WriteLine("

Back to the index

"); + html.WriteLine("

Commands

"); + + List commands = new List(CommandSystem.Entries.Values); + List list = new List(); + + commands.Sort(); + commands.Reverse(); + Clean(commands); + + for (int i = 0; i < commands.Count; ++i) { - html.WriteLine(""); - html.WriteLine(" "); - html.WriteLine(" RunUO Documentation - Commands"); - html.WriteLine(" "); - html.WriteLine(" "); - html.WriteLine(" "); - html.WriteLine(" "); - html.WriteLine("

Back to the index

"); - html.WriteLine("

Commands

"); + CommandEntry e = commands[i]; - List commands = new List(CommandSystem.Entries.Values); - List list = new List(); + MethodInfo mi = e.Handler.Method; - commands.Sort(); - commands.Reverse(); - Clean(commands); + object[] attrs = mi.GetCustomAttributes(typeof(UsageAttribute), false); - for (int i = 0; i < commands.Count; ++i) - { - CommandEntry e = commands[i]; + if (attrs.Length == 0) + continue; - MethodInfo mi = e.Handler.Method; + UsageAttribute usage = attrs[0] as UsageAttribute; - object[] attrs = mi.GetCustomAttributes(typeof(UsageAttribute), false); + attrs = mi.GetCustomAttributes(typeof(DescriptionAttribute), false); - if (attrs.Length == 0) - continue; + if (attrs.Length == 0) + continue; - UsageAttribute usage = attrs[0] as UsageAttribute; + if (usage == null || !(attrs[0] is DescriptionAttribute desc)) + continue; - attrs = mi.GetCustomAttributes(typeof(DescriptionAttribute), false); + attrs = mi.GetCustomAttributes(typeof(AliasesAttribute), false); - if (attrs.Length == 0) - continue; + AliasesAttribute aliases = attrs.Length == 0 ? null : attrs[0] as AliasesAttribute; - if (usage == null || !(attrs[0] is DescriptionAttribute desc)) - continue; + string descString = desc.Description.Replace("<", "<").Replace(">", ">"); - attrs = mi.GetCustomAttributes(typeof(AliasesAttribute), false); - - AliasesAttribute aliases = attrs.Length == 0 ? null : attrs[0] as AliasesAttribute; - - string descString = desc.Description.Replace("<", "<").Replace(">", ">"); - - if (aliases == null) - list.Add(new DocCommandEntry(e.AccessLevel, e.Command, null, usage.Usage, descString)); - else - list.Add(new DocCommandEntry(e.AccessLevel, e.Command, aliases.Aliases, usage.Usage, descString)); - } - - for (int i = 0; i < TargetCommands.AllCommands.Count; ++i) - { - BaseCommand command = TargetCommands.AllCommands[i]; - - string usage = command.Usage; - string desc = command.Description; - - if (usage == null || desc == null) - continue; - - string[] cmds = command.Commands; - string cmd = cmds[0]; - string[] aliases = new string[cmds.Length - 1]; - - for (int j = 0; j < aliases.Length; ++j) - aliases[j] = cmds[j + 1]; - - desc = desc.Replace("<", "<").Replace(">", ">"); - - if (command.Supports != CommandSupport.Single) - { - StringBuilder sb = new StringBuilder(50 + desc.Length); - - sb.Append("Modifiers: "); - - if ((command.Supports & CommandSupport.Global) != 0) - sb.Append("Global, "); - - if ((command.Supports & CommandSupport.Online) != 0) - sb.Append("Online, "); - - if ((command.Supports & CommandSupport.Region) != 0) - sb.Append("Region, "); - - if ((command.Supports & CommandSupport.Contained) != 0) - sb.Append("Contained, "); - - if ((command.Supports & CommandSupport.Multi) != 0) - sb.Append("Multi, "); - - if ((command.Supports & CommandSupport.Area) != 0) - sb.Append("Area, "); - - if ((command.Supports & CommandSupport.Self) != 0) - sb.Append("Self, "); - - sb.Remove(sb.Length - 2, 2); - sb.Append("
"); - sb.Append(desc); - - desc = sb.ToString(); - } - - list.Add(new DocCommandEntry(command.AccessLevel, cmd, aliases, usage, desc)); - } - - List commandImpls = BaseCommandImplementor.Implementors; - - for (int i = 0; i < commandImpls.Count; ++i) - { - BaseCommandImplementor command = commandImpls[i]; - - string usage = command.Usage; - string desc = command.Description; - - if (usage == null || desc == null) - continue; - - string[] cmds = command.Accessors; - string cmd = cmds[0]; - string[] aliases = new string[cmds.Length - 1]; - - for (int j = 0; j < aliases.Length; ++j) - aliases[j] = cmds[j + 1]; - - desc = desc.Replace("<", "<").Replace(">", ">"); - - list.Add(new DocCommandEntry(command.AccessLevel, cmd, aliases, usage, desc)); - } - - list.Sort(new CommandEntrySorter()); - - AccessLevel last = AccessLevel.Player; - - foreach (DocCommandEntry e in list) - { - if (e.AccessLevel != last) - { - if (last != AccessLevel.Player) - html.WriteLine("

"); - - last = e.AccessLevel; - - html.WriteLine(" ", last); - - switch (last) - { - case AccessLevel.Administrator: - html.WriteLine( - " Administrator | Game Master | Counselor | Player

"); - break; - case AccessLevel.GameMaster: - html.WriteLine( - " Administrator | Game Master | Counselor | Player

"); - break; - case AccessLevel.Seer: - html.WriteLine( - " Administrator | Game Master | Counselor | Player

"); - break; - case AccessLevel.Counselor: - html.WriteLine( - " Administrator | Game Master | Counselor | Player

"); - break; - case AccessLevel.Player: - html.WriteLine( - " Administrator | Game Master | Counselor | Player

"); - break; - } - - html.WriteLine(" "); - html.WriteLine("
"); - html.WriteLine(" "); - html.WriteLine(" ", - last == AccessLevel.GameMaster ? "Game Master" : last.ToString()); - } - - DocumentCommand(html, e); - } - - html.WriteLine("
{0}
"); - html.WriteLine(" "); - html.WriteLine(""); + if (aliases == null) + list.Add(new DocCommandEntry(e.AccessLevel, e.Command, null, usage.Usage, descString)); + else + list.Add(new DocCommandEntry(e.AccessLevel, e.Command, aliases.Aliases, usage.Usage, descString)); } + + for (int i = 0; i < TargetCommands.AllCommands.Count; ++i) + { + BaseCommand command = TargetCommands.AllCommands[i]; + + string usage = command.Usage; + string desc = command.Description; + + if (usage == null || desc == null) + continue; + + string[] cmds = command.Commands; + string cmd = cmds[0]; + string[] aliases = new string[cmds.Length - 1]; + + for (int j = 0; j < aliases.Length; ++j) + aliases[j] = cmds[j + 1]; + + desc = desc.Replace("<", "<").Replace(">", ">"); + + if (command.Supports != CommandSupport.Single) + { + StringBuilder sb = new StringBuilder(50 + desc.Length); + + sb.Append("Modifiers: "); + + if ((command.Supports & CommandSupport.Global) != 0) + sb.Append("Global, "); + + if ((command.Supports & CommandSupport.Online) != 0) + sb.Append("Online, "); + + if ((command.Supports & CommandSupport.Region) != 0) + sb.Append("Region, "); + + if ((command.Supports & CommandSupport.Contained) != 0) + sb.Append("Contained, "); + + if ((command.Supports & CommandSupport.Multi) != 0) + sb.Append("Multi, "); + + if ((command.Supports & CommandSupport.Area) != 0) + sb.Append("Area, "); + + if ((command.Supports & CommandSupport.Self) != 0) + sb.Append("Self, "); + + sb.Remove(sb.Length - 2, 2); + sb.Append("
"); + sb.Append(desc); + + desc = sb.ToString(); + } + + list.Add(new DocCommandEntry(command.AccessLevel, cmd, aliases, usage, desc)); + } + + List commandImpls = BaseCommandImplementor.Implementors; + + for (int i = 0; i < commandImpls.Count; ++i) + { + BaseCommandImplementor command = commandImpls[i]; + + string usage = command.Usage; + string desc = command.Description; + + if (usage == null || desc == null) + continue; + + string[] cmds = command.Accessors; + string cmd = cmds[0]; + string[] aliases = new string[cmds.Length - 1]; + + for (int j = 0; j < aliases.Length; ++j) + aliases[j] = cmds[j + 1]; + + desc = desc.Replace("<", "<").Replace(">", ">"); + + list.Add(new DocCommandEntry(command.AccessLevel, cmd, aliases, usage, desc)); + } + + list.Sort(new CommandEntrySorter()); + + AccessLevel last = AccessLevel.Player; + + foreach (DocCommandEntry e in list) + { + if (e.AccessLevel != last) + { + if (last != AccessLevel.Player) + html.WriteLine("
"); + + last = e.AccessLevel; + + html.WriteLine(" ", last); + + switch (last) + { + case AccessLevel.Administrator: + html.WriteLine( + " Administrator | Game Master | Counselor | Player

"); + break; + case AccessLevel.GameMaster: + html.WriteLine( + " Administrator | Game Master | Counselor | Player

"); + break; + case AccessLevel.Seer: + html.WriteLine( + " Administrator | Game Master | Counselor | Player

"); + break; + case AccessLevel.Counselor: + html.WriteLine( + " Administrator | Game Master | Counselor | Player

"); + break; + case AccessLevel.Player: + html.WriteLine( + " Administrator | Game Master | Counselor | Player

"); + break; + } + + html.WriteLine(" "); + html.WriteLine("
"); + html.WriteLine(" "); + html.WriteLine(" ", + last == AccessLevel.GameMaster ? "Game Master" : last.ToString()); + } + + DocumentCommand(html, e); + } + + html.WriteLine("
{0}
"); + html.WriteLine(" "); + html.WriteLine(""); } public static void Clean(List list) @@ -2161,15 +2131,9 @@ namespace Server.Commands private static Type typeofItem = typeof(Item), typeofMobile = typeof(Mobile), typeofMap = typeof(Map); private static Type typeofCustomEnum = typeof(CustomEnumAttribute); - private static bool IsConstructible(Type t, out bool isItem) - { - return (isItem = typeofItem.IsAssignableFrom(t)) || typeofMobile.IsAssignableFrom(t); - } + private static bool IsConstructible(Type t, out bool isItem) => (isItem = typeofItem.IsAssignableFrom(t)) || typeofMobile.IsAssignableFrom(t); - private static bool IsConstructible(ConstructorInfo ctor) - { - return ctor.IsDefined(typeof(ConstructibleAttribute), false); - } + private static bool IsConstructible(ConstructorInfo ctor) => ctor.IsDefined(typeof(ConstructibleAttribute), false); private static void DocumentConstructibleObjects() { @@ -2198,49 +2162,47 @@ namespace Server.Commands } } - using (StreamWriter html = GetWriter("docs/", "objects.html")) + using StreamWriter html = GetWriter("docs/", "objects.html"); + html.WriteLine(""); + html.WriteLine(" "); + html.WriteLine(" RunUO Documentation - Constructible Objects"); + html.WriteLine(" "); + html.WriteLine(" "); + html.WriteLine(" "); + html.WriteLine("

Back to the index

"); + html.WriteLine( + "

Constructible Items and Mobiles

"); + + html.WriteLine(" "); + html.WriteLine(" "); + html.WriteLine("
"); + html.WriteLine(" "); + html.WriteLine(" "); + + items.ForEach(tuple => { - html.WriteLine(""); - html.WriteLine(" "); - html.WriteLine(" RunUO Documentation - Constructible Objects"); - html.WriteLine(" "); - html.WriteLine(" "); - html.WriteLine(" "); - html.WriteLine("

Back to the index

"); - html.WriteLine( - "

Constructible Items and Mobiles

"); + var (type, constructors) = tuple; + DocumentConstructibleObject(html, type, constructors); + }); - html.WriteLine(" "); - html.WriteLine("
Item NameUsage
"); - html.WriteLine("
"); - html.WriteLine(" "); - html.WriteLine(" "); + html.WriteLine("
Item NameUsage


"); - items.ForEach(tuple => - { - var (type, constructors) = tuple; - DocumentConstructibleObject(html, type, constructors); - }); + html.WriteLine("
"); + html.WriteLine(" "); + html.WriteLine("
"); + html.WriteLine(" "); + html.WriteLine(" "); - html.WriteLine("
Mobile NameUsage


"); + mobiles.ForEach(tuple => + { + var (type, constructors) = tuple; + DocumentConstructibleObject(html, type, constructors); + }); - html.WriteLine("
"); - html.WriteLine(" "); - html.WriteLine("
"); - html.WriteLine(" "); - html.WriteLine(" "); + html.WriteLine("
Mobile NameUsage
"); - mobiles.ForEach(tuple => - { - var (type, constructors) = tuple; - DocumentConstructibleObject(html, type, constructors); - }); - - html.WriteLine("
"); - - html.WriteLine(" "); - html.WriteLine(""); - } + html.WriteLine(" "); + html.WriteLine(""); } private static void DocumentConstructibleObject(StreamWriter html, Type t, ConstructorInfo[] ctors) @@ -2691,10 +2653,7 @@ namespace Server.Commands return Body == e?.Body && BodyType == e.BodyType && Name == e.Name; } - public override int GetHashCode() - { - return Body.BodyID ^ (int)BodyType ^ Name.GetHashCode(); - } + public override int GetHashCode() => Body.BodyID ^ (int)BodyType ^ Name.GetHashCode(); } public class BodyEntrySorter : IComparer diff --git a/Projects/Scripts/Commands/GenCategorization.cs b/Projects/Scripts/Commands/GenCategorization.cs index 88dd2533a..fe492eedd 100644 --- a/Projects/Scripts/Commands/GenCategorization.cs +++ b/Projects/Scripts/Commands/GenCategorization.cs @@ -388,13 +388,13 @@ namespace Server.Commands List list = new List(); if (File.Exists(path)) - using (StreamReader ip = new StreamReader(path)) - { - string line; + { + using StreamReader ip = new StreamReader(path); + string line; - while ((line = ip.ReadLine()) != null) - list.Add(new CategoryLine(line)); - } + while ((line = ip.ReadLine()) != null) + list.Add(new CategoryLine(line)); + } return list.ToArray(); } diff --git a/Projects/Scripts/Commands/Generic/Commands/BaseCommand.cs b/Projects/Scripts/Commands/Generic/Commands/BaseCommand.cs index 328afbe6d..4c360b8ab 100644 --- a/Projects/Scripts/Commands/Generic/Commands/BaseCommand.cs +++ b/Projects/Scripts/Commands/Generic/Commands/BaseCommand.cs @@ -54,10 +54,7 @@ namespace Server.Commands.Generic { } - public virtual bool ValidateArgs(BaseCommandImplementor impl, CommandEventArgs e) - { - return true; - } + public virtual bool ValidateArgs(BaseCommandImplementor impl, CommandEventArgs e) => true; public void AddResponse(string message) { @@ -128,10 +125,7 @@ namespace Server.Commands.Generic m_Count = 1; } - public override string ToString() - { - return m_Count > 1 ? $"{m_Message} ({m_Count})" : m_Message; - } + public override string ToString() => m_Count > 1 ? $"{m_Message} ({m_Count})" : m_Message; } } } \ No newline at end of file diff --git a/Projects/Scripts/Commands/Generic/Extensions/BaseExtension.cs b/Projects/Scripts/Commands/Generic/Extensions/BaseExtension.cs index cb135e5a7..c8927953e 100644 --- a/Projects/Scripts/Commands/Generic/Extensions/BaseExtension.cs +++ b/Projects/Scripts/Commands/Generic/Extensions/BaseExtension.cs @@ -121,10 +121,7 @@ namespace Server.Commands.Generic { } - public virtual bool IsValid(object obj) - { - return true; - } + public virtual bool IsValid(object obj) => true; public virtual void Filter(List list) { diff --git a/Projects/Scripts/Commands/Generic/Extensions/DistinctExtension.cs b/Projects/Scripts/Commands/Generic/Extensions/DistinctExtension.cs index bc50b0168..682f4681c 100644 --- a/Projects/Scripts/Commands/Generic/Extensions/DistinctExtension.cs +++ b/Projects/Scripts/Commands/Generic/Extensions/DistinctExtension.cs @@ -12,10 +12,7 @@ namespace Server.Commands.Generic private List m_Properties; - public DistinctExtension() - { - m_Properties = new List(); - } + public DistinctExtension() => m_Properties = new List(); public override ExtensionInfo Info => ExtInfo; diff --git a/Projects/Scripts/Commands/Generic/Extensions/SortExtension.cs b/Projects/Scripts/Commands/Generic/Extensions/SortExtension.cs index fe8613240..5f2684cdb 100644 --- a/Projects/Scripts/Commands/Generic/Extensions/SortExtension.cs +++ b/Projects/Scripts/Commands/Generic/Extensions/SortExtension.cs @@ -11,10 +11,7 @@ namespace Server.Commands.Generic private List m_Orders; - public SortExtension() - { - m_Orders = new List(); - } + public SortExtension() => m_Orders = new List(); public override ExtensionInfo Info => ExtInfo; diff --git a/Projects/Scripts/Commands/Generic/Extensions/WhereExtension.cs b/Projects/Scripts/Commands/Generic/Extensions/WhereExtension.cs index 1330fdd96..019e78e92 100644 --- a/Projects/Scripts/Commands/Generic/Extensions/WhereExtension.cs +++ b/Projects/Scripts/Commands/Generic/Extensions/WhereExtension.cs @@ -31,9 +31,6 @@ namespace Server.Commands.Generic Conditional = ObjectConditional.ParseDirect(from, arguments, offset, size); } - public override bool IsValid(object obj) - { - return Conditional.CheckCondition(obj); - } + public override bool IsValid(object obj) => Conditional.CheckCondition(obj); } } \ No newline at end of file diff --git a/Projects/Scripts/Commands/Generic/Implementors/BaseCommandImplementor.cs b/Projects/Scripts/Commands/Generic/Implementors/BaseCommandImplementor.cs index 6ea26d0b9..23edf03ea 100644 --- a/Projects/Scripts/Commands/Generic/Implementors/BaseCommandImplementor.cs +++ b/Projects/Scripts/Commands/Generic/Implementors/BaseCommandImplementor.cs @@ -30,10 +30,7 @@ namespace Server.Commands.Generic { private static List m_Implementors; - public BaseCommandImplementor() - { - Commands = new Dictionary(StringComparer.OrdinalIgnoreCase); - } + public BaseCommandImplementor() => Commands = new Dictionary(StringComparer.OrdinalIgnoreCase); public bool SupportsConditionals{ get; set; } diff --git a/Projects/Scripts/Commands/Handlers.cs b/Projects/Scripts/Commands/Handlers.cs index f7825df2a..fa99c103f 100644 --- a/Projects/Scripts/Commands/Handlers.cs +++ b/Projects/Scripts/Commands/Handlers.cs @@ -408,10 +408,7 @@ namespace Server.Commands AutoSave.Save(true); } - private static bool FixMap(ref Map map, ref Point3D loc, Item item) - { - return map != null && map != Map.Internal || item.RootParent is Mobile m && FixMap(ref map, ref loc, m); - } + private static bool FixMap(ref Map map, ref Point3D loc, Item item) => map != null && map != Map.Internal || item.RootParent is Mobile m && FixMap(ref map, ref loc, m); private static bool FixMap(ref Map map, ref Point3D loc, Mobile m) { diff --git a/Projects/Scripts/Commands/HelpInfo.cs b/Projects/Scripts/Commands/HelpInfo.cs index 2d74884c1..a868edf7e 100644 --- a/Projects/Scripts/Commands/HelpInfo.cs +++ b/Projects/Scripts/Commands/HelpInfo.cs @@ -388,15 +388,9 @@ namespace Server.Commands //AddAlphaRegion( 10, height - 30, width - 20, 20 ); } - public string Color(string text, int color) - { - return $"{text}"; - } + public string Color(string text, int color) => $"{text}"; - public string Center(string text) - { - return $"
{text}
"; - } + public string Center(string text) => $"
{text}
"; } } } diff --git a/Projects/Scripts/Commands/Logging.cs b/Projects/Scripts/Commands/Logging.cs index 76de569cb..76925519e 100644 --- a/Projects/Scripts/Commands/Logging.cs +++ b/Projects/Scripts/Commands/Logging.cs @@ -81,10 +81,8 @@ namespace Server.Commands AppendPath(ref path, from.AccessLevel.ToString()); path = Path.Combine(path, $"{name}.log"); - using (StreamWriter sw = new StreamWriter(path, true)) - { - sw.WriteLine("{0}: {1}: {2}", DateTime.UtcNow, from.NetState, text); - } + using StreamWriter sw = new StreamWriter(path, true); + sw.WriteLine("{0}: {1}: {2}", DateTime.UtcNow, @from.NetState, text); } catch { diff --git a/Projects/Scripts/Commands/Profiling.cs b/Projects/Scripts/Commands/Profiling.cs index 3cdde3201..15a431096 100644 --- a/Projects/Scripts/Commands/Profiling.cs +++ b/Projects/Scripts/Commands/Profiling.cs @@ -25,31 +25,29 @@ namespace Server.Commands { try { - using (StreamWriter sw = new StreamWriter("profiles.log", true)) - { - sw.WriteLine("# Dump on {0:f}", DateTime.UtcNow); - sw.WriteLine("# Core profiling for " + Core.ProfileTime); + using StreamWriter sw = new StreamWriter("profiles.log", true); + sw.WriteLine("# Dump on {0:f}", DateTime.UtcNow); + sw.WriteLine("# Core profiling for " + Core.ProfileTime); - sw.WriteLine("# Packet send"); - BaseProfile.WriteAll(sw, PacketSendProfile.Profiles); - sw.WriteLine(); + sw.WriteLine("# Packet send"); + BaseProfile.WriteAll(sw, PacketSendProfile.Profiles); + sw.WriteLine(); - sw.WriteLine("# Packet receive"); - BaseProfile.WriteAll(sw, PacketReceiveProfile.Profiles); - sw.WriteLine(); + sw.WriteLine("# Packet receive"); + BaseProfile.WriteAll(sw, PacketReceiveProfile.Profiles); + sw.WriteLine(); - sw.WriteLine("# Timer"); - BaseProfile.WriteAll(sw, TimerProfile.Profiles); - sw.WriteLine(); + sw.WriteLine("# Timer"); + BaseProfile.WriteAll(sw, TimerProfile.Profiles); + sw.WriteLine(); - sw.WriteLine("# Gump response"); - BaseProfile.WriteAll(sw, GumpProfile.Profiles); - sw.WriteLine(); + sw.WriteLine("# Gump response"); + BaseProfile.WriteAll(sw, GumpProfile.Profiles); + sw.WriteLine(); - sw.WriteLine("# Target response"); - BaseProfile.WriteAll(sw, TargetProfile.Profiles); - sw.WriteLine(); - } + sw.WriteLine("# Target response"); + BaseProfile.WriteAll(sw, TargetProfile.Profiles); + sw.WriteLine(); } catch { @@ -75,10 +73,8 @@ namespace Server.Commands { try { - using (StreamWriter sw = new StreamWriter("timerdump.log", true)) - { - Timer.DumpInfo(sw); - } + using StreamWriter sw = new StreamWriter("timerdump.log", true); + Timer.DumpInfo(sw); } catch { @@ -190,37 +186,35 @@ namespace Server.Commands try { - using (StreamWriter op = new StreamWriter("expandedItems.log", true)) + using StreamWriter op = new StreamWriter("expandedItems.log", true); + string[] names = { - string[] names = - { - "Name", - "Items", - "Bounce", - "Holder", - "Blessed", - "TempFlag", - "SaveFlag", - "Weight", - "Spawner" - }; + "Name", + "Items", + "Bounce", + "Holder", + "Blessed", + "TempFlag", + "SaveFlag", + "Weight", + "Spawner" + }; - List> list = typeTable.ToList(); + List> list = typeTable.ToList(); - list.Sort(new CountsSorter()); + list.Sort(new CountsSorter()); - foreach (KeyValuePair kvp in list) - { - int[] countTable = kvp.Value; + foreach (KeyValuePair kvp in list) + { + int[] countTable = kvp.Value; - op.WriteLine("# {0}", kvp.Key.FullName); + op.WriteLine("# {0}", kvp.Key.FullName); - for (int i = 0; i < countTable.Length; ++i) - if (countTable[i] > 0) - op.WriteLine("{0}\t{1:N0}", names[i], countTable[i]); + for (int i = 0; i < countTable.Length; ++i) + if (countTable[i] > 0) + op.WriteLine("{0}\t{1:N0}", names[i], countTable[i]); - op.WriteLine(); - } + op.WriteLine(); } } catch @@ -253,20 +247,18 @@ namespace Server.Commands table[type] = new[] { 1, item.Amount }; } - using (StreamWriter op = new StreamWriter("internal.log")) + using StreamWriter op = new StreamWriter("internal.log"); + op.WriteLine("# {0} items found", totalCount); + op.WriteLine("# {0} different types", table.Count); + op.WriteLine(); + op.WriteLine(); + op.WriteLine("Type\t\tCount\t\tAmount\t\tAvg. Amount"); + + foreach (KeyValuePair de in table) { - op.WriteLine("# {0} items found", totalCount); - op.WriteLine("# {0} different types", table.Count); - op.WriteLine(); - op.WriteLine(); - op.WriteLine("Type\t\tCount\t\tAmount\t\tAvg. Amount"); + int[] parms = de.Value; - foreach (KeyValuePair de in table) - { - int[] parms = de.Value; - - op.WriteLine("{0}\t\t{1}\t\t{2}\t\t{3:F2}", de.Key.Name, parms[0], parms[1], (double)parms[1] / parms[0]); - } + op.WriteLine("{0}\t\t{1}\t\t{2}\t\t{3:F2}", de.Key.Name, parms[0], parms[1], (double)parms[1] / parms[0]); } } @@ -323,16 +315,14 @@ namespace Server.Commands list.Sort(new CountSorter()); - using (StreamWriter op = new StreamWriter(opFile)) - { - op.WriteLine("# Profile of world {0}", type); - op.WriteLine("# Generated on {0}", DateTime.UtcNow); - op.WriteLine(); - op.WriteLine(); + using StreamWriter op = new StreamWriter(opFile); + op.WriteLine("# Profile of world {0}", type); + op.WriteLine("# Generated on {0}", DateTime.UtcNow); + op.WriteLine(); + op.WriteLine(); - list.ForEach(kvp => - op.WriteLine("{0}\t{1:F2}%\t{2}", kvp.Value, 100.0 * kvp.Value / total, kvp.Key)); - } + list.ForEach(kvp => + op.WriteLine("{0}\t{1:F2}%\t{2}", kvp.Value, 100.0 * kvp.Value / total, kvp.Key)); } catch { diff --git a/Projects/Scripts/Commands/Properties.cs b/Projects/Scripts/Commands/Properties.cs index 176cf75e6..5a1752957 100644 --- a/Projects/Scripts/Commands/Properties.cs +++ b/Projects/Scripts/Commands/Properties.cs @@ -70,10 +70,7 @@ namespace Server.Commands } } - private static bool CIEqual(string l, string r) - { - return Insensitive.Equals(l, r); - } + private static bool CIEqual(string l, string r) => Insensitive.Equals(l, r); public static CPA GetCPA(PropertyInfo p) { @@ -346,40 +343,19 @@ namespace Server.Commands return p == null ? failReason : InternalSetValue(from, logObject, o, p, name, value, true); } - private static bool IsSerial(Type t) - { - return t == typeofSerial; - } + private static bool IsSerial(Type t) => t == typeofSerial; - private static bool IsType(Type t) - { - return t == typeofType; - } + private static bool IsType(Type t) => t == typeofType; - private static bool IsChar(Type t) - { - return t == typeofChar; - } + private static bool IsChar(Type t) => t == typeofChar; - private static bool IsString(Type t) - { - return t == typeofString; - } + private static bool IsString(Type t) => t == typeofString; - private static bool IsText(Type t) - { - return t == typeofText; - } + private static bool IsText(Type t) => t == typeofText; - private static bool IsEnum(Type t) - { - return t.IsEnum; - } + private static bool IsEnum(Type t) => t.IsEnum; - private static bool IsParsable(Type t) - { - return t == typeofTimeSpan || t.IsDefined(typeofParsable, false); - } + private static bool IsParsable(Type t) => t == typeofTimeSpan || t.IsDefined(typeofParsable, false); private static object Parse(object o, Type t, string value) { @@ -390,10 +366,7 @@ namespace Server.Commands return method?.Invoke(o, m_ParseParams); } - private static bool IsNumeric(Type t) - { - return Array.IndexOf(m_NumericTypes, t) >= 0; - } + private static bool IsNumeric(Type t) => Array.IndexOf(m_NumericTypes, t) >= 0; public static string ConstructFromString(Type type, object obj, string value, ref object constructed) { @@ -551,10 +524,8 @@ namespace Server protected Property m_Property; public PropertyException(Property property, string message) - : base(message) - { + : base(message) => m_Property = property; - } public Property Property => m_Property; } @@ -655,15 +626,9 @@ namespace Server { private PropertyInfo[] m_Chain; - public Property(string binding) - { - Binding = binding; - } + public Property(string binding) => Binding = binding; - public Property(PropertyInfo[] chain) - { - m_Chain = chain; - } + public Property(PropertyInfo[] chain) => m_Chain = chain; public string Binding{ get; } diff --git a/Projects/Scripts/Commands/Skills.cs b/Projects/Scripts/Commands/Skills.cs index 320ac9b44..7decdfc6f 100644 --- a/Projects/Scripts/Commands/Skills.cs +++ b/Projects/Scripts/Commands/Skills.cs @@ -60,10 +60,7 @@ namespace Server.Commands { private double m_Value; - public AllSkillsTarget(double value) : base(-1, false, TargetFlags.None) - { - m_Value = value; - } + public AllSkillsTarget(double value) : base(-1, false, TargetFlags.None) => m_Value = value; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Commands/Statics.cs b/Projects/Scripts/Commands/Statics.cs index f45fda070..8ac929e82 100644 --- a/Projects/Scripts/Commands/Statics.cs +++ b/Projects/Scripts/Commands/Statics.cs @@ -187,101 +187,97 @@ namespace Server TileMatrix matrix = map.Tiles; - using (FileStream idxStream = OpenWrite(matrix.IndexStream)) + using FileStream idxStream = OpenWrite(matrix.IndexStream); + using FileStream mulStream = OpenWrite(matrix.DataStream); + if (idxStream == null || mulStream == null) { - using (FileStream mulStream = OpenWrite(matrix.DataStream)) + badDataFile = true; + continue; + } + + BinaryReader idxReader = new BinaryReader(idxStream); + + BinaryWriter idxWriter = new BinaryWriter(idxStream); + BinaryWriter mulWriter = new BinaryWriter(mulStream); + + foreach (DeltaState state in table.Values) + { + StaticTile[] oldTiles = ReadStaticBlock(idxReader, mulStream, state.m_X, state.m_Y, + matrix.BlockWidth, matrix.BlockHeight, out int oldTileCount); + + if (oldTileCount < 0) + continue; + + int newTileCount = 0; + StaticTile[] newTiles = new StaticTile[state.m_List.Count]; + + for (int i = 0; i < state.m_List.Count; ++i) { - if (idxStream == null || mulStream == null) - { - badDataFile = true; + Item item = state.m_List[i]; + + int xOffset = item.X - state.m_X * 8; + int yOffset = item.Y - state.m_Y * 8; + + if (xOffset < 0 || xOffset >= 8 || yOffset < 0 || yOffset >= 8) continue; - } - BinaryReader idxReader = new BinaryReader(idxStream); + StaticTile newTile = new StaticTile((ushort)item.ItemID, (byte)xOffset, (byte)yOffset, + (sbyte)item.Z, (short)item.Hue); - BinaryWriter idxWriter = new BinaryWriter(idxStream); - BinaryWriter mulWriter = new BinaryWriter(mulStream); + newTiles[newTileCount++] = newTile; - foreach (DeltaState state in table.Values) - { - StaticTile[] oldTiles = ReadStaticBlock(idxReader, mulStream, state.m_X, state.m_Y, - matrix.BlockWidth, matrix.BlockHeight, out int oldTileCount); + item.Delete(); - if (oldTileCount < 0) - continue; - - int newTileCount = 0; - StaticTile[] newTiles = new StaticTile[state.m_List.Count]; - - for (int i = 0; i < state.m_List.Count; ++i) - { - Item item = state.m_List[i]; - - int xOffset = item.X - state.m_X * 8; - int yOffset = item.Y - state.m_Y * 8; - - if (xOffset < 0 || xOffset >= 8 || yOffset < 0 || yOffset >= 8) - continue; - - StaticTile newTile = new StaticTile((ushort)item.ItemID, (byte)xOffset, (byte)yOffset, - (sbyte)item.Z, (short)item.Hue); - - newTiles[newTileCount++] = newTile; - - item.Delete(); - - ++totalFrozen; - } - - int mulPos = -1; - int length = -1; - int extra = 0; - - if (oldTileCount + newTileCount > 0) - { - mulWriter.Seek(0, SeekOrigin.End); - - mulPos = (int)mulWriter.BaseStream.Position; - length = (oldTileCount + newTileCount) * 7; - extra = 1; - - for (int i = 0; i < oldTileCount; ++i) - { - StaticTile toWrite = oldTiles[i]; - - mulWriter.Write((ushort)toWrite.ID); - mulWriter.Write((byte)toWrite.X); - mulWriter.Write((byte)toWrite.Y); - mulWriter.Write((sbyte)toWrite.Z); - mulWriter.Write((short)toWrite.Hue); - } - - for (int i = 0; i < newTileCount; ++i) - { - StaticTile toWrite = newTiles[i]; - - mulWriter.Write((ushort)toWrite.ID); - mulWriter.Write((byte)toWrite.X); - mulWriter.Write((byte)toWrite.Y); - mulWriter.Write((sbyte)toWrite.Z); - mulWriter.Write((short)toWrite.Hue); - } - - mulWriter.Flush(); - } - - int idxPos = (state.m_X * matrix.BlockHeight + state.m_Y) * 12; - - idxWriter.Seek(idxPos, SeekOrigin.Begin); - idxWriter.Write(mulPos); - idxWriter.Write(length); - idxWriter.Write(extra); - - idxWriter.Flush(); - - matrix.SetStaticBlock(state.m_X, state.m_Y, null); - } + ++totalFrozen; } + + int mulPos = -1; + int length = -1; + int extra = 0; + + if (oldTileCount + newTileCount > 0) + { + mulWriter.Seek(0, SeekOrigin.End); + + mulPos = (int)mulWriter.BaseStream.Position; + length = (oldTileCount + newTileCount) * 7; + extra = 1; + + for (int i = 0; i < oldTileCount; ++i) + { + StaticTile toWrite = oldTiles[i]; + + mulWriter.Write((ushort)toWrite.ID); + mulWriter.Write((byte)toWrite.X); + mulWriter.Write((byte)toWrite.Y); + mulWriter.Write((sbyte)toWrite.Z); + mulWriter.Write((short)toWrite.Hue); + } + + for (int i = 0; i < newTileCount; ++i) + { + StaticTile toWrite = newTiles[i]; + + mulWriter.Write((ushort)toWrite.ID); + mulWriter.Write((byte)toWrite.X); + mulWriter.Write((byte)toWrite.Y); + mulWriter.Write((sbyte)toWrite.Z); + mulWriter.Write((short)toWrite.Hue); + } + + mulWriter.Flush(); + } + + int idxPos = (state.m_X * matrix.BlockHeight + state.m_Y) * 12; + + idxWriter.Seek(idxPos, SeekOrigin.Begin); + idxWriter.Write(mulPos); + idxWriter.Write(length); + idxWriter.Write(extra); + + idxWriter.Flush(); + + matrix.SetStaticBlock(state.m_X, state.m_Y, null); } } @@ -351,96 +347,92 @@ namespace Server TileMatrix matrix = map.Tiles; - using (FileStream idxStream = OpenWrite(matrix.IndexStream)) + using FileStream idxStream = OpenWrite(matrix.IndexStream); + using FileStream mulStream = OpenWrite(matrix.DataStream); + if (idxStream == null || mulStream == null) { - using (FileStream mulStream = OpenWrite(matrix.DataStream)) + badDataFile = true; + return; + } + + BinaryReader idxReader = new BinaryReader(idxStream); + + BinaryWriter idxWriter = new BinaryWriter(idxStream); + BinaryWriter mulWriter = new BinaryWriter(mulStream); + + for (int x = xStartBlock; x <= xEndBlock; ++x) + for (int y = yStartBlock; y <= yEndBlock; ++y) + { + StaticTile[] oldTiles = ReadStaticBlock(idxReader, mulStream, x, y, matrix.BlockWidth, + matrix.BlockHeight, out int oldTileCount); + + if (oldTileCount < 0) + continue; + + int newTileCount = 0; + StaticTile[] newTiles = new StaticTile[oldTileCount]; + + int baseX = (x << 3) - xTileStart, baseY = (y << 3) - yTileStart; + + for (int i = 0; i < oldTileCount; ++i) { - if (idxStream == null || mulStream == null) + StaticTile oldTile = oldTiles[i]; + + int px = baseX + oldTile.X; + int py = baseY + oldTile.Y; + + if (px < 0 || px >= xTileWidth || py < 0 || py >= yTileHeight) { - badDataFile = true; - return; + newTiles[newTileCount++] = oldTile; } - - BinaryReader idxReader = new BinaryReader(idxStream); - - BinaryWriter idxWriter = new BinaryWriter(idxStream); - BinaryWriter mulWriter = new BinaryWriter(mulStream); - - for (int x = xStartBlock; x <= xEndBlock; ++x) - for (int y = yStartBlock; y <= yEndBlock; ++y) + else { - StaticTile[] oldTiles = ReadStaticBlock(idxReader, mulStream, x, y, matrix.BlockWidth, - matrix.BlockHeight, out int oldTileCount); + ++totalUnfrozen; - if (oldTileCount < 0) - continue; + Item item = new Static(oldTile.ID); - int newTileCount = 0; - StaticTile[] newTiles = new StaticTile[oldTileCount]; + item.Hue = oldTile.Hue; - int baseX = (x << 3) - xTileStart, baseY = (y << 3) - yTileStart; - - for (int i = 0; i < oldTileCount; ++i) - { - StaticTile oldTile = oldTiles[i]; - - int px = baseX + oldTile.X; - int py = baseY + oldTile.Y; - - if (px < 0 || px >= xTileWidth || py < 0 || py >= yTileHeight) - { - newTiles[newTileCount++] = oldTile; - } - else - { - ++totalUnfrozen; - - Item item = new Static(oldTile.ID); - - item.Hue = oldTile.Hue; - - item.MoveToWorld(new Point3D(px + xTileStart, py + yTileStart, oldTile.Z), map); - } - } - - int mulPos = -1; - int length = -1; - int extra = 0; - - if (newTileCount > 0) - { - mulWriter.Seek(0, SeekOrigin.End); - - mulPos = (int)mulWriter.BaseStream.Position; - length = newTileCount * 7; - extra = 1; - - for (int i = 0; i < newTileCount; ++i) - { - StaticTile toWrite = newTiles[i]; - - mulWriter.Write((ushort)toWrite.ID); - mulWriter.Write((byte)toWrite.X); - mulWriter.Write((byte)toWrite.Y); - mulWriter.Write((sbyte)toWrite.Z); - mulWriter.Write((short)toWrite.Hue); - } - - mulWriter.Flush(); - } - - int idxPos = (x * matrix.BlockHeight + y) * 12; - - idxWriter.Seek(idxPos, SeekOrigin.Begin); - idxWriter.Write(mulPos); - idxWriter.Write(length); - idxWriter.Write(extra); - - idxWriter.Flush(); - - matrix.SetStaticBlock(x, y, null); + item.MoveToWorld(new Point3D(px + xTileStart, py + yTileStart, oldTile.Z), map); } } + + int mulPos = -1; + int length = -1; + int extra = 0; + + if (newTileCount > 0) + { + mulWriter.Seek(0, SeekOrigin.End); + + mulPos = (int)mulWriter.BaseStream.Position; + length = newTileCount * 7; + extra = 1; + + for (int i = 0; i < newTileCount; ++i) + { + StaticTile toWrite = newTiles[i]; + + mulWriter.Write((ushort)toWrite.ID); + mulWriter.Write((byte)toWrite.X); + mulWriter.Write((byte)toWrite.Y); + mulWriter.Write((sbyte)toWrite.Z); + mulWriter.Write((short)toWrite.Hue); + } + + mulWriter.Flush(); + } + + int idxPos = (x * matrix.BlockHeight + y) * 12; + + idxWriter.Seek(idxPos, SeekOrigin.Begin); + idxWriter.Write(mulPos); + idxWriter.Write(length); + idxWriter.Write(extra); + + idxWriter.Flush(); + + matrix.SetStaticBlock(x, y, null); } } diff --git a/Projects/Scripts/Context Menus/AddToSpellbookEntry.cs b/Projects/Scripts/Context Menus/AddToSpellbookEntry.cs index 434f7186a..18d1e0b35 100644 --- a/Projects/Scripts/Context Menus/AddToSpellbookEntry.cs +++ b/Projects/Scripts/Context Menus/AddToSpellbookEntry.cs @@ -20,10 +20,7 @@ namespace Server.ContextMenus { private SpellScroll m_Scroll; - public InternalTarget(SpellScroll scroll) : base(3, false, TargetFlags.None) - { - m_Scroll = scroll; - } + public InternalTarget(SpellScroll scroll) : base(3, false, TargetFlags.None) => m_Scroll = scroll; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Context Menus/OpenBankEntry.cs b/Projects/Scripts/Context Menus/OpenBankEntry.cs index 35b1a4dad..a58153bae 100644 --- a/Projects/Scripts/Context Menus/OpenBankEntry.cs +++ b/Projects/Scripts/Context Menus/OpenBankEntry.cs @@ -4,10 +4,7 @@ namespace Server.ContextMenus { private Mobile m_Banker; - public OpenBankEntry(Mobile from, Mobile banker) : base(6105, 12) - { - m_Banker = banker; - } + public OpenBankEntry(Mobile from, Mobile banker) : base(6105, 12) => m_Banker = banker; public override void OnClick() { diff --git a/Projects/Scripts/Engines/BulkOrders/BODTarget.cs b/Projects/Scripts/Engines/BulkOrders/BODTarget.cs index e443b0702..71b6e9625 100644 --- a/Projects/Scripts/Engines/BulkOrders/BODTarget.cs +++ b/Projects/Scripts/Engines/BulkOrders/BODTarget.cs @@ -6,10 +6,7 @@ namespace Server.Engines.BulkOrders { private BaseBOD m_Deed; - public BODTarget(BaseBOD deed) : base(18, false, TargetFlags.None) - { - m_Deed = deed; - } + public BODTarget(BaseBOD deed) : base(18, false, TargetFlags.None) => m_Deed = deed; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Engines/BulkOrders/Books/BulkOrderBook.cs b/Projects/Scripts/Engines/BulkOrders/Books/BulkOrderBook.cs index e022fb799..e73315712 100644 --- a/Projects/Scripts/Engines/BulkOrders/Books/BulkOrderBook.cs +++ b/Projects/Scripts/Engines/BulkOrders/Books/BulkOrderBook.cs @@ -8,61 +8,61 @@ using Server.Items; namespace Server.Engines.BulkOrders { - public class BulkOrderBook : Item, ISecurable - { - private string m_BookName; + public class BulkOrderBook : Item, ISecurable + { + private string m_BookName; - [CommandProperty( AccessLevel.GameMaster )] - public string BookName - { - get => m_BookName; - set{ m_BookName = value; InvalidateProperties(); } - } + [CommandProperty( AccessLevel.GameMaster )] + public string BookName + { + get => m_BookName; + set{ m_BookName = value; InvalidateProperties(); } + } - [CommandProperty( AccessLevel.GameMaster )] - public SecureLevel Level { get; set; } + [CommandProperty( AccessLevel.GameMaster )] + public SecureLevel Level { get; set; } - public List Entries { get; private set; } + public List Entries { get; private set; } - public BOBFilter Filter { get; private set; } + public BOBFilter Filter { get; private set; } - public int ItemCount { get; set; } + public int ItemCount { get; set; } - [Constructible] - public BulkOrderBook() : base( 0x2259 ) - { - Weight = 1.0; - LootType = LootType.Blessed; + [Constructible] + public BulkOrderBook() : base( 0x2259 ) + { + Weight = 1.0; + LootType = LootType.Blessed; - Entries = new List(); - Filter = new BOBFilter(); + Entries = new List(); + Filter = new BOBFilter(); - Level = SecureLevel.CoOwners; - } + Level = SecureLevel.CoOwners; + } - public override void OnDoubleClick( Mobile from ) - { - if ( !from.InRange( GetWorldLocation(), 2 ) ) - from.LocalOverheadMessage( Network.MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. - else if ( Entries.Count == 0 ) - from.SendLocalizedMessage( 1062381 ); // The book is empty. - else if ( from is PlayerMobile mobile ) - mobile.SendGump( new BOBGump( mobile, this ) ); - } + public override void OnDoubleClick( Mobile from ) + { + if ( !from.InRange( GetWorldLocation(), 2 ) ) + from.LocalOverheadMessage( Network.MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. + else if ( Entries.Count == 0 ) + from.SendLocalizedMessage( 1062381 ); // The book is empty. + else if ( from is PlayerMobile mobile ) + mobile.SendGump( new BOBGump( mobile, this ) ); + } - public override void OnDoubleClickSecureTrade( Mobile from ) - { - if ( !from.InRange( GetWorldLocation(), 2 ) ) - { - from.SendLocalizedMessage( 500446 ); // That is too far away. - } - else if ( Entries.Count == 0 ) - { - from.SendLocalizedMessage( 1062381 ); // The book is empty. - } - else - { - from.SendGump( new BOBGump( (PlayerMobile)from, this ) ); + public override void OnDoubleClickSecureTrade( Mobile from ) + { + if ( !from.InRange( GetWorldLocation(), 2 ) ) + { + from.SendLocalizedMessage( 500446 ); // That is too far away. + } + else if ( Entries.Count == 0 ) + { + from.SendLocalizedMessage( 1062381 ); // The book is empty. + } + else + { + from.SendGump( new BOBGump( (PlayerMobile)from, this ) ); SecureTrade trade = GetSecureTradeCont()?.Trade; @@ -70,239 +70,236 @@ namespace Server.Engines.BulkOrders trade.To.Mobile.SendGump( new BOBGump( (PlayerMobile)trade.To.Mobile, this ) ); else if (trade?.To.Mobile == from ) trade.From.Mobile.SendGump( new BOBGump( (PlayerMobile)trade.From.Mobile, this ) ); - } - } + } + } - public override bool OnDragDrop( Mobile from, Item dropped ) - { - if ( dropped is BaseBOD ) - { - if ( !IsChildOf( from.Backpack ) ) - { - from.SendLocalizedMessage( 1062385 ); // You must have the book in your backpack to add deeds to it. - return false; - } - if ( !from.Backpack.CheckHold( from, dropped, true, true ) ) - return false; - if ( Entries.Count < 500 ) - { - if ( dropped is LargeBOD bod ) - Entries.Add( new BOBLargeEntry( bod ) ); - else - Entries.Add( new BOBSmallEntry( (SmallBOD)dropped ) ); + public override bool OnDragDrop( Mobile from, Item dropped ) + { + if ( dropped is BaseBOD ) + { + if ( !IsChildOf( from.Backpack ) ) + { + from.SendLocalizedMessage( 1062385 ); // You must have the book in your backpack to add deeds to it. + return false; + } + if ( !from.Backpack.CheckHold( from, dropped, true, true ) ) + return false; + if ( Entries.Count < 500 ) + { + if ( dropped is LargeBOD bod ) + Entries.Add( new BOBLargeEntry( bod ) ); + else + Entries.Add( new BOBSmallEntry( (SmallBOD)dropped ) ); - InvalidateProperties(); + InvalidateProperties(); - if ( Entries.Count / 5 > ItemCount ) - { - ItemCount++; - InvalidateItems(); - } + if ( Entries.Count / 5 > ItemCount ) + { + ItemCount++; + InvalidateItems(); + } - from.SendSound(0x42, GetWorldLocation()); - from.SendLocalizedMessage( 1062386 ); // Deed added to book. + from.SendSound(0x42, GetWorldLocation()); + from.SendLocalizedMessage( 1062386 ); // Deed added to book. - if ( from is PlayerMobile pm ) - pm.SendGump( new BOBGump( pm, this ) ); + if ( from is PlayerMobile pm ) + pm.SendGump( new BOBGump( pm, this ) ); - dropped.Delete(); + dropped.Delete(); - return true; - } + return true; + } - from.SendLocalizedMessage( 1062387 ); // The book is full of deeds. - return false; - } + from.SendLocalizedMessage( 1062387 ); // The book is full of deeds. + return false; + } - from.SendLocalizedMessage( 1062388 ); // That is not a bulk order deed. - return false; - } + from.SendLocalizedMessage( 1062388 ); // That is not a bulk order deed. + return false; + } - public override int GetTotal( TotalType type ) - { - int total = base.GetTotal( type ); + public override int GetTotal( TotalType type ) + { + int total = base.GetTotal( type ); - if ( type == TotalType.Items ) - total = ItemCount; + if ( type == TotalType.Items ) + total = ItemCount; - return total; - } + return total; + } - public void InvalidateItems() - { - if ( RootParent is Mobile m ) - { - m.UpdateTotals(); - InvalidateContainers( Parent ); - } - } + public void InvalidateItems() + { + if ( RootParent is Mobile m ) + { + m.UpdateTotals(); + InvalidateContainers( Parent ); + } + } - public void InvalidateContainers(IEntity parent) - { - if ( parent is Container c ) - { - c.InvalidateProperties(); - InvalidateContainers( c.Parent ); - } - } + public void InvalidateContainers(IEntity parent) + { + if ( parent is Container c ) + { + c.InvalidateProperties(); + InvalidateContainers( c.Parent ); + } + } - public BulkOrderBook( Serial serial ) : base( serial ) - { - } + public BulkOrderBook( Serial serial ) : base( serial ) + { + } - public override void Serialize( GenericWriter writer ) - { - base.Serialize( writer ); + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); - writer.Write( 2 ); // version + writer.Write( 2 ); // version - writer.Write( ItemCount ); + writer.Write( ItemCount ); - writer.Write( (int) Level ); + writer.Write( (int) Level ); - writer.Write( m_BookName ); + writer.Write( m_BookName ); - Filter.Serialize( writer ); + Filter.Serialize( writer ); - writer.WriteEncodedInt( Entries.Count ); + writer.WriteEncodedInt( Entries.Count ); - for ( int i = 0; i < Entries.Count; ++i ) - { - object obj = Entries[i]; + for ( int i = 0; i < Entries.Count; ++i ) + { + object obj = Entries[i]; - if ( obj is BOBLargeEntry entry ) - { - writer.WriteEncodedInt( 0 ); - entry.Serialize( writer ); - } - else - { - writer.WriteEncodedInt( 1 ); - ((BOBSmallEntry)obj).Serialize( writer ); - } - } - } + if ( obj is BOBLargeEntry entry ) + { + writer.WriteEncodedInt( 0 ); + entry.Serialize( writer ); + } + else + { + writer.WriteEncodedInt( 1 ); + ((BOBSmallEntry)obj).Serialize( writer ); + } + } + } - public override void Deserialize( GenericReader reader ) - { - base.Deserialize( reader ); + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); - int version = reader.ReadInt(); + int version = reader.ReadInt(); - switch ( version ) - { - case 2: - { - ItemCount = reader.ReadInt(); - goto case 1; - } - case 1: - { - Level = (SecureLevel)reader.ReadInt(); - goto case 0; - } - case 0: - { - m_BookName = reader.ReadString(); + switch ( version ) + { + case 2: + { + ItemCount = reader.ReadInt(); + goto case 1; + } + case 1: + { + Level = (SecureLevel)reader.ReadInt(); + goto case 0; + } + case 0: + { + m_BookName = reader.ReadString(); - Filter = new BOBFilter( reader ); + Filter = new BOBFilter( reader ); - int count = reader.ReadEncodedInt(); + int count = reader.ReadEncodedInt(); - Entries = new List( count ); + Entries = new List( count ); - for ( int i = 0; i < count; ++i ) - { - int v = reader.ReadEncodedInt(); + for ( int i = 0; i < count; ++i ) + { + int v = reader.ReadEncodedInt(); - switch ( v ) - { - case 0: Entries.Add( new BOBLargeEntry( reader ) ); break; - case 1: Entries.Add( new BOBSmallEntry( reader ) ); break; - } - } + switch ( v ) + { + case 0: Entries.Add( new BOBLargeEntry( reader ) ); break; + case 1: Entries.Add( new BOBSmallEntry( reader ) ); break; + } + } - break; - } - } - } + break; + } + } + } - public override void GetProperties( ObjectPropertyList list ) - { - base.GetProperties( list ); + public override void GetProperties( ObjectPropertyList list ) + { + base.GetProperties( list ); - list.Add( 1062344, Entries.Count.ToString() ); // Deeds in book: ~1_val~ + list.Add( 1062344, Entries.Count.ToString() ); // Deeds in book: ~1_val~ - if ( !string.IsNullOrEmpty(m_BookName) ) - list.Add( 1062481, m_BookName ); // Book Name: ~1_val~ - } + if ( !string.IsNullOrEmpty(m_BookName) ) + list.Add( 1062481, m_BookName ); // Book Name: ~1_val~ + } - public override void OnSingleClick(Mobile from) - { - base.OnSingleClick(from); + public override void OnSingleClick(Mobile from) + { + base.OnSingleClick(from); - LabelTo(from, 1062344, Entries.Count.ToString()); // Deeds in book: ~1_val~ + LabelTo(from, 1062344, Entries.Count.ToString()); // Deeds in book: ~1_val~ - if (!string.IsNullOrEmpty(m_BookName)) - LabelTo(from, 1062481, m_BookName); - } + if (!string.IsNullOrEmpty(m_BookName)) + LabelTo(from, 1062481, m_BookName); + } - public override void GetContextMenuEntries( Mobile from, List list ) - { - base.GetContextMenuEntries( from, list ); + public override void GetContextMenuEntries( Mobile from, List list ) + { + base.GetContextMenuEntries( from, list ); - if ( from.CheckAlive() && IsChildOf( from.Backpack ) ) - list.Add( new NameBookEntry( from, this ) ); + if ( from.CheckAlive() && IsChildOf( from.Backpack ) ) + list.Add( new NameBookEntry( from, this ) ); - SetSecureLevelEntry.AddTo( from, this, list ); - } + SetSecureLevelEntry.AddTo( from, this, list ); + } - private class NameBookEntry : ContextMenuEntry - { - private Mobile m_From; - private BulkOrderBook m_Book; + private class NameBookEntry : ContextMenuEntry + { + private Mobile m_From; + private BulkOrderBook m_Book; - public NameBookEntry( Mobile from, BulkOrderBook book ) : base( 6216 ) - { - m_From = from; - m_Book = book; - } + public NameBookEntry( Mobile from, BulkOrderBook book ) : base( 6216 ) + { + m_From = from; + m_Book = book; + } - public override void OnClick() - { - if ( m_From.CheckAlive() && m_Book.IsChildOf( m_From.Backpack ) ) - { - m_From.Prompt = new NameBookPrompt( m_Book ); - m_From.SendLocalizedMessage( 1062479 ); // Type in the new name of the book: - } - } - } + public override void OnClick() + { + if ( m_From.CheckAlive() && m_Book.IsChildOf( m_From.Backpack ) ) + { + m_From.Prompt = new NameBookPrompt( m_Book ); + m_From.SendLocalizedMessage( 1062479 ); // Type in the new name of the book: + } + } + } - private class NameBookPrompt : Prompt - { - private BulkOrderBook m_Book; + private class NameBookPrompt : Prompt + { + private BulkOrderBook m_Book; - public NameBookPrompt( BulkOrderBook book ) - { - m_Book = book; - } + public NameBookPrompt( BulkOrderBook book ) => m_Book = book; - public override void OnResponse( Mobile from, string text ) - { - if ( text.Length > 40 ) - text = text.Substring( 0, 40 ); + public override void OnResponse( Mobile from, string text ) + { + if ( text.Length > 40 ) + text = text.Substring( 0, 40 ); - if ( from.CheckAlive() && m_Book.IsChildOf( from.Backpack ) ) - { - m_Book.BookName = Utility.FixHtml( text.Trim() ); + if ( from.CheckAlive() && m_Book.IsChildOf( from.Backpack ) ) + { + m_Book.BookName = Utility.FixHtml( text.Trim() ); - from.SendLocalizedMessage( 1062480 ); // The bulk order book's name has been changed. - } - } + from.SendLocalizedMessage( 1062480 ); // The bulk order book's name has been changed. + } + } - public override void OnCancel( Mobile from ) - { - } - } - } + public override void OnCancel( Mobile from ) + { + } + } + } } diff --git a/Projects/Scripts/Engines/BulkOrders/LargeBOD.cs b/Projects/Scripts/Engines/BulkOrders/LargeBOD.cs index ce4eb99b7..3beec2c4a 100644 --- a/Projects/Scripts/Engines/BulkOrders/LargeBOD.cs +++ b/Projects/Scripts/Engines/BulkOrders/LargeBOD.cs @@ -28,10 +28,8 @@ namespace Server.Engines.BulkOrders public override int LabelNumber => 1045151; // a bulk order deed public LargeBOD(int hue, int amountMax, bool requireExeptional, BulkMaterialType material, LargeBulkEntry[] entries) : - base(hue, amountMax, requireExeptional, material) - { - m_Entries = entries; - } + base(hue, amountMax, requireExeptional, material) => + m_Entries = entries; public LargeBOD() { diff --git a/Projects/Scripts/Engines/BulkOrders/LargeBulkEntry.cs b/Projects/Scripts/Engines/BulkOrders/LargeBulkEntry.cs index 37c884a0e..77b4aebd2 100644 --- a/Projects/Scripts/Engines/BulkOrders/LargeBulkEntry.cs +++ b/Projects/Scripts/Engines/BulkOrders/LargeBulkEntry.cs @@ -3,118 +3,118 @@ using System.Collections.Generic; namespace Server.Engines.BulkOrders { - public class LargeBulkEntry - { - private int m_Amount; + public class LargeBulkEntry + { + private int m_Amount; - public LargeBOD Owner { get; set; } + public LargeBOD Owner { get; set; } - public int Amount + public int Amount { get => m_Amount; - set{ m_Amount = value; Owner?.InvalidateProperties(); } + set{ m_Amount = value; Owner?.InvalidateProperties(); } } - public SmallBulkEntry Details { get; } + public SmallBulkEntry Details { get; } - public static SmallBulkEntry[] LargeRing => GetEntries( "Blacksmith", "largering" ); + public static SmallBulkEntry[] LargeRing => GetEntries( "Blacksmith", "largering" ); - public static SmallBulkEntry[] LargePlate => GetEntries( "Blacksmith", "largeplate" ); + public static SmallBulkEntry[] LargePlate => GetEntries( "Blacksmith", "largeplate" ); - public static SmallBulkEntry[] LargeChain => GetEntries( "Blacksmith", "largechain" ); + public static SmallBulkEntry[] LargeChain => GetEntries( "Blacksmith", "largechain" ); - public static SmallBulkEntry[] LargeAxes => GetEntries( "Blacksmith", "largeaxes" ); + public static SmallBulkEntry[] LargeAxes => GetEntries( "Blacksmith", "largeaxes" ); - public static SmallBulkEntry[] LargeFencing => GetEntries( "Blacksmith", "largefencing" ); + public static SmallBulkEntry[] LargeFencing => GetEntries( "Blacksmith", "largefencing" ); - public static SmallBulkEntry[] LargeMaces => GetEntries( "Blacksmith", "largemaces" ); + public static SmallBulkEntry[] LargeMaces => GetEntries( "Blacksmith", "largemaces" ); - public static SmallBulkEntry[] LargePolearms => GetEntries( "Blacksmith", "largepolearms" ); + public static SmallBulkEntry[] LargePolearms => GetEntries( "Blacksmith", "largepolearms" ); - public static SmallBulkEntry[] LargeSwords => GetEntries( "Blacksmith", "largeswords" ); + public static SmallBulkEntry[] LargeSwords => GetEntries( "Blacksmith", "largeswords" ); - public static SmallBulkEntry[] BoneSet => GetEntries( "Tailoring", "boneset" ); + public static SmallBulkEntry[] BoneSet => GetEntries( "Tailoring", "boneset" ); - public static SmallBulkEntry[] Farmer => GetEntries( "Tailoring", "farmer" ); + public static SmallBulkEntry[] Farmer => GetEntries( "Tailoring", "farmer" ); - public static SmallBulkEntry[] FemaleLeatherSet => GetEntries( "Tailoring", "femaleleatherset" ); + public static SmallBulkEntry[] FemaleLeatherSet => GetEntries( "Tailoring", "femaleleatherset" ); - public static SmallBulkEntry[] FisherGirl => GetEntries( "Tailoring", "fishergirl" ); + public static SmallBulkEntry[] FisherGirl => GetEntries( "Tailoring", "fishergirl" ); - public static SmallBulkEntry[] Gypsy => GetEntries( "Tailoring", "gypsy" ); + public static SmallBulkEntry[] Gypsy => GetEntries( "Tailoring", "gypsy" ); - public static SmallBulkEntry[] HatSet => GetEntries( "Tailoring", "hatset" ); + public static SmallBulkEntry[] HatSet => GetEntries( "Tailoring", "hatset" ); - public static SmallBulkEntry[] Jester => GetEntries( "Tailoring", "jester" ); + public static SmallBulkEntry[] Jester => GetEntries( "Tailoring", "jester" ); - public static SmallBulkEntry[] Lady => GetEntries( "Tailoring", "lady" ); + public static SmallBulkEntry[] Lady => GetEntries( "Tailoring", "lady" ); - public static SmallBulkEntry[] MaleLeatherSet => GetEntries( "Tailoring", "maleleatherset" ); + public static SmallBulkEntry[] MaleLeatherSet => GetEntries( "Tailoring", "maleleatherset" ); - public static SmallBulkEntry[] Pirate => GetEntries( "Tailoring", "pirate" ); + public static SmallBulkEntry[] Pirate => GetEntries( "Tailoring", "pirate" ); - public static SmallBulkEntry[] ShoeSet => GetEntries( "Tailoring", "shoeset" ); + public static SmallBulkEntry[] ShoeSet => GetEntries( "Tailoring", "shoeset" ); - public static SmallBulkEntry[] StuddedSet => GetEntries( "Tailoring", "studdedset" ); + public static SmallBulkEntry[] StuddedSet => GetEntries( "Tailoring", "studdedset" ); - public static SmallBulkEntry[] TownCrier => GetEntries( "Tailoring", "towncrier" ); + public static SmallBulkEntry[] TownCrier => GetEntries( "Tailoring", "towncrier" ); - public static SmallBulkEntry[] Wizard => GetEntries( "Tailoring", "wizard" ); + public static SmallBulkEntry[] Wizard => GetEntries( "Tailoring", "wizard" ); - private static Dictionary> m_Cache; + private static Dictionary> m_Cache; - public static SmallBulkEntry[] GetEntries( string type, string name ) - { - if (m_Cache == null) - m_Cache = new Dictionary>(); + public static SmallBulkEntry[] GetEntries( string type, string name ) + { + if (m_Cache == null) + m_Cache = new Dictionary>(); - if (!m_Cache.TryGetValue( type, out Dictionary table )) - m_Cache[type] = table = new Dictionary(); + if (!m_Cache.TryGetValue( type, out Dictionary table )) + m_Cache[type] = table = new Dictionary(); - if (!table.TryGetValue( name, out SmallBulkEntry[] entries )) - table[name] = entries = SmallBulkEntry.LoadEntries(type, name); + if (!table.TryGetValue( name, out SmallBulkEntry[] entries )) + table[name] = entries = SmallBulkEntry.LoadEntries(type, name); - return entries; - } + return entries; + } - public static LargeBulkEntry[] ConvertEntries( LargeBOD owner, SmallBulkEntry[] small ) - { - LargeBulkEntry[] large = new LargeBulkEntry[small.Length]; + public static LargeBulkEntry[] ConvertEntries( LargeBOD owner, SmallBulkEntry[] small ) + { + LargeBulkEntry[] large = new LargeBulkEntry[small.Length]; - for ( int i = 0; i < small.Length; ++i ) - large[i] = new LargeBulkEntry( owner, small[i] ); + for ( int i = 0; i < small.Length; ++i ) + large[i] = new LargeBulkEntry( owner, small[i] ); - return large; - } + return large; + } - public LargeBulkEntry( LargeBOD owner, SmallBulkEntry details ) - { - Owner = owner; - Details = details; - } + public LargeBulkEntry( LargeBOD owner, SmallBulkEntry details ) + { + Owner = owner; + Details = details; + } - public LargeBulkEntry( LargeBOD owner, GenericReader reader ) - { - Owner = owner; - m_Amount = reader.ReadInt(); + public LargeBulkEntry( LargeBOD owner, GenericReader reader ) + { + Owner = owner; + m_Amount = reader.ReadInt(); - Type realType = null; + Type realType = null; - string type = reader.ReadString(); + string type = reader.ReadString(); - if ( type != null ) - realType = AssemblyHandler.FindTypeByFullName( type ); + if ( type != null ) + realType = AssemblyHandler.FindTypeByFullName( type ); - Details = new SmallBulkEntry( realType, reader.ReadInt(), reader.ReadInt() ); - } + Details = new SmallBulkEntry( realType, reader.ReadInt(), reader.ReadInt() ); + } - public void Serialize( GenericWriter writer ) - { - writer.Write( m_Amount ); - writer.Write( Details.Type == null ? null : Details.Type.FullName ); - writer.Write( Details.Number ); - writer.Write( Details.Graphic ); - } - } + public void Serialize( GenericWriter writer ) + { + writer.Write( m_Amount ); + writer.Write( Details.Type == null ? null : Details.Type.FullName ); + writer.Write( Details.Number ); + writer.Write( Details.Graphic ); + } + } } diff --git a/Projects/Scripts/Engines/BulkOrders/LargeTailorBOD.cs b/Projects/Scripts/Engines/BulkOrders/LargeTailorBOD.cs index bb78b8ad4..8cb608427 100644 --- a/Projects/Scripts/Engines/BulkOrders/LargeTailorBOD.cs +++ b/Projects/Scripts/Engines/BulkOrders/LargeTailorBOD.cs @@ -91,15 +91,9 @@ namespace Server.Engines.BulkOrders { } - public override int ComputeFame() - { - return TailorRewardCalculator.Instance.ComputeFame(this); - } + public override int ComputeFame() => TailorRewardCalculator.Instance.ComputeFame(this); - public override int ComputeGold() - { - return TailorRewardCalculator.Instance.ComputeGold(this); - } + public override int ComputeGold() => TailorRewardCalculator.Instance.ComputeGold(this); public override RewardGroup GetRewardGroup() => TailorRewardCalculator.Instance.LookupRewards(TailorRewardCalculator.Instance.ComputePoints(this)); diff --git a/Projects/Scripts/Engines/BulkOrders/Rewards.cs b/Projects/Scripts/Engines/BulkOrders/Rewards.cs index 66a3282b4..81f6dc9ba 100644 --- a/Projects/Scripts/Engines/BulkOrders/Rewards.cs +++ b/Projects/Scripts/Engines/BulkOrders/Rewards.cs @@ -116,27 +116,17 @@ namespace Server.Engines.BulkOrders return points * points; } - public virtual int ComputePoints(SmallBOD bod) - { - return ComputePoints(bod.AmountMax, bod.RequireExceptional, bod.Material, 1, bod.Type); - } + public virtual int ComputePoints(SmallBOD bod) => ComputePoints(bod.AmountMax, bod.RequireExceptional, bod.Material, 1, bod.Type); - public virtual int ComputePoints(LargeBOD bod) - { - return ComputePoints(bod.AmountMax, bod.RequireExceptional, bod.Material, bod.Entries.Length, + public virtual int ComputePoints(LargeBOD bod) => + ComputePoints(bod.AmountMax, bod.RequireExceptional, bod.Material, bod.Entries.Length, bod.Entries[0].Details.Type); - } - public virtual int ComputeGold(SmallBOD bod) - { - return ComputeGold(bod.AmountMax, bod.RequireExceptional, bod.Material, 1, bod.Type); - } + public virtual int ComputeGold(SmallBOD bod) => ComputeGold(bod.AmountMax, bod.RequireExceptional, bod.Material, 1, bod.Type); - public virtual int ComputeGold(LargeBOD bod) - { - return ComputeGold(bod.AmountMax, bod.RequireExceptional, bod.Material, bod.Entries.Length, + public virtual int ComputeGold(LargeBOD bod) => + ComputeGold(bod.AmountMax, bod.RequireExceptional, bod.Material, bod.Entries.Length, bod.Entries[0].Details.Type); - } public virtual RewardGroup LookupRewards(int points) { @@ -385,15 +375,9 @@ namespace Server.Engines.BulkOrders #region Constructors - private static Item CreateSturdyShovel(int type) - { - return new SturdyShovel(); - } + private static Item CreateSturdyShovel(int type) => new SturdyShovel(); - private static Item CreateSturdyPickaxe(int type) - { - return new SturdyPickaxe(); - } + private static Item CreateSturdyPickaxe(int type) => new SturdyPickaxe(); private static Item CreateMiningGloves(int type) { @@ -410,20 +394,11 @@ namespace Server.Engines.BulkOrders } } - private static Item CreateGargoylesPickaxe(int type) - { - return new GargoylesPickaxe(); - } + private static Item CreateGargoylesPickaxe(int type) => new GargoylesPickaxe(); - private static Item CreateProspectorsTool(int type) - { - return new ProspectorsTool(); - } + private static Item CreateProspectorsTool(int type) => new ProspectorsTool(); - private static Item CreatePowderOfTemperament(int type) - { - return new PowderOfTemperament(); - } + private static Item CreatePowderOfTemperament(int type) => new PowderOfTemperament(); private static Item CreateRunicHammer(int type) { @@ -441,13 +416,7 @@ namespace Server.Engines.BulkOrders throw new InvalidOperationException(); } - private static Item CreateColoredAnvil(int type) - { - // Generate an anvil deed, not an actual anvil. - //return new ColoredAnvilDeed(); - - return new ColoredAnvil(); - } + private static Item CreateColoredAnvil(int type) => new ColoredAnvil(); private static Item CreateAncientHammer(int type) { @@ -678,10 +647,7 @@ namespace Server.Engines.BulkOrders 0x484, 0x497 }; - private static Item CreateSandals(int type) - { - return new Sandals(m_SandalHues[Utility.Random(m_SandalHues.Length)]); - } + private static Item CreateSandals(int type) => new Sandals(m_SandalHues[Utility.Random(m_SandalHues.Length)]); private static Item CreateStretchedHide(int type) { @@ -735,10 +701,7 @@ namespace Server.Engines.BulkOrders throw new InvalidOperationException(); } - private static Item CreateCBD(int type) - { - return new ClothingBlessDeed(); - } + private static Item CreateCBD(int type) => new ClothingBlessDeed(); #endregion } diff --git a/Projects/Scripts/Engines/BulkOrders/SmallBulkEntry.cs b/Projects/Scripts/Engines/BulkOrders/SmallBulkEntry.cs index d9b5b3e6c..35bbd80c4 100644 --- a/Projects/Scripts/Engines/BulkOrders/SmallBulkEntry.cs +++ b/Projects/Scripts/Engines/BulkOrders/SmallBulkEntry.cs @@ -4,89 +4,84 @@ using System.IO; namespace Server.Engines.BulkOrders { - public class SmallBulkEntry - { - public Type Type { get; } + public class SmallBulkEntry + { + public Type Type { get; } - public int Number { get; } + public int Number { get; } - public int Graphic { get; } + public int Graphic { get; } - public SmallBulkEntry( Type type, int number, int graphic ) - { - Type = type; - Number = number; - Graphic = graphic; - } + public SmallBulkEntry( Type type, int number, int graphic ) + { + Type = type; + Number = number; + Graphic = graphic; + } - public static SmallBulkEntry[] BlacksmithWeapons => GetEntries( "Blacksmith", "weapons" ); + public static SmallBulkEntry[] BlacksmithWeapons => GetEntries( "Blacksmith", "weapons" ); - public static SmallBulkEntry[] BlacksmithArmor => GetEntries( "Blacksmith", "armor" ); + public static SmallBulkEntry[] BlacksmithArmor => GetEntries( "Blacksmith", "armor" ); - public static SmallBulkEntry[] TailorCloth => GetEntries( "Tailoring", "cloth" ); + public static SmallBulkEntry[] TailorCloth => GetEntries( "Tailoring", "cloth" ); - public static SmallBulkEntry[] TailorLeather => GetEntries( "Tailoring", "leather" ); + public static SmallBulkEntry[] TailorLeather => GetEntries( "Tailoring", "leather" ); - private static Dictionary> m_Cache; + private static Dictionary> m_Cache; - public static SmallBulkEntry[] GetEntries( string type, string name ) - { - if ( m_Cache == null ) - m_Cache = new Dictionary>(); + public static SmallBulkEntry[] GetEntries( string type, string name ) + { + if ( m_Cache == null ) + m_Cache = new Dictionary>(); - if (!m_Cache.TryGetValue( type, out Dictionary table )) - m_Cache[type] = table = new Dictionary(); + if (!m_Cache.TryGetValue( type, out Dictionary table )) + m_Cache[type] = table = new Dictionary(); - if (!table.TryGetValue( name, out SmallBulkEntry[] entries )) - table[name] = entries = LoadEntries(type, name); + if (!table.TryGetValue( name, out SmallBulkEntry[] entries )) + table[name] = entries = LoadEntries(type, name); - return entries; - } + return entries; + } - public static SmallBulkEntry[] LoadEntries( string type, string name ) - { - return LoadEntries($"Data/Bulk Orders/{type}/{name}.cfg"); - } + public static SmallBulkEntry[] LoadEntries( string type, string name ) => LoadEntries($"Data/Bulk Orders/{type}/{name}.cfg"); - public static SmallBulkEntry[] LoadEntries( string path ) - { - path = Path.Combine( Core.BaseDirectory, path ); + public static SmallBulkEntry[] LoadEntries( string path ) + { + path = Path.Combine( Core.BaseDirectory, path ); - List list = new List(); + List list = new List(); - if ( File.Exists( path ) ) - { - using ( StreamReader ip = new StreamReader( path ) ) - { - string line; + if ( File.Exists( path ) ) + { + using StreamReader ip = new StreamReader( path ); + string line; - while ( (line = ip.ReadLine()) != null ) - { - if ( line.Length == 0 || line.StartsWith( "#" ) ) - continue; + while ( (line = ip.ReadLine()) != null ) + { + if ( line.Length == 0 || line.StartsWith( "#" ) ) + continue; - try - { - string[] split = line.Split( '\t' ); + try + { + string[] split = line.Split( '\t' ); - if ( split.Length >= 2 ) - { - Type type = AssemblyHandler.FindTypeByName( split[0] ); - int graphic = Utility.ToInt32( split[split.Length - 1] ); - - if ( type != null && graphic > 0 ) - list.Add( new SmallBulkEntry( type, graphic < 0x4000 ? 1020000 + graphic : 1078872 + graphic, graphic ) ); - } - } - catch + if ( split.Length >= 2 ) { - // ignored + Type type = AssemblyHandler.FindTypeByName( split[0] ); + int graphic = Utility.ToInt32( split[split.Length - 1] ); + + if ( type != null && graphic > 0 ) + list.Add( new SmallBulkEntry( type, graphic < 0x4000 ? 1020000 + graphic : 1078872 + graphic, graphic ) ); } } - } - } + catch + { + // ignored + } + } + } - return list.ToArray(); - } - } + return list.ToArray(); + } + } } diff --git a/Projects/Scripts/Engines/CannedEvil/ChampionAltar.cs b/Projects/Scripts/Engines/CannedEvil/ChampionAltar.cs index 0a8d89c0f..3fd0ef22e 100644 --- a/Projects/Scripts/Engines/CannedEvil/ChampionAltar.cs +++ b/Projects/Scripts/Engines/CannedEvil/ChampionAltar.cs @@ -6,10 +6,7 @@ namespace Server.Engines.CannedEvil { private ChampionSpawn m_Spawn; - public ChampionAltar(ChampionSpawn spawn) - { - m_Spawn = spawn; - } + public ChampionAltar(ChampionSpawn spawn) => m_Spawn = spawn; public ChampionAltar(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/CannedEvil/ChampionSkullBrazier.cs b/Projects/Scripts/Engines/CannedEvil/ChampionSkullBrazier.cs index ad6becfd4..6991ac13e 100644 --- a/Projects/Scripts/Engines/CannedEvil/ChampionSkullBrazier.cs +++ b/Projects/Scripts/Engines/CannedEvil/ChampionSkullBrazier.cs @@ -170,10 +170,7 @@ namespace Server.Engines.CannedEvil { private ChampionSkullBrazier m_Brazier; - public SacrificeTarget(ChampionSkullBrazier brazier) : base(12, false, TargetFlags.None) - { - m_Brazier = brazier; - } + public SacrificeTarget(ChampionSkullBrazier brazier) : base(12, false, TargetFlags.None) => m_Brazier = brazier; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Engines/CannedEvil/ChampionSkullPlatform.cs b/Projects/Scripts/Engines/CannedEvil/ChampionSkullPlatform.cs index a8166c708..6330117d4 100644 --- a/Projects/Scripts/Engines/CannedEvil/ChampionSkullPlatform.cs +++ b/Projects/Scripts/Engines/CannedEvil/ChampionSkullPlatform.cs @@ -84,10 +84,7 @@ namespace Server.Engines.CannedEvil } } - public bool Validate(ChampionSkullBrazier brazier) - { - return brazier?.Skull?.Deleted == false; - } + public bool Validate(ChampionSkullBrazier brazier) => brazier?.Skull?.Deleted == false; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Engines/CannedEvil/ChampionSpawn.cs b/Projects/Scripts/Engines/CannedEvil/ChampionSpawn.cs index a9e438d0d..976dbfeb2 100644 --- a/Projects/Scripts/Engines/CannedEvil/ChampionSpawn.cs +++ b/Projects/Scripts/Engines/CannedEvil/ChampionSpawn.cs @@ -200,10 +200,7 @@ namespace Server.Engines.CannedEvil */ } - public bool IsChampionSpawn(Mobile m) - { - return m_Creatures.Contains(m); - } + public bool IsChampionSpawn(Mobile m) => m_Creatures.Contains(m); public void SetWhiteSkullCount(int val) { @@ -1008,11 +1005,9 @@ namespace Server.Engines.CannedEvil 1062317); // For your valor in combating the fallen beast, a special artifact has been bestowed on you. } - public bool IsEligible(Mobile m, Item Artifact) - { - return m.Player && m.Alive && m.Region != null && m.Region == m_Region && - m.Backpack?.CheckHold(m, Artifact, false) == true; - } + public bool IsEligible(Mobile m, Item Artifact) => + m.Player && m.Alive && m.Region != null && m.Region == m_Region && + m.Backpack?.CheckHold(m, Artifact, false) == true; public override void Serialize(GenericWriter writer) { @@ -1167,19 +1162,14 @@ namespace Server.Engines.CannedEvil public class ChampionSpawnRegion : BaseRegion { public ChampionSpawnRegion(ChampionSpawn spawn) : base(null, spawn.Map, Find(spawn.Location, spawn.Map), - spawn.SpawnArea) - { + spawn.SpawnArea) => ChampionSpawn = spawn; - } public override bool YoungProtected => false; public ChampionSpawn ChampionSpawn{ get; } - public override bool AllowHousing(Mobile from, Point3D p) - { - return false; - } + public override bool AllowHousing(Mobile from, Point3D p) => false; public override void AlterLightLevel(Mobile m, ref int global, ref int personal) { diff --git a/Projects/Scripts/Engines/CannedEvil/StarRoomGate.cs b/Projects/Scripts/Engines/CannedEvil/StarRoomGate.cs index 31d6db763..87e421280 100644 --- a/Projects/Scripts/Engines/CannedEvil/StarRoomGate.cs +++ b/Projects/Scripts/Engines/CannedEvil/StarRoomGate.cs @@ -85,10 +85,7 @@ namespace Server.Items { private Item m_Item; - public InternalTimer(Item item, DateTime end) : base(end - DateTime.UtcNow) - { - m_Item = item; - } + public InternalTimer(Item item, DateTime end) : base(end - DateTime.UtcNow) => m_Item = item; protected override void OnTick() { diff --git a/Projects/Scripts/Engines/Chat/Channel.cs b/Projects/Scripts/Engines/Chat/Channel.cs index 9a88aa369..bc1a54ba8 100644 --- a/Projects/Scripts/Engines/Chat/Channel.cs +++ b/Projects/Scripts/Engines/Chat/Channel.cs @@ -19,10 +19,7 @@ namespace Server.Engines.Chat m_Voices = new List(); } - public Channel(string name, string password) : this(name) - { - m_Password = password; - } + public Channel(string name, string password) : this(name) => m_Password = password; public string Name { @@ -73,35 +70,17 @@ namespace Server.Engines.Chat public static List Channels{ get; } = new List(); - public bool Contains(ChatUser user) - { - return m_Users.Contains(user); - } + public bool Contains(ChatUser user) => m_Users.Contains(user); - public bool IsBanned(ChatUser user) - { - return m_Banned.Contains(user); - } + public bool IsBanned(ChatUser user) => m_Banned.Contains(user); - public bool CanTalk(ChatUser user) - { - return !m_VoiceRestricted || m_Voices.Contains(user) || m_Moderators.Contains(user); - } + public bool CanTalk(ChatUser user) => !m_VoiceRestricted || m_Voices.Contains(user) || m_Moderators.Contains(user); - public bool IsModerator(ChatUser user) - { - return m_Moderators.Contains(user); - } + public bool IsModerator(ChatUser user) => m_Moderators.Contains(user); - public bool IsVoiced(ChatUser user) - { - return m_Voices.Contains(user); - } + public bool IsVoiced(ChatUser user) => m_Voices.Contains(user); - public bool ValidatePassword(string password) - { - return m_Password == null || Insensitive.Equals(m_Password, password); - } + public bool ValidatePassword(string password) => m_Password == null || Insensitive.Equals(m_Password, password); public bool ValidateModerator(ChatUser user) { diff --git a/Projects/Scripts/Engines/Chat/ChatUser.cs b/Projects/Scripts/Engines/Chat/ChatUser.cs index 1fe1995d1..a24ee7508 100644 --- a/Projects/Scripts/Engines/Chat/ChatUser.cs +++ b/Projects/Scripts/Engines/Chat/ChatUser.cs @@ -51,11 +51,9 @@ namespace Server.Engines.Chat public bool IsModerator => CurrentChannel?.IsModerator(this) == true; - public char GetColorCharacter() - { - return IsModerator ? ModeratorColorCharacter : - CurrentChannel?.IsVoiced(this) == true ? VoicedColorCharacter : NormalColorCharacter; - } + public char GetColorCharacter() => + IsModerator ? ModeratorColorCharacter : + CurrentChannel?.IsVoiced(this) == true ? VoicedColorCharacter : NormalColorCharacter; public bool CheckOnline() { @@ -78,10 +76,7 @@ namespace Server.Engines.Chat Mobile.Send(new ChatMessagePacket(from, number, param1, param2)); } - public bool IsIgnored(ChatUser check) - { - return Ignored.Contains(check); - } + public bool IsIgnored(ChatUser check) => Ignored.Contains(check); public void AddIgnored(ChatUser user) { diff --git a/Projects/Scripts/Engines/ConPVP/AcceptDuelGump.cs b/Projects/Scripts/Engines/ConPVP/AcceptDuelGump.cs index 7bf342a64..99b8f3cd8 100644 --- a/Projects/Scripts/Engines/ConPVP/AcceptDuelGump.cs +++ b/Projects/Scripts/Engines/ConPVP/AcceptDuelGump.cs @@ -92,15 +92,9 @@ namespace Server.Engines.ConPVP Timer.DelayCall(TimeSpan.FromSeconds(15.0), AutoReject); } - public string Center(string text) - { - return $"
{text}
"; - } + public string Center(string text) => $"
{text}
"; - public string Color(string text, int color) - { - return $"{text}"; - } + public string Color(string text, int color) => $"{text}"; public void AutoReject() { diff --git a/Projects/Scripts/Engines/ConPVP/Arena.cs b/Projects/Scripts/Engines/ConPVP/Arena.cs index f36bd394c..12703d633 100644 --- a/Projects/Scripts/Engines/ConPVP/Arena.cs +++ b/Projects/Scripts/Engines/ConPVP/Arena.cs @@ -86,10 +86,7 @@ namespace Server.Engines.ConPVP [PropertyObject] public class ArenaStartPoints { - public ArenaStartPoints(Point3D[] points = null) - { - Points = points ?? new Point3D[8]; - } + public ArenaStartPoints(Point3D[] points = null) => Points = points ?? new Point3D[8]; public ArenaStartPoints(GenericReader reader) { @@ -157,10 +154,7 @@ namespace Server.Engines.ConPVP set => Points[7] = value; } - public override string ToString() - { - return "..."; - } + public override string ToString() => "..."; public void Serialize(GenericWriter writer) { @@ -471,10 +465,7 @@ namespace Server.Engines.ConPVP return a.CompareTo(b); } - public Ladder AcquireLadder() - { - return Ladder?.Ladder ?? ConPVP.Ladder.Instance; - } + public Ladder AcquireLadder() => Ladder?.Ladder ?? ConPVP.Ladder.Instance; public void Delete() { @@ -483,10 +474,7 @@ namespace Server.Engines.ConPVP m_Region = null; } - public override string ToString() - { - return "..."; - } + public override string ToString() => "..."; public Point3D GetBaseStartPoint(int index) { @@ -754,10 +742,7 @@ namespace Server.Engines.ConPVP public int m_VotesAgainst; public int m_VotesFor; - public ArenaEntry(Arena arena) - { - m_Arena = arena; - } + public ArenaEntry(Arena arena) => m_Arena = arena; public int Value => m_VotesFor; } diff --git a/Projects/Scripts/Engines/ConPVP/DuelContext.cs b/Projects/Scripts/Engines/ConPVP/DuelContext.cs index c5e667d52..51b4144ec 100644 --- a/Projects/Scripts/Engines/ConPVP/DuelContext.cs +++ b/Projects/Scripts/Engines/ConPVP/DuelContext.cs @@ -117,11 +117,7 @@ namespace Server.Engines.ConPVP Timer.DelayCall(ts, () => DelayBounce_Callback(mob, corpse)); } - public static bool AllowSpecialMove(Mobile from, string name, SpecialMove move) - { - // No DuelContext, or InstaAllowSpecialMove - return (from as PlayerMobile)?.DuelContext?.InstAllowSpecialMove(from, name, move) != false; - } + public static bool AllowSpecialMove(Mobile from, string name, SpecialMove move) => (from as PlayerMobile)?.DuelContext?.InstAllowSpecialMove(from, name, move) != false; public bool InstAllowSpecialMove(Mobile from, string name, SpecialMove move) { @@ -958,10 +954,7 @@ namespace Server.Engines.ConPVP m_SDWarnTimer = null; } - public static bool CheckSuddenDeath(Mobile mob) - { - return mob is PlayerMobile pm && pm.DuelPlayer?.Eliminated == false && pm.DuelContext?.IsSuddenDeath == true; - } + public static bool CheckSuddenDeath(Mobile mob) => mob is PlayerMobile pm && pm.DuelPlayer?.Eliminated == false && pm.DuelContext?.IsSuddenDeath == true; public void ActivateSuddenDeath() { @@ -2204,10 +2197,7 @@ namespace Server.Engines.ConPVP private class InternalWall : Item { - public InternalWall() : base(0x80) - { - Movable = false; - } + public InternalWall() : base(0x80) => Movable = false; public InternalWall(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/ConPVP/Games/BombingRun.cs b/Projects/Scripts/Engines/ConPVP/Games/BombingRun.cs index c41cfb333..d6a204482 100644 --- a/Projects/Scripts/Engines/ConPVP/Games/BombingRun.cs +++ b/Projects/Scripts/Engines/ConPVP/Games/BombingRun.cs @@ -918,10 +918,8 @@ namespace Server.Engines.ConPVP [Constructible] public BRBoard() - : base(7774) - { + : base(7774) => Movable = false; - } public BRBoard(Serial serial) : base(serial) @@ -1088,15 +1086,9 @@ namespace Server.Engines.ConPVP AddButton(314, height - 42, 247, 248, 1); } - public string Center(string text) - { - return $"
{text}
"; - } + public string Center(string text) => $"
{text}
"; - public string Color(string text, int color) - { - return $"{text}"; - } + public string Color(string text, int color) => $"{text}"; private void AddBorderedText(int x, int y, int width, int height, string text, int color, int borderColor) { @@ -1362,15 +1354,9 @@ namespace Server.Engines.ConPVP public override string Title => "Bombing Run"; public override string DefaultName => "Bombing Run Controller"; - public override string GetTeamName(int teamID) - { - return TeamInfo[teamID % TeamInfo.Length].Name; - } + public override string GetTeamName(int teamID) => TeamInfo[teamID % TeamInfo.Length].Name; - public override EventGame Construct(DuelContext context) - { - return new BRGame(this, context); - } + public override EventGame Construct(DuelContext context) => new BRGame(this, context); public override void Serialize(GenericWriter writer) { @@ -1421,10 +1407,7 @@ namespace Server.Engines.ConPVP private TimerCallback m_UnhideCallback; - public BRGame(BRController controller, DuelContext context) : base(context) - { - Controller = controller; - } + public BRGame(BRController controller, DuelContext context) : base(context) => Controller = controller; public BRController Controller{ get; } @@ -1439,10 +1422,7 @@ namespace Server.Engines.ConPVP } } - public override bool CantDoAnything(Mobile mob) - { - return mob.Backpack?.FindItemByType() != null && GetTeamInfo(mob) != null; - } + public override bool CantDoAnything(Mobile mob) => mob.Backpack?.FindItemByType() != null && GetTeamInfo(mob) != null; public void ReturnBomb() { @@ -1508,10 +1488,7 @@ namespace Server.Engines.ConPVP return pm.DuelContext.Participants.IndexOf(pm.DuelPlayer.Participant); } - public int GetColor(Mobile mob) - { - return GetTeamInfo(mob)?.Color ?? -1; - } + public int GetColor(Mobile mob) => GetTeamInfo(mob)?.Color ?? -1; private void ApplyHues(Participant p, int hueOverride) { diff --git a/Projects/Scripts/Engines/ConPVP/Games/CTF.cs b/Projects/Scripts/Engines/ConPVP/Games/CTF.cs index d8b98dc48..9425df0ae 100644 --- a/Projects/Scripts/Engines/ConPVP/Games/CTF.cs +++ b/Projects/Scripts/Engines/ConPVP/Games/CTF.cs @@ -15,10 +15,8 @@ namespace Server.Engines.ConPVP [Constructible] public CTFBoard() - : base(7774) - { + : base(7774) => Movable = false; - } public CTFBoard(Serial serial) : base(serial) @@ -181,15 +179,9 @@ namespace Server.Engines.ConPVP AddButton(314, height - 42, 247, 248, 1); } - public string Center(string text) - { - return $"
{text}
"; - } + public string Center(string text) => $"
{text}
"; - public string Color(string text, int color) - { - return $"{text}"; - } + public string Color(string text, int color) => $"{text}"; private void AddBorderedText(int x, int y, int width, int height, string text, int color, int borderColor) { @@ -223,10 +215,8 @@ namespace Server.Engines.ConPVP [Constructible] public CTFFlag() - : base(5643) - { + : base(5643) => Movable = false; - } public CTFFlag(Serial serial) : base(serial) @@ -684,10 +674,7 @@ namespace Server.Engines.ConPVP op.Write(Origin); } - public override string ToString() - { - return "..."; - } + public override string ToString() => "..."; } public sealed class CTFController : EventController @@ -742,15 +729,9 @@ namespace Server.Engines.ConPVP public override string Title => "CTF"; - public override string GetTeamName(int teamID) - { - return TeamInfo[teamID % TeamInfo.Length].Name; - } + public override string GetTeamName(int teamID) => TeamInfo[teamID % TeamInfo.Length].Name; - public override EventGame Construct(DuelContext context) - { - return new CTFGame(this, context); - } + public override EventGame Construct(DuelContext context) => new CTFGame(this, context); public override void Serialize(GenericWriter writer) { @@ -809,10 +790,7 @@ namespace Server.Engines.ConPVP { private Timer m_FinishTimer; - public CTFGame(CTFController controller, DuelContext context) : base(context) - { - Controller = controller; - } + public CTFGame(CTFController controller, DuelContext context) : base(context) => Controller = controller; public CTFController Controller{ get; } diff --git a/Projects/Scripts/Engines/ConPVP/Games/DoubleDom.cs b/Projects/Scripts/Engines/ConPVP/Games/DoubleDom.cs index f0c4c5a92..332fdb862 100644 --- a/Projects/Scripts/Engines/ConPVP/Games/DoubleDom.cs +++ b/Projects/Scripts/Engines/ConPVP/Games/DoubleDom.cs @@ -13,10 +13,8 @@ namespace Server.Engines.ConPVP [Constructible] public DDBoard() - : base(7774) - { + : base(7774) => Movable = false; - } public DDBoard(Serial serial) : base(serial) @@ -177,15 +175,9 @@ namespace Server.Engines.ConPVP AddButton(314, height - 42, 247, 248, 1); } - public string Center(string text) - { - return $"
{text}
"; - } + public string Center(string text) => $"
{text}
"; - public string Color(string text, int color) - { - return $"{text}"; - } + public string Color(string text, int color) => $"{text}"; private void AddBorderedText(int x, int y, int width, int height, string text, int color, int borderColor) { @@ -354,10 +346,7 @@ namespace Server.Engines.ConPVP op.Write(Origin); } - public override string ToString() - { - return "..."; - } + public override string ToString() => "..."; } public sealed class DDController : EventController @@ -402,15 +391,9 @@ namespace Server.Engines.ConPVP public override string DefaultName => "DD Controller"; - public override string GetTeamName(int teamID) - { - return TeamInfo[teamID % TeamInfo.Length].Name; - } + public override string GetTeamName(int teamID) => TeamInfo[teamID % TeamInfo.Length].Name; - public override EventGame Construct(DuelContext context) - { - return new DDGame(this, context); - } + public override EventGame Construct(DuelContext context) => new DDGame(this, context); public override void Serialize(GenericWriter writer) { @@ -464,10 +447,7 @@ namespace Server.Engines.ConPVP private Timer m_FinishTimer; private Timer m_UncaptureTimer; - public DDGame(DDController controller, DuelContext context) : base(context) - { - Controller = controller; - } + public DDGame(DDController controller, DuelContext context) : base(context) => Controller = controller; public DDController Controller{ get; } @@ -525,10 +505,7 @@ namespace Server.Engines.ConPVP return pm.DuelContext.Participants.IndexOf(pm.DuelPlayer.Participant); } - public int GetColor(Mobile mob) - { - return GetTeamInfo(mob)?.Color ?? -1; - } + public int GetColor(Mobile mob) => GetTeamInfo(mob)?.Color ?? -1; private void ApplyHues(Participant p, int hueOverride) { @@ -1077,10 +1054,7 @@ namespace Server.Engines.ConPVP public class DDStep : AddonComponent { - public DDStep(int itemID) : base(itemID) - { - Visible = true; - } + public DDStep(int itemID) : base(itemID) => Visible = true; public DDStep(Serial serial) : base(serial) { @@ -1100,10 +1074,7 @@ namespace Server.Engines.ConPVP writer.Write(0); //version } - public override bool OnMoveOver(Mobile m) - { - return Addon.OnMoveOver(m); - } + public override bool OnMoveOver(Mobile m) => Addon.OnMoveOver(m); } } } diff --git a/Projects/Scripts/Engines/ConPVP/Games/EventGame.cs b/Projects/Scripts/Engines/ConPVP/Games/EventGame.cs index 5f49e80d0..e1ff34e8b 100644 --- a/Projects/Scripts/Engines/ConPVP/Games/EventGame.cs +++ b/Projects/Scripts/Engines/ConPVP/Games/EventGame.cs @@ -47,24 +47,15 @@ namespace Server.Engines.ConPVP { protected DuelContext m_Context; - public EventGame(DuelContext context) - { - m_Context = context; - } + public EventGame(DuelContext context) => m_Context = context; public DuelContext Context => m_Context; public virtual bool FreeConsume => true; - public virtual bool OnDeath(Mobile mob, Container corpse) - { - return true; - } + public virtual bool OnDeath(Mobile mob, Container corpse) => true; - public virtual bool CantDoAnything(Mobile mob) - { - return false; - } + public virtual bool CantDoAnything(Mobile mob) => false; public virtual void OnStart() { diff --git a/Projects/Scripts/Engines/ConPVP/Games/KingOfTheHill.cs b/Projects/Scripts/Engines/ConPVP/Games/KingOfTheHill.cs index f93023b88..23047a128 100644 --- a/Projects/Scripts/Engines/ConPVP/Games/KingOfTheHill.cs +++ b/Projects/Scripts/Engines/ConPVP/Games/KingOfTheHill.cs @@ -463,15 +463,9 @@ namespace Server.Engines.ConPVP AddButton(314, height - 42, 247, 248, 1); } - public string Center(string text) - { - return $"
{text}
"; - } + public string Center(string text) => $"
{text}
"; - public string Color(string text, int color) - { - return $"{text}"; - } + public string Color(string text, int color) => $"{text}"; private void AddBorderedText(int x, int y, int width, int height, string text, int color, int borderColor) { @@ -650,10 +644,7 @@ namespace Server.Engines.ConPVP op.WriteEncodedInt(Color); } - public override string ToString() - { - return TeamName != null ? $"({Name}) ..." : "..."; - } + public override string ToString() => TeamName != null ? $"({Name}) ..." : "..."; } public sealed class KHController : EventController @@ -745,15 +736,9 @@ namespace Server.Engines.ConPVP public override string Title => "King of the Hill"; - public override string GetTeamName(int teamID) - { - return TeamInfo[teamID % TeamInfo.Length].Name; - } + public override string GetTeamName(int teamID) => TeamInfo[teamID % TeamInfo.Length].Name; - public override EventGame Construct(DuelContext context) - { - return new KHGame(this, context); - } + public override EventGame Construct(DuelContext context) => new KHGame(this, context); public void RemoveBoard(KHBoard b) { @@ -824,10 +809,7 @@ namespace Server.Engines.ConPVP { private Timer m_FinishTimer; - public KHGame(KHController controller, DuelContext context) : base(context) - { - Controller = controller; - } + public KHGame(KHController controller, DuelContext context) : base(context) => Controller = controller; public KHController Controller{ get; } @@ -895,10 +877,7 @@ namespace Server.Engines.ConPVP return pm.DuelContext.Participants.IndexOf(pm.DuelPlayer.Participant); } - public int GetColor(Mobile mob) - { - return GetTeamInfo(mob)?.Color ?? -1; - } + public int GetColor(Mobile mob) => GetTeamInfo(mob)?.Color ?? -1; private void ApplyHues(Participant p, int hueOverride) { diff --git a/Projects/Scripts/Engines/ConPVP/Gumps/AcceptTeamGump.cs b/Projects/Scripts/Engines/ConPVP/Gumps/AcceptTeamGump.cs index e1526cc57..636db892e 100644 --- a/Projects/Scripts/Engines/ConPVP/Gumps/AcceptTeamGump.cs +++ b/Projects/Scripts/Engines/ConPVP/Gumps/AcceptTeamGump.cs @@ -248,15 +248,9 @@ namespace Server.Engines.ConPVP Timer.DelayCall(TimeSpan.FromSeconds(15.0), AutoReject); } - public string Center(string text) - { - return $"
{text}
"; - } + public string Center(string text) => $"
{text}
"; - public string Color(string text, int color) - { - return $"{text}"; - } + public string Color(string text, int color) => $"{text}"; private void AddBorderedText(int x, int y, int width, int height, string text, int color, int borderColor) { diff --git a/Projects/Scripts/Engines/ConPVP/Gumps/ArenaGump.cs b/Projects/Scripts/Engines/ConPVP/Gumps/ArenaGump.cs index bd4aa7a6e..27e29c16f 100644 --- a/Projects/Scripts/Engines/ConPVP/Gumps/ArenaGump.cs +++ b/Projects/Scripts/Engines/ConPVP/Gumps/ArenaGump.cs @@ -67,10 +67,7 @@ namespace Server.Engines.ConPVP from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that } - public override bool OnMoveOver(Mobile m) - { - return !m.Player || UseGate(m); - } + public override bool OnMoveOver(Mobile m) => !m.Player || UseGate(m); } public class ArenaGump : Gump @@ -242,15 +239,9 @@ namespace Server.Engines.ConPVP } } - public string Center(string text) - { - return $"
{text}
"; - } + public string Center(string text) => $"
{text}
"; - public string Color(string text, int color) - { - return $"{text}"; - } + public string Color(string text, int color) => $"{text}"; private void AddBorderedText(int x, int y, int width, string text, int color, int borderColor) { diff --git a/Projects/Scripts/Engines/ConPVP/Gumps/BeginGump.cs b/Projects/Scripts/Engines/ConPVP/Gumps/BeginGump.cs index a90d151b1..2414e770e 100644 --- a/Projects/Scripts/Engines/ConPVP/Gumps/BeginGump.cs +++ b/Projects/Scripts/Engines/ConPVP/Gumps/BeginGump.cs @@ -59,14 +59,8 @@ namespace Server.Engines.ConPVP AddButton(314 - 50, 157 - offset, 247, 248, 1); } - public string Center(string text) - { - return $"
{text}
"; - } + public string Center(string text) => $"
{text}
"; - public string Color(string text, int color) - { - return $"{text}"; - } + public string Color(string text, int color) => $"{text}"; } } diff --git a/Projects/Scripts/Engines/ConPVP/Gumps/ConfirmSignupGump.cs b/Projects/Scripts/Engines/ConPVP/Gumps/ConfirmSignupGump.cs index 78d4305ae..a69f0b197 100644 --- a/Projects/Scripts/Engines/ConPVP/Gumps/ConfirmSignupGump.cs +++ b/Projects/Scripts/Engines/ConPVP/Gumps/ConfirmSignupGump.cs @@ -281,15 +281,9 @@ public class ConfirmSignupGump : Gump AddButton(314, y, 247, 248, 1); } - public string Center(string text) - { - return $"
{text}
"; - } + public string Center(string text) => $"
{text}
"; - public string Color(string text, int color) - { - return $"{text}"; - } + public string Color(string text, int color) => $"{text}"; private void AddBorderedText(int x, int y, int width, int height, string text, int color, int borderColor) { diff --git a/Projects/Scripts/Engines/ConPVP/Gumps/DuelContextGump.cs b/Projects/Scripts/Engines/ConPVP/Gumps/DuelContextGump.cs index f3de1eaa7..b29bea6d5 100644 --- a/Projects/Scripts/Engines/ConPVP/Gumps/DuelContextGump.cs +++ b/Projects/Scripts/Engines/ConPVP/Gumps/DuelContextGump.cs @@ -56,10 +56,7 @@ namespace Server.Engines.ConPVP public DuelContext Context{ get; } - public string Center(string text) - { - return $"
{text}
"; - } + public string Center(string text) => $"
{text}
"; public void AddGoldenButton(int x, int y, int bid) { diff --git a/Projects/Scripts/Engines/ConPVP/Gumps/LadderGump.cs b/Projects/Scripts/Engines/ConPVP/Gumps/LadderGump.cs index c22dfa82b..972249d76 100644 --- a/Projects/Scripts/Engines/ConPVP/Gumps/LadderGump.cs +++ b/Projects/Scripts/Engines/ConPVP/Gumps/LadderGump.cs @@ -8,10 +8,7 @@ namespace Server.Engines.ConPVP public class LadderItem : Item { [Constructible] - public LadderItem() : base(0x117F) - { - Movable = false; - } + public LadderItem() : base(0x117F) => Movable = false; public LadderItem(Serial serial) : base(serial) { @@ -207,15 +204,9 @@ namespace Server.Engines.ConPVP from.SendGump(new LadderGump(m_Ladder, m_Page + 1)); } - public string Center(string text) - { - return $"
{text}
"; - } + public string Center(string text) => $"
{text}
"; - public string Color(string text, int color) - { - return $"{text}"; - } + public string Color(string text, int color) => $"{text}"; private void AddBorderedText(int x, int y, int width, string text, int color, int borderColor) { diff --git a/Projects/Scripts/Engines/ConPVP/Gumps/ParticipantGump.cs b/Projects/Scripts/Engines/ConPVP/Gumps/ParticipantGump.cs index c412f98f5..fefd3a68e 100644 --- a/Projects/Scripts/Engines/ConPVP/Gumps/ParticipantGump.cs +++ b/Projects/Scripts/Engines/ConPVP/Gumps/ParticipantGump.cs @@ -64,10 +64,7 @@ namespace Server.Engines.ConPVP public Participant Participant{ get; } - public string Center(string text) - { - return $"
{text}
"; - } + public string Center(string text) => $"
{text}
"; public void AddGoldenButton(int x, int y, int bid) { diff --git a/Projects/Scripts/Engines/ConPVP/Gumps/PickRulesetGump.cs b/Projects/Scripts/Engines/ConPVP/Gumps/PickRulesetGump.cs index 0ba8f1340..95a0302c3 100644 --- a/Projects/Scripts/Engines/ConPVP/Gumps/PickRulesetGump.cs +++ b/Projects/Scripts/Engines/ConPVP/Gumps/PickRulesetGump.cs @@ -70,10 +70,7 @@ namespace Server.Engines.ConPVP } } - public string Center(string text) - { - return $"
{text}
"; - } + public string Center(string text) => $"
{text}
"; public override void OnResponse(NetState sender, RelayInfo info) { diff --git a/Projects/Scripts/Engines/ConPVP/Gumps/ReadyGump.cs b/Projects/Scripts/Engines/ConPVP/Gumps/ReadyGump.cs index 6d87c6756..34ae8b008 100644 --- a/Projects/Scripts/Engines/ConPVP/Gumps/ReadyGump.cs +++ b/Projects/Scripts/Engines/ConPVP/Gumps/ReadyGump.cs @@ -97,10 +97,7 @@ namespace Server.Engines.ConPVP } } - public string Center(string text) - { - return $"
{text}
"; - } + public string Center(string text) => $"
{text}
"; public override void OnResponse(NetState sender, RelayInfo info) { diff --git a/Projects/Scripts/Engines/ConPVP/Gumps/ReadyUpGump.cs b/Projects/Scripts/Engines/ConPVP/Gumps/ReadyUpGump.cs index e97899ef9..fe2438585 100644 --- a/Projects/Scripts/Engines/ConPVP/Gumps/ReadyUpGump.cs +++ b/Projects/Scripts/Engines/ConPVP/Gumps/ReadyUpGump.cs @@ -189,10 +189,7 @@ namespace Server.Engines.ConPVP } } - public string Center(string text) - { - return $"
{text}
"; - } + public string Center(string text) => $"
{text}
"; public void AddGoldenButton(int x, int y, int bid) { diff --git a/Projects/Scripts/Engines/ConPVP/Gumps/RulesetGump.cs b/Projects/Scripts/Engines/ConPVP/Gumps/RulesetGump.cs index bb9372ede..f1359bae4 100644 --- a/Projects/Scripts/Engines/ConPVP/Gumps/RulesetGump.cs +++ b/Projects/Scripts/Engines/ConPVP/Gumps/RulesetGump.cs @@ -73,10 +73,7 @@ namespace Server.Engines.ConPVP } } - public string Center(string text) - { - return $"
{text}
"; - } + public string Center(string text) => $"
{text}
"; public void AddGoldenButton(int x, int y, int bid) { diff --git a/Projects/Scripts/Engines/ConPVP/Gumps/TournamentBracketGump.cs b/Projects/Scripts/Engines/ConPVP/Gumps/TournamentBracketGump.cs index 0743d9353..838404aeb 100644 --- a/Projects/Scripts/Engines/ConPVP/Gumps/TournamentBracketGump.cs +++ b/Projects/Scripts/Engines/ConPVP/Gumps/TournamentBracketGump.cs @@ -614,15 +614,9 @@ namespace Server.Engines.ConPVP } } - public string Center(string text) - { - return $"
{text}
"; - } + public string Center(string text) => $"
{text}
"; - public string Color(string text, int color) - { - return $"{text}"; - } + public string Color(string text, int color) => $"{text}"; private void AddBorderedText(int x, int y, int width, int height, string text, int color, int borderColor) { @@ -667,10 +661,7 @@ namespace Server.Engines.ConPVP AddLeftArrow(x, y, bid, null); } - public int ToButtonID(int type, int index) - { - return 1 + index * 7 + type; - } + public int ToButtonID(int type, int index) => 1 + index * 7 + type; public bool FromButtonID(int bid, out int type, out int index) { diff --git a/Projects/Scripts/Engines/ConPVP/Ladder.cs b/Projects/Scripts/Engines/ConPVP/Ladder.cs index 8457abd69..b2171f0a8 100644 --- a/Projects/Scripts/Engines/ConPVP/Ladder.cs +++ b/Projects/Scripts/Engines/ConPVP/Ladder.cs @@ -118,10 +118,7 @@ namespace Server.Engines.ConPVP private Dictionary m_Table; - public Ladder() - { - m_Table = new Dictionary(); - } + public Ladder() => m_Table = new Dictionary(); public Ladder(GenericReader reader) { @@ -350,10 +347,7 @@ namespace Server.Engines.ConPVP [CommandProperty(AccessLevel.GameMaster)] public int Rank => Index; - public int CompareTo(LadderEntry l) - { - return (l?.m_Experience ?? 0) - m_Experience; - } + public int CompareTo(LadderEntry l) => (l?.m_Experience ?? 0) - m_Experience; public void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Engines/ConPVP/Participant.cs b/Projects/Scripts/Engines/ConPVP/Participant.cs index 8638252da..2f83d7fbe 100644 --- a/Projects/Scripts/Engines/ConPVP/Participant.cs +++ b/Projects/Scripts/Engines/ConPVP/Participant.cs @@ -102,10 +102,7 @@ namespace Server.Engines.ConPVP return null; } - public bool Contains(Mobile mob) - { - return Find(mob) != null; - } + public bool Contains(Mobile mob) => Find(mob) != null; public void Broadcast(int hue, string message, string nonLocalOverhead, string localOverhead) { diff --git a/Projects/Scripts/Engines/ConPVP/Preferences.cs b/Projects/Scripts/Engines/ConPVP/Preferences.cs index 4417967a0..7e6901f6e 100644 --- a/Projects/Scripts/Engines/ConPVP/Preferences.cs +++ b/Projects/Scripts/Engines/ConPVP/Preferences.cs @@ -240,15 +240,9 @@ namespace Server.Engines.ConPVP } } - public string Center(string text) - { - return $"
{text}
"; - } + public string Center(string text) => $"
{text}
"; - public string Color(string text, int color) - { - return $"{text}"; - } + public string Color(string text, int color) => $"{text}"; private void AddBorderedText(int x, int y, int width, string text, int color, int borderColor) { diff --git a/Projects/Scripts/Engines/ConPVP/RulesetLayout.cs b/Projects/Scripts/Engines/ConPVP/RulesetLayout.cs index c15a06f5e..4b9f3a6ab 100644 --- a/Projects/Scripts/Engines/ConPVP/RulesetLayout.cs +++ b/Projects/Scripts/Engines/ConPVP/RulesetLayout.cs @@ -736,10 +736,7 @@ namespace Server.Engines.ConPVP return null; } - public int GetOptionIndex(string option) - { - return Array.IndexOf(Options, option); - } + public int GetOptionIndex(string option) => Array.IndexOf(Options, option); public void ComputeOffsets() { diff --git a/Projects/Scripts/Engines/ConPVP/SafeZone.cs b/Projects/Scripts/Engines/ConPVP/SafeZone.cs index 12ceec1d7..e6016ad9f 100644 --- a/Projects/Scripts/Engines/ConPVP/SafeZone.cs +++ b/Projects/Scripts/Engines/ConPVP/SafeZone.cs @@ -19,10 +19,7 @@ namespace Server.Engines.ConPVP Register(); } - public override bool AllowHousing(Mobile from, Point3D p) - { - return from.AccessLevel >= AccessLevel.GameMaster && base.AllowHousing(from, p); - } + public override bool AllowHousing(Mobile from, Point3D p) => from.AccessLevel >= AccessLevel.GameMaster && base.AllowHousing(from, p); public override bool OnMoveInto(Mobile m, Direction d, Point3D newLocation, Point3D oldLocation) { @@ -58,9 +55,6 @@ namespace Server.Engines.ConPVP m.SendMessage("You have left a dueling safezone. Combat is now unrestricted."); } - public override bool CanUseStuckMenu(Mobile m) - { - return false; - } + public override bool CanUseStuckMenu(Mobile m) => false; } } diff --git a/Projects/Scripts/Engines/ConPVP/Tournament.cs b/Projects/Scripts/Engines/ConPVP/Tournament.cs index 233f3348e..f841ccb9c 100644 --- a/Projects/Scripts/Engines/ConPVP/Tournament.cs +++ b/Projects/Scripts/Engines/ConPVP/Tournament.cs @@ -426,10 +426,7 @@ namespace Server.Engines.ConPVP Alert(arena, sb.ToString()); } - private int ComputeCashAward() - { - return Participants.Count * m_PlayersPerParticipant * 2500; - } + private int ComputeCashAward() => Participants.Count * m_PlayersPerParticipant * 2500; private void GiveAwards() { diff --git a/Projects/Scripts/Engines/ConPVP/TournamentBracketItem.cs b/Projects/Scripts/Engines/ConPVP/TournamentBracketItem.cs index f1800b044..37dc5708d 100644 --- a/Projects/Scripts/Engines/ConPVP/TournamentBracketItem.cs +++ b/Projects/Scripts/Engines/ConPVP/TournamentBracketItem.cs @@ -1,65 +1,62 @@ -using Server.Network; - -namespace Server.Engines.ConPVP -{ - public class TournamentBracketItem : Item - { - [Constructible] - public TournamentBracketItem() : base(3774) - { - Movable = false; - } - - public TournamentBracketItem(Serial serial) : base(serial) - { - } - - [CommandProperty(AccessLevel.GameMaster)] - public TournamentController Tournament{ get; set; } - - public override string DefaultName => "tournament bracket"; - - public override void OnDoubleClick(Mobile from) - { - if (!from.InRange(GetWorldLocation(), 2)) - { - from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that - } - else - { - Tournament tourney = Tournament?.Tournament; - - if (tourney != null) - { - from.CloseGump(); - from.SendGump(new TournamentBracketGump(from, tourney, TourneyBracketGumpType.Index)); - } - } - } - - public override void Serialize(GenericWriter writer) - { - base.Serialize(writer); - - writer.Write(0); - - writer.Write(Tournament); - } - - public override void Deserialize(GenericReader reader) - { - base.Deserialize(reader); - - int version = reader.ReadInt(); - - switch (version) - { - case 0: - { - Tournament = reader.ReadItem() as TournamentController; - break; - } - } - } - } +using Server.Network; + +namespace Server.Engines.ConPVP +{ + public class TournamentBracketItem : Item + { + [Constructible] + public TournamentBracketItem() : base(3774) => Movable = false; + + public TournamentBracketItem(Serial serial) : base(serial) + { + } + + [CommandProperty(AccessLevel.GameMaster)] + public TournamentController Tournament{ get; set; } + + public override string DefaultName => "tournament bracket"; + + public override void OnDoubleClick(Mobile from) + { + if (!from.InRange(GetWorldLocation(), 2)) + { + from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that + } + else + { + Tournament tourney = Tournament?.Tournament; + + if (tourney != null) + { + from.CloseGump(); + from.SendGump(new TournamentBracketGump(from, tourney, TourneyBracketGumpType.Index)); + } + } + } + + public override void Serialize(GenericWriter writer) + { + base.Serialize(writer); + + writer.Write(0); + + writer.Write(Tournament); + } + + public override void Deserialize(GenericReader reader) + { + base.Deserialize(reader); + + int version = reader.ReadInt(); + + switch (version) + { + case 0: + { + Tournament = reader.ReadItem() as TournamentController; + break; + } + } + } + } } \ No newline at end of file diff --git a/Projects/Scripts/Engines/ConPVP/TournamentController.cs b/Projects/Scripts/Engines/ConPVP/TournamentController.cs index 67686f869..aac5b46ea 100644 --- a/Projects/Scripts/Engines/ConPVP/TournamentController.cs +++ b/Projects/Scripts/Engines/ConPVP/TournamentController.cs @@ -1,143 +1,137 @@ -using System; -using System.Collections.Generic; -using Server.ContextMenus; -using Server.Gumps; - -namespace Server.Engines.ConPVP -{ - public class TournamentController : Item - { - private static List m_Instances = new List(); - - [Constructible] - public TournamentController() : base(0x1B7A) - { - Visible = false; - Movable = false; - - Tournament = new Tournament(); - m_Instances.Add(this); - } - - public TournamentController(Serial serial) : base(serial) - { - } - - [CommandProperty(AccessLevel.GameMaster)] - public Tournament Tournament{ get; private set; } - - public static bool IsActive - { - get - { - for (int i = 0; i < m_Instances.Count; ++i) - { - TournamentController controller = m_Instances[i]; - - if (controller?.Deleted == false && controller.Tournament != null && - controller.Tournament.Stage != TournamentStage.Inactive) - return true; - } - - return false; - } - } - - public override string DefaultName => "tournament controller"; - - public override void GetContextMenuEntries(Mobile from, List list) - { - base.GetContextMenuEntries(from, list); - - if (from.AccessLevel >= AccessLevel.GameMaster && Tournament != null) - { - list.Add(new EditEntry(Tournament)); - - if (Tournament.CurrentStage == TournamentStage.Inactive) - list.Add(new StartEntry(Tournament)); - } - } - - public override void OnDoubleClick(Mobile from) - { - if (from.AccessLevel >= AccessLevel.GameMaster && Tournament != null) - { - from.CloseGump(); - from.CloseGump(); - from.SendGump(new PickRulesetGump(from, null, Tournament.Ruleset)); - } - } - - public override void Serialize(GenericWriter writer) - { - base.Serialize(writer); - - writer.Write(0); - - Tournament.Serialize(writer); - } - - public override void Deserialize(GenericReader reader) - { - base.Deserialize(reader); - - int version = reader.ReadInt(); - - switch (version) - { - case 0: - { - Tournament = new Tournament(reader); - break; - } - } - - m_Instances.Add(this); - } - - public override void OnDelete() - { - base.OnDelete(); - - m_Instances.Remove(this); - } - - private class EditEntry : ContextMenuEntry - { - private Tournament m_Tournament; - - public EditEntry(Tournament tourney) : base(5101) - { - m_Tournament = tourney; - } - - public override void OnClick() - { - Owner.From.SendGump(new PropertiesGump(Owner.From, m_Tournament)); - } - } - - private class StartEntry : ContextMenuEntry - { - private Tournament m_Tournament; - - public StartEntry(Tournament tourney) : base(5113) - { - m_Tournament = tourney; - } - - public override void OnClick() - { - if (m_Tournament.Stage == TournamentStage.Inactive) - { - m_Tournament.SignupStart = DateTime.UtcNow; - m_Tournament.Stage = TournamentStage.Signup; - m_Tournament.Participants.Clear(); - m_Tournament.Pyramid.Levels.Clear(); - m_Tournament.Alert("Hear ye! Hear ye!", - "Tournament signup has opened. You can enter by signing up with the registrar."); - } - } - } - } -} +using System; +using System.Collections.Generic; +using Server.ContextMenus; +using Server.Gumps; + +namespace Server.Engines.ConPVP +{ + public class TournamentController : Item + { + private static List m_Instances = new List(); + + [Constructible] + public TournamentController() : base(0x1B7A) + { + Visible = false; + Movable = false; + + Tournament = new Tournament(); + m_Instances.Add(this); + } + + public TournamentController(Serial serial) : base(serial) + { + } + + [CommandProperty(AccessLevel.GameMaster)] + public Tournament Tournament{ get; private set; } + + public static bool IsActive + { + get + { + for (int i = 0; i < m_Instances.Count; ++i) + { + TournamentController controller = m_Instances[i]; + + if (controller?.Deleted == false && controller.Tournament != null && + controller.Tournament.Stage != TournamentStage.Inactive) + return true; + } + + return false; + } + } + + public override string DefaultName => "tournament controller"; + + public override void GetContextMenuEntries(Mobile from, List list) + { + base.GetContextMenuEntries(from, list); + + if (from.AccessLevel >= AccessLevel.GameMaster && Tournament != null) + { + list.Add(new EditEntry(Tournament)); + + if (Tournament.CurrentStage == TournamentStage.Inactive) + list.Add(new StartEntry(Tournament)); + } + } + + public override void OnDoubleClick(Mobile from) + { + if (from.AccessLevel >= AccessLevel.GameMaster && Tournament != null) + { + from.CloseGump(); + from.CloseGump(); + from.SendGump(new PickRulesetGump(from, null, Tournament.Ruleset)); + } + } + + public override void Serialize(GenericWriter writer) + { + base.Serialize(writer); + + writer.Write(0); + + Tournament.Serialize(writer); + } + + public override void Deserialize(GenericReader reader) + { + base.Deserialize(reader); + + int version = reader.ReadInt(); + + switch (version) + { + case 0: + { + Tournament = new Tournament(reader); + break; + } + } + + m_Instances.Add(this); + } + + public override void OnDelete() + { + base.OnDelete(); + + m_Instances.Remove(this); + } + + private class EditEntry : ContextMenuEntry + { + private Tournament m_Tournament; + + public EditEntry(Tournament tourney) : base(5101) => m_Tournament = tourney; + + public override void OnClick() + { + Owner.From.SendGump(new PropertiesGump(Owner.From, m_Tournament)); + } + } + + private class StartEntry : ContextMenuEntry + { + private Tournament m_Tournament; + + public StartEntry(Tournament tourney) : base(5113) => m_Tournament = tourney; + + public override void OnClick() + { + if (m_Tournament.Stage == TournamentStage.Inactive) + { + m_Tournament.SignupStart = DateTime.UtcNow; + m_Tournament.Stage = TournamentStage.Signup; + m_Tournament.Participants.Clear(); + m_Tournament.Pyramid.Levels.Clear(); + m_Tournament.Alert("Hear ye! Hear ye!", + "Tournament signup has opened. You can enter by signing up with the registrar."); + } + } + } + } +} diff --git a/Projects/Scripts/Engines/ConPVP/TournamentPyramid.cs b/Projects/Scripts/Engines/ConPVP/TournamentPyramid.cs index 36cec277c..983947d9e 100644 --- a/Projects/Scripts/Engines/ConPVP/TournamentPyramid.cs +++ b/Projects/Scripts/Engines/ConPVP/TournamentPyramid.cs @@ -1,190 +1,187 @@ -using System.Collections.Generic; -using Server.Ethics; -using Server.Factions; - -namespace Server.Engines.ConPVP -{ - public class TourneyPyramid - { - public TourneyPyramid() - { - Levels = new List(); - } - - public List Levels{ get; set; } - - public void AddLevel(int partsPerMatch, List participants, GroupingType groupType, TourneyType tourneyType) - { - List copy = new List(participants); - - if (groupType == GroupingType.Nearest || groupType == GroupingType.HighVsLow) - copy.Sort(); - - PyramidLevel level = new PyramidLevel(); - - switch (tourneyType) - { - case TourneyType.RedVsBlue: - { - TourneyParticipant[] parts = new TourneyParticipant[2]; - - for (int i = 0; i < parts.Length; ++i) - parts[i] = new TourneyParticipant(new List()); - - for (int i = 0; i < copy.Count; ++i) - { - List players = copy[i].Players; - - for (int j = 0; j < players.Count; ++j) - { - Mobile mob = players[j]; - - if (mob.Kills >= 5) - parts[0].Players.Add(mob); - else - parts[1].Players.Add(mob); - } - } - - level.Matches.Add(new TourneyMatch(new List(parts))); - break; - } - case TourneyType.Faction: - { - TourneyParticipant[] parts = new TourneyParticipant[partsPerMatch]; - - for (int i = 0; i < parts.Length; ++i) - parts[i] = new TourneyParticipant(new List()); - - for (int i = 0; i < copy.Count; ++i) - { - List players = copy[i].Players; - - for (int j = 0; j < players.Count; ++j) - { - Mobile mob = players[j]; - - int index = -1; - - if (partsPerMatch == 4) - { - Faction fac = Faction.Find(mob); - - if (fac != null) - index = fac.Definition.Sort; - } - else if (partsPerMatch == 2) - { - if (Ethic.Evil.IsEligible(mob)) - index = 0; - else if (Ethic.Hero.IsEligible(mob)) index = 1; - } - - if (index < 0 || index >= partsPerMatch) index = i % partsPerMatch; - - parts[index].Players.Add(mob); - } - } - - level.Matches.Add(new TourneyMatch(new List(parts))); - break; - } - case TourneyType.RandomTeam: - { - TourneyParticipant[] parts = new TourneyParticipant[partsPerMatch]; - - for (int i = 0; i < partsPerMatch; ++i) - parts[i] = new TourneyParticipant(new List()); - - for (int i = 0; i < copy.Count; ++i) - parts[i % parts.Length].Players.AddRange(copy[i].Players); - - level.Matches.Add(new TourneyMatch(new List(parts))); - break; - } - case TourneyType.FreeForAll: - { - level.Matches.Add(new TourneyMatch(copy)); - break; - } - case TourneyType.Standard: - { - if (partsPerMatch >= 2 && participants.Count % partsPerMatch == 1) - { - int lowAdvances = int.MaxValue; - - for (int i = 0; i < participants.Count; ++i) - { - TourneyParticipant p = participants[i]; - - if (p.FreeAdvances < lowAdvances) - lowAdvances = p.FreeAdvances; - } - - List toAdvance = new List(); - - for (int i = 0; i < participants.Count; ++i) - { - TourneyParticipant p = participants[i]; - - if (p.FreeAdvances == lowAdvances) - toAdvance.Add(p); - } - - if (toAdvance.Count == 0) - toAdvance = copy; // sanity - - int idx = Utility.Random(toAdvance.Count); - - toAdvance[idx].AddLog( - "Advanced automatically due to an odd number of challengers."); - level.FreeAdvance = toAdvance[idx]; - ++level.FreeAdvance.FreeAdvances; - copy.Remove(toAdvance[idx]); - } - - while (copy.Count >= partsPerMatch) - { - List thisMatch = new List(); - - for (int i = 0; i < partsPerMatch; ++i) - { - int idx = 0; - - switch (groupType) - { - case GroupingType.HighVsLow: - idx = i * (copy.Count - 1) / (partsPerMatch - 1); - break; - case GroupingType.Nearest: - idx = 0; - break; - case GroupingType.Random: - idx = Utility.Random(copy.Count); - break; - } - - thisMatch.Add(copy[idx]); - copy.RemoveAt(idx); - } - - level.Matches.Add(new TourneyMatch(thisMatch)); - } - - if (copy.Count > 1) - level.Matches.Add(new TourneyMatch(copy)); - - break; - } - } - - Levels.Add(level); - } - } - - public class PyramidLevel - { - public List Matches{ get; set; } = new List(); - public TourneyParticipant FreeAdvance{ get; set; } - } -} +using System.Collections.Generic; +using Server.Ethics; +using Server.Factions; + +namespace Server.Engines.ConPVP +{ + public class TourneyPyramid + { + public TourneyPyramid() => Levels = new List(); + + public List Levels{ get; set; } + + public void AddLevel(int partsPerMatch, List participants, GroupingType groupType, TourneyType tourneyType) + { + List copy = new List(participants); + + if (groupType == GroupingType.Nearest || groupType == GroupingType.HighVsLow) + copy.Sort(); + + PyramidLevel level = new PyramidLevel(); + + switch (tourneyType) + { + case TourneyType.RedVsBlue: + { + TourneyParticipant[] parts = new TourneyParticipant[2]; + + for (int i = 0; i < parts.Length; ++i) + parts[i] = new TourneyParticipant(new List()); + + for (int i = 0; i < copy.Count; ++i) + { + List players = copy[i].Players; + + for (int j = 0; j < players.Count; ++j) + { + Mobile mob = players[j]; + + if (mob.Kills >= 5) + parts[0].Players.Add(mob); + else + parts[1].Players.Add(mob); + } + } + + level.Matches.Add(new TourneyMatch(new List(parts))); + break; + } + case TourneyType.Faction: + { + TourneyParticipant[] parts = new TourneyParticipant[partsPerMatch]; + + for (int i = 0; i < parts.Length; ++i) + parts[i] = new TourneyParticipant(new List()); + + for (int i = 0; i < copy.Count; ++i) + { + List players = copy[i].Players; + + for (int j = 0; j < players.Count; ++j) + { + Mobile mob = players[j]; + + int index = -1; + + if (partsPerMatch == 4) + { + Faction fac = Faction.Find(mob); + + if (fac != null) + index = fac.Definition.Sort; + } + else if (partsPerMatch == 2) + { + if (Ethic.Evil.IsEligible(mob)) + index = 0; + else if (Ethic.Hero.IsEligible(mob)) index = 1; + } + + if (index < 0 || index >= partsPerMatch) index = i % partsPerMatch; + + parts[index].Players.Add(mob); + } + } + + level.Matches.Add(new TourneyMatch(new List(parts))); + break; + } + case TourneyType.RandomTeam: + { + TourneyParticipant[] parts = new TourneyParticipant[partsPerMatch]; + + for (int i = 0; i < partsPerMatch; ++i) + parts[i] = new TourneyParticipant(new List()); + + for (int i = 0; i < copy.Count; ++i) + parts[i % parts.Length].Players.AddRange(copy[i].Players); + + level.Matches.Add(new TourneyMatch(new List(parts))); + break; + } + case TourneyType.FreeForAll: + { + level.Matches.Add(new TourneyMatch(copy)); + break; + } + case TourneyType.Standard: + { + if (partsPerMatch >= 2 && participants.Count % partsPerMatch == 1) + { + int lowAdvances = int.MaxValue; + + for (int i = 0; i < participants.Count; ++i) + { + TourneyParticipant p = participants[i]; + + if (p.FreeAdvances < lowAdvances) + lowAdvances = p.FreeAdvances; + } + + List toAdvance = new List(); + + for (int i = 0; i < participants.Count; ++i) + { + TourneyParticipant p = participants[i]; + + if (p.FreeAdvances == lowAdvances) + toAdvance.Add(p); + } + + if (toAdvance.Count == 0) + toAdvance = copy; // sanity + + int idx = Utility.Random(toAdvance.Count); + + toAdvance[idx].AddLog( + "Advanced automatically due to an odd number of challengers."); + level.FreeAdvance = toAdvance[idx]; + ++level.FreeAdvance.FreeAdvances; + copy.Remove(toAdvance[idx]); + } + + while (copy.Count >= partsPerMatch) + { + List thisMatch = new List(); + + for (int i = 0; i < partsPerMatch; ++i) + { + int idx = 0; + + switch (groupType) + { + case GroupingType.HighVsLow: + idx = i * (copy.Count - 1) / (partsPerMatch - 1); + break; + case GroupingType.Nearest: + idx = 0; + break; + case GroupingType.Random: + idx = Utility.Random(copy.Count); + break; + } + + thisMatch.Add(copy[idx]); + copy.RemoveAt(idx); + } + + level.Matches.Add(new TourneyMatch(thisMatch)); + } + + if (copy.Count > 1) + level.Matches.Add(new TourneyMatch(copy)); + + break; + } + } + + Levels.Add(level); + } + } + + public class PyramidLevel + { + public List Matches{ get; set; } = new List(); + public TourneyParticipant FreeAdvance{ get; set; } + } +} diff --git a/Projects/Scripts/Engines/ConPVP/TournamentSignupItem.cs b/Projects/Scripts/Engines/ConPVP/TournamentSignupItem.cs index b03dbefaf..d7631da5a 100644 --- a/Projects/Scripts/Engines/ConPVP/TournamentSignupItem.cs +++ b/Projects/Scripts/Engines/ConPVP/TournamentSignupItem.cs @@ -1,149 +1,146 @@ -using System.Collections.Generic; -using Server.Factions; -using Server.Mobiles; -using Server.Network; - -namespace Server.Engines.ConPVP -{ -public class TournamentSignupItem : Item - { - [Constructible] - public TournamentSignupItem() : base(4029) - { - Movable = false; - } - - public TournamentSignupItem(Serial serial) : base(serial) - { - } - - [CommandProperty(AccessLevel.GameMaster)] - public TournamentController Tournament{ get; set; } - - [CommandProperty(AccessLevel.GameMaster)] - public Mobile Registrar{ get; set; } - - public override string DefaultName => "tournament signup book"; - - public override void OnDoubleClick(Mobile from) - { - if (!from.InRange(GetWorldLocation(), 2)) - { - from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that - } - else - { - Tournament tourney = Tournament?.Tournament; - - if (tourney == null) - return; - - if (Registrar != null) - Registrar.Direction = Registrar.GetDirectionTo(this); - - switch (tourney.Stage) - { - case TournamentStage.Fighting: - { - if (Registrar != null) - { - if (tourney.HasParticipant(from)) - Registrar.PrivateOverheadMessage(MessageType.Regular, - 0x35, false, "Excuse me? You are already signed up.", from.NetState); - else - Registrar.PrivateOverheadMessage(MessageType.Regular, - 0x22, false, "The tournament has already begun. You are too late to signup now.", - from.NetState); - } - - break; - } - case TournamentStage.Inactive: - { - Registrar?.PrivateOverheadMessage(MessageType.Regular, - 0x35, false, "The tournament is closed.", from.NetState); - - break; - } - case TournamentStage.Signup: - { - Ladder ladder = Ladder.Instance; - LadderEntry entry = ladder?.Find(from); - - if (entry != null && Ladder.GetLevel(entry.Experience) < tourney.LevelRequirement) - { - Registrar?.PrivateOverheadMessage(MessageType.Regular, - 0x35, false, "You have not yet proven yourself a worthy dueler.", from.NetState); - - break; - } - - if (tourney.IsFactionRestricted && Faction.Find(from) == null) - { - Registrar?.PrivateOverheadMessage(MessageType.Regular, - 0x35, false, "Only those who have declared their faction allegiance may participate.", - from.NetState); - - break; - } - - if (from.HasGump()) - { - Registrar?.PrivateOverheadMessage(MessageType.Regular, - 0x22, false, "You must first respond to the offer I've given you.", from.NetState); - } - else if (from.HasGump()) - { - Registrar?.PrivateOverheadMessage(MessageType.Regular, - 0x22, false, "You must first cancel your duel offer.", from.NetState); - } - else if (from is PlayerMobile mobile && mobile.DuelContext != null) - { - Registrar?.PrivateOverheadMessage(MessageType.Regular, - 0x22, false, "You are already participating in a duel.", mobile.NetState); - } - else if (!tourney.HasParticipant(from)) - { - from.CloseGump(); - from.SendGump(new ConfirmSignupGump(from, Registrar, tourney, new List { from })); - } - else - { - Registrar?.PrivateOverheadMessage(MessageType.Regular, - 0x35, false, "You have already entered this tournament.", from.NetState); - } - - break; - } - } - } - } - - public override void Serialize(GenericWriter writer) - { - base.Serialize(writer); - - writer.Write(0); - - writer.Write(Tournament); - writer.Write(Registrar); - } - - public override void Deserialize(GenericReader reader) - { - base.Deserialize(reader); - - int version = reader.ReadInt(); - - switch (version) - { - case 0: - { - Tournament = reader.ReadItem() as TournamentController; - Registrar = reader.ReadMobile(); - break; - } - } - } - } +using System.Collections.Generic; +using Server.Factions; +using Server.Mobiles; +using Server.Network; + +namespace Server.Engines.ConPVP +{ +public class TournamentSignupItem : Item + { + [Constructible] + public TournamentSignupItem() : base(4029) => Movable = false; + + public TournamentSignupItem(Serial serial) : base(serial) + { + } + + [CommandProperty(AccessLevel.GameMaster)] + public TournamentController Tournament{ get; set; } + + [CommandProperty(AccessLevel.GameMaster)] + public Mobile Registrar{ get; set; } + + public override string DefaultName => "tournament signup book"; + + public override void OnDoubleClick(Mobile from) + { + if (!from.InRange(GetWorldLocation(), 2)) + { + from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that + } + else + { + Tournament tourney = Tournament?.Tournament; + + if (tourney == null) + return; + + if (Registrar != null) + Registrar.Direction = Registrar.GetDirectionTo(this); + + switch (tourney.Stage) + { + case TournamentStage.Fighting: + { + if (Registrar != null) + { + if (tourney.HasParticipant(from)) + Registrar.PrivateOverheadMessage(MessageType.Regular, + 0x35, false, "Excuse me? You are already signed up.", from.NetState); + else + Registrar.PrivateOverheadMessage(MessageType.Regular, + 0x22, false, "The tournament has already begun. You are too late to signup now.", + from.NetState); + } + + break; + } + case TournamentStage.Inactive: + { + Registrar?.PrivateOverheadMessage(MessageType.Regular, + 0x35, false, "The tournament is closed.", from.NetState); + + break; + } + case TournamentStage.Signup: + { + Ladder ladder = Ladder.Instance; + LadderEntry entry = ladder?.Find(from); + + if (entry != null && Ladder.GetLevel(entry.Experience) < tourney.LevelRequirement) + { + Registrar?.PrivateOverheadMessage(MessageType.Regular, + 0x35, false, "You have not yet proven yourself a worthy dueler.", from.NetState); + + break; + } + + if (tourney.IsFactionRestricted && Faction.Find(from) == null) + { + Registrar?.PrivateOverheadMessage(MessageType.Regular, + 0x35, false, "Only those who have declared their faction allegiance may participate.", + from.NetState); + + break; + } + + if (from.HasGump()) + { + Registrar?.PrivateOverheadMessage(MessageType.Regular, + 0x22, false, "You must first respond to the offer I've given you.", from.NetState); + } + else if (from.HasGump()) + { + Registrar?.PrivateOverheadMessage(MessageType.Regular, + 0x22, false, "You must first cancel your duel offer.", from.NetState); + } + else if (from is PlayerMobile mobile && mobile.DuelContext != null) + { + Registrar?.PrivateOverheadMessage(MessageType.Regular, + 0x22, false, "You are already participating in a duel.", mobile.NetState); + } + else if (!tourney.HasParticipant(from)) + { + from.CloseGump(); + from.SendGump(new ConfirmSignupGump(from, Registrar, tourney, new List { from })); + } + else + { + Registrar?.PrivateOverheadMessage(MessageType.Regular, + 0x35, false, "You have already entered this tournament.", from.NetState); + } + + break; + } + } + } + } + + public override void Serialize(GenericWriter writer) + { + base.Serialize(writer); + + writer.Write(0); + + writer.Write(Tournament); + writer.Write(Registrar); + } + + public override void Deserialize(GenericReader reader) + { + base.Deserialize(reader); + + int version = reader.ReadInt(); + + switch (version) + { + case 0: + { + Tournament = reader.ReadItem() as TournamentController; + Registrar = reader.ReadMobile(); + break; + } + } + } + } } \ No newline at end of file diff --git a/Projects/Scripts/Engines/ConPVP/TourneyParticipant.cs b/Projects/Scripts/Engines/ConPVP/TourneyParticipant.cs index bcd77cbd1..7591a527b 100644 --- a/Projects/Scripts/Engines/ConPVP/TourneyParticipant.cs +++ b/Projects/Scripts/Engines/ConPVP/TourneyParticipant.cs @@ -81,10 +81,7 @@ namespace Server.Engines.ConPVP } } - public int CompareTo(TourneyParticipant p) - { - return p.TotalLadderXP - TotalLadderXP; - } + public int CompareTo(TourneyParticipant p) => p.TotalLadderXP - TotalLadderXP; public void AddLog(string text) { diff --git a/Projects/Scripts/Engines/Craft/Core/CraftGroupCol.cs b/Projects/Scripts/Engines/Craft/Core/CraftGroupCol.cs index f6d698c97..196924e4a 100644 --- a/Projects/Scripts/Engines/Craft/Core/CraftGroupCol.cs +++ b/Projects/Scripts/Engines/Craft/Core/CraftGroupCol.cs @@ -4,10 +4,7 @@ namespace Server.Engines.Craft { public class CraftGroupCol : CollectionBase { - public int Add(CraftGroup craftGroup) - { - return List.Add(craftGroup); - } + public int Add(CraftGroup craftGroup) => List.Add(craftGroup); public void Remove(int index) { @@ -20,10 +17,7 @@ namespace Server.Engines.Craft } } - public CraftGroup GetAt(int index) - { - return (CraftGroup)List[index]; - } + public CraftGroup GetAt(int index) => (CraftGroup)List[index]; public int SearchFor(TextDefinition groupName) { diff --git a/Projects/Scripts/Engines/Craft/Core/CraftGump.cs b/Projects/Scripts/Engines/Craft/Core/CraftGump.cs index 97dcb7cc8..2a0b866dd 100644 --- a/Projects/Scripts/Engines/Craft/Core/CraftGump.cs +++ b/Projects/Scripts/Engines/Craft/Core/CraftGump.cs @@ -339,10 +339,7 @@ namespace Server.Engines.Craft return craftGroupCol.Count; } - public static int GetButtonID(int type, int index) - { - return 1 + type + index * 7; - } + public static int GetButtonID(int type, int index) => 1 + type + index * 7; public void CraftItem(CraftItem item) { diff --git a/Projects/Scripts/Engines/Craft/Core/CraftItem.cs b/Projects/Scripts/Engines/Craft/Core/CraftItem.cs index 6562b2cee..13644ba2c 100644 --- a/Projects/Scripts/Engines/Craft/Core/CraftItem.cs +++ b/Projects/Scripts/Engines/Craft/Core/CraftItem.cs @@ -424,10 +424,8 @@ namespace Server.Engines.Craft } public bool ConsumeRes(Mobile from, Type typeRes, CraftSystem craftSystem, ref int resHue, ref int maxAmount, - ConsumeType consumeType, ref object message) - { - return ConsumeRes(from, typeRes, craftSystem, ref resHue, ref maxAmount, consumeType, ref message, false); - } + ConsumeType consumeType, ref object message) => + ConsumeRes(from, typeRes, craftSystem, ref resHue, ref maxAmount, consumeType, ref message, false); public bool ConsumeRes(Mobile from, Type typeRes, CraftSystem craftSystem, ref int resHue, ref int maxAmount, ConsumeType consumeType, ref object message, bool isFailure) @@ -639,10 +637,7 @@ namespace Server.Engines.Craft } } - private int CheckHueGrouping(Item a, Item b) - { - return b.Hue.CompareTo(a.Hue); - } + private int CheckHueGrouping(Item a, Item b) => b.Hue.CompareTo(a.Hue); public double GetExceptionalChance(CraftSystem system, double chance, Mobile from) { @@ -686,10 +681,8 @@ namespace Server.Engines.Craft } public bool CheckSkills(Mobile from, Type typeRes, CraftSystem craftSystem, ref int quality, - ref bool allRequiredSkills) - { - return CheckSkills(from, typeRes, craftSystem, ref quality, ref allRequiredSkills, true); - } + ref bool allRequiredSkills) => + CheckSkills(from, typeRes, craftSystem, ref quality, ref allRequiredSkills, true); public bool CheckSkills(Mobile from, Type typeRes, CraftSystem craftSystem, ref int quality, ref bool allRequiredSkills, bool gainSkills) diff --git a/Projects/Scripts/Engines/Craft/Core/CraftItemCol.cs b/Projects/Scripts/Engines/Craft/Core/CraftItemCol.cs index b9eebad2d..a7149dcfc 100644 --- a/Projects/Scripts/Engines/Craft/Core/CraftItemCol.cs +++ b/Projects/Scripts/Engines/Craft/Core/CraftItemCol.cs @@ -5,10 +5,7 @@ namespace Server.Engines.Craft { public class CraftItemCol : CollectionBase { - public int Add(CraftItem craftItem) - { - return List.Add(craftItem); - } + public int Add(CraftItem craftItem) => List.Add(craftItem); public void Remove(int index) { @@ -21,10 +18,7 @@ namespace Server.Engines.Craft } } - public CraftItem GetAt(int index) - { - return (CraftItem)List[index]; - } + public CraftItem GetAt(int index) => (CraftItem)List[index]; public CraftItem SearchForSubclass(Type type) { diff --git a/Projects/Scripts/Engines/Craft/Core/CraftItemIDAttribute.cs b/Projects/Scripts/Engines/Craft/Core/CraftItemIDAttribute.cs index 0e336ce1b..74cc0d9f6 100644 --- a/Projects/Scripts/Engines/Craft/Core/CraftItemIDAttribute.cs +++ b/Projects/Scripts/Engines/Craft/Core/CraftItemIDAttribute.cs @@ -5,10 +5,7 @@ namespace Server.Engines.Craft [AttributeUsage(AttributeTargets.Class)] public class CraftItemIDAttribute : Attribute { - public CraftItemIDAttribute(int itemID) - { - ItemID = itemID; - } + public CraftItemIDAttribute(int itemID) => ItemID = itemID; public int ItemID{ get; } } diff --git a/Projects/Scripts/Engines/Craft/Core/CraftResCol.cs b/Projects/Scripts/Engines/Craft/Core/CraftResCol.cs index ee49696c4..49a489b48 100644 --- a/Projects/Scripts/Engines/Craft/Core/CraftResCol.cs +++ b/Projects/Scripts/Engines/Craft/Core/CraftResCol.cs @@ -20,9 +20,6 @@ namespace Server.Engines.Craft } } - public CraftRes GetAt(int index) - { - return (CraftRes)List[index]; - } + public CraftRes GetAt(int index) => (CraftRes)List[index]; } } \ No newline at end of file diff --git a/Projects/Scripts/Engines/Craft/Core/CraftSkillCol.cs b/Projects/Scripts/Engines/Craft/Core/CraftSkillCol.cs index ffc23c919..11d58ccd4 100644 --- a/Projects/Scripts/Engines/Craft/Core/CraftSkillCol.cs +++ b/Projects/Scripts/Engines/Craft/Core/CraftSkillCol.cs @@ -20,9 +20,6 @@ namespace Server.Engines.Craft } } - public CraftSkill GetAt(int index) - { - return (CraftSkill)List[index]; - } + public CraftSkill GetAt(int index) => (CraftSkill)List[index]; } } \ No newline at end of file diff --git a/Projects/Scripts/Engines/Craft/Core/CraftSubResCol.cs b/Projects/Scripts/Engines/Craft/Core/CraftSubResCol.cs index aea002dd1..1bad74936 100644 --- a/Projects/Scripts/Engines/Craft/Core/CraftSubResCol.cs +++ b/Projects/Scripts/Engines/Craft/Core/CraftSubResCol.cs @@ -5,10 +5,7 @@ namespace Server.Engines.Craft { public class CraftSubResCol : CollectionBase { - public CraftSubResCol() - { - Init = false; - } + public CraftSubResCol() => Init = false; public bool Init{ get; set; } @@ -34,10 +31,7 @@ namespace Server.Engines.Craft } } - public CraftSubRes GetAt(int index) - { - return (CraftSubRes)List[index]; - } + public CraftSubRes GetAt(int index) => (CraftSubRes)List[index]; public CraftSubRes SearchFor(Type type) { diff --git a/Projects/Scripts/Engines/Craft/Core/CraftSystem.cs b/Projects/Scripts/Engines/Craft/Core/CraftSystem.cs index 6490fb5e6..422919f62 100644 --- a/Projects/Scripts/Engines/Craft/Core/CraftSystem.cs +++ b/Projects/Scripts/Engines/Craft/Core/CraftSystem.cs @@ -65,10 +65,7 @@ namespace Server.Engines.Craft public abstract double GetChanceAtMin(CraftItem item); - public virtual bool RetainsColorFrom(CraftItem item, Type type) - { - return false; - } + public virtual bool RetainsColorFrom(CraftItem item, Type type) => false; public CraftContext GetContext(Mobile m) { @@ -92,10 +89,7 @@ namespace Server.Engines.Craft GetContext(m)?.OnMade(item); } - public virtual bool ConsumeOnFailure(Mobile from, Type resourceType, CraftItem craftItem) - { - return true; - } + public virtual bool ConsumeOnFailure(Mobile from, Type resourceType, CraftItem craftItem) => true; public void CreateItem(Mobile from, Type type, Type typeRes, BaseTool tool, CraftItem realCraftItem) { @@ -122,22 +116,16 @@ namespace Server.Engines.Craft public int AddCraft(Type typeItem, TextDefinition group, TextDefinition name, double minSkill, double maxSkill, - Type typeRes, TextDefinition nameRes, int amount) - { - return AddCraft(typeItem, group, name, MainSkill, minSkill, maxSkill, typeRes, nameRes, amount, ""); - } + Type typeRes, TextDefinition nameRes, int amount) => + AddCraft(typeItem, group, name, MainSkill, minSkill, maxSkill, typeRes, nameRes, amount, ""); public int AddCraft(Type typeItem, TextDefinition group, TextDefinition name, double minSkill, double maxSkill, - Type typeRes, TextDefinition nameRes, int amount, TextDefinition message) - { - return AddCraft(typeItem, group, name, MainSkill, minSkill, maxSkill, typeRes, nameRes, amount, message); - } + Type typeRes, TextDefinition nameRes, int amount, TextDefinition message) => + AddCraft(typeItem, group, name, MainSkill, minSkill, maxSkill, typeRes, nameRes, amount, message); public int AddCraft(Type typeItem, TextDefinition group, TextDefinition name, SkillName skillToMake, double minSkill, - double maxSkill, Type typeRes, TextDefinition nameRes, int amount) - { - return AddCraft(typeItem, group, name, skillToMake, minSkill, maxSkill, typeRes, nameRes, amount, ""); - } + double maxSkill, Type typeRes, TextDefinition nameRes, int amount) => + AddCraft(typeItem, group, name, skillToMake, minSkill, maxSkill, typeRes, nameRes, amount, ""); public int AddCraft(Type typeItem, TextDefinition group, TextDefinition name, SkillName skillToMake, double minSkill, double maxSkill, Type typeRes, TextDefinition nameRes, int amount, TextDefinition message) diff --git a/Projects/Scripts/Engines/Craft/Core/Repair.cs b/Projects/Scripts/Engines/Craft/Core/Repair.cs index e27aba97a..2d74fc499 100644 --- a/Projects/Scripts/Engines/Craft/Core/Repair.cs +++ b/Projects/Scripts/Engines/Craft/Core/Repair.cs @@ -37,21 +37,11 @@ namespace Server.Engines.Craft m_Deed = deed; } - private int GetWeakenChance(Mobile mob, SkillName skill, int curHits, int maxHits) - { - // 40% - (1% per hp lost) - (1% per 10 craft skill) - return 40 + (maxHits - curHits) - (int)((m_Deed?.SkillLevel ?? mob.Skills[skill].Value) / 10); - } + private int GetWeakenChance(Mobile mob, SkillName skill, int curHits, int maxHits) => 40 + (maxHits - curHits) - (int)((m_Deed?.SkillLevel ?? mob.Skills[skill].Value) / 10); - private bool CheckWeaken(Mobile mob, SkillName skill, int curHits, int maxHits) - { - return GetWeakenChance(mob, skill, curHits, maxHits) > Utility.Random(100); - } + private bool CheckWeaken(Mobile mob, SkillName skill, int curHits, int maxHits) => GetWeakenChance(mob, skill, curHits, maxHits) > Utility.Random(100); - private int GetRepairDifficulty(int curHits, int maxHits) - { - return (maxHits - curHits) * 1250 / Math.Max(maxHits, 1) - 250; - } + private int GetRepairDifficulty(int curHits, int maxHits) => (maxHits - curHits) * 1250 / Math.Max(maxHits, 1) - 250; private bool CheckRepairDifficulty(Mobile mob, SkillName skill, int curHits, int maxHits) { diff --git a/Projects/Scripts/Engines/Craft/DefAlchemy.cs b/Projects/Scripts/Engines/Craft/DefAlchemy.cs index 09e7572ca..85746fc1f 100644 --- a/Projects/Scripts/Engines/Craft/DefAlchemy.cs +++ b/Projects/Scripts/Engines/Craft/DefAlchemy.cs @@ -19,10 +19,7 @@ namespace Server.Engines.Craft public static CraftSystem CraftSystem => m_CraftSystem ?? (m_CraftSystem = new DefAlchemy()); - public override double GetChanceAtMin(CraftItem item) - { - return 0.0; // 0% - } + public override double GetChanceAtMin(CraftItem item) => 0.0; public override int CanCraft(Mobile from, BaseTool tool, Type itemType) { @@ -40,10 +37,7 @@ namespace Server.Engines.Craft from.PlaySound(0x242); } - public static bool IsPotion(Type type) - { - return typeofPotion.IsAssignableFrom(type); - } + public static bool IsPotion(Type type) => typeofPotion.IsAssignableFrom(type); public override int PlayEndingEffect(Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item) diff --git a/Projects/Scripts/Engines/Craft/DefBlacksmithy.cs b/Projects/Scripts/Engines/Craft/DefBlacksmithy.cs index fd42bc0f9..c68c961ab 100644 --- a/Projects/Scripts/Engines/Craft/DefBlacksmithy.cs +++ b/Projects/Scripts/Engines/Craft/DefBlacksmithy.cs @@ -34,10 +34,7 @@ namespace Server.Engines.Craft public override CraftECA ECA => CraftECA.ChanceMinusSixtyToFourtyFive; - public override double GetChanceAtMin(CraftItem item) - { - return 0.0; // 0% - } + public override double GetChanceAtMin(CraftItem item) => 0.0; public static void CheckAnvilAndForge(Mobile from, int range, out bool anvil, out bool forge) { @@ -773,10 +770,7 @@ namespace Server.Engines.Craft { private Mobile m_From; - public InternalTimer(Mobile from) : base(TimeSpan.FromSeconds(0.7)) - { - m_From = from; - } + public InternalTimer(Mobile from) : base(TimeSpan.FromSeconds(0.7)) => m_From = from; protected override void OnTick() { diff --git a/Projects/Scripts/Engines/Craft/DefBowFletching.cs b/Projects/Scripts/Engines/Craft/DefBowFletching.cs index 5d6b385fc..1af14ebf7 100644 --- a/Projects/Scripts/Engines/Craft/DefBowFletching.cs +++ b/Projects/Scripts/Engines/Craft/DefBowFletching.cs @@ -19,10 +19,7 @@ namespace Server.Engines.Craft public override CraftECA ECA => CraftECA.FiftyPercentChanceMinusTenPercent; - public override double GetChanceAtMin(CraftItem item) - { - return 0.5; // 50% - } + public override double GetChanceAtMin(CraftItem item) => 0.5; public override int CanCraft(Mobile from, BaseTool tool, Type itemType) { diff --git a/Projects/Scripts/Engines/Craft/DefCarpentry.cs b/Projects/Scripts/Engines/Craft/DefCarpentry.cs index a4a1ee132..4e965a2f0 100644 --- a/Projects/Scripts/Engines/Craft/DefCarpentry.cs +++ b/Projects/Scripts/Engines/Craft/DefCarpentry.cs @@ -17,10 +17,7 @@ namespace Server.Engines.Craft public static CraftSystem CraftSystem => m_CraftSystem ?? (m_CraftSystem = new DefCarpentry()); - public override double GetChanceAtMin(CraftItem item) - { - return 0.5; // 50% - } + public override double GetChanceAtMin(CraftItem item) => 0.5; public override int CanCraft(Mobile from, BaseTool tool, Type itemType) { diff --git a/Projects/Scripts/Engines/Craft/DefCartography.cs b/Projects/Scripts/Engines/Craft/DefCartography.cs index 66207d36d..370664838 100644 --- a/Projects/Scripts/Engines/Craft/DefCartography.cs +++ b/Projects/Scripts/Engines/Craft/DefCartography.cs @@ -17,10 +17,7 @@ namespace Server.Engines.Craft public static CraftSystem CraftSystem => m_CraftSystem ?? (m_CraftSystem = new DefCartography()); - public override double GetChanceAtMin(CraftItem item) - { - return 0.0; // 0% - } + public override double GetChanceAtMin(CraftItem item) => 0.0; public override int CanCraft(Mobile from, BaseTool tool, Type itemType) { diff --git a/Projects/Scripts/Engines/Craft/DefCooking.cs b/Projects/Scripts/Engines/Craft/DefCooking.cs index 8afb26226..b37f7d4af 100644 --- a/Projects/Scripts/Engines/Craft/DefCooking.cs +++ b/Projects/Scripts/Engines/Craft/DefCooking.cs @@ -19,10 +19,7 @@ namespace Server.Engines.Craft public override CraftECA ECA => CraftECA.ChanceMinusSixtyToFourtyFive; - public override double GetChanceAtMin(CraftItem item) - { - return 0.0; // 0% - } + public override double GetChanceAtMin(CraftItem item) => 0.0; public override int CanCraft(Mobile from, BaseTool tool, Type itemType) { diff --git a/Projects/Scripts/Engines/Craft/DefGlassblowing.cs b/Projects/Scripts/Engines/Craft/DefGlassblowing.cs index c17378390..4daf3d40f 100644 --- a/Projects/Scripts/Engines/Craft/DefGlassblowing.cs +++ b/Projects/Scripts/Engines/Craft/DefGlassblowing.cs @@ -18,10 +18,7 @@ namespace Server.Engines.Craft public static CraftSystem CraftSystem => m_CraftSystem ?? (m_CraftSystem = new DefGlassblowing()); - public override double GetChanceAtMin(CraftItem item) - { - return item.ItemType == typeof(HollowPrism) ? 0.5 : 0.0; - } + public override double GetChanceAtMin(CraftItem item) => item.ItemType == typeof(HollowPrism) ? 0.5 : 0.0; public override int CanCraft(Mobile from, BaseTool tool, Type itemType) { @@ -102,10 +99,7 @@ namespace Server.Engines.Craft { private Mobile m_From; - public InternalTimer(Mobile from) : base(TimeSpan.FromSeconds(0.7)) - { - m_From = from; - } + public InternalTimer(Mobile from) : base(TimeSpan.FromSeconds(0.7)) => m_From = from; protected override void OnTick() { diff --git a/Projects/Scripts/Engines/Craft/DefInscription.cs b/Projects/Scripts/Engines/Craft/DefInscription.cs index c1922259e..d8a5892eb 100644 --- a/Projects/Scripts/Engines/Craft/DefInscription.cs +++ b/Projects/Scripts/Engines/Craft/DefInscription.cs @@ -38,10 +38,7 @@ namespace Server.Engines.Craft public static CraftSystem CraftSystem => m_CraftSystem ?? (m_CraftSystem = new DefInscription()); - public override double GetChanceAtMin(CraftItem item) - { - return 0.0; // 0% - } + public override double GetChanceAtMin(CraftItem item) => 0.0; public override int CanCraft(Mobile from, BaseTool tool, Type typeItem) { diff --git a/Projects/Scripts/Engines/Craft/DefMasonry.cs b/Projects/Scripts/Engines/Craft/DefMasonry.cs index 1e73469b1..66b193e29 100644 --- a/Projects/Scripts/Engines/Craft/DefMasonry.cs +++ b/Projects/Scripts/Engines/Craft/DefMasonry.cs @@ -18,15 +18,9 @@ namespace Server.Engines.Craft public static CraftSystem CraftSystem => m_CraftSystem ?? (m_CraftSystem = new DefMasonry()); - public override double GetChanceAtMin(CraftItem item) - { - return 0.0; // 0% - } + public override double GetChanceAtMin(CraftItem item) => 0.0; - public override bool RetainsColorFrom(CraftItem item, Type type) - { - return true; - } + public override bool RetainsColorFrom(CraftItem item, Type type) => true; public override int CanCraft(Mobile from, BaseTool tool, Type itemType) { @@ -119,10 +113,7 @@ namespace Server.Engines.Craft { private Mobile m_From; - public InternalTimer(Mobile from) : base(TimeSpan.FromSeconds(0.7)) - { - m_From = from; - } + public InternalTimer(Mobile from) : base(TimeSpan.FromSeconds(0.7)) => m_From = from; protected override void OnTick() { diff --git a/Projects/Scripts/Engines/Craft/DefTailoring.cs b/Projects/Scripts/Engines/Craft/DefTailoring.cs index b2e3430a5..cc4185fb8 100644 --- a/Projects/Scripts/Engines/Craft/DefTailoring.cs +++ b/Projects/Scripts/Engines/Craft/DefTailoring.cs @@ -27,10 +27,7 @@ namespace Server.Engines.Craft public override CraftECA ECA => CraftECA.ChanceMinusSixtyToFourtyFive; - public override double GetChanceAtMin(CraftItem item) - { - return 0.5; // 50% - } + public override double GetChanceAtMin(CraftItem item) => 0.5; public override int CanCraft(Mobile from, BaseTool tool, Type itemType) { diff --git a/Projects/Scripts/Engines/Craft/DefTinkering.cs b/Projects/Scripts/Engines/Craft/DefTinkering.cs index 813e074dd..e2cd7f346 100644 --- a/Projects/Scripts/Engines/Craft/DefTinkering.cs +++ b/Projects/Scripts/Engines/Craft/DefTinkering.cs @@ -473,10 +473,7 @@ namespace Server.Engines.Craft { private TrapCraft m_TrapCraft; - public ContainerTarget(TrapCraft trapCraft) : base(-1, false, TargetFlags.None) - { - m_TrapCraft = trapCraft; - } + public ContainerTarget(TrapCraft trapCraft) : base(-1, false, TargetFlags.None) => m_TrapCraft = trapCraft; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Engines/Doom/LeverPuzzle/LeverPuzzleController.cs b/Projects/Scripts/Engines/Doom/LeverPuzzle/LeverPuzzleController.cs index d4c5d4598..058ad0a1e 100644 --- a/Projects/Scripts/Engines/Doom/LeverPuzzle/LeverPuzzleController.cs +++ b/Projects/Scripts/Engines/Doom/LeverPuzzle/LeverPuzzleController.cs @@ -368,12 +368,10 @@ namespace Server.Engines.Doom } } - private static bool IsValidDamagable(Mobile m) - { - return m?.Deleted == false && - (m.Player && m.Alive || - m is BaseCreature bc && (bc.Controlled || bc.Summoned) && !bc.IsDeadBondedPet); - } + private static bool IsValidDamagable(Mobile m) => + m?.Deleted == false && + (m.Player && m.Alive || + m is BaseCreature bc && (bc.Controlled || bc.Summoned) && !bc.IsDeadBondedPet); public static void MoveMobileOut(Mobile m) { @@ -388,15 +386,9 @@ namespace Server.Engines.Doom } } - public static bool AniSafe(Mobile m) - { - return m?.BodyMod == 0 && m.Alive && !TransformationSpellHelper.UnderTransformation(m); - } + public static bool AniSafe(Mobile m) => m?.BodyMod == 0 && m.Alive && !TransformationSpellHelper.UnderTransformation(m); - public static IEntity ZAdjustedIEFromMobile(Mobile m, int ZDelta) - { - return new Entity(Serial.Zero, new Point3D(m.X, m.Y, m.Z + ZDelta), m.Map); - } + public static IEntity ZAdjustedIEFromMobile(Mobile m, int ZDelta) => new Entity(Serial.Zero, new Point3D(m.X, m.Y, m.Z + ZDelta), m.Map); public static void DoDamage(Mobile m, int min, int max, bool poison) { @@ -407,20 +399,11 @@ namespace Server.Engines.Doom } } - public static Point3D RandomPointIn(Point3D point, int range) - { - return RandomPointIn(point.X - range, point.Y - range, range * 2, range * 2, point.Z); - } + public static Point3D RandomPointIn(Point3D point, int range) => RandomPointIn(point.X - range, point.Y - range, range * 2, range * 2, point.Z); - public static Point3D RandomPointIn(Rectangle2D rect, int z) - { - return RandomPointIn(rect.X, rect.Y, rect.Height, rect.Width, z); - } + public static Point3D RandomPointIn(Rectangle2D rect, int z) => RandomPointIn(rect.X, rect.Y, rect.Height, rect.Width, z); - public static Point3D RandomPointIn(int x, int y, int x2, int y2, int z) - { - return new Point3D(Utility.Random(x, x2), Utility.Random(y, y2), z); - } + public static Point3D RandomPointIn(int x, int y, int x2, int y2, int z) => new Point3D(Utility.Random(x, x2), Utility.Random(y, y2), z); public static void PlaySounds(Point3D location, int[] sounds) { @@ -503,10 +486,7 @@ namespace Server.Engines.Doom m_Controller = Controller; } - private int Rock() - { - return 0x1363 + Utility.Random(0, 11); - } + private int Rock() => 0x1363 + Utility.Random(0, 11); protected override void OnTick() { @@ -571,10 +551,8 @@ namespace Server.Engines.Doom private Mobile m; public LampRoomKickTimer(Mobile player) - : base(TimeSpan.FromSeconds(.25)) - { + : base(TimeSpan.FromSeconds(.25)) => m = player; - } protected override void OnTick() { diff --git a/Projects/Scripts/Engines/Doom/LeverPuzzle/LeverPuzzleRegions.cs b/Projects/Scripts/Engines/Doom/LeverPuzzle/LeverPuzzleRegions.cs index 4c7898a07..193961bae 100644 --- a/Projects/Scripts/Engines/Doom/LeverPuzzle/LeverPuzzleRegions.cs +++ b/Projects/Scripts/Engines/Doom/LeverPuzzle/LeverPuzzleRegions.cs @@ -69,10 +69,7 @@ namespace Server.Engines.Doom kick.Start(); } - public override bool OnSkillUse(Mobile m, int Skill) /* just in case */ - { - return m_Controller.Successful != null && (m.AccessLevel != AccessLevel.Player || m == m_Controller.Successful); - } + public override bool OnSkillUse(Mobile m, int Skill) /* just in case */ => m_Controller.Successful != null && (m.AccessLevel != AccessLevel.Player || m == m_Controller.Successful); } public class LeverPuzzleRegion : BaseRegion diff --git a/Projects/Scripts/Engines/Ethics/Core/Ethic.cs b/Projects/Scripts/Engines/Ethics/Core/Ethic.cs index 333379997..555add67a 100644 --- a/Projects/Scripts/Engines/Ethics/Core/Ethic.cs +++ b/Projects/Scripts/Engines/Ethics/Core/Ethic.cs @@ -24,10 +24,7 @@ namespace Server.Ethics protected PlayerCollection m_Players; - public Ethic() - { - m_Players = new PlayerCollection(); - } + public Ethic() => m_Players = new PlayerCollection(); public EthicDefinition Definition => m_Definition; @@ -84,10 +81,7 @@ namespace Server.Ethics return false; } - public static bool IsImbued(Item item) - { - return IsImbued(item, false); - } + public static bool IsImbued(Item item) => IsImbued(item, false); public static bool IsImbued(Item item, bool recurse) { @@ -166,15 +160,9 @@ namespace Server.Ethics } } - public static Ethic Find(Mobile mob) - { - return Find(mob, false, false); - } + public static Ethic Find(Mobile mob) => Find(mob, false, false); - public static Ethic Find(Mobile mob, bool inherit) - { - return Find(mob, inherit, false); - } + public static Ethic Find(Mobile mob, bool inherit) => Find(mob, inherit, false); public static Ethic Find(Mobile mob, bool inherit, bool allegiance) { diff --git a/Projects/Scripts/Engines/Ethics/Core/Persistance.cs b/Projects/Scripts/Engines/Ethics/Core/Persistance.cs index 6396149e6..b1e823ef9 100644 --- a/Projects/Scripts/Engines/Ethics/Core/Persistance.cs +++ b/Projects/Scripts/Engines/Ethics/Core/Persistance.cs @@ -15,10 +15,8 @@ namespace Server.Ethics } public EthicsPersistance(Serial serial) - : base(serial) - { + : base(serial) => Instance = this; - } public static EthicsPersistance Instance{ get; private set; } diff --git a/Projects/Scripts/Engines/Ethics/Core/Player.cs b/Projects/Scripts/Engines/Ethics/Core/Player.cs index 3ee9468f8..2f60ba923 100644 --- a/Projects/Scripts/Engines/Ethics/Core/Player.cs +++ b/Projects/Scripts/Engines/Ethics/Core/Player.cs @@ -79,10 +79,7 @@ namespace Server.Ethics } } - public static Player Find(Mobile mob) - { - return Find(mob, false); - } + public static Player Find(Mobile mob) => Find(mob, false); public static Player Find(Mobile mob, bool inherit) { diff --git a/Projects/Scripts/Engines/Ethics/Evil/Powers/Blight.cs b/Projects/Scripts/Engines/Ethics/Evil/Powers/Blight.cs index 948794aa5..59a4216e4 100644 --- a/Projects/Scripts/Engines/Ethics/Evil/Powers/Blight.cs +++ b/Projects/Scripts/Engines/Ethics/Evil/Powers/Blight.cs @@ -7,15 +7,13 @@ namespace Server.Ethics.Evil { public sealed class Blight : Power { - public Blight() - { + public Blight() => m_Definition = new PowerDefinition( 15, "Blight", "Velgo Ontawl", "" ); - } public override void BeginInvoke(Player from) { diff --git a/Projects/Scripts/Engines/Ethics/Evil/Powers/SummonFamiliar.cs b/Projects/Scripts/Engines/Ethics/Evil/Powers/SummonFamiliar.cs index 53359a8cd..5f854207a 100644 --- a/Projects/Scripts/Engines/Ethics/Evil/Powers/SummonFamiliar.cs +++ b/Projects/Scripts/Engines/Ethics/Evil/Powers/SummonFamiliar.cs @@ -6,15 +6,13 @@ namespace Server.Ethics.Evil { public sealed class SummonFamiliar : Power { - public SummonFamiliar() - { + public SummonFamiliar() => m_Definition = new PowerDefinition( 5, "Summon Familiar", "Trubechs Vingir", "" ); - } public override void BeginInvoke(Player from) { diff --git a/Projects/Scripts/Engines/Ethics/Evil/Powers/UnholyItem.cs b/Projects/Scripts/Engines/Ethics/Evil/Powers/UnholyItem.cs index d25c99861..15cf89cb6 100644 --- a/Projects/Scripts/Engines/Ethics/Evil/Powers/UnholyItem.cs +++ b/Projects/Scripts/Engines/Ethics/Evil/Powers/UnholyItem.cs @@ -6,15 +6,13 @@ namespace Server.Ethics.Evil { public sealed class UnholyItem : Power { - public UnholyItem() - { + public UnholyItem() => m_Definition = new PowerDefinition( 5, "Unholy Item", "Vidda K'balc", "" ); - } public override void BeginInvoke(Player from) { diff --git a/Projects/Scripts/Engines/Ethics/Evil/Powers/UnholySense.cs b/Projects/Scripts/Engines/Ethics/Evil/Powers/UnholySense.cs index 3cf8f4ef3..faf336aad 100644 --- a/Projects/Scripts/Engines/Ethics/Evil/Powers/UnholySense.cs +++ b/Projects/Scripts/Engines/Ethics/Evil/Powers/UnholySense.cs @@ -6,15 +6,13 @@ namespace Server.Ethics.Evil { public sealed class UnholySense : Power { - public UnholySense() - { + public UnholySense() => m_Definition = new PowerDefinition( 0, "Unholy Sense", "Drewrok Velgo", "" ); - } public override void BeginInvoke(Player from) { diff --git a/Projects/Scripts/Engines/Ethics/Evil/Powers/UnholyShield.cs b/Projects/Scripts/Engines/Ethics/Evil/Powers/UnholyShield.cs index 466067dca..b4e75c93f 100644 --- a/Projects/Scripts/Engines/Ethics/Evil/Powers/UnholyShield.cs +++ b/Projects/Scripts/Engines/Ethics/Evil/Powers/UnholyShield.cs @@ -4,15 +4,13 @@ namespace Server.Ethics.Evil { public sealed class UnholyShield : Power { - public UnholyShield() - { + public UnholyShield() => m_Definition = new PowerDefinition( 20, "Unholy Shield", "Velgo K'blac", "" ); - } public override void BeginInvoke(Player from) { diff --git a/Projects/Scripts/Engines/Ethics/Evil/Powers/UnholySteed.cs b/Projects/Scripts/Engines/Ethics/Evil/Powers/UnholySteed.cs index fcef7b4e8..bfe591b1f 100644 --- a/Projects/Scripts/Engines/Ethics/Evil/Powers/UnholySteed.cs +++ b/Projects/Scripts/Engines/Ethics/Evil/Powers/UnholySteed.cs @@ -6,15 +6,13 @@ namespace Server.Ethics.Evil { public sealed class UnholySteed : Power { - public UnholySteed() - { + public UnholySteed() => m_Definition = new PowerDefinition( 30, "Unholy Steed", "Trubechs Yeliab", "" ); - } public override void BeginInvoke(Player from) { diff --git a/Projects/Scripts/Engines/Ethics/Evil/Powers/UnholyWord.cs b/Projects/Scripts/Engines/Ethics/Evil/Powers/UnholyWord.cs index 058ff80d9..3c5a4e54c 100644 --- a/Projects/Scripts/Engines/Ethics/Evil/Powers/UnholyWord.cs +++ b/Projects/Scripts/Engines/Ethics/Evil/Powers/UnholyWord.cs @@ -2,15 +2,13 @@ namespace Server.Ethics.Evil { public sealed class UnholyWord : Power { - public UnholyWord() - { + public UnholyWord() => m_Definition = new PowerDefinition( 100, "Unholy Word", "Velgo Oostrac", "" ); - } public override void BeginInvoke(Player from) { diff --git a/Projects/Scripts/Engines/Ethics/Evil/Powers/VileBlade.cs b/Projects/Scripts/Engines/Ethics/Evil/Powers/VileBlade.cs index ca30b19a7..f713df11e 100644 --- a/Projects/Scripts/Engines/Ethics/Evil/Powers/VileBlade.cs +++ b/Projects/Scripts/Engines/Ethics/Evil/Powers/VileBlade.cs @@ -2,15 +2,13 @@ namespace Server.Ethics.Evil { public sealed class VileBlade : Power { - public VileBlade() - { + public VileBlade() => m_Definition = new PowerDefinition( 10, "Vile Blade", "Velgo Reyam", "" ); - } public override void BeginInvoke(Player from) { diff --git a/Projects/Scripts/Engines/Ethics/Hero/Powers/Bless.cs b/Projects/Scripts/Engines/Ethics/Hero/Powers/Bless.cs index c9bc49b5c..f6ecfc8a6 100644 --- a/Projects/Scripts/Engines/Ethics/Hero/Powers/Bless.cs +++ b/Projects/Scripts/Engines/Ethics/Hero/Powers/Bless.cs @@ -7,15 +7,13 @@ namespace Server.Ethics.Hero { public sealed class Bless : Power { - public Bless() - { + public Bless() => m_Definition = new PowerDefinition( 15, "Bless", "Erstok Ontawl", "" ); - } public override void BeginInvoke(Player from) { diff --git a/Projects/Scripts/Engines/Ethics/Hero/Powers/HolyBlade.cs b/Projects/Scripts/Engines/Ethics/Hero/Powers/HolyBlade.cs index 3a199b687..b39f2a039 100644 --- a/Projects/Scripts/Engines/Ethics/Hero/Powers/HolyBlade.cs +++ b/Projects/Scripts/Engines/Ethics/Hero/Powers/HolyBlade.cs @@ -2,15 +2,13 @@ namespace Server.Ethics.Hero { public sealed class HolyBlade : Power { - public HolyBlade() - { + public HolyBlade() => m_Definition = new PowerDefinition( 10, "Holy Blade", "Erstok Reyam", "" ); - } public override void BeginInvoke(Player from) { diff --git a/Projects/Scripts/Engines/Ethics/Hero/Powers/HolyItem.cs b/Projects/Scripts/Engines/Ethics/Hero/Powers/HolyItem.cs index 06f6b5707..06eeeac62 100644 --- a/Projects/Scripts/Engines/Ethics/Hero/Powers/HolyItem.cs +++ b/Projects/Scripts/Engines/Ethics/Hero/Powers/HolyItem.cs @@ -6,15 +6,13 @@ namespace Server.Ethics.Hero { public sealed class HolyItem : Power { - public HolyItem() - { + public HolyItem() => m_Definition = new PowerDefinition( 5, "Holy Item", "Vidda K'balc", "" ); - } public override void BeginInvoke(Player from) { diff --git a/Projects/Scripts/Engines/Ethics/Hero/Powers/HolySense.cs b/Projects/Scripts/Engines/Ethics/Hero/Powers/HolySense.cs index 2aa21edd1..dff3df97c 100644 --- a/Projects/Scripts/Engines/Ethics/Hero/Powers/HolySense.cs +++ b/Projects/Scripts/Engines/Ethics/Hero/Powers/HolySense.cs @@ -6,15 +6,13 @@ namespace Server.Ethics.Hero { public sealed class HolySense : Power { - public HolySense() - { + public HolySense() => m_Definition = new PowerDefinition( 0, "Holy Sense", "Drewrok Erstok", "" ); - } public override void BeginInvoke(Player from) { diff --git a/Projects/Scripts/Engines/Ethics/Hero/Powers/HolyShield.cs b/Projects/Scripts/Engines/Ethics/Hero/Powers/HolyShield.cs index 576fbbde4..5345f244d 100644 --- a/Projects/Scripts/Engines/Ethics/Hero/Powers/HolyShield.cs +++ b/Projects/Scripts/Engines/Ethics/Hero/Powers/HolyShield.cs @@ -4,15 +4,13 @@ namespace Server.Ethics.Hero { public sealed class HolyShield : Power { - public HolyShield() - { + public HolyShield() => m_Definition = new PowerDefinition( 20, "Holy Shield", "Erstok K'blac", "" ); - } public override void BeginInvoke(Player from) { diff --git a/Projects/Scripts/Engines/Ethics/Hero/Powers/HolySteed.cs b/Projects/Scripts/Engines/Ethics/Hero/Powers/HolySteed.cs index 089e6e3a4..4df96f3bb 100644 --- a/Projects/Scripts/Engines/Ethics/Hero/Powers/HolySteed.cs +++ b/Projects/Scripts/Engines/Ethics/Hero/Powers/HolySteed.cs @@ -6,15 +6,13 @@ namespace Server.Ethics.Hero { public sealed class HolySteed : Power { - public HolySteed() - { + public HolySteed() => m_Definition = new PowerDefinition( 30, "Holy Steed", "Trubechs Yeliab", "" ); - } public override void BeginInvoke(Player from) { diff --git a/Projects/Scripts/Engines/Ethics/Hero/Powers/HolyWord.cs b/Projects/Scripts/Engines/Ethics/Hero/Powers/HolyWord.cs index 39de95af5..708c47826 100644 --- a/Projects/Scripts/Engines/Ethics/Hero/Powers/HolyWord.cs +++ b/Projects/Scripts/Engines/Ethics/Hero/Powers/HolyWord.cs @@ -2,15 +2,13 @@ namespace Server.Ethics.Hero { public sealed class HolyWord : Power { - public HolyWord() - { + public HolyWord() => m_Definition = new PowerDefinition( 100, "Holy Word", "Erstok Oostrac", "" ); - } public override void BeginInvoke(Player from) { diff --git a/Projects/Scripts/Engines/Ethics/Hero/Powers/SummonFamiliar.cs b/Projects/Scripts/Engines/Ethics/Hero/Powers/SummonFamiliar.cs index 1a43a8fa6..3315eb455 100644 --- a/Projects/Scripts/Engines/Ethics/Hero/Powers/SummonFamiliar.cs +++ b/Projects/Scripts/Engines/Ethics/Hero/Powers/SummonFamiliar.cs @@ -6,15 +6,13 @@ namespace Server.Ethics.Hero { public sealed class SummonFamiliar : Power { - public SummonFamiliar() - { + public SummonFamiliar() => m_Definition = new PowerDefinition( 5, "Summon Familiar", "Trubechs Vingir", "" ); - } public override void BeginInvoke(Player from) { diff --git a/Projects/Scripts/Engines/Factions/Core/Election.cs b/Projects/Scripts/Engines/Factions/Core/Election.cs index 93507910e..690b59b09 100644 --- a/Projects/Scripts/Engines/Factions/Core/Election.cs +++ b/Projects/Scripts/Engines/Factions/Core/Election.cs @@ -216,20 +216,11 @@ namespace Server.Factions } } - public bool IsCandidate(Mobile mob) - { - return FindCandidate(mob) != null; - } + public bool IsCandidate(Mobile mob) => FindCandidate(mob) != null; - public bool CanVote(Mobile mob) - { - return CurrentState == ElectionState.Election && !HasVoted(mob); - } + public bool CanVote(Mobile mob) => CurrentState == ElectionState.Election && !HasVoted(mob); - public bool HasVoted(Mobile mob) - { - return FindVoter(mob) != null; - } + public bool HasVoted(Mobile mob) => FindVoter(mob) != null; public Candidate FindCandidate(Mobile mob) { diff --git a/Projects/Scripts/Engines/Factions/Core/Faction.cs b/Projects/Scripts/Engines/Factions/Core/Faction.cs index d7d708aae..fb2a30699 100644 --- a/Projects/Scripts/Engines/Factions/Core/Faction.cs +++ b/Projects/Scripts/Engines/Factions/Core/Faction.cs @@ -27,10 +27,7 @@ namespace Server.Factions private FactionDefinition m_Definition; public int ZeroRankOffset; - public Faction() - { - State = new FactionState(this); - } + public Faction() => State = new FactionState(this); public StrongholdRegion StrongholdRegion{ get; set; } @@ -88,10 +85,7 @@ namespace Server.Factions public static List Factions => Reflector.Factions; - public int CompareTo(Faction f) - { - return m_Definition.Sort - (f?.m_Definition.Sort ?? 0); - } + public int CompareTo(Faction f) => m_Definition.Sort - (f?.m_Definition.Sort ?? 0); public void Broadcast(string text) { @@ -505,10 +499,7 @@ namespace Server.Factions return mob.AccessLevel >= AccessLevel.GameMaster || mob == Commander; } - public override string ToString() - { - return m_Definition.FriendlyName; - } + public override string ToString() => m_Definition.FriendlyName; public static bool CheckLeaveTimer(Mobile mob) { @@ -1160,10 +1151,7 @@ namespace Server.Factions { private Faction m_Faction; - public BroadcastPrompt(Faction faction) - { - m_Faction = faction; - } + public BroadcastPrompt(Faction faction) => m_Faction = faction; public override void OnResponse(Mobile from, string text) { @@ -1184,10 +1172,7 @@ namespace Server.Factions public Timer m_Timer; } - public static bool InSkillLoss(Mobile mob) - { - return m_SkillLoss.ContainsKey(mob); - } + public static bool InSkillLoss(Mobile mob) => m_SkillLoss.ContainsKey(mob); public static void ApplySkillLoss(Mobile mob) { diff --git a/Projects/Scripts/Engines/Factions/Core/Generator.cs b/Projects/Scripts/Engines/Factions/Core/Generator.cs index 22f2b49f5..945b13e25 100644 --- a/Projects/Scripts/Engines/Factions/Core/Generator.cs +++ b/Projects/Scripts/Engines/Factions/Core/Generator.cs @@ -67,9 +67,6 @@ namespace Server.Factions } } - private static bool CheckExistance(Point3D loc, Map facet, Type type) - { - return facet.GetItemsInRange(loc, 0).Any(type.IsInstanceOfType); - } + private static bool CheckExistance(Point3D loc, Map facet, Type type) => facet.GetItemsInRange(loc, 0).Any(type.IsInstanceOfType); } } \ No newline at end of file diff --git a/Projects/Scripts/Engines/Factions/Core/MerchantTitles.cs b/Projects/Scripts/Engines/Factions/Core/MerchantTitles.cs index e14e7f87c..b69512c3a 100644 --- a/Projects/Scripts/Engines/Factions/Core/MerchantTitles.cs +++ b/Projects/Scripts/Engines/Factions/Core/MerchantTitles.cs @@ -76,10 +76,7 @@ namespace Server.Factions return false; } - public static bool IsQualified(Mobile mob, MerchantTitle title) - { - return IsQualified(mob, GetInfo(title)); - } + public static bool IsQualified(Mobile mob, MerchantTitle title) => IsQualified(mob, GetInfo(title)); public static bool IsQualified(Mobile mob, MerchantTitleInfo info) { diff --git a/Projects/Scripts/Engines/Factions/Core/Persistance.cs b/Projects/Scripts/Engines/Factions/Core/Persistance.cs index cfdd0caac..db59fd71f 100644 --- a/Projects/Scripts/Engines/Factions/Core/Persistance.cs +++ b/Projects/Scripts/Engines/Factions/Core/Persistance.cs @@ -14,10 +14,7 @@ namespace Server.Factions base.Delete(); } - public FactionPersistance(Serial serial) : base(serial) - { - Instance = this; - } + public FactionPersistance(Serial serial) : base(serial) => Instance = this; public static FactionPersistance Instance{ get; private set; } diff --git a/Projects/Scripts/Engines/Factions/Core/PlayerState.cs b/Projects/Scripts/Engines/Factions/Core/PlayerState.cs index e9d0e11b8..121b8a7fe 100644 --- a/Projects/Scripts/Engines/Factions/Core/PlayerState.cs +++ b/Projects/Scripts/Engines/Factions/Core/PlayerState.cs @@ -241,10 +241,7 @@ namespace Server.Factions public bool IsActive{ get; set; } - public int CompareTo(PlayerState ps) - { - return (ps?.m_KillPoints ?? 0) - m_KillPoints; - } + public int CompareTo(PlayerState ps) => (ps?.m_KillPoints ?? 0) - m_KillPoints; public bool CanGiveSilverTo(Mobile mob) { @@ -295,9 +292,6 @@ namespace Server.Factions writer.Write(Leaving); } - public static PlayerState Find(Mobile mob) - { - return mob is PlayerMobile mobile ? mobile.FactionPlayerState : null; - } + public static PlayerState Find(Mobile mob) => mob is PlayerMobile mobile ? mobile.FactionPlayerState : null; } } diff --git a/Projects/Scripts/Engines/Factions/Core/StrongholdRegion.cs b/Projects/Scripts/Engines/Factions/Core/StrongholdRegion.cs index 71cbc3ee3..353647968 100644 --- a/Projects/Scripts/Engines/Factions/Core/StrongholdRegion.cs +++ b/Projects/Scripts/Engines/Factions/Core/StrongholdRegion.cs @@ -32,9 +32,6 @@ namespace Server.Factions return Faction.Find(m, true, true) != null; } - public override bool AllowHousing(Mobile from, Point3D p) - { - return false; - } + public override bool AllowHousing(Mobile from, Point3D p) => false; } } \ No newline at end of file diff --git a/Projects/Scripts/Engines/Factions/Core/Town.cs b/Projects/Scripts/Engines/Factions/Core/Town.cs index 4bca45747..635b6c67e 100644 --- a/Projects/Scripts/Engines/Factions/Core/Town.cs +++ b/Projects/Scripts/Engines/Factions/Core/Town.cs @@ -132,10 +132,7 @@ namespace Server.Factions public static List Towns => Reflector.Towns; - public int CompareTo(Town other) - { - return Definition.Sort - (other?.Definition.Sort ?? 0); - } + public int CompareTo(Town other) => Definition.Sort - (other?.Definition.Sort ?? 0); public static Town FromRegion(Region reg) { @@ -379,17 +376,13 @@ namespace Server.Factions CommandSystem.Register("GrantTownSilver", AccessLevel.Administrator, GrantTownSilver_OnCommand); } - public bool IsSheriff(Mobile mob) - { - return mob?.Deleted == false && - (mob.AccessLevel >= AccessLevel.GameMaster || mob == Sheriff); - } + public bool IsSheriff(Mobile mob) => + mob?.Deleted == false && + (mob.AccessLevel >= AccessLevel.GameMaster || mob == Sheriff); - public bool IsFinance(Mobile mob) - { - return mob?.Deleted == false && - (mob.AccessLevel >= AccessLevel.GameMaster || mob == Finance); - } + public bool IsFinance(Mobile mob) => + mob?.Deleted == false && + (mob.AccessLevel >= AccessLevel.GameMaster || mob == Finance); public void Capture(Faction f) { @@ -445,10 +438,7 @@ namespace Server.Factions ConstructGuardLists(); } - public override string ToString() - { - return Definition.FriendlyName; - } + public override string ToString() => Definition.FriendlyName; public static void WriteReference(GenericWriter writer, Town town) { diff --git a/Projects/Scripts/Engines/Factions/Core/TownState.cs b/Projects/Scripts/Engines/Factions/Core/TownState.cs index fcdf7a15e..c7ca2bd0c 100644 --- a/Projects/Scripts/Engines/Factions/Core/TownState.cs +++ b/Projects/Scripts/Engines/Factions/Core/TownState.cs @@ -7,10 +7,7 @@ namespace Server.Factions private Mobile m_Finance; private Mobile m_Sheriff; - public TownState(Town town) - { - Town = town; - } + public TownState(Town town) => Town = town; public TownState(GenericReader reader) { diff --git a/Projects/Scripts/Engines/Factions/Gumps/ElectionManagementGump.cs b/Projects/Scripts/Engines/Factions/Gumps/ElectionManagementGump.cs index d0028826f..27b520e55 100644 --- a/Projects/Scripts/Engines/Factions/Gumps/ElectionManagementGump.cs +++ b/Projects/Scripts/Engines/Factions/Gumps/ElectionManagementGump.cs @@ -138,25 +138,13 @@ namespace Server.Factions } } - public string Right(string text) - { - return $"
{text}
"; - } + public string Right(string text) => $"
{text}
"; - public string Center(string text) - { - return $"
{text}
"; - } + public string Center(string text) => $"
{text}
"; - public string Color(string text, int color) - { - return $"{text}"; - } + public string Color(string text, int color) => $"{text}"; - public static string FormatTimeSpan(TimeSpan ts) - { - return $"{ts.Days:D2}:{ts.Hours % 24:D2}:{ts.Minutes % 60:D2}:{ts.Seconds % 60:D2}"; - } + public static string FormatTimeSpan(TimeSpan ts) => $"{ts.Days:D2}:{ts.Hours % 24:D2}:{ts.Minutes % 60:D2}:{ts.Seconds % 60:D2}"; public override void OnResponse(NetState sender, RelayInfo info) { diff --git a/Projects/Scripts/Engines/Factions/Gumps/FactionGump.cs b/Projects/Scripts/Engines/Factions/Gumps/FactionGump.cs index 0ac6e7b64..328bf5956 100644 --- a/Projects/Scripts/Engines/Factions/Gumps/FactionGump.cs +++ b/Projects/Scripts/Engines/Factions/Gumps/FactionGump.cs @@ -10,10 +10,7 @@ namespace Server.Factions public virtual int ButtonTypes => 10; - public int ToButtonID(int type, int index) - { - return 1 + index * ButtonTypes + type; - } + public int ToButtonID(int type, int index) => 1 + index * ButtonTypes + type; public bool FromButtonID(int buttonID, out int type, out int index) { @@ -30,10 +27,7 @@ namespace Server.Factions return false; } - public static bool Exists(Mobile mob) - { - return mob.HasGump(); - } + public static bool Exists(Mobile mob) => mob.HasGump(); public void AddHtmlText(int x, int y, int width, int height, TextDefinition text, bool back, bool scroll) { diff --git a/Projects/Scripts/Engines/Factions/Instances/Towns/Britain.cs b/Projects/Scripts/Engines/Factions/Instances/Towns/Britain.cs index 5d93976ed..e89ba2bca 100644 --- a/Projects/Scripts/Engines/Factions/Instances/Towns/Britain.cs +++ b/Projects/Scripts/Engines/Factions/Instances/Towns/Britain.cs @@ -2,8 +2,7 @@ namespace Server.Factions { public class Britain : Town { - public Britain() - { + public Britain() => Definition = new TownDefinition( 0, @@ -19,6 +18,5 @@ namespace Server.Factions new TextDefinition(1041386, "Corrupted Faction Town Sigil of Britain"), new Point3D(1592, 1680, 10), new Point3D(1588, 1676, 10)); - } } } \ No newline at end of file diff --git a/Projects/Scripts/Engines/Factions/Instances/Towns/Magincia.cs b/Projects/Scripts/Engines/Factions/Instances/Towns/Magincia.cs index 965daced1..126d58021 100644 --- a/Projects/Scripts/Engines/Factions/Instances/Towns/Magincia.cs +++ b/Projects/Scripts/Engines/Factions/Instances/Towns/Magincia.cs @@ -2,8 +2,7 @@ namespace Server.Factions { public class Magincia : Town { - public Magincia() - { + public Magincia() => Definition = new TownDefinition( 7, @@ -19,6 +18,5 @@ namespace Server.Factions new TextDefinition(1041393, "Corrupted Faction Town Sigil of Magincia"), new Point3D(3714, 2235, 20), new Point3D(3712, 2230, 20)); - } } } \ No newline at end of file diff --git a/Projects/Scripts/Engines/Factions/Instances/Towns/Minoc.cs b/Projects/Scripts/Engines/Factions/Instances/Towns/Minoc.cs index 8e7dffadd..82f659200 100644 --- a/Projects/Scripts/Engines/Factions/Instances/Towns/Minoc.cs +++ b/Projects/Scripts/Engines/Factions/Instances/Towns/Minoc.cs @@ -2,8 +2,7 @@ namespace Server.Factions { public class Minoc : Town { - public Minoc() - { + public Minoc() => Definition = new TownDefinition( 2, @@ -19,6 +18,5 @@ namespace Server.Factions new TextDefinition(1041388, "Corrupted Faction Town Sigil of Minoc"), new Point3D(2471, 439, 15), new Point3D(2469, 445, 15)); - } } } \ No newline at end of file diff --git a/Projects/Scripts/Engines/Factions/Instances/Towns/Moonglow.cs b/Projects/Scripts/Engines/Factions/Instances/Towns/Moonglow.cs index 622b5e314..bb4377652 100644 --- a/Projects/Scripts/Engines/Factions/Instances/Towns/Moonglow.cs +++ b/Projects/Scripts/Engines/Factions/Instances/Towns/Moonglow.cs @@ -2,8 +2,7 @@ namespace Server.Factions { public class Moonglow : Town { - public Moonglow() - { + public Moonglow() => Definition = new TownDefinition( 3, @@ -19,6 +18,5 @@ namespace Server.Factions new TextDefinition(1041389, "Corrupted Faction Town Sigil of Moonglow"), new Point3D(4436, 1083, 0), new Point3D(4432, 1086, 0)); - } } } \ No newline at end of file diff --git a/Projects/Scripts/Engines/Factions/Instances/Towns/SkaraBrae.cs b/Projects/Scripts/Engines/Factions/Instances/Towns/SkaraBrae.cs index ec2d1e478..20243c3d9 100644 --- a/Projects/Scripts/Engines/Factions/Instances/Towns/SkaraBrae.cs +++ b/Projects/Scripts/Engines/Factions/Instances/Towns/SkaraBrae.cs @@ -2,8 +2,7 @@ namespace Server.Factions { public class SkaraBrae : Town { - public SkaraBrae() - { + public SkaraBrae() => Definition = new TownDefinition( 6, @@ -19,6 +18,5 @@ namespace Server.Factions new TextDefinition(1041392, "Corrupted Faction Town Sigil of Skara Brae"), new Point3D(576, 2200, 0), new Point3D(572, 2196, 0)); - } } } \ No newline at end of file diff --git a/Projects/Scripts/Engines/Factions/Instances/Towns/Trinsic.cs b/Projects/Scripts/Engines/Factions/Instances/Towns/Trinsic.cs index fbf21a9b2..1ae773f61 100644 --- a/Projects/Scripts/Engines/Factions/Instances/Towns/Trinsic.cs +++ b/Projects/Scripts/Engines/Factions/Instances/Towns/Trinsic.cs @@ -2,8 +2,7 @@ namespace Server.Factions { public class Trinsic : Town { - public Trinsic() - { + public Trinsic() => Definition = new TownDefinition( 1, @@ -19,6 +18,5 @@ namespace Server.Factions new TextDefinition(1041387, "Corrupted Faction Town Sigil of Trinsic"), new Point3D(1914, 2717, 20), new Point3D(1909, 2720, 20)); - } } } \ No newline at end of file diff --git a/Projects/Scripts/Engines/Factions/Instances/Towns/Vesper.cs b/Projects/Scripts/Engines/Factions/Instances/Towns/Vesper.cs index 9e0a2c6e4..fd7e8e6a8 100644 --- a/Projects/Scripts/Engines/Factions/Instances/Towns/Vesper.cs +++ b/Projects/Scripts/Engines/Factions/Instances/Towns/Vesper.cs @@ -2,8 +2,7 @@ namespace Server.Factions { public class Vesper : Town { - public Vesper() - { + public Vesper() => Definition = new TownDefinition( 5, @@ -19,6 +18,5 @@ namespace Server.Factions new TextDefinition(1041391, "Corrupted Faction Town Sigil of Vesper"), new Point3D(2982, 818, 0), new Point3D(2985, 821, 0)); - } } } \ No newline at end of file diff --git a/Projects/Scripts/Engines/Factions/Instances/Towns/Yew.cs b/Projects/Scripts/Engines/Factions/Instances/Towns/Yew.cs index f63c8ab32..9a21177a0 100644 --- a/Projects/Scripts/Engines/Factions/Instances/Towns/Yew.cs +++ b/Projects/Scripts/Engines/Factions/Instances/Towns/Yew.cs @@ -2,8 +2,7 @@ namespace Server.Factions { public class Yew : Town { - public Yew() - { + public Yew() => Definition = new TownDefinition( 4, @@ -19,6 +18,5 @@ namespace Server.Factions new TextDefinition(1041390, "Corrupted Faction Town Sigil of Yew"), new Point3D(548, 979, 0), new Point3D(542, 980, 0)); - } } } \ No newline at end of file diff --git a/Projects/Scripts/Engines/Factions/Items/Power Faction Items/BloodRose.cs b/Projects/Scripts/Engines/Factions/Items/Power Faction Items/BloodRose.cs index a48862335..822435501 100644 --- a/Projects/Scripts/Engines/Factions/Items/Power Faction Items/BloodRose.cs +++ b/Projects/Scripts/Engines/Factions/Items/Power Faction Items/BloodRose.cs @@ -5,10 +5,8 @@ namespace Server public sealed class BloodRose : PowerFactionItem { public BloodRose() - : base(Utility.RandomList(6378, 9035)) - { + : base(Utility.RandomList(6378, 9035)) => Hue = 2118; - } public BloodRose(Serial serial) : base(serial) diff --git a/Projects/Scripts/Engines/Factions/Items/Power Faction Items/ClarityPotion.cs b/Projects/Scripts/Engines/Factions/Items/Power Faction Items/ClarityPotion.cs index 30c1ffbaf..58dcb2c9b 100644 --- a/Projects/Scripts/Engines/Factions/Items/Power Faction Items/ClarityPotion.cs +++ b/Projects/Scripts/Engines/Factions/Items/Power Faction Items/ClarityPotion.cs @@ -5,10 +5,8 @@ namespace Server public sealed class ClarityPotion : PowerFactionItem { public ClarityPotion() - : base(3628) - { + : base(3628) => Hue = 1154; - } public ClarityPotion(Serial serial) : base(serial) diff --git a/Projects/Scripts/Engines/Factions/Items/Power Faction Items/GemOfEmpowerment.cs b/Projects/Scripts/Engines/Factions/Items/Power Faction Items/GemOfEmpowerment.cs index e190614e5..5fba758cc 100644 --- a/Projects/Scripts/Engines/Factions/Items/Power Faction Items/GemOfEmpowerment.cs +++ b/Projects/Scripts/Engines/Factions/Items/Power Faction Items/GemOfEmpowerment.cs @@ -6,10 +6,8 @@ namespace Server public sealed class GemOfEmpowerment : PowerFactionItem { public GemOfEmpowerment() - : base(7955) - { + : base(7955) => Hue = 1154; - } public GemOfEmpowerment(Serial serial) : base(serial) diff --git a/Projects/Scripts/Engines/Factions/Items/Power Faction Items/PowerFactionItem.cs b/Projects/Scripts/Engines/Factions/Items/Power Faction Items/PowerFactionItem.cs index 600caeae0..77e3baa4b 100644 --- a/Projects/Scripts/Engines/Factions/Items/Power Faction Items/PowerFactionItem.cs +++ b/Projects/Scripts/Engines/Factions/Items/Power Faction Items/PowerFactionItem.cs @@ -65,10 +65,8 @@ namespace Server try { - using (StreamWriter op = new StreamWriter("faction-power-items.log", true)) - { - op.WriteLine("{0}\t{1}\t{2}\t{3}", DateTime.UtcNow, killer, victim, obj); - } + using StreamWriter op = new StreamWriter("faction-power-items.log", true); + op.WriteLine("{0}\t{1}\t{2}\t{3}", DateTime.UtcNow, killer, victim, obj); } catch { @@ -144,10 +142,8 @@ namespace Server private bool _screamed; public DestructionTimer(Mobile mob) - : base(TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(0.1), 10) - { + : base(TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(0.1), 10) => _mobile = mob; - } protected override void OnTick() { @@ -178,10 +174,7 @@ namespace Server public Type Type{ get; } - public Item Construct() - { - return Activator.CreateInstance(Type) as Item; - } + public Item Construct() => Activator.CreateInstance(Type) as Item; } } } \ No newline at end of file diff --git a/Projects/Scripts/Engines/Factions/Items/Power Faction Items/StormsEye.cs b/Projects/Scripts/Engines/Factions/Items/Power Faction Items/StormsEye.cs index 87da13935..cc4d94344 100644 --- a/Projects/Scripts/Engines/Factions/Items/Power Faction Items/StormsEye.cs +++ b/Projects/Scripts/Engines/Factions/Items/Power Faction Items/StormsEye.cs @@ -10,10 +10,8 @@ namespace Server public sealed class StormsEye : PowerFactionItem { public StormsEye() - : base(3967) - { + : base(3967) => Hue = 1165; - } public StormsEye(Serial serial) : base(serial) diff --git a/Projects/Scripts/Engines/Factions/Items/Sigil.cs b/Projects/Scripts/Engines/Factions/Items/Sigil.cs index 18a8d9bc9..7bd3b958b 100644 --- a/Projects/Scripts/Engines/Factions/Items/Sigil.cs +++ b/Projects/Scripts/Engines/Factions/Items/Sigil.cs @@ -221,10 +221,7 @@ namespace Server.Factions } } - public static bool ExistsOn(Mobile mob) - { - return mob.Backpack?.FindItemByType() != null; - } + public static bool ExistsOn(Mobile mob) => mob.Backpack?.FindItemByType() != null; private void BeginCorrupting(Faction faction) { diff --git a/Projects/Scripts/Engines/Factions/Items/Traps/BaseFactionTrap.cs b/Projects/Scripts/Engines/Factions/Items/Traps/BaseFactionTrap.cs index 405998579..898f40b5f 100644 --- a/Projects/Scripts/Engines/Factions/Items/Traps/BaseFactionTrap.cs +++ b/Projects/Scripts/Engines/Factions/Items/Traps/BaseFactionTrap.cs @@ -105,10 +105,7 @@ namespace Server.Factions public abstract void DoVisibleEffect(); public abstract void DoAttackEffect(Mobile m); - public virtual int IsValidLocation() - { - return IsValidLocation(GetWorldLocation(), Map); - } + public virtual int IsValidLocation() => IsValidLocation(GetWorldLocation(), Map); public virtual int IsValidLocation(Point3D p, Map m) { diff --git a/Projects/Scripts/Engines/Factions/Mobiles/Guards/BaseFactionGuard.cs b/Projects/Scripts/Engines/Factions/Mobiles/Guards/BaseFactionGuard.cs index a69d30cf1..4e2cdd4ff 100644 --- a/Projects/Scripts/Engines/Factions/Mobiles/Guards/BaseFactionGuard.cs +++ b/Projects/Scripts/Engines/Factions/Mobiles/Guards/BaseFactionGuard.cs @@ -467,10 +467,7 @@ namespace Server.Factions { private VirtualMountItem m_Item; - public VirtualMount(VirtualMountItem item) - { - m_Item = item; - } + public VirtualMount(VirtualMountItem item) => m_Item = item; Mobile IMount.Rider { @@ -495,10 +492,7 @@ namespace Server.Factions m_Mount = new VirtualMount(this); } - public VirtualMountItem(Serial serial) : base(serial) - { - m_Mount = new VirtualMount(this); - } + public VirtualMountItem(Serial serial) : base(serial) => m_Mount = new VirtualMount(this); public Mobile Rider{ get; private set; } diff --git a/Projects/Scripts/Engines/Factions/Mobiles/Guards/GuardAI.cs b/Projects/Scripts/Engines/Factions/Mobiles/Guards/GuardAI.cs index b3f3e9451..556e318bb 100644 --- a/Projects/Scripts/Engines/Factions/Mobiles/Guards/GuardAI.cs +++ b/Projects/Scripts/Engines/Factions/Mobiles/Guards/GuardAI.cs @@ -108,10 +108,7 @@ namespace Server.Factions private BaseFactionGuard m_Guard; private DateTime m_ReleaseTarget; - public FactionGuardAI(BaseFactionGuard guard) : base(guard) - { - m_Guard = guard; - } + public FactionGuardAI(BaseFactionGuard guard) : base(guard) => m_Guard = guard; public bool IsDamaged => m_Guard.Hits < m_Guard.HitsMax; @@ -142,10 +139,7 @@ namespace Server.Factions } } - public bool IsAllowed(GuardAI flag) - { - return (m_Guard.GuardAI & flag) == flag; - } + public bool IsAllowed(GuardAI flag) => (m_Guard.GuardAI & flag) == flag; public bool DequipWeapon() { @@ -343,11 +337,9 @@ namespace Server.Factions return null; } - public bool CanDispel(Mobile m) - { - return m is BaseCreature creature && creature.Summoned && m_Mobile.CanBeHarmful(creature, false) && - !creature.IsAnimatedDead; - } + public bool CanDispel(Mobile m) => + m is BaseCreature creature && creature.Summoned && m_Mobile.CanBeHarmful(creature, false) && + !creature.IsAnimatedDead; public void RunTo(Mobile m) { diff --git a/Projects/Scripts/Engines/Factions/Mobiles/Vendors/BaseFactionVendor.cs b/Projects/Scripts/Engines/Factions/Mobiles/Vendors/BaseFactionVendor.cs index 7d743e263..4b13baee3 100644 --- a/Projects/Scripts/Engines/Factions/Mobiles/Vendors/BaseFactionVendor.cs +++ b/Projects/Scripts/Engines/Factions/Mobiles/Vendors/BaseFactionVendor.cs @@ -83,10 +83,7 @@ namespace Server.Factions Unregister(); } - public override bool CheckVendorAccess(Mobile from) - { - return true; - } + public override bool CheckVendorAccess(Mobile from) => true; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Engines/Factions/Mobiles/Vendors/FactionHorseVendor.cs b/Projects/Scripts/Engines/Factions/Mobiles/Vendors/FactionHorseVendor.cs index 0b26cf2eb..33b017193 100644 --- a/Projects/Scripts/Engines/Factions/Mobiles/Vendors/FactionHorseVendor.cs +++ b/Projects/Scripts/Engines/Factions/Mobiles/Vendors/FactionHorseVendor.cs @@ -24,10 +24,7 @@ namespace Server.Factions { } - public override int GetShoeHue() - { - return 0; - } + public override int GetShoeHue() => 0; public override void InitOutfit() { @@ -51,15 +48,9 @@ namespace Server.Factions { } - public override bool OnBuyItems(Mobile buyer, List list) - { - return false; - } + public override bool OnBuyItems(Mobile buyer, List list) => false; - public override bool OnSellItems(Mobile seller, List list) - { - return false; - } + public override bool OnSellItems(Mobile seller, List list) => false; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Engines/Harvest/Core/HarvestSystem.cs b/Projects/Scripts/Engines/Harvest/Core/HarvestSystem.cs index 693a0a636..5d2fb1981 100644 --- a/Projects/Scripts/Engines/Harvest/Core/HarvestSystem.cs +++ b/Projects/Scripts/Engines/Harvest/Core/HarvestSystem.cs @@ -8,10 +8,7 @@ namespace Server.Engines.Harvest { public abstract class HarvestSystem { - public HarvestSystem() - { - Definitions = new List(); - } + public HarvestSystem() => Definitions = new List(); public List Definitions{ get; } @@ -25,15 +22,9 @@ namespace Server.Engines.Harvest return !wornOut; } - public virtual bool CheckHarvest(Mobile from, Item tool) - { - return CheckTool(from, tool); - } + public virtual bool CheckHarvest(Mobile from, Item tool) => CheckTool(from, tool); - public virtual bool CheckHarvest(Mobile from, Item tool, HarvestDefinition def, object toHarvest) - { - return CheckTool(from, tool); - } + public virtual bool CheckHarvest(Mobile from, Item tool, HarvestDefinition def, object toHarvest) => CheckTool(from, tool); public virtual bool CheckRange(Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, bool timed) { @@ -60,18 +51,7 @@ namespace Server.Engines.Harvest { } - public virtual object GetLock(Mobile from, Item tool, HarvestDefinition def, object toHarvest) - { - /* Here we prevent multiple harvesting. - * - * Some options: - * - 'return tool;' : This will allow the player to harvest more than once concurrently, but only if they use multiple tools. This seems to be as OSI. - * - 'return GetType();' : This will disallow multiple harvesting of the same type. That is, we couldn't mine more than once concurrently, but we could be both mining and lumberjacking. - * - 'return typeof( HarvestSystem );' : This will completely restrict concurrent harvesting. - */ - - return tool; - } + public virtual object GetLock(Mobile from, Item tool, HarvestDefinition def, object toHarvest) => tool; public virtual void OnConcurrentHarvest(Mobile from, Item tool, HarvestDefinition def, object toHarvest) { @@ -234,10 +214,7 @@ namespace Server.Engines.Harvest { } - public virtual bool SpecialHarvest(Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc) - { - return false; - } + public virtual bool SpecialHarvest(Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc) => false; public virtual Item Construct(Type type, Mobile from) { @@ -252,10 +229,8 @@ namespace Server.Engines.Harvest } public virtual HarvestVein MutateVein(Mobile from, Item tool, HarvestDefinition def, HarvestBank bank, - object toHarvest, HarvestVein vein) - { - return vein; - } + object toHarvest, HarvestVein vein) => + vein; public virtual void SendSuccessTo(Mobile from, Item item, HarvestResource resource) { @@ -288,16 +263,12 @@ namespace Server.Engines.Harvest } public virtual Type MutateType(Type type, Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, - HarvestResource resource) - { - return from.Region.GetResource(type); - } + HarvestResource resource) => + from.Region.GetResource(type); public virtual Type GetResourceType(Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, - HarvestResource resource) - { - return resource.Types.Length > 0 ? resource.Types[Utility.Random(resource.Types.Length)] : null; - } + HarvestResource resource) => + resource.Types.Length > 0 ? resource.Types[Utility.Random(resource.Types.Length)] : null; public virtual HarvestResource MutateResource(Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestVein vein, HarvestResource primary, HarvestResource fallback) @@ -464,9 +435,6 @@ namespace Server [AttributeUsage(AttributeTargets.Class)] public class FurnitureAttribute : Attribute { - public static bool Check(Item item) - { - return item?.GetType().IsDefined(typeof(FurnitureAttribute), false) == true; - } + public static bool Check(Item item) => item?.GetType().IsDefined(typeof(FurnitureAttribute), false) == true; } } diff --git a/Projects/Scripts/Engines/Harvest/Fishing.cs b/Projects/Scripts/Engines/Harvest/Fishing.cs index d642da9ba..620003856 100644 --- a/Projects/Scripts/Engines/Harvest/Fishing.cs +++ b/Projects/Scripts/Engines/Harvest/Fishing.cs @@ -156,10 +156,7 @@ namespace Server.Engines.Harvest return type; } - private static Map SafeMap(Map map) - { - return map == null || map == Map.Internal ? Map.Trammel : map; - } + private static Map SafeMap(Map map) => map == null || map == Map.Internal ? Map.Trammel : map; public override bool CheckResources(Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, bool timed) { @@ -447,10 +444,7 @@ namespace Server.Engines.Harvest from.RevealingAction(); } - public override object GetLock(Mobile from, Item tool, HarvestDefinition def, object toHarvest) - { - return this; - } + public override object GetLock(Mobile from, Item tool, HarvestDefinition def, object toHarvest) => this; public override bool BeginHarvesting(Mobile from, Item tool) { diff --git a/Projects/Scripts/Engines/Help/HelpGump.cs b/Projects/Scripts/Engines/Help/HelpGump.cs index f4634a8a5..f99b5c308 100644 --- a/Projects/Scripts/Engines/Help/HelpGump.cs +++ b/Projects/Scripts/Engines/Help/HelpGump.cs @@ -16,10 +16,8 @@ namespace Server.Engines.Help public ContainedMenu(Mobile from) : base( "You already have an open help request. We will have someone assist you as soon as possible. What would you like to do?", - new[] { "Leave my old help request like it is.", "Remove my help request from the queue." }) - { + new[] { "Leave my old help request like it is.", "Remove my help request from the queue." }) => m_From = from; - } public override void OnCancel(NetState state) { @@ -211,10 +209,7 @@ namespace Server.Engines.Help e.Mobile.SendGump(new HelpGump(e.Mobile)); } - private static bool IsYoung(Mobile m) - { - return m is PlayerMobile mobile && mobile.Young; - } + private static bool IsYoung(Mobile m) => m is PlayerMobile mobile && mobile.Young; public static bool CheckCombat(Mobile m) { diff --git a/Projects/Scripts/Engines/Help/PagePrompt.cs b/Projects/Scripts/Engines/Help/PagePrompt.cs index 58ff9f060..4ab9e3a79 100644 --- a/Projects/Scripts/Engines/Help/PagePrompt.cs +++ b/Projects/Scripts/Engines/Help/PagePrompt.cs @@ -6,10 +6,7 @@ namespace Server.Engines.Help { private PageType m_Type; - public PagePrompt(PageType type) - { - m_Type = type; - } + public PagePrompt(PageType type) => m_Type = type; public override void OnCancel(Mobile from) { diff --git a/Projects/Scripts/Engines/Help/PageQueue.cs b/Projects/Scripts/Engines/Help/PageQueue.cs index 5dbeae26f..f6afaace9 100644 --- a/Projects/Scripts/Engines/Help/PageQueue.cs +++ b/Projects/Scripts/Engines/Help/PageQueue.cs @@ -87,10 +87,7 @@ namespace Server.Engines.Help private PageEntry m_Entry; - public InternalTimer(PageEntry entry) : base(TimeSpan.FromSeconds(1.0), StatusDelay) - { - m_Entry = entry; - } + public InternalTimer(PageEntry entry) : base(TimeSpan.FromSeconds(1.0), StatusDelay) => m_Entry = entry; protected override void OnTick() { @@ -180,20 +177,11 @@ namespace Server.Engines.Help e.Mobile.SendMessage("The page queue is empty."); } - public static bool IsHandling(Mobile check) - { - return m_KeyedByHandler.ContainsKey(check); - } + public static bool IsHandling(Mobile check) => m_KeyedByHandler.ContainsKey(check); - public static bool Contains(Mobile sender) - { - return m_KeyedBySender.ContainsKey(sender); - } + public static bool Contains(Mobile sender) => m_KeyedBySender.ContainsKey(sender); - public static int IndexOf(PageEntry e) - { - return List.IndexOf(e); - } + public static int IndexOf(PageEntry e) => List.IndexOf(e); public static void Remove(PageEntry e) { diff --git a/Projects/Scripts/Engines/Help/PageQueueGump.cs b/Projects/Scripts/Engines/Help/PageQueueGump.cs index 5351e83ac..38885ae14 100644 --- a/Projects/Scripts/Engines/Help/PageQueueGump.cs +++ b/Projects/Scripts/Engines/Help/PageQueueGump.cs @@ -154,14 +154,12 @@ namespace Server.Engines.Help { string path = Path.Combine(Core.BaseDirectory, "Data/pageresponse.cfg"); - using (StreamWriter op = new StreamWriter(path)) + using StreamWriter op = new StreamWriter(path); + for (int i = 0; i < List.Count; ++i) { - for (int i = 0; i < List.Count; ++i) - { - PredefinedResponse resp = List[i]; + PredefinedResponse resp = List[i]; - op.WriteLine("{0}\t{1}", resp.Title, resp.Message); - } + op.WriteLine("{0}\t{1}", resp.Title, resp.Message); } } catch (Exception e) @@ -181,20 +179,18 @@ namespace Server.Engines.Help try { - using (StreamReader ip = new StreamReader(path)) + using StreamReader ip = new StreamReader(path); + string line; + + while ((line = ip.ReadLine()?.Trim()) != null) { - string line; + if (line.Length == 0 || line.StartsWith("#")) + continue; - while ((line = ip.ReadLine()?.Trim()) != null) - { - if (line.Length == 0 || line.StartsWith("#")) - continue; + string[] split = line.Split('\t'); - string[] split = line.Split('\t'); - - if (split.Length == 2) - list.Add(new PredefinedResponse(split[0], split[1])); - } + if (split.Length == 2) + list.Add(new PredefinedResponse(split[0], split[1])); } } catch (Exception e) @@ -305,15 +301,9 @@ namespace Server.Engines.Help } } - public string Center(string text) - { - return $"
{text}
"; - } + public string Center(string text) => $"
{text}
"; - public string Color(string text, int color) - { - return $"{text}"; - } + public string Color(string text, int color) => $"{text}"; public void AddTextInput(int x, int y, int w, int h, int id, string def) { diff --git a/Projects/Scripts/Engines/Help/SpeechLog.cs b/Projects/Scripts/Engines/Help/SpeechLog.cs index 9a5c4a8ba..2dc5ad7dc 100644 --- a/Projects/Scripts/Engines/Help/SpeechLog.cs +++ b/Projects/Scripts/Engines/Help/SpeechLog.cs @@ -21,28 +21,19 @@ namespace Server.Engines.Help private Queue m_Queue; - public SpeechLog() - { - m_Queue = new Queue(); - } + public SpeechLog() => m_Queue = new Queue(); public int Count => m_Queue.Count; #region IEnumerable Members - IEnumerator IEnumerable.GetEnumerator() - { - return m_Queue.GetEnumerator(); - } + IEnumerator IEnumerable.GetEnumerator() => m_Queue.GetEnumerator(); #endregion #region IEnumerable Members - IEnumerator IEnumerable.GetEnumerator() - { - return m_Queue.GetEnumerator(); - } + IEnumerator IEnumerable.GetEnumerator() => m_Queue.GetEnumerator(); #endregion diff --git a/Projects/Scripts/Engines/Help/StuckMenu.cs b/Projects/Scripts/Engines/Help/StuckMenu.cs index 229cb815b..9c6519417 100644 --- a/Projects/Scripts/Engines/Help/StuckMenu.cs +++ b/Projects/Scripts/Engines/Help/StuckMenu.cs @@ -141,11 +141,9 @@ namespace Server.Menus.Questions AddHtmlLocalized(90, 265, 200, 35, 1011012); // CANCEL } - private static bool IsInSecondAgeArea(Mobile m) - { - return (m.Map == Map.Trammel || m.Map == Map.Felucca) && - (m.X >= 5120 && m.Y >= 2304 || m.Region.IsPartOf("Terathan Keep")); - } + private static bool IsInSecondAgeArea(Mobile m) => + (m.Map == Map.Trammel || m.Map == Map.Felucca) && + (m.X >= 5120 && m.Y >= 2304 || m.Region.IsPartOf("Terathan Keep")); public void BeginClose() { diff --git a/Projects/Scripts/Engines/Khaldun/Mobiles/GrimmochDrummel.cs b/Projects/Scripts/Engines/Khaldun/Mobiles/GrimmochDrummel.cs index 6b679d94b..a08ec8022 100644 --- a/Projects/Scripts/Engines/Khaldun/Mobiles/GrimmochDrummel.cs +++ b/Projects/Scripts/Engines/Khaldun/Mobiles/GrimmochDrummel.cs @@ -77,25 +77,13 @@ namespace Server.Mobiles public override bool AlwaysMurderer => true; - public override int GetIdleSound() - { - return 0x178; - } + public override int GetIdleSound() => 0x178; - public override int GetAngerSound() - { - return 0x1AC; - } + public override int GetAngerSound() => 0x1AC; - public override int GetDeathSound() - { - return 0x27E; - } + public override int GetDeathSound() => 0x27E; - public override int GetHurtSound() - { - return 0x177; - } + public override int GetHurtSound() => 0x177; public override bool OnBeforeDeath() { diff --git a/Projects/Scripts/Engines/Khaldun/Mobiles/LysanderGathenwale.cs b/Projects/Scripts/Engines/Khaldun/Mobiles/LysanderGathenwale.cs index 9f087c484..4523038aa 100644 --- a/Projects/Scripts/Engines/Khaldun/Mobiles/LysanderGathenwale.cs +++ b/Projects/Scripts/Engines/Khaldun/Mobiles/LysanderGathenwale.cs @@ -71,25 +71,13 @@ namespace Server.Mobiles public override bool AlwaysMurderer => true; - public override int GetIdleSound() - { - return 0x1CE; - } + public override int GetIdleSound() => 0x1CE; - public override int GetAngerSound() - { - return 0x1AC; - } + public override int GetAngerSound() => 0x1AC; - public override int GetDeathSound() - { - return 0x182; - } + public override int GetDeathSound() => 0x182; - public override int GetHurtSound() - { - return 0x28D; - } + public override int GetHurtSound() => 0x28D; public override void GenerateLoot() { diff --git a/Projects/Scripts/Engines/Khaldun/Mobiles/MorgBergen.cs b/Projects/Scripts/Engines/Khaldun/Mobiles/MorgBergen.cs index a93e47d68..d66202016 100644 --- a/Projects/Scripts/Engines/Khaldun/Mobiles/MorgBergen.cs +++ b/Projects/Scripts/Engines/Khaldun/Mobiles/MorgBergen.cs @@ -64,25 +64,13 @@ namespace Server.Mobiles public override bool AlwaysMurderer => true; - public override int GetIdleSound() - { - return 0x1CE; - } + public override int GetIdleSound() => 0x1CE; - public override int GetAngerSound() - { - return 0x263; - } + public override int GetAngerSound() => 0x263; - public override int GetDeathSound() - { - return 0x1D1; - } + public override int GetDeathSound() => 0x1D1; - public override int GetHurtSound() - { - return 0x25E; - } + public override int GetHurtSound() => 0x25E; public override bool OnBeforeDeath() { diff --git a/Projects/Scripts/Engines/Khaldun/Mobiles/TavaraSewel.cs b/Projects/Scripts/Engines/Khaldun/Mobiles/TavaraSewel.cs index f2bf55fd1..1b17bb8f9 100644 --- a/Projects/Scripts/Engines/Khaldun/Mobiles/TavaraSewel.cs +++ b/Projects/Scripts/Engines/Khaldun/Mobiles/TavaraSewel.cs @@ -68,25 +68,13 @@ namespace Server.Mobiles public override bool AlwaysMurderer => true; - public override int GetIdleSound() - { - return 0x27F; - } + public override int GetIdleSound() => 0x27F; - public override int GetAngerSound() - { - return 0x258; - } + public override int GetAngerSound() => 0x258; - public override int GetDeathSound() - { - return 0x25B; - } + public override int GetDeathSound() => 0x25B; - public override int GetHurtSound() - { - return 0x257; - } + public override int GetHurtSound() => 0x257; public override bool OnBeforeDeath() { diff --git a/Projects/Scripts/Engines/Khaldun/PuzzleChest.cs b/Projects/Scripts/Engines/Khaldun/PuzzleChest.cs index 633fd951a..d00e57ddb 100644 --- a/Projects/Scripts/Engines/Khaldun/PuzzleChest.cs +++ b/Projects/Scripts/Engines/Khaldun/PuzzleChest.cs @@ -153,10 +153,7 @@ namespace Server.Items public class PuzzleChestSolutionAndTime : PuzzleChestSolution { - public PuzzleChestSolutionAndTime(DateTime when, PuzzleChestSolution solution) : base(solution) - { - When = when; - } + public PuzzleChestSolutionAndTime(DateTime when, PuzzleChestSolution solution) : base(solution) => When = when; public PuzzleChestSolutionAndTime(GenericReader reader) : base(reader) { diff --git a/Projects/Scripts/Engines/Khaldun/RaiseSwitch.cs b/Projects/Scripts/Engines/Khaldun/RaiseSwitch.cs index 2cf814499..1a4c22cf5 100644 --- a/Projects/Scripts/Engines/Khaldun/RaiseSwitch.cs +++ b/Projects/Scripts/Engines/Khaldun/RaiseSwitch.cs @@ -8,10 +8,7 @@ namespace Server.Items { private ResetTimer m_ResetTimer; - public RaiseSwitch(int itemID = 0x1093) : base(itemID) - { - Movable = false; - } + public RaiseSwitch(int itemID = 0x1093) : base(itemID) => Movable = false; public RaiseSwitch(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/MLQuests/Definitions/BaseEscort.cs b/Projects/Scripts/Engines/MLQuests/Definitions/BaseEscort.cs index 93cdd2b30..6a505e897 100644 --- a/Projects/Scripts/Engines/MLQuests/Definitions/BaseEscort.cs +++ b/Projects/Scripts/Engines/MLQuests/Definitions/BaseEscort.cs @@ -3,10 +3,7 @@ // Base class for escorts providing the AwardHumanInNeed option public class BaseEscort : MLQuest { - public BaseEscort() - { - CompletionNotice = CompletionNoticeShort; - } + public BaseEscort() => CompletionNotice = CompletionNoticeShort; public virtual bool AwardHumanInNeed => true; diff --git a/Projects/Scripts/Engines/MLQuests/Definitions/Heritage.cs b/Projects/Scripts/Engines/MLQuests/Definitions/Heritage.cs index d87389985..d4e6d191f 100644 --- a/Projects/Scripts/Engines/MLQuests/Definitions/Heritage.cs +++ b/Projects/Scripts/Engines/MLQuests/Definitions/Heritage.cs @@ -131,10 +131,7 @@ namespace Server.Engines.MLQuests.Definitions public override bool ShowDetailed => false; - public override bool CheckItem(Item item) - { - return item is Pitcher pitcher && pitcher.Content == BeverageType.Water && pitcher.Quantity > 0; - } + public override bool CheckItem(Item item) => item is Pitcher pitcher && pitcher.Content == BeverageType.Water && pitcher.Quantity > 0; } } @@ -413,20 +410,11 @@ namespace Server.Engines.MLQuests.Definitions { } - public override int GetAttackSound() - { - return 0x82; - } + public override int GetAttackSound() => 0x82; - public override int GetHurtSound() - { - return 0x83; - } + public override int GetHurtSound() => 0x83; - public override int GetDeathSound() - { - return 0x84; - } + public override int GetDeathSound() => 0x84; public override void Serialize(GenericWriter writer) { @@ -446,10 +434,7 @@ namespace Server.Engines.MLQuests.Definitions public class BravehornsMate : Hind { [Constructible] - public BravehornsMate() - { - Tamable = false; - } + public BravehornsMate() => Tamable = false; public BravehornsMate(Serial serial) : base(serial) diff --git a/Projects/Scripts/Engines/MLQuests/Definitions/LostItems.cs b/Projects/Scripts/Engines/MLQuests/Definitions/LostItems.cs index 201762325..fc5f7da8f 100644 --- a/Projects/Scripts/Engines/MLQuests/Definitions/LostItems.cs +++ b/Projects/Scripts/Engines/MLQuests/Definitions/LostItems.cs @@ -38,10 +38,8 @@ namespace Server.Engines.MLQuests.Definitions { [Constructible] public BatteredBucket() - : base(0x2004, TimeSpan.FromMinutes(10)) - { + : base(0x2004, TimeSpan.FromMinutes(10)) => LootType = LootType.Blessed; - } public BatteredBucket(Serial serial) : base(serial) diff --git a/Projects/Scripts/Engines/MLQuests/Definitions/NewHavenSkillTraining.cs b/Projects/Scripts/Engines/MLQuests/Definitions/NewHavenSkillTraining.cs index 71644f7ee..3ba6aaf8a 100644 --- a/Projects/Scripts/Engines/MLQuests/Definitions/NewHavenSkillTraining.cs +++ b/Projects/Scripts/Engines/MLQuests/Definitions/NewHavenSkillTraining.cs @@ -1510,10 +1510,7 @@ namespace Server.Engines.MLQuests.Definitions public class GustarShroud : BaseOuterTorso { [Constructible] - public GustarShroud() : base(0x2684) - { - Hue = 0x479; - } + public GustarShroud() : base(0x2684) => Hue = 0x479; public GustarShroud(Serial serial) : base(serial) { @@ -1988,10 +1985,7 @@ namespace Server.Engines.MLQuests.Definitions m_SBInfos.Add(new SBNinja()); } - public override bool GetGender() - { - return false; - } + public override bool GetGender() => false; public override void InitOutfit() { @@ -2235,10 +2229,7 @@ namespace Server.Engines.MLQuests.Definitions m_SBInfos.Add(new SBSamurai()); } - public override bool GetGender() - { - return false; - } + public override bool GetGender() => false; public override void InitOutfit() { diff --git a/Projects/Scripts/Engines/MLQuests/Definitions/NewHavenTraining.cs b/Projects/Scripts/Engines/MLQuests/Definitions/NewHavenTraining.cs index 626bc25ba..a117fc484 100644 --- a/Projects/Scripts/Engines/MLQuests/Definitions/NewHavenTraining.cs +++ b/Projects/Scripts/Engines/MLQuests/Definitions/NewHavenTraining.cs @@ -175,10 +175,7 @@ namespace Server.Engines.MLQuests.Definitions { } - public override bool CheckItem(Item item) - { - return item.ItemID == 6585; // Only large pieces count - } + public override bool CheckItem(Item item) => item.ItemID == 6585; } } diff --git a/Projects/Scripts/Engines/MLQuests/Gumps/BaseQuestGump.cs b/Projects/Scripts/Engines/MLQuests/Gumps/BaseQuestGump.cs index 593c9a89b..1852dcacf 100644 --- a/Projects/Scripts/Engines/MLQuests/Gumps/BaseQuestGump.cs +++ b/Projects/Scripts/Engines/MLQuests/Gumps/BaseQuestGump.cs @@ -49,56 +49,6 @@ namespace Server.Engines.MLQuests.Gumps private string m_Title; private List m_Buttons; -#if false -// OSI clone, inefficient layout - public BaseQuestGump( int label ) : base( 75, 25 ) - { - m_Page = 0; - m_MaxPages = 0; - m_Label = label; - m_Title = null; - m_Buttons = new List( 2 ); - } - - public void BuildPage() - { - AddPage( ++m_Page ); - - Closable = false; - AddImageTiled( 50, 20, 400, 460, 0x1404 ); - AddImageTiled( 50, 29, 30, 450, 0x28DC ); - AddImageTiled( 34, 140, 17, 339, 0x242F ); - AddImage( 48, 135, 0x28AB ); - AddImage( -16, 285, 0x28A2 ); - AddImage( 0, 10, 0x28B5 ); - AddImage( 25, 0, 0x28B4 ); - AddImageTiled( 83, 15, 350, 15, 0x280A ); - AddImage( 34, 479, 0x2842 ); - AddImage( 442, 479, 0x2840 ); - AddImageTiled( 51, 479, 392, 17, 0x2775 ); - AddImageTiled( 415, 29, 44, 450, 0xA2D ); - AddImageTiled( 415, 29, 30, 450, 0x28DC ); - AddLabel( 100, 50, 0x481, "" ); - AddImage( 370, 50, 0x589 ); - AddImage( 379, 60, 0x15A9 ); - AddImage( 425, 0, 0x28C9 ); - AddImage( 90, 33, 0x232D ); - AddHtmlLocalized( 130, 45, 270, 16, m_Label, 0xFFFFFF, false, false ); - AddImageTiled( 130, 65, 175, 1, 0x238D ); - - if ( m_Page > 1 ) - AddButton( 130, 430, (int)ButtonGraphic.Previous, (int)ButtonGraphic.Previous + 2, 0, GumpButtonType.Page, m_Page - 1 ); - - if ( m_Page < m_MaxPages ) - AddButton( 275, 430, (int)ButtonGraphic.Continue, (int)ButtonGraphic.Continue + 2, 0, GumpButtonType.Page, m_Page + 1 ); - - foreach ( ButtonInfo button in m_Buttons ) - AddButton( button.Position == ButtonPosition.Left ? 95 : 313, 455, (int)button.Graphic, (int)button.Graphic + 2, button.ButtonID, ); - - if ( m_Title != null ) - AddHtmlLocalized( 130, 68, 220, 48, 1114513, m_Title, 0x2710, false, false ); //
~1_TOKEN~
- } -#else // RunUO optimized version public BaseQuestGump(int label) : base(75, 25) @@ -154,7 +104,6 @@ namespace Server.Engines.MLQuests.Gumps if (m_Title != null) AddHtmlLocalized(130, 68, 220, 48, 1114513, m_Title, 0x2710); //
~1_TOKEN~
} -#endif public void SetPageCount(int maxPages) { diff --git a/Projects/Scripts/Engines/MLQuests/Gumps/RaceChangeGump.cs b/Projects/Scripts/Engines/MLQuests/Gumps/RaceChangeGump.cs index a1719cbea..ae284cb5a 100644 --- a/Projects/Scripts/Engines/MLQuests/Gumps/RaceChangeGump.cs +++ b/Projects/Scripts/Engines/MLQuests/Gumps/RaceChangeGump.cs @@ -75,10 +75,7 @@ namespace Server.Engines.MLQuests.Gumps PacketHandlers.RegisterExtended(0x2A, true, RaceChangeReply); } - public static bool IsPending(NetState state) - { - return state != null && m_Pending.ContainsKey(state); - } + public static bool IsPending(NetState state) => state != null && m_Pending.ContainsKey(state); private static void Offer(IRaceChanger owner, PlayerMobile from, Race targetRace) { @@ -277,10 +274,8 @@ namespace Server.Engines.MLQuests.Gumps { [Constructible] public RaceChangeDeed() - : base(0x14F0) - { + : base(0x14F0) => LootType = LootType.Blessed; - } public RaceChangeDeed(Serial serial) : base(serial) diff --git a/Projects/Scripts/Engines/MLQuests/Items/ABauble.cs b/Projects/Scripts/Engines/MLQuests/Items/ABauble.cs index 1ec4e1ef2..e817a5185 100644 --- a/Projects/Scripts/Engines/MLQuests/Items/ABauble.cs +++ b/Projects/Scripts/Engines/MLQuests/Items/ABauble.cs @@ -3,10 +3,7 @@ namespace Server.Items public class ABauble : Item { [Constructible] - public ABauble() : base(0x23B) - { - LootType = LootType.Blessed; - } + public ABauble() : base(0x23B) => LootType = LootType.Blessed; public ABauble(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/MLQuests/Items/APersonalLetterAddressedToAhie.cs b/Projects/Scripts/Engines/MLQuests/Items/APersonalLetterAddressedToAhie.cs index a018cbf08..ed7ad5e03 100644 --- a/Projects/Scripts/Engines/MLQuests/Items/APersonalLetterAddressedToAhie.cs +++ b/Projects/Scripts/Engines/MLQuests/Items/APersonalLetterAddressedToAhie.cs @@ -5,10 +5,7 @@ namespace Server.Items public class APersonalLetterAddressedToAhie : TransientItem { [Constructible] - public APersonalLetterAddressedToAhie() : base(0x14ED, TimeSpan.FromMinutes(30)) - { - LootType = LootType.Blessed; - } + public APersonalLetterAddressedToAhie() : base(0x14ED, TimeSpan.FromMinutes(30)) => LootType = LootType.Blessed; public APersonalLetterAddressedToAhie(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/MLQuests/Items/AnOldNecklace.cs b/Projects/Scripts/Engines/MLQuests/Items/AnOldNecklace.cs index e6757ca4a..efe32c5a9 100644 --- a/Projects/Scripts/Engines/MLQuests/Items/AnOldNecklace.cs +++ b/Projects/Scripts/Engines/MLQuests/Items/AnOldNecklace.cs @@ -3,10 +3,7 @@ namespace Server.Items public class AnOldNecklace : Necklace { [Constructible] - public AnOldNecklace() - { - Hue = 0x222; - } + public AnOldNecklace() => Hue = 0x222; public AnOldNecklace(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/MLQuests/Items/AnOldRing.cs b/Projects/Scripts/Engines/MLQuests/Items/AnOldRing.cs index 11086fae2..3ee5bfa96 100644 --- a/Projects/Scripts/Engines/MLQuests/Items/AnOldRing.cs +++ b/Projects/Scripts/Engines/MLQuests/Items/AnOldRing.cs @@ -3,10 +3,7 @@ namespace Server.Items public class AnOldRing : GoldRing { [Constructible] - public AnOldRing() - { - Hue = 0x222; - } + public AnOldRing() => Hue = 0x222; public AnOldRing(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/MLQuests/Items/AndrosGratitude.cs b/Projects/Scripts/Engines/MLQuests/Items/AndrosGratitude.cs index 489c5c475..6675de348 100644 --- a/Projects/Scripts/Engines/MLQuests/Items/AndrosGratitude.cs +++ b/Projects/Scripts/Engines/MLQuests/Items/AndrosGratitude.cs @@ -3,10 +3,7 @@ namespace Server.Items public class AndrosGratitude : SmithHammer { [Constructible] - public AndrosGratitude() : base(10) - { - LootType = LootType.Blessed; - } + public AndrosGratitude() : base(10) => LootType = LootType.Blessed; public AndrosGratitude(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/MLQuests/Items/BasinOfCrystalClearWater.cs b/Projects/Scripts/Engines/MLQuests/Items/BasinOfCrystalClearWater.cs index ee76c8fd2..961b52b22 100644 --- a/Projects/Scripts/Engines/MLQuests/Items/BasinOfCrystalClearWater.cs +++ b/Projects/Scripts/Engines/MLQuests/Items/BasinOfCrystalClearWater.cs @@ -3,10 +3,7 @@ namespace Server.Items public class BasinOfCrystalClearWater : Item { [Constructible] - public BasinOfCrystalClearWater() : base(0x1008) - { - LootType = LootType.Blessed; - } + public BasinOfCrystalClearWater() : base(0x1008) => LootType = LootType.Blessed; public BasinOfCrystalClearWater(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/MLQuests/Items/BedlamTeleporter.cs b/Projects/Scripts/Engines/MLQuests/Items/BedlamTeleporter.cs index b133a10bf..1b3a56bca 100644 --- a/Projects/Scripts/Engines/MLQuests/Items/BedlamTeleporter.cs +++ b/Projects/Scripts/Engines/MLQuests/Items/BedlamTeleporter.cs @@ -9,10 +9,8 @@ namespace Server.Engines.MLQuests.Items private static readonly Map MapDest = Map.Malas; public BedlamTeleporter() - : base(0x124D) - { + : base(0x124D) => Movable = false; - } public BedlamTeleporter(Serial serial) : base(serial) diff --git a/Projects/Scripts/Engines/MLQuests/Items/Bleach.cs b/Projects/Scripts/Engines/MLQuests/Items/Bleach.cs index da0e7446f..6e700966a 100644 --- a/Projects/Scripts/Engines/MLQuests/Items/Bleach.cs +++ b/Projects/Scripts/Engines/MLQuests/Items/Bleach.cs @@ -3,10 +3,7 @@ namespace Server.Items public class Bleach : PigmentsOfTokuno { [Constructible] - public Bleach() - { - LootType = LootType.Blessed; - } + public Bleach() => LootType = LootType.Blessed; public Bleach(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/MLQuests/Items/BridesLetter.cs b/Projects/Scripts/Engines/MLQuests/Items/BridesLetter.cs index a514fedfb..4a4ba59b0 100644 --- a/Projects/Scripts/Engines/MLQuests/Items/BridesLetter.cs +++ b/Projects/Scripts/Engines/MLQuests/Items/BridesLetter.cs @@ -3,10 +3,7 @@ namespace Server.Items public class BridesLetter : Item { [Constructible] - public BridesLetter() : base(0x14ED) - { - LootType = LootType.Blessed; - } + public BridesLetter() : base(0x14ED) => LootType = LootType.Blessed; public BridesLetter(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/MLQuests/Items/CompletedTuitionReimbursementForm.cs b/Projects/Scripts/Engines/MLQuests/Items/CompletedTuitionReimbursementForm.cs index 83a4438bf..ad4c63424 100644 --- a/Projects/Scripts/Engines/MLQuests/Items/CompletedTuitionReimbursementForm.cs +++ b/Projects/Scripts/Engines/MLQuests/Items/CompletedTuitionReimbursementForm.cs @@ -3,10 +3,7 @@ namespace Server.Items public class CompletedTuitionReimbursementForm : Item { [Constructible] - public CompletedTuitionReimbursementForm() : base(0x14F0) - { - LootType = LootType.Blessed; - } + public CompletedTuitionReimbursementForm() : base(0x14F0) => LootType = LootType.Blessed; public CompletedTuitionReimbursementForm(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/MLQuests/Items/CraftmansSatchel.cs b/Projects/Scripts/Engines/MLQuests/Items/CraftmansSatchel.cs index 5cbbe4ce3..a856c0b8f 100644 --- a/Projects/Scripts/Engines/MLQuests/Items/CraftmansSatchel.cs +++ b/Projects/Scripts/Engines/MLQuests/Items/CraftmansSatchel.cs @@ -8,10 +8,7 @@ namespace Server.Engines.MLQuests.Items { protected static readonly Type[] m_TalismanType = { typeof(RandomTalisman) }; - public BaseCraftmansSatchel() - { - Hue = Utility.RandomBrightHue(); - } + public BaseCraftmansSatchel() => Hue = Utility.RandomBrightHue(); public BaseCraftmansSatchel(Serial serial) : base(serial) diff --git a/Projects/Scripts/Engines/MLQuests/Items/CrateForSledge.cs b/Projects/Scripts/Engines/MLQuests/Items/CrateForSledge.cs index 058432070..73ec842b2 100644 --- a/Projects/Scripts/Engines/MLQuests/Items/CrateForSledge.cs +++ b/Projects/Scripts/Engines/MLQuests/Items/CrateForSledge.cs @@ -5,10 +5,7 @@ namespace Server.Items public class CrateForSledge : TransientItem { [Constructible] - public CrateForSledge() : base(0x1FFF, TimeSpan.FromHours(1)) - { - LootType = LootType.Blessed; - } + public CrateForSledge() : base(0x1FFF, TimeSpan.FromHours(1)) => LootType = LootType.Blessed; public CrateForSledge(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/MLQuests/Items/FragmentOfAMap.cs b/Projects/Scripts/Engines/MLQuests/Items/FragmentOfAMap.cs index 374beef8a..db95ccf4e 100644 --- a/Projects/Scripts/Engines/MLQuests/Items/FragmentOfAMap.cs +++ b/Projects/Scripts/Engines/MLQuests/Items/FragmentOfAMap.cs @@ -3,10 +3,7 @@ namespace Server.Items public class FragmentOfAMap : Item { [Constructible] - public FragmentOfAMap() : base(0x14ED) - { - LootType = LootType.Blessed; - } + public FragmentOfAMap() : base(0x14ED) => LootType = LootType.Blessed; public FragmentOfAMap(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/MLQuests/Items/FragmentOfAMapDelivery.cs b/Projects/Scripts/Engines/MLQuests/Items/FragmentOfAMapDelivery.cs index 22b7e4fe2..b44f09b36 100644 --- a/Projects/Scripts/Engines/MLQuests/Items/FragmentOfAMapDelivery.cs +++ b/Projects/Scripts/Engines/MLQuests/Items/FragmentOfAMapDelivery.cs @@ -3,10 +3,7 @@ namespace Server.Items public class FragmentOfAMapDelivery : Item { [Constructible] - public FragmentOfAMapDelivery() : base(0x14ED) - { - LootType = LootType.Blessed; - } + public FragmentOfAMapDelivery() : base(0x14ED) => LootType = LootType.Blessed; public FragmentOfAMapDelivery(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/MLQuests/Items/FriendsOfTheLibraryApplication.cs b/Projects/Scripts/Engines/MLQuests/Items/FriendsOfTheLibraryApplication.cs index 0f65e1308..eddd81e61 100644 --- a/Projects/Scripts/Engines/MLQuests/Items/FriendsOfTheLibraryApplication.cs +++ b/Projects/Scripts/Engines/MLQuests/Items/FriendsOfTheLibraryApplication.cs @@ -3,10 +3,7 @@ namespace Server.Items public class FriendsOfTheLibraryApplication : Item { [Constructible] - public FriendsOfTheLibraryApplication() : base(0xEC0) - { - LootType = LootType.Blessed; - } + public FriendsOfTheLibraryApplication() : base(0xEC0) => LootType = LootType.Blessed; public FriendsOfTheLibraryApplication(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/MLQuests/Items/GiftForArielle.cs b/Projects/Scripts/Engines/MLQuests/Items/GiftForArielle.cs index 9d2b02078..c9e4a5b98 100644 --- a/Projects/Scripts/Engines/MLQuests/Items/GiftForArielle.cs +++ b/Projects/Scripts/Engines/MLQuests/Items/GiftForArielle.cs @@ -3,10 +3,7 @@ namespace Server.Items public class GiftForArielle : BaseContainer { [Constructible] - public GiftForArielle() : base(0x1882) - { - Hue = 0x2C4; - } + public GiftForArielle() : base(0x1882) => Hue = 0x2C4; public GiftForArielle(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/MLQuests/Items/MiniatureMushroom.cs b/Projects/Scripts/Engines/MLQuests/Items/MiniatureMushroom.cs index c11083291..b447ba027 100644 --- a/Projects/Scripts/Engines/MLQuests/Items/MiniatureMushroom.cs +++ b/Projects/Scripts/Engines/MLQuests/Items/MiniatureMushroom.cs @@ -3,10 +3,7 @@ namespace Server.Items public class MiniatureMushroom : Food { [Constructible] - public MiniatureMushroom() : base(0xD16) - { - LootType = LootType.Blessed; - } + public MiniatureMushroom() : base(0xD16) => LootType = LootType.Blessed; public MiniatureMushroom(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/MLQuests/Items/NotarizedApplication.cs b/Projects/Scripts/Engines/MLQuests/Items/NotarizedApplication.cs index 48c7d1a8d..de526397f 100644 --- a/Projects/Scripts/Engines/MLQuests/Items/NotarizedApplication.cs +++ b/Projects/Scripts/Engines/MLQuests/Items/NotarizedApplication.cs @@ -3,10 +3,7 @@ namespace Server.Items public class NotarizedApplication : Item { [Constructible] - public NotarizedApplication() : base(0x14EF) - { - LootType = LootType.Blessed; - } + public NotarizedApplication() : base(0x14EF) => LootType = LootType.Blessed; public NotarizedApplication(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/MLQuests/Items/PeppercornFishsteak.cs b/Projects/Scripts/Engines/MLQuests/Items/PeppercornFishsteak.cs index 7317b724b..363b63a22 100644 --- a/Projects/Scripts/Engines/MLQuests/Items/PeppercornFishsteak.cs +++ b/Projects/Scripts/Engines/MLQuests/Items/PeppercornFishsteak.cs @@ -3,10 +3,7 @@ namespace Server.Items public class PeppercornFishsteak : FishSteak { [Constructible] - public PeppercornFishsteak() - { - Hue = 0x222; - } + public PeppercornFishsteak() => Hue = 0x222; public PeppercornFishsteak(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/MLQuests/Items/PortraitOfTheBride.cs b/Projects/Scripts/Engines/MLQuests/Items/PortraitOfTheBride.cs index 7447eb2b9..875250f30 100644 --- a/Projects/Scripts/Engines/MLQuests/Items/PortraitOfTheBride.cs +++ b/Projects/Scripts/Engines/MLQuests/Items/PortraitOfTheBride.cs @@ -3,10 +3,7 @@ namespace Server.Items public class PortraitOfTheBride : Item { [Constructible] - public PortraitOfTheBride() : base(0xE9F) - { - LootType = LootType.Blessed; - } + public PortraitOfTheBride() : base(0xE9F) => LootType = LootType.Blessed; public PortraitOfTheBride(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/MLQuests/Items/RedLeatherBook.cs b/Projects/Scripts/Engines/MLQuests/Items/RedLeatherBook.cs index 747c03a71..45b216ec0 100644 --- a/Projects/Scripts/Engines/MLQuests/Items/RedLeatherBook.cs +++ b/Projects/Scripts/Engines/MLQuests/Items/RedLeatherBook.cs @@ -3,10 +3,7 @@ public class RedLeatherBook : BlueBook { [Constructible] - public RedLeatherBook() - { - Hue = 0x485; - } + public RedLeatherBook() => Hue = 0x485; public RedLeatherBook(Serial serial) : base(serial) diff --git a/Projects/Scripts/Engines/MLQuests/Items/ReginasLetter.cs b/Projects/Scripts/Engines/MLQuests/Items/ReginasLetter.cs index a641a9c5b..8861447fa 100644 --- a/Projects/Scripts/Engines/MLQuests/Items/ReginasLetter.cs +++ b/Projects/Scripts/Engines/MLQuests/Items/ReginasLetter.cs @@ -3,10 +3,7 @@ namespace Server.Items public class ReginasLetter : Item { [Constructible] - public ReginasLetter() : base(0x14ED) - { - LootType = LootType.Blessed; - } + public ReginasLetter() : base(0x14ED) => LootType = LootType.Blessed; public ReginasLetter(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/MLQuests/Items/ReginasRing.cs b/Projects/Scripts/Engines/MLQuests/Items/ReginasRing.cs index c9dcc2d5b..70b54fc0e 100644 --- a/Projects/Scripts/Engines/MLQuests/Items/ReginasRing.cs +++ b/Projects/Scripts/Engines/MLQuests/Items/ReginasRing.cs @@ -3,10 +3,7 @@ namespace Server.Items public class ReginasRing : SilverRing { [Constructible] - public ReginasRing() - { - LootType = LootType.Blessed; - } + public ReginasRing() => LootType = LootType.Blessed; public ReginasRing(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/MLQuests/Items/SealedNotesForJamal.cs b/Projects/Scripts/Engines/MLQuests/Items/SealedNotesForJamal.cs index 9ba2274de..633826509 100644 --- a/Projects/Scripts/Engines/MLQuests/Items/SealedNotesForJamal.cs +++ b/Projects/Scripts/Engines/MLQuests/Items/SealedNotesForJamal.cs @@ -3,10 +3,7 @@ namespace Server.Items public class SealedNotesForJamal : Item { [Constructible] - public SealedNotesForJamal() : base(0xEF9) - { - LootType = LootType.Blessed; - } + public SealedNotesForJamal() : base(0xEF9) => LootType = LootType.Blessed; public SealedNotesForJamal(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/MLQuests/Items/SealingWaxOrderAddressedToPetrus.cs b/Projects/Scripts/Engines/MLQuests/Items/SealingWaxOrderAddressedToPetrus.cs index 263630634..b7d0c4335 100644 --- a/Projects/Scripts/Engines/MLQuests/Items/SealingWaxOrderAddressedToPetrus.cs +++ b/Projects/Scripts/Engines/MLQuests/Items/SealingWaxOrderAddressedToPetrus.cs @@ -3,10 +3,7 @@ namespace Server.Items public class SealingWaxOrderAddressedToPetrus : Item { [Constructible] - public SealingWaxOrderAddressedToPetrus() : base(0xEBF) - { - LootType = LootType.Blessed; - } + public SealingWaxOrderAddressedToPetrus() : base(0xEBF) => LootType = LootType.Blessed; public SealingWaxOrderAddressedToPetrus(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/MLQuests/Items/SignedTuitionReimbursementForm.cs b/Projects/Scripts/Engines/MLQuests/Items/SignedTuitionReimbursementForm.cs index ba35a8ce6..4a9cf2827 100644 --- a/Projects/Scripts/Engines/MLQuests/Items/SignedTuitionReimbursementForm.cs +++ b/Projects/Scripts/Engines/MLQuests/Items/SignedTuitionReimbursementForm.cs @@ -3,10 +3,7 @@ namespace Server.Items public class SignedTuitionReimbursementForm : Item { [Constructible] - public SignedTuitionReimbursementForm() : base(0x14F0) - { - LootType = LootType.Blessed; - } + public SignedTuitionReimbursementForm() : base(0x14F0) => LootType = LootType.Blessed; public SignedTuitionReimbursementForm(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/MLQuests/Items/SpeckledPoisonSac.cs b/Projects/Scripts/Engines/MLQuests/Items/SpeckledPoisonSac.cs index d2359237d..9451cf58f 100644 --- a/Projects/Scripts/Engines/MLQuests/Items/SpeckledPoisonSac.cs +++ b/Projects/Scripts/Engines/MLQuests/Items/SpeckledPoisonSac.cs @@ -5,10 +5,7 @@ namespace Server.Items public class SpeckledPoisonSac : TransientItem { [Constructible] - public SpeckledPoisonSac() : base(0x23A, TimeSpan.FromHours(1)) - { - LootType = LootType.Blessed; - } + public SpeckledPoisonSac() : base(0x23A, TimeSpan.FromHours(1)) => LootType = LootType.Blessed; public SpeckledPoisonSac(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/MLQuests/Items/SpiritBottle.cs b/Projects/Scripts/Engines/MLQuests/Items/SpiritBottle.cs index f1ff1c306..b8850a854 100644 --- a/Projects/Scripts/Engines/MLQuests/Items/SpiritBottle.cs +++ b/Projects/Scripts/Engines/MLQuests/Items/SpiritBottle.cs @@ -3,10 +3,7 @@ namespace Server.Items public class SpiritBottle : Item { [Constructible] - public SpiritBottle() : base(0xEFB) - { - LootType = LootType.Blessed; - } + public SpiritBottle() : base(0xEFB) => LootType = LootType.Blessed; public SpiritBottle(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/MLQuests/Items/StoutWhip.cs b/Projects/Scripts/Engines/MLQuests/Items/StoutWhip.cs index 0b16feaf9..75fcabe38 100644 --- a/Projects/Scripts/Engines/MLQuests/Items/StoutWhip.cs +++ b/Projects/Scripts/Engines/MLQuests/Items/StoutWhip.cs @@ -3,10 +3,7 @@ namespace Server.Items public class StoutWhip : Item { [Constructible] - public StoutWhip() : base(0x166F) - { - LootType = LootType.Blessed; - } + public StoutWhip() : base(0x166F) => LootType = LootType.Blessed; public StoutWhip(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/MLQuests/Items/TuitionReimbursementForm.cs b/Projects/Scripts/Engines/MLQuests/Items/TuitionReimbursementForm.cs index 047458736..e19bdad00 100644 --- a/Projects/Scripts/Engines/MLQuests/Items/TuitionReimbursementForm.cs +++ b/Projects/Scripts/Engines/MLQuests/Items/TuitionReimbursementForm.cs @@ -3,10 +3,7 @@ namespace Server.Items public class TuitionReimbursementForm : Item { [Constructible] - public TuitionReimbursementForm() : base(0xE3A) - { - LootType = LootType.Blessed; - } + public TuitionReimbursementForm() : base(0xE3A) => LootType = LootType.Blessed; public TuitionReimbursementForm(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/MLQuests/MLQuest.cs b/Projects/Scripts/Engines/MLQuests/MLQuest.cs index f466e82f9..4231451b5 100644 --- a/Projects/Scripts/Engines/MLQuests/MLQuest.cs +++ b/Projects/Scripts/Engines/MLQuests/MLQuest.cs @@ -101,15 +101,9 @@ namespace Server.Engines.MLQuests Console.WriteLine("INFO: Generating quest: {0}", GetType()); } - public MLQuestInstance CreateInstance(IQuestGiver quester, PlayerMobile pm) - { - return new MLQuestInstance(this, quester, pm); - } + public MLQuestInstance CreateInstance(IQuestGiver quester, PlayerMobile pm) => new MLQuestInstance(this, quester, pm); - public bool CanOffer(IQuestGiver quester, PlayerMobile pm, bool message) - { - return CanOffer(quester, pm, MLQuestSystem.GetContext(pm), message); - } + public bool CanOffer(IQuestGiver quester, PlayerMobile pm, bool message) => CanOffer(quester, pm, MLQuestSystem.GetContext(pm), message); public virtual bool CanOffer(IQuestGiver quester, PlayerMobile pm, MLQuestContext context, bool message) { @@ -215,10 +209,7 @@ namespace Server.Engines.MLQuests { } - public virtual TimeSpan GetRestartDelay() - { - return TimeSpan.FromSeconds(Utility.Random(1, 5) * 30); - } + public virtual TimeSpan GetRestartDelay() => TimeSpan.FromSeconds(Utility.Random(1, 5) * 30); public static void Serialize(GenericWriter writer, MLQuest quest) { diff --git a/Projects/Scripts/Engines/MLQuests/MLQuestContext.cs b/Projects/Scripts/Engines/MLQuests/MLQuestContext.cs index 23e7a6071..81b713dbb 100644 --- a/Projects/Scripts/Engines/MLQuests/MLQuestContext.cs +++ b/Projects/Scripts/Engines/MLQuests/MLQuestContext.cs @@ -202,10 +202,7 @@ namespace Server.Engines.MLQuests return quest != null && IsDoingQuest(quest); } - public bool IsDoingQuest(MLQuest quest) - { - return FindInstance(quest) != null; - } + public bool IsDoingQuest(MLQuest quest) => FindInstance(quest) != null; public void Serialize(GenericWriter writer) { @@ -230,10 +227,7 @@ namespace Server.Engines.MLQuests writer.WriteEncodedInt((int)m_Flags); } - public bool GetFlag(MLQuestFlag flag) - { - return (m_Flags & flag) != 0; - } + public bool GetFlag(MLQuestFlag flag) => (m_Flags & flag) != 0; public void SetFlag(MLQuestFlag flag, bool value) { diff --git a/Projects/Scripts/Engines/MLQuests/MLQuestEntry.cs b/Projects/Scripts/Engines/MLQuests/MLQuestEntry.cs index 262672cd5..db7ce184d 100644 --- a/Projects/Scripts/Engines/MLQuests/MLQuestEntry.cs +++ b/Projects/Scripts/Engines/MLQuests/MLQuestEntry.cs @@ -422,10 +422,7 @@ namespace Server.Engines.MLQuests Quest.OnPlayerDeath(this); } - private bool GetFlag(MLQuestInstanceFlags flag) - { - return (m_Flags & flag) != 0; - } + private bool GetFlag(MLQuestInstanceFlags flag) => (m_Flags & flag) != 0; private void SetFlag(MLQuestInstanceFlags flag, bool value) { diff --git a/Projects/Scripts/Engines/MLQuests/MLQuestPersistence.cs b/Projects/Scripts/Engines/MLQuests/MLQuestPersistence.cs index 66f041b89..87f3cfa5c 100644 --- a/Projects/Scripts/Engines/MLQuests/MLQuestPersistence.cs +++ b/Projects/Scripts/Engines/MLQuests/MLQuestPersistence.cs @@ -5,15 +5,10 @@ namespace Server.Engines.MLQuests private static MLQuestPersistence m_Instance; private MLQuestPersistence() - : base(1) - { + : base(1) => Movable = false; - } - public MLQuestPersistence(Serial serial) : base(serial) - { - m_Instance = this; - } + public MLQuestPersistence(Serial serial) : base(serial) => m_Instance = this; public override string DefaultName => "ML quests persistence - Internal"; diff --git a/Projects/Scripts/Engines/MLQuests/MLQuestSystem.cs b/Projects/Scripts/Engines/MLQuests/MLQuestSystem.cs index 5535c8969..32ec0c488 100644 --- a/Projects/Scripts/Engines/MLQuests/MLQuestSystem.cs +++ b/Projects/Scripts/Engines/MLQuests/MLQuestSystem.cs @@ -36,61 +36,61 @@ namespace Server.Engines.MLQuests Type baseQuesterType = typeof(IQuestGiver); if (File.Exists(cfgPath)) - using (StreamReader sr = new StreamReader(cfgPath)) + { + using StreamReader sr = new StreamReader(cfgPath); + string line; + + while ((line = sr.ReadLine()) != null) { - string line; + if (line.Length == 0 || line.StartsWith("#")) + continue; - while ((line = sr.ReadLine()) != null) + string[] split = line.Split('\t'); + + Type type = AssemblyHandler.FindTypeByName(split[0]); + + if (type == null || !baseQuestType.IsAssignableFrom(type)) { - if (line.Length == 0 || line.StartsWith("#")) - continue; + if (Debug) + Console.WriteLine("Warning: {1} quest type '{0}'", split[0], + type == null ? "Unknown" : "Invalid"); - string[] split = line.Split('\t'); + continue; + } - Type type = AssemblyHandler.FindTypeByName(split[0]); + MLQuest quest = null; - if (type == null || !baseQuestType.IsAssignableFrom(type)) + try + { + quest = Activator.CreateInstance(type) as MLQuest; + } + catch + { + // ignored + } + + if (quest == null) + continue; + + Register(type, quest); + + for (int i = 1; i < split.Length; ++i) + { + Type questerType = AssemblyHandler.FindTypeByName(split[i]); + + if (questerType == null || !baseQuesterType.IsAssignableFrom(questerType)) { if (Debug) - Console.WriteLine("Warning: {1} quest type '{0}'", split[0], - type == null ? "Unknown" : "Invalid"); + Console.WriteLine("Warning: {1} quester type '{0}'", split[i], + questerType == null ? "Unknown" : "Invalid"); continue; } - MLQuest quest = null; - - try - { - quest = Activator.CreateInstance(type) as MLQuest; - } - catch - { - // ignored - } - - if (quest == null) - continue; - - Register(type, quest); - - for (int i = 1; i < split.Length; ++i) - { - Type questerType = AssemblyHandler.FindTypeByName(split[i]); - - if (questerType == null || !baseQuesterType.IsAssignableFrom(questerType)) - { - if (Debug) - Console.WriteLine("Warning: {1} quester type '{0}'", split[i], - questerType == null ? "Unknown" : "Invalid"); - - continue; - } - - RegisterQuestGiver(quest, questerType); - } + RegisterQuestGiver(quest, questerType); } } + } } public static bool Enabled => Core.ML; @@ -653,10 +653,7 @@ namespace Server.Engines.MLQuests return result; } - public static List FindQuestList(Type questerType) - { - return QuestGivers.TryGetValue(questerType, out List result) ? result : EmptyList; - } + public static List FindQuestList(Type questerType) => QuestGivers.TryGetValue(questerType, out List result) ? result : EmptyList; public class ViewQuestsCommand : BaseCommand { diff --git a/Projects/Scripts/Engines/MLQuests/Mobiles/BoonCollector.cs b/Projects/Scripts/Engines/MLQuests/Mobiles/BoonCollector.cs index 7c8f81bd2..0ba0dff6d 100644 --- a/Projects/Scripts/Engines/MLQuests/Mobiles/BoonCollector.cs +++ b/Projects/Scripts/Engines/MLQuests/Mobiles/BoonCollector.cs @@ -86,10 +86,7 @@ namespace Server.Engines.MLQuests.Mobiles DenyTalk(from); } - public virtual bool CanTalkTo(Mobile from) - { - return true; - } + public virtual bool CanTalkTo(Mobile from) => true; public virtual void DenyTalk(Mobile from) { @@ -191,10 +188,7 @@ namespace Server.Engines.MLQuests.Mobiles m_Index = 0; } - private static TimeSpan GetDelay() - { - return TimeSpan.FromSeconds(Utility.RandomBool() ? 3 : 4); - } + private static TimeSpan GetDelay() => TimeSpan.FromSeconds(Utility.RandomBool() ? 3 : 4); protected override void OnTick() { @@ -297,10 +291,7 @@ namespace Server.Engines.MLQuests.Mobiles public override string DefaultName => "Darius"; - public override bool CanTalkTo(Mobile from) - { - return from.Race == Race.Human; - } + public override bool CanTalkTo(Mobile from) => from.Race == Race.Human; public override void DenyTalk(Mobile from) { @@ -394,10 +385,7 @@ namespace Server.Engines.MLQuests.Mobiles public override string DefaultName => "Nedrick"; - public override bool CanTalkTo(Mobile from) - { - return from.Race == Race.Elf; - } + public override bool CanTalkTo(Mobile from) => from.Race == Race.Elf; public override void DenyTalk(Mobile from) { diff --git a/Projects/Scripts/Engines/MLQuests/Mobiles/SirHelper.cs b/Projects/Scripts/Engines/MLQuests/Mobiles/SirHelper.cs index e38f08cfc..ac70f3b68 100644 --- a/Projects/Scripts/Engines/MLQuests/Mobiles/SirHelper.cs +++ b/Projects/Scripts/Engines/MLQuests/Mobiles/SirHelper.cs @@ -40,10 +40,7 @@ namespace Server.Engines.MLQuests.Mobiles { } - public override bool GetGender() - { - return false; // male - } + public override bool GetGender() => false; public override void CheckMorph() { diff --git a/Projects/Scripts/Engines/MLQuests/Objectives/BaseObjective.cs b/Projects/Scripts/Engines/MLQuests/Objectives/BaseObjective.cs index 044867b60..5277614ad 100644 --- a/Projects/Scripts/Engines/MLQuests/Objectives/BaseObjective.cs +++ b/Projects/Scripts/Engines/MLQuests/Objectives/BaseObjective.cs @@ -9,17 +9,11 @@ namespace Server.Engines.MLQuests.Objectives public virtual bool IsTimed => false; public virtual TimeSpan Duration => TimeSpan.Zero; - public virtual bool CanOffer(IQuestGiver quester, PlayerMobile pm, bool message) - { - return true; - } + public virtual bool CanOffer(IQuestGiver quester, PlayerMobile pm, bool message) => true; public abstract void WriteToGump(Gump g, ref int y); - public virtual BaseObjectiveInstance CreateInstance(MLQuestInstance instance) - { - return null; - } + public virtual BaseObjectiveInstance CreateInstance(MLQuestInstance instance) => null; } public abstract class BaseObjectiveInstance @@ -63,15 +57,9 @@ namespace Server.Engines.MLQuests.Objectives y += 16; } - public virtual bool AllowsQuestItem(Item item, Type type) - { - return false; - } + public virtual bool AllowsQuestItem(Item item, Type type) => false; - public virtual bool IsCompleted() - { - return false; - } + public virtual bool IsCompleted() => false; public virtual void CheckComplete() { @@ -94,10 +82,7 @@ namespace Server.Engines.MLQuests.Objectives { } - public virtual bool OnBeforeClaimReward() - { - return true; - } + public virtual bool OnBeforeClaimReward() => true; public virtual void OnClaimReward() { diff --git a/Projects/Scripts/Engines/MLQuests/Objectives/CollectObjective.cs b/Projects/Scripts/Engines/MLQuests/Objectives/CollectObjective.cs index cccf92fc7..d113f1832 100644 --- a/Projects/Scripts/Engines/MLQuests/Objectives/CollectObjective.cs +++ b/Projects/Scripts/Engines/MLQuests/Objectives/CollectObjective.cs @@ -31,15 +31,9 @@ namespace Server.Engines.MLQuests.Objectives public virtual bool ShowDetailed => true; - public bool CheckType(Type type) - { - return AcceptedType?.IsAssignableFrom(type) == true; - } + public bool CheckType(Type type) => AcceptedType?.IsAssignableFrom(type) == true; - public virtual bool CheckItem(Item item) - { - return true; - } + public virtual bool CheckItem(Item item) => true; public static int LabelToItemID(int label) { @@ -78,10 +72,7 @@ namespace Server.Engines.MLQuests.Objectives y += 32; } - public override BaseObjectiveInstance CreateInstance(MLQuestInstance instance) - { - return new CollectObjectiveInstance(this, instance); - } + public override BaseObjectiveInstance CreateInstance(MLQuestInstance instance) => new CollectObjectiveInstance(this, instance); } #region Timed @@ -89,10 +80,8 @@ namespace Server.Engines.MLQuests.Objectives public class TimedCollectObjective : CollectObjective { public TimedCollectObjective(TimeSpan duration, int amount, Type type, TextDefinition name) - : base(amount, type, name) - { + : base(amount, type, name) => Duration = duration; - } public override bool IsTimed => true; public override TimeSpan Duration{ get; } @@ -103,10 +92,8 @@ namespace Server.Engines.MLQuests.Objectives public class CollectObjectiveInstance : BaseObjectiveInstance { public CollectObjectiveInstance(CollectObjective objective, MLQuestInstance instance) - : base(instance, objective) - { + : base(instance, objective) => Objective = objective; - } public CollectObjective Objective{ get; set; } @@ -121,15 +108,9 @@ namespace Server.Engines.MLQuests.Objectives return items.Where(item => item.QuestItem && Objective.CheckItem(item)).Sum(item => item.Amount); } - public override bool AllowsQuestItem(Item item, Type type) - { - return Objective.CheckType(type) && Objective.CheckItem(item); - } + public override bool AllowsQuestItem(Item item, Type type) => Objective.CheckType(type) && Objective.CheckItem(item); - public override bool IsCompleted() - { - return GetCurrentTotal() >= Objective.DesiredAmount; - } + public override bool IsCompleted() => GetCurrentTotal() >= Objective.DesiredAmount; public override void OnQuestCancelled() { diff --git a/Projects/Scripts/Engines/MLQuests/Objectives/DeliverObjective.cs b/Projects/Scripts/Engines/MLQuests/Objectives/DeliverObjective.cs index cd36d49c5..5fc354b12 100644 --- a/Projects/Scripts/Engines/MLQuests/Objectives/DeliverObjective.cs +++ b/Projects/Scripts/Engines/MLQuests/Objectives/DeliverObjective.cs @@ -86,10 +86,7 @@ namespace Server.Engines.MLQuests.Objectives y += 16; } - public override BaseObjectiveInstance CreateInstance(MLQuestInstance instance) - { - return new DeliverObjectiveInstance(this, instance); - } + public override BaseObjectiveInstance CreateInstance(MLQuestInstance instance) => new DeliverObjectiveInstance(this, instance); } #region Timed @@ -98,10 +95,8 @@ namespace Server.Engines.MLQuests.Objectives { public TimedDeliverObjective(TimeSpan duration, Type delivery, int amount, TextDefinition name, Type destination, bool spawnsDelivery = true) - : base(delivery, amount, name, destination, spawnsDelivery) - { + : base(delivery, amount, name, destination, spawnsDelivery) => Duration = duration; - } public override bool IsTimed => true; public override TimeSpan Duration{ get; } @@ -112,10 +107,8 @@ namespace Server.Engines.MLQuests.Objectives public class DeliverObjectiveInstance : BaseObjectiveInstance { public DeliverObjectiveInstance(DeliverObjective objective, MLQuestInstance instance) - : base(instance, objective) - { + : base(instance, objective) => Objective = objective; - } public DeliverObjective Objective{ get; set; } @@ -130,10 +123,7 @@ namespace Server.Engines.MLQuests.Objectives return destType?.IsAssignableFrom(type) == true; } - public override bool IsCompleted() - { - return HasCompleted; - } + public override bool IsCompleted() => HasCompleted; public override void OnQuestAccepted() { diff --git a/Projects/Scripts/Engines/MLQuests/Objectives/EscortObjective.cs b/Projects/Scripts/Engines/MLQuests/Objectives/EscortObjective.cs index 05814e1a5..a81783ed4 100644 --- a/Projects/Scripts/Engines/MLQuests/Objectives/EscortObjective.cs +++ b/Projects/Scripts/Engines/MLQuests/Objectives/EscortObjective.cs @@ -7,10 +7,7 @@ namespace Server.Engines.MLQuests.Objectives { public class EscortObjective : BaseObjective { - public EscortObjective(QuestArea destination = null) - { - Destination = destination; - } + public EscortObjective(QuestArea destination = null) => Destination = destination; public QuestArea Destination{ get; set; } @@ -99,10 +96,7 @@ namespace Server.Engines.MLQuests.Objectives public override DataType ExtraDataType => DataType.EscortObjective; - public override bool IsCompleted() - { - return HasCompleted; - } + public override bool IsCompleted() => HasCompleted; private void CheckDestination() { diff --git a/Projects/Scripts/Engines/MLQuests/Objectives/GainSkillObjective.cs b/Projects/Scripts/Engines/MLQuests/Objectives/GainSkillObjective.cs index 692e922cf..ff829b636 100644 --- a/Projects/Scripts/Engines/MLQuests/Objectives/GainSkillObjective.cs +++ b/Projects/Scripts/Engines/MLQuests/Objectives/GainSkillObjective.cs @@ -71,15 +71,9 @@ namespace Server.Engines.MLQuests.Objectives y += 16; } - public override BaseObjectiveInstance CreateInstance(MLQuestInstance instance) - { - return new GainSkillObjectiveInstance(this, instance); - } + public override BaseObjectiveInstance CreateInstance(MLQuestInstance instance) => new GainSkillObjectiveInstance(this, instance); - private bool GetFlag(GainSkillObjectiveFlags flag) - { - return (m_Flags & flag) != 0; - } + private bool GetFlag(GainSkillObjectiveFlags flag) => (m_Flags & flag) != 0; private void SetFlag(GainSkillObjectiveFlags flag, bool value) { @@ -94,17 +88,12 @@ namespace Server.Engines.MLQuests.Objectives public class GainSkillObjectiveInstance : BaseObjectiveInstance { public GainSkillObjectiveInstance(GainSkillObjective objective, MLQuestInstance instance) - : base(instance, objective) - { + : base(instance, objective) => Objective = objective; - } public GainSkillObjective Objective{ get; set; } - public bool Handles(SkillName skill) - { - return Objective.Skill == skill; - } + public bool Handles(SkillName skill) => Objective.Skill == skill; public override bool IsCompleted() { diff --git a/Projects/Scripts/Engines/MLQuests/Objectives/KillObjective.cs b/Projects/Scripts/Engines/MLQuests/Objectives/KillObjective.cs index af75f1660..89f47f269 100644 --- a/Projects/Scripts/Engines/MLQuests/Objectives/KillObjective.cs +++ b/Projects/Scripts/Engines/MLQuests/Objectives/KillObjective.cs @@ -55,10 +55,7 @@ namespace Server.Engines.MLQuests.Objectives #endregion } - public override BaseObjectiveInstance CreateInstance(MLQuestInstance instance) - { - return new KillObjectiveInstance(this, instance); - } + public override BaseObjectiveInstance CreateInstance(MLQuestInstance instance) => new KillObjectiveInstance(this, instance); } #region Timed @@ -66,10 +63,8 @@ namespace Server.Engines.MLQuests.Objectives public class TimedKillObjective : KillObjective { public TimedKillObjective(TimeSpan duration, int amount, Type[] types, TextDefinition name, QuestArea area = null) - : base(amount, types, name, area) - { + : base(amount, types, name, area) => Duration = duration; - } public override bool IsTimed => true; public override TimeSpan Duration{ get; } @@ -116,10 +111,7 @@ namespace Server.Engines.MLQuests.Objectives return false; } - public override bool IsCompleted() - { - return Slain >= Objective.DesiredAmount; - } + public override bool IsCompleted() => Slain >= Objective.DesiredAmount; public override void WriteToGump(Gump g, ref int y) { diff --git a/Projects/Scripts/Engines/MLQuests/QuestArea.cs b/Projects/Scripts/Engines/MLQuests/QuestArea.cs index 929c058e3..1aa0a02f3 100644 --- a/Projects/Scripts/Engines/MLQuests/QuestArea.cs +++ b/Projects/Scripts/Engines/MLQuests/QuestArea.cs @@ -21,10 +21,7 @@ namespace Server.Engines.MLQuests public Map ForceMap{ get; set; } - public bool Contains(Mobile mob) - { - return Contains(mob.Region); - } + public bool Contains(Mobile mob) => Contains(mob.Region); public bool Contains(Region reg) { diff --git a/Projects/Scripts/Engines/MLQuests/QuesterNameAttribute.cs b/Projects/Scripts/Engines/MLQuests/QuesterNameAttribute.cs index 3c8191f7f..ffe0db292 100644 --- a/Projects/Scripts/Engines/MLQuests/QuesterNameAttribute.cs +++ b/Projects/Scripts/Engines/MLQuests/QuesterNameAttribute.cs @@ -9,10 +9,7 @@ namespace Server.Engines.MLQuests private static readonly Type m_Type = typeof(QuesterNameAttribute); private static readonly Dictionary m_Cache = new Dictionary(); - public QuesterNameAttribute(string questerName) - { - QuesterName = questerName; - } + public QuesterNameAttribute(string questerName) => QuesterName = questerName; public string QuesterName{ get; } diff --git a/Projects/Scripts/Engines/MLQuests/Rewards/BaseReward.cs b/Projects/Scripts/Engines/MLQuests/Rewards/BaseReward.cs index a0a422386..7054471df 100644 --- a/Projects/Scripts/Engines/MLQuests/Rewards/BaseReward.cs +++ b/Projects/Scripts/Engines/MLQuests/Rewards/BaseReward.cs @@ -6,10 +6,7 @@ namespace Server.Engines.MLQuests.Rewards { public abstract class BaseReward { - public BaseReward(TextDefinition name) - { - Name = name; - } + public BaseReward(TextDefinition name) => Name = name; public TextDefinition Name{ get; set; } diff --git a/Projects/Scripts/Engines/MyRunUO/Config.cs b/Projects/Scripts/Engines/MyRunUO/Config.cs deleted file mode 100644 index 51bd3896a..000000000 --- a/Projects/Scripts/Engines/MyRunUO/Config.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using System.Text; -using System.Threading; - -namespace Server.Engines.MyRunUO -{ - public class Config - { - // Details required for database connection string - public const string DatabaseDriver = "{MySQL ODBC 5.2w Driver}"; - public const string DatabaseServer = "localhost"; - public const string DatabaseName = "MyRunUO"; - public const string DatabaseUserID = "username"; - - public const string DatabasePassword = "password"; - - // Is MyRunUO enabled? - public static bool Enabled = false; - - // Should the database use transactions? This is recommended - public static bool UseTransactions = true; - - // Use optimized table loading techniques? (LOAD DATA INFILE) - public static bool LoadDataInFile = true; - - // This must be enabled if the database server is on a remote machine. - public static bool DatabaseNonLocal = DatabaseServer != "localhost"; - - // Text encoding used - public static Encoding EncodingIO = Encoding.ASCII; - - // Database communication is done in a separate thread. This value is the 'priority' of that thread, or, how much CPU it will try to use - public static ThreadPriority DatabaseThreadPriority = ThreadPriority.BelowNormal; - - // Any character with an AccessLevel equal to or higher than this will not be displayed - public static AccessLevel HiddenAccessLevel = AccessLevel.Counselor; - - // Export character database every 30 minutes - public static TimeSpan CharacterUpdateInterval = TimeSpan.FromMinutes(30.0); - - // Export online list database every 5 minutes - public static TimeSpan StatusUpdateInterval = TimeSpan.FromMinutes(5.0); - - public static string CompileConnectionString() - { - string connectionString = - $"DRIVER={DatabaseDriver};SERVER={DatabaseServer};DATABASE={DatabaseName};UID={DatabaseUserID};PASSWORD={DatabasePassword};"; - - return connectionString; - } - } -} \ No newline at end of file diff --git a/Projects/Scripts/Engines/MyRunUO/LayerComparer.cs b/Projects/Scripts/Engines/MyRunUO/LayerComparer.cs deleted file mode 100644 index 5fd198a0e..000000000 --- a/Projects/Scripts/Engines/MyRunUO/LayerComparer.cs +++ /dev/null @@ -1,84 +0,0 @@ -using System.Collections.Generic; - -namespace Server.Engines.MyRunUO -{ - public class LayerComparer : IComparer - { - private static Layer PlateArms = (Layer)255; - private static Layer ChainTunic = (Layer)254; - private static Layer LeatherShorts = (Layer)253; - - private static Layer[] m_DesiredLayerOrder = - { - Layer.Cloak, - Layer.Bracelet, - Layer.Ring, - Layer.Shirt, - Layer.Pants, - Layer.InnerLegs, - Layer.Shoes, - LeatherShorts, - Layer.Arms, - Layer.InnerTorso, - LeatherShorts, - PlateArms, - Layer.MiddleTorso, - Layer.OuterLegs, - Layer.Neck, - Layer.Waist, - Layer.Gloves, - Layer.OuterTorso, - Layer.OneHanded, - Layer.TwoHanded, - Layer.FacialHair, - Layer.Hair, - Layer.Helm, - Layer.Talisman - }; - - public static readonly IComparer Instance = new LayerComparer(); - - static LayerComparer() - { - TranslationTable = new int[256]; - - for (int i = 0; i < m_DesiredLayerOrder.Length; ++i) - TranslationTable[(int)m_DesiredLayerOrder[i]] = m_DesiredLayerOrder.Length - i; - } - - public static int[] TranslationTable{ get; } - - public int Compare(Item a, Item b) - { - if (a == null) - return b == null ? 0 : 1; - - if (b == null) - return -1; - - Layer aLayer = Fix(a.ItemID, a.Layer); - Layer bLayer = Fix(b.ItemID, b.Layer); - - return TranslationTable[(int)bLayer] - TranslationTable[(int)aLayer]; - } - - public static bool IsValid(Item item) - { - return TranslationTable[(int)item.Layer] > 0; - } - - public Layer Fix(int itemID, Layer oldLayer) - { - if (itemID == 0x1410 || itemID == 0x1417) // platemail arms - return PlateArms; - - if (itemID == 0x13BF || itemID == 0x13C4) // chainmail tunic - return ChainTunic; - - if (itemID == 0x1C08 || itemID == 0x1C09 || itemID == 0x1C00 || itemID == 0x1C01) // leather skirt/shorts - return LeatherShorts; - - return oldLayer; - } - } -} \ No newline at end of file diff --git a/Projects/Scripts/Engines/Party/Party.cs b/Projects/Scripts/Engines/Party/Party.cs index 74e9c4cd8..45bfd02fc 100644 --- a/Projects/Scripts/Engines/Party/Party.cs +++ b/Projects/Scripts/Engines/Party/Party.cs @@ -174,10 +174,7 @@ namespace Server.Engines.PartySystem from.Party = null; } - public static Party Get(Mobile m) - { - return m?.Party as Party; - } + public static Party Get(Mobile m) => m?.Party as Party; public void Add(Mobile m) { @@ -288,10 +285,7 @@ namespace Server.Engines.PartySystem } } - public bool Contains(Mobile m) - { - return this[m] != null; - } + public bool Contains(Mobile m) => this[m] != null; public void Disband() { @@ -433,10 +427,7 @@ namespace Server.Engines.PartySystem { private Mobile m_Mobile; - public RejoinTimer(Mobile m) : base(TimeSpan.FromSeconds(1.0)) - { - m_Mobile = m; - } + public RejoinTimer(Mobile m) : base(TimeSpan.FromSeconds(1.0)) => m_Mobile = m; protected override void OnTick() { diff --git a/Projects/Scripts/Engines/Pathing/FastAStarAlgorithm.cs b/Projects/Scripts/Engines/Pathing/FastAStarAlgorithm.cs index 2b31ef552..312e995c0 100644 --- a/Projects/Scripts/Engines/Pathing/FastAStarAlgorithm.cs +++ b/Projects/Scripts/Engines/Pathing/FastAStarAlgorithm.cs @@ -47,10 +47,7 @@ namespace Server.PathAlgorithms.FastAStar return x * x + y * y + z * z; } - public override bool CheckCondition(Mobile m, Map map, Point3D start, Point3D goal) - { - return Utility.InRange(start, goal, AreaSize); - } + public override bool CheckCondition(Mobile m, Map map, Point3D start, Point3D goal) => Utility.InRange(start, goal, AreaSize); private void RemoveFromChain(int node) { diff --git a/Projects/Scripts/Engines/Pathing/FastMovement.cs b/Projects/Scripts/Engines/Pathing/FastMovement.cs index 6630e8b65..2d3416b40 100644 --- a/Projects/Scripts/Engines/Pathing/FastMovement.cs +++ b/Projects/Scripts/Engines/Pathing/FastMovement.cs @@ -130,12 +130,10 @@ namespace Server.Movement return moveIsOk; } - public bool CheckMovement(Mobile m, Direction d, out int newZ) - { - return !Enabled && _Successor != null + public bool CheckMovement(Mobile m, Direction d, out int newZ) => + !Enabled && _Successor != null ? _Successor.CheckMovement(m, d, out newZ) : CheckMovement(m, m.Map, m.Location, d, out newZ); - } public static void Initialize() { @@ -381,21 +379,13 @@ namespace Server.Movement return moveIsOk; } - private static bool Verify(Item item, int x, int y) - { - return item.AtWorldPoint(x, y); - } + private static bool Verify(Item item, int x, int y) => item.AtWorldPoint(x, y); - private static bool Verify(Item item, TileFlag reqFlags, bool ignoreMovableImpassables) - { - return item != null && (!ignoreMovableImpassables || !item.Movable || !item.ItemData.Impassable) && - (item.ItemData.Flags & reqFlags) != 0 && !(item is BaseMulti) && item.ItemID <= TileData.MaxItemValue; - } + private static bool Verify(Item item, TileFlag reqFlags, bool ignoreMovableImpassables) => + item != null && (!ignoreMovableImpassables || !item.Movable || !item.ItemData.Impassable) && + (item.ItemData.Flags & reqFlags) != 0 && !(item is BaseMulti) && item.ItemID <= TileData.MaxItemValue; - private static bool Verify(Item item, TileFlag reqFlags, bool ignoreMovableImpassables, int x, int y) - { - return Verify(item, reqFlags, ignoreMovableImpassables) && Verify(item, x, y); - } + private static bool Verify(Item item, TileFlag reqFlags, bool ignoreMovableImpassables, int x, int y) => Verify(item, reqFlags, ignoreMovableImpassables) && Verify(item, x, y); private static void GetStartZ(Mobile m, Map map, Point3D loc, IEnumerable itemList, out int zLow, out int zTop) { diff --git a/Projects/Scripts/Engines/Pathing/Movement.cs b/Projects/Scripts/Engines/Pathing/Movement.cs index 8c954f4a4..0c5ffacd6 100644 --- a/Projects/Scripts/Engines/Pathing/Movement.cs +++ b/Projects/Scripts/Engines/Pathing/Movement.cs @@ -264,10 +264,7 @@ namespace Server.Movement return moveIsOk; } - public bool CheckMovement(Mobile m, Direction d, out int newZ) - { - return CheckMovement(m, m.Map, m.Location, d, out newZ); - } + public bool CheckMovement(Mobile m, Direction d, out int newZ) => CheckMovement(m, m.Map, m.Location, d, out newZ); public static void Configure() { @@ -499,11 +496,9 @@ namespace Server.Movement return moveIsOk; } - private bool CanMoveOver(Mobile m, Mobile t) - { - return !t.Alive || !m.Alive || t.IsDeadBondedPet || m.IsDeadBondedPet || - t.Hidden && t.AccessLevel > AccessLevel.Player; - } + private bool CanMoveOver(Mobile m, Mobile t) => + !t.Alive || !m.Alive || t.IsDeadBondedPet || m.IsDeadBondedPet || + t.Hidden && t.AccessLevel > AccessLevel.Player; private void GetStartZ(Mobile m, Map map, Point3D loc, List itemList, out int zLow, out int zTop) { diff --git a/Projects/Scripts/Engines/Pathing/PathFollower.cs b/Projects/Scripts/Engines/Pathing/PathFollower.cs index 73fbd46e5..6780ba930 100644 --- a/Projects/Scripts/Engines/Pathing/PathFollower.cs +++ b/Projects/Scripts/Engines/Pathing/PathFollower.cs @@ -90,10 +90,7 @@ namespace Server } - public bool Check(Point3D loc, Point3D goal, int range) - { - return Utility.InRange(loc, goal, range) && (range > 1 || Math.Abs(loc.Z - goal.Z) < 16); - } + public bool Check(Point3D loc, Point3D goal, int range) => Utility.InRange(loc, goal, range) && (range > 1 || Math.Abs(loc.Z - goal.Z) < 16); public bool Follow(bool run, int range) { diff --git a/Projects/Scripts/Engines/Pathing/SlowAStarAlgorithm.cs b/Projects/Scripts/Engines/Pathing/SlowAStarAlgorithm.cs index c0221c02a..e09d23520 100644 --- a/Projects/Scripts/Engines/Pathing/SlowAStarAlgorithm.cs +++ b/Projects/Scripts/Engines/Pathing/SlowAStarAlgorithm.cs @@ -38,10 +38,7 @@ namespace Server.PathAlgorithms.SlowAStar return x * x + y * y + z * z; } - public override bool CheckCondition(Mobile m, Map map, Point3D start, Point3D goal) - { - return false; - } + public override bool CheckCondition(Mobile m, Map map, Point3D start, Point3D goal) => false; public override Direction[] Find(Mobile m, Map map, Point3D start, Point3D goal) { diff --git a/Projects/Scripts/Engines/Plants/MiscItems/GreenThorns.cs b/Projects/Scripts/Engines/Plants/MiscItems/GreenThorns.cs index be37f5f78..f57c30053 100644 --- a/Projects/Scripts/Engines/Plants/MiscItems/GreenThorns.cs +++ b/Projects/Scripts/Engines/Plants/MiscItems/GreenThorns.cs @@ -59,10 +59,7 @@ namespace Server.Items { private GreenThorns m_Thorn; - public InternalTarget(GreenThorns thorn) : base(3, true, TargetFlags.None) - { - m_Thorn = thorn; - } + public InternalTarget(GreenThorns thorn) : base(3, true, TargetFlags.None) => m_Thorn = thorn; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Engines/Plants/MiscItems/OrangePetals.cs b/Projects/Scripts/Engines/Plants/MiscItems/OrangePetals.cs index f2e30e623..6106aa662 100644 --- a/Projects/Scripts/Engines/Plants/MiscItems/OrangePetals.cs +++ b/Projects/Scripts/Engines/Plants/MiscItems/OrangePetals.cs @@ -85,10 +85,7 @@ namespace Server.Items return context; } - public static bool UnderEffect(Mobile m) - { - return m_Table.ContainsKey(m); - } + public static bool UnderEffect(Mobile m) => m_Table.ContainsKey(m); public override void Serialize(GenericWriter writer) { @@ -108,10 +105,7 @@ namespace Server.Items { private Mobile m_Mobile; - public OrangePetalsTimer(Mobile from) : base(TimeSpan.FromMinutes(5.0)) - { - m_Mobile = from; - } + public OrangePetalsTimer(Mobile from) : base(TimeSpan.FromMinutes(5.0)) => m_Mobile = from; protected override void OnTick() { @@ -125,10 +119,7 @@ namespace Server.Items private class OrangePetalsContext { - public OrangePetalsContext(Timer timer) - { - Timer = timer; - } + public OrangePetalsContext(Timer timer) => Timer = timer; public Timer Timer{ get; } } diff --git a/Projects/Scripts/Engines/Plants/MiscItems/RedLeaves.cs b/Projects/Scripts/Engines/Plants/MiscItems/RedLeaves.cs index b95ef96b9..fbcb35218 100644 --- a/Projects/Scripts/Engines/Plants/MiscItems/RedLeaves.cs +++ b/Projects/Scripts/Engines/Plants/MiscItems/RedLeaves.cs @@ -50,10 +50,7 @@ namespace Server.Items { private RedLeaves m_RedLeaves; - public InternalTarget(RedLeaves redLeaves) : base(3, false, TargetFlags.None) - { - m_RedLeaves = redLeaves; - } + public InternalTarget(RedLeaves redLeaves) : base(3, false, TargetFlags.None) => m_RedLeaves = redLeaves; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Engines/Plants/PlantBowl.cs b/Projects/Scripts/Engines/Plants/PlantBowl.cs index 8a328a3ce..59d35fa5a 100644 --- a/Projects/Scripts/Engines/Plants/PlantBowl.cs +++ b/Projects/Scripts/Engines/Plants/PlantBowl.cs @@ -48,10 +48,7 @@ namespace Server.Engines.Plants }; [Constructible] - public PlantBowl() : base(0x15FD) - { - Weight = 1.0; - } + public PlantBowl() : base(0x15FD) => Weight = 1.0; public PlantBowl(Serial serial) : base(serial) { @@ -110,10 +107,7 @@ namespace Server.Engines.Plants { private PlantBowl m_PlantBowl; - public InternalTarget(PlantBowl plantBowl) : base(3, true, TargetFlags.None) - { - m_PlantBowl = plantBowl; - } + public InternalTarget(PlantBowl plantBowl) : base(3, true, TargetFlags.None) => m_PlantBowl = plantBowl; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Engines/Plants/PlantHue.cs b/Projects/Scripts/Engines/Plants/PlantHue.cs index 631a81387..a00d4f296 100644 --- a/Projects/Scripts/Engines/Plants/PlantHue.cs +++ b/Projects/Scripts/Engines/Plants/PlantHue.cs @@ -41,8 +41,7 @@ namespace Server.Engines.Plants { private static Dictionary m_Table; - static PlantHueInfo() - { + static PlantHueInfo() => m_Table = new Dictionary { [PlantHue.Plain] = new PlantHueInfo(0, 1060813, PlantHue.Plain, 0x835), @@ -66,8 +65,6 @@ namespace Server.Engines.Plants [PlantHue.FireRed] = new PlantHueInfo(0x489, 1061855, PlantHue.FireRed) }; - } - private PlantHueInfo(int hue, int name, PlantHue plantHue) : this(hue, name, plantHue, hue) { } @@ -88,10 +85,7 @@ namespace Server.Engines.Plants public int GumpHue{ get; } - public static PlantHueInfo GetInfo(PlantHue plantHue) - { - return m_Table.TryGetValue(plantHue, out PlantHueInfo info) ? info : m_Table[PlantHue.Plain]; - } + public static PlantHueInfo GetInfo(PlantHue plantHue) => m_Table.TryGetValue(plantHue, out PlantHueInfo info) ? info : m_Table[PlantHue.Plain]; public static PlantHue RandomFirstGeneration() { @@ -104,30 +98,15 @@ namespace Server.Engines.Plants } } - public static bool CanReproduce(PlantHue plantHue) - { - return (plantHue & PlantHue.Reproduces) != PlantHue.None; - } + public static bool CanReproduce(PlantHue plantHue) => (plantHue & PlantHue.Reproduces) != PlantHue.None; - public static bool IsCrossable(PlantHue plantHue) - { - return (plantHue & PlantHue.Crossable) != PlantHue.None; - } + public static bool IsCrossable(PlantHue plantHue) => (plantHue & PlantHue.Crossable) != PlantHue.None; - public static bool IsBright(PlantHue plantHue) - { - return (plantHue & PlantHue.Bright) != PlantHue.None; - } + public static bool IsBright(PlantHue plantHue) => (plantHue & PlantHue.Bright) != PlantHue.None; - public static PlantHue GetNotBright(PlantHue plantHue) - { - return plantHue & ~PlantHue.Bright; - } + public static PlantHue GetNotBright(PlantHue plantHue) => plantHue & ~PlantHue.Bright; - public static bool IsPrimary(PlantHue plantHue) - { - return plantHue == PlantHue.Red || plantHue == PlantHue.Blue || plantHue == PlantHue.Yellow; - } + public static bool IsPrimary(PlantHue plantHue) => plantHue == PlantHue.Red || plantHue == PlantHue.Blue || plantHue == PlantHue.Yellow; public static PlantHue Cross(PlantHue first, PlantHue second) { @@ -161,24 +140,12 @@ namespace Server.Engines.Plants return notBrightFirst & notBrightSecond; } - public bool IsCrossable() - { - return IsCrossable(PlantHue); - } + public bool IsCrossable() => IsCrossable(PlantHue); - public bool IsBright() - { - return IsBright(PlantHue); - } + public bool IsBright() => IsBright(PlantHue); - public PlantHue GetNotBright() - { - return GetNotBright(PlantHue); - } + public PlantHue GetNotBright() => GetNotBright(PlantHue); - public bool IsPrimary() - { - return IsPrimary(PlantHue); - } + public bool IsPrimary() => IsPrimary(PlantHue); } } diff --git a/Projects/Scripts/Engines/Plants/PlantItem.cs b/Projects/Scripts/Engines/Plants/PlantItem.cs index 0a34d1837..bc4f71965 100644 --- a/Projects/Scripts/Engines/Plants/PlantItem.cs +++ b/Projects/Scripts/Engines/Plants/PlantItem.cs @@ -191,10 +191,7 @@ namespace Server.Engines.Plants return 1026951; // dirt } - public int GetLocalizedContainerType() - { - return 1150435; // bowl - } + public int GetLocalizedContainerType() => 1150435; private void Update() { @@ -284,11 +281,9 @@ namespace Server.Engines.Plants } } - public bool IsUsableBy(Mobile from) - { - return IsChildOf(from.Backpack) || IsChildOf(from.FindBankNoCreate()) || IsLockedDown && IsAccessibleTo(from) || - RootParent is Item root && root.IsSecure && root.IsAccessibleTo(from); - } + public bool IsUsableBy(Mobile from) => + IsChildOf(from.Backpack) || IsChildOf(from.FindBankNoCreate()) || IsLockedDown && IsAccessibleTo(from) || + RootParent is Item root && root.IsSecure && root.IsAccessibleTo(from); public override void OnDoubleClick(Mobile from) { diff --git a/Projects/Scripts/Engines/Plants/PlantPourTarget.cs b/Projects/Scripts/Engines/Plants/PlantPourTarget.cs index 292746970..83708b8ba 100644 --- a/Projects/Scripts/Engines/Plants/PlantPourTarget.cs +++ b/Projects/Scripts/Engines/Plants/PlantPourTarget.cs @@ -6,10 +6,7 @@ namespace Server.Engines.Plants { private PlantItem m_Plant; - public PlantPourTarget(PlantItem plant) : base(3, true, TargetFlags.None) - { - m_Plant = plant; - } + public PlantPourTarget(PlantItem plant) : base(3, true, TargetFlags.None) => m_Plant = plant; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Engines/Plants/PlantResources.cs b/Projects/Scripts/Engines/Plants/PlantResources.cs index cf6bc3356..32eae6913 100644 --- a/Projects/Scripts/Engines/Plants/PlantResources.cs +++ b/Projects/Scripts/Engines/Plants/PlantResources.cs @@ -40,9 +40,6 @@ namespace Server.Engines.Plants return null; } - public Item CreateResource() - { - return (Item)Activator.CreateInstance(ResourceType); - } + public Item CreateResource() => (Item)Activator.CreateInstance(ResourceType); } } \ No newline at end of file diff --git a/Projects/Scripts/Engines/Plants/PlantType.cs b/Projects/Scripts/Engines/Plants/PlantType.cs index 9b59d81b2..f448ff239 100644 --- a/Projects/Scripts/Engines/Plants/PlantType.cs +++ b/Projects/Scripts/Engines/Plants/PlantType.cs @@ -278,10 +278,7 @@ namespace Server.Engines.Plants return PlantType.ExoticBonsai; } - public static bool IsCrossable(PlantType plantType) - { - return GetInfo(plantType).Crossable; - } + public static bool IsCrossable(PlantType plantType) => GetInfo(plantType).Crossable; public static PlantType Cross(PlantType first, PlantType second) { @@ -296,10 +293,7 @@ namespace Server.Engines.Plants return (PlantType)((firstIndex + secondIndex) / 2); } - public static bool CanReproduce(PlantType plantType) - { - return GetInfo(plantType).Reproduces; - } + public static bool CanReproduce(PlantType plantType) => GetInfo(plantType).Reproduces; public int GetPlantLabelSeed(PlantHueInfo hueInfo) { diff --git a/Projects/Scripts/Engines/Plants/PollinateTarget.cs b/Projects/Scripts/Engines/Plants/PollinateTarget.cs index 41e1e364b..f7d0ded40 100644 --- a/Projects/Scripts/Engines/Plants/PollinateTarget.cs +++ b/Projects/Scripts/Engines/Plants/PollinateTarget.cs @@ -6,10 +6,7 @@ namespace Server.Engines.Plants { private PlantItem m_Plant; - public PollinateTarget(PlantItem plant) : base(3, true, TargetFlags.None) - { - m_Plant = plant; - } + public PollinateTarget(PlantItem plant) : base(3, true, TargetFlags.None) => m_Plant = plant; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Engines/Plants/Seed.cs b/Projects/Scripts/Engines/Plants/Seed.cs index b3578477a..69f026b04 100644 --- a/Projects/Scripts/Engines/Plants/Seed.cs +++ b/Projects/Scripts/Engines/Plants/Seed.cs @@ -68,15 +68,9 @@ namespace Server.Engines.Plants public override bool ForceShowProperties => ObjectPropertyList.Enabled; - public static Seed RandomBonsaiSeed() - { - return RandomBonsaiSeed(0.5); - } + public static Seed RandomBonsaiSeed() => RandomBonsaiSeed(0.5); - public static Seed RandomBonsaiSeed(double increaseRatio) - { - return new Seed(PlantTypeInfo.RandomBonsai(increaseRatio), PlantHue.Plain); - } + public static Seed RandomBonsaiSeed(double increaseRatio) => new Seed(PlantTypeInfo.RandomBonsai(increaseRatio), PlantHue.Plain); public static Seed RandomPeculiarSeed(int group) { @@ -145,11 +139,9 @@ namespace Server.Engines.Plants LabelTo(from, 1061916); // Choose a bowl of dirt to plant this seed in. } - public override bool StackWith(Mobile from, Item dropped, bool playSound) - { - return dropped is Seed other && other.PlantType == m_PlantType && other.PlantHue == m_PlantHue && - other.ShowType == m_ShowType && base.StackWith(from, other, playSound); - } + public override bool StackWith(Mobile from, Item dropped, bool playSound) => + dropped is Seed other && other.PlantType == m_PlantType && other.PlantHue == m_PlantHue && + other.ShowType == m_ShowType && base.StackWith(from, other, playSound); public override void OnAfterDuped(Item newItem) { diff --git a/Projects/Scripts/Engines/Quests/Ambitious Solen Queen/AmbitiousQueenQuest.cs b/Projects/Scripts/Engines/Quests/Ambitious Solen Queen/AmbitiousQueenQuest.cs index bed7d8d5e..3e89a7c1f 100644 --- a/Projects/Scripts/Engines/Quests/Ambitious Solen Queen/AmbitiousQueenQuest.cs +++ b/Projects/Scripts/Engines/Quests/Ambitious Solen Queen/AmbitiousQueenQuest.cs @@ -22,10 +22,7 @@ namespace Server.Engines.Quests.Ambitious typeof(GetRewardObjective) }; - public AmbitiousQueenQuest(PlayerMobile from, bool redSolen) : base(from) - { - RedSolen = redSolen; - } + public AmbitiousQueenQuest(PlayerMobile from, bool redSolen) : base(from) => RedSolen = redSolen; // Serialization public AmbitiousQueenQuest() diff --git a/Projects/Scripts/Engines/Quests/Ambitious Solen Queen/Conversations.cs b/Projects/Scripts/Engines/Quests/Ambitious Solen Queen/Conversations.cs index c2c15abb7..65641eb8b 100644 --- a/Projects/Scripts/Engines/Quests/Ambitious Solen Queen/Conversations.cs +++ b/Projects/Scripts/Engines/Quests/Ambitious Solen Queen/Conversations.cs @@ -77,10 +77,7 @@ namespace Server.Engines.Quests.Ambitious m_Gold = gold; } - public FullBackpackConversation() - { - m_Logged = true; - } + public FullBackpackConversation() => m_Logged = true; public override object Message => 1054077; diff --git a/Projects/Scripts/Engines/Quests/Ambitious Solen Queen/Mobiles/AmbitiousSolenQueen.cs b/Projects/Scripts/Engines/Quests/Ambitious Solen Queen/Mobiles/AmbitiousSolenQueen.cs index f4e262ea6..d47ba94b1 100644 --- a/Projects/Scripts/Engines/Quests/Ambitious Solen Queen/Mobiles/AmbitiousSolenQueen.cs +++ b/Projects/Scripts/Engines/Quests/Ambitious Solen Queen/Mobiles/AmbitiousSolenQueen.cs @@ -27,10 +27,7 @@ namespace Server.Engines.Quests.Ambitious SpeechHue = 0; } - public override int GetIdleSound() - { - return 0x10D; - } + public override int GetIdleSound() => 0x10D; public override void OnTalk(PlayerMobile player, bool contextMenu) { diff --git a/Projects/Scripts/Engines/Quests/Collector/Conversations.cs b/Projects/Scripts/Engines/Quests/Collector/Conversations.cs index f0923e572..960e812cc 100644 --- a/Projects/Scripts/Engines/Quests/Collector/Conversations.cs +++ b/Projects/Scripts/Engines/Quests/Collector/Conversations.cs @@ -243,15 +243,9 @@ namespace Server.Engines.Quests.Collector { private bool m_Logged; - public FullEndConversation(bool logged) - { - m_Logged = logged; - } + public FullEndConversation(bool logged) => m_Logged = logged; - public FullEndConversation() - { - m_Logged = true; - } + public FullEndConversation() => m_Logged = true; public override object Message => 1055135; diff --git a/Projects/Scripts/Engines/Quests/Collector/Items/EnchantedPaints.cs b/Projects/Scripts/Engines/Quests/Collector/Items/EnchantedPaints.cs index 7ef2a1df1..a2a753519 100644 --- a/Projects/Scripts/Engines/Quests/Collector/Items/EnchantedPaints.cs +++ b/Projects/Scripts/Engines/Quests/Collector/Items/EnchantedPaints.cs @@ -17,13 +17,7 @@ namespace Server.Engines.Quests.Collector { } - public override bool CanDrop(PlayerMobile player) - { - return !(player.Quest is CollectorQuest); - - /*return !( qs.IsObjectiveInProgress( typeof( CaptureImagesObjective ) ) - || qs.IsObjectiveInProgress( typeof( ReturnImagesObjective ) ) );*/ - } + public override bool CanDrop(PlayerMobile player) => !(player.Quest is CollectorQuest); public override void OnDoubleClick(Mobile from) { diff --git a/Projects/Scripts/Engines/Quests/Collector/Items/Obsidian.cs b/Projects/Scripts/Engines/Quests/Collector/Items/Obsidian.cs index a0f95a65f..d48cd0da2 100644 --- a/Projects/Scripts/Engines/Quests/Collector/Items/Obsidian.cs +++ b/Projects/Scripts/Engines/Quests/Collector/Items/Obsidian.cs @@ -199,10 +199,7 @@ namespace Server.Engines.Quests.Collector { private Obsidian m_Obsidian; - public DisassembleEntry(Obsidian obsidian) : base(6142) - { - m_Obsidian = obsidian; - } + public DisassembleEntry(Obsidian obsidian) : base(6142) => m_Obsidian = obsidian; public override void OnClick() { @@ -222,10 +219,7 @@ namespace Server.Engines.Quests.Collector { private Obsidian m_Obsidian; - public InternalTarget(Obsidian obsidian) : base(-1, false, TargetFlags.None) - { - m_Obsidian = obsidian; - } + public InternalTarget(Obsidian obsidian) : base(-1, false, TargetFlags.None) => m_Obsidian = obsidian; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Engines/Quests/Collector/Objectives.cs b/Projects/Scripts/Engines/Quests/Collector/Objectives.cs index 9ae31b2e0..147d3f146 100644 --- a/Projects/Scripts/Engines/Quests/Collector/Objectives.cs +++ b/Projects/Scripts/Engines/Quests/Collector/Objectives.cs @@ -59,10 +59,7 @@ namespace Server.Engines.Quests.Collector private DateTime m_Begin; - public SitOnTheStoolObjective() - { - m_Begin = DateTime.MaxValue; - } + public SitOnTheStoolObjective() => m_Begin = DateTime.MaxValue; public override object Message => 1055093; diff --git a/Projects/Scripts/Engines/Quests/Core/BaseQuester.cs b/Projects/Scripts/Engines/Quests/Core/BaseQuester.cs index c6f4cc259..20096b24f 100644 --- a/Projects/Scripts/Engines/Quests/Core/BaseQuester.cs +++ b/Projects/Scripts/Engines/Quests/Core/BaseQuester.cs @@ -9,10 +9,7 @@ namespace Server.Engines.Quests { private BaseQuester m_Quester; - public TalkEntry(BaseQuester quester) : base(quester.TalkNumber) - { - m_Quester = quester; - } + public TalkEntry(BaseQuester quester) : base(quester.TalkNumber) => m_Quester = quester; public override void OnClick() { @@ -52,20 +49,11 @@ namespace Server.Engines.Quests public abstract void OnTalk(PlayerMobile player, bool contextMenu); - public virtual bool CanTalkTo(PlayerMobile to) - { - return true; - } + public virtual bool CanTalkTo(PlayerMobile to) => true; - public virtual int GetAutoTalkRange(PlayerMobile m) - { - return -1; - } + public virtual int GetAutoTalkRange(PlayerMobile m) => -1; - public override bool CanBeDamaged() - { - return false; - } + public override bool CanBeDamaged() => false; protected Item SetHue(Item item, int hue) { diff --git a/Projects/Scripts/Engines/Quests/Core/Items/EnchantedSextant.cs b/Projects/Scripts/Engines/Quests/Core/Items/EnchantedSextant.cs index 0d819f792..2bb1b0fe0 100644 --- a/Projects/Scripts/Engines/Quests/Core/Items/EnchantedSextant.cs +++ b/Projects/Scripts/Engines/Quests/Core/Items/EnchantedSextant.cs @@ -68,10 +68,7 @@ namespace Server.Items }; [Constructible] - public EnchantedSextant() : base(0x1058) - { - Weight = 2.0; - } + public EnchantedSextant() : base(0x1058) => Weight = 2.0; public EnchantedSextant(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/Quests/Core/Items/HornOfRetreat.cs b/Projects/Scripts/Engines/Quests/Core/Items/HornOfRetreat.cs index 87f9b33c5..12b03d3ab 100644 --- a/Projects/Scripts/Engines/Quests/Core/Items/HornOfRetreat.cs +++ b/Projects/Scripts/Engines/Quests/Core/Items/HornOfRetreat.cs @@ -41,10 +41,7 @@ namespace Server.Engines.Quests public override int LabelNumber => 1049117; // Horn of Retreat - public virtual bool ValidateUse(Mobile from) - { - return true; - } + public virtual bool ValidateUse(Mobile from) => true; public override void GetProperties(ObjectPropertyList list) { diff --git a/Projects/Scripts/Engines/Quests/Core/QuestCallbackEntry.cs b/Projects/Scripts/Engines/Quests/Core/QuestCallbackEntry.cs index 87a1c87f7..a9b13569b 100644 --- a/Projects/Scripts/Engines/Quests/Core/QuestCallbackEntry.cs +++ b/Projects/Scripts/Engines/Quests/Core/QuestCallbackEntry.cs @@ -10,10 +10,7 @@ namespace Server.Engines.Quests { } - public QuestCallbackEntry(int number, int range, QuestCallback callback) : base(number, range) - { - m_Callback = callback; - } + public QuestCallbackEntry(int number, int range, QuestCallback callback) : base(number, range) => m_Callback = callback; public override void OnClick() { diff --git a/Projects/Scripts/Engines/Quests/Core/QuestObjective.cs b/Projects/Scripts/Engines/Quests/Core/QuestObjective.cs index 1c8db7a96..201db5f20 100644 --- a/Projects/Scripts/Engines/Quests/Core/QuestObjective.cs +++ b/Projects/Scripts/Engines/Quests/Core/QuestObjective.cs @@ -107,10 +107,7 @@ namespace Server.Engines.Quests { } - public virtual bool GetTimerEvent() - { - return !Completed; - } + public virtual bool GetTimerEvent() => !Completed; public virtual void CheckProgress() { @@ -120,19 +117,13 @@ namespace Server.Engines.Quests { } - public virtual bool GetKillEvent(BaseCreature creature, Container corpse) - { - return !Completed; - } + public virtual bool GetKillEvent(BaseCreature creature, Container corpse) => !Completed; public virtual void OnKill(BaseCreature creature, Container corpse) { } - public virtual bool IgnoreYoungProtection(Mobile from) - { - return false; - } + public virtual bool IgnoreYoungProtection(Mobile from) => false; } public class QuestLogUpdatedGump : BaseQuestGump diff --git a/Projects/Scripts/Engines/Quests/Core/QuestSystem.cs b/Projects/Scripts/Engines/Quests/Core/QuestSystem.cs index 8e644ffaa..a2d82ea75 100644 --- a/Projects/Scripts/Engines/Quests/Core/QuestSystem.cs +++ b/Projects/Scripts/Engines/Quests/Core/QuestSystem.cs @@ -393,10 +393,7 @@ namespace Server.Engines.Quests From.SendLocalizedMessage(1049018); // You have declined the Quest. } - public static bool CanOfferQuest(Mobile check, Type questType) - { - return CanOfferQuest(check, questType, out _); - } + public static bool CanOfferQuest(Mobile check, Type questType) => CanOfferQuest(check, questType, out _); public static bool CanOfferQuest(Mobile check, Type questType, out bool inRestartPeriod) { @@ -635,10 +632,7 @@ namespace Server.Engines.Quests return (r << 16) | (g << 8) | (b << 0); } - public static int C16216(int c16) - { - return c16 & 0x7FFF; - } + public static int C16216(int c16) => c16 & 0x7FFF; public static int C32216(int c32) { @@ -651,10 +645,7 @@ namespace Server.Engines.Quests return (r << 10) | (g << 5) | (b << 0); } - public static string Color(string text, int color) - { - return $"{text}"; - } + public static string Color(string text, int color) => $"{text}"; public void AddHtmlObject(int x, int y, int width, int height, object message, int color, bool back, bool scroll) { diff --git a/Projects/Scripts/Engines/Quests/Dark Tides/Conversations.cs b/Projects/Scripts/Engines/Quests/Dark Tides/Conversations.cs index f02b10fad..bb61b48dc 100644 --- a/Projects/Scripts/Engines/Quests/Dark Tides/Conversations.cs +++ b/Projects/Scripts/Engines/Quests/Dark Tides/Conversations.cs @@ -127,10 +127,7 @@ namespace Server.Engines.Quests.Necro { private bool m_FromMardoth; - public LostCallingScrollConversation(bool fromMardoth) - { - m_FromMardoth = fromMardoth; - } + public LostCallingScrollConversation(bool fromMardoth) => m_FromMardoth = fromMardoth; // Serialization public LostCallingScrollConversation() diff --git a/Projects/Scripts/Engines/Quests/Dark Tides/Items/CrystalCaveBarrier.cs b/Projects/Scripts/Engines/Quests/Dark Tides/Items/CrystalCaveBarrier.cs index f6d561fc6..19e630207 100644 --- a/Projects/Scripts/Engines/Quests/Dark Tides/Items/CrystalCaveBarrier.cs +++ b/Projects/Scripts/Engines/Quests/Dark Tides/Items/CrystalCaveBarrier.cs @@ -5,10 +5,7 @@ namespace Server.Engines.Quests.Necro public class CrystalCaveBarrier : Item { [Constructible] - public CrystalCaveBarrier() : base(0x3967) - { - Movable = false; - } + public CrystalCaveBarrier() : base(0x3967) => Movable = false; public CrystalCaveBarrier(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/Quests/Dark Tides/Items/DarkTidesHorn.cs b/Projects/Scripts/Engines/Quests/Dark Tides/Items/DarkTidesHorn.cs index f64fafdd1..2a7130464 100644 --- a/Projects/Scripts/Engines/Quests/Dark Tides/Items/DarkTidesHorn.cs +++ b/Projects/Scripts/Engines/Quests/Dark Tides/Items/DarkTidesHorn.cs @@ -15,10 +15,7 @@ namespace Server.Engines.Quests.Necro { } - public override bool ValidateUse(Mobile from) - { - return from is PlayerMobile pm && pm.Quest is DarkTidesQuest; - } + public override bool ValidateUse(Mobile from) => from is PlayerMobile pm && pm.Quest is DarkTidesQuest; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Engines/Quests/Dark Tides/Items/KronusScroll.cs b/Projects/Scripts/Engines/Quests/Dark Tides/Items/KronusScroll.cs index 1127ead5c..b0cdb7038 100644 --- a/Projects/Scripts/Engines/Quests/Dark Tides/Items/KronusScroll.cs +++ b/Projects/Scripts/Engines/Quests/Dark Tides/Items/KronusScroll.cs @@ -23,15 +23,7 @@ namespace Server.Engines.Quests.Necro public override int LabelNumber => 1060149; // Calling of Kronus - public override bool CanDrop(PlayerMobile player) - { - return !(player.Quest is DarkTidesQuest); - - /*return !( qs.IsObjectiveInProgress( typeof( FindCallingScrollObjective ) ) - || qs.IsObjectiveInProgress( typeof( FindMardothAboutKronusObjective ) ) - || qs.IsObjectiveInProgress( typeof( FindWellOfTearsObjective ) ) - || qs.IsObjectiveInProgress( typeof( UseCallingScrollObjective ) ) );*/ - } + public override bool CanDrop(PlayerMobile player) => !(player.Quest is DarkTidesQuest); public override void OnDoubleClick(Mobile from) { diff --git a/Projects/Scripts/Engines/Quests/Dark Tides/Items/ScrollOfAbraxus.cs b/Projects/Scripts/Engines/Quests/Dark Tides/Items/ScrollOfAbraxus.cs index f77e9d7ab..28ca07b7e 100644 --- a/Projects/Scripts/Engines/Quests/Dark Tides/Items/ScrollOfAbraxus.cs +++ b/Projects/Scripts/Engines/Quests/Dark Tides/Items/ScrollOfAbraxus.cs @@ -6,10 +6,7 @@ namespace Server.Engines.Quests.Necro public class ScrollOfAbraxus : QuestItem { [Constructible] - public ScrollOfAbraxus() : base(0x227B) - { - Weight = 1.0; - } + public ScrollOfAbraxus() : base(0x227B) => Weight = 1.0; public ScrollOfAbraxus(Serial serial) : base(serial) { @@ -17,12 +14,7 @@ namespace Server.Engines.Quests.Necro public override int LabelNumber => 1028827; // Scroll of Abraxus - public override bool CanDrop(PlayerMobile player) - { - return !(player.Quest is DarkTidesQuest); - - //return !( qs.IsObjectiveInProgress( typeof( RetrieveAbraxusScrollObjective ) ) || qs.IsObjectiveInProgress( typeof( ReadAbraxusScrollObjective ) ) ); - } + public override bool CanDrop(PlayerMobile player) => !(player.Quest is DarkTidesQuest); public override void OnAdded(IEntity parent) { diff --git a/Projects/Scripts/Engines/Quests/Dark Tides/Mobiles/Horus.cs b/Projects/Scripts/Engines/Quests/Dark Tides/Mobiles/Horus.cs index 3453b7957..7273ac694 100644 --- a/Projects/Scripts/Engines/Quests/Dark Tides/Mobiles/Horus.cs +++ b/Projects/Scripts/Engines/Quests/Dark Tides/Mobiles/Horus.cs @@ -44,10 +44,7 @@ namespace Server.Engines.Quests.Necro Utility.AssignRandomFacialHair(this, false); } - public override int GetAutoTalkRange(PlayerMobile m) - { - return 3; - } + public override int GetAutoTalkRange(PlayerMobile m) => 3; public override bool CanTalkTo(PlayerMobile to) { diff --git a/Projects/Scripts/Engines/Quests/Dark Tides/Mobiles/Maabus.cs b/Projects/Scripts/Engines/Quests/Dark Tides/Mobiles/Maabus.cs index 795815927..bcb71f1c4 100644 --- a/Projects/Scripts/Engines/Quests/Dark Tides/Mobiles/Maabus.cs +++ b/Projects/Scripts/Engines/Quests/Dark Tides/Mobiles/Maabus.cs @@ -19,10 +19,7 @@ namespace Server.Engines.Quests.Necro Body = 0x94; } - public override bool CanTalkTo(PlayerMobile to) - { - return false; - } + public override bool CanTalkTo(PlayerMobile to) => false; public override void OnTalk(PlayerMobile player, bool contextMenu) { diff --git a/Projects/Scripts/Engines/Quests/Dark Tides/Mobiles/Mardoth.cs b/Projects/Scripts/Engines/Quests/Dark Tides/Mobiles/Mardoth.cs index 8de629eee..7d4aedbef 100644 --- a/Projects/Scripts/Engines/Quests/Dark Tides/Mobiles/Mardoth.cs +++ b/Projects/Scripts/Engines/Quests/Dark Tides/Mobiles/Mardoth.cs @@ -80,10 +80,7 @@ namespace Server.Engines.Quests.Necro AddItem(gorget); } - public override int GetAutoTalkRange(PlayerMobile m) - { - return 3; - } + public override int GetAutoTalkRange(PlayerMobile m) => 3; public override bool CanTalkTo(PlayerMobile to) { diff --git a/Projects/Scripts/Engines/Quests/Dark Tides/Objectives.cs b/Projects/Scripts/Engines/Quests/Dark Tides/Objectives.cs index ebd492a12..4eb61cc39 100644 --- a/Projects/Scripts/Engines/Quests/Dark Tides/Objectives.cs +++ b/Projects/Scripts/Engines/Quests/Dark Tides/Objectives.cs @@ -190,15 +190,9 @@ namespace Server.Engines.Quests.Necro public override object Message => 1060119; - public override bool IgnoreYoungProtection(Mobile from) - { - return !m_SkitteringHoppersDisposed && from is SkitteringHopper; - } + public override bool IgnoreYoungProtection(Mobile from) => !m_SkitteringHoppersDisposed && from is SkitteringHopper; - public override bool GetKillEvent(BaseCreature creature, Container corpse) - { - return !m_SkitteringHoppersDisposed; - } + public override bool GetKillEvent(BaseCreature creature, Container corpse) => !m_SkitteringHoppersDisposed; public override void OnKill(BaseCreature creature, Container corpse) { @@ -307,10 +301,7 @@ namespace Server.Engines.Quests.Necro { private bool m_Victory; - public FindMardothEndObjective(bool victory) - { - m_Victory = victory; - } + public FindMardothEndObjective(bool victory) => m_Victory = victory; // Serialization public FindMardothEndObjective() diff --git a/Projects/Scripts/Engines/Quests/Emino's Undertaking/Items/EminosKatana.cs b/Projects/Scripts/Engines/Quests/Emino's Undertaking/Items/EminosKatana.cs index b89c5e14c..652f1f4e7 100644 --- a/Projects/Scripts/Engines/Quests/Emino's Undertaking/Items/EminosKatana.cs +++ b/Projects/Scripts/Engines/Quests/Emino's Undertaking/Items/EminosKatana.cs @@ -5,10 +5,7 @@ namespace Server.Engines.Quests.Ninja public class EminosKatana : QuestItem { [Constructible] - public EminosKatana() : base(0x13FF) - { - Weight = 1.0; - } + public EminosKatana() : base(0x13FF) => Weight = 1.0; public EminosKatana(Serial serial) : base(serial) { @@ -16,14 +13,7 @@ namespace Server.Engines.Quests.Ninja public override int LabelNumber => 1063214; // Daimyo Emino's Katana - public override bool CanDrop(PlayerMobile player) - { - return !(player.Quest is EminosUndertakingQuest); - - /*return !qs.IsObjectiveInProgress( typeof( ReturnSwordObjective ) ) - && !qs.IsObjectiveInProgress( typeof( SlayHenchmenObjective ) ) - && !qs.IsObjectiveInProgress( typeof( GiveEminoSwordObjective ) );*/ - } + public override bool CanDrop(PlayerMobile player) => !(player.Quest is EminosUndertakingQuest); public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Engines/Quests/Emino's Undertaking/Items/EminosKatanaChest.cs b/Projects/Scripts/Engines/Quests/Emino's Undertaking/Items/EminosKatanaChest.cs index eb7982f40..5bf575c2e 100644 --- a/Projects/Scripts/Engines/Quests/Emino's Undertaking/Items/EminosKatanaChest.cs +++ b/Projects/Scripts/Engines/Quests/Emino's Undertaking/Items/EminosKatanaChest.cs @@ -87,15 +87,9 @@ namespace Server.Engines.Quests.Ninja base.OnDoubleClick(from); } - public override bool CheckHold(Mobile m, Item item, bool message, bool checkItems, int plusItems, int plusWeight) - { - return false; - } + public override bool CheckHold(Mobile m, Item item, bool message, bool checkItems, int plusItems, int plusWeight) => false; - public override bool CheckItemUse(Mobile from, Item item) - { - return item == this; - } + public override bool CheckItemUse(Mobile from, Item item) => item == this; public override bool CheckLift(Mobile from, Item item, ref LRReason reject) { diff --git a/Projects/Scripts/Engines/Quests/Emino's Undertaking/Items/NoteForZoel.cs b/Projects/Scripts/Engines/Quests/Emino's Undertaking/Items/NoteForZoel.cs index aee939141..a1990f971 100644 --- a/Projects/Scripts/Engines/Quests/Emino's Undertaking/Items/NoteForZoel.cs +++ b/Projects/Scripts/Engines/Quests/Emino's Undertaking/Items/NoteForZoel.cs @@ -17,12 +17,7 @@ namespace Server.Engines.Quests.Ninja public override int LabelNumber => 1063186; // A Note for Zoel - public override bool CanDrop(PlayerMobile player) - { - return !(player.Quest is EminosUndertakingQuest); - - //return !qs.IsObjectiveInProgress( typeof( GiveZoelNoteObjective ) ); - } + public override bool CanDrop(PlayerMobile player) => !(player.Quest is EminosUndertakingQuest); public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Engines/Quests/Emino's Undertaking/Mobiles/Emino.cs b/Projects/Scripts/Engines/Quests/Emino's Undertaking/Mobiles/Emino.cs index a4f9aa28f..f5ee388b1 100644 --- a/Projects/Scripts/Engines/Quests/Emino's Undertaking/Mobiles/Emino.cs +++ b/Projects/Scripts/Engines/Quests/Emino's Undertaking/Mobiles/Emino.cs @@ -47,10 +47,7 @@ namespace Server.Engines.Quests.Ninja AddItem(nunchaku); } - public override int GetAutoTalkRange(PlayerMobile pm) - { - return 2; - } + public override int GetAutoTalkRange(PlayerMobile pm) => 2; public override void OnTalk(PlayerMobile player, bool contextMenu) { diff --git a/Projects/Scripts/Engines/Quests/Emino's Undertaking/Mobiles/HiddenFigure.cs b/Projects/Scripts/Engines/Quests/Emino's Undertaking/Mobiles/HiddenFigure.cs index 23448112e..7ad33b972 100644 --- a/Projects/Scripts/Engines/Quests/Emino's Undertaking/Mobiles/HiddenFigure.cs +++ b/Projects/Scripts/Engines/Quests/Emino's Undertaking/Mobiles/HiddenFigure.cs @@ -13,10 +13,7 @@ namespace Server.Engines.Quests.Ninja }; [Constructible] - public HiddenFigure() - { - Message = Utility.RandomList(Messages); - } + public HiddenFigure() => Message = Utility.RandomList(Messages); public HiddenFigure(Serial serial) : base(serial) { @@ -61,10 +58,7 @@ namespace Server.Engines.Quests.Ninja AddItem(new Sandals(GetShoeHue())); } - public override int GetAutoTalkRange(PlayerMobile pm) - { - return 3; - } + public override int GetAutoTalkRange(PlayerMobile pm) => 3; public override void OnTalk(PlayerMobile player, bool contextMenu) { diff --git a/Projects/Scripts/Engines/Quests/Emino's Undertaking/Mobiles/Zoel.cs b/Projects/Scripts/Engines/Quests/Emino's Undertaking/Mobiles/Zoel.cs index 4b89ab260..789e3b236 100644 --- a/Projects/Scripts/Engines/Quests/Emino's Undertaking/Mobiles/Zoel.cs +++ b/Projects/Scripts/Engines/Quests/Emino's Undertaking/Mobiles/Zoel.cs @@ -46,15 +46,9 @@ namespace Server.Engines.Quests.Ninja AddItem(tekagi); } - public override int GetAutoTalkRange(PlayerMobile pm) - { - return 2; - } + public override int GetAutoTalkRange(PlayerMobile pm) => 2; - public override bool CanTalkTo(PlayerMobile to) - { - return to.Quest is EminosUndertakingQuest; - } + public override bool CanTalkTo(PlayerMobile to) => to.Quest is EminosUndertakingQuest; public override void OnTalk(PlayerMobile player, bool contextMenu) { diff --git a/Projects/Scripts/Engines/Quests/Haochi's Trials/Conversations.cs b/Projects/Scripts/Engines/Quests/Haochi's Trials/Conversations.cs index e32749bb8..e85aef7e4 100644 --- a/Projects/Scripts/Engines/Quests/Haochi's Trials/Conversations.cs +++ b/Projects/Scripts/Engines/Quests/Haochi's Trials/Conversations.cs @@ -41,10 +41,7 @@ namespace Server.Engines.Quests.Samurai { private bool m_CursedSoul; - public GainKarmaConversation(bool cursedSoul) - { - m_CursedSoul = cursedSoul; - } + public GainKarmaConversation(bool cursedSoul) => m_CursedSoul = cursedSoul; public GainKarmaConversation() { @@ -82,10 +79,7 @@ namespace Server.Engines.Quests.Samurai { private bool m_CursedSoul; - public SecondTrialIntroConversation(bool cursedSoul) - { - m_CursedSoul = cursedSoul; - } + public SecondTrialIntroConversation(bool cursedSoul) => m_CursedSoul = cursedSoul; public SecondTrialIntroConversation() { @@ -143,10 +137,7 @@ namespace Server.Engines.Quests.Samurai { private bool m_Dragon; - public ThirdTrialIntroConversation(bool dragon) - { - m_Dragon = dragon; - } + public ThirdTrialIntroConversation(bool dragon) => m_Dragon = dragon; public ThirdTrialIntroConversation() { @@ -230,10 +221,7 @@ namespace Server.Engines.Quests.Samurai { private bool m_KilledCat; - public FifthTrialIntroConversation(bool killedCat) - { - m_KilledCat = killedCat; - } + public FifthTrialIntroConversation(bool killedCat) => m_KilledCat = killedCat; public FifthTrialIntroConversation() { @@ -305,10 +293,7 @@ namespace Server.Engines.Quests.Samurai { private bool m_StolenTreasure; - public SixthTrialIntroConversation(bool stolenTreasure) - { - m_StolenTreasure = stolenTreasure; - } + public SixthTrialIntroConversation(bool stolenTreasure) => m_StolenTreasure = stolenTreasure; public SixthTrialIntroConversation() { diff --git a/Projects/Scripts/Engines/Quests/Haochi's Trials/Items/HaochisKatana.cs b/Projects/Scripts/Engines/Quests/Haochi's Trials/Items/HaochisKatana.cs index a10fa87a9..d6e765dc5 100644 --- a/Projects/Scripts/Engines/Quests/Haochi's Trials/Items/HaochisKatana.cs +++ b/Projects/Scripts/Engines/Quests/Haochi's Trials/Items/HaochisKatana.cs @@ -5,10 +5,7 @@ namespace Server.Engines.Quests.Samurai public class HaochisKatana : QuestItem { [Constructible] - public HaochisKatana() : base(0x13FF) - { - Weight = 1.0; - } + public HaochisKatana() : base(0x13FF) => Weight = 1.0; public HaochisKatana(Serial serial) : base(serial) { @@ -16,12 +13,7 @@ namespace Server.Engines.Quests.Samurai public override int LabelNumber => 1063165; // Daimyo Haochi's Katana - public override bool CanDrop(PlayerMobile player) - { - return !(player.Quest is HaochisTrialsQuest); - - //return !qs.IsObjectiveInProgress( typeof( FifthTrialReturnObjective ) ); - } + public override bool CanDrop(PlayerMobile player) => !(player.Quest is HaochisTrialsQuest); public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Engines/Quests/Haochi's Trials/Items/HaochisTreasureChest.cs b/Projects/Scripts/Engines/Quests/Haochi's Trials/Items/HaochisTreasureChest.cs index 9387233cc..a913baad7 100644 --- a/Projects/Scripts/Engines/Quests/Haochi's Trials/Items/HaochisTreasureChest.cs +++ b/Projects/Scripts/Engines/Quests/Haochi's Trials/Items/HaochisTreasureChest.cs @@ -41,15 +41,9 @@ namespace Server.Engines.Quests.Samurai } } - public override bool CheckHold(Mobile m, Item item, bool message, bool checkItems, int plusItems, int plusWeight) - { - return false; - } + public override bool CheckHold(Mobile m, Item item, bool message, bool checkItems, int plusItems, int plusWeight) => false; - public override bool CheckItemUse(Mobile from, Item item) - { - return item == this; - } + public override bool CheckItemUse(Mobile from, Item item) => item == this; public override bool CheckLift(Mobile from, Item item, ref LRReason reject) { diff --git a/Projects/Scripts/Engines/Quests/Haochi's Trials/Mobiles/FierceDragon.cs b/Projects/Scripts/Engines/Quests/Haochi's Trials/Mobiles/FierceDragon.cs index afd52d4c8..c3a9f5146 100644 --- a/Projects/Scripts/Engines/Quests/Haochi's Trials/Mobiles/FierceDragon.cs +++ b/Projects/Scripts/Engines/Quests/Haochi's Trials/Mobiles/FierceDragon.cs @@ -40,30 +40,15 @@ namespace Server.Engines.Quests.Samurai public override string DefaultName => "a fierce dragon"; - public override int GetIdleSound() - { - return 0x2C4; - } + public override int GetIdleSound() => 0x2C4; - public override int GetAttackSound() - { - return 0x2C0; - } + public override int GetAttackSound() => 0x2C0; - public override int GetDeathSound() - { - return 0x2C1; - } + public override int GetDeathSound() => 0x2C1; - public override int GetAngerSound() - { - return 0x2C4; - } + public override int GetAngerSound() => 0x2C4; - public override int GetHurtSound() - { - return 0x2C3; - } + public override int GetHurtSound() => 0x2C3; public override void AggressiveAction(Mobile aggressor, bool criminal) { diff --git a/Projects/Scripts/Engines/Quests/Haochi's Trials/Mobiles/Haochi.cs b/Projects/Scripts/Engines/Quests/Haochi's Trials/Mobiles/Haochi.cs index 89000e68c..4bbcec568 100644 --- a/Projects/Scripts/Engines/Quests/Haochi's Trials/Mobiles/Haochi.cs +++ b/Projects/Scripts/Engines/Quests/Haochi's Trials/Mobiles/Haochi.cs @@ -43,10 +43,7 @@ namespace Server.Engines.Quests.Samurai AddItem(new PlateHiroSode()); } - public override int GetAutoTalkRange(PlayerMobile pm) - { - return 2; - } + public override int GetAutoTalkRange(PlayerMobile pm) => 2; public override void OnTalk(PlayerMobile player, bool contextMenu) { diff --git a/Projects/Scripts/Engines/Quests/Haochi's Trials/Mobiles/InjuredWolf.cs b/Projects/Scripts/Engines/Quests/Haochi's Trials/Mobiles/InjuredWolf.cs index 56d759417..fff48e43f 100644 --- a/Projects/Scripts/Engines/Quests/Haochi's Trials/Mobiles/InjuredWolf.cs +++ b/Projects/Scripts/Engines/Quests/Haochi's Trials/Mobiles/InjuredWolf.cs @@ -37,10 +37,7 @@ namespace Server.Engines.Quests.Samurai public override string CorpseName => "an injured wolf corpse"; public override string DefaultName => "an injured wolf"; - public override int GetIdleSound() - { - return 0xE9; - } + public override int GetIdleSound() => 0xE9; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Engines/Quests/Haochi's Trials/Objectives.cs b/Projects/Scripts/Engines/Quests/Haochi's Trials/Objectives.cs index fd6b84992..392d9a218 100644 --- a/Projects/Scripts/Engines/Quests/Haochi's Trials/Objectives.cs +++ b/Projects/Scripts/Engines/Quests/Haochi's Trials/Objectives.cs @@ -85,10 +85,7 @@ namespace Server.Engines.Quests.Samurai { private bool m_CursedSoul; - public FirstTrialReturnObjective(bool cursedSoul) - { - m_CursedSoul = cursedSoul; - } + public FirstTrialReturnObjective(bool cursedSoul) => m_CursedSoul = cursedSoul; public FirstTrialReturnObjective() { @@ -133,10 +130,7 @@ namespace Server.Engines.Quests.Samurai public class SecondTrialReturnObjective : QuestObjective { - public SecondTrialReturnObjective(bool dragon) - { - Dragon = dragon; - } + public SecondTrialReturnObjective(bool dragon) => Dragon = dragon; public SecondTrialReturnObjective() { @@ -228,10 +222,7 @@ namespace Server.Engines.Quests.Samurai public class FourthTrialReturnObjective : QuestObjective { - public FourthTrialReturnObjective(bool killedCat) - { - KilledCat = killedCat; - } + public FourthTrialReturnObjective(bool killedCat) => KilledCat = killedCat; public FourthTrialReturnObjective() { diff --git a/Projects/Scripts/Engines/Quests/Solen Matriarch/Conversations.cs b/Projects/Scripts/Engines/Quests/Solen Matriarch/Conversations.cs index 19939630d..0d30ad32b 100644 --- a/Projects/Scripts/Engines/Quests/Solen Matriarch/Conversations.cs +++ b/Projects/Scripts/Engines/Quests/Solen Matriarch/Conversations.cs @@ -4,10 +4,7 @@ namespace Server.Engines.Quests.Matriarch { private bool m_Friend; - public DontOfferConversation(bool friend) - { - m_Friend = friend; - } + public DontOfferConversation(bool friend) => m_Friend = friend; public DontOfferConversation() { @@ -86,10 +83,7 @@ namespace Server.Engines.Quests.Matriarch { private bool m_Friend; - public ProcessFungiConversation(bool friend) - { - m_Friend = friend; - } + public ProcessFungiConversation(bool friend) => m_Friend = friend; public ProcessFungiConversation() { @@ -150,15 +144,9 @@ namespace Server.Engines.Quests.Matriarch { private bool m_Logged; - public FullBackpackConversation(bool logged) - { - m_Logged = logged; - } + public FullBackpackConversation(bool logged) => m_Logged = logged; - public FullBackpackConversation() - { - m_Logged = true; - } + public FullBackpackConversation() => m_Logged = true; public override object Message => 1054102; diff --git a/Projects/Scripts/Engines/Quests/Solen Matriarch/Mobiles/SolenMatriarch.cs b/Projects/Scripts/Engines/Quests/Solen Matriarch/Mobiles/SolenMatriarch.cs index b12ea4516..ccf17da08 100644 --- a/Projects/Scripts/Engines/Quests/Solen Matriarch/Mobiles/SolenMatriarch.cs +++ b/Projects/Scripts/Engines/Quests/Solen Matriarch/Mobiles/SolenMatriarch.cs @@ -27,10 +27,7 @@ namespace Server.Engines.Quests.Matriarch public override string DefaultName => "the solen matriarch"; public override bool DisallowAllMoves => false; - public override int GetIdleSound() - { - return 0x10D; - } + public override int GetIdleSound() => 0x10D; public override bool CanTalkTo(PlayerMobile to) { diff --git a/Projects/Scripts/Engines/Quests/Solen Matriarch/SolenMatriarchQuest.cs b/Projects/Scripts/Engines/Quests/Solen Matriarch/SolenMatriarchQuest.cs index b7f11e18a..a7f516ce3 100644 --- a/Projects/Scripts/Engines/Quests/Solen Matriarch/SolenMatriarchQuest.cs +++ b/Projects/Scripts/Engines/Quests/Solen Matriarch/SolenMatriarchQuest.cs @@ -25,10 +25,7 @@ namespace Server.Engines.Quests.Matriarch typeof(GetRewardObjective) }; - public SolenMatriarchQuest(PlayerMobile from, bool redSolen) : base(from) - { - RedSolen = redSolen; - } + public SolenMatriarchQuest(PlayerMobile from, bool redSolen) : base(from) => RedSolen = redSolen; // Serialization public SolenMatriarchQuest() diff --git a/Projects/Scripts/Engines/Quests/Study of the Solen Hive/Objectives.cs b/Projects/Scripts/Engines/Quests/Study of the Solen Hive/Objectives.cs index 21b4a56d2..e4b1cde74 100644 --- a/Projects/Scripts/Engines/Quests/Study of the Solen Hive/Objectives.cs +++ b/Projects/Scripts/Engines/Quests/Study of the Solen Hive/Objectives.cs @@ -18,10 +18,7 @@ namespace Server.Engines.Quests.Naturalist public bool StudiedSpecialNest{ get; private set; } - public override bool GetTimerEvent() - { - return true; - } + public override bool GetTimerEvent() => true; public override void CheckProgress() { diff --git a/Projects/Scripts/Engines/Quests/Study of the Solen Hive/StudyOfSolenQuest.cs b/Projects/Scripts/Engines/Quests/Study of the Solen Hive/StudyOfSolenQuest.cs index aa05412da..dacbca396 100644 --- a/Projects/Scripts/Engines/Quests/Study of the Solen Hive/StudyOfSolenQuest.cs +++ b/Projects/Scripts/Engines/Quests/Study of the Solen Hive/StudyOfSolenQuest.cs @@ -17,10 +17,7 @@ namespace Server.Engines.Quests.Naturalist typeof(FullBackpackConversation) }; - public StudyOfSolenQuest(PlayerMobile from, Naturalist naturalist) : base(from) - { - Naturalist = naturalist; - } + public StudyOfSolenQuest(PlayerMobile from, Naturalist naturalist) : base(from) => Naturalist = naturalist; // Serialization public StudyOfSolenQuest() diff --git a/Projects/Scripts/Engines/Quests/Terrible Hatchlings/Objectives.cs b/Projects/Scripts/Engines/Quests/Terrible Hatchlings/Objectives.cs index 6ea5f6ad8..e4ffa64e8 100644 --- a/Projects/Scripts/Engines/Quests/Terrible Hatchlings/Objectives.cs +++ b/Projects/Scripts/Engines/Quests/Terrible Hatchlings/Objectives.cs @@ -78,10 +78,7 @@ namespace Server.Engines.Quests.Zento public class ThirdKillObjective : QuestObjective { - public ThirdKillObjective(int startingProgress) - { - CurProgress = startingProgress; - } + public ThirdKillObjective(int startingProgress) => CurProgress = startingProgress; public ThirdKillObjective() { diff --git a/Projects/Scripts/Engines/Quests/The Summoning/Items/ChylothStaff.cs b/Projects/Scripts/Engines/Quests/The Summoning/Items/ChylothStaff.cs index 2da921c56..784ad7fde 100644 --- a/Projects/Scripts/Engines/Quests/The Summoning/Items/ChylothStaff.cs +++ b/Projects/Scripts/Engines/Quests/The Summoning/Items/ChylothStaff.cs @@ -5,10 +5,7 @@ namespace Server.Engines.Quests.Doom public class ChylothStaff : BlackStaff { [Constructible] - public ChylothStaff() - { - Hue = 0x482; - } + public ChylothStaff() => Hue = 0x482; public ChylothStaff(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/Quests/The Summoning/Mobiles/Chyloth.cs b/Projects/Scripts/Engines/Quests/The Summoning/Mobiles/Chyloth.cs index ccd8d1598..0ed2a5218 100644 --- a/Projects/Scripts/Engines/Quests/The Summoning/Mobiles/Chyloth.cs +++ b/Projects/Scripts/Engines/Quests/The Summoning/Mobiles/Chyloth.cs @@ -203,10 +203,7 @@ namespace Server.Engines.Quests.Doom return base.OnDragDrop(from, dropped); } - public override bool CanTalkTo(PlayerMobile to) - { - return false; - } + public override bool CanTalkTo(PlayerMobile to) => false; public override void OnTalk(PlayerMobile player, bool contextMenu) { diff --git a/Projects/Scripts/Engines/Quests/The Summoning/Mobiles/Victoria.cs b/Projects/Scripts/Engines/Quests/The Summoning/Mobiles/Victoria.cs index 3eed0c1f7..0516bd16d 100644 --- a/Projects/Scripts/Engines/Quests/The Summoning/Mobiles/Victoria.cs +++ b/Projects/Scripts/Engines/Quests/The Summoning/Mobiles/Victoria.cs @@ -113,10 +113,7 @@ namespace Server.Engines.Quests.Doom return base.OnDragDrop(from, dropped); } - public override bool CanTalkTo(PlayerMobile to) - { - return to.Quest == null && QuestSystem.CanOfferQuest(to, typeof(TheSummoningQuest)); - } + public override bool CanTalkTo(PlayerMobile to) => to.Quest == null && QuestSystem.CanOfferQuest(to, typeof(TheSummoningQuest)); public override void OnTalk(PlayerMobile player, bool contextMenu) { diff --git a/Projects/Scripts/Engines/Quests/The Summoning/Objectives.cs b/Projects/Scripts/Engines/Quests/The Summoning/Objectives.cs index 8e646a569..f67562ef0 100644 --- a/Projects/Scripts/Engines/Quests/The Summoning/Objectives.cs +++ b/Projects/Scripts/Engines/Quests/The Summoning/Objectives.cs @@ -72,10 +72,7 @@ namespace Server.Engines.Quests.Doom { private BoneDemon m_Daemon; - public VanquishDaemonObjective(BoneDemon daemon) - { - m_Daemon = daemon; - } + public VanquishDaemonObjective(BoneDemon daemon) => m_Daemon = daemon; // Serialization public VanquishDaemonObjective() diff --git a/Projects/Scripts/Engines/Quests/The Summoning/TheSummoningQuest.cs b/Projects/Scripts/Engines/Quests/The Summoning/TheSummoningQuest.cs index c41924f7d..59b3fc75e 100644 --- a/Projects/Scripts/Engines/Quests/The Summoning/TheSummoningQuest.cs +++ b/Projects/Scripts/Engines/Quests/The Summoning/TheSummoningQuest.cs @@ -14,10 +14,7 @@ namespace Server.Engines.Quests.Doom typeof(VanquishDaemonObjective) }; - public TheSummoningQuest(Victoria victoria, PlayerMobile from) : base(from) - { - Victoria = victoria; - } + public TheSummoningQuest(Victoria victoria, PlayerMobile from) : base(from) => Victoria = victoria; public TheSummoningQuest() { diff --git a/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Conversations.cs b/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Conversations.cs index c4c3a0ed4..1ed974af4 100644 --- a/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Conversations.cs +++ b/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Conversations.cs @@ -346,10 +346,7 @@ namespace Server.Engines.Quests.Haven { private bool m_FromUzeraan; - public LostScrollOfPowerConversation(bool fromUzeraan) - { - m_FromUzeraan = fromUzeraan; - } + public LostScrollOfPowerConversation(bool fromUzeraan) => m_FromUzeraan = fromUzeraan; public LostScrollOfPowerConversation() { @@ -395,10 +392,7 @@ namespace Server.Engines.Quests.Haven { private bool m_FromUzeraan; - public LostFertileDirtConversation(bool fromUzeraan) - { - m_FromUzeraan = fromUzeraan; - } + public LostFertileDirtConversation(bool fromUzeraan) => m_FromUzeraan = fromUzeraan; public LostFertileDirtConversation() { diff --git a/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Items/DaemonBloodChest.cs b/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Items/DaemonBloodChest.cs index e098cee9a..fdc755091 100644 --- a/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Items/DaemonBloodChest.cs +++ b/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Items/DaemonBloodChest.cs @@ -6,10 +6,7 @@ namespace Server.Engines.Quests.Haven public class DaemonBloodChest : MetalChest { [Constructible] - public DaemonBloodChest() - { - Movable = false; - } + public DaemonBloodChest() => Movable = false; public DaemonBloodChest(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Items/QuestDaemonBlood.cs b/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Items/QuestDaemonBlood.cs index f30b1f1e4..a66c488de 100644 --- a/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Items/QuestDaemonBlood.cs +++ b/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Items/QuestDaemonBlood.cs @@ -5,21 +5,13 @@ namespace Server.Engines.Quests.Haven public class QuestDaemonBlood : QuestItem { [Constructible] - public QuestDaemonBlood() : base(0xF7D) - { - Weight = 1.0; - } + public QuestDaemonBlood() : base(0xF7D) => Weight = 1.0; public QuestDaemonBlood(Serial serial) : base(serial) { } - public override bool CanDrop(PlayerMobile player) - { - return !(player.Quest is UzeraanTurmoilQuest); - - /*return !qs.IsObjectiveInProgress( typeof( ReturnDaemonBloodObjective ) );*/ - } + public override bool CanDrop(PlayerMobile player) => !(player.Quest is UzeraanTurmoilQuest); public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Items/QuestDaemonBone.cs b/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Items/QuestDaemonBone.cs index 82090d543..cd32b886d 100644 --- a/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Items/QuestDaemonBone.cs +++ b/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Items/QuestDaemonBone.cs @@ -5,21 +5,13 @@ namespace Server.Engines.Quests.Haven public class QuestDaemonBone : QuestItem { [Constructible] - public QuestDaemonBone() : base(0xF80) - { - Weight = 1.0; - } + public QuestDaemonBone() : base(0xF80) => Weight = 1.0; public QuestDaemonBone(Serial serial) : base(serial) { } - public override bool CanDrop(PlayerMobile player) - { - return !(player.Quest is UzeraanTurmoilQuest); - - //return !qs.IsObjectiveInProgress( typeof( ReturnDaemonBoneObjective ) ); - } + public override bool CanDrop(PlayerMobile player) => !(player.Quest is UzeraanTurmoilQuest); public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Items/QuestFertileDirt.cs b/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Items/QuestFertileDirt.cs index 990bcd6a3..20ac3407f 100644 --- a/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Items/QuestFertileDirt.cs +++ b/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Items/QuestFertileDirt.cs @@ -5,21 +5,13 @@ namespace Server.Engines.Quests.Haven public class QuestFertileDirt : QuestItem { [Constructible] - public QuestFertileDirt() : base(0xF81) - { - Weight = 1.0; - } + public QuestFertileDirt() : base(0xF81) => Weight = 1.0; public QuestFertileDirt(Serial serial) : base(serial) { } - public override bool CanDrop(PlayerMobile player) - { - return !(player.Quest is UzeraanTurmoilQuest); - - //return !qs.IsObjectiveInProgress( typeof( ReturnFertileDirtObjective ) ); - } + public override bool CanDrop(PlayerMobile player) => !(player.Quest is UzeraanTurmoilQuest); public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Items/SchmendrickScrollOfPower.cs b/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Items/SchmendrickScrollOfPower.cs index ac3eb1a65..84d8c7764 100644 --- a/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Items/SchmendrickScrollOfPower.cs +++ b/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Items/SchmendrickScrollOfPower.cs @@ -16,11 +16,9 @@ namespace Server.Engines.Quests.Haven public override int LabelNumber => 1049118; // a scroll with ancient markings - public override bool CanDrop(PlayerMobile player) - { - return !(player.Quest is UzeraanTurmoilQuest qs && - qs.IsObjectiveInProgress(typeof(ReturnScrollOfPowerObjective))); - } + public override bool CanDrop(PlayerMobile player) => + !(player.Quest is UzeraanTurmoilQuest qs && + qs.IsObjectiveInProgress(typeof(ReturnScrollOfPowerObjective))); public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Items/UzeraanTurmoilHorn.cs b/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Items/UzeraanTurmoilHorn.cs index 9ae9687eb..8484b6721 100644 --- a/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Items/UzeraanTurmoilHorn.cs +++ b/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Items/UzeraanTurmoilHorn.cs @@ -15,10 +15,7 @@ namespace Server.Engines.Quests.Haven { } - public override bool ValidateUse(Mobile from) - { - return from is PlayerMobile pm && pm.Quest is UzeraanTurmoilQuest; - } + public override bool ValidateUse(Mobile from) => from is PlayerMobile pm && pm.Quest is UzeraanTurmoilQuest; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Mobiles/Dryad.cs b/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Mobiles/Dryad.cs index ca65e6ada..aa4e91752 100644 --- a/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Mobiles/Dryad.cs +++ b/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Mobiles/Dryad.cs @@ -56,15 +56,9 @@ namespace Server.Engines.Quests.Haven m_SBInfos.Add(new SBDryad()); } - public override int GetAutoTalkRange(PlayerMobile pm) - { - return 4; - } + public override int GetAutoTalkRange(PlayerMobile pm) => 4; - public override bool CanTalkTo(PlayerMobile to) - { - return to.Quest is UzeraanTurmoilQuest qs && qs.FindObjective() != null; - } + public override bool CanTalkTo(PlayerMobile to) => to.Quest is UzeraanTurmoilQuest qs && qs.FindObjective() != null; public override void OnTalk(PlayerMobile player, bool contextMenu) { diff --git a/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Mobiles/MansionGuard.cs b/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Mobiles/MansionGuard.cs index da6b8951d..e90be9edb 100644 --- a/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Mobiles/MansionGuard.cs +++ b/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Mobiles/MansionGuard.cs @@ -40,15 +40,9 @@ namespace Server.Engines.Quests.Haven AddItem(weapon); } - public override int GetAutoTalkRange(PlayerMobile pm) - { - return 3; - } + public override int GetAutoTalkRange(PlayerMobile pm) => 3; - public override bool CanTalkTo(PlayerMobile to) - { - return to.Quest == null && QuestSystem.CanOfferQuest(to, typeof(UzeraanTurmoilQuest)); - } + public override bool CanTalkTo(PlayerMobile to) => to.Quest == null && QuestSystem.CanOfferQuest(to, typeof(UzeraanTurmoilQuest)); public override void OnTalk(PlayerMobile player, bool contextMenu) { diff --git a/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Mobiles/MilitiaCanoneer.cs b/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Mobiles/MilitiaCanoneer.cs index 5f06d86e3..77fef16a7 100644 --- a/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Mobiles/MilitiaCanoneer.cs +++ b/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Mobiles/MilitiaCanoneer.cs @@ -6,10 +6,7 @@ namespace Server.Engines.Quests.Haven public class MilitiaCanoneer : BaseQuester { [Constructible] - public MilitiaCanoneer() : base("the Militia Canoneer") - { - Active = true; - } + public MilitiaCanoneer() : base("the Militia Canoneer") => Active = true; public MilitiaCanoneer(Serial serial) : base(serial) { @@ -45,10 +42,7 @@ namespace Server.Engines.Quests.Haven torch.Ignite(); } - public override bool CanTalkTo(PlayerMobile to) - { - return false; - } + public override bool CanTalkTo(PlayerMobile to) => false; public override void OnTalk(PlayerMobile player, bool contextMenu) { diff --git a/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Mobiles/Schmendrick.cs b/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Mobiles/Schmendrick.cs index 27081888f..d1873495f 100644 --- a/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Mobiles/Schmendrick.cs +++ b/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Mobiles/Schmendrick.cs @@ -48,15 +48,9 @@ namespace Server.Engines.Quests.Haven AddItem(pack); } - public override int GetAutoTalkRange(PlayerMobile pm) - { - return 7; - } + public override int GetAutoTalkRange(PlayerMobile pm) => 7; - public override bool CanTalkTo(PlayerMobile to) - { - return to.Quest is UzeraanTurmoilQuest qs && qs.FindObjective() != null; - } + public override bool CanTalkTo(PlayerMobile to) => to.Quest is UzeraanTurmoilQuest qs && qs.FindObjective() != null; public override void OnTalk(PlayerMobile player, bool contextMenu) { diff --git a/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Mobiles/Uzeraan.cs b/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Mobiles/Uzeraan.cs index cd5a098ba..cfc84fee1 100644 --- a/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Mobiles/Uzeraan.cs +++ b/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Mobiles/Uzeraan.cs @@ -44,15 +44,9 @@ namespace Server.Engines.Quests.Haven AddItem(staff); } - public override int GetAutoTalkRange(PlayerMobile pm) - { - return 3; - } + public override int GetAutoTalkRange(PlayerMobile pm) => 3; - public override bool CanTalkTo(PlayerMobile to) - { - return to.Quest is UzeraanTurmoilQuest; - } + public override bool CanTalkTo(PlayerMobile to) => to.Quest is UzeraanTurmoilQuest; public override void OnTalk(PlayerMobile player, bool contextMenu) { diff --git a/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Objectives.cs b/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Objectives.cs index 09aef695b..a5e4016a0 100644 --- a/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Objectives.cs +++ b/Projects/Scripts/Engines/Quests/Uzeraan Turmoil/Objectives.cs @@ -21,10 +21,7 @@ namespace Server.Engines.Quests.Haven { private int m_OldTithingPoints; - public TitheGoldObjective() - { - m_OldTithingPoints = -1; - } + public TitheGoldObjective() => m_OldTithingPoints = -1; public override object Message => 1060386; @@ -71,10 +68,7 @@ namespace Server.Engines.Quests.Haven { } - public KillHordeMinionsObjective(KillHordeMinionsStep step) - { - Step = step; - } + public KillHordeMinionsObjective(KillHordeMinionsStep step) => Step = step; public KillHordeMinionsStep Step{ get; private set; } diff --git a/Projects/Scripts/Engines/Quests/Witch Apprentice/Conversations.cs b/Projects/Scripts/Engines/Quests/Witch Apprentice/Conversations.cs index 31b8a9dba..f84bcffa1 100644 --- a/Projects/Scripts/Engines/Quests/Witch Apprentice/Conversations.cs +++ b/Projects/Scripts/Engines/Quests/Witch Apprentice/Conversations.cs @@ -55,10 +55,7 @@ namespace Server.Engines.Quests.Hag { private Point3D m_ImpLocation; - public ImpDeathConversation(Point3D impLocation) - { - m_ImpLocation = impLocation; - } + public ImpDeathConversation(Point3D impLocation) => m_ImpLocation = impLocation; public ImpDeathConversation() { @@ -213,10 +210,7 @@ namespace Server.Engines.Quests.Hag { private bool m_FirstMet; - public BlackheartPirateConversation(bool firstMet) - { - m_FirstMet = firstMet; - } + public BlackheartPirateConversation(bool firstMet) => m_FirstMet = firstMet; public BlackheartPirateConversation() { diff --git a/Projects/Scripts/Engines/Quests/Witch Apprentice/Items/Cauldron.cs b/Projects/Scripts/Engines/Quests/Witch Apprentice/Items/Cauldron.cs index dd62cc1b4..cc45ed63a 100644 --- a/Projects/Scripts/Engines/Quests/Witch Apprentice/Items/Cauldron.cs +++ b/Projects/Scripts/Engines/Quests/Witch Apprentice/Items/Cauldron.cs @@ -3,10 +3,7 @@ namespace Server.Items public class Cauldron : Item { [Constructible] - public Cauldron() : base(0x9ED) - { - Weight = 1.0; - } + public Cauldron() : base(0x9ED) => Weight = 1.0; public Cauldron(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/Quests/Witch Apprentice/Items/HagApprenticeCorpse.cs b/Projects/Scripts/Engines/Quests/Witch Apprentice/Items/HagApprenticeCorpse.cs index b45f08259..66e7fba84 100644 --- a/Projects/Scripts/Engines/Quests/Witch Apprentice/Items/HagApprenticeCorpse.cs +++ b/Projects/Scripts/Engines/Quests/Witch Apprentice/Items/HagApprenticeCorpse.cs @@ -35,10 +35,7 @@ namespace Server.Engines.Quests.Hag return apprentice; } - private static List GetEquipment() - { - return new List(); - } + private static List GetEquipment() => new List(); public override void AddNameProperty(ObjectPropertyList list) { diff --git a/Projects/Scripts/Engines/Quests/Witch Apprentice/Items/MagicFlute.cs b/Projects/Scripts/Engines/Quests/Witch Apprentice/Items/MagicFlute.cs index 86034c4d5..e90069e56 100644 --- a/Projects/Scripts/Engines/Quests/Witch Apprentice/Items/MagicFlute.cs +++ b/Projects/Scripts/Engines/Quests/Witch Apprentice/Items/MagicFlute.cs @@ -5,10 +5,7 @@ namespace Server.Engines.Quests.Hag public class MagicFlute : Item { [Constructible] - public MagicFlute() : base(0x1421) - { - Hue = 0x8AB; - } + public MagicFlute() : base(0x1421) => Hue = 0x8AB; public MagicFlute(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/Quests/Witch Apprentice/Items/MoonfireBrew.cs b/Projects/Scripts/Engines/Quests/Witch Apprentice/Items/MoonfireBrew.cs index 6f95e11c1..73d47886b 100644 --- a/Projects/Scripts/Engines/Quests/Witch Apprentice/Items/MoonfireBrew.cs +++ b/Projects/Scripts/Engines/Quests/Witch Apprentice/Items/MoonfireBrew.cs @@ -3,10 +3,7 @@ namespace Server.Engines.Quests.Hag public class MoonfireBrew : Item { [Constructible] - public MoonfireBrew() : base(0xF04) - { - Weight = 1.0; - } + public MoonfireBrew() : base(0xF04) => Weight = 1.0; public MoonfireBrew(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/Quests/Witch Apprentice/Mobiles/Zeefzorpul.cs b/Projects/Scripts/Engines/Quests/Witch Apprentice/Mobiles/Zeefzorpul.cs index 56596dca7..c41adcb27 100644 --- a/Projects/Scripts/Engines/Quests/Witch Apprentice/Mobiles/Zeefzorpul.cs +++ b/Projects/Scripts/Engines/Quests/Witch Apprentice/Mobiles/Zeefzorpul.cs @@ -19,10 +19,7 @@ namespace Server.Engines.Quests.Hag Body = 0x4A; } - public override bool CanTalkTo(PlayerMobile to) - { - return false; - } + public override bool CanTalkTo(PlayerMobile to) => false; public override void OnTalk(PlayerMobile player, bool contextMenu) { diff --git a/Projects/Scripts/Engines/Quests/Witch Apprentice/Objectives.cs b/Projects/Scripts/Engines/Quests/Witch Apprentice/Objectives.cs index 8bea12987..b3456553c 100644 --- a/Projects/Scripts/Engines/Quests/Witch Apprentice/Objectives.cs +++ b/Projects/Scripts/Engines/Quests/Witch Apprentice/Objectives.cs @@ -189,10 +189,7 @@ namespace Server.Engines.Quests.Hag public class FindZeefzorpulObjective : QuestObjective { - public FindZeefzorpulObjective(Point3D impLocation) - { - ImpLocation = impLocation; - } + public FindZeefzorpulObjective(Point3D impLocation) => ImpLocation = impLocation; public FindZeefzorpulObjective() { diff --git a/Projects/Scripts/Engines/RemoteAdmin/Network.cs b/Projects/Scripts/Engines/RemoteAdmin/Network.cs deleted file mode 100644 index 09e9cd300..000000000 --- a/Projects/Scripts/Engines/RemoteAdmin/Network.cs +++ /dev/null @@ -1,279 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Server.Accounting; -using Server.Items; -using Server.Misc; -using Server.Network; - -namespace Server.RemoteAdmin -{ - public class AdminNetwork - { - private const string ProtocolVersion = "2"; - - private const string DateFormat = "MMMM dd hh:mm:ss.f tt"; - - private static List m_Auth = new List(); - private static bool m_NewLine = true; - private static StringBuilder m_ConsoleData = new StringBuilder(); - - public static void Configure() - { - PacketHandlers.Register(0xF1, 0, false, OnReceive); - Core.MultiConsoleOut.Add(new EventTextWriter(OnConsoleChar, OnConsoleLine, OnConsoleString)); - Timer.DelayCall(TimeSpan.FromMinutes(2.5), TimeSpan.FromMinutes(2.5), CleanUp); - } - - public static void OnConsoleString(string str) - { - string outStr; - if (m_NewLine) - { - outStr = $"[{DateTime.UtcNow.ToString(DateFormat)}]: {str}"; - m_NewLine = false; - } - else - { - outStr = str; - } - - m_ConsoleData.Append(outStr); - RoughTrimConsoleData(); - - SendToAll(outStr); - } - - public static void OnConsoleChar(char ch) - { - if (m_NewLine) - { - string outStr; - outStr = $"[{DateTime.UtcNow.ToString(DateFormat)}]: {ch}"; - - m_ConsoleData.Append(outStr); - SendToAll(outStr); - - m_NewLine = false; - } - else - { - m_ConsoleData.Append(ch); - SendToAll(ch); - } - - RoughTrimConsoleData(); - } - - public static void OnConsoleLine(string line) - { - string outStr; - if (m_NewLine) - outStr = $"[{DateTime.UtcNow.ToString(DateFormat)}]: {line}{Console.Out.NewLine}"; - else - outStr = $"{line}{Console.Out.NewLine}"; - - m_ConsoleData.Append(outStr); - RoughTrimConsoleData(); - - SendToAll(outStr); - - m_NewLine = true; - } - - private static void SendToAll(string outStr) - { - SendToAll(new ConsoleData(outStr)); - } - - private static void SendToAll(char ch) - { - SendToAll(new ConsoleData(ch)); - } - - private static void SendToAll(ConsoleData packet) - { - packet.Acquire(); - for (int i = 0; i < m_Auth.Count; i++) - m_Auth[i].Send(packet); - packet.Release(); - } - - private static void RoughTrimConsoleData() - { - if (m_ConsoleData.Length >= 4096) - m_ConsoleData.Remove(0, 2048); - } - - private static void TightTrimConsoleData() - { - if (m_ConsoleData.Length > 1024) - m_ConsoleData.Remove(0, m_ConsoleData.Length - 1024); - } - - public static void OnReceive(NetState state, PacketReader pvSrc) - { - byte cmd = pvSrc.ReadByte(); - if (cmd == 0x02) - { - Authenticate(state, pvSrc); - } - else if (cmd == 0xFE) - { - state.Send(new CompactServerInfo()); - state.Dispose(); - } - else if (cmd == 0xFF) - { - string statStr = - $", Name={ServerList.ServerName}, Age={(int)(DateTime.UtcNow - Clock.ServerStart).TotalHours}, Clients={NetState.Instances.Count}, Items={World.Items.Count}, Chars={World.Mobiles.Count}, Mem={(int)(GC.GetTotalMemory(false) / 1024)}K, Ver={ProtocolVersion}"; - state.Send(new UOGInfo(statStr)); - state.Dispose(); - } - else if (!IsAuth(state)) - { - Console.WriteLine("ADMIN: Unauthorized packet from {0}, disconnecting", state); - Disconnect(state); - } - else - { - if (!RemoteAdminHandlers.Handle(cmd, state, pvSrc)) - Disconnect(state); - } - } - - private static void DelayedDisconnect(NetState ns) - { - Timer.DelayCall(TimeSpan.FromSeconds(15.0), () => Disconnect(ns)); - } - - private static void Disconnect(NetState ns) - { - m_Auth.Remove(ns); - ns.Dispose(); - } - - public static void Authenticate(NetState state, PacketReader pvSrc) - { - string user = pvSrc.ReadString(30); - string pw = pvSrc.ReadString(30); - - if (!(Accounts.GetAccount(user) is Account a)) - { - state.Send(new Login(LoginResponse.NoUser)); - Console.WriteLine("ADMIN: Invalid username '{0}' from {1}", user, state); - DelayedDisconnect(state); - } - else if (!a.HasAccess(state)) - { - state.Send(new Login(LoginResponse.BadIP)); - Console.WriteLine("ADMIN: Access to '{0}' from {1} denied.", user, state); - DelayedDisconnect(state); - } - else if (!a.CheckPassword(pw)) - { - state.Send(new Login(LoginResponse.BadPass)); - Console.WriteLine("ADMIN: Invalid password for user '{0}' from {1}", user, state); - DelayedDisconnect(state); - } - else if (a.AccessLevel < AccessLevel.Administrator || a.Banned) - { - Console.WriteLine("ADMIN: Account '{0}' does not have admin access. Connection Denied.", user); - state.Send(new Login(LoginResponse.NoAccess)); - DelayedDisconnect(state); - } - else - { - Console.WriteLine("ADMIN: Access granted to '{0}' from {1}", user, state); - state.Account = a; - a.LogAccess(state); - a.LastLogin = DateTime.UtcNow; - - state.Send(new Login(LoginResponse.OK)); - TightTrimConsoleData(); - state.Send(Compress(new ConsoleData(m_ConsoleData.ToString()))); - m_Auth.Add(state); - } - } - - public static bool IsAuth(NetState state) - { - return m_Auth.Contains(state); - } - - private static void CleanUp() - { - //remove dead instances from m_Auth - List list = new List(); - for (int i = 0; i < m_Auth.Count; i++) - { - NetState ns = m_Auth[i]; - if (ns.Running) - list.Add(ns); - } - - m_Auth = list; - } - - public static Packet Compress(Packet p) - { - byte[] source = p.Compile(false, out int length); - - if (length > 100 && length < 60000) - { - byte[] dest = new byte[(int)(length * 1.001) + 10]; - int destSize = dest.Length; - - ZLibError error = Compression.Pack(dest, ref destSize, source, length, ZLibQuality.Default); - - if (error != ZLibError.Okay) - { - Console.WriteLine("WARNING: Unable to compress admin packet, zlib error: {0}", error); - return p; - } - - return new AdminCompressedPacket(dest, destSize, length); - } - - return p; - } - } - - public class EventTextWriter : TextWriter - { - public delegate void OnConsoleChar(char ch); - - public delegate void OnConsoleLine(string line); - - public delegate void OnConsoleStr(string str); - - private OnConsoleChar m_OnChar; - private OnConsoleLine m_OnLine; - private OnConsoleStr m_OnStr; - - public EventTextWriter(OnConsoleChar onChar, OnConsoleLine onLine, OnConsoleStr onStr) - { - m_OnChar = onChar; - m_OnLine = onLine; - m_OnStr = onStr; - } - - public override Encoding Encoding => Encoding.ASCII; - - public override void Write(char ch) - { - m_OnChar?.Invoke(ch); - } - - public override void Write(string str) - { - m_OnStr?.Invoke(str); - } - - public override void WriteLine(string line) - { - m_OnLine?.Invoke(line); - } - } -} diff --git a/Projects/Scripts/Engines/RemoteAdmin/PacketHandlers.cs b/Projects/Scripts/Engines/RemoteAdmin/PacketHandlers.cs deleted file mode 100644 index 45242a2cd..000000000 --- a/Projects/Scripts/Engines/RemoteAdmin/PacketHandlers.cs +++ /dev/null @@ -1,254 +0,0 @@ -using System; -using System.Collections.Generic; -using Server.Accounting; -using Server.Network; - -namespace Server.RemoteAdmin -{ - public class RemoteAdminHandlers - { - public enum AcctSearchType : byte - { - Username = 0, - IP = 1 - } - - private static OnPacketReceive[] m_Handlers = new OnPacketReceive[256]; - - static RemoteAdminHandlers() - { - //0x02 = login request, handled by AdminNetwork - Register(0x04, ServerInfoRequest); - Register(0x05, AccountSearch); - Register(0x06, RemoveAccount); - Register(0x07, UpdateAccount); - } - - public static void Register(byte command, OnPacketReceive handler) - { - m_Handlers[command] = handler; - } - - public static bool Handle(byte command, NetState state, PacketReader pvSrc) - { - if (m_Handlers[command] == null) - { - Console.WriteLine("ADMIN: Invalid packet 0x{0:X2} from {1}, disconnecting", command, state); - return false; - } - - m_Handlers[command](state, pvSrc); - return true; - } - - private static void ServerInfoRequest(NetState state, PacketReader pvSrc) - { - state.Send(AdminNetwork.Compress(new ServerInfo())); - } - - private static void AccountSearch(NetState state, PacketReader pvSrc) - { - AcctSearchType type = (AcctSearchType)pvSrc.ReadByte(); - string term = pvSrc.ReadString(); - - if (type == AcctSearchType.IP && !Utility.IsValidIP(term)) - { - state.Send(new MessageBoxMessage("Invalid search term.\nThe IP sent was not valid.", "Invalid IP")); - return; - } - - term = term.ToUpper(); - - List list = new List(); - - foreach (Account a in Accounts.GetAccounts()) - { - if (!CanAccessAccount(state.Account, a)) continue; - - switch (type) - { - case AcctSearchType.Username: - { - if (a.Username.ToUpper().IndexOf(term) != -1) - list.Add(a); - break; - } - case AcctSearchType.IP: - { - for (int i = 0; i < a.LoginIPs.Length; i++) - if (Utility.IPMatch(term, a.LoginIPs[i])) - { - list.Add(a); - break; - } - - break; - } - } - } - - if (list.Count > 0) - { - if (list.Count <= 25) - state.Send(AdminNetwork.Compress(new AccountSearchResults(list))); - else - state.Send(new MessageBoxMessage( - "There were more than 25 matches to your search.\nNarrow the search parameters and try again.", - "Too Many Results")); - } - else - { - state.Send(new MessageBoxMessage("There were no results to your search.\nPlease try again.", "No Matches")); - } - } - - private static bool CanAccessAccount(IAccount beholder, IAccount beheld) - { - return beholder.AccessLevel == AccessLevel.Owner || - beheld.AccessLevel < - beholder.AccessLevel; // Cannot see accounts of equal or greater access level unless Owner - } - - private static void RemoveAccount(NetState state, PacketReader pvSrc) - { - if (state.Account.AccessLevel < AccessLevel.Administrator) - { - state.Send(new MessageBoxMessage("You do not have permission to delete accounts.", - "Account Access Exception")); - return; - } - - IAccount a = Accounts.GetAccount(pvSrc.ReadString()); - - if (a == null) - { - state.Send(new MessageBoxMessage("The account could not be found (and thus was not deleted).", - "Account Not Found")); - } - else if (!CanAccessAccount(state.Account, a)) - { - state.Send(new MessageBoxMessage( - "You cannot delete an account with an access level greater than or equal to your own.", - "Account Access Exception")); - } - else if (a == state.Account) - { - state.Send(new MessageBoxMessage("You may not delete your own account.", "Not Allowed")); - } - else - { - RemoteAdminLogging.WriteLine(state, "Deleted Account {0}", a); - a.Delete(); - state.Send(new MessageBoxMessage("The requested account (and all it's characters) has been deleted.", - "Account Deleted")); - } - } - - private static void UpdateAccount(NetState state, PacketReader pvSrc) - { - if (state.Account.AccessLevel < AccessLevel.Administrator) - { - state.Send(new MessageBoxMessage("You do not have permission to edit accounts.", - "Account Access Exception")); - return; - } - - string username = pvSrc.ReadString(); - string pass = pvSrc.ReadString(); - - Account a = Accounts.GetAccount(username) as Account; - - if (a != null && !CanAccessAccount(state.Account, a)) - { - state.Send(new MessageBoxMessage( - "You cannot edit an account with an access level greater than or equal to your own.", - "Account Access Exception")); - } - else - { - bool CreatedAccount = false; - bool UpdatedPass = false; - bool oldbanned = a?.Banned ?? false; - AccessLevel oldAcessLevel = a?.AccessLevel ?? 0; - - if (a == null) - { - a = new Account(username, pass); - CreatedAccount = true; - } - else if (pass != "(hidden)") - { - a.SetPassword(pass); - UpdatedPass = true; - } - - if (a != state.Account) - { - AccessLevel newAccessLevel = (AccessLevel)pvSrc.ReadByte(); - if (a.AccessLevel != newAccessLevel) - { - if (newAccessLevel >= state.Account.AccessLevel) - state.Send(new MessageBoxMessage( - "Warning: You may not set an access level greater than or equal to your own.", - "Account Access Level update denied.")); - else - a.AccessLevel = newAccessLevel; - } - - bool newBanned = pvSrc.ReadBoolean(); - if (newBanned != a.Banned) - { - oldbanned = a.Banned; - a.Banned = newBanned; - a.Comments.Add(new AccountComment(state.Account.Username, - newBanned ? "Banned via Remote Admin" : "Unbanned via Remote Admin")); - } - } - else - { - pvSrc.ReadInt16(); //skip both - state.Send(new MessageBoxMessage( - "Warning: When editing your own account, Account Status and Access Level cannot be changed.", - "Editing Own Account")); - } - - List list = new List(); - ushort length = pvSrc.ReadUInt16(); - bool invalid = false; - for (int i = 0; i < length; i++) - { - string add = pvSrc.ReadString(); - if (Utility.IsValidIP(add)) - list.Add(add); - else - invalid = true; - } - - a.IPRestrictions = list.ToArray(); - - if (invalid) - state.Send(new MessageBoxMessage( - "Warning: one or more of the IP Restrictions you specified was not valid.", - "Invalid IP Restriction")); - - if (CreatedAccount) - { - RemoteAdminLogging.WriteLine(state, "Created account {0} with Access Level {1}", a.Username, - a.AccessLevel); - } - else - { - string changes = string.Empty; - if (UpdatedPass) changes += " Password Changed."; - if (oldAcessLevel != a.AccessLevel) - changes = - $"{changes} Access level changed from {oldAcessLevel} to {a.AccessLevel}."; - if (oldbanned != a.Banned) changes += a.Banned ? " Banned." : " Unbanned."; - RemoteAdminLogging.WriteLine(state, "Updated account {0}:{1}", a.Username, changes); - } - - state.Send(new MessageBoxMessage("Account updated successfully.", "Account Updated")); - } - } - } -} \ No newline at end of file diff --git a/Projects/Scripts/Engines/RemoteAdmin/Packets.cs b/Projects/Scripts/Engines/RemoteAdmin/Packets.cs deleted file mode 100644 index 0697c1f30..000000000 --- a/Projects/Scripts/Engines/RemoteAdmin/Packets.cs +++ /dev/null @@ -1,157 +0,0 @@ -using System; -using System.Collections.Generic; -using Server.Accounting; -using Server.Items; -using Server.Network; - -namespace Server.RemoteAdmin -{ - public enum LoginResponse : byte - { - NoUser = 0, - BadIP, - BadPass, - NoAccess, - OK - } - - public sealed class AdminCompressedPacket : Packet - { - public AdminCompressedPacket(byte[] CompData, int CDLen, int unCompSize) : base(0x01) - { - EnsureCapacity(1 + 2 + 2 + CDLen); - m_Stream.Write((ushort)unCompSize); - m_Stream.Write(CompData, 0, CDLen); - } - } - - public sealed class Login : Packet - { - public Login(LoginResponse resp) : base(0x02, 2) - { - m_Stream.Write((byte)resp); - } - } - - public sealed class ConsoleData : Packet - { - public ConsoleData(string str) : base(0x03) - { - EnsureCapacity(1 + 2 + 1 + str.Length + 1); - m_Stream.Write((byte)2); - - m_Stream.WriteAsciiNull(str); - } - - public ConsoleData(char ch) : base(0x03) - { - EnsureCapacity(1 + 2 + 1 + 1); - m_Stream.Write((byte)3); - - m_Stream.Write((byte)ch); - } - } - - public sealed class ServerInfo : Packet - { - public ServerInfo() : base(0x04) - { - string netVer = Environment.Version.ToString(); - string os = Environment.OSVersion.ToString(); - - EnsureCapacity(1 + 2 + 10 * 4 + netVer.Length + 1 + os.Length + 1); - int banned = 0; - int active = 0; - - foreach (Account acct in Accounts.GetAccounts()) - if (acct.Banned) - ++banned; - else - ++active; - - m_Stream.Write(active); - m_Stream.Write(banned); - m_Stream.Write(Firewall.List.Count); - m_Stream.Write(NetState.Instances.Count); - - m_Stream.Write(World.Mobiles.Count); - m_Stream.Write(Core.ScriptMobiles); - m_Stream.Write(World.Items.Count); - m_Stream.Write(Core.ScriptItems); - - m_Stream.Write((uint)(DateTime.UtcNow - Clock.ServerStart).TotalSeconds); - m_Stream.Write( - (uint)GC.GetTotalMemory(false)); // TODO: uint not sufficient for TotalMemory (long). Fix protocol. - m_Stream.WriteAsciiNull(netVer); - m_Stream.WriteAsciiNull(os); - } - } - - public sealed class AccountSearchResults : Packet - { - public AccountSearchResults(List results) : base(0x05) - { - EnsureCapacity(1 + 2 + 2); - - m_Stream.Write((byte)results.Count); - - foreach (Account a in results) - { - m_Stream.WriteAsciiNull(a.Username); - - m_Stream.WriteAsciiNull(a.PlainPassword ?? "(hidden)"); - m_Stream.Write((byte)a.AccessLevel); - m_Stream.Write(a.Banned); - unchecked - { - m_Stream.Write((uint)a.LastLogin.Ticks); - } // TODO: This doesn't work, uint.MaxValue is only 7 minutes of ticks. Fix protocol. - - m_Stream.Write((ushort)a.LoginIPs.Length); - for (int i = 0; i < a.LoginIPs.Length; i++) - m_Stream.WriteAsciiNull(a.LoginIPs[i].ToString()); - - m_Stream.Write((ushort)a.IPRestrictions.Length); - for (int i = 0; i < a.IPRestrictions.Length; i++) - m_Stream.WriteAsciiNull(a.IPRestrictions[i]); - } - } - } - - public sealed class CompactServerInfo : Packet - { - public CompactServerInfo() : base(0x51) - { - EnsureCapacity(1 + 2 + 4 * 4 + 8); - - m_Stream.Write(NetState.Instances.Count - 1); // Clients - m_Stream.Write(World.Items.Count); // Items - m_Stream.Write(World.Mobiles.Count); // Mobiles - m_Stream.Write((uint)(DateTime.UtcNow - Clock.ServerStart).TotalSeconds); // Age (seconds) - - long memory = GC.GetTotalMemory(false); - m_Stream.Write((uint)(memory >> 32)); // Memory high bytes - m_Stream.Write((uint)memory); // Memory low bytes - } - } - - public sealed class UOGInfo : Packet - { - public UOGInfo(string str) : base(0x52, str.Length + 6) // 'R' - { - m_Stream.WriteAsciiFixed("unUO", 4); - m_Stream.WriteAsciiNull(str); - } - } - - public sealed class MessageBoxMessage : Packet - { - public MessageBoxMessage(string msg, string caption) : base(0x08) - { - EnsureCapacity(1 + 2 + msg.Length + 1 + caption.Length + 1); - - m_Stream.WriteAsciiNull(msg); - m_Stream.WriteAsciiNull(caption); - } - } -} diff --git a/Projects/Scripts/Engines/RemoteAdmin/RemoteAdminLogging.cs b/Projects/Scripts/Engines/RemoteAdmin/RemoteAdminLogging.cs deleted file mode 100644 index a2340f191..000000000 --- a/Projects/Scripts/Engines/RemoteAdmin/RemoteAdminLogging.cs +++ /dev/null @@ -1,104 +0,0 @@ -using System; -using System.IO; -using Server.Accounting; -using Server.Commands; -using Server.Network; - -namespace Server.RemoteAdmin -{ - public class RemoteAdminLogging - { - private const string LogBaseDirectory = "Logs"; - private const string LogSubDirectory = "RemoteAdmin"; - - private static bool Initialized; - - public static bool Enabled{ get; set; } = true; - - public static StreamWriter Output{ get; private set; } - - public static void LazyInitialize() - { - if (Initialized || !Enabled) return; - Initialized = true; - - if (!Directory.Exists(LogBaseDirectory)) - Directory.CreateDirectory(LogBaseDirectory); - - string directory = Path.Combine(LogBaseDirectory, LogSubDirectory); - - if (!Directory.Exists(directory)) - Directory.CreateDirectory(directory); - - try - { - Output = new StreamWriter( - Path.Combine(directory, - string.Format(LogSubDirectory + "{0}.log", DateTime.UtcNow.ToString("yyyyMMdd"))), true) { AutoFlush = true }; - - - Output.WriteLine("##############################"); - Output.WriteLine("Log started on {0}", DateTime.UtcNow); - Output.WriteLine(); - } - catch - { - Utility.PushColor(ConsoleColor.Red); - Console.WriteLine("RemoteAdminLogging: Failed to initialize LogWriter."); - Utility.PopColor(); - Enabled = false; - } - } - - public static object Format(object o) - { - o = CommandLogging.Format(o); - if (o == null) - return "(null)"; - - return o; - } - - public static void WriteLine(NetState state, string format, params object[] args) - { - for (int i = 0; i < args.Length; i++) - args[i] = CommandLogging.Format(args[i]); - - WriteLine(state, string.Format(format, args)); - } - - public static void WriteLine(NetState state, string text) - { - LazyInitialize(); - - if (!Enabled) - return; - - try - { - Account acct = state?.Account as Account; - string name = acct == null ? "(UNKNOWN)" : acct.Username; - string accesslevel = acct == null ? "NoAccount" : acct.AccessLevel.ToString(); - string statestr = state == null ? "NULLSTATE" : state.ToString(); - - Output.WriteLine("{0}: {1}: {2}: {3}", DateTime.UtcNow, statestr, name, text); - - string path = Core.BaseDirectory; - - CommandLogging.AppendPath(ref path, LogBaseDirectory); - CommandLogging.AppendPath(ref path, LogSubDirectory); - CommandLogging.AppendPath(ref path, accesslevel); - path = Path.Combine(path, $"{name}.log"); - - using (StreamWriter sw = new StreamWriter(path, true)) - { - sw.WriteLine("{0}: {1}: {2}", DateTime.UtcNow, statestr, text); - } - } - catch - { - // ignored - } - } - } -} \ No newline at end of file diff --git a/Projects/Scripts/Engines/Spawner/Spawner.cs b/Projects/Scripts/Engines/Spawner/Spawner.cs index 3d6229d53..dad488bab 100644 --- a/Projects/Scripts/Engines/Spawner/Spawner.cs +++ b/Projects/Scripts/Engines/Spawner/Spawner.cs @@ -591,15 +591,9 @@ namespace Server.Mobiles return false; } - public virtual int GetWalkingRange() - { - return m_WalkingRange; - } + public virtual int GetWalkingRange() => m_WalkingRange; - public virtual WayPoint GetWayPoint() - { - return WayPoint; - } + public virtual WayPoint GetWayPoint() => WayPoint; public virtual Point3D GetSpawnPosition(ISpawnable spawned, Map map) { @@ -671,10 +665,7 @@ namespace Server.Mobiles return false; } - public virtual Map GetSpawnMap() - { - return Map; - } + public virtual Map GetSpawnMap() => Map; public void DoTimer() { @@ -1024,19 +1015,17 @@ namespace Server.Mobiles { Console.WriteLine("Warning: {0} bad spawns detected, logged: 'badspawn.log'", m_List.Count); - using (StreamWriter op = new StreamWriter("badspawn.log", true)) - { - op.WriteLine("# Bad spawns : {0}", DateTime.Now); - op.WriteLine("# Format: X Y Z F Name"); - op.WriteLine(); + using StreamWriter op = new StreamWriter("badspawn.log", true); + op.WriteLine("# Bad spawns : {0}", DateTime.Now); + op.WriteLine("# Format: X Y Z F Name"); + op.WriteLine(); - foreach (WarnEntry e in m_List) - op.WriteLine("{0}\t{1}\t{2}\t{3}\t{4}", e.m_Point.X, e.m_Point.Y, e.m_Point.Z, e.m_Map, - e.m_Name); + foreach (WarnEntry e in m_List) + op.WriteLine("{0}\t{1}\t{2}\t{3}\t{4}", e.m_Point.X, e.m_Point.Y, e.m_Point.Z, e.m_Map, + e.m_Name); - op.WriteLine(); - op.WriteLine(); - } + op.WriteLine(); + op.WriteLine(); } catch { diff --git a/Projects/Scripts/Engines/Spawner/SpawnerGump.cs b/Projects/Scripts/Engines/Spawner/SpawnerGump.cs index 9be3687b3..7be5f298d 100644 --- a/Projects/Scripts/Engines/Spawner/SpawnerGump.cs +++ b/Projects/Scripts/Engines/Spawner/SpawnerGump.cs @@ -122,10 +122,7 @@ namespace Server.Mobiles AddImage(293, 308 + offset, 0x25E6); } - public int GetButtonID(int type, int index) - { - return 1 + index * 10 + type; - } + public int GetButtonID(int type, int index) => 1 + index * 10 + type; public void CreateArray(RelayInfo info, Mobile from, Spawner spawner) { diff --git a/Projects/Scripts/Engines/Spawner/SpawnerType.cs b/Projects/Scripts/Engines/Spawner/SpawnerType.cs index 70d83b8d0..3ef354a80 100644 --- a/Projects/Scripts/Engines/Spawner/SpawnerType.cs +++ b/Projects/Scripts/Engines/Spawner/SpawnerType.cs @@ -4,9 +4,6 @@ namespace Server.Mobiles { public class SpawnerType { - public static Type GetType(string name) - { - return AssemblyHandler.FindTypeByName(name); - } + public static Type GetType(string name) => AssemblyHandler.FindTypeByName(name); } } diff --git a/Projects/Scripts/Engines/Treasures of Tokuno/GreaterArtifacts.cs b/Projects/Scripts/Engines/Treasures of Tokuno/GreaterArtifacts.cs index e020b5cc4..965c23cb9 100644 --- a/Projects/Scripts/Engines/Treasures of Tokuno/GreaterArtifacts.cs +++ b/Projects/Scripts/Engines/Treasures of Tokuno/GreaterArtifacts.cs @@ -44,10 +44,7 @@ namespace Server.Items public class KasaOfTheRajin : Kasa { [Constructible] - public KasaOfTheRajin() - { - Attributes.SpellDamage = 12; - } + public KasaOfTheRajin() => Attributes.SpellDamage = 12; public KasaOfTheRajin(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Engines/Treasures of Tokuno/TreasuresOfTokuno.cs b/Projects/Scripts/Engines/Treasures of Tokuno/TreasuresOfTokuno.cs index d9f9e95d7..2c61d291d 100644 --- a/Projects/Scripts/Engines/Treasures of Tokuno/TreasuresOfTokuno.cs +++ b/Projects/Scripts/Engines/Treasures of Tokuno/TreasuresOfTokuno.cs @@ -244,10 +244,7 @@ namespace Server.Mobiles int version = reader.ReadInt(); } - public override bool CanBeDamaged() - { - return false; - } + public override bool CanBeDamaged() => false; public override void OnMovement(Mobile m, Point3D oldLocation) { @@ -304,10 +301,8 @@ namespace Server.Gumps public class ItemTileButtonInfo : ImageTileButtonInfo { public ItemTileButtonInfo(Item i) : base(i.ItemID, i.Hue, - i.Name == null || i.Name.Length <= 0 ? (TextDefinition)i.LabelNumber : (TextDefinition)i.Name) - { + i.Name == null || i.Name.Length <= 0 ? (TextDefinition)i.LabelNumber : (TextDefinition)i.Name) => Item = i; - } public Item Item{ get; set; } } @@ -318,9 +313,8 @@ namespace Server.Gumps public ToTTurnInGump(Mobile collector, List buttons) : base(1071012, Utility.CastListContravariant(buttons)) // Click a minor artifact to give it to Ihara Soko. - { - m_Collector = collector; - } + => + m_Collector = collector; public static List FindRedeemableItems(Mobile m) { @@ -413,10 +407,8 @@ namespace Server.Gumps pigments ? PigmentRewards[(int)TreasuresOfTokuno.RewardEra - 1].ToArray() : NormalRewards[(int)TreasuresOfTokuno.RewardEra - 1].ToArray() - ) - { + ) => m_Collector = collector; - } public static TypeTileButtonInfo[][] NormalRewards{ get; } = { @@ -588,10 +580,8 @@ namespace Server.Gumps } public TypeTileButtonInfo(Type type, int itemID, int hue, TextDefinition label, int localizedToolTip = -1) : base( - itemID, hue, label, localizedToolTip) - { + itemID, hue, label, localizedToolTip) => Type = type; - } public Type Type{ get; } } @@ -599,10 +589,8 @@ namespace Server.Gumps public class PigmentsTileButtonInfo : ImageTileButtonInfo { public PigmentsTileButtonInfo(PigmentType p) : base(0xEFF, PigmentsOfTokuno.GetInfo(p)[0], - PigmentsOfTokuno.GetInfo(p)[1]) - { + PigmentsOfTokuno.GetInfo(p)[1]) => Pigment = p; - } public PigmentType Pigment{ get; set; } } diff --git a/Projects/Scripts/Engines/Treasures of Tokuno/TreasuresOfTokunoPersistance.cs b/Projects/Scripts/Engines/Treasures of Tokuno/TreasuresOfTokunoPersistance.cs index 309b3e8ef..f02acfba1 100644 --- a/Projects/Scripts/Engines/Treasures of Tokuno/TreasuresOfTokunoPersistance.cs +++ b/Projects/Scripts/Engines/Treasures of Tokuno/TreasuresOfTokunoPersistance.cs @@ -12,10 +12,7 @@ namespace Server.Misc base.Delete(); } - public TreasuresOfTokunoPersistance(Serial serial) : base(serial) - { - Instance = this; - } + public TreasuresOfTokunoPersistance(Serial serial) : base(serial) => Instance = this; public static TreasuresOfTokunoPersistance Instance{ get; private set; } diff --git a/Projects/Scripts/Engines/VeteranRewards/Character Statue Maker/CharacterStatue.cs b/Projects/Scripts/Engines/VeteranRewards/Character Statue Maker/CharacterStatue.cs index 3e2de9eba..342c4740a 100644 --- a/Projects/Scripts/Engines/VeteranRewards/Character Statue Maker/CharacterStatue.cs +++ b/Projects/Scripts/Engines/VeteranRewards/Character Statue Maker/CharacterStatue.cs @@ -179,15 +179,9 @@ namespace Server.Mobiles Plinth.Location = new Point3D(X, Y, Z - 5); } - public override bool CanBeRenamedBy(Mobile from) - { - return false; - } + public override bool CanBeRenamedBy(Mobile from) => false; - public override bool CanBeDamaged() - { - return false; - } + public override bool CanBeDamaged() => false; public void OnRequestedAnimation(Mobile from) { @@ -394,10 +388,7 @@ namespace Server.Mobiles { private CharacterStatue m_Statue; - public DemolishEntry(CharacterStatue statue) : base(6275, 2) - { - m_Statue = statue; - } + public DemolishEntry(CharacterStatue statue) : base(6275, 2) => m_Statue = statue; public override void OnClick() { diff --git a/Projects/Scripts/Engines/VeteranRewards/RewardChoiceGump.cs b/Projects/Scripts/Engines/VeteranRewards/RewardChoiceGump.cs index 238ebfc94..3fe04c1d1 100644 --- a/Projects/Scripts/Engines/VeteranRewards/RewardChoiceGump.cs +++ b/Projects/Scripts/Engines/VeteranRewards/RewardChoiceGump.cs @@ -107,10 +107,7 @@ namespace Server.Engines.VeteranRewards return (int)Math.Ceiling(i / 24.0); } - private int GetButtonID(int type, int index) - { - return 2 + index * 20 + type; - } + private int GetButtonID(int type, int index) => 2 + index * 20 + type; private void RenderCategory(RewardCategory category, int index, ref int page) { diff --git a/Projects/Scripts/Engines/Virtues/Honor.cs b/Projects/Scripts/Engines/Virtues/Honor.cs index 2583a48f6..5bab37931 100644 --- a/Projects/Scripts/Engines/Virtues/Honor.cs +++ b/Projects/Scripts/Engines/Virtues/Honor.cs @@ -152,10 +152,7 @@ namespace Server private class InternalTarget : Target { - public InternalTarget() : base(12, false, TargetFlags.None) - { - CheckLOS = true; - } + public InternalTarget() : base(12, false, TargetFlags.None) => CheckLOS = true; protected override void OnTarget(Mobile from, object targeted) { @@ -371,10 +368,7 @@ namespace Server } } - public bool CheckDistance() - { - return true; - } + public bool CheckDistance() => true; public void Cancel() { @@ -395,10 +389,7 @@ namespace Server { private HonorContext m_Context; - public InternalTimer(HonorContext context) : base(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.0)) - { - m_Context = context; - } + public InternalTimer(HonorContext context) : base(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.0)) => m_Context = context; protected override void OnTick() { diff --git a/Projects/Scripts/Engines/Virtues/VirtueGump.cs b/Projects/Scripts/Engines/Virtues/VirtueGump.cs index 98a6765ef..0277fb64e 100644 --- a/Projects/Scripts/Engines/Virtues/VirtueGump.cs +++ b/Projects/Scripts/Engines/Virtues/VirtueGump.cs @@ -165,10 +165,7 @@ namespace Server { } - public override string Compile(NetState ns) - { - return $"{{ gumppic {X} {Y} {GumpID} hue={Hue} class=VirtueGumpItem }}"; - } + public override string Compile(NetState ns) => $"{{ gumppic {X} {Y} {GumpID} hue={Hue} class=VirtueGumpItem }}"; public override void AppendTo(NetState ns, IGumpWriter disp) { diff --git a/Projects/Scripts/Engines/Virtues/VirtueHelper.cs b/Projects/Scripts/Engines/Virtues/VirtueHelper.cs index be5452311..4966b6c04 100644 --- a/Projects/Scripts/Engines/Virtues/VirtueHelper.cs +++ b/Projects/Scripts/Engines/Virtues/VirtueHelper.cs @@ -25,15 +25,9 @@ namespace Server public class VirtueHelper { - public static bool HasAny(Mobile from, VirtueName virtue) - { - return from.Virtues.GetValue((int)virtue) > 0; - } + public static bool HasAny(Mobile from, VirtueName virtue) => from.Virtues.GetValue((int)virtue) > 0; - public static bool IsHighestPath(Mobile from, VirtueName virtue) - { - return from.Virtues.GetValue((int)virtue) >= GetMaxAmount(virtue); - } + public static bool IsHighestPath(Mobile from, VirtueName virtue) => from.Virtues.GetValue((int)virtue) >= GetMaxAmount(virtue); public static VirtueLevel GetLevel(Mobile from, VirtueName virtue) { @@ -83,10 +77,7 @@ namespace Server return true; } - public static bool Atrophy(Mobile from, VirtueName virtue) - { - return Atrophy(from, virtue, 1); - } + public static bool Atrophy(Mobile from, VirtueName virtue) => Atrophy(from, virtue, 1); public static bool Atrophy(Mobile from, VirtueName virtue, int amount) { @@ -100,20 +91,11 @@ namespace Server return current > 0; } - public static bool IsSeeker(Mobile from, VirtueName virtue) - { - return GetLevel(from, virtue) >= VirtueLevel.Seeker; - } + public static bool IsSeeker(Mobile from, VirtueName virtue) => GetLevel(from, virtue) >= VirtueLevel.Seeker; - public static bool IsFollower(Mobile from, VirtueName virtue) - { - return GetLevel(from, virtue) >= VirtueLevel.Follower; - } + public static bool IsFollower(Mobile from, VirtueName virtue) => GetLevel(from, virtue) >= VirtueLevel.Follower; - public static bool IsKnight(Mobile from, VirtueName virtue) - { - return GetLevel(from, virtue) >= VirtueLevel.Knight; - } + public static bool IsKnight(Mobile from, VirtueName virtue) => GetLevel(from, virtue) >= VirtueLevel.Knight; public static void AwardVirtue(PlayerMobile pm, VirtueName virtue, int amount) { diff --git a/Projects/Scripts/Gumps/AddGump.cs b/Projects/Scripts/Gumps/AddGump.cs index 58136f741..69d24becc 100644 --- a/Projects/Scripts/Gumps/AddGump.cs +++ b/Projects/Scripts/Gumps/AddGump.cs @@ -203,10 +203,7 @@ namespace Server.Gumps private class TypeNameComparer : IComparer { - public int Compare(Type x, Type y) - { - return x.Name.CompareTo(y.Name); - } + public int Compare(Type x, Type y) => x.Name.CompareTo(y.Name); } public class InternalTarget : Target diff --git a/Projects/Scripts/Gumps/AdminGump.cs b/Projects/Scripts/Gumps/AdminGump.cs index 01f1f25b6..be038d50d 100644 --- a/Projects/Scripts/Gumps/AdminGump.cs +++ b/Projects/Scripts/Gumps/AdminGump.cs @@ -11,7 +11,6 @@ using Server.Misc; using Server.Multis; using Server.Network; using Server.Prompts; -using Server.RemoteAdmin; namespace Server.Gumps { @@ -417,8 +416,7 @@ namespace Server.Gumps int offset = 140 + i * 20; if (m == null) - AddLabelCropped(12, offset, 81, 20, LabelHue, - AdminNetwork.IsAuth(ns) ? "(remote admin)" : "(logging in)"); + AddLabelCropped(12, offset, 81, 20, LabelHue, "(logging in)"); else AddLabelCropped(12, offset, 81, 20, GetHueFor(m), m.Name); AddLabelCropped(95, offset, 81, 20, LabelHue, a == null ? "(no account)" : a.Username); @@ -1162,15 +1160,9 @@ namespace Server.Gumps AddHtml(x + 35, y, 240, 20, Color(text, LabelColor32)); } - public string Center(string text) - { - return $"
{text}
"; - } + public string Center(string text) => $"
{text}
"; - public string Color(string text, int color) - { - return $"{text}"; - } + public string Color(string text, int color) => $"{text}"; public void AddBlackAlpha(int x, int y, int width, int height) { @@ -1178,15 +1170,9 @@ namespace Server.Gumps AddAlphaRegion(x, y, width, height); } - public int GetButtonID(int type, int index) - { - return 1 + index * 11 + type; - } + public int GetButtonID(int type, int index) => 1 + index * 11 + type; - public static string FormatTimeSpan(TimeSpan ts) - { - return $"{ts.Days:D2}:{ts.Hours % 24:D2}:{ts.Minutes % 60:D2}:{ts.Seconds % 60:D2}"; - } + public static string FormatTimeSpan(TimeSpan ts) => $"{ts.Days:D2}:{ts.Hours % 24:D2}:{ts.Minutes % 60:D2}:{ts.Seconds % 60:D2}"; public static string FormatByteAmount(long totalBytes) { @@ -3013,20 +2999,14 @@ namespace Server.Gumps { public static readonly IComparer>> Instance = new SharedAccountComparer(); - public int Compare(KeyValuePair> x, KeyValuePair> y) - { - return x.Value.Count - y.Value.Count; - } + public int Compare(KeyValuePair> x, KeyValuePair> y) => x.Value.Count - y.Value.Count; } private class AddCommentPrompt : Prompt { private Account m_Account; - public AddCommentPrompt(Account acct) - { - m_Account = acct; - } + public AddCommentPrompt(Account acct) => m_Account = acct; public override void OnCancel(Mobile from) { @@ -3049,10 +3029,7 @@ namespace Server.Gumps { private Account m_Account; - public AddTagNamePrompt(Account acct) - { - m_Account = acct; - } + public AddTagNamePrompt(Account acct) => m_Account = acct; public override void OnCancel(Mobile from) { diff --git a/Projects/Scripts/Gumps/BaseGridGump.cs b/Projects/Scripts/Gumps/BaseGridGump.cs index 40fd596c3..2f34840df 100644 --- a/Projects/Scripts/Gumps/BaseGridGump.cs +++ b/Projects/Scripts/Gumps/BaseGridGump.cs @@ -37,20 +37,11 @@ namespace Server.Gumps public virtual int TextHue => 0; public virtual int TextOffsetX => 2; - public string Center(string text) - { - return $"
{text}
"; - } + public string Center(string text) => $"
{text}
"; - public string Color(string text, int color) - { - return $"{text}"; - } + public string Color(string text, int color) => $"{text}"; - public int GetButtonID(int typeCount, int type, int index) - { - return 1 + index * typeCount + type; - } + public int GetButtonID(int typeCount, int type, int index) => 1 + index * typeCount + type; public bool SplitButtonID(int buttonID, int typeCount, out int type, out int index) { diff --git a/Projects/Scripts/Gumps/ClientGump.cs b/Projects/Scripts/Gumps/ClientGump.cs index 956f4b70c..345d2ebb1 100644 --- a/Projects/Scripts/Gumps/ClientGump.cs +++ b/Projects/Scripts/Gumps/ClientGump.cs @@ -292,14 +292,8 @@ namespace Server.Gumps } } - public string Center(string text) - { - return $"
{text}
"; - } + public string Center(string text) => $"
{text}
"; - public string Color(string text, int color) - { - return $"{text}"; - } + public string Color(string text, int color) => $"{text}"; } } diff --git a/Projects/Scripts/Gumps/CommentsGump.cs b/Projects/Scripts/Gumps/CommentsGump.cs index 897a5d370..a30c88c75 100644 --- a/Projects/Scripts/Gumps/CommentsGump.cs +++ b/Projects/Scripts/Gumps/CommentsGump.cs @@ -92,10 +92,7 @@ namespace Server.Gumps { private Account m_Acct; - public CommentPrompt(Account acct) - { - m_Acct = acct; - } + public CommentPrompt(Account acct) => m_Acct = acct; public override void OnCancel(Mobile from) { diff --git a/Projects/Scripts/Gumps/ConfirmBreakCrystalGump.cs b/Projects/Scripts/Gumps/ConfirmBreakCrystalGump.cs index 4a22984ba..436279a88 100644 --- a/Projects/Scripts/Gumps/ConfirmBreakCrystalGump.cs +++ b/Projects/Scripts/Gumps/ConfirmBreakCrystalGump.cs @@ -7,10 +7,7 @@ namespace Server.Gumps { private BaseImprisonedMobile m_Item; - public ConfirmBreakCrystalGump(BaseImprisonedMobile item) - { - m_Item = item; - } + public ConfirmBreakCrystalGump(BaseImprisonedMobile item) => m_Item = item; public override int LabelNumber => 1075084; // This statuette will be destroyed when its trapped creature is summoned. The creature will be bonded to you but will disappear if released.

Do you wish to proceed? diff --git a/Projects/Scripts/Gumps/ConfirmReleaseGump.cs b/Projects/Scripts/Gumps/ConfirmReleaseGump.cs index a045fef0e..747791df3 100644 --- a/Projects/Scripts/Gumps/ConfirmReleaseGump.cs +++ b/Projects/Scripts/Gumps/ConfirmReleaseGump.cs @@ -31,8 +31,9 @@ namespace Server.Gumps public override void OnResponse(NetState sender, RelayInfo info) { - if (info.ButtonID != 2 || m_Pet.Deleted || !(m_Pet.Controlled && m_From == m_Pet.ControlMaster && - m_From.CheckAlive() && m_Pet.Map == m_From.Map && m_Pet.InRange(m_From, 14))) + if (info.ButtonID != 2 || m_Pet.Deleted || + !(m_Pet.Controlled && m_From == m_Pet.ControlMaster && + m_From.CheckAlive() && m_Pet.Map == m_From.Map && m_Pet.InRange(m_From, 14))) return; m_Pet.ControlTarget = null; m_Pet.ControlOrder = OrderType.Release; diff --git a/Projects/Scripts/Gumps/Guilds/New Guild System/BaseGuildGump.cs b/Projects/Scripts/Gumps/Guilds/New Guild System/BaseGuildGump.cs index 81024b81c..bab0308bf 100644 --- a/Projects/Scripts/Gumps/Guilds/New Guild System/BaseGuildGump.cs +++ b/Projects/Scripts/Gumps/Guilds/New Guild System/BaseGuildGump.cs @@ -65,17 +65,13 @@ namespace Server.Guilds } } - public static bool IsLeader(Mobile m, Guild g) - { - return !(m.Deleted || g.Disbanded || !(m is PlayerMobile) || - m.AccessLevel < AccessLevel.GameMaster && g.Leader != m); - } + public static bool IsLeader(Mobile m, Guild g) => + !(m.Deleted || g.Disbanded || !(m is PlayerMobile) || + m.AccessLevel < AccessLevel.GameMaster && g.Leader != m); - public static bool IsMember(Mobile m, Guild g) - { - return !(m.Deleted || g.Disbanded || !(m is PlayerMobile) || - m.AccessLevel < AccessLevel.GameMaster && !g.IsMember(m)); - } + public static bool IsMember(Mobile m, Guild g) => + !(m.Deleted || g.Disbanded || !(m is PlayerMobile) || + m.AccessLevel < AccessLevel.GameMaster && !g.IsMember(m)); public static bool CheckProfanity(string s, int maxLength = 50) { @@ -123,9 +119,6 @@ namespace Server.Guilds AddHtml(x, y, width, height, text.String, back, scroll); } - public static string Color(string text, int color) - { - return $"{text}"; - } + public static string Color(string text, int color) => $"{text}"; } } diff --git a/Projects/Scripts/Gumps/Guilds/New Guild System/BaseGuildListGump.cs b/Projects/Scripts/Gumps/Guilds/New Guild System/BaseGuildListGump.cs index 2ad7bed1c..ecb5bb900 100644 --- a/Projects/Scripts/Gumps/Guilds/New Guild System/BaseGuildListGump.cs +++ b/Projects/Scripts/Gumps/Guilds/New Guild System/BaseGuildListGump.cs @@ -103,10 +103,7 @@ namespace Server.Guilds { } - public virtual bool HasRelationship(T o) - { - return false; - } + public virtual bool HasRelationship(T o) => false; public virtual void DrawEntry(T o, int index, int itemNumber) { diff --git a/Projects/Scripts/Gumps/Guilds/New Guild System/DiplomacyGump.cs b/Projects/Scripts/Gumps/Guilds/New Guild System/DiplomacyGump.cs index 084fb59d6..2c3e175b8 100644 --- a/Projects/Scripts/Gumps/Guilds/New Guild System/DiplomacyGump.cs +++ b/Projects/Scripts/Gumps/Guilds/New Guild System/DiplomacyGump.cs @@ -179,10 +179,8 @@ namespace Server.Guilds public override Gump GetResentGump(PlayerMobile pm, Guild g, IComparer comparer, bool ascending, - string filter, int startNumber) - { - return new GuildDiplomacyGump(pm, g, comparer, ascending, filter, startNumber, m_Display); - } + string filter, int startNumber) => + new GuildDiplomacyGump(pm, g, comparer, ascending, filter, startNumber, m_Display); public override Gump GetObjectInfoGump(PlayerMobile pm, Guild g, Guild o) { @@ -232,10 +230,7 @@ namespace Server.Guilds { private Guild m_Guild; - public StatusComparer(Guild g) - { - m_Guild = g; - } + public StatusComparer(Guild g) => m_Guild = g; public int Compare(Guild x, Guild y) { diff --git a/Projects/Scripts/Gumps/Guilds/New Guild System/GuildRosterGump.cs b/Projects/Scripts/Gumps/Guilds/New Guild System/GuildRosterGump.cs index 5a629ca71..17389398f 100644 --- a/Projects/Scripts/Gumps/Guilds/New Guild System/GuildRosterGump.cs +++ b/Projects/Scripts/Gumps/Guilds/New Guild System/GuildRosterGump.cs @@ -73,15 +73,10 @@ namespace Server.Guilds } public override Gump GetResentGump(PlayerMobile pm, Guild g, IComparer comparer, bool ascending, - string filter, int startNumber) - { - return new GuildRosterGump(pm, g, comparer, ascending, filter, startNumber); - } + string filter, int startNumber) => + new GuildRosterGump(pm, g, comparer, ascending, filter, startNumber); - public override Gump GetObjectInfoGump(PlayerMobile pm, Guild g, PlayerMobile o) - { - return new GuildMemberInfoGump(pm, g, o, false, false); - } + public override Gump GetObjectInfoGump(PlayerMobile pm, Guild g, PlayerMobile o) => new GuildMemberInfoGump(pm, g, o, false, false); public override void OnResponse(NetState sender, RelayInfo info) { diff --git a/Projects/Scripts/Gumps/HonorSelf.cs b/Projects/Scripts/Gumps/HonorSelf.cs index cb7599b39..3fae52cba 100644 --- a/Projects/Scripts/Gumps/HonorSelf.cs +++ b/Projects/Scripts/Gumps/HonorSelf.cs @@ -13,8 +13,7 @@ namespace Server.Gumps AddBackground(0, 0, 245, 145, 9250); AddButton(157, 101, 247, 248, 1); AddButton(81, 100, 241, 248, 0); - AddHtml(21, 20, 203, 70, @"Are you sure you want to use -honor points on yourself?", true); + AddHtml(21, 20, 203, 70, "Are you sure you want to use honor points on yourself?", true); } public override void OnResponse(NetState sender, RelayInfo info) diff --git a/Projects/Scripts/Gumps/HouseGump.cs b/Projects/Scripts/Gumps/HouseGump.cs index 0f914fa30..e809ab6e2 100644 --- a/Projects/Scripts/Gumps/HouseGump.cs +++ b/Projects/Scripts/Gumps/HouseGump.cs @@ -721,10 +721,7 @@ namespace Server.Prompts { private BaseHouse m_House; - public RenamePrompt(BaseHouse house) - { - m_House = house; - } + public RenamePrompt(BaseHouse house) => m_House = house; public override void OnResponse(Mobile from, string text) { diff --git a/Projects/Scripts/Gumps/HouseGumpAOS.cs b/Projects/Scripts/Gumps/HouseGumpAOS.cs index bce001852..f2afc2343 100644 --- a/Projects/Scripts/Gumps/HouseGumpAOS.cs +++ b/Projects/Scripts/Gumps/HouseGumpAOS.cs @@ -487,10 +487,7 @@ namespace Server.Gumps return String.IsNullOrWhiteSpace(m.Name) ? "(no name)" : m.Name.Trim(); } - private string GetDateTime(DateTime val) - { - return val == DateTime.MinValue ? "" : val.ToString("yyyy'-'MM'-'dd HH':'mm':'ss"); - } + private string GetDateTime(DateTime val) => val == DateTime.MinValue ? "" : val.ToString("yyyy'-'MM'-'dd HH':'mm':'ss"); public void AddPageButton(int x, int y, int buttonID, int number, HouseGumpPageAOS page) { @@ -576,10 +573,7 @@ namespace Server.Gumps } } - public int GetButtonID(int type, int index) - { - return 1 + index * 15 + type; - } + public int GetButtonID(int type, int index) => 1 + index * 15 + type; public static void PublicPrivateNotice_Callback(Mobile from, BaseHouse house) { diff --git a/Projects/Scripts/Gumps/Props/PropsGump.cs b/Projects/Scripts/Gumps/Props/PropsGump.cs index 3079792a5..57b9acb48 100644 --- a/Projects/Scripts/Gumps/Props/PropsGump.cs +++ b/Projects/Scripts/Gumps/Props/PropsGump.cs @@ -416,10 +416,7 @@ namespace Server.Gumps return list; } - private static bool IsCustomEnum(Type type) - { - return type.IsDefined(typeofCustomEnum, false); - } + private static bool IsCustomEnum(Type type) => type.IsDefined(typeofCustomEnum, false); public static void OnValueChanged(object obj, PropertyInfo prop, Stack stack) { @@ -448,15 +445,9 @@ namespace Server.Gumps return ce.Names; } - private static bool HasAttribute(Type type, Type check, bool inherit) - { - return type.GetCustomAttributes(check, inherit).Length > 0; - } + private static bool HasAttribute(Type type, Type check, bool inherit) => type.GetCustomAttributes(check, inherit).Length > 0; - private static bool IsType(Type type, Type check) - { - return type == check || type.IsSubclassOf(check); - } + private static bool IsType(Type type, Type check) => type == check || type.IsSubclassOf(check); private static bool IsType(Type type, Type[] check) { @@ -467,10 +458,7 @@ namespace Server.Gumps return false; } - private string ValueToString(PropertyInfo prop) - { - return ValueToString(m_Object, prop); - } + private string ValueToString(PropertyInfo prop) => ValueToString(m_Object, prop); public static string ValueToString(object obj, PropertyInfo prop) { @@ -666,15 +654,9 @@ namespace Server.Gumps { private Type m_Start; - public GroupComparer(Type start) - { - m_Start = start; - } + public GroupComparer(Type start) => m_Start = start; - public int Compare(KeyValuePair> x, KeyValuePair> y) - { - return GetDistance(x.Key).CompareTo(GetDistance(y.Key)); - } + public int Compare(KeyValuePair> x, KeyValuePair> y) => GetDistance(x.Key).CompareTo(GetDistance(y.Key)); private int GetDistance(Type type) { diff --git a/Projects/Scripts/Gumps/Props/SetBodyGump.cs b/Projects/Scripts/Gumps/Props/SetBodyGump.cs index e57c1214f..43f1ee237 100644 --- a/Projects/Scripts/Gumps/Props/SetBodyGump.cs +++ b/Projects/Scripts/Gumps/Props/SetBodyGump.cs @@ -96,15 +96,9 @@ namespace Server.Gumps } } - public string Center(string text) - { - return $"
{text}
"; - } + public string Center(string text) => $"
{text}
"; - public string Color(string text, int color) - { - return $"{text}"; - } + public string Color(string text, int color) => $"{text}"; public void AddTypeButton(int x, int y, int buttonID, string text, ModelBodyType type) { diff --git a/Projects/Scripts/Gumps/Props/SetCustomEnumGump.cs b/Projects/Scripts/Gumps/Props/SetCustomEnumGump.cs index 63601c9ac..9ce0eec48 100644 --- a/Projects/Scripts/Gumps/Props/SetCustomEnumGump.cs +++ b/Projects/Scripts/Gumps/Props/SetCustomEnumGump.cs @@ -11,10 +11,8 @@ namespace Server.Gumps private string[] m_Names; public SetCustomEnumGump(PropertyInfo prop, Mobile mobile, object o, Stack stack, int propspage, - List list, string[] names) : base(prop, mobile, o, stack, propspage, list, names, null) - { + List list, string[] names) : base(prop, mobile, o, stack, propspage, list, names, null) => m_Names = names; - } public override void OnResponse(NetState sender, RelayInfo relayInfo) { diff --git a/Projects/Scripts/Gumps/ReportMurderer.cs b/Projects/Scripts/Gumps/ReportMurderer.cs index bab416048..41b8a71b6 100644 --- a/Projects/Scripts/Gumps/ReportMurderer.cs +++ b/Projects/Scripts/Gumps/ReportMurderer.cs @@ -6,179 +6,179 @@ using Server.Mobiles; namespace Server.Gumps { - public class ReportMurdererGump : Gump - { - private int m_Idx; - private List m_Killers; - private Mobile m_Victum; + public class ReportMurdererGump : Gump + { + private int m_Idx; + private List m_Killers; + private Mobile m_Victum; - public static void Initialize() - { - EventSink.PlayerDeath += EventSink_PlayerDeath; - } + public static void Initialize() + { + EventSink.PlayerDeath += EventSink_PlayerDeath; + } - public static void EventSink_PlayerDeath( PlayerDeathEventArgs e ) - { - Mobile m = e.Mobile; + public static void EventSink_PlayerDeath( PlayerDeathEventArgs e ) + { + Mobile m = e.Mobile; - List killers = new List(); - List toGive = new List(); + List killers = new List(); + List toGive = new List(); - foreach ( AggressorInfo ai in m.Aggressors ) - { - if ( ai.Attacker.Player && ai.CanReportMurder && !ai.Reported ) - { - if (!Core.SE || !((PlayerMobile)m).RecentlyReported.Contains(ai.Attacker)) - { - killers.Add(ai.Attacker); - ai.Reported = true; - ai.CanReportMurder = false; - } - } + foreach ( AggressorInfo ai in m.Aggressors ) + { + if ( ai.Attacker.Player && ai.CanReportMurder && !ai.Reported ) + { + if (!Core.SE || !((PlayerMobile)m).RecentlyReported.Contains(ai.Attacker)) + { + killers.Add(ai.Attacker); + ai.Reported = true; + ai.CanReportMurder = false; + } + } - if ( ai.Attacker.Player && (DateTime.UtcNow - ai.LastCombatTime) < TimeSpan.FromSeconds( 30.0 ) && !toGive.Contains( ai.Attacker ) ) - toGive.Add( ai.Attacker ); - } + if ( ai.Attacker.Player && (DateTime.UtcNow - ai.LastCombatTime) < TimeSpan.FromSeconds( 30.0 ) && !toGive.Contains( ai.Attacker ) ) + toGive.Add( ai.Attacker ); + } - foreach ( AggressorInfo ai in m.Aggressed ) - { - if ( ai.Defender.Player && (DateTime.UtcNow - ai.LastCombatTime) < TimeSpan.FromSeconds( 30.0 ) && !toGive.Contains( ai.Defender ) ) - toGive.Add( ai.Defender ); - } + foreach ( AggressorInfo ai in m.Aggressed ) + { + if ( ai.Defender.Player && (DateTime.UtcNow - ai.LastCombatTime) < TimeSpan.FromSeconds( 30.0 ) && !toGive.Contains( ai.Defender ) ) + toGive.Add( ai.Defender ); + } - foreach ( Mobile g in toGive ) - { - int n = Notoriety.Compute( g, m ); + foreach ( Mobile g in toGive ) + { + int n = Notoriety.Compute( g, m ); - int theirKarma = m.Karma, ourKarma = g.Karma; - bool innocent = ( n == Notoriety.Innocent ); - bool criminal = ( n == Notoriety.Criminal || n == Notoriety.Murderer ); + int theirKarma = m.Karma, ourKarma = g.Karma; + bool innocent = ( n == Notoriety.Innocent ); + bool criminal = ( n == Notoriety.Criminal || n == Notoriety.Murderer ); - int fameAward = m.Fame / 200; - int karmaAward = 0; + int fameAward = m.Fame / 200; + int karmaAward = 0; - if ( innocent ) - karmaAward = ( ourKarma > -2500 ? -850 : -110 - (m.Karma / 100) ); - else if ( criminal ) - karmaAward = 50; + if ( innocent ) + karmaAward = ( ourKarma > -2500 ? -850 : -110 - (m.Karma / 100) ); + else if ( criminal ) + karmaAward = 50; - Titles.AwardFame( g, fameAward, false ); - Titles.AwardKarma( g, karmaAward, true ); - } + Titles.AwardFame( g, fameAward, false ); + Titles.AwardKarma( g, karmaAward, true ); + } - if ( m is PlayerMobile mobile && mobile.NpcGuild == NpcGuild.ThievesGuild ) - return; + if ( m is PlayerMobile mobile && mobile.NpcGuild == NpcGuild.ThievesGuild ) + return; - if ( killers.Count > 0 ) - new GumpTimer( m, killers ).Start(); - } + if ( killers.Count > 0 ) + new GumpTimer( m, killers ).Start(); + } - private class GumpTimer : Timer - { - private Mobile m_Victim; - private List m_Killers; + private class GumpTimer : Timer + { + private Mobile m_Victim; + private List m_Killers; - public GumpTimer( Mobile victim, List killers ) : base( TimeSpan.FromSeconds( 4.0 ) ) - { - m_Victim = victim; - m_Killers = killers; - } + public GumpTimer( Mobile victim, List killers ) : base( TimeSpan.FromSeconds( 4.0 ) ) + { + m_Victim = victim; + m_Killers = killers; + } - protected override void OnTick() - { - m_Victim.SendGump( new ReportMurdererGump( m_Victim, m_Killers ) ); - } - } + protected override void OnTick() + { + m_Victim.SendGump( new ReportMurdererGump( m_Victim, m_Killers ) ); + } + } - private ReportMurdererGump(Mobile victum, List killers, int idx = 0) : base( 0, 0 ) - { - m_Killers = killers; - m_Victum = victum; - m_Idx = idx; - BuildGump(); - } + private ReportMurdererGump(Mobile victum, List killers, int idx = 0) : base( 0, 0 ) + { + m_Killers = killers; + m_Victum = victum; + m_Idx = idx; + BuildGump(); + } - private void BuildGump() - { - AddBackground( 265, 205, 320, 290, 5054 ); - Closable = false; - Resizable = false; + private void BuildGump() + { + AddBackground( 265, 205, 320, 290, 5054 ); + Closable = false; + Resizable = false; - AddPage( 0 ); + AddPage( 0 ); - AddImageTiled( 225, 175, 50, 45, 0xCE ); //Top left corner - AddImageTiled( 267, 175, 315, 44, 0xC9 ); //Top bar - AddImageTiled( 582, 175, 43, 45, 0xCF ); //Top right corner - AddImageTiled( 225, 219, 44, 270, 0xCA ); //Left side - AddImageTiled( 582, 219, 44, 270, 0xCB ); //Right side - AddImageTiled( 225, 489, 44, 43, 0xCC ); //Lower left corner - AddImageTiled( 267, 489, 315, 43, 0xE9 ); //Lower Bar - AddImageTiled( 582, 489, 43, 43, 0xCD ); //Lower right corner + AddImageTiled( 225, 175, 50, 45, 0xCE ); //Top left corner + AddImageTiled( 267, 175, 315, 44, 0xC9 ); //Top bar + AddImageTiled( 582, 175, 43, 45, 0xCF ); //Top right corner + AddImageTiled( 225, 219, 44, 270, 0xCA ); //Left side + AddImageTiled( 582, 219, 44, 270, 0xCB ); //Right side + AddImageTiled( 225, 489, 44, 43, 0xCC ); //Lower left corner + AddImageTiled( 267, 489, 315, 43, 0xE9 ); //Lower Bar + AddImageTiled( 582, 489, 43, 43, 0xCD ); //Lower right corner - AddPage( 1 ); + AddPage( 1 ); - AddHtml( 260, 234, 300, 140, m_Killers[m_Idx].Name ); // Player's Name - AddHtmlLocalized( 260, 254, 300, 140, 1049066 ); // Would you like to report... + AddHtml( 260, 234, 300, 140, m_Killers[m_Idx].Name ); // Player's Name + AddHtmlLocalized( 260, 254, 300, 140, 1049066 ); // Would you like to report... - AddButton( 260, 300, 0xFA5, 0xFA7, 1 ); - AddHtmlLocalized( 300, 300, 300, 50, 1046362 ); // Yes + AddButton( 260, 300, 0xFA5, 0xFA7, 1 ); + AddHtmlLocalized( 300, 300, 300, 50, 1046362 ); // Yes - AddButton( 360, 300, 0xFA5, 0xFA7, 2 ); - AddHtmlLocalized( 400, 300, 300, 50, 1046363 ); // No - } + AddButton( 360, 300, 0xFA5, 0xFA7, 2 ); + AddHtmlLocalized( 400, 300, 300, 50, 1046363 ); // No + } - public static void ReportedListExpiry_Callback( PlayerMobile from, Mobile killer ) - { - if (from.RecentlyReported.Contains(killer)) - from.RecentlyReported.Remove(killer); - } + public static void ReportedListExpiry_Callback( PlayerMobile from, Mobile killer ) + { + if (from.RecentlyReported.Contains(killer)) + from.RecentlyReported.Remove(killer); + } - public override void OnResponse( NetState state, RelayInfo info ) - { - PlayerMobile from = (PlayerMobile)state.Mobile; + public override void OnResponse( NetState state, RelayInfo info ) + { + PlayerMobile from = (PlayerMobile)state.Mobile; - switch ( info.ButtonID ) - { - case 1: - { - Mobile killer = m_Killers[m_Idx]; - if (killer?.Deleted == false) - { - killer.Kills++; - killer.ShortTermMurders++; + switch ( info.ButtonID ) + { + case 1: + { + Mobile killer = m_Killers[m_Idx]; + if (killer?.Deleted == false) + { + killer.Kills++; + killer.ShortTermMurders++; - if (Core.SE) - { - from.RecentlyReported.Add(killer); - Timer.DelayCall(TimeSpan.FromMinutes(10), () => ReportedListExpiry_Callback(from, killer)); - } + if (Core.SE) + { + from.RecentlyReported.Add(killer); + Timer.DelayCall(TimeSpan.FromMinutes(10), () => ReportedListExpiry_Callback(from, killer)); + } - if (killer is PlayerMobile pk) - { - pk.ResetKillTime(); - pk.SendLocalizedMessage(1049067);//You have been reported for murder! + if (killer is PlayerMobile pk) + { + pk.ResetKillTime(); + pk.SendLocalizedMessage(1049067);//You have been reported for murder! - if (pk.Kills == 5) - { - pk.SendLocalizedMessage(502134);//You are now known as a murderer! - } - else if (SkillHandlers.Stealing.SuspendOnMurder && pk.Kills == 1 && pk.NpcGuild == NpcGuild.ThievesGuild) - { - pk.SendLocalizedMessage(501562); // You have been suspended by the Thieves Guild. - } - } - } - break; - } - case 2: - { - break; - } - } + if (pk.Kills == 5) + { + pk.SendLocalizedMessage(502134);//You are now known as a murderer! + } + else if (SkillHandlers.Stealing.SuspendOnMurder && pk.Kills == 1 && pk.NpcGuild == NpcGuild.ThievesGuild) + { + pk.SendLocalizedMessage(501562); // You have been suspended by the Thieves Guild. + } + } + } + break; + } + case 2: + { + break; + } + } - m_Idx++; - if ( m_Idx < m_Killers.Count ) - from.SendGump( new ReportMurdererGump( from, m_Killers, m_Idx ) ); - } - } + m_Idx++; + if ( m_Idx < m_Killers.Count ) + from.SendGump( new ReportMurdererGump( from, m_Killers, m_Idx ) ); + } + } } diff --git a/Projects/Scripts/Gumps/ResurrectGump.cs b/Projects/Scripts/Gumps/ResurrectGump.cs index fc8c1e7b8..18d26166c 100644 --- a/Projects/Scripts/Gumps/ResurrectGump.cs +++ b/Projects/Scripts/Gumps/ResurrectGump.cs @@ -5,122 +5,122 @@ using Server.Mobiles; namespace Server.Gumps { - public enum ResurrectMessage - { - ChaosShrine = 0, - VirtueShrine = 1, - Healer = 2, - Generic = 3 - } + public enum ResurrectMessage + { + ChaosShrine = 0, + VirtueShrine = 1, + Healer = 2, + Generic = 3 + } - public class ResurrectGump : Gump - { - private Mobile m_Healer; - private int m_Price; - private bool m_FromSacrifice; - private double m_HitsScalar; + public class ResurrectGump : Gump + { + private Mobile m_Healer; + private int m_Price; + private bool m_FromSacrifice; + private double m_HitsScalar; - public ResurrectGump(Mobile owner, double hitsScalar) - : this(owner, owner, ResurrectMessage.Generic, false, hitsScalar) - { - } + public ResurrectGump(Mobile owner, double hitsScalar) + : this(owner, owner, ResurrectMessage.Generic, false, hitsScalar) + { + } - public ResurrectGump(Mobile owner, ResurrectMessage msg) : this(owner, owner, msg) - { - } + public ResurrectGump(Mobile owner, ResurrectMessage msg) : this(owner, owner, msg) + { + } - public ResurrectGump(Mobile owner, bool fromSacrifice = false) - : this(owner, owner, ResurrectMessage.Generic, fromSacrifice) - { - } + public ResurrectGump(Mobile owner, bool fromSacrifice = false) + : this(owner, owner, ResurrectMessage.Generic, fromSacrifice) + { + } - public ResurrectGump(Mobile owner, Mobile healer, ResurrectMessage msg = ResurrectMessage.Generic, - bool fromSacrifice = false, double hitsScalar = 0.0) - : base( 100, 0 ) - { - m_Healer = healer; - m_FromSacrifice = fromSacrifice; - m_HitsScalar = hitsScalar; + public ResurrectGump(Mobile owner, Mobile healer, ResurrectMessage msg = ResurrectMessage.Generic, + bool fromSacrifice = false, double hitsScalar = 0.0) + : base( 100, 0 ) + { + m_Healer = healer; + m_FromSacrifice = fromSacrifice; + m_HitsScalar = hitsScalar; - AddPage( 0 ); + AddPage( 0 ); - AddBackground( 0, 0, 400, 350, 2600 ); + AddBackground( 0, 0, 400, 350, 2600 ); - AddHtmlLocalized( 0, 20, 400, 35, 1011022 ); //
Resurrection
+ AddHtmlLocalized( 0, 20, 400, 35, 1011022 ); //
Resurrection
- AddHtmlLocalized( 50, 55, 300, 140, 1011023 + (int)msg, true, true ); /* It is possible for you to be resurrected here by this healer. Do you wish to try?
+ AddHtmlLocalized( 50, 55, 300, 140, 1011023 + (int)msg, true, true ); /* It is possible for you to be resurrected here by this healer. Do you wish to try?
* CONTINUE - You chose to try to come back to life now.
* CANCEL - You prefer to remain a ghost for now. */ - AddButton( 200, 227, 4005, 4007, 0); - AddHtmlLocalized( 235, 230, 110, 35, 1011012 ); // CANCEL + AddButton( 200, 227, 4005, 4007, 0); + AddHtmlLocalized( 235, 230, 110, 35, 1011012 ); // CANCEL - AddButton( 65, 227, 4005, 4007, 1); - AddHtmlLocalized( 100, 230, 110, 35, 1011011 ); // CONTINUE - } + AddButton( 65, 227, 4005, 4007, 1); + AddHtmlLocalized( 100, 230, 110, 35, 1011011 ); // CONTINUE + } - public ResurrectGump( Mobile owner, Mobile healer, int price ) - : base( 150, 50 ) - { - m_Healer = healer; - m_Price = price; + public ResurrectGump( Mobile owner, Mobile healer, int price ) + : base( 150, 50 ) + { + m_Healer = healer; + m_Price = price; - Closable = false; + Closable = false; - AddPage( 0 ); + AddPage( 0 ); - AddImage( 0, 0, 3600 ); + AddImage( 0, 0, 3600 ); - AddImageTiled( 0, 14, 15, 200, 3603 ); - AddImageTiled( 380, 14, 14, 200, 3605 ); + AddImageTiled( 0, 14, 15, 200, 3603 ); + AddImageTiled( 380, 14, 14, 200, 3605 ); - AddImage( 0, 201, 3606 ); + AddImage( 0, 201, 3606 ); - AddImageTiled( 15, 201, 370, 16, 3607 ); - AddImageTiled( 15, 0, 370, 16, 3601 ); + AddImageTiled( 15, 201, 370, 16, 3607 ); + AddImageTiled( 15, 0, 370, 16, 3601 ); - AddImage( 380, 0, 3602 ); + AddImage( 380, 0, 3602 ); - AddImage( 380, 201, 3608 ); + AddImage( 380, 201, 3608 ); - AddImageTiled( 15, 15, 365, 190, 2624 ); + AddImageTiled( 15, 15, 365, 190, 2624 ); - AddRadio( 30, 140, 9727, 9730, true, 1 ); - AddHtmlLocalized( 65, 145, 300, 25, 1060015, 0x7FFF ); // Grudgingly pay the money + AddRadio( 30, 140, 9727, 9730, true, 1 ); + AddHtmlLocalized( 65, 145, 300, 25, 1060015, 0x7FFF ); // Grudgingly pay the money - AddRadio( 30, 175, 9727, 9730, false, 0 ); - AddHtmlLocalized( 65, 178, 300, 25, 1060016, 0x7FFF ); // I'd rather stay dead, you scoundrel!!! + AddRadio( 30, 175, 9727, 9730, false, 0 ); + AddHtmlLocalized( 65, 178, 300, 25, 1060016, 0x7FFF ); // I'd rather stay dead, you scoundrel!!! - AddHtmlLocalized( 30, 20, 360, 35, 1060017, 0x7FFF ); // Wishing to rejoin the living, are you? I can restore your body... for a price of course... + AddHtmlLocalized( 30, 20, 360, 35, 1060017, 0x7FFF ); // Wishing to rejoin the living, are you? I can restore your body... for a price of course... - AddHtmlLocalized( 30, 105, 345, 40, 1060018, 0x5B2D ); // Do you accept the fee, which will be withdrawn from your bank? + AddHtmlLocalized( 30, 105, 345, 40, 1060018, 0x5B2D ); // Do you accept the fee, which will be withdrawn from your bank? - AddImage( 65, 72, 5605 ); + AddImage( 65, 72, 5605 ); - AddImageTiled( 80, 90, 200, 1, 9107 ); - AddImageTiled( 95, 92, 200, 1, 9157 ); + AddImageTiled( 80, 90, 200, 1, 9107 ); + AddImageTiled( 95, 92, 200, 1, 9157 ); - AddLabel( 90, 70, 1645, price.ToString() ); - AddHtmlLocalized( 140, 70, 100, 25, 1023823, 0x7FFF ); // gold coins + AddLabel( 90, 70, 1645, price.ToString() ); + AddHtmlLocalized( 140, 70, 100, 25, 1023823, 0x7FFF ); // gold coins - AddButton( 290, 175, 247, 248, 2 ); + AddButton( 290, 175, 247, 248, 2 ); - AddImageTiled( 15, 14, 365, 1, 9107 ); - AddImageTiled( 380, 14, 1, 190, 9105 ); - AddImageTiled( 15, 205, 365, 1, 9107 ); - AddImageTiled( 15, 14, 1, 190, 9105 ); - AddImageTiled( 0, 0, 395, 1, 9157 ); - AddImageTiled( 394, 0, 1, 217, 9155 ); - AddImageTiled( 0, 216, 395, 1, 9157 ); - AddImageTiled( 0, 0, 1, 217, 9155 ); - } + AddImageTiled( 15, 14, 365, 1, 9107 ); + AddImageTiled( 380, 14, 1, 190, 9105 ); + AddImageTiled( 15, 205, 365, 1, 9107 ); + AddImageTiled( 15, 14, 1, 190, 9105 ); + AddImageTiled( 0, 0, 395, 1, 9157 ); + AddImageTiled( 394, 0, 1, 217, 9155 ); + AddImageTiled( 0, 216, 395, 1, 9157 ); + AddImageTiled( 0, 0, 1, 217, 9155 ); + } - public override void OnResponse( NetState state, RelayInfo info ) - { - Mobile from = state.Mobile; + public override void OnResponse( NetState state, RelayInfo info ) + { + Mobile from = state.Mobile; - from.CloseGump(); + from.CloseGump(); if (info.ButtonID != 1 && info.ButtonID != 2) return; @@ -224,5 +224,5 @@ namespace Server.Gumps if ( from.Alive && m_HitsScalar > 0 ) from.Hits = (int)(from.HitsMax * m_HitsScalar); } - } + } } diff --git a/Projects/Scripts/Gumps/RunebookGump.cs b/Projects/Scripts/Gumps/RunebookGump.cs index dff228d50..845ed5628 100644 --- a/Projects/Scripts/Gumps/RunebookGump.cs +++ b/Projects/Scripts/Gumps/RunebookGump.cs @@ -201,10 +201,7 @@ namespace Server.Gumps AddLabelCropped(145 + half * 160, 60, 115, 17, hue, desc); } - public static bool HasSpell(Mobile from, int spellID) - { - return Spellbook.Find(from, spellID)?.HasSpell(spellID) == true; - } + public static bool HasSpell(Mobile from, int spellID) => Spellbook.Find(from, spellID)?.HasSpell(spellID) == true; public override void OnResponse(NetState state, RelayInfo info) { @@ -410,10 +407,7 @@ namespace Server.Gumps { private Runebook m_Book; - public InternalPrompt(Runebook book) - { - m_Book = book; - } + public InternalPrompt(Runebook book) => m_Book = book; public override void OnResponse(Mobile from, string text) { diff --git a/Projects/Scripts/Gumps/SetSecureLevelGump.cs b/Projects/Scripts/Gumps/SetSecureLevelGump.cs index 2d66ba628..498c4200a 100644 --- a/Projects/Scripts/Gumps/SetSecureLevelGump.cs +++ b/Projects/Scripts/Gumps/SetSecureLevelGump.cs @@ -56,15 +56,9 @@ namespace Server.Gumps AddHtmlLocalized(45, 130 + offset, 150, 20, 1061626, GetColor(SecureLevel.Anyone)); // Anyone } - public int GetColor(SecureLevel level) - { - return m_Info.Level == level ? 0x7F18 : 0x7FFF; - } + public int GetColor(SecureLevel level) => m_Info.Level == level ? 0x7F18 : 0x7FFF; - public int GetFirstID(SecureLevel level) - { - return m_Info.Level == level ? 4006 : 4005; - } + public int GetFirstID(SecureLevel level) => m_Info.Level == level ? 4006 : 4005; public override void OnResponse(NetState state, RelayInfo info) { diff --git a/Projects/Scripts/Gumps/SkillsGump.cs b/Projects/Scripts/Gumps/SkillsGump.cs index 24725e13d..31a4c881d 100644 --- a/Projects/Scripts/Gumps/SkillsGump.cs +++ b/Projects/Scripts/Gumps/SkillsGump.cs @@ -439,10 +439,7 @@ namespace Server.Gumps } } - public int GetButtonID(int type, int index) - { - return 1 + index * 3 + type; - } + public int GetButtonID(int type, int index) => 1 + index * 3 + type; } public class SkillsGumpGroup diff --git a/Projects/Scripts/Gumps/VendorRentalGumps.cs b/Projects/Scripts/Gumps/VendorRentalGumps.cs index 77f4ef986..91c22f341 100644 --- a/Projects/Scripts/Gumps/VendorRentalGumps.cs +++ b/Projects/Scripts/Gumps/VendorRentalGumps.cs @@ -7,602 +7,575 @@ using Server.Multis; namespace Server.Gumps { - public abstract class BaseVendorRentalGump : Gump - { - protected enum GumpType - { - UnlockedContract, - LockedContract, - Offer, - VendorLandlord, - VendorRenter - } + public abstract class BaseVendorRentalGump : Gump + { + protected enum GumpType + { + UnlockedContract, + LockedContract, + Offer, + VendorLandlord, + VendorRenter + } - protected BaseVendorRentalGump( GumpType type, VendorRentalDuration duration, int price, int renewalPrice, - Mobile landlord, Mobile renter, bool landlordRenew, bool renterRenew, bool renew ) : base( 100, 100 ) - { - if ( type == GumpType.Offer ) - Closable = false; + protected BaseVendorRentalGump( GumpType type, VendorRentalDuration duration, int price, int renewalPrice, + Mobile landlord, Mobile renter, bool landlordRenew, bool renterRenew, bool renew ) : base( 100, 100 ) + { + if ( type == GumpType.Offer ) + Closable = false; - AddPage( 0 ); + AddPage( 0 ); - AddImage( 0, 0, 0x1F40 ); - AddImageTiled( 20, 37, 300, 308, 0x1F42 ); - AddImage( 20, 325, 0x1F43 ); + AddImage( 0, 0, 0x1F40 ); + AddImageTiled( 20, 37, 300, 308, 0x1F42 ); + AddImage( 20, 325, 0x1F43 ); - AddImage( 35, 8, 0x39 ); - AddImageTiled( 65, 8, 257, 10, 0x3A ); - AddImage( 290, 8, 0x3B ); + AddImage( 35, 8, 0x39 ); + AddImageTiled( 65, 8, 257, 10, 0x3A ); + AddImage( 290, 8, 0x3B ); - AddImageTiled( 70, 55, 230, 2, 0x23C5 ); + AddImageTiled( 70, 55, 230, 2, 0x23C5 ); - AddImage( 32, 33, 0x2635 ); - AddHtmlLocalized( 70, 35, 270, 20, 1062353, 0x1 ); // Vendor Rental Contract + AddImage( 32, 33, 0x2635 ); + AddHtmlLocalized( 70, 35, 270, 20, 1062353, 0x1 ); // Vendor Rental Contract - AddPage( 1 ); + AddPage( 1 ); - if ( type != GumpType.UnlockedContract ) - { - AddImage( 65, 60, 0x827 ); - AddHtmlLocalized( 79, 58, 270, 20, 1062370, 0x1 ); // Landlord: - AddLabel( 150, 58, 0x64, landlord != null ? landlord.Name : "" ); + if ( type != GumpType.UnlockedContract ) + { + AddImage( 65, 60, 0x827 ); + AddHtmlLocalized( 79, 58, 270, 20, 1062370, 0x1 ); // Landlord: + AddLabel( 150, 58, 0x64, landlord != null ? landlord.Name : "" ); - AddImageTiled( 70, 80, 230, 2, 0x23C5 ); - } + AddImageTiled( 70, 80, 230, 2, 0x23C5 ); + } - if ( type == GumpType.UnlockedContract || type == GumpType.LockedContract ) - AddButton( 30, 96, 0x15E1, 0x15E5, 0, GumpButtonType.Page, 2 ); - AddHtmlLocalized( 50, 95, 150, 20, 1062354, 0x1 ); // Contract Length - AddHtmlLocalized( 230, 95, 270, 20, duration.Name, 0x1 ); + if ( type == GumpType.UnlockedContract || type == GumpType.LockedContract ) + AddButton( 30, 96, 0x15E1, 0x15E5, 0, GumpButtonType.Page, 2 ); + AddHtmlLocalized( 50, 95, 150, 20, 1062354, 0x1 ); // Contract Length + AddHtmlLocalized( 230, 95, 270, 20, duration.Name, 0x1 ); - if ( type == GumpType.UnlockedContract || type == GumpType.LockedContract ) - AddButton( 30, 116, 0x15E1, 0x15E5, 1); - AddHtmlLocalized( 50, 115, 150, 20, 1062356, 0x1 ); // Price Per Rental - AddLabel( 230, 115, 0x64, price > 0 ? price.ToString() : "FREE" ); + if ( type == GumpType.UnlockedContract || type == GumpType.LockedContract ) + AddButton( 30, 116, 0x15E1, 0x15E5, 1); + AddHtmlLocalized( 50, 115, 150, 20, 1062356, 0x1 ); // Price Per Rental + AddLabel( 230, 115, 0x64, price > 0 ? price.ToString() : "FREE" ); - AddImageTiled( 50, 160, 250, 2, 0x23BF ); + AddImageTiled( 50, 160, 250, 2, 0x23BF ); - if ( type == GumpType.Offer ) - { - AddButton( 67, 180, 0x482, 0x483, 2); - AddHtmlLocalized( 100, 180, 270, 20, 1049011, 0x28 ); // I accept! + if ( type == GumpType.Offer ) + { + AddButton( 67, 180, 0x482, 0x483, 2); + AddHtmlLocalized( 100, 180, 270, 20, 1049011, 0x28 ); // I accept! - AddButton( 67, 210, 0x47F, 0x480, 0); - AddHtmlLocalized( 100, 210, 270, 20, 1049012, 0x28 ); // No thanks, I decline. - } - else - { - AddImage( 49, 170, 0x61 ); - AddHtmlLocalized( 60, 170, 250, 20, 1062355, 0x1 ); // Renew On Expiration? + AddButton( 67, 210, 0x47F, 0x480, 0); + AddHtmlLocalized( 100, 210, 270, 20, 1049012, 0x28 ); // No thanks, I decline. + } + else + { + AddImage( 49, 170, 0x61 ); + AddHtmlLocalized( 60, 170, 250, 20, 1062355, 0x1 ); // Renew On Expiration? - if ( type == GumpType.LockedContract || type == GumpType.UnlockedContract || type == GumpType.VendorLandlord ) - AddButton( 30, 192, 0x15E1, 0x15E5, 3); - AddHtmlLocalized( 85, 190, 250, 20, 1062359, 0x1 ); // Landlord: - AddHtmlLocalized( 230, 190, 270, 20, landlordRenew ? 1049717 : 1049718, 0x1 ); // YES / NO + if ( type == GumpType.LockedContract || type == GumpType.UnlockedContract || type == GumpType.VendorLandlord ) + AddButton( 30, 192, 0x15E1, 0x15E5, 3); + AddHtmlLocalized( 85, 190, 250, 20, 1062359, 0x1 ); // Landlord: + AddHtmlLocalized( 230, 190, 270, 20, landlordRenew ? 1049717 : 1049718, 0x1 ); // YES / NO - if ( type == GumpType.VendorRenter ) - AddButton( 30, 212, 0x15E1, 0x15E5, 4); - AddHtmlLocalized( 85, 210, 250, 20, 1062360, 0x1 ); // Renter: - AddHtmlLocalized( 230, 210, 270, 20, renterRenew ? 1049717 : 1049718, 0x1 ); // YES / NO + if ( type == GumpType.VendorRenter ) + AddButton( 30, 212, 0x15E1, 0x15E5, 4); + AddHtmlLocalized( 85, 210, 250, 20, 1062360, 0x1 ); // Renter: + AddHtmlLocalized( 230, 210, 270, 20, renterRenew ? 1049717 : 1049718, 0x1 ); // YES / NO - if ( renew ) - { - AddImage( 49, 233, 0x939 ); - AddHtmlLocalized( 70, 230, 250, 20, 1062482, 0x1 ); // Contract WILL renew - } - else - { - AddImage( 49, 233, 0x938 ); - AddHtmlLocalized( 70, 230, 250, 20, 1062483, 0x1 ); // Contract WILL NOT renew - } - } + if ( renew ) + { + AddImage( 49, 233, 0x939 ); + AddHtmlLocalized( 70, 230, 250, 20, 1062482, 0x1 ); // Contract WILL renew + } + else + { + AddImage( 49, 233, 0x938 ); + AddHtmlLocalized( 70, 230, 250, 20, 1062483, 0x1 ); // Contract WILL NOT renew + } + } - AddImageTiled( 30, 283, 257, 30, 0x5D ); - AddImage( 285, 283, 0x5E ); - AddImage( 20, 288, 0x232C ); + AddImageTiled( 30, 283, 257, 30, 0x5D ); + AddImage( 285, 283, 0x5E ); + AddImage( 20, 288, 0x232C ); - if ( type == GumpType.LockedContract ) - { - AddButton( 67, 295, 0x15E1, 0x15E5, 5); - AddHtmlLocalized( 85, 294, 270, 20, 1062358, 0x28 ); // Offer Contract To Someone - } - else if ( type == GumpType.VendorLandlord || type == GumpType.VendorRenter ) - { - if ( type == GumpType.VendorLandlord ) - AddButton( 30, 250, 0x15E1, 0x15E1, 6); - AddHtmlLocalized( 85, 250, 250, 20, 1062499, 0x1 ); // Renewal Price - AddLabel( 230, 250, 0x64, renewalPrice.ToString() ); + if ( type == GumpType.LockedContract ) + { + AddButton( 67, 295, 0x15E1, 0x15E5, 5); + AddHtmlLocalized( 85, 294, 270, 20, 1062358, 0x28 ); // Offer Contract To Someone + } + else if ( type == GumpType.VendorLandlord || type == GumpType.VendorRenter ) + { + if ( type == GumpType.VendorLandlord ) + AddButton( 30, 250, 0x15E1, 0x15E1, 6); + AddHtmlLocalized( 85, 250, 250, 20, 1062499, 0x1 ); // Renewal Price + AddLabel( 230, 250, 0x64, renewalPrice.ToString() ); - AddHtmlLocalized( 60, 294, 270, 20, 1062369, 0x1 ); // Renter: - AddLabel( 120, 293, 0x64, renter != null ? renter.Name : "" ); - } + AddHtmlLocalized( 60, 294, 270, 20, 1062369, 0x1 ); // Renter: + AddLabel( 120, 293, 0x64, renter != null ? renter.Name : "" ); + } - if ( type == GumpType.UnlockedContract || type == GumpType.LockedContract ) - { - AddPage( 2 ); + if ( type == GumpType.UnlockedContract || type == GumpType.LockedContract ) + { + AddPage( 2 ); - for ( int i = 0; i < VendorRentalDuration.Instances.Length; i++ ) - { - VendorRentalDuration durationItem = VendorRentalDuration.Instances[i]; + for ( int i = 0; i < VendorRentalDuration.Instances.Length; i++ ) + { + VendorRentalDuration durationItem = VendorRentalDuration.Instances[i]; - AddButton( 30, 76 + i * 20, 0x15E1, 0x15E5, 0x10 | i, GumpButtonType.Reply, 1 ); - AddHtmlLocalized( 50, 75 + i * 20, 150, 20, durationItem.Name, 0x1 ); - } - } - } + AddButton( 30, 76 + i * 20, 0x15E1, 0x15E5, 0x10 | i, GumpButtonType.Reply, 1 ); + AddHtmlLocalized( 50, 75 + i * 20, 150, 20, durationItem.Name, 0x1 ); + } + } + } - public override void OnResponse( NetState sender, RelayInfo info ) - { - Mobile from = sender.Mobile; + public override void OnResponse( NetState sender, RelayInfo info ) + { + Mobile from = sender.Mobile; - if ( !IsValidResponse( from ) ) - return; + if ( !IsValidResponse( from ) ) + return; - if ( (info.ButtonID & 0x10) != 0 ) // Contract duration - { - int index = info.ButtonID & 0xF; + if ( (info.ButtonID & 0x10) != 0 ) // Contract duration + { + int index = info.ButtonID & 0xF; - if ( index < VendorRentalDuration.Instances.Length ) - { - SetContractDuration( from, VendorRentalDuration.Instances[index] ); - } - } - else - { - switch ( info.ButtonID ) - { - case 1: // Price Per Rental - SetPricePerRental( from ); - break; + if ( index < VendorRentalDuration.Instances.Length ) + { + SetContractDuration( from, VendorRentalDuration.Instances[index] ); + } + } + else + { + switch ( info.ButtonID ) + { + case 1: // Price Per Rental + SetPricePerRental( from ); + break; - case 2: // Accept offer - AcceptOffer( from ); - break; + case 2: // Accept offer + AcceptOffer( from ); + break; - case 3: // Renew on expiration - landlord - LandlordRenewOnExpiration( from ); - break; + case 3: // Renew on expiration - landlord + LandlordRenewOnExpiration( from ); + break; - case 4: // Renew on expiration - renter - RenterRenewOnExpiration( from ); - break; + case 4: // Renew on expiration - renter + RenterRenewOnExpiration( from ); + break; - case 5: // Offer Contract To Someone - OfferContract( from ); - break; + case 5: // Offer Contract To Someone + OfferContract( from ); + break; - case 6: // Renewal price - SetRenewalPrice( from ); - break; + case 6: // Renewal price + SetRenewalPrice( from ); + break; - default: - Cancel( from ); - break; - } - } - } + default: + Cancel( from ); + break; + } + } + } - protected abstract bool IsValidResponse( Mobile from ); + protected abstract bool IsValidResponse( Mobile from ); - protected virtual void SetContractDuration( Mobile from, VendorRentalDuration duration ) - { - } + protected virtual void SetContractDuration( Mobile from, VendorRentalDuration duration ) + { + } - protected virtual void SetPricePerRental( Mobile from ) - { - } + protected virtual void SetPricePerRental( Mobile from ) + { + } - protected virtual void AcceptOffer( Mobile from ) - { - } + protected virtual void AcceptOffer( Mobile from ) + { + } - protected virtual void LandlordRenewOnExpiration( Mobile from ) - { - } + protected virtual void LandlordRenewOnExpiration( Mobile from ) + { + } - protected virtual void RenterRenewOnExpiration( Mobile from ) - { - } + protected virtual void RenterRenewOnExpiration( Mobile from ) + { + } - protected virtual void OfferContract( Mobile from ) - { - } + protected virtual void OfferContract( Mobile from ) + { + } - protected virtual void SetRenewalPrice( Mobile from ) - { - } + protected virtual void SetRenewalPrice( Mobile from ) + { + } - protected virtual void Cancel( Mobile from ) - { - } - } + protected virtual void Cancel( Mobile from ) + { + } + } - public class VendorRentalContractGump : BaseVendorRentalGump - { - private VendorRentalContract m_Contract; + public class VendorRentalContractGump : BaseVendorRentalGump + { + private VendorRentalContract m_Contract; - public VendorRentalContractGump( VendorRentalContract contract, Mobile from ) : base( - contract.IsLockedDown ? GumpType.LockedContract : GumpType.UnlockedContract, contract.Duration, - contract.Price, contract.Price, from, null, contract.LandlordRenew, false, false ) - { - m_Contract = contract; - } + public VendorRentalContractGump( VendorRentalContract contract, Mobile from ) : base( + contract.IsLockedDown ? GumpType.LockedContract : GumpType.UnlockedContract, contract.Duration, + contract.Price, contract.Price, from, null, contract.LandlordRenew, false, false ) => + m_Contract = contract; - protected override bool IsValidResponse( Mobile from ) - { - return m_Contract.IsUsableBy( from, true, true, true, true ); - } + protected override bool IsValidResponse( Mobile from ) => m_Contract.IsUsableBy( from, true, true, true, true ); - protected override void SetContractDuration( Mobile from, VendorRentalDuration duration ) - { - m_Contract.Duration = duration; + protected override void SetContractDuration( Mobile from, VendorRentalDuration duration ) + { + m_Contract.Duration = duration; - from.SendGump( new VendorRentalContractGump( m_Contract, from ) ); - } + from.SendGump( new VendorRentalContractGump( m_Contract, from ) ); + } - protected override void SetPricePerRental( Mobile from ) - { - from.SendLocalizedMessage( 1062365 ); // Please enter the amount of gold that should be charged for this contract (ESC to cancel): - from.Prompt = new PricePerRentalPrompt( m_Contract ); - } + protected override void SetPricePerRental( Mobile from ) + { + from.SendLocalizedMessage( 1062365 ); // Please enter the amount of gold that should be charged for this contract (ESC to cancel): + from.Prompt = new PricePerRentalPrompt( m_Contract ); + } - protected override void LandlordRenewOnExpiration( Mobile from ) - { - m_Contract.LandlordRenew = !m_Contract.LandlordRenew; + protected override void LandlordRenewOnExpiration( Mobile from ) + { + m_Contract.LandlordRenew = !m_Contract.LandlordRenew; - from.SendGump( new VendorRentalContractGump( m_Contract, from ) ); - } + from.SendGump( new VendorRentalContractGump( m_Contract, from ) ); + } - protected override void OfferContract( Mobile from ) - { - if ( m_Contract.IsLandlord( from ) ) - { - from.SendLocalizedMessage( 1062371 ); // Please target the person you wish to offer this contract to. - from.Target = new OfferContractTarget( m_Contract ); - } - } + protected override void OfferContract( Mobile from ) + { + if ( m_Contract.IsLandlord( from ) ) + { + from.SendLocalizedMessage( 1062371 ); // Please target the person you wish to offer this contract to. + from.Target = new OfferContractTarget( m_Contract ); + } + } - private class PricePerRentalPrompt : Prompt - { - private VendorRentalContract m_Contract; + private class PricePerRentalPrompt : Prompt + { + private VendorRentalContract m_Contract; - public PricePerRentalPrompt( VendorRentalContract contract ) - { - m_Contract = contract; - } + public PricePerRentalPrompt( VendorRentalContract contract ) => m_Contract = contract; - public override void OnResponse( Mobile from, string text ) - { - if ( !m_Contract.IsUsableBy( from, true, true, true, true ) ) - return; + public override void OnResponse( Mobile from, string text ) + { + if ( !m_Contract.IsUsableBy( from, true, true, true, true ) ) + return; - text = text.Trim(); + text = text.Trim(); if ( !int.TryParse( text, out int price ) ) price = -1; - if ( price < 0 ) - { - from.SendLocalizedMessage( 1062485 ); // Invalid entry. Rental fee set to 0. - m_Contract.Price = 0; - } - else if ( price > 5000000 ) - { - m_Contract.Price = 5000000; - } - else - { - m_Contract.Price = price; - } + if ( price < 0 ) + { + from.SendLocalizedMessage( 1062485 ); // Invalid entry. Rental fee set to 0. + m_Contract.Price = 0; + } + else if ( price > 5000000 ) + { + m_Contract.Price = 5000000; + } + else + { + m_Contract.Price = price; + } - from.SendGump( new VendorRentalContractGump( m_Contract, from ) ); - } + from.SendGump( new VendorRentalContractGump( m_Contract, from ) ); + } - public override void OnCancel( Mobile from ) - { - if ( m_Contract.IsUsableBy( from, true, true, true, true ) ) - from.SendGump( new VendorRentalContractGump( m_Contract, from ) ); - } - } + public override void OnCancel( Mobile from ) + { + if ( m_Contract.IsUsableBy( from, true, true, true, true ) ) + from.SendGump( new VendorRentalContractGump( m_Contract, from ) ); + } + } - private class OfferContractTarget : Target - { - private VendorRentalContract m_Contract; + private class OfferContractTarget : Target + { + private VendorRentalContract m_Contract; - public OfferContractTarget( VendorRentalContract contract ) : base( -1, false, TargetFlags.None ) - { - m_Contract = contract; - } + public OfferContractTarget( VendorRentalContract contract ) : base( -1, false, TargetFlags.None ) => m_Contract = contract; - protected override void OnTarget( Mobile from, object targeted ) - { - if ( !m_Contract.IsUsableBy( from, true, false, true, true ) ) - return; + protected override void OnTarget( Mobile from, object targeted ) + { + if ( !m_Contract.IsUsableBy( from, true, false, true, true ) ) + return; - if ( !(targeted is Mobile mob) || !mob.Player || !mob.Alive || mob == from ) - { - from.SendLocalizedMessage(1071984); //That is not a valid target for a rental contract! - } - else if ( !mob.InRange( m_Contract, 5 ) ) - { - from.SendLocalizedMessage( 501853 ); // Target is too far away. - } - else - { - from.SendLocalizedMessage( 1062372 ); // Please wait while that person considers your offer. + if ( !(targeted is Mobile mob) || !mob.Player || !mob.Alive || mob == from ) + { + from.SendLocalizedMessage(1071984); //That is not a valid target for a rental contract! + } + else if ( !mob.InRange( m_Contract, 5 ) ) + { + from.SendLocalizedMessage( 501853 ); // Target is too far away. + } + else + { + from.SendLocalizedMessage( 1062372 ); // Please wait while that person considers your offer. - mob.SendLocalizedMessage( 1062373, from.Name ); // ~1_NAME~ is offering you a vendor rental. If you choose to accept this offer, you have 30 seconds to do so. - mob.SendGump( new VendorRentalOfferGump( m_Contract, from ) ); + mob.SendLocalizedMessage( 1062373, from.Name ); // ~1_NAME~ is offering you a vendor rental. If you choose to accept this offer, you have 30 seconds to do so. + mob.SendGump( new VendorRentalOfferGump( m_Contract, from ) ); - m_Contract.Offeree = mob; - } - } + m_Contract.Offeree = mob; + } + } - protected override void OnTargetCancel( Mobile from, TargetCancelType cancelType ) - { - from.SendLocalizedMessage( 1062380 ); // You decide against offering the contract to anyone. - } - } - } + protected override void OnTargetCancel( Mobile from, TargetCancelType cancelType ) + { + from.SendLocalizedMessage( 1062380 ); // You decide against offering the contract to anyone. + } + } + } - public class VendorRentalOfferGump : BaseVendorRentalGump - { - private VendorRentalContract m_Contract; - private Mobile m_Landlord; + public class VendorRentalOfferGump : BaseVendorRentalGump + { + private VendorRentalContract m_Contract; + private Mobile m_Landlord; - public VendorRentalOfferGump( VendorRentalContract contract, Mobile landlord ) : base( - GumpType.Offer, contract.Duration, contract.Price, contract.Price, - landlord, null, contract.LandlordRenew, false, false ) - { - m_Contract = contract; - m_Landlord = landlord; - } + public VendorRentalOfferGump( VendorRentalContract contract, Mobile landlord ) : base( + GumpType.Offer, contract.Duration, contract.Price, contract.Price, + landlord, null, contract.LandlordRenew, false, false ) + { + m_Contract = contract; + m_Landlord = landlord; + } - protected override bool IsValidResponse( Mobile from ) - { - return m_Contract.IsUsableBy( m_Landlord, true, false, false, false ) && from.CheckAlive() && m_Contract.Offeree == from; - } + protected override bool IsValidResponse( Mobile from ) => m_Contract.IsUsableBy( m_Landlord, true, false, false, false ) && from.CheckAlive() && m_Contract.Offeree == from; - protected override void AcceptOffer( Mobile from ) - { - m_Contract.Offeree = null; + protected override void AcceptOffer( Mobile from ) + { + m_Contract.Offeree = null; - if ( !m_Contract.Map.CanFit( m_Contract.Location, 16, false, false ) ) - { - m_Landlord.SendLocalizedMessage( 1062486 ); // A vendor cannot exist at that location. Please try again. - return; - } + if ( !m_Contract.Map.CanFit( m_Contract.Location, 16, false, false ) ) + { + m_Landlord.SendLocalizedMessage( 1062486 ); // A vendor cannot exist at that location. Please try again. + return; + } - BaseHouse house = BaseHouse.FindHouseAt( m_Contract ); - if ( house == null ) - return; + BaseHouse house = BaseHouse.FindHouseAt( m_Contract ); + if ( house == null ) + return; - int price = m_Contract.Price; - int goldToGive; + int price = m_Contract.Price; + int goldToGive; - if ( price > 0 ) - { - if ( Banker.Withdraw( from, price ) ) - { - from.SendLocalizedMessage( 1060398, price.ToString() ); // ~1_AMOUNT~ gold has been withdrawn from your bank box. + if ( price > 0 ) + { + if ( Banker.Withdraw( from, price ) ) + { + from.SendLocalizedMessage( 1060398, price.ToString() ); // ~1_AMOUNT~ gold has been withdrawn from your bank box. - int depositedGold = Banker.DepositUpTo( m_Landlord, price ); - goldToGive = price - depositedGold; + int depositedGold = Banker.DepositUpTo( m_Landlord, price ); + goldToGive = price - depositedGold; - if ( depositedGold > 0 ) - m_Landlord.SendLocalizedMessage( 1060397, price.ToString() ); // ~1_AMOUNT~ gold has been deposited into your bank box. + if ( depositedGold > 0 ) + m_Landlord.SendLocalizedMessage( 1060397, price.ToString() ); // ~1_AMOUNT~ gold has been deposited into your bank box. - if ( goldToGive > 0 ) - m_Landlord.SendLocalizedMessage( 500390 ); // Your bank box is full. - } - else - { - from.SendLocalizedMessage( 1062378 ); // You do not have enough gold in your bank account to cover the cost of the contract. - m_Landlord.SendLocalizedMessage( 1062374, from.Name ); // ~1_NAME~ has declined your vendor rental offer. + if ( goldToGive > 0 ) + m_Landlord.SendLocalizedMessage( 500390 ); // Your bank box is full. + } + else + { + from.SendLocalizedMessage( 1062378 ); // You do not have enough gold in your bank account to cover the cost of the contract. + m_Landlord.SendLocalizedMessage( 1062374, from.Name ); // ~1_NAME~ has declined your vendor rental offer. - return; - } - } - else - { - goldToGive = 0; - } + return; + } + } + else + { + goldToGive = 0; + } - PlayerVendor vendor = new RentedVendor( from, house, m_Contract.Duration, price, m_Contract.LandlordRenew, goldToGive ); - vendor.MoveToWorld( m_Contract.Location, m_Contract.Map ); + PlayerVendor vendor = new RentedVendor( from, house, m_Contract.Duration, price, m_Contract.LandlordRenew, goldToGive ); + vendor.MoveToWorld( m_Contract.Location, m_Contract.Map ); - m_Contract.Delete(); + m_Contract.Delete(); - from.SendLocalizedMessage( 1062377 ); // You have accepted the offer and now own a vendor in this house. Rental contract options and details may be viewed on this vendor via the 'Contract Options' context menu. - m_Landlord.SendLocalizedMessage( 1062376, from.Name ); // ~1_NAME~ has accepted your vendor rental offer. Rental contract details and options may be viewed on this vendor via the 'Contract Options' context menu. - } + from.SendLocalizedMessage( 1062377 ); // You have accepted the offer and now own a vendor in this house. Rental contract options and details may be viewed on this vendor via the 'Contract Options' context menu. + m_Landlord.SendLocalizedMessage( 1062376, from.Name ); // ~1_NAME~ has accepted your vendor rental offer. Rental contract details and options may be viewed on this vendor via the 'Contract Options' context menu. + } - protected override void Cancel( Mobile from ) - { - m_Contract.Offeree = null; + protected override void Cancel( Mobile from ) + { + m_Contract.Offeree = null; - from.SendLocalizedMessage( 1062375 ); // You decline the offer for a vendor space rental. - m_Landlord.SendLocalizedMessage( 1062374, from.Name ); // ~1_NAME~ has declined your vendor rental offer. - } - } + from.SendLocalizedMessage( 1062375 ); // You decline the offer for a vendor space rental. + m_Landlord.SendLocalizedMessage( 1062374, from.Name ); // ~1_NAME~ has declined your vendor rental offer. + } + } - public class RenterVendorRentalGump : BaseVendorRentalGump - { - private RentedVendor m_Vendor; + public class RenterVendorRentalGump : BaseVendorRentalGump + { + private RentedVendor m_Vendor; - public RenterVendorRentalGump( RentedVendor vendor ) : base( - GumpType.VendorRenter, vendor.RentalDuration, vendor.RentalPrice, vendor.RenewalPrice, - vendor.Landlord, vendor.Owner, vendor.LandlordRenew, vendor.RenterRenew, vendor.Renew ) - { - m_Vendor = vendor; - } + public RenterVendorRentalGump( RentedVendor vendor ) : base( + GumpType.VendorRenter, vendor.RentalDuration, vendor.RentalPrice, vendor.RenewalPrice, + vendor.Landlord, vendor.Owner, vendor.LandlordRenew, vendor.RenterRenew, vendor.Renew ) => + m_Vendor = vendor; - protected override bool IsValidResponse( Mobile from ) - { - return m_Vendor.CanInteractWith( from, true ); - } + protected override bool IsValidResponse( Mobile from ) => m_Vendor.CanInteractWith( from, true ); - protected override void RenterRenewOnExpiration( Mobile from ) - { - m_Vendor.RenterRenew = !m_Vendor.RenterRenew; + protected override void RenterRenewOnExpiration( Mobile from ) + { + m_Vendor.RenterRenew = !m_Vendor.RenterRenew; - from.SendGump( new RenterVendorRentalGump( m_Vendor ) ); - } - } + from.SendGump( new RenterVendorRentalGump( m_Vendor ) ); + } + } - public class LandlordVendorRentalGump : BaseVendorRentalGump - { - private RentedVendor m_Vendor; + public class LandlordVendorRentalGump : BaseVendorRentalGump + { + private RentedVendor m_Vendor; - public LandlordVendorRentalGump( RentedVendor vendor ) : base( - GumpType.VendorLandlord, vendor.RentalDuration, vendor.RentalPrice, vendor.RenewalPrice, - vendor.Landlord, vendor.Owner, vendor.LandlordRenew, vendor.RenterRenew, vendor.Renew ) - { - m_Vendor = vendor; - } + public LandlordVendorRentalGump( RentedVendor vendor ) : base( + GumpType.VendorLandlord, vendor.RentalDuration, vendor.RentalPrice, vendor.RenewalPrice, + vendor.Landlord, vendor.Owner, vendor.LandlordRenew, vendor.RenterRenew, vendor.Renew ) => + m_Vendor = vendor; - protected override bool IsValidResponse( Mobile from ) - { - return m_Vendor.CanInteractWith( from, false ) && m_Vendor.IsLandlord( from ); - } + protected override bool IsValidResponse( Mobile from ) => m_Vendor.CanInteractWith( from, false ) && m_Vendor.IsLandlord( from ); - protected override void LandlordRenewOnExpiration( Mobile from ) - { - m_Vendor.LandlordRenew = !m_Vendor.LandlordRenew; + protected override void LandlordRenewOnExpiration( Mobile from ) + { + m_Vendor.LandlordRenew = !m_Vendor.LandlordRenew; - from.SendGump( new LandlordVendorRentalGump( m_Vendor ) ); - } + from.SendGump( new LandlordVendorRentalGump( m_Vendor ) ); + } - protected override void SetRenewalPrice( Mobile from ) - { - from.SendLocalizedMessage( 1062500 ); // Enter contract renewal price: + protected override void SetRenewalPrice( Mobile from ) + { + from.SendLocalizedMessage( 1062500 ); // Enter contract renewal price: - from.Prompt = new ContractRenewalPricePrompt( m_Vendor ); - } + from.Prompt = new ContractRenewalPricePrompt( m_Vendor ); + } - private class ContractRenewalPricePrompt : Prompt - { - private RentedVendor m_Vendor; + private class ContractRenewalPricePrompt : Prompt + { + private RentedVendor m_Vendor; - public ContractRenewalPricePrompt( RentedVendor vendor ) - { - m_Vendor = vendor; - } + public ContractRenewalPricePrompt( RentedVendor vendor ) => m_Vendor = vendor; - public override void OnResponse( Mobile from, string text ) - { - if ( !m_Vendor.CanInteractWith( from, false ) || !m_Vendor.IsLandlord( from ) ) - return; + public override void OnResponse( Mobile from, string text ) + { + if ( !m_Vendor.CanInteractWith( from, false ) || !m_Vendor.IsLandlord( from ) ) + return; - text = text.Trim(); + text = text.Trim(); if ( !int.TryParse( text, out int price ) ) price = -1; - if ( price < 0 ) - { - from.SendLocalizedMessage( 1062485 ); // Invalid entry. Rental fee set to 0. - m_Vendor.RenewalPrice = 0; - } - else if ( price > 5000000 ) - { - m_Vendor.RenewalPrice = 5000000; - } - else - { - m_Vendor.RenewalPrice = price; - } + if ( price < 0 ) + { + from.SendLocalizedMessage( 1062485 ); // Invalid entry. Rental fee set to 0. + m_Vendor.RenewalPrice = 0; + } + else if ( price > 5000000 ) + { + m_Vendor.RenewalPrice = 5000000; + } + else + { + m_Vendor.RenewalPrice = price; + } - m_Vendor.RenterRenew = false; + m_Vendor.RenterRenew = false; - from.SendGump( new LandlordVendorRentalGump( m_Vendor ) ); - } + from.SendGump( new LandlordVendorRentalGump( m_Vendor ) ); + } - public override void OnCancel( Mobile from ) - { - if ( m_Vendor.CanInteractWith( from, false ) && m_Vendor.IsLandlord( from ) ) - from.SendGump( new LandlordVendorRentalGump( m_Vendor ) ); - } - } - } + public override void OnCancel( Mobile from ) + { + if ( m_Vendor.CanInteractWith( from, false ) && m_Vendor.IsLandlord( from ) ) + from.SendGump( new LandlordVendorRentalGump( m_Vendor ) ); + } + } + } - public class VendorRentalRefundGump : Gump - { - private RentedVendor m_Vendor; - private Mobile m_Landlord; - private int m_RefundAmount; + public class VendorRentalRefundGump : Gump + { + private RentedVendor m_Vendor; + private Mobile m_Landlord; + private int m_RefundAmount; - public VendorRentalRefundGump( RentedVendor vendor, Mobile landlord, int refundAmount ) : base( 50, 50 ) - { - m_Vendor = vendor; - m_Landlord = landlord; - m_RefundAmount = refundAmount; + public VendorRentalRefundGump( RentedVendor vendor, Mobile landlord, int refundAmount ) : base( 50, 50 ) + { + m_Vendor = vendor; + m_Landlord = landlord; + m_RefundAmount = refundAmount; - AddBackground( 0, 0, 420, 320, 0x13BE ); + AddBackground( 0, 0, 420, 320, 0x13BE ); - AddImageTiled( 10, 10, 400, 300, 0xA40 ); - AddAlphaRegion( 10, 10, 400, 300 ); + AddImageTiled( 10, 10, 400, 300, 0xA40 ); + AddAlphaRegion( 10, 10, 400, 300 ); - /* The landlord for this vendor is offering you a partial refund of your rental fee - * in exchange for immediate termination of your rental contract.

- * - * If you accept this offer, the vendor will be immediately dismissed. You will then - * be able to claim the inventory and any funds the vendor may be holding for you via - * a context menu on the house sign for this house. - */ - AddHtmlLocalized( 10, 10, 400, 150, 1062501, 0x7FFF, false, true ); + /* The landlord for this vendor is offering you a partial refund of your rental fee + * in exchange for immediate termination of your rental contract.

+ * + * If you accept this offer, the vendor will be immediately dismissed. You will then + * be able to claim the inventory and any funds the vendor may be holding for you via + * a context menu on the house sign for this house. + */ + AddHtmlLocalized( 10, 10, 400, 150, 1062501, 0x7FFF, false, true ); - AddHtmlLocalized( 10, 180, 150, 20, 1062508, 0x7FFF ); // Vendor Name: - AddLabel( 160, 180, 0x480, vendor.Name ); + AddHtmlLocalized( 10, 180, 150, 20, 1062508, 0x7FFF ); // Vendor Name: + AddLabel( 160, 180, 0x480, vendor.Name ); - AddHtmlLocalized( 10, 200, 150, 20, 1062509, 0x7FFF ); // Shop Name: - AddLabel( 160, 200, 0x480, vendor.ShopName ); + AddHtmlLocalized( 10, 200, 150, 20, 1062509, 0x7FFF ); // Shop Name: + AddLabel( 160, 200, 0x480, vendor.ShopName ); - AddHtmlLocalized( 10, 220, 150, 20, 1062510, 0x7FFF ); // Refund Amount: - AddLabel( 160, 220, 0x480, refundAmount.ToString() ); + AddHtmlLocalized( 10, 220, 150, 20, 1062510, 0x7FFF ); // Refund Amount: + AddLabel( 160, 220, 0x480, refundAmount.ToString() ); - AddButton( 10, 268, 0xFA5, 0xFA7, 1); - AddHtmlLocalized( 45, 268, 350, 20, 1062511, 0x7FFF ); // Agree, and dismiss vendor + AddButton( 10, 268, 0xFA5, 0xFA7, 1); + AddHtmlLocalized( 45, 268, 350, 20, 1062511, 0x7FFF ); // Agree, and dismiss vendor - AddButton( 10, 288, 0xFA5, 0xFA7, 0); - AddHtmlLocalized( 45, 288, 350, 20, 1062512, 0x7FFF ); // No, I want to keep my vendor - } + AddButton( 10, 288, 0xFA5, 0xFA7, 0); + AddHtmlLocalized( 45, 288, 350, 20, 1062512, 0x7FFF ); // No, I want to keep my vendor + } - public override void OnResponse( NetState sender, RelayInfo info ) - { - Mobile from = sender.Mobile; + public override void OnResponse( NetState sender, RelayInfo info ) + { + Mobile from = sender.Mobile; - if ( !m_Vendor.CanInteractWith( from, true ) || !m_Vendor.CanInteractWith( m_Landlord, false ) || !m_Vendor.IsLandlord( m_Landlord ) ) - return; + if ( !m_Vendor.CanInteractWith( from, true ) || !m_Vendor.CanInteractWith( m_Landlord, false ) || !m_Vendor.IsLandlord( m_Landlord ) ) + return; - if ( info.ButtonID == 1 ) - { - if ( Banker.Withdraw( m_Landlord, m_RefundAmount ) ) - { - m_Landlord.SendLocalizedMessage( 1060398, m_RefundAmount.ToString() ); // ~1_AMOUNT~ gold has been withdrawn from your bank box. + if ( info.ButtonID == 1 ) + { + if ( Banker.Withdraw( m_Landlord, m_RefundAmount ) ) + { + m_Landlord.SendLocalizedMessage( 1060398, m_RefundAmount.ToString() ); // ~1_AMOUNT~ gold has been withdrawn from your bank box. - int depositedGold = Banker.DepositUpTo( from, m_RefundAmount ); + int depositedGold = Banker.DepositUpTo( from, m_RefundAmount ); - if ( depositedGold > 0 ) - from.SendLocalizedMessage( 1060397, depositedGold.ToString() ); // ~1_AMOUNT~ gold has been deposited into your bank box. + if ( depositedGold > 0 ) + from.SendLocalizedMessage( 1060397, depositedGold.ToString() ); // ~1_AMOUNT~ gold has been deposited into your bank box. - m_Vendor.HoldGold += m_RefundAmount - depositedGold; + m_Vendor.HoldGold += m_RefundAmount - depositedGold; - m_Vendor.Destroy( false ); + m_Vendor.Destroy( false ); - from.SendLocalizedMessage(1071990); //Remember to claim your vendor's belongings from the house sign! - } - else - { - m_Landlord.SendLocalizedMessage( 1062507 ); // You do not have that much money in your bank account. - } - } - else - { - m_Landlord.SendLocalizedMessage( 1062513 ); // The renter declined your offer. - } - } - } + from.SendLocalizedMessage(1071990); //Remember to claim your vendor's belongings from the house sign! + } + else + { + m_Landlord.SendLocalizedMessage( 1062507 ); // You do not have that much money in your bank account. + } + } + else + { + m_Landlord.SendLocalizedMessage( 1062513 ); // The renter declined your offer. + } + } + } } diff --git a/Projects/Scripts/Gumps/ViewHousesGump.cs b/Projects/Scripts/Gumps/ViewHousesGump.cs index 2b4e2845e..d4a545850 100644 --- a/Projects/Scripts/Gumps/ViewHousesGump.cs +++ b/Projects/Scripts/Gumps/ViewHousesGump.cs @@ -255,20 +255,11 @@ namespace Server.Gumps return house.GetType().Name; } - public string Right(string text) - { - return $"
{text}
"; - } + public string Right(string text) => $"
{text}
"; - public string Center(string text) - { - return $"
{text}
"; - } + public string Center(string text) => $"
{text}
"; - public string Color(string text, int color) - { - return $"{text}"; - } + public string Color(string text, int color) => $"{text}"; public void AddBlackAlpha(int x, int y, int width, int height) { @@ -280,10 +271,7 @@ namespace Server.Gumps { public static readonly IComparer Instance = new HouseComparer(); - public int Compare(BaseHouse x, BaseHouse y) - { - return x.BuiltOn.CompareTo(y.BuiltOn); - } + public int Compare(BaseHouse x, BaseHouse y) => x.BuiltOn.CompareTo(y.BuiltOn); } } } diff --git a/Projects/Scripts/Gumps/WarningGump.cs b/Projects/Scripts/Gumps/WarningGump.cs index 568bb945c..b6e9338b7 100644 --- a/Projects/Scripts/Gumps/WarningGump.cs +++ b/Projects/Scripts/Gumps/WarningGump.cs @@ -1,55 +1,55 @@ namespace Server.Gumps { - public delegate void WarningGumpCallback( bool okay ); + public delegate void WarningGumpCallback( bool okay ); - public class WarningGump : Gump - { - private WarningGumpCallback m_Callback; + public class WarningGump : Gump + { + private WarningGumpCallback m_Callback; - public WarningGump( int header, int headerColor, object content, int contentColor, int width, int height, WarningGumpCallback callback = null, bool cancelButton = true) : base( (640 - width) / 2, (480 - height) / 2 ) - { - m_Callback = callback; + public WarningGump( int header, int headerColor, object content, int contentColor, int width, int height, WarningGumpCallback callback = null, bool cancelButton = true) : base( (640 - width) / 2, (480 - height) / 2 ) + { + m_Callback = callback; - Closable = false; + Closable = false; - AddPage( 0 ); + AddPage( 0 ); - AddBackground( 0, 0, width, height, 5054 ); + AddBackground( 0, 0, width, height, 5054 ); - AddImageTiled( 10, 10, width - 20, 20, 2624 ); - AddAlphaRegion( 10, 10, width - 20, 20 ); - AddHtmlLocalized( 10, 10, width - 20, 20, header, headerColor ); + AddImageTiled( 10, 10, width - 20, 20, 2624 ); + AddAlphaRegion( 10, 10, width - 20, 20 ); + AddHtmlLocalized( 10, 10, width - 20, 20, header, headerColor ); - AddImageTiled( 10, 40, width - 20, height - 80, 2624 ); - AddAlphaRegion( 10, 40, width - 20, height - 80 ); + AddImageTiled( 10, 40, width - 20, height - 80, 2624 ); + AddAlphaRegion( 10, 40, width - 20, height - 80 ); - if ( content is int i ) - AddHtmlLocalized( 10, 40, width - 20, height - 80, i, contentColor, false, true ); - else if ( content is string ) - AddHtml( 10, 40, width - 20, height - 80, $"{content}", false, true ); + if ( content is int i ) + AddHtmlLocalized( 10, 40, width - 20, height - 80, i, contentColor, false, true ); + else if ( content is string ) + AddHtml( 10, 40, width - 20, height - 80, $"{content}", false, true ); - AddImageTiled( 10, height - 30, width - 20, 20, 2624 ); - AddAlphaRegion( 10, height - 30, width - 20, 20 ); + AddImageTiled( 10, height - 30, width - 20, 20, 2624 ); + AddAlphaRegion( 10, height - 30, width - 20, 20 ); - AddButton( 10, height - 30, 4005, 4007, 1 ); - AddHtmlLocalized( 40, height - 30, 170, 20, 1011036, 32767 ); // OKAY + AddButton( 10, height - 30, 4005, 4007, 1 ); + AddHtmlLocalized( 40, height - 30, 170, 20, 1011036, 32767 ); // OKAY - if ( cancelButton ) - { - AddButton( 10 + ((width - 20) / 2), height - 30, 4005, 4007, 0 ); - AddHtmlLocalized( 40 + ((width - 20) / 2), height - 30, 170, 20, 1011012, 32767 ); // CANCEL - } - } + if ( cancelButton ) + { + AddButton( 10 + ((width - 20) / 2), height - 30, 4005, 4007, 0 ); + AddHtmlLocalized( 40 + ((width - 20) / 2), height - 30, 170, 20, 1011012, 32767 ); // CANCEL + } + } - public override void OnResponse( Network.NetState sender, RelayInfo info ) - { - if (m_Callback == null) - return; + public override void OnResponse( Network.NetState sender, RelayInfo info ) + { + if (m_Callback == null) + return; - if ( info.ButtonID == 1) - m_Callback( true ); - else - m_Callback.Invoke( false ); - } - } + if ( info.ButtonID == 1) + m_Callback( true ); + else + m_Callback.Invoke( false ); + } + } } diff --git a/Projects/Scripts/Gumps/WhoGump.cs b/Projects/Scripts/Gumps/WhoGump.cs index b7992794e..963415f5e 100644 --- a/Projects/Scripts/Gumps/WhoGump.cs +++ b/Projects/Scripts/Gumps/WhoGump.cs @@ -6,287 +6,287 @@ using Server.Network; namespace Server.Gumps { - public class WhoGump : Gump - { - public static void Initialize() - { - CommandSystem.Register( "Who", AccessLevel.Counselor, WhoList_OnCommand ); - CommandSystem.Register( "WhoList", AccessLevel.Counselor, WhoList_OnCommand ); - } + public class WhoGump : Gump + { + public static void Initialize() + { + CommandSystem.Register( "Who", AccessLevel.Counselor, WhoList_OnCommand ); + CommandSystem.Register( "WhoList", AccessLevel.Counselor, WhoList_OnCommand ); + } - [Usage( "WhoList [filter]" )] - [Aliases( "Who" )] - [Description( "Lists all connected clients. Optionally filters results by name." )] - private static void WhoList_OnCommand( CommandEventArgs e ) - { - e.Mobile.SendGump( new WhoGump( e.Mobile, e.ArgString ) ); - } + [Usage( "WhoList [filter]" )] + [Aliases( "Who" )] + [Description( "Lists all connected clients. Optionally filters results by name." )] + private static void WhoList_OnCommand( CommandEventArgs e ) + { + e.Mobile.SendGump( new WhoGump( e.Mobile, e.ArgString ) ); + } - public static bool OldStyle = PropsConfig.OldStyle; + public static bool OldStyle = PropsConfig.OldStyle; - public static readonly int GumpOffsetX = PropsConfig.GumpOffsetX; - public static readonly int GumpOffsetY = PropsConfig.GumpOffsetY; + public static readonly int GumpOffsetX = PropsConfig.GumpOffsetX; + public static readonly int GumpOffsetY = PropsConfig.GumpOffsetY; - public static readonly int TextHue = PropsConfig.TextHue; - public static readonly int TextOffsetX = PropsConfig.TextOffsetX; + public static readonly int TextHue = PropsConfig.TextHue; + public static readonly int TextOffsetX = PropsConfig.TextOffsetX; - public static readonly int OffsetGumpID = PropsConfig.OffsetGumpID; - public static readonly int HeaderGumpID = PropsConfig.HeaderGumpID; - public static readonly int EntryGumpID = PropsConfig.EntryGumpID; - public static readonly int BackGumpID = PropsConfig.BackGumpID; - public static readonly int SetGumpID = PropsConfig.SetGumpID; + public static readonly int OffsetGumpID = PropsConfig.OffsetGumpID; + public static readonly int HeaderGumpID = PropsConfig.HeaderGumpID; + public static readonly int EntryGumpID = PropsConfig.EntryGumpID; + public static readonly int BackGumpID = PropsConfig.BackGumpID; + public static readonly int SetGumpID = PropsConfig.SetGumpID; - public static readonly int SetWidth = PropsConfig.SetWidth; - public static readonly int SetOffsetX = PropsConfig.SetOffsetX, SetOffsetY = PropsConfig.SetOffsetY; - public static readonly int SetButtonID1 = PropsConfig.SetButtonID1; - public static readonly int SetButtonID2 = PropsConfig.SetButtonID2; + public static readonly int SetWidth = PropsConfig.SetWidth; + public static readonly int SetOffsetX = PropsConfig.SetOffsetX, SetOffsetY = PropsConfig.SetOffsetY; + public static readonly int SetButtonID1 = PropsConfig.SetButtonID1; + public static readonly int SetButtonID2 = PropsConfig.SetButtonID2; - public static readonly int PrevWidth = PropsConfig.PrevWidth; - public static readonly int PrevOffsetX = PropsConfig.PrevOffsetX, PrevOffsetY = PropsConfig.PrevOffsetY; - public static readonly int PrevButtonID1 = PropsConfig.PrevButtonID1; - public static readonly int PrevButtonID2 = PropsConfig.PrevButtonID2; + public static readonly int PrevWidth = PropsConfig.PrevWidth; + public static readonly int PrevOffsetX = PropsConfig.PrevOffsetX, PrevOffsetY = PropsConfig.PrevOffsetY; + public static readonly int PrevButtonID1 = PropsConfig.PrevButtonID1; + public static readonly int PrevButtonID2 = PropsConfig.PrevButtonID2; - public static readonly int NextWidth = PropsConfig.NextWidth; - public static readonly int NextOffsetX = PropsConfig.NextOffsetX, NextOffsetY = PropsConfig.NextOffsetY; - public static readonly int NextButtonID1 = PropsConfig.NextButtonID1; - public static readonly int NextButtonID2 = PropsConfig.NextButtonID2; + public static readonly int NextWidth = PropsConfig.NextWidth; + public static readonly int NextOffsetX = PropsConfig.NextOffsetX, NextOffsetY = PropsConfig.NextOffsetY; + public static readonly int NextButtonID1 = PropsConfig.NextButtonID1; + public static readonly int NextButtonID2 = PropsConfig.NextButtonID2; - public static readonly int OffsetSize = PropsConfig.OffsetSize; + public static readonly int OffsetSize = PropsConfig.OffsetSize; - public static readonly int EntryHeight = PropsConfig.EntryHeight; - public static readonly int BorderSize = PropsConfig.BorderSize; + public static readonly int EntryHeight = PropsConfig.EntryHeight; + public static readonly int BorderSize = PropsConfig.BorderSize; - private static bool PrevLabel = false, NextLabel = false; + private static bool PrevLabel = false, NextLabel = false; - private static readonly int PrevLabelOffsetX = PrevWidth + 1; - private static readonly int PrevLabelOffsetY = 0; + private static readonly int PrevLabelOffsetX = PrevWidth + 1; + private static readonly int PrevLabelOffsetY = 0; - private static readonly int NextLabelOffsetX = -29; - private static readonly int NextLabelOffsetY = 0; + private static readonly int NextLabelOffsetX = -29; + private static readonly int NextLabelOffsetY = 0; - private static readonly int EntryWidth = 180; - private static readonly int EntryCount = 15; + private static readonly int EntryWidth = 180; + private static readonly int EntryCount = 15; - private static readonly int TotalWidth = OffsetSize + EntryWidth + OffsetSize + SetWidth + OffsetSize; - private static readonly int TotalHeight = OffsetSize + ((EntryHeight + OffsetSize) * (EntryCount + 1)); + private static readonly int TotalWidth = OffsetSize + EntryWidth + OffsetSize + SetWidth + OffsetSize; + private static readonly int TotalHeight = OffsetSize + ((EntryHeight + OffsetSize) * (EntryCount + 1)); - private static readonly int BackWidth = BorderSize + TotalWidth + BorderSize; - private static readonly int BackHeight = BorderSize + TotalHeight + BorderSize; + private static readonly int BackWidth = BorderSize + TotalWidth + BorderSize; + private static readonly int BackHeight = BorderSize + TotalHeight + BorderSize; - private Mobile m_Owner; - private List m_Mobiles; - private int m_Page; + private Mobile m_Owner; + private List m_Mobiles; + private int m_Page; - private class InternalComparer : IComparer - { - public static readonly IComparer Instance = new InternalComparer(); + private class InternalComparer : IComparer + { + public static readonly IComparer Instance = new InternalComparer(); - public InternalComparer() - { - } + public InternalComparer() + { + } - public int Compare( Mobile x, Mobile y ) - { - if ( x == null || y == null ) - throw new ArgumentException(); + public int Compare( Mobile x, Mobile y ) + { + if ( x == null || y == null ) + throw new ArgumentException(); - if ( x.AccessLevel > y.AccessLevel ) - return -1; - if ( x.AccessLevel < y.AccessLevel ) - return 1; - return Insensitive.Compare( x.Name, y.Name ); - } - } + if ( x.AccessLevel > y.AccessLevel ) + return -1; + if ( x.AccessLevel < y.AccessLevel ) + return 1; + return Insensitive.Compare( x.Name, y.Name ); + } + } - public WhoGump(Mobile owner, string filter) : this(owner, BuildList( owner, filter )) - { - } + public WhoGump(Mobile owner, string filter) : this(owner, BuildList( owner, filter )) + { + } - public WhoGump(Mobile owner, List list, int page = 0) : base(GumpOffsetX, GumpOffsetY) - { - owner.CloseGump(); + public WhoGump(Mobile owner, List list, int page = 0) : base(GumpOffsetX, GumpOffsetY) + { + owner.CloseGump(); - m_Owner = owner; - m_Mobiles = list; + m_Owner = owner; + m_Mobiles = list; - Initialize( page ); - } + Initialize( page ); + } - public static List BuildList(Mobile owner, string rawFilter) - { - string filter = String.IsNullOrWhiteSpace(rawFilter) ? null : rawFilter.Trim().ToLower(); + public static List BuildList(Mobile owner, string rawFilter) + { + string filter = String.IsNullOrWhiteSpace(rawFilter) ? null : rawFilter.Trim().ToLower(); - List list = new List(); - List states = NetState.Instances; + List list = new List(); + List states = NetState.Instances; - for ( int i = 0; i < states.Count; ++i ) - { - Mobile m = states[i].Mobile; + for ( int i = 0; i < states.Count; ++i ) + { + Mobile m = states[i].Mobile; - if ( m != null && (m == owner || !m.Hidden || owner.AccessLevel >= m.AccessLevel || m is PlayerMobile mobile && mobile.VisibilityList.Contains( owner ) ) ) - { - if ( filter != null && !(m.Name?.ToLower().IndexOf(filter) >= 0) ) - continue; + if ( m != null && (m == owner || !m.Hidden || owner.AccessLevel >= m.AccessLevel || m is PlayerMobile mobile && mobile.VisibilityList.Contains( owner ) ) ) + { + if ( filter != null && !(m.Name?.ToLower().IndexOf(filter) >= 0) ) + continue; - list.Add( m ); - } - } + list.Add( m ); + } + } - list.Sort( InternalComparer.Instance ); + list.Sort( InternalComparer.Instance ); - return list; - } + return list; + } - public void Initialize( int page ) - { - m_Page = page; + public void Initialize( int page ) + { + m_Page = page; - int count = m_Mobiles.Count - page * EntryCount; + int count = m_Mobiles.Count - page * EntryCount; - if ( count < 0 ) - count = 0; - else if ( count > EntryCount ) - count = EntryCount; + if ( count < 0 ) + count = 0; + else if ( count > EntryCount ) + count = EntryCount; - int totalHeight = OffsetSize + (EntryHeight + OffsetSize) * (count + 1); + int totalHeight = OffsetSize + (EntryHeight + OffsetSize) * (count + 1); - AddPage( 0 ); + AddPage( 0 ); - AddBackground( 0, 0, BackWidth, BorderSize + totalHeight + BorderSize, BackGumpID ); - AddImageTiled( BorderSize, BorderSize, TotalWidth - (OldStyle ? SetWidth + OffsetSize : 0), totalHeight, OffsetGumpID ); + AddBackground( 0, 0, BackWidth, BorderSize + totalHeight + BorderSize, BackGumpID ); + AddImageTiled( BorderSize, BorderSize, TotalWidth - (OldStyle ? SetWidth + OffsetSize : 0), totalHeight, OffsetGumpID ); - int x = BorderSize + OffsetSize; - int y = BorderSize + OffsetSize; + int x = BorderSize + OffsetSize; + int y = BorderSize + OffsetSize; - int emptyWidth = TotalWidth - PrevWidth - NextWidth - (OffsetSize * 4) - (OldStyle ? SetWidth + OffsetSize : 0); + int emptyWidth = TotalWidth - PrevWidth - NextWidth - (OffsetSize * 4) - (OldStyle ? SetWidth + OffsetSize : 0); - if ( !OldStyle ) - AddImageTiled( x - (OldStyle ? OffsetSize : 0), y, emptyWidth + (OldStyle ? OffsetSize * 2 : 0), EntryHeight, EntryGumpID ); + if ( !OldStyle ) + AddImageTiled( x - (OldStyle ? OffsetSize : 0), y, emptyWidth + (OldStyle ? OffsetSize * 2 : 0), EntryHeight, EntryGumpID ); - AddLabel( x + TextOffsetX, y, TextHue, - $"Page {page + 1} of {(m_Mobiles.Count + EntryCount - 1) / EntryCount} ({m_Mobiles.Count})"); + AddLabel( x + TextOffsetX, y, TextHue, + $"Page {page + 1} of {(m_Mobiles.Count + EntryCount - 1) / EntryCount} ({m_Mobiles.Count})"); - x += emptyWidth + OffsetSize; + x += emptyWidth + OffsetSize; - if ( OldStyle ) - AddImageTiled( x, y, TotalWidth - (OffsetSize * 3) - SetWidth, EntryHeight, HeaderGumpID ); - else - AddImageTiled( x, y, PrevWidth, EntryHeight, HeaderGumpID ); + if ( OldStyle ) + AddImageTiled( x, y, TotalWidth - (OffsetSize * 3) - SetWidth, EntryHeight, HeaderGumpID ); + else + AddImageTiled( x, y, PrevWidth, EntryHeight, HeaderGumpID ); - if ( page > 0 ) - { - AddButton( x + PrevOffsetX, y + PrevOffsetY, PrevButtonID1, PrevButtonID2, 1 ); + if ( page > 0 ) + { + AddButton( x + PrevOffsetX, y + PrevOffsetY, PrevButtonID1, PrevButtonID2, 1 ); - if ( PrevLabel ) - AddLabel( x + PrevLabelOffsetX, y + PrevLabelOffsetY, TextHue, "Previous" ); - } + if ( PrevLabel ) + AddLabel( x + PrevLabelOffsetX, y + PrevLabelOffsetY, TextHue, "Previous" ); + } - x += PrevWidth + OffsetSize; + x += PrevWidth + OffsetSize; - if ( !OldStyle ) - AddImageTiled( x, y, NextWidth, EntryHeight, HeaderGumpID ); + if ( !OldStyle ) + AddImageTiled( x, y, NextWidth, EntryHeight, HeaderGumpID ); - if ( (page + 1) * EntryCount < m_Mobiles.Count ) - { - AddButton( x + NextOffsetX, y + NextOffsetY, NextButtonID1, NextButtonID2, 2, GumpButtonType.Reply, 1 ); + if ( (page + 1) * EntryCount < m_Mobiles.Count ) + { + AddButton( x + NextOffsetX, y + NextOffsetY, NextButtonID1, NextButtonID2, 2, GumpButtonType.Reply, 1 ); - if ( NextLabel ) - AddLabel( x + NextLabelOffsetX, y + NextLabelOffsetY, TextHue, "Next" ); - } + if ( NextLabel ) + AddLabel( x + NextLabelOffsetX, y + NextLabelOffsetY, TextHue, "Next" ); + } - for ( int i = 0, index = page * EntryCount; i < EntryCount && index < m_Mobiles.Count; ++i, ++index ) - { - x = BorderSize + OffsetSize; - y += EntryHeight + OffsetSize; + for ( int i = 0, index = page * EntryCount; i < EntryCount && index < m_Mobiles.Count; ++i, ++index ) + { + x = BorderSize + OffsetSize; + y += EntryHeight + OffsetSize; - Mobile m = m_Mobiles[index]; + Mobile m = m_Mobiles[index]; - AddImageTiled( x, y, EntryWidth, EntryHeight, EntryGumpID ); - AddLabelCropped( x + TextOffsetX, y, EntryWidth - TextOffsetX, EntryHeight, GetHueFor( m ), m.Deleted ? "(deleted)" : m.Name ); + AddImageTiled( x, y, EntryWidth, EntryHeight, EntryGumpID ); + AddLabelCropped( x + TextOffsetX, y, EntryWidth - TextOffsetX, EntryHeight, GetHueFor( m ), m.Deleted ? "(deleted)" : m.Name ); - x += EntryWidth + OffsetSize; + x += EntryWidth + OffsetSize; - if ( SetGumpID != 0 ) - AddImageTiled( x, y, SetWidth, EntryHeight, SetGumpID ); + if ( SetGumpID != 0 ) + AddImageTiled( x, y, SetWidth, EntryHeight, SetGumpID ); - if ( m.NetState != null && !m.Deleted ) - AddButton( x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, i + 3 ); - } - } + if ( m.NetState != null && !m.Deleted ) + AddButton( x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, i + 3 ); + } + } - private static int GetHueFor( Mobile m ) - { - switch ( m.AccessLevel ) - { - case AccessLevel.Owner: - case AccessLevel.Developer: - case AccessLevel.Administrator: return 0x516; - case AccessLevel.Seer: return 0x144; - case AccessLevel.GameMaster: return 0x21; - case AccessLevel.Counselor: return 0x2; - default: - { - return m.Kills >= 5 ? 0x21 : m.Criminal ? 0x3B1 : 0x58; - } - } - } + private static int GetHueFor( Mobile m ) + { + switch ( m.AccessLevel ) + { + case AccessLevel.Owner: + case AccessLevel.Developer: + case AccessLevel.Administrator: return 0x516; + case AccessLevel.Seer: return 0x144; + case AccessLevel.GameMaster: return 0x21; + case AccessLevel.Counselor: return 0x2; + default: + { + return m.Kills >= 5 ? 0x21 : m.Criminal ? 0x3B1 : 0x58; + } + } + } - public override void OnResponse( NetState state, RelayInfo info ) - { - Mobile from = state.Mobile; + public override void OnResponse( NetState state, RelayInfo info ) + { + Mobile from = state.Mobile; - switch ( info.ButtonID ) - { - case 0: // Closed - { - return; - } - case 1: // Previous - { - if ( m_Page > 0 ) - from.SendGump( new WhoGump( from, m_Mobiles, m_Page - 1 ) ); + switch ( info.ButtonID ) + { + case 0: // Closed + { + return; + } + case 1: // Previous + { + if ( m_Page > 0 ) + from.SendGump( new WhoGump( from, m_Mobiles, m_Page - 1 ) ); - break; - } - case 2: // Next - { - if ( (m_Page + 1) * EntryCount < m_Mobiles.Count ) - from.SendGump( new WhoGump( from, m_Mobiles, m_Page + 1 ) ); + break; + } + case 2: // Next + { + if ( (m_Page + 1) * EntryCount < m_Mobiles.Count ) + from.SendGump( new WhoGump( from, m_Mobiles, m_Page + 1 ) ); - break; - } - default: - { - int index = m_Page * EntryCount + (info.ButtonID - 3); + break; + } + default: + { + int index = m_Page * EntryCount + (info.ButtonID - 3); - if ( index >= 0 && index < m_Mobiles.Count ) - { - Mobile m = m_Mobiles[index]; + if ( index >= 0 && index < m_Mobiles.Count ) + { + Mobile m = m_Mobiles[index]; - if ( m.Deleted ) - { - from.SendMessage( "That player has deleted their character." ); - from.SendGump( new WhoGump( from, m_Mobiles, m_Page ) ); - } - else if ( m.NetState == null ) - { - from.SendMessage( "That player is no longer online." ); - from.SendGump( new WhoGump( from, m_Mobiles, m_Page ) ); - } - else if ( m == from || !m.Hidden || from.AccessLevel >= m.AccessLevel || m is PlayerMobile mobile && mobile.VisibilityList.Contains( from )) - { - from.SendGump( new ClientGump( from, m.NetState ) ); - } - else - { - from.SendMessage( "You cannot see them." ); - from.SendGump( new WhoGump( from, m_Mobiles, m_Page ) ); - } - } + if ( m.Deleted ) + { + from.SendMessage( "That player has deleted their character." ); + from.SendGump( new WhoGump( from, m_Mobiles, m_Page ) ); + } + else if ( m.NetState == null ) + { + from.SendMessage( "That player is no longer online." ); + from.SendGump( new WhoGump( from, m_Mobiles, m_Page ) ); + } + else if ( m == from || !m.Hidden || from.AccessLevel >= m.AccessLevel || m is PlayerMobile mobile && mobile.VisibilityList.Contains( from )) + { + from.SendGump( new ClientGump( from, m.NetState ) ); + } + else + { + from.SendMessage( "You cannot see them." ); + from.SendGump( new WhoGump( from, m_Mobiles, m_Page ) ); + } + } - break; - } - } - } - } + break; + } + } + } + } } diff --git a/Projects/Scripts/Gumps/YoungGumps.cs b/Projects/Scripts/Gumps/YoungGumps.cs index c6e05fc07..fc0a31cc7 100644 --- a/Projects/Scripts/Gumps/YoungGumps.cs +++ b/Projects/Scripts/Gumps/YoungGumps.cs @@ -3,91 +3,91 @@ using Server.Accounting; namespace Server.Gumps { - public class YoungDungeonWarning : Gump - { - public YoungDungeonWarning() : base( 150, 200 ) - { - AddBackground( 0, 0, 250, 170, 0xA28 ); + public class YoungDungeonWarning : Gump + { + public YoungDungeonWarning() : base( 150, 200 ) + { + AddBackground( 0, 0, 250, 170, 0xA28 ); - AddHtmlLocalized( 20, 43, 215, 70, 1018030, true, true ); // Warning: monsters may attack you on site down here in the dungeons! + AddHtmlLocalized( 20, 43, 215, 70, 1018030, true, true ); // Warning: monsters may attack you on site down here in the dungeons! - AddButton( 70, 123, 0xFA5, 0xFA7, 0); - AddHtmlLocalized( 105, 125, 100, 35, 1011036 ); // OKAY - } - } + AddButton( 70, 123, 0xFA5, 0xFA7, 0); + AddHtmlLocalized( 105, 125, 100, 35, 1011036 ); // OKAY + } + } - public class YoungDeathNotice : Gump - { - public YoungDeathNotice() : base( 100, 15 ) - { - Closable = false; + public class YoungDeathNotice : Gump + { + public YoungDeathNotice() : base( 100, 15 ) + { + Closable = false; - AddBackground( 25, 10, 425, 444, 0x13BE ); + AddBackground( 25, 10, 425, 444, 0x13BE ); - AddImageTiled( 33, 20, 407, 425, 0xA40 ); - AddAlphaRegion( 33, 20, 407, 425 ); + AddImageTiled( 33, 20, 407, 425, 0xA40 ); + AddAlphaRegion( 33, 20, 407, 425 ); - AddHtmlLocalized( 190, 24, 120, 20, 1046287, 0x7D00 ); // You have died. + AddHtmlLocalized( 190, 24, 120, 20, 1046287, 0x7D00 ); // You have died. - // As a ghost you cannot interact with the world. You cannot touch items nor can you use them. - AddHtmlLocalized( 50, 50, 380, 40, 1046288, 0xFFFFFF ); - // You can pass through doors as though they do not exist. However, you cannot pass through walls. - AddHtmlLocalized( 50, 100, 380, 45, 1046289, 0xFFFFFF ); - // Since you are a new player, any items you had on your person at the time of your death will be in your backpack upon resurrection. - AddHtmlLocalized( 50, 140, 380, 60, 1046291, 0xFFFFFF ); - // To be resurrected you must find a healer in town or wandering in the wilderness. Some powerful players may also be able to resurrect you. - AddHtmlLocalized( 50, 204, 380, 65, 1046292, 0xFFFFFF ); - // While you are still in young status, you will be transported to the nearest healer (along with your items) at the time of your death. - AddHtmlLocalized( 50, 269, 380, 65, 1046293, 0xFFFFFF ); - // To rejoin the world of the living simply walk near one of the NPC healers, and they will resurrect you as long as you are not marked as a criminal. - AddHtmlLocalized( 50, 334, 380, 70, 1046294, 0xFFFFFF ); + // As a ghost you cannot interact with the world. You cannot touch items nor can you use them. + AddHtmlLocalized( 50, 50, 380, 40, 1046288, 0xFFFFFF ); + // You can pass through doors as though they do not exist. However, you cannot pass through walls. + AddHtmlLocalized( 50, 100, 380, 45, 1046289, 0xFFFFFF ); + // Since you are a new player, any items you had on your person at the time of your death will be in your backpack upon resurrection. + AddHtmlLocalized( 50, 140, 380, 60, 1046291, 0xFFFFFF ); + // To be resurrected you must find a healer in town or wandering in the wilderness. Some powerful players may also be able to resurrect you. + AddHtmlLocalized( 50, 204, 380, 65, 1046292, 0xFFFFFF ); + // While you are still in young status, you will be transported to the nearest healer (along with your items) at the time of your death. + AddHtmlLocalized( 50, 269, 380, 65, 1046293, 0xFFFFFF ); + // To rejoin the world of the living simply walk near one of the NPC healers, and they will resurrect you as long as you are not marked as a criminal. + AddHtmlLocalized( 50, 334, 380, 70, 1046294, 0xFFFFFF ); - AddButton( 195, 410, 0xF8, 0xF9, 0); - } - } + AddButton( 195, 410, 0xF8, 0xF9, 0); + } + } - public class RenounceYoungGump : Gump - { - public RenounceYoungGump() : base( 150, 50 ) - { - AddBackground( 0, 0, 450, 400, 0xA28 ); + public class RenounceYoungGump : Gump + { + public RenounceYoungGump() : base( 150, 50 ) + { + AddBackground( 0, 0, 450, 400, 0xA28 ); - AddHtmlLocalized( 0, 30, 450, 35, 1013004 ); //
Renouncing 'Young Player' Status
+ AddHtmlLocalized( 0, 30, 450, 35, 1013004 ); //
Renouncing 'Young Player' Status
- /* As a 'Young' player, you are currently under a system of protection that prevents - * you from being attacked by other players and certain monsters.

- * - * If you choose to renounce your status as a 'Young' player, you will lose this protection. - * You will become vulnerable to other players, and many monsters that had only glared - * at you menacingly before will now attack you on sight!

- * - * Select OKAY now if you wish to renounce your status as a 'Young' player, otherwise - * press CANCEL. - */ - AddHtmlLocalized( 30, 70, 390, 210, 1013005, true, true ); + /* As a 'Young' player, you are currently under a system of protection that prevents + * you from being attacked by other players and certain monsters.

+ * + * If you choose to renounce your status as a 'Young' player, you will lose this protection. + * You will become vulnerable to other players, and many monsters that had only glared + * at you menacingly before will now attack you on sight!

+ * + * Select OKAY now if you wish to renounce your status as a 'Young' player, otherwise + * press CANCEL. + */ + AddHtmlLocalized( 30, 70, 390, 210, 1013005, true, true ); - AddButton( 45, 298, 0xFA5, 0xFA7, 1); - AddHtmlLocalized( 78, 300, 100, 35, 1011036 ); // OKAY + AddButton( 45, 298, 0xFA5, 0xFA7, 1); + AddHtmlLocalized( 78, 300, 100, 35, 1011036 ); // OKAY - AddButton( 178, 298, 0xFA5, 0xFA7, 0); - AddHtmlLocalized( 211, 300, 100, 35, 1011012 ); // CANCEL - } + AddButton( 178, 298, 0xFA5, 0xFA7, 0); + AddHtmlLocalized( 211, 300, 100, 35, 1011012 ); // CANCEL + } - public override void OnResponse( NetState sender, RelayInfo info ) - { - Mobile from = sender.Mobile; + public override void OnResponse( NetState sender, RelayInfo info ) + { + Mobile from = sender.Mobile; - if ( info.ButtonID == 1 ) - { - if ( from.Account is Account acc ) - { - acc.RemoveYoungStatus( 502085 ); // You have chosen to renounce your `Young' player status. - } - } - else - { - from.SendLocalizedMessage( 502086 ); // You have chosen not to renounce your `Young' player status. - } - } - } + if ( info.ButtonID == 1 ) + { + if ( from.Account is Account acc ) + { + acc.RemoveYoungStatus( 502085 ); // You have chosen to renounce your `Young' player status. + } + } + else + { + from.SendLocalizedMessage( 502086 ); // You have chosen not to renounce your `Young' player status. + } + } + } } diff --git a/Projects/Scripts/Holiday Stuff/Halloween/2006/Engines/TrickOrTreat.cs b/Projects/Scripts/Holiday Stuff/Halloween/2006/Engines/TrickOrTreat.cs index dfe3aa2a3..b0cdb8ed4 100644 --- a/Projects/Scripts/Holiday Stuff/Halloween/2006/Engines/TrickOrTreat.cs +++ b/Projects/Scripts/Holiday Stuff/Halloween/2006/Engines/TrickOrTreat.cs @@ -109,10 +109,7 @@ namespace Server.Engines.Events return loc; } - public static bool CheckMobile(Mobile mobile) - { - return mobile?.Map != null && !mobile.Deleted && mobile.Alive && mobile.Map != Map.Internal; - } + public static bool CheckMobile(Mobile mobile) => mobile?.Map != null && !mobile.Deleted && mobile.Alive && mobile.Map != Map.Internal; private class TrickOrTreatTarget : Target { diff --git a/Projects/Scripts/Holiday Stuff/Halloween/2006/Items/TwilightLantern.cs b/Projects/Scripts/Holiday Stuff/Halloween/2006/Items/TwilightLantern.cs index 945230d3c..9c4ef250c 100644 --- a/Projects/Scripts/Holiday Stuff/Halloween/2006/Items/TwilightLantern.cs +++ b/Projects/Scripts/Holiday Stuff/Halloween/2006/Items/TwilightLantern.cs @@ -3,10 +3,7 @@ public class TwilightLantern : Lantern { [Constructible] - public TwilightLantern() - { - Hue = Utility.RandomBool() ? 244 : 997; - } + public TwilightLantern() => Hue = Utility.RandomBool() ? 244 : 997; public TwilightLantern(Serial serial) : base(serial) @@ -15,10 +12,7 @@ public override string DefaultName => "Twilight Lantern"; - public override bool AllowEquippedCast(Mobile from) - { - return true; - } + public override bool AllowEquippedCast(Mobile from) => true; public override void GetProperties(ObjectPropertyList list) { diff --git a/Projects/Scripts/Holiday Stuff/Halloween/2009/Foods/CreepyCake.cs b/Projects/Scripts/Holiday Stuff/Halloween/2009/Foods/CreepyCake.cs index 50e6761fd..9e643a558 100644 --- a/Projects/Scripts/Holiday Stuff/Halloween/2009/Foods/CreepyCake.cs +++ b/Projects/Scripts/Holiday Stuff/Halloween/2009/Foods/CreepyCake.cs @@ -8,10 +8,7 @@ public class CreepyCake : Food { [Constructible] - public CreepyCake() : base(0x9e9, 1) - { - Hue = 0x3E4; - } + public CreepyCake() : base(0x9e9, 1) => Hue = 0x3E4; public CreepyCake(Serial serial) : base(serial) diff --git a/Projects/Scripts/Holiday Stuff/Halloween/2009/Foods/HarvestWine.cs b/Projects/Scripts/Holiday Stuff/Halloween/2009/Foods/HarvestWine.cs index 9f9830ddb..5eca9d985 100644 --- a/Projects/Scripts/Holiday Stuff/Halloween/2009/Foods/HarvestWine.cs +++ b/Projects/Scripts/Holiday Stuff/Halloween/2009/Foods/HarvestWine.cs @@ -9,10 +9,8 @@ { [Constructible] public HarvestWine() - : base(BeverageType.Wine) - { + : base(BeverageType.Wine) => Hue = 0xe0; - } public HarvestWine(Serial serial) : base(serial) diff --git a/Projects/Scripts/Holiday Stuff/Halloween/2009/Foods/PumpkinPizza.cs b/Projects/Scripts/Holiday Stuff/Halloween/2009/Foods/PumpkinPizza.cs index 30f4b357d..4482560f5 100644 --- a/Projects/Scripts/Holiday Stuff/Halloween/2009/Foods/PumpkinPizza.cs +++ b/Projects/Scripts/Holiday Stuff/Halloween/2009/Foods/PumpkinPizza.cs @@ -8,10 +8,7 @@ public class PumpkinPizza : CheesePizza { [Constructible] - public PumpkinPizza() - { - Hue = 0xF3; - } + public PumpkinPizza() => Hue = 0xF3; public PumpkinPizza(Serial serial) : base(serial) diff --git a/Projects/Scripts/Holiday Stuff/Halloween/2010/Items/ColoredSmallWebs.cs b/Projects/Scripts/Holiday Stuff/Halloween/2010/Items/ColoredSmallWebs.cs index b6843ad89..b2ce1261e 100644 --- a/Projects/Scripts/Holiday Stuff/Halloween/2010/Items/ColoredSmallWebs.cs +++ b/Projects/Scripts/Holiday Stuff/Halloween/2010/Items/ColoredSmallWebs.cs @@ -4,10 +4,8 @@ namespace Server.Items { [Constructible] public ColoredSmallWebs() - : base(Utility.RandomBool() ? 0x10d6 : 0x10d7) - { + : base(Utility.RandomBool() ? 0x10d6 : 0x10d7) => Hue = Utility.RandomBool() ? 0x455 : 0x4E9; - } public ColoredSmallWebs(Serial serial) : base(serial) diff --git a/Projects/Scripts/Holiday Stuff/Halloween/2011/Items/BasePaintedMask.cs b/Projects/Scripts/Holiday Stuff/Halloween/2011/Items/BasePaintedMask.cs index 7dc4fac64..c89849eaa 100644 --- a/Projects/Scripts/Holiday Stuff/Halloween/2011/Items/BasePaintedMask.cs +++ b/Projects/Scripts/Holiday Stuff/Halloween/2011/Items/BasePaintedMask.cs @@ -35,13 +35,7 @@ namespace Server.Items.Holiday { } - public override string DefaultName - { - get - { - return m_Staffer != null ? $"{MaskName} hand painted by {m_Staffer}" : MaskName; - } - } + public override string DefaultName => m_Staffer != null ? $"{MaskName} hand painted by {m_Staffer}" : MaskName; public virtual string MaskName => "A Mask"; diff --git a/Projects/Scripts/Holiday Stuff/Halloween/2012/Engines/PlayerZombies.cs b/Projects/Scripts/Holiday Stuff/Halloween/2012/Engines/PlayerZombies.cs index 03ba47234..bcd51cb10 100644 --- a/Projects/Scripts/Holiday Stuff/Halloween/2012/Engines/PlayerZombies.cs +++ b/Projects/Scripts/Holiday Stuff/Halloween/2012/Engines/PlayerZombies.cs @@ -6,265 +6,265 @@ using Server.Events.Halloween; namespace Server.Engines.Events { - public class HalloweenHauntings - { - public static Dictionary ReAnimated { get; set; } + public class HalloweenHauntings + { + public static Dictionary ReAnimated { get; set; } - private static Timer m_Timer; - private static Timer m_ClearTimer; + private static Timer m_Timer; + private static Timer m_ClearTimer; - private static int m_TotalZombieLimit; - private static int m_DeathQueueLimit; - private static int m_QueueDelaySeconds; - private static int m_QueueClearIntervalSeconds; + private static int m_TotalZombieLimit; + private static int m_DeathQueueLimit; + private static int m_QueueDelaySeconds; + private static int m_QueueClearIntervalSeconds; - private static List m_DeathQueue; + private static List m_DeathQueue; - private static Rectangle2D[] m_Cemetaries = { - new Rectangle2D(1272,3712,30,20), // Jhelom - new Rectangle2D(1337,1444,48,52), // Britain - new Rectangle2D(2424,1098,20,28), // Trinsic - new Rectangle2D(2728,840,54,54), // Vesper - new Rectangle2D(4528,1314,20,28), // Moonglow - new Rectangle2D(712,1104,30,22), // Yew - new Rectangle2D(5824,1464,22,6), // Fire Dungeon - new Rectangle2D(5224,3655,14,5), // T2A + private static Rectangle2D[] m_Cemetaries = { + new Rectangle2D(1272,3712,30,20), // Jhelom + new Rectangle2D(1337,1444,48,52), // Britain + new Rectangle2D(2424,1098,20,28), // Trinsic + new Rectangle2D(2728,840,54,54), // Vesper + new Rectangle2D(4528,1314,20,28), // Moonglow + new Rectangle2D(712,1104,30,22), // Yew + new Rectangle2D(5824,1464,22,6), // Fire Dungeon + new Rectangle2D(5224,3655,14,5), // T2A - new Rectangle2D(1272,3712,20,30), // Jhelom - new Rectangle2D(1337,1444,52,48), // Britain - new Rectangle2D(2424,1098,28,20), // Trinsic - new Rectangle2D(2728,840,54,54), // Vesper - new Rectangle2D(4528,1314,28,20), // Moonglow - new Rectangle2D(712,1104,22,30), // Yew - new Rectangle2D(5824,1464,6,22), // Fire Dungeon - new Rectangle2D(5224,3655,5,14) // T2A - }; + new Rectangle2D(1272,3712,20,30), // Jhelom + new Rectangle2D(1337,1444,52,48), // Britain + new Rectangle2D(2424,1098,28,20), // Trinsic + new Rectangle2D(2728,840,54,54), // Vesper + new Rectangle2D(4528,1314,28,20), // Moonglow + new Rectangle2D(712,1104,22,30), // Yew + new Rectangle2D(5824,1464,6,22), // Fire Dungeon + new Rectangle2D(5224,3655,5,14) // T2A + }; - public static void Initialize() - { - m_TotalZombieLimit = 200; - m_DeathQueueLimit = 200; - m_QueueDelaySeconds = 120; - m_QueueClearIntervalSeconds = 1800; + public static void Initialize() + { + m_TotalZombieLimit = 200; + m_DeathQueueLimit = 200; + m_QueueDelaySeconds = 120; + m_QueueClearIntervalSeconds = 1800; - DateTime today = DateTime.UtcNow; - TimeSpan tick = TimeSpan.FromSeconds( m_QueueDelaySeconds ); - TimeSpan clear = TimeSpan.FromSeconds( m_QueueClearIntervalSeconds ); + DateTime today = DateTime.UtcNow; + TimeSpan tick = TimeSpan.FromSeconds( m_QueueDelaySeconds ); + TimeSpan clear = TimeSpan.FromSeconds( m_QueueClearIntervalSeconds ); - ReAnimated = new Dictionary(); - m_DeathQueue = new List(); + ReAnimated = new Dictionary(); + m_DeathQueue = new List(); - if ( today >= HolidaySettings.StartHalloween && today <= HolidaySettings.FinishHalloween ) - { - m_Timer = Timer.DelayCall( tick, tick, Timer_Callback ); + if ( today >= HolidaySettings.StartHalloween && today <= HolidaySettings.FinishHalloween ) + { + m_Timer = Timer.DelayCall( tick, tick, Timer_Callback ); - m_ClearTimer = Timer.DelayCall( clear, clear, Clear_Callback ); + m_ClearTimer = Timer.DelayCall( clear, clear, Clear_Callback ); - EventSink.PlayerDeath += EventSink_PlayerDeath; - } - } + EventSink.PlayerDeath += EventSink_PlayerDeath; + } + } - public static void EventSink_PlayerDeath( PlayerDeathEventArgs e ) - { - if ( e.Mobile is PlayerMobile player && !player.Deleted && m_Timer.Running && !m_DeathQueue.Contains( player ) && m_DeathQueue.Count < m_DeathQueueLimit ) - m_DeathQueue.Add( player ); - } + public static void EventSink_PlayerDeath( PlayerDeathEventArgs e ) + { + if ( e.Mobile is PlayerMobile player && !player.Deleted && m_Timer.Running && !m_DeathQueue.Contains( player ) && m_DeathQueue.Count < m_DeathQueueLimit ) + m_DeathQueue.Add( player ); + } - private static void Clear_Callback() - { - ReAnimated.Clear(); + private static void Clear_Callback() + { + ReAnimated.Clear(); - m_DeathQueue.Clear(); + m_DeathQueue.Clear(); - if ( DateTime.UtcNow <= HolidaySettings.FinishHalloween ) - { - m_ClearTimer.Stop(); - } - } + if ( DateTime.UtcNow <= HolidaySettings.FinishHalloween ) + { + m_ClearTimer.Stop(); + } + } - private static void Timer_Callback() - { - PlayerMobile player = null; + private static void Timer_Callback() + { + PlayerMobile player = null; - if ( DateTime.UtcNow <= HolidaySettings.FinishHalloween ) - { - for( int index = 0; m_DeathQueue.Count > 0 && index < m_DeathQueue.Count; index++ ) - { - if ( !ReAnimated.ContainsKey( m_DeathQueue[ index ] ) ) - { - player = m_DeathQueue[ index ]; + if ( DateTime.UtcNow <= HolidaySettings.FinishHalloween ) + { + for( int index = 0; m_DeathQueue.Count > 0 && index < m_DeathQueue.Count; index++ ) + { + if ( !ReAnimated.ContainsKey( m_DeathQueue[ index ] ) ) + { + player = m_DeathQueue[ index ]; - break; - } - } + break; + } + } - if (player?.Deleted == false && ReAnimated.Count < m_TotalZombieLimit ) - { - Map map = Utility.RandomBool() ? Map.Trammel : Map.Felucca; + if (player?.Deleted == false && ReAnimated.Count < m_TotalZombieLimit ) + { + Map map = Utility.RandomBool() ? Map.Trammel : Map.Felucca; - Point3D home = ( GetRandomPointInRect( m_Cemetaries[ Utility.Random( m_Cemetaries.Length ) ], map )); + Point3D home = ( GetRandomPointInRect( m_Cemetaries[ Utility.Random( m_Cemetaries.Length ) ], map )); - if ( map.CanSpawnMobile( home ) ) - { - ZombieSkeleton zombieskel = new ZombieSkeleton( player ); + if ( map.CanSpawnMobile( home ) ) + { + ZombieSkeleton zombieskel = new ZombieSkeleton( player ); - ReAnimated.Add( player, zombieskel ); - zombieskel.Home = home; - zombieskel.RangeHome = 10; + ReAnimated.Add( player, zombieskel ); + zombieskel.Home = home; + zombieskel.RangeHome = 10; - zombieskel.MoveToWorld( home, map ); + zombieskel.MoveToWorld( home, map ); - m_DeathQueue.Remove( player ); - } - } - } - else - { - m_Timer.Stop(); - } - } + m_DeathQueue.Remove( player ); + } + } + } + else + { + m_Timer.Stop(); + } + } - private static Point3D GetRandomPointInRect( Rectangle2D rect, Map map ) - { - int x = Utility.Random( rect.X, rect.Width ); - int y = Utility.Random( rect.Y, rect.Height ); + private static Point3D GetRandomPointInRect( Rectangle2D rect, Map map ) + { + int x = Utility.Random( rect.X, rect.Width ); + int y = Utility.Random( rect.Y, rect.Height ); - return new Point3D( x, y, map.GetAverageZ( x, y ) ); - } - } + return new Point3D( x, y, map.GetAverageZ( x, y ) ); + } + } - public class PlayerBones : BaseContainer - { - [Constructible] - public PlayerBones( string name ) - : base( Utility.RandomMinMax( 0x0ECA, 0x0ED2 ) ) - { - Name = $"{name}'s bones"; + public class PlayerBones : BaseContainer + { + [Constructible] + public PlayerBones( string name ) + : base( Utility.RandomMinMax( 0x0ECA, 0x0ED2 ) ) + { + Name = $"{name}'s bones"; - switch( Utility.Random( 10 ) ) - { - case 0: Hue = 0xa09; break; - case 1: Hue = 0xa93; break; - case 2: Hue = 0xa47; break; - default: break; - } - } + switch( Utility.Random( 10 ) ) + { + case 0: Hue = 0xa09; break; + case 1: Hue = 0xa93; break; + case 2: Hue = 0xa47; break; + default: break; + } + } - public PlayerBones( Serial serial ) - : base( serial ) - { - } + public PlayerBones( Serial serial ) + : base( serial ) + { + } - public override void Serialize( GenericWriter writer ) - { - base.Serialize( writer ); - writer.Write( 0 ); - } + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + writer.Write( 0 ); + } - public override void Deserialize( GenericReader reader ) - { - base.Deserialize( reader ); - int version = reader.ReadInt(); - } - } + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + int version = reader.ReadInt(); + } + } - public class ZombieSkeleton : BaseCreature - { - public override string CorpseName => "a rotting corpse"; - private static readonly string m_Name = "Zombie Skeleton"; + public class ZombieSkeleton : BaseCreature + { + public override string CorpseName => "a rotting corpse"; + private static readonly string m_Name = "Zombie Skeleton"; - private PlayerMobile m_DeadPlayer; + private PlayerMobile m_DeadPlayer; - public ZombieSkeleton(PlayerMobile player = null) - : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 ) - { - m_DeadPlayer = player; + public ZombieSkeleton(PlayerMobile player = null) + : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 ) + { + m_DeadPlayer = player; - Name = player != null ? $"{player.Name}'s {m_Name}" : m_Name; + Name = player != null ? $"{player.Name}'s {m_Name}" : m_Name; - Body = 0x93; - BaseSoundID = 0x1c3; + Body = 0x93; + BaseSoundID = 0x1c3; - SetStr( 500 ); - SetDex( 500 ); - SetInt( 500 ); + SetStr( 500 ); + SetDex( 500 ); + SetInt( 500 ); - SetHits( 2500 ); - SetMana( 500 ); - SetStam( 500 ); + SetHits( 2500 ); + SetMana( 500 ); + SetStam( 500 ); - SetDamage( 8, 18 ); + SetDamage( 8, 18 ); - SetDamageType( ResistanceType.Physical, 40 ); - SetDamageType( ResistanceType.Cold, 60 ); + SetDamageType( ResistanceType.Physical, 40 ); + SetDamageType( ResistanceType.Cold, 60 ); - SetResistance( ResistanceType.Fire, 50 ); - SetResistance( ResistanceType.Energy, 50 ); - SetResistance( ResistanceType.Physical, 50 ); - SetResistance( ResistanceType.Cold, 50 ); - SetResistance( ResistanceType.Poison, 50 ); + SetResistance( ResistanceType.Fire, 50 ); + SetResistance( ResistanceType.Energy, 50 ); + SetResistance( ResistanceType.Physical, 50 ); + SetResistance( ResistanceType.Cold, 50 ); + SetResistance( ResistanceType.Poison, 50 ); - SetSkill( SkillName.MagicResist, 65.1, 80.0 ); - SetSkill( SkillName.Tactics, 95.1, 100 ); - SetSkill( SkillName.Wrestling, 85.1, 95 ); + SetSkill( SkillName.MagicResist, 65.1, 80.0 ); + SetSkill( SkillName.Tactics, 95.1, 100 ); + SetSkill( SkillName.Wrestling, 85.1, 95 ); - Fame = 1000; - Karma = -1000; + Fame = 1000; + Karma = -1000; - VirtualArmor = 18; - } + VirtualArmor = 18; + } - public override void GenerateLoot() - { - switch( Utility.Random( 10 ) ) - { - case 0: PackItem( new LeftArm() ); break; - case 1: PackItem( new RightArm() ); break; - case 2: PackItem( new Torso() ); break; - case 3: PackItem( new Bone() ); break; - case 4: PackItem( new RibCage() ); break; - case 5: if (m_DeadPlayer?.Deleted == false) { PackItem( new PlayerBones( m_DeadPlayer.Name ) ); } break; - default: break; - } + public override void GenerateLoot() + { + switch( Utility.Random( 10 ) ) + { + case 0: PackItem( new LeftArm() ); break; + case 1: PackItem( new RightArm() ); break; + case 2: PackItem( new Torso() ); break; + case 3: PackItem( new Bone() ); break; + case 4: PackItem( new RibCage() ); break; + case 5: if (m_DeadPlayer?.Deleted == false) { PackItem( new PlayerBones( m_DeadPlayer.Name ) ); } break; + default: break; + } - AddLoot( LootPack.Meager ); - } + AddLoot( LootPack.Meager ); + } - public override bool BleedImmune => true; + public override bool BleedImmune => true; - public override Poison PoisonImmune => Poison.Regular; + public override Poison PoisonImmune => Poison.Regular; - public ZombieSkeleton( Serial serial ) - : base( serial ) - { - } + public ZombieSkeleton( Serial serial ) + : base( serial ) + { + } - public override void OnDelete() - { - if ( HalloweenHauntings.ReAnimated != null ) - { - if (m_DeadPlayer?.Deleted == false) - { - if ( HalloweenHauntings.ReAnimated.ContainsKey( m_DeadPlayer ) ) - HalloweenHauntings.ReAnimated.Remove( m_DeadPlayer ); - } - } - } + public override void OnDelete() + { + if ( HalloweenHauntings.ReAnimated != null ) + { + if (m_DeadPlayer?.Deleted == false) + { + if ( HalloweenHauntings.ReAnimated.ContainsKey( m_DeadPlayer ) ) + HalloweenHauntings.ReAnimated.Remove( m_DeadPlayer ); + } + } + } - public override void Serialize( GenericWriter writer ) - { - base.Serialize( writer ); - writer.Write( 0 ); + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + writer.Write( 0 ); - writer.WriteMobile( m_DeadPlayer ); - } + writer.WriteMobile( m_DeadPlayer ); + } - public override void Deserialize( GenericReader reader ) - { - base.Deserialize( reader ); - int version = reader.ReadInt(); + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + int version = reader.ReadInt(); - m_DeadPlayer = reader.ReadMobile(); - } - } + m_DeadPlayer = reader.ReadMobile(); + } + } } diff --git a/Projects/Scripts/Holiday Stuff/Halloween/Treats/Jellybeans.cs b/Projects/Scripts/Holiday Stuff/Halloween/Treats/Jellybeans.cs index 29c41ee19..54459251a 100644 --- a/Projects/Scripts/Holiday Stuff/Halloween/Treats/Jellybeans.cs +++ b/Projects/Scripts/Holiday Stuff/Halloween/Treats/Jellybeans.cs @@ -3,10 +3,8 @@ public class JellyBeans : CandyCane { public JellyBeans(int amount = 1) - : base(0x468C) - { + : base(0x468C) => Stackable = true; - } public JellyBeans(Serial serial) : base(serial) diff --git a/Projects/Scripts/Holiday Stuff/Halloween/Treats/Lollipops.cs b/Projects/Scripts/Holiday Stuff/Halloween/Treats/Lollipops.cs index f4c2e3de4..86dfd1257 100644 --- a/Projects/Scripts/Holiday Stuff/Halloween/Treats/Lollipops.cs +++ b/Projects/Scripts/Holiday Stuff/Halloween/Treats/Lollipops.cs @@ -5,10 +5,8 @@ { [Constructible] public Lollipops(int amount = 1) - : base(0x468D + Utility.Random(3)) - { + : base(0x468D + Utility.Random(3)) => Stackable = true; - } public Lollipops(Serial serial) : base(serial) diff --git a/Projects/Scripts/Holiday Stuff/Halloween/Treats/NougatSwirl.cs b/Projects/Scripts/Holiday Stuff/Halloween/Treats/NougatSwirl.cs index d4eebd192..c21d13464 100644 --- a/Projects/Scripts/Holiday Stuff/Halloween/Treats/NougatSwirl.cs +++ b/Projects/Scripts/Holiday Stuff/Halloween/Treats/NougatSwirl.cs @@ -4,10 +4,8 @@ { [Constructible] public NougatSwirl(int amount = 1) - : base(0x4690) - { + : base(0x4690) => Stackable = true; - } public NougatSwirl(Serial serial) : base(serial) diff --git a/Projects/Scripts/Holiday Stuff/Halloween/Treats/Taffy.cs b/Projects/Scripts/Holiday Stuff/Halloween/Treats/Taffy.cs index ca74450e6..1c37f743d 100644 --- a/Projects/Scripts/Holiday Stuff/Halloween/Treats/Taffy.cs +++ b/Projects/Scripts/Holiday Stuff/Halloween/Treats/Taffy.cs @@ -3,10 +3,8 @@ public class Taffy : CandyCane { public Taffy(int amount = 1) - : base(0x469D) - { + : base(0x469D) => Stackable = true; - } public Taffy(Serial serial) : base(serial) diff --git a/Projects/Scripts/Holiday Stuff/Halloween/Treats/WrappedCandy.cs b/Projects/Scripts/Holiday Stuff/Halloween/Treats/WrappedCandy.cs index 5bd2e9ab5..cdeb8c250 100644 --- a/Projects/Scripts/Holiday Stuff/Halloween/Treats/WrappedCandy.cs +++ b/Projects/Scripts/Holiday Stuff/Halloween/Treats/WrappedCandy.cs @@ -3,10 +3,8 @@ public class WrappedCandy : CandyCane { public WrappedCandy(int amount = 1) - : base(0x469e) - { + : base(0x469e) => Stackable = true; - } public WrappedCandy(Serial serial) : base(serial) diff --git a/Projects/Scripts/Holiday Stuff/Valentine/2010/Items/AnimatedHeartShapedBox.cs b/Projects/Scripts/Holiday Stuff/Valentine/2010/Items/AnimatedHeartShapedBox.cs index 6981ac610..da4adc061 100644 --- a/Projects/Scripts/Holiday Stuff/Valentine/2010/Items/AnimatedHeartShapedBox.cs +++ b/Projects/Scripts/Holiday Stuff/Valentine/2010/Items/AnimatedHeartShapedBox.cs @@ -4,10 +4,7 @@ namespace Server.Items public class AnimatedHeartShapedBox : HeartShapedBox { [Constructible] - public AnimatedHeartShapedBox() - { - ItemID = 0x49CC; - } + public AnimatedHeartShapedBox() => ItemID = 0x49CC; public AnimatedHeartShapedBox(Serial serial) : base(serial) diff --git a/Projects/Scripts/Holiday Stuff/Valentine/2012/Items/CupidStatue.cs b/Projects/Scripts/Holiday Stuff/Valentine/2012/Items/CupidStatue.cs index 580d81a64..5ea488b64 100644 --- a/Projects/Scripts/Holiday Stuff/Valentine/2012/Items/CupidStatue.cs +++ b/Projects/Scripts/Holiday Stuff/Valentine/2012/Items/CupidStatue.cs @@ -5,10 +5,8 @@ namespace Server.Items { [Constructible] public CupidStatue() - : base(0x4F7D) - { + : base(0x4F7D) => LootType = LootType.Blessed; - } public CupidStatue(Serial serial) : base(serial) diff --git a/Projects/Scripts/Holiday Stuff/Valentine/2012/Items/CupidsArrow.cs b/Projects/Scripts/Holiday Stuff/Valentine/2012/Items/CupidsArrow.cs index 9c34c5824..124e0cc1b 100644 --- a/Projects/Scripts/Holiday Stuff/Valentine/2012/Items/CupidsArrow.cs +++ b/Projects/Scripts/Holiday Stuff/Valentine/2012/Items/CupidsArrow.cs @@ -3,127 +3,125 @@ using Server.Targeting; namespace Server.Items { - public class CupidsArrow : Item - { - // TODO: Check messages + public class CupidsArrow : Item + { + // TODO: Check messages - public override int LabelNumber => 1152270; // Cupid's Arrow 2012 + public override int LabelNumber => 1152270; // Cupid's Arrow 2012 - private string m_From; - private string m_To; + private string m_From; + private string m_To; - [CommandProperty( AccessLevel.GameMaster )] - public string From - { - get => m_From; - set { m_From = value; InvalidateProperties(); } - } + [CommandProperty( AccessLevel.GameMaster )] + public string From + { + get => m_From; + set { m_From = value; InvalidateProperties(); } + } - [CommandProperty( AccessLevel.GameMaster )] - public string To - { - get => m_To; - set { m_To = value; InvalidateProperties(); } - } + [CommandProperty( AccessLevel.GameMaster )] + public string To + { + get => m_To; + set { m_To = value; InvalidateProperties(); } + } - public bool IsSigned => ( m_From != null && m_To != null ); + public bool IsSigned => ( m_From != null && m_To != null ); - [Constructible] - public CupidsArrow() - : base( 0x4F7F ) - { - LootType = LootType.Blessed; - } + [Constructible] + public CupidsArrow() + : base( 0x4F7F ) => + LootType = LootType.Blessed; - public override void AddNameProperty( ObjectPropertyList list ) - { - base.AddNameProperty( list ); + public override void AddNameProperty( ObjectPropertyList list ) + { + base.AddNameProperty( list ); - if ( IsSigned ) - list.Add( 1152273, $"{m_From}\t{m_To}"); // ~1_val~ is madly in love with ~2_val~ - } + if ( IsSigned ) + list.Add( 1152273, $"{m_From}\t{m_To}"); // ~1_val~ is madly in love with ~2_val~ + } - public static bool CheckSeason( Mobile from ) - { - if ( DateTime.UtcNow.Month == 2 ) - return true; + public static bool CheckSeason( Mobile from ) + { + if ( DateTime.UtcNow.Month == 2 ) + return true; - from.SendLocalizedMessage( 1152318 ); // You may not use this item out of season. - return false; - } + from.SendLocalizedMessage( 1152318 ); // You may not use this item out of season. + return false; + } - public override void OnSingleClick( Mobile from ) - { - base.OnSingleClick( from ); + public override void OnSingleClick( Mobile from ) + { + base.OnSingleClick( from ); - if ( IsSigned ) - LabelTo( from, 1152273, $"{m_From}\t{m_To}"); // ~1_val~ is madly in love with ~2_val~ - } + if ( IsSigned ) + LabelTo( from, 1152273, $"{m_From}\t{m_To}"); // ~1_val~ is madly in love with ~2_val~ + } - public override void OnDoubleClick( Mobile from ) - { - if ( IsSigned || !CheckSeason( from ) ) - return; + public override void OnDoubleClick( Mobile from ) + { + if ( IsSigned || !CheckSeason( from ) ) + return; - if ( !IsChildOf( from.Backpack ) ) - { - from.SendLocalizedMessage( 1080063 ); // This must be in your backpack to use it. - return; - } + if ( !IsChildOf( from.Backpack ) ) + { + from.SendLocalizedMessage( 1080063 ); // This must be in your backpack to use it. + return; + } - from.BeginTarget( 10, false, TargetFlags.None, OnTarget ); - from.SendMessage( "Who do you wish to use this on?" ); - } + from.BeginTarget( 10, false, TargetFlags.None, OnTarget ); + from.SendMessage( "Who do you wish to use this on?" ); + } - private void OnTarget( Mobile from, object targeted ) - { - if ( IsSigned || !IsChildOf( from.Backpack ) ) - return; + private void OnTarget( Mobile from, object targeted ) + { + if ( IsSigned || !IsChildOf( from.Backpack ) ) + return; - if ( targeted is Mobile m ) - { - if ( !m.Alive ) - { - from.SendLocalizedMessage( 1152269 ); // That target is dead and even Cupid's arrow won't make them love you. - return; - } + if ( targeted is Mobile m ) + { + if ( !m.Alive ) + { + from.SendLocalizedMessage( 1152269 ); // That target is dead and even Cupid's arrow won't make them love you. + return; + } - m_From = from.Name; - m_To = m.Name; + m_From = from.Name; + m_To = m.Name; - InvalidateProperties(); + InvalidateProperties(); - from.SendMessage( "You inscribe the arrow." ); - } - else - { - from.SendMessage( "That is not a person." ); - } - } + from.SendMessage( "You inscribe the arrow." ); + } + else + { + from.SendMessage( "That is not a person." ); + } + } - public CupidsArrow( Serial serial ) - : base( serial ) - { - } + public CupidsArrow( Serial serial ) + : base( serial ) + { + } - public override void Serialize( GenericWriter writer ) - { - base.Serialize( writer ); + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); - writer.Write( 0 ); + writer.Write( 0 ); - writer.Write( m_From ); - writer.Write( m_To ); - } + writer.Write( m_From ); + writer.Write( m_To ); + } - public override void Deserialize( GenericReader reader ) - { - base.Deserialize( reader ); + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); - int version = reader.ReadInt(); + int version = reader.ReadInt(); - m_From = Utility.Intern( reader.ReadString() ); - m_To = Utility.Intern( reader.ReadString() ); - } - } + m_From = Utility.Intern( reader.ReadString() ); + m_To = Utility.Intern( reader.ReadString() ); + } + } } diff --git a/Projects/Scripts/Items/Addons/AddonComponent.cs b/Projects/Scripts/Items/Addons/AddonComponent.cs index a3d5ed2ec..8fafc77fa 100644 --- a/Projects/Scripts/Items/Addons/AddonComponent.cs +++ b/Projects/Scripts/Items/Addons/AddonComponent.cs @@ -61,10 +61,7 @@ namespace Server.Items private int m_LabelNumber; [Constructible] - public LocalizedAddonComponent(int itemID, int labelNumber) : base(itemID) - { - m_LabelNumber = labelNumber; - } + public LocalizedAddonComponent(int itemID, int labelNumber) : base(itemID) => m_LabelNumber = labelNumber; public LocalizedAddonComponent(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Addons/AddonContainerComponent.cs b/Projects/Scripts/Items/Addons/AddonContainerComponent.cs index 08cb07d44..d63cf46f5 100644 --- a/Projects/Scripts/Items/Addons/AddonContainerComponent.cs +++ b/Projects/Scripts/Items/Addons/AddonContainerComponent.cs @@ -114,10 +114,7 @@ namespace Server.Items { private int m_LabelNumber; - public LocalizedContainerComponent(int itemID, int labelNumber) : base(itemID) - { - m_LabelNumber = labelNumber; - } + public LocalizedContainerComponent(int itemID, int labelNumber) : base(itemID) => m_LabelNumber = labelNumber; public LocalizedContainerComponent(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Addons/ArcheryButteAddon.cs b/Projects/Scripts/Items/Addons/ArcheryButteAddon.cs index aa04779d6..5e32e5fa9 100644 --- a/Projects/Scripts/Items/Addons/ArcheryButteAddon.cs +++ b/Projects/Scripts/Items/Addons/ArcheryButteAddon.cs @@ -4,327 +4,327 @@ using Server.Network; namespace Server.Items { - [FlippableAttribute( 0x100A/*East*/, 0x100B/*South*/ )] - public class ArcheryButte : AddonComponent - { - [CommandProperty( AccessLevel.GameMaster )] - public double MinSkill { get; set; } + [FlippableAttribute( 0x100A/*East*/, 0x100B/*South*/ )] + public class ArcheryButte : AddonComponent + { + [CommandProperty( AccessLevel.GameMaster )] + public double MinSkill { get; set; } - [CommandProperty( AccessLevel.GameMaster )] - public double MaxSkill { get; set; } - - [CommandProperty( AccessLevel.GameMaster )] - public DateTime LastUse { get; set; } - - [CommandProperty( AccessLevel.GameMaster )] - public bool FacingEast - { - get => ItemID == 0x100A; - set => ItemID = value ? 0x100A : 0x100B; - } - - [CommandProperty( AccessLevel.GameMaster )] - public int Arrows { get; set; } - - [CommandProperty( AccessLevel.GameMaster )] - public int Bolts { get; set; } - - public ArcheryButte(int itemID = 0x100A) : base(itemID) - { - MinSkill = -25.0; - MaxSkill = +25.0; - } - - public ArcheryButte( Serial serial ) : base( serial ) - { - } - - public override void OnDoubleClick( Mobile from ) - { - if ( (Arrows > 0 || Bolts > 0) && from.InRange( GetWorldLocation(), 1 ) ) - Gather( from ); - else - Fire( from ); - } - - public void Gather( Mobile from ) - { - from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500592 ); // You gather the arrows and bolts. - - if ( Arrows > 0 ) - from.AddToBackpack( new Arrow( Arrows ) ); - - if ( Bolts > 0 ) - from.AddToBackpack( new Bolt( Bolts ) ); - - Arrows = 0; - Bolts = 0; - - m_Entries = null; - } - - private static TimeSpan UseDelay = TimeSpan.FromSeconds( 2.0 ); - - private class ScoreEntry - { - public int Total { get; set; } - - public int Count { get; set; } - - public void Record( int score ) - { - Total += score; - Count += 1; - } + [CommandProperty( AccessLevel.GameMaster )] + public double MaxSkill { get; set; } + + [CommandProperty( AccessLevel.GameMaster )] + public DateTime LastUse { get; set; } + + [CommandProperty( AccessLevel.GameMaster )] + public bool FacingEast + { + get => ItemID == 0x100A; + set => ItemID = value ? 0x100A : 0x100B; + } + + [CommandProperty( AccessLevel.GameMaster )] + public int Arrows { get; set; } + + [CommandProperty( AccessLevel.GameMaster )] + public int Bolts { get; set; } + + public ArcheryButte(int itemID = 0x100A) : base(itemID) + { + MinSkill = -25.0; + MaxSkill = +25.0; + } + + public ArcheryButte( Serial serial ) : base( serial ) + { + } + + public override void OnDoubleClick( Mobile from ) + { + if ( (Arrows > 0 || Bolts > 0) && from.InRange( GetWorldLocation(), 1 ) ) + Gather( from ); + else + Fire( from ); + } + + public void Gather( Mobile from ) + { + from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500592 ); // You gather the arrows and bolts. + + if ( Arrows > 0 ) + from.AddToBackpack( new Arrow( Arrows ) ); + + if ( Bolts > 0 ) + from.AddToBackpack( new Bolt( Bolts ) ); + + Arrows = 0; + Bolts = 0; + + m_Entries = null; + } + + private static TimeSpan UseDelay = TimeSpan.FromSeconds( 2.0 ); + + private class ScoreEntry + { + public int Total { get; set; } + + public int Count { get; set; } + + public void Record( int score ) + { + Total += score; + Count += 1; + } - public ScoreEntry() - { - } - } + public ScoreEntry() + { + } + } - private Dictionary m_Entries; + private Dictionary m_Entries; - private ScoreEntry GetEntryFor( Mobile from ) - { - if ( m_Entries == null ) - m_Entries = new Dictionary(); - - if (!m_Entries.TryGetValue(from, out ScoreEntry e)) - m_Entries[from] = e = new ScoreEntry(); - - return e; - } - - public void Fire( Mobile from ) - { - if ( !(from.Weapon is BaseRanged bow) ) - { - SendLocalizedMessageTo( from, 500593 ); // You must practice with ranged weapons on this. - return; - } - - if ( DateTime.UtcNow < (LastUse + UseDelay) ) - return; - - Point3D worldLoc = GetWorldLocation(); - - if ( FacingEast ? from.X <= worldLoc.X : from.Y <= worldLoc.Y ) - { - from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500596 ); // You would do better to stand in front of the archery butte. - return; - } - - if ( FacingEast ? from.Y != worldLoc.Y : from.X != worldLoc.X ) - { - from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500597 ); // You aren't properly lined up with the archery butte to get an accurate shot. - return; - } - - if ( !from.InRange( worldLoc, 6 ) ) - { - from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500598 ); // You are too far away from the archery butte to get an accurate shot. - return; - } - - if ( from.InRange( worldLoc, 4 ) ) - { - from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500599 ); // You are too close to the target. - return; - } - - Container pack = from.Backpack; - Type ammoType = bow.AmmoType; - - bool isArrow = ammoType == typeof( Arrow ); - bool isBolt = ammoType == typeof( Bolt ); - bool isKnown = isArrow || isBolt; - - if (pack?.ConsumeTotal( ammoType ) != true) - { - if ( isArrow ) - from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500594 ); // You do not have any arrows with which to practice. - else if ( isBolt ) - from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500595 ); // You do not have any crossbow bolts with which to practice. - else - SendLocalizedMessageTo( from, 500593 ); // You must practice with ranged weapons on this. - - return; - } - - LastUse = DateTime.UtcNow; - - from.Direction = from.GetDirectionTo( GetWorldLocation() ); - bow.PlaySwingAnimation( from ); - from.MovingEffect( this, bow.EffectID, 18, 1, false, false ); - - ScoreEntry se = GetEntryFor( from ); - - if ( !from.CheckSkill( bow.Skill, MinSkill, MaxSkill ) ) - { - from.PlaySound( bow.MissSound ); - - PublicOverheadMessage( MessageType.Regular, 0x3B2, 500604, from.Name ); // You miss the target altogether. - - se.Record( 0 ); - - if ( se.Count == 1 ) - PublicOverheadMessage( MessageType.Regular, 0x3B2, 1062719, se.Total.ToString() ); - else - PublicOverheadMessage( MessageType.Regular, 0x3B2, 1042683, $"{se.Total}\t{se.Count}"); - - return; - } - - Effects.PlaySound( Location, Map, 0x2B1 ); - - double rand = Utility.RandomDouble(); - - int area, score, splitScore; - - if ( 0.10 > rand ) - { - area = 0; // bullseye - score = 50; - splitScore = 100; - } - else if ( 0.25 > rand ) - { - area = 1; // inner ring - score = 10; - splitScore = 20; - } - else if ( 0.50 > rand ) - { - area = 2; // middle ring - score = 5; - splitScore = 15; - } - else - { - area = 3; // outer ring - score = 2; - splitScore = 5; - } - - bool split = ( isKnown && ((Arrows + Bolts) * 0.02) > Utility.RandomDouble() ); - - if ( split ) - { - PublicOverheadMessage( MessageType.Regular, 0x3B2, 1010027 + area, - $"{from.Name}\t{(isArrow ? "arrow" : "bolt")}"); - } - else - { - PublicOverheadMessage( MessageType.Regular, 0x3B2, 1010035 + area, from.Name ); - - if ( isArrow ) - ++Arrows; - else if ( isBolt ) - ++Bolts; - } - - se.Record( split ? splitScore : score ); - - if ( se.Count == 1 ) - PublicOverheadMessage( MessageType.Regular, 0x3B2, 1062719, se.Total.ToString() ); - else - PublicOverheadMessage( MessageType.Regular, 0x3B2, 1042683, $"{se.Total}\t{se.Count}"); - } - - public override void Serialize( GenericWriter writer ) - { - base.Serialize( writer ); - - writer.Write( 0 ); - - writer.Write( MinSkill ); - writer.Write( MaxSkill ); - writer.Write( Arrows ); - writer.Write( Bolts ); - } - - public override void Deserialize( GenericReader reader ) - { - base.Deserialize( reader ); - - int version = reader.ReadInt(); - - switch ( version ) - { - case 0: - { - MinSkill = reader.ReadDouble(); - MaxSkill = reader.ReadDouble(); - Arrows = reader.ReadInt(); - Bolts = reader.ReadInt(); - - if ( MinSkill == 0.0 && MaxSkill == 30.0 ) - { - MinSkill = -25.0; - MaxSkill = +25.0; - } - - break; - } - } - } - } - - public class ArcheryButteAddon : BaseAddon - { - public override BaseAddonDeed Deed => new ArcheryButteDeed(); - - [Constructible] - public ArcheryButteAddon() - { - AddComponent( new ArcheryButte(), 0, 0, 0 ); - } - - public ArcheryButteAddon( Serial serial ) : base( serial ) - { - } - - public override void Serialize( GenericWriter writer ) - { - base.Serialize( writer ); - - writer.Write( 0 ); // version - } - - public override void Deserialize( GenericReader reader ) - { - base.Deserialize( reader ); - - int version = reader.ReadInt(); - } - } - - public class ArcheryButteDeed : BaseAddonDeed - { - public override BaseAddon Addon => new ArcheryButteAddon(); - public override int LabelNumber => 1024106; // archery butte - - [Constructible] - public ArcheryButteDeed() - { - } - - public ArcheryButteDeed( Serial serial ) : base( serial ) - { - } - - public override void Serialize( GenericWriter writer ) - { - base.Serialize( writer ); - - writer.Write( 0 ); // version - } - - public override void Deserialize( GenericReader reader ) - { - base.Deserialize( reader ); - - int version = reader.ReadInt(); - } - } + private ScoreEntry GetEntryFor( Mobile from ) + { + if ( m_Entries == null ) + m_Entries = new Dictionary(); + + if (!m_Entries.TryGetValue(from, out ScoreEntry e)) + m_Entries[from] = e = new ScoreEntry(); + + return e; + } + + public void Fire( Mobile from ) + { + if ( !(from.Weapon is BaseRanged bow) ) + { + SendLocalizedMessageTo( from, 500593 ); // You must practice with ranged weapons on this. + return; + } + + if ( DateTime.UtcNow < (LastUse + UseDelay) ) + return; + + Point3D worldLoc = GetWorldLocation(); + + if ( FacingEast ? from.X <= worldLoc.X : from.Y <= worldLoc.Y ) + { + from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500596 ); // You would do better to stand in front of the archery butte. + return; + } + + if ( FacingEast ? from.Y != worldLoc.Y : from.X != worldLoc.X ) + { + from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500597 ); // You aren't properly lined up with the archery butte to get an accurate shot. + return; + } + + if ( !from.InRange( worldLoc, 6 ) ) + { + from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500598 ); // You are too far away from the archery butte to get an accurate shot. + return; + } + + if ( from.InRange( worldLoc, 4 ) ) + { + from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500599 ); // You are too close to the target. + return; + } + + Container pack = from.Backpack; + Type ammoType = bow.AmmoType; + + bool isArrow = ammoType == typeof( Arrow ); + bool isBolt = ammoType == typeof( Bolt ); + bool isKnown = isArrow || isBolt; + + if (pack?.ConsumeTotal( ammoType ) != true) + { + if ( isArrow ) + from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500594 ); // You do not have any arrows with which to practice. + else if ( isBolt ) + from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500595 ); // You do not have any crossbow bolts with which to practice. + else + SendLocalizedMessageTo( from, 500593 ); // You must practice with ranged weapons on this. + + return; + } + + LastUse = DateTime.UtcNow; + + from.Direction = from.GetDirectionTo( GetWorldLocation() ); + bow.PlaySwingAnimation( from ); + from.MovingEffect( this, bow.EffectID, 18, 1, false, false ); + + ScoreEntry se = GetEntryFor( from ); + + if ( !from.CheckSkill( bow.Skill, MinSkill, MaxSkill ) ) + { + from.PlaySound( bow.MissSound ); + + PublicOverheadMessage( MessageType.Regular, 0x3B2, 500604, from.Name ); // You miss the target altogether. + + se.Record( 0 ); + + if ( se.Count == 1 ) + PublicOverheadMessage( MessageType.Regular, 0x3B2, 1062719, se.Total.ToString() ); + else + PublicOverheadMessage( MessageType.Regular, 0x3B2, 1042683, $"{se.Total}\t{se.Count}"); + + return; + } + + Effects.PlaySound( Location, Map, 0x2B1 ); + + double rand = Utility.RandomDouble(); + + int area, score, splitScore; + + if ( 0.10 > rand ) + { + area = 0; // bullseye + score = 50; + splitScore = 100; + } + else if ( 0.25 > rand ) + { + area = 1; // inner ring + score = 10; + splitScore = 20; + } + else if ( 0.50 > rand ) + { + area = 2; // middle ring + score = 5; + splitScore = 15; + } + else + { + area = 3; // outer ring + score = 2; + splitScore = 5; + } + + bool split = ( isKnown && ((Arrows + Bolts) * 0.02) > Utility.RandomDouble() ); + + if ( split ) + { + PublicOverheadMessage( MessageType.Regular, 0x3B2, 1010027 + area, + $"{from.Name}\t{(isArrow ? "arrow" : "bolt")}"); + } + else + { + PublicOverheadMessage( MessageType.Regular, 0x3B2, 1010035 + area, from.Name ); + + if ( isArrow ) + ++Arrows; + else if ( isBolt ) + ++Bolts; + } + + se.Record( split ? splitScore : score ); + + if ( se.Count == 1 ) + PublicOverheadMessage( MessageType.Regular, 0x3B2, 1062719, se.Total.ToString() ); + else + PublicOverheadMessage( MessageType.Regular, 0x3B2, 1042683, $"{se.Total}\t{se.Count}"); + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.Write( 0 ); + + writer.Write( MinSkill ); + writer.Write( MaxSkill ); + writer.Write( Arrows ); + writer.Write( Bolts ); + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + int version = reader.ReadInt(); + + switch ( version ) + { + case 0: + { + MinSkill = reader.ReadDouble(); + MaxSkill = reader.ReadDouble(); + Arrows = reader.ReadInt(); + Bolts = reader.ReadInt(); + + if ( MinSkill == 0.0 && MaxSkill == 30.0 ) + { + MinSkill = -25.0; + MaxSkill = +25.0; + } + + break; + } + } + } + } + + public class ArcheryButteAddon : BaseAddon + { + public override BaseAddonDeed Deed => new ArcheryButteDeed(); + + [Constructible] + public ArcheryButteAddon() + { + AddComponent( new ArcheryButte(), 0, 0, 0 ); + } + + public ArcheryButteAddon( Serial serial ) : base( serial ) + { + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.Write( 0 ); // version + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + int version = reader.ReadInt(); + } + } + + public class ArcheryButteDeed : BaseAddonDeed + { + public override BaseAddon Addon => new ArcheryButteAddon(); + public override int LabelNumber => 1024106; // archery butte + + [Constructible] + public ArcheryButteDeed() + { + } + + public ArcheryButteDeed( Serial serial ) : base( serial ) + { + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.Write( 0 ); // version + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + int version = reader.ReadInt(); + } + } } diff --git a/Projects/Scripts/Items/Addons/BallotBox.cs b/Projects/Scripts/Items/Addons/BallotBox.cs index e69bebaa4..941e8037f 100644 --- a/Projects/Scripts/Items/Addons/BallotBox.cs +++ b/Projects/Scripts/Items/Addons/BallotBox.cs @@ -67,10 +67,7 @@ namespace Server.Items return house?.IsOwner(from) == true; } - public bool HasVoted(Mobile from) - { - return Yes.Contains(from) || No.Contains(from); - } + public bool HasVoted(Mobile from) => Yes.Contains(from) || No.Contains(from); public override bool OnDragDrop(Mobile from, Item dropped) { @@ -271,10 +268,7 @@ namespace Server.Items { private BallotBox m_Box; - public TopicPrompt(BallotBox box) - { - m_Box = box; - } + public TopicPrompt(BallotBox box) => m_Box = box; public override void OnResponse(Mobile from, string text) { diff --git a/Projects/Scripts/Items/Addons/BaseAddon.cs b/Projects/Scripts/Items/Addons/BaseAddon.cs index 3f889fdc2..09f1a2d62 100644 --- a/Projects/Scripts/Items/Addons/BaseAddon.cs +++ b/Projects/Scripts/Items/Addons/BaseAddon.cs @@ -163,10 +163,7 @@ namespace Server.Items return AddonFitResult.Valid; } - public static bool CheckHouse(Mobile from, Point3D p, Map map, int height, ref BaseHouse house) - { - return from == null || BaseHouse.FindHouseAt(p, map, height)?.IsOwner(from) == true; - } + public static bool CheckHouse(Mobile from, Point3D p, Map map, int height, ref BaseHouse house) => from == null || BaseHouse.FindHouseAt(p, map, height)?.IsOwner(from) == true; public static bool IsWall(int x, int y, int z, Map map) { diff --git a/Projects/Scripts/Items/Addons/SHTeleporter.cs b/Projects/Scripts/Items/Addons/SHTeleporter.cs index a716ddbe4..73210e1bb 100644 --- a/Projects/Scripts/Items/Addons/SHTeleporter.cs +++ b/Projects/Scripts/Items/Addons/SHTeleporter.cs @@ -162,10 +162,7 @@ namespace Server.Items AddComponent(LeftTele, 0, 1, 0); } - public SHTeleporter(Serial serial) : base(serial) - { - m_Changing = false; - } + public SHTeleporter(Serial serial) : base(serial) => m_Changing = false; [CommandProperty(AccessLevel.GameMaster)] public bool External{ get; private set; } @@ -301,10 +298,7 @@ namespace Server.Items { private int m_Count; - public SHTeleporterCreator() - { - m_Count = 0; - } + public SHTeleporterCreator() => m_Count = 0; public static SHTeleporter FindSHTeleporter(Map map, Point3D p) { diff --git a/Projects/Scripts/Items/Aquarium/Aquarium.cs b/Projects/Scripts/Items/Aquarium/Aquarium.cs index 417a225f3..5caec12ea 100644 --- a/Projects/Scripts/Items/Aquarium/Aquarium.cs +++ b/Projects/Scripts/Items/Aquarium/Aquarium.cs @@ -174,13 +174,11 @@ namespace Server.Items ExamineAquarium(from); } - public virtual bool HasAccess(Mobile from) - { - return from?.Deleted == false && ( - from.AccessLevel >= AccessLevel.GameMaster || - BaseHouse.FindHouseAt(this)?.IsCoOwner(from) == true + public virtual bool HasAccess(Mobile from) => + from?.Deleted == false && ( + from.AccessLevel >= AccessLevel.GameMaster || + BaseHouse.FindHouseAt(this)?.IsCoOwner(from) == true ); - } public override bool OnDragDrop(Mobile from, Item dropped) { @@ -525,10 +523,7 @@ namespace Server.Items return 1074236 + m_Food.State; } - public int WaterNumber() - { - return 1074242 + m_Water.State; - } + public int WaterNumber() => 1074242 + m_Water.State; #endregion @@ -822,10 +817,7 @@ namespace Server.Items from.PlaySound(0x5A4); } - public virtual bool AddFish(BaseFish fish) - { - return AddFish(null, fish); - } + public virtual bool AddFish(BaseFish fish) => AddFish(null, fish); public virtual bool AddFish(Mobile from, BaseFish fish) { @@ -851,10 +843,7 @@ namespace Server.Items return true; } - public virtual bool AddDecoration(Item item) - { - return AddDecoration(null, item); - } + public virtual bool AddDecoration(Item item) => AddDecoration(null, item); public virtual bool AddDecoration(Mobile from, Item item) { @@ -936,9 +925,8 @@ namespace Server.Items private Aquarium m_Aquarium; public ExamineEntry(Aquarium aquarium) : base(6235, 2) // Examine Aquarium - { - m_Aquarium = aquarium; - } + => + m_Aquarium = aquarium; public override void OnClick() { @@ -954,9 +942,8 @@ namespace Server.Items private Aquarium m_Aquarium; public CollectRewardEntry(Aquarium aquarium) : base(6237, 2) // Collect Reward - { - m_Aquarium = aquarium; - } + => + m_Aquarium = aquarium; public override void OnClick() { @@ -972,9 +959,8 @@ namespace Server.Items private Aquarium m_Aquarium; public ViewEventEntry(Aquarium aquarium) : base(6239, 2) // View events - { - m_Aquarium = aquarium; - } + => + m_Aquarium = aquarium; public override void OnClick() { @@ -996,9 +982,8 @@ namespace Server.Items private Aquarium m_Aquarium; public CancelVacationMode(Aquarium aquarium) : base(6240, 2) // Cancel vacation mode - { - m_Aquarium = aquarium; - } + => + m_Aquarium = aquarium; public override void OnClick() { @@ -1017,9 +1002,8 @@ namespace Server.Items private Aquarium m_Aquarium; public GMAddFood(Aquarium aquarium) : base(6231) // GM Add Food - { - m_Aquarium = aquarium; - } + => + m_Aquarium = aquarium; public override void OnClick() { @@ -1036,9 +1020,8 @@ namespace Server.Items private Aquarium m_Aquarium; public GMAddWater(Aquarium aquarium) : base(6232) // GM Add Water - { - m_Aquarium = aquarium; - } + => + m_Aquarium = aquarium; public override void OnClick() { @@ -1055,9 +1038,8 @@ namespace Server.Items private Aquarium m_Aquarium; public GMForceEvaluate(Aquarium aquarium) : base(6233) // GM Force Evaluate - { - m_Aquarium = aquarium; - } + => + m_Aquarium = aquarium; public override void OnClick() { @@ -1073,9 +1055,8 @@ namespace Server.Items private Aquarium m_Aquarium; public GMOpen(Aquarium aquarium) : base(6234) // GM Open Container - { - m_Aquarium = aquarium; - } + => + m_Aquarium = aquarium; public override void OnClick() { @@ -1091,9 +1072,8 @@ namespace Server.Items private Aquarium m_Aquarium; public GMFill(Aquarium aquarium) : base(6236) // GM Fill Food and Water - { - m_Aquarium = aquarium; - } + => + m_Aquarium = aquarium; public override void OnClick() { diff --git a/Projects/Scripts/Items/Aquarium/AquariumState.cs b/Projects/Scripts/Items/Aquarium/AquariumState.cs index 52ff6ad82..7b7e16eda 100644 --- a/Projects/Scripts/Items/Aquarium/AquariumState.cs +++ b/Projects/Scripts/Items/Aquarium/AquariumState.cs @@ -48,10 +48,7 @@ namespace Server.Items [CommandProperty(AccessLevel.GameMaster)] public int Added{ get; set; } - public override string ToString() - { - return "..."; - } + public override string ToString() => "..."; public virtual void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Items/Aquarium/Fish/AlbinoFrog.cs b/Projects/Scripts/Items/Aquarium/Fish/AlbinoFrog.cs index 93028fa68..3fb814e20 100644 --- a/Projects/Scripts/Items/Aquarium/Fish/AlbinoFrog.cs +++ b/Projects/Scripts/Items/Aquarium/Fish/AlbinoFrog.cs @@ -3,10 +3,7 @@ namespace Server.Items public class AlbinoFrog : BaseFish { [Constructible] - public AlbinoFrog() : base(0x3B0D) - { - Hue = 0x47E; - } + public AlbinoFrog() : base(0x3B0D) => Hue = 0x47E; public AlbinoFrog(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Aquarium/Fish/LongClawCrab.cs b/Projects/Scripts/Items/Aquarium/Fish/LongClawCrab.cs index f6d0d0cde..0b82fec9b 100644 --- a/Projects/Scripts/Items/Aquarium/Fish/LongClawCrab.cs +++ b/Projects/Scripts/Items/Aquarium/Fish/LongClawCrab.cs @@ -3,10 +3,7 @@ namespace Server.Items public class LongClawCrab : BaseFish { [Constructible] - public LongClawCrab() : base(0x3AFC) - { - Hue = 0x527; - } + public LongClawCrab() : base(0x3AFC) => Hue = 0x527; public LongClawCrab(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Aquarium/Fish/PurpleFrog.cs b/Projects/Scripts/Items/Aquarium/Fish/PurpleFrog.cs index 2ad0748d9..daf15d04e 100644 --- a/Projects/Scripts/Items/Aquarium/Fish/PurpleFrog.cs +++ b/Projects/Scripts/Items/Aquarium/Fish/PurpleFrog.cs @@ -3,10 +3,7 @@ namespace Server.Items public class PurpleFrog : BaseFish { [Constructible] - public PurpleFrog() : base(0x3B0D) - { - Hue = 0x4FA; - } + public PurpleFrog() : base(0x3B0D) => Hue = 0x4FA; public PurpleFrog(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Aquarium/FishBowl.cs b/Projects/Scripts/Items/Aquarium/FishBowl.cs index 97477ff16..df70f5506 100644 --- a/Projects/Scripts/Items/Aquarium/FishBowl.cs +++ b/Projects/Scripts/Items/Aquarium/FishBowl.cs @@ -136,9 +136,8 @@ namespace Server.Items private FishBowl m_Bowl; public RemoveCreature(FishBowl bowl) : base(6242, 3) // Remove creature - { - m_Bowl = bowl; - } + => + m_Bowl = bowl; public override void OnClick() { diff --git a/Projects/Scripts/Items/Armor/BaseArmor.cs b/Projects/Scripts/Items/Armor/BaseArmor.cs index 7ff3bdfdf..fcdfa6688 100644 --- a/Projects/Scripts/Items/Armor/BaseArmor.cs +++ b/Projects/Scripts/Items/Armor/BaseArmor.cs @@ -913,10 +913,7 @@ namespace Server.Items flags |= toSet; } - private static bool GetSaveFlag(SaveFlag flags, SaveFlag toGet) - { - return (flags & toGet) != 0; - } + private static bool GetSaveFlag(SaveFlag flags, SaveFlag toGet) => (flags & toGet) != 0; public override void Serialize(GenericWriter writer) { @@ -1459,10 +1456,7 @@ namespace Server.Items base.OnRemoved(parent); } - private string GetNameString() - { - return Name ?? $"#{LabelNumber}"; - } + private string GetNameString() => Name ?? $"#{LabelNumber}"; public override void AddNameProperty(ObjectPropertyList list) { diff --git a/Projects/Scripts/Items/Armor/Bone/BoneArms.cs b/Projects/Scripts/Items/Armor/Bone/BoneArms.cs index 094b7be0d..46b0c892c 100644 --- a/Projects/Scripts/Items/Armor/Bone/BoneArms.cs +++ b/Projects/Scripts/Items/Armor/Bone/BoneArms.cs @@ -4,10 +4,7 @@ namespace Server.Items public class BoneArms : BaseArmor { [Constructible] - public BoneArms() : base(0x144E) - { - Weight = 2.0; - } + public BoneArms() : base(0x144E) => Weight = 2.0; public BoneArms(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Bone/BoneChest.cs b/Projects/Scripts/Items/Armor/Bone/BoneChest.cs index e5b29489a..eb72fe478 100644 --- a/Projects/Scripts/Items/Armor/Bone/BoneChest.cs +++ b/Projects/Scripts/Items/Armor/Bone/BoneChest.cs @@ -4,10 +4,7 @@ namespace Server.Items public class BoneChest : BaseArmor { [Constructible] - public BoneChest() : base(0x144F) - { - Weight = 6.0; - } + public BoneChest() : base(0x144F) => Weight = 6.0; public BoneChest(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Bone/BoneGloves.cs b/Projects/Scripts/Items/Armor/Bone/BoneGloves.cs index d8b829cef..21a7d78d3 100644 --- a/Projects/Scripts/Items/Armor/Bone/BoneGloves.cs +++ b/Projects/Scripts/Items/Armor/Bone/BoneGloves.cs @@ -4,10 +4,7 @@ namespace Server.Items public class BoneGloves : BaseArmor { [Constructible] - public BoneGloves() : base(0x1450) - { - Weight = 2.0; - } + public BoneGloves() : base(0x1450) => Weight = 2.0; public BoneGloves(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Bone/BoneLegs.cs b/Projects/Scripts/Items/Armor/Bone/BoneLegs.cs index 30da8fd19..8b34c3f9e 100644 --- a/Projects/Scripts/Items/Armor/Bone/BoneLegs.cs +++ b/Projects/Scripts/Items/Armor/Bone/BoneLegs.cs @@ -4,10 +4,7 @@ namespace Server.Items public class BoneLegs : BaseArmor { [Constructible] - public BoneLegs() : base(0x1452) - { - Weight = 3.0; - } + public BoneLegs() : base(0x1452) => Weight = 3.0; public BoneLegs(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Chain/ChainChest.cs b/Projects/Scripts/Items/Armor/Chain/ChainChest.cs index d572b5731..8af7391d5 100644 --- a/Projects/Scripts/Items/Armor/Chain/ChainChest.cs +++ b/Projects/Scripts/Items/Armor/Chain/ChainChest.cs @@ -4,10 +4,7 @@ namespace Server.Items public class ChainChest : BaseArmor { [Constructible] - public ChainChest() : base(0x13BF) - { - Weight = 7.0; - } + public ChainChest() : base(0x13BF) => Weight = 7.0; public ChainChest(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Chain/ChainHatsuburi.cs b/Projects/Scripts/Items/Armor/Chain/ChainHatsuburi.cs index f47e71394..e8b7835c2 100644 --- a/Projects/Scripts/Items/Armor/Chain/ChainHatsuburi.cs +++ b/Projects/Scripts/Items/Armor/Chain/ChainHatsuburi.cs @@ -3,10 +3,7 @@ namespace Server.Items public class ChainHatsuburi : BaseArmor { [Constructible] - public ChainHatsuburi() : base(0x2774) - { - Weight = 7.0; - } + public ChainHatsuburi() : base(0x2774) => Weight = 7.0; public ChainHatsuburi(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Chain/ChainLegs.cs b/Projects/Scripts/Items/Armor/Chain/ChainLegs.cs index 72732061f..ce2ed8fba 100644 --- a/Projects/Scripts/Items/Armor/Chain/ChainLegs.cs +++ b/Projects/Scripts/Items/Armor/Chain/ChainLegs.cs @@ -4,10 +4,7 @@ namespace Server.Items public class ChainLegs : BaseArmor { [Constructible] - public ChainLegs() : base(0x13BE) - { - Weight = 7.0; - } + public ChainLegs() : base(0x13BE) => Weight = 7.0; public ChainLegs(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Dragon/DragonArms.cs b/Projects/Scripts/Items/Armor/Dragon/DragonArms.cs index 4df01ee1c..fb18b5588 100644 --- a/Projects/Scripts/Items/Armor/Dragon/DragonArms.cs +++ b/Projects/Scripts/Items/Armor/Dragon/DragonArms.cs @@ -4,10 +4,7 @@ namespace Server.Items public class DragonArms : BaseArmor { [Constructible] - public DragonArms() : base(0x2657) - { - Weight = 5.0; - } + public DragonArms() : base(0x2657) => Weight = 5.0; public DragonArms(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Dragon/DragonChest.cs b/Projects/Scripts/Items/Armor/Dragon/DragonChest.cs index e17f4afb7..642ff6161 100644 --- a/Projects/Scripts/Items/Armor/Dragon/DragonChest.cs +++ b/Projects/Scripts/Items/Armor/Dragon/DragonChest.cs @@ -4,10 +4,7 @@ namespace Server.Items public class DragonChest : BaseArmor { [Constructible] - public DragonChest() : base(0x2641) - { - Weight = 10.0; - } + public DragonChest() : base(0x2641) => Weight = 10.0; public DragonChest(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Dragon/DragonGloves.cs b/Projects/Scripts/Items/Armor/Dragon/DragonGloves.cs index a4c04a460..4218c5c50 100644 --- a/Projects/Scripts/Items/Armor/Dragon/DragonGloves.cs +++ b/Projects/Scripts/Items/Armor/Dragon/DragonGloves.cs @@ -4,10 +4,7 @@ namespace Server.Items public class DragonGloves : BaseArmor { [Constructible] - public DragonGloves() : base(0x2643) - { - Weight = 2.0; - } + public DragonGloves() : base(0x2643) => Weight = 2.0; public DragonGloves(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Dragon/DragonHelm.cs b/Projects/Scripts/Items/Armor/Dragon/DragonHelm.cs index 8955ca0c2..c4599ab3a 100644 --- a/Projects/Scripts/Items/Armor/Dragon/DragonHelm.cs +++ b/Projects/Scripts/Items/Armor/Dragon/DragonHelm.cs @@ -4,10 +4,7 @@ namespace Server.Items public class DragonHelm : BaseArmor { [Constructible] - public DragonHelm() : base(0x2645) - { - Weight = 5.0; - } + public DragonHelm() : base(0x2645) => Weight = 5.0; public DragonHelm(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Dragon/DragonLegs.cs b/Projects/Scripts/Items/Armor/Dragon/DragonLegs.cs index 2b9f9c64e..ccfbb22ff 100644 --- a/Projects/Scripts/Items/Armor/Dragon/DragonLegs.cs +++ b/Projects/Scripts/Items/Armor/Dragon/DragonLegs.cs @@ -4,10 +4,7 @@ namespace Server.Items public class DragonLegs : BaseArmor { [Constructible] - public DragonLegs() : base(0x2647) - { - Weight = 6.0; - } + public DragonLegs() : base(0x2647) => Weight = 6.0; public DragonLegs(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Glasses/ElvenGlasses.cs b/Projects/Scripts/Items/Armor/Glasses/ElvenGlasses.cs index 923d0a861..9f51f6393 100644 --- a/Projects/Scripts/Items/Armor/Glasses/ElvenGlasses.cs +++ b/Projects/Scripts/Items/Armor/Glasses/ElvenGlasses.cs @@ -94,10 +94,7 @@ namespace Server.Items flags |= toSet; } - private static bool GetSaveFlag(SaveFlag flags, SaveFlag toGet) - { - return (flags & toGet) != 0; - } + private static bool GetSaveFlag(SaveFlag flags, SaveFlag toGet) => (flags & toGet) != 0; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Items/Armor/Helmets/Bascinet.cs b/Projects/Scripts/Items/Armor/Helmets/Bascinet.cs index 3bef2c1e7..06c127e2e 100644 --- a/Projects/Scripts/Items/Armor/Helmets/Bascinet.cs +++ b/Projects/Scripts/Items/Armor/Helmets/Bascinet.cs @@ -3,10 +3,7 @@ namespace Server.Items public class Bascinet : BaseArmor { [Constructible] - public Bascinet() : base(0x140C) - { - Weight = 5.0; - } + public Bascinet() : base(0x140C) => Weight = 5.0; public Bascinet(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Helmets/BoneHelm.cs b/Projects/Scripts/Items/Armor/Helmets/BoneHelm.cs index 982a00010..501e04670 100644 --- a/Projects/Scripts/Items/Armor/Helmets/BoneHelm.cs +++ b/Projects/Scripts/Items/Armor/Helmets/BoneHelm.cs @@ -4,10 +4,7 @@ namespace Server.Items public class BoneHelm : BaseArmor { [Constructible] - public BoneHelm() : base(0x1451) - { - Weight = 3.0; - } + public BoneHelm() : base(0x1451) => Weight = 3.0; public BoneHelm(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Helmets/ChainCoif.cs b/Projects/Scripts/Items/Armor/Helmets/ChainCoif.cs index 3839b26fc..a09f06beb 100644 --- a/Projects/Scripts/Items/Armor/Helmets/ChainCoif.cs +++ b/Projects/Scripts/Items/Armor/Helmets/ChainCoif.cs @@ -4,10 +4,7 @@ namespace Server.Items public class ChainCoif : BaseArmor { [Constructible] - public ChainCoif() : base(0x13BB) - { - Weight = 1.0; - } + public ChainCoif() : base(0x13BB) => Weight = 1.0; public ChainCoif(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Helmets/Circlet.cs b/Projects/Scripts/Items/Armor/Helmets/Circlet.cs index 8ab4b7df1..8e5eccd7a 100644 --- a/Projects/Scripts/Items/Armor/Helmets/Circlet.cs +++ b/Projects/Scripts/Items/Armor/Helmets/Circlet.cs @@ -4,10 +4,7 @@ namespace Server.Items public class Circlet : BaseArmor { [Constructible] - public Circlet() : base(0x2B6E) - { - Weight = 2.0; - } + public Circlet() : base(0x2B6E) => Weight = 2.0; public Circlet(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Helmets/CloseHelm.cs b/Projects/Scripts/Items/Armor/Helmets/CloseHelm.cs index a8b0739c8..240dbac22 100644 --- a/Projects/Scripts/Items/Armor/Helmets/CloseHelm.cs +++ b/Projects/Scripts/Items/Armor/Helmets/CloseHelm.cs @@ -3,10 +3,7 @@ namespace Server.Items public class CloseHelm : BaseArmor { [Constructible] - public CloseHelm() : base(0x1408) - { - Weight = 5.0; - } + public CloseHelm() : base(0x1408) => Weight = 5.0; public CloseHelm(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Helmets/GemmedCirclet.cs b/Projects/Scripts/Items/Armor/Helmets/GemmedCirclet.cs index 6259e1a9a..a5f2303e5 100644 --- a/Projects/Scripts/Items/Armor/Helmets/GemmedCirclet.cs +++ b/Projects/Scripts/Items/Armor/Helmets/GemmedCirclet.cs @@ -4,10 +4,7 @@ namespace Server.Items public class GemmedCirclet : BaseArmor { [Constructible] - public GemmedCirclet() : base(0x2B70) - { - Weight = 2.0; - } + public GemmedCirclet() : base(0x2B70) => Weight = 2.0; public GemmedCirclet(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Helmets/Helmet.cs b/Projects/Scripts/Items/Armor/Helmets/Helmet.cs index ec2802f18..26889fd94 100644 --- a/Projects/Scripts/Items/Armor/Helmets/Helmet.cs +++ b/Projects/Scripts/Items/Armor/Helmets/Helmet.cs @@ -3,10 +3,7 @@ namespace Server.Items public class Helmet : BaseArmor { [Constructible] - public Helmet() : base(0x140A) - { - Weight = 5.0; - } + public Helmet() : base(0x140A) => Weight = 5.0; public Helmet(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Helmets/LeatherCap.cs b/Projects/Scripts/Items/Armor/Helmets/LeatherCap.cs index 67110387e..6d3392bf4 100644 --- a/Projects/Scripts/Items/Armor/Helmets/LeatherCap.cs +++ b/Projects/Scripts/Items/Armor/Helmets/LeatherCap.cs @@ -4,10 +4,7 @@ namespace Server.Items public class LeatherCap : BaseArmor { [Constructible] - public LeatherCap() : base(0x1DB9) - { - Weight = 2.0; - } + public LeatherCap() : base(0x1DB9) => Weight = 2.0; public LeatherCap(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Helmets/NorseHelm.cs b/Projects/Scripts/Items/Armor/Helmets/NorseHelm.cs index 359e40288..8caf6bd7e 100644 --- a/Projects/Scripts/Items/Armor/Helmets/NorseHelm.cs +++ b/Projects/Scripts/Items/Armor/Helmets/NorseHelm.cs @@ -3,10 +3,7 @@ namespace Server.Items public class NorseHelm : BaseArmor { [Constructible] - public NorseHelm() : base(0x140E) - { - Weight = 5.0; - } + public NorseHelm() : base(0x140E) => Weight = 5.0; public NorseHelm(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Helmets/PlateHelm.cs b/Projects/Scripts/Items/Armor/Helmets/PlateHelm.cs index 2698f40ab..4e2acfc28 100644 --- a/Projects/Scripts/Items/Armor/Helmets/PlateHelm.cs +++ b/Projects/Scripts/Items/Armor/Helmets/PlateHelm.cs @@ -3,10 +3,7 @@ namespace Server.Items public class PlateHelm : BaseArmor { [Constructible] - public PlateHelm() : base(0x1412) - { - Weight = 5.0; - } + public PlateHelm() : base(0x1412) => Weight = 5.0; public PlateHelm(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Helmets/RavenHelm.cs b/Projects/Scripts/Items/Armor/Helmets/RavenHelm.cs index 699ca6d35..63448676c 100644 --- a/Projects/Scripts/Items/Armor/Helmets/RavenHelm.cs +++ b/Projects/Scripts/Items/Armor/Helmets/RavenHelm.cs @@ -4,10 +4,7 @@ namespace Server.Items public class RavenHelm : BaseArmor { [Constructible] - public RavenHelm() : base(0x2B71) - { - Weight = 5.0; - } + public RavenHelm() : base(0x2B71) => Weight = 5.0; public RavenHelm(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Helmets/RoyalCirclet.cs b/Projects/Scripts/Items/Armor/Helmets/RoyalCirclet.cs index f7621dae6..9e48538d9 100644 --- a/Projects/Scripts/Items/Armor/Helmets/RoyalCirclet.cs +++ b/Projects/Scripts/Items/Armor/Helmets/RoyalCirclet.cs @@ -4,10 +4,7 @@ namespace Server.Items public class RoyalCirclet : BaseArmor { [Constructible] - public RoyalCirclet() : base(0x2B6F) - { - Weight = 2.0; - } + public RoyalCirclet() : base(0x2B6F) => Weight = 2.0; public RoyalCirclet(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Helmets/VultureHelm.cs b/Projects/Scripts/Items/Armor/Helmets/VultureHelm.cs index ad855a0f1..59d07b2ad 100644 --- a/Projects/Scripts/Items/Armor/Helmets/VultureHelm.cs +++ b/Projects/Scripts/Items/Armor/Helmets/VultureHelm.cs @@ -4,10 +4,7 @@ namespace Server.Items public class VultureHelm : BaseArmor { [Constructible] - public VultureHelm() : base(0x2B72) - { - Weight = 5.0; - } + public VultureHelm() : base(0x2B72) => Weight = 5.0; public VultureHelm(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Helmets/WingedHelm.cs b/Projects/Scripts/Items/Armor/Helmets/WingedHelm.cs index bbfd3ed7b..a00357b6b 100644 --- a/Projects/Scripts/Items/Armor/Helmets/WingedHelm.cs +++ b/Projects/Scripts/Items/Armor/Helmets/WingedHelm.cs @@ -4,10 +4,7 @@ namespace Server.Items public class WingedHelm : BaseArmor { [Constructible] - public WingedHelm() : base(0x2B73) - { - Weight = 5.0; - } + public WingedHelm() : base(0x2B73) => Weight = 5.0; public WingedHelm(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Leather/FemaleLeafChest.cs b/Projects/Scripts/Items/Armor/Leather/FemaleLeafChest.cs index 95aab53e4..b7b6ab79a 100644 --- a/Projects/Scripts/Items/Armor/Leather/FemaleLeafChest.cs +++ b/Projects/Scripts/Items/Armor/Leather/FemaleLeafChest.cs @@ -4,10 +4,7 @@ namespace Server.Items public class FemaleLeafChest : BaseArmor { [Constructible] - public FemaleLeafChest() : base(0x2FCB) - { - Weight = 2.0; - } + public FemaleLeafChest() : base(0x2FCB) => Weight = 2.0; public FemaleLeafChest(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Leather/FemaleLeatherChest.cs b/Projects/Scripts/Items/Armor/Leather/FemaleLeatherChest.cs index 127c59701..e24e9a672 100644 --- a/Projects/Scripts/Items/Armor/Leather/FemaleLeatherChest.cs +++ b/Projects/Scripts/Items/Armor/Leather/FemaleLeatherChest.cs @@ -4,10 +4,7 @@ namespace Server.Items public class FemaleLeatherChest : BaseArmor { [Constructible] - public FemaleLeatherChest() : base(0x1C06) - { - Weight = 1.0; - } + public FemaleLeatherChest() : base(0x1C06) => Weight = 1.0; public FemaleLeatherChest(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Leather/LeafArms.cs b/Projects/Scripts/Items/Armor/Leather/LeafArms.cs index 1ce97de34..dbd8e7794 100644 --- a/Projects/Scripts/Items/Armor/Leather/LeafArms.cs +++ b/Projects/Scripts/Items/Armor/Leather/LeafArms.cs @@ -4,10 +4,7 @@ namespace Server.Items public class LeafArms : BaseArmor { [Constructible] - public LeafArms() : base(0x2FC8) - { - Weight = 2.0; - } + public LeafArms() : base(0x2FC8) => Weight = 2.0; public LeafArms(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Leather/LeafChest.cs b/Projects/Scripts/Items/Armor/Leather/LeafChest.cs index be19d01ce..0dd4ddb77 100644 --- a/Projects/Scripts/Items/Armor/Leather/LeafChest.cs +++ b/Projects/Scripts/Items/Armor/Leather/LeafChest.cs @@ -4,10 +4,7 @@ namespace Server.Items public class LeafChest : BaseArmor { [Constructible] - public LeafChest() : base(0x2FC5) - { - Weight = 2.0; - } + public LeafChest() : base(0x2FC5) => Weight = 2.0; public LeafChest(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Leather/LeafGloves.cs b/Projects/Scripts/Items/Armor/Leather/LeafGloves.cs index e7754388c..4190c1d95 100644 --- a/Projects/Scripts/Items/Armor/Leather/LeafGloves.cs +++ b/Projects/Scripts/Items/Armor/Leather/LeafGloves.cs @@ -4,10 +4,7 @@ namespace Server.Items public class LeafGloves : BaseArmor, IArcaneEquip { [Constructible] - public LeafGloves() : base(0x2FC6) - { - Weight = 2.0; - } + public LeafGloves() : base(0x2FC6) => Weight = 2.0; public LeafGloves(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Leather/LeafGorget.cs b/Projects/Scripts/Items/Armor/Leather/LeafGorget.cs index 2fba6e1d5..f4e84153b 100644 --- a/Projects/Scripts/Items/Armor/Leather/LeafGorget.cs +++ b/Projects/Scripts/Items/Armor/Leather/LeafGorget.cs @@ -3,10 +3,7 @@ namespace Server.Items public class LeafGorget : BaseArmor { [Constructible] - public LeafGorget() : base(0x2FC7) - { - Weight = 2.0; - } + public LeafGorget() : base(0x2FC7) => Weight = 2.0; public LeafGorget(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Leather/LeafLegs.cs b/Projects/Scripts/Items/Armor/Leather/LeafLegs.cs index 41bd65a8e..86c4d1a06 100644 --- a/Projects/Scripts/Items/Armor/Leather/LeafLegs.cs +++ b/Projects/Scripts/Items/Armor/Leather/LeafLegs.cs @@ -4,10 +4,7 @@ namespace Server.Items public class LeafLegs : BaseArmor { [Constructible] - public LeafLegs() : base(0x2FC9) - { - Weight = 2.0; - } + public LeafLegs() : base(0x2FC9) => Weight = 2.0; public LeafLegs(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Leather/LeafTonlet.cs b/Projects/Scripts/Items/Armor/Leather/LeafTonlet.cs index e10efd467..37c7996cf 100644 --- a/Projects/Scripts/Items/Armor/Leather/LeafTonlet.cs +++ b/Projects/Scripts/Items/Armor/Leather/LeafTonlet.cs @@ -4,10 +4,7 @@ namespace Server.Items public class LeafTonlet : BaseArmor { [Constructible] - public LeafTonlet() : base(0x2FCA) - { - Weight = 2.0; - } + public LeafTonlet() : base(0x2FCA) => Weight = 2.0; public LeafTonlet(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Leather/LeatherArms.cs b/Projects/Scripts/Items/Armor/Leather/LeatherArms.cs index a9c4c4ba3..43cdfb51f 100644 --- a/Projects/Scripts/Items/Armor/Leather/LeatherArms.cs +++ b/Projects/Scripts/Items/Armor/Leather/LeatherArms.cs @@ -4,10 +4,7 @@ namespace Server.Items public class LeatherArms : BaseArmor { [Constructible] - public LeatherArms() : base(0x13CD) - { - Weight = 2.0; - } + public LeatherArms() : base(0x13CD) => Weight = 2.0; public LeatherArms(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Leather/LeatherBustierArms.cs b/Projects/Scripts/Items/Armor/Leather/LeatherBustierArms.cs index b0e12b36e..c87232cf7 100644 --- a/Projects/Scripts/Items/Armor/Leather/LeatherBustierArms.cs +++ b/Projects/Scripts/Items/Armor/Leather/LeatherBustierArms.cs @@ -4,10 +4,7 @@ namespace Server.Items public class LeatherBustierArms : BaseArmor { [Constructible] - public LeatherBustierArms() : base(0x1C0A) - { - Weight = 1.0; - } + public LeatherBustierArms() : base(0x1C0A) => Weight = 1.0; public LeatherBustierArms(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Leather/LeatherChest.cs b/Projects/Scripts/Items/Armor/Leather/LeatherChest.cs index d1902db6b..25c7a3a28 100644 --- a/Projects/Scripts/Items/Armor/Leather/LeatherChest.cs +++ b/Projects/Scripts/Items/Armor/Leather/LeatherChest.cs @@ -4,10 +4,7 @@ namespace Server.Items public class LeatherChest : BaseArmor { [Constructible] - public LeatherChest() : base(0x13CC) - { - Weight = 6.0; - } + public LeatherChest() : base(0x13CC) => Weight = 6.0; public LeatherChest(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Leather/LeatherDo.cs b/Projects/Scripts/Items/Armor/Leather/LeatherDo.cs index f879ae5d0..1d0e3f5b2 100644 --- a/Projects/Scripts/Items/Armor/Leather/LeatherDo.cs +++ b/Projects/Scripts/Items/Armor/Leather/LeatherDo.cs @@ -3,10 +3,7 @@ namespace Server.Items public class LeatherDo : BaseArmor { [Constructible] - public LeatherDo() : base(0x27C6) - { - Weight = 6.0; - } + public LeatherDo() : base(0x27C6) => Weight = 6.0; public LeatherDo(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Leather/LeatherGloves.cs b/Projects/Scripts/Items/Armor/Leather/LeatherGloves.cs index da6742375..fcb18b469 100644 --- a/Projects/Scripts/Items/Armor/Leather/LeatherGloves.cs +++ b/Projects/Scripts/Items/Armor/Leather/LeatherGloves.cs @@ -4,10 +4,7 @@ namespace Server.Items public class LeatherGloves : BaseArmor, IArcaneEquip { [Constructible] - public LeatherGloves() : base(0x13C6) - { - Weight = 1.0; - } + public LeatherGloves() : base(0x13C6) => Weight = 1.0; public LeatherGloves(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Leather/LeatherGorget.cs b/Projects/Scripts/Items/Armor/Leather/LeatherGorget.cs index c0e83717c..09fa4c404 100644 --- a/Projects/Scripts/Items/Armor/Leather/LeatherGorget.cs +++ b/Projects/Scripts/Items/Armor/Leather/LeatherGorget.cs @@ -3,10 +3,7 @@ namespace Server.Items public class LeatherGorget : BaseArmor { [Constructible] - public LeatherGorget() : base(0x13C7) - { - Weight = 1.0; - } + public LeatherGorget() : base(0x13C7) => Weight = 1.0; public LeatherGorget(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Leather/LeatherHaidate.cs b/Projects/Scripts/Items/Armor/Leather/LeatherHaidate.cs index 81e3df748..269f0c603 100644 --- a/Projects/Scripts/Items/Armor/Leather/LeatherHaidate.cs +++ b/Projects/Scripts/Items/Armor/Leather/LeatherHaidate.cs @@ -3,10 +3,7 @@ namespace Server.Items public class LeatherHaidate : BaseArmor { [Constructible] - public LeatherHaidate() : base(0x278A) - { - Weight = 4.0; - } + public LeatherHaidate() : base(0x278A) => Weight = 4.0; public LeatherHaidate(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Leather/LeatherHiroSode.cs b/Projects/Scripts/Items/Armor/Leather/LeatherHiroSode.cs index 848c563b7..3c20b0e88 100644 --- a/Projects/Scripts/Items/Armor/Leather/LeatherHiroSode.cs +++ b/Projects/Scripts/Items/Armor/Leather/LeatherHiroSode.cs @@ -3,10 +3,7 @@ namespace Server.Items public class LeatherHiroSode : BaseArmor { [Constructible] - public LeatherHiroSode() : base(0x277E) - { - Weight = 1.0; - } + public LeatherHiroSode() : base(0x277E) => Weight = 1.0; public LeatherHiroSode(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Leather/LeatherJingasa.cs b/Projects/Scripts/Items/Armor/Leather/LeatherJingasa.cs index a1e677dda..aca7a0b72 100644 --- a/Projects/Scripts/Items/Armor/Leather/LeatherJingasa.cs +++ b/Projects/Scripts/Items/Armor/Leather/LeatherJingasa.cs @@ -3,10 +3,7 @@ namespace Server.Items public class LeatherJingasa : BaseArmor { [Constructible] - public LeatherJingasa() : base(0x2776) - { - Weight = 3.0; - } + public LeatherJingasa() : base(0x2776) => Weight = 3.0; public LeatherJingasa(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Leather/LeatherLegs.cs b/Projects/Scripts/Items/Armor/Leather/LeatherLegs.cs index a8a067426..101f7fcae 100644 --- a/Projects/Scripts/Items/Armor/Leather/LeatherLegs.cs +++ b/Projects/Scripts/Items/Armor/Leather/LeatherLegs.cs @@ -4,10 +4,7 @@ namespace Server.Items public class LeatherLegs : BaseArmor { [Constructible] - public LeatherLegs() : base(0x13CB) - { - Weight = 4.0; - } + public LeatherLegs() : base(0x13CB) => Weight = 4.0; public LeatherLegs(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Leather/LeatherMempo.cs b/Projects/Scripts/Items/Armor/Leather/LeatherMempo.cs index af1a29984..0e41bc064 100644 --- a/Projects/Scripts/Items/Armor/Leather/LeatherMempo.cs +++ b/Projects/Scripts/Items/Armor/Leather/LeatherMempo.cs @@ -3,10 +3,7 @@ namespace Server.Items public class LeatherMempo : BaseArmor { [Constructible] - public LeatherMempo() : base(0x277A) - { - Weight = 2.0; - } + public LeatherMempo() : base(0x277A) => Weight = 2.0; public LeatherMempo(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Leather/LeatherNinjaHood.cs b/Projects/Scripts/Items/Armor/Leather/LeatherNinjaHood.cs index d5eb533a8..f698d79d4 100644 --- a/Projects/Scripts/Items/Armor/Leather/LeatherNinjaHood.cs +++ b/Projects/Scripts/Items/Armor/Leather/LeatherNinjaHood.cs @@ -3,10 +3,7 @@ namespace Server.Items public class LeatherNinjaHood : BaseArmor { [Constructible] - public LeatherNinjaHood() : base(0x278E) - { - Weight = 2.0; - } + public LeatherNinjaHood() : base(0x278E) => Weight = 2.0; public LeatherNinjaHood(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Leather/LeatherNinjaJacket.cs b/Projects/Scripts/Items/Armor/Leather/LeatherNinjaJacket.cs index 8651a48df..5ae6fdb42 100644 --- a/Projects/Scripts/Items/Armor/Leather/LeatherNinjaJacket.cs +++ b/Projects/Scripts/Items/Armor/Leather/LeatherNinjaJacket.cs @@ -3,10 +3,7 @@ namespace Server.Items public class LeatherNinjaJacket : BaseArmor { [Constructible] - public LeatherNinjaJacket() : base(0x2793) - { - Weight = 5.0; - } + public LeatherNinjaJacket() : base(0x2793) => Weight = 5.0; public LeatherNinjaJacket(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Leather/LeatherNinjaMitts.cs b/Projects/Scripts/Items/Armor/Leather/LeatherNinjaMitts.cs index cf34bca41..acd7af4f8 100644 --- a/Projects/Scripts/Items/Armor/Leather/LeatherNinjaMitts.cs +++ b/Projects/Scripts/Items/Armor/Leather/LeatherNinjaMitts.cs @@ -3,10 +3,7 @@ namespace Server.Items public class LeatherNinjaMitts : BaseArmor { [Constructible] - public LeatherNinjaMitts() : base(0x2792) - { - Weight = 2.0; - } + public LeatherNinjaMitts() : base(0x2792) => Weight = 2.0; public LeatherNinjaMitts(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Leather/LeatherNinjaPants.cs b/Projects/Scripts/Items/Armor/Leather/LeatherNinjaPants.cs index 41dc965bb..65868164c 100644 --- a/Projects/Scripts/Items/Armor/Leather/LeatherNinjaPants.cs +++ b/Projects/Scripts/Items/Armor/Leather/LeatherNinjaPants.cs @@ -3,10 +3,7 @@ namespace Server.Items public class LeatherNinjaPants : BaseArmor { [Constructible] - public LeatherNinjaPants() : base(0x2791) - { - Weight = 3.0; - } + public LeatherNinjaPants() : base(0x2791) => Weight = 3.0; public LeatherNinjaPants(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Leather/LeatherShorts.cs b/Projects/Scripts/Items/Armor/Leather/LeatherShorts.cs index 8ab4d66f5..1520662b2 100644 --- a/Projects/Scripts/Items/Armor/Leather/LeatherShorts.cs +++ b/Projects/Scripts/Items/Armor/Leather/LeatherShorts.cs @@ -4,10 +4,7 @@ namespace Server.Items public class LeatherShorts : BaseArmor { [Constructible] - public LeatherShorts() : base(0x1C00) - { - Weight = 3.0; - } + public LeatherShorts() : base(0x1C00) => Weight = 3.0; public LeatherShorts(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Leather/LeatherSkirt.cs b/Projects/Scripts/Items/Armor/Leather/LeatherSkirt.cs index 4572cf7e1..a71aa587f 100644 --- a/Projects/Scripts/Items/Armor/Leather/LeatherSkirt.cs +++ b/Projects/Scripts/Items/Armor/Leather/LeatherSkirt.cs @@ -4,10 +4,7 @@ namespace Server.Items public class LeatherSkirt : BaseArmor { [Constructible] - public LeatherSkirt() : base(0x1C08) - { - Weight = 1.0; - } + public LeatherSkirt() : base(0x1C08) => Weight = 1.0; public LeatherSkirt(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Leather/LeatherSuneate.cs b/Projects/Scripts/Items/Armor/Leather/LeatherSuneate.cs index c531f1abe..0b402d0ab 100644 --- a/Projects/Scripts/Items/Armor/Leather/LeatherSuneate.cs +++ b/Projects/Scripts/Items/Armor/Leather/LeatherSuneate.cs @@ -3,10 +3,7 @@ namespace Server.Items public class LeatherSuneate : BaseArmor { [Constructible] - public LeatherSuneate() : base(0x2786) - { - Weight = 4.0; - } + public LeatherSuneate() : base(0x2786) => Weight = 4.0; public LeatherSuneate(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Plate/DecorativePlateKabuto.cs b/Projects/Scripts/Items/Armor/Plate/DecorativePlateKabuto.cs index c70f92c5d..68bbfd692 100644 --- a/Projects/Scripts/Items/Armor/Plate/DecorativePlateKabuto.cs +++ b/Projects/Scripts/Items/Armor/Plate/DecorativePlateKabuto.cs @@ -3,10 +3,7 @@ namespace Server.Items public class DecorativePlateKabuto : BaseArmor { [Constructible] - public DecorativePlateKabuto() : base(0x2778) - { - Weight = 6.0; - } + public DecorativePlateKabuto() : base(0x2778) => Weight = 6.0; public DecorativePlateKabuto(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Plate/FemalePlateChest.cs b/Projects/Scripts/Items/Armor/Plate/FemalePlateChest.cs index 7329eb9ef..6f356f2af 100644 --- a/Projects/Scripts/Items/Armor/Plate/FemalePlateChest.cs +++ b/Projects/Scripts/Items/Armor/Plate/FemalePlateChest.cs @@ -4,10 +4,7 @@ namespace Server.Items public class FemalePlateChest : BaseArmor { [Constructible] - public FemalePlateChest() : base(0x1C04) - { - Weight = 4.0; - } + public FemalePlateChest() : base(0x1C04) => Weight = 4.0; public FemalePlateChest(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Plate/FemaleWoodlandChest.cs b/Projects/Scripts/Items/Armor/Plate/FemaleWoodlandChest.cs index 3a11d1543..4347fe267 100644 --- a/Projects/Scripts/Items/Armor/Plate/FemaleWoodlandChest.cs +++ b/Projects/Scripts/Items/Armor/Plate/FemaleWoodlandChest.cs @@ -5,10 +5,7 @@ namespace Server.Items public class FemaleElvenPlateChest : BaseArmor { [Constructible] - public FemaleElvenPlateChest() : base(0x2B6D) - { - Weight = 8.0; - } + public FemaleElvenPlateChest() : base(0x2B6D) => Weight = 8.0; public FemaleElvenPlateChest(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Plate/HeavyPlateJingasa.cs b/Projects/Scripts/Items/Armor/Plate/HeavyPlateJingasa.cs index 8b6f09282..f3c3f4e18 100644 --- a/Projects/Scripts/Items/Armor/Plate/HeavyPlateJingasa.cs +++ b/Projects/Scripts/Items/Armor/Plate/HeavyPlateJingasa.cs @@ -3,10 +3,7 @@ namespace Server.Items public class HeavyPlateJingasa : BaseArmor { [Constructible] - public HeavyPlateJingasa() : base(0x2777) - { - Weight = 5.0; - } + public HeavyPlateJingasa() : base(0x2777) => Weight = 5.0; public HeavyPlateJingasa(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Plate/LightPlateJingasa.cs b/Projects/Scripts/Items/Armor/Plate/LightPlateJingasa.cs index 343b9cc3e..ebe82c0ac 100644 --- a/Projects/Scripts/Items/Armor/Plate/LightPlateJingasa.cs +++ b/Projects/Scripts/Items/Armor/Plate/LightPlateJingasa.cs @@ -3,10 +3,7 @@ namespace Server.Items public class LightPlateJingasa : BaseArmor { [Constructible] - public LightPlateJingasa() : base(0x2781) - { - Weight = 5.0; - } + public LightPlateJingasa() : base(0x2781) => Weight = 5.0; public LightPlateJingasa(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Plate/PlateArms.cs b/Projects/Scripts/Items/Armor/Plate/PlateArms.cs index f97581ef1..689fdafb3 100644 --- a/Projects/Scripts/Items/Armor/Plate/PlateArms.cs +++ b/Projects/Scripts/Items/Armor/Plate/PlateArms.cs @@ -4,10 +4,7 @@ namespace Server.Items public class PlateArms : BaseArmor { [Constructible] - public PlateArms() : base(0x1410) - { - Weight = 5.0; - } + public PlateArms() : base(0x1410) => Weight = 5.0; public PlateArms(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Plate/PlateBattleKabuto.cs b/Projects/Scripts/Items/Armor/Plate/PlateBattleKabuto.cs index e70e79fa8..703dbc56c 100644 --- a/Projects/Scripts/Items/Armor/Plate/PlateBattleKabuto.cs +++ b/Projects/Scripts/Items/Armor/Plate/PlateBattleKabuto.cs @@ -3,10 +3,7 @@ namespace Server.Items public class PlateBattleKabuto : BaseArmor { [Constructible] - public PlateBattleKabuto() : base(0x2785) - { - Weight = 6.0; - } + public PlateBattleKabuto() : base(0x2785) => Weight = 6.0; public PlateBattleKabuto(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Plate/PlateChest.cs b/Projects/Scripts/Items/Armor/Plate/PlateChest.cs index 956d1925d..42126ee4e 100644 --- a/Projects/Scripts/Items/Armor/Plate/PlateChest.cs +++ b/Projects/Scripts/Items/Armor/Plate/PlateChest.cs @@ -4,10 +4,7 @@ namespace Server.Items public class PlateChest : BaseArmor { [Constructible] - public PlateChest() : base(0x1415) - { - Weight = 10.0; - } + public PlateChest() : base(0x1415) => Weight = 10.0; public PlateChest(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Plate/PlateDo.cs b/Projects/Scripts/Items/Armor/Plate/PlateDo.cs index cf6030751..5a3742bfd 100644 --- a/Projects/Scripts/Items/Armor/Plate/PlateDo.cs +++ b/Projects/Scripts/Items/Armor/Plate/PlateDo.cs @@ -3,10 +3,7 @@ namespace Server.Items public class PlateDo : BaseArmor { [Constructible] - public PlateDo() : base(0x277D) - { - Weight = 10.0; - } + public PlateDo() : base(0x277D) => Weight = 10.0; public PlateDo(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Plate/PlateGloves.cs b/Projects/Scripts/Items/Armor/Plate/PlateGloves.cs index a362ca46c..ab2120152 100644 --- a/Projects/Scripts/Items/Armor/Plate/PlateGloves.cs +++ b/Projects/Scripts/Items/Armor/Plate/PlateGloves.cs @@ -4,10 +4,7 @@ namespace Server.Items public class PlateGloves : BaseArmor { [Constructible] - public PlateGloves() : base(0x1414) - { - Weight = 2.0; - } + public PlateGloves() : base(0x1414) => Weight = 2.0; public PlateGloves(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Plate/PlateGorget.cs b/Projects/Scripts/Items/Armor/Plate/PlateGorget.cs index 810848e02..e14112f1f 100644 --- a/Projects/Scripts/Items/Armor/Plate/PlateGorget.cs +++ b/Projects/Scripts/Items/Armor/Plate/PlateGorget.cs @@ -3,10 +3,7 @@ namespace Server.Items public class PlateGorget : BaseArmor { [Constructible] - public PlateGorget() : base(0x1413) - { - Weight = 2.0; - } + public PlateGorget() : base(0x1413) => Weight = 2.0; public PlateGorget(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Plate/PlateHaidate.cs b/Projects/Scripts/Items/Armor/Plate/PlateHaidate.cs index c3af21a8b..733dc1046 100644 --- a/Projects/Scripts/Items/Armor/Plate/PlateHaidate.cs +++ b/Projects/Scripts/Items/Armor/Plate/PlateHaidate.cs @@ -3,10 +3,7 @@ namespace Server.Items public class PlateHaidate : BaseArmor { [Constructible] - public PlateHaidate() : base(0x278D) - { - Weight = 7.0; - } + public PlateHaidate() : base(0x278D) => Weight = 7.0; public PlateHaidate(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Plate/PlateHatsuburi.cs b/Projects/Scripts/Items/Armor/Plate/PlateHatsuburi.cs index d3294a082..bec64a7fb 100644 --- a/Projects/Scripts/Items/Armor/Plate/PlateHatsuburi.cs +++ b/Projects/Scripts/Items/Armor/Plate/PlateHatsuburi.cs @@ -3,10 +3,7 @@ namespace Server.Items public class PlateHatsuburi : BaseArmor { [Constructible] - public PlateHatsuburi() : base(0x2775) - { - Weight = 5.0; - } + public PlateHatsuburi() : base(0x2775) => Weight = 5.0; public PlateHatsuburi(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Plate/PlateHiroSode.cs b/Projects/Scripts/Items/Armor/Plate/PlateHiroSode.cs index 4c63030d0..0dee92416 100644 --- a/Projects/Scripts/Items/Armor/Plate/PlateHiroSode.cs +++ b/Projects/Scripts/Items/Armor/Plate/PlateHiroSode.cs @@ -3,10 +3,7 @@ namespace Server.Items public class PlateHiroSode : BaseArmor { [Constructible] - public PlateHiroSode() : base(0x2780) - { - Weight = 3.0; - } + public PlateHiroSode() : base(0x2780) => Weight = 3.0; public PlateHiroSode(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Plate/PlateLegs.cs b/Projects/Scripts/Items/Armor/Plate/PlateLegs.cs index 9a32f3748..0ac328a04 100644 --- a/Projects/Scripts/Items/Armor/Plate/PlateLegs.cs +++ b/Projects/Scripts/Items/Armor/Plate/PlateLegs.cs @@ -4,10 +4,7 @@ namespace Server.Items public class PlateLegs : BaseArmor { [Constructible] - public PlateLegs() : base(0x1411) - { - Weight = 7.0; - } + public PlateLegs() : base(0x1411) => Weight = 7.0; public PlateLegs(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Plate/PlateMempo.cs b/Projects/Scripts/Items/Armor/Plate/PlateMempo.cs index 597106af3..273bf1a09 100644 --- a/Projects/Scripts/Items/Armor/Plate/PlateMempo.cs +++ b/Projects/Scripts/Items/Armor/Plate/PlateMempo.cs @@ -3,10 +3,7 @@ namespace Server.Items public class PlateMempo : BaseArmor { [Constructible] - public PlateMempo() : base(0x2779) - { - Weight = 3.0; - } + public PlateMempo() : base(0x2779) => Weight = 3.0; public PlateMempo(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Plate/PlateSuneate.cs b/Projects/Scripts/Items/Armor/Plate/PlateSuneate.cs index d882fd254..7eae652b9 100644 --- a/Projects/Scripts/Items/Armor/Plate/PlateSuneate.cs +++ b/Projects/Scripts/Items/Armor/Plate/PlateSuneate.cs @@ -3,10 +3,7 @@ namespace Server.Items public class PlateSuneate : BaseArmor { [Constructible] - public PlateSuneate() : base(0x2788) - { - Weight = 7.0; - } + public PlateSuneate() : base(0x2788) => Weight = 7.0; public PlateSuneate(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Plate/SmallPlateJingasa.cs b/Projects/Scripts/Items/Armor/Plate/SmallPlateJingasa.cs index e813e9f6c..cb0d9ba54 100644 --- a/Projects/Scripts/Items/Armor/Plate/SmallPlateJingasa.cs +++ b/Projects/Scripts/Items/Armor/Plate/SmallPlateJingasa.cs @@ -3,10 +3,7 @@ namespace Server.Items public class SmallPlateJingasa : BaseArmor { [Constructible] - public SmallPlateJingasa() : base(0x2784) - { - Weight = 5.0; - } + public SmallPlateJingasa() : base(0x2784) => Weight = 5.0; public SmallPlateJingasa(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Plate/StandardPlateKabuto.cs b/Projects/Scripts/Items/Armor/Plate/StandardPlateKabuto.cs index 270082b38..55df2f48e 100644 --- a/Projects/Scripts/Items/Armor/Plate/StandardPlateKabuto.cs +++ b/Projects/Scripts/Items/Armor/Plate/StandardPlateKabuto.cs @@ -3,10 +3,7 @@ namespace Server.Items public class StandardPlateKabuto : BaseArmor { [Constructible] - public StandardPlateKabuto() : base(0x2789) - { - Weight = 6.0; - } + public StandardPlateKabuto() : base(0x2789) => Weight = 6.0; public StandardPlateKabuto(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Plate/WoodlandArms.cs b/Projects/Scripts/Items/Armor/Plate/WoodlandArms.cs index da6dbdf4c..7565a99be 100644 --- a/Projects/Scripts/Items/Armor/Plate/WoodlandArms.cs +++ b/Projects/Scripts/Items/Armor/Plate/WoodlandArms.cs @@ -4,10 +4,7 @@ namespace Server.Items public class WoodlandArms : BaseArmor { [Constructible] - public WoodlandArms() : base(0x2B6C) - { - Weight = 5.0; - } + public WoodlandArms() : base(0x2B6C) => Weight = 5.0; public WoodlandArms(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Plate/WoodlandChest.cs b/Projects/Scripts/Items/Armor/Plate/WoodlandChest.cs index 7cda187e9..c876fd46a 100644 --- a/Projects/Scripts/Items/Armor/Plate/WoodlandChest.cs +++ b/Projects/Scripts/Items/Armor/Plate/WoodlandChest.cs @@ -4,10 +4,7 @@ namespace Server.Items public class WoodlandChest : BaseArmor { [Constructible] - public WoodlandChest() : base(0x2B67) - { - Weight = 8.0; - } + public WoodlandChest() : base(0x2B67) => Weight = 8.0; public WoodlandChest(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Plate/WoodlandGloves.cs b/Projects/Scripts/Items/Armor/Plate/WoodlandGloves.cs index 87d538a84..c1830479c 100644 --- a/Projects/Scripts/Items/Armor/Plate/WoodlandGloves.cs +++ b/Projects/Scripts/Items/Armor/Plate/WoodlandGloves.cs @@ -4,10 +4,7 @@ namespace Server.Items public class WoodlandGloves : BaseArmor { [Constructible] - public WoodlandGloves() : base(0x2B6A) - { - Weight = 2.0; - } + public WoodlandGloves() : base(0x2B6A) => Weight = 2.0; public WoodlandGloves(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Plate/WoodlandLegs.cs b/Projects/Scripts/Items/Armor/Plate/WoodlandLegs.cs index 716dff990..0d7dffba3 100644 --- a/Projects/Scripts/Items/Armor/Plate/WoodlandLegs.cs +++ b/Projects/Scripts/Items/Armor/Plate/WoodlandLegs.cs @@ -4,10 +4,7 @@ namespace Server.Items public class WoodlandLegs : BaseArmor { [Constructible] - public WoodlandLegs() : base(0x2B6B) - { - Weight = 8.0; - } + public WoodlandLegs() : base(0x2B6B) => Weight = 8.0; public WoodlandLegs(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Ring/RingmailArms.cs b/Projects/Scripts/Items/Armor/Ring/RingmailArms.cs index 96735d944..821f9a032 100644 --- a/Projects/Scripts/Items/Armor/Ring/RingmailArms.cs +++ b/Projects/Scripts/Items/Armor/Ring/RingmailArms.cs @@ -4,10 +4,7 @@ namespace Server.Items public class RingmailArms : BaseArmor { [Constructible] - public RingmailArms() : base(0x13EE) - { - Weight = 15.0; - } + public RingmailArms() : base(0x13EE) => Weight = 15.0; public RingmailArms(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Ring/RingmailChest.cs b/Projects/Scripts/Items/Armor/Ring/RingmailChest.cs index 02211a66e..3fe5a08e7 100644 --- a/Projects/Scripts/Items/Armor/Ring/RingmailChest.cs +++ b/Projects/Scripts/Items/Armor/Ring/RingmailChest.cs @@ -4,10 +4,7 @@ namespace Server.Items public class RingmailChest : BaseArmor { [Constructible] - public RingmailChest() : base(0x13EC) - { - Weight = 15.0; - } + public RingmailChest() : base(0x13EC) => Weight = 15.0; public RingmailChest(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Ring/RingmailGloves.cs b/Projects/Scripts/Items/Armor/Ring/RingmailGloves.cs index bd89b7034..17565b13a 100644 --- a/Projects/Scripts/Items/Armor/Ring/RingmailGloves.cs +++ b/Projects/Scripts/Items/Armor/Ring/RingmailGloves.cs @@ -4,10 +4,7 @@ namespace Server.Items public class RingmailGloves : BaseArmor { [Constructible] - public RingmailGloves() : base(0x13EB) - { - Weight = 2.0; - } + public RingmailGloves() : base(0x13EB) => Weight = 2.0; public RingmailGloves(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Ring/RingmailLegs.cs b/Projects/Scripts/Items/Armor/Ring/RingmailLegs.cs index 75856e2c3..a920bd4b5 100644 --- a/Projects/Scripts/Items/Armor/Ring/RingmailLegs.cs +++ b/Projects/Scripts/Items/Armor/Ring/RingmailLegs.cs @@ -4,10 +4,7 @@ namespace Server.Items public class RingmailLegs : BaseArmor { [Constructible] - public RingmailLegs() : base(0x13F0) - { - Weight = 15.0; - } + public RingmailLegs() : base(0x13F0) => Weight = 15.0; public RingmailLegs(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Studded/FemaleStuddedChest.cs b/Projects/Scripts/Items/Armor/Studded/FemaleStuddedChest.cs index 1aeb75537..1b7d30bc9 100644 --- a/Projects/Scripts/Items/Armor/Studded/FemaleStuddedChest.cs +++ b/Projects/Scripts/Items/Armor/Studded/FemaleStuddedChest.cs @@ -4,10 +4,7 @@ namespace Server.Items public class FemaleStuddedChest : BaseArmor { [Constructible] - public FemaleStuddedChest() : base(0x1C02) - { - Weight = 6.0; - } + public FemaleStuddedChest() : base(0x1C02) => Weight = 6.0; public FemaleStuddedChest(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Studded/HideChest.cs b/Projects/Scripts/Items/Armor/Studded/HideChest.cs index f7466f88d..4bbc85eaf 100644 --- a/Projects/Scripts/Items/Armor/Studded/HideChest.cs +++ b/Projects/Scripts/Items/Armor/Studded/HideChest.cs @@ -4,10 +4,7 @@ namespace Server.Items public class HideChest : BaseArmor { [Constructible] - public HideChest() : base(0x2B74) - { - Weight = 6.0; - } + public HideChest() : base(0x2B74) => Weight = 6.0; public HideChest(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Studded/HideFemaleChest.cs b/Projects/Scripts/Items/Armor/Studded/HideFemaleChest.cs index e80c76c04..ceef80485 100644 --- a/Projects/Scripts/Items/Armor/Studded/HideFemaleChest.cs +++ b/Projects/Scripts/Items/Armor/Studded/HideFemaleChest.cs @@ -4,10 +4,7 @@ namespace Server.Items public class HideFemaleChest : BaseArmor { [Constructible] - public HideFemaleChest() : base(0x2B79) - { - Weight = 6.0; - } + public HideFemaleChest() : base(0x2B79) => Weight = 6.0; public HideFemaleChest(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Studded/HideGloves.cs b/Projects/Scripts/Items/Armor/Studded/HideGloves.cs index 6a6bfa0aa..aa06ac601 100644 --- a/Projects/Scripts/Items/Armor/Studded/HideGloves.cs +++ b/Projects/Scripts/Items/Armor/Studded/HideGloves.cs @@ -4,10 +4,7 @@ namespace Server.Items public class HideGloves : BaseArmor { [Constructible] - public HideGloves() : base(0x2B75) - { - Weight = 2.0; - } + public HideGloves() : base(0x2B75) => Weight = 2.0; public HideGloves(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Studded/HideGorget.cs b/Projects/Scripts/Items/Armor/Studded/HideGorget.cs index ebd4ba8d1..f174cad59 100644 --- a/Projects/Scripts/Items/Armor/Studded/HideGorget.cs +++ b/Projects/Scripts/Items/Armor/Studded/HideGorget.cs @@ -4,10 +4,7 @@ namespace Server.Items public class HideGorget : BaseArmor { [Constructible] - public HideGorget() : base(0x2B76) - { - Weight = 3.0; - } + public HideGorget() : base(0x2B76) => Weight = 3.0; public HideGorget(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Studded/HidePants.cs b/Projects/Scripts/Items/Armor/Studded/HidePants.cs index e2dbf171d..ccd2b1987 100644 --- a/Projects/Scripts/Items/Armor/Studded/HidePants.cs +++ b/Projects/Scripts/Items/Armor/Studded/HidePants.cs @@ -4,10 +4,7 @@ namespace Server.Items public class HidePants : BaseArmor { [Constructible] - public HidePants() : base(0x2B78) - { - Weight = 5.0; - } + public HidePants() : base(0x2B78) => Weight = 5.0; public HidePants(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Studded/HidePauldrons.cs b/Projects/Scripts/Items/Armor/Studded/HidePauldrons.cs index 567a12e9f..44a4541fc 100644 --- a/Projects/Scripts/Items/Armor/Studded/HidePauldrons.cs +++ b/Projects/Scripts/Items/Armor/Studded/HidePauldrons.cs @@ -4,10 +4,7 @@ namespace Server.Items public class HidePauldrons : BaseArmor { [Constructible] - public HidePauldrons() : base(0x2B77) - { - Weight = 4.0; - } + public HidePauldrons() : base(0x2B77) => Weight = 4.0; public HidePauldrons(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Studded/StuddedArms.cs b/Projects/Scripts/Items/Armor/Studded/StuddedArms.cs index bf9c93fc7..24c7b3720 100644 --- a/Projects/Scripts/Items/Armor/Studded/StuddedArms.cs +++ b/Projects/Scripts/Items/Armor/Studded/StuddedArms.cs @@ -4,10 +4,7 @@ namespace Server.Items public class StuddedArms : BaseArmor { [Constructible] - public StuddedArms() : base(0x13DC) - { - Weight = 4.0; - } + public StuddedArms() : base(0x13DC) => Weight = 4.0; public StuddedArms(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Studded/StuddedBustierArms.cs b/Projects/Scripts/Items/Armor/Studded/StuddedBustierArms.cs index eee9bb458..c23297507 100644 --- a/Projects/Scripts/Items/Armor/Studded/StuddedBustierArms.cs +++ b/Projects/Scripts/Items/Armor/Studded/StuddedBustierArms.cs @@ -4,10 +4,7 @@ namespace Server.Items public class StuddedBustierArms : BaseArmor { [Constructible] - public StuddedBustierArms() : base(0x1C0C) - { - Weight = 1.0; - } + public StuddedBustierArms() : base(0x1C0C) => Weight = 1.0; public StuddedBustierArms(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Studded/StuddedChest.cs b/Projects/Scripts/Items/Armor/Studded/StuddedChest.cs index e4b612aa7..40b287bfe 100644 --- a/Projects/Scripts/Items/Armor/Studded/StuddedChest.cs +++ b/Projects/Scripts/Items/Armor/Studded/StuddedChest.cs @@ -4,10 +4,7 @@ namespace Server.Items public class StuddedChest : BaseArmor { [Constructible] - public StuddedChest() : base(0x13DB) - { - Weight = 8.0; - } + public StuddedChest() : base(0x13DB) => Weight = 8.0; public StuddedChest(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Studded/StuddedDo.cs b/Projects/Scripts/Items/Armor/Studded/StuddedDo.cs index 5e63952ea..a78791d12 100644 --- a/Projects/Scripts/Items/Armor/Studded/StuddedDo.cs +++ b/Projects/Scripts/Items/Armor/Studded/StuddedDo.cs @@ -3,10 +3,7 @@ namespace Server.Items public class StuddedDo : BaseArmor { [Constructible] - public StuddedDo() : base(0x27C7) - { - Weight = 8.0; - } + public StuddedDo() : base(0x27C7) => Weight = 8.0; public StuddedDo(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Studded/StuddedGloves.cs b/Projects/Scripts/Items/Armor/Studded/StuddedGloves.cs index a3fcd8f41..dd978fa09 100644 --- a/Projects/Scripts/Items/Armor/Studded/StuddedGloves.cs +++ b/Projects/Scripts/Items/Armor/Studded/StuddedGloves.cs @@ -4,10 +4,7 @@ namespace Server.Items public class StuddedGloves : BaseArmor { [Constructible] - public StuddedGloves() : base(0x13D5) - { - Weight = 1.0; - } + public StuddedGloves() : base(0x13D5) => Weight = 1.0; public StuddedGloves(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Studded/StuddedGorget.cs b/Projects/Scripts/Items/Armor/Studded/StuddedGorget.cs index fbb1fd7be..948737b24 100644 --- a/Projects/Scripts/Items/Armor/Studded/StuddedGorget.cs +++ b/Projects/Scripts/Items/Armor/Studded/StuddedGorget.cs @@ -3,10 +3,7 @@ namespace Server.Items public class StuddedGorget : BaseArmor { [Constructible] - public StuddedGorget() : base(0x13D6) - { - Weight = 1.0; - } + public StuddedGorget() : base(0x13D6) => Weight = 1.0; public StuddedGorget(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Studded/StuddedHaidate.cs b/Projects/Scripts/Items/Armor/Studded/StuddedHaidate.cs index a9950fb65..e6b3288fd 100644 --- a/Projects/Scripts/Items/Armor/Studded/StuddedHaidate.cs +++ b/Projects/Scripts/Items/Armor/Studded/StuddedHaidate.cs @@ -3,10 +3,7 @@ namespace Server.Items public class StuddedHaidate : BaseArmor { [Constructible] - public StuddedHaidate() : base(0x278B) - { - Weight = 5.0; - } + public StuddedHaidate() : base(0x278B) => Weight = 5.0; public StuddedHaidate(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Studded/StuddedHiroSode.cs b/Projects/Scripts/Items/Armor/Studded/StuddedHiroSode.cs index 960f8ff0b..5569f379e 100644 --- a/Projects/Scripts/Items/Armor/Studded/StuddedHiroSode.cs +++ b/Projects/Scripts/Items/Armor/Studded/StuddedHiroSode.cs @@ -3,10 +3,7 @@ namespace Server.Items public class StuddedHiroSode : BaseArmor { [Constructible] - public StuddedHiroSode() : base(0x277F) - { - Weight = 1.0; - } + public StuddedHiroSode() : base(0x277F) => Weight = 1.0; public StuddedHiroSode(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Studded/StuddedLegs.cs b/Projects/Scripts/Items/Armor/Studded/StuddedLegs.cs index fad053907..18eb7e188 100644 --- a/Projects/Scripts/Items/Armor/Studded/StuddedLegs.cs +++ b/Projects/Scripts/Items/Armor/Studded/StuddedLegs.cs @@ -4,10 +4,7 @@ namespace Server.Items public class StuddedLegs : BaseArmor { [Constructible] - public StuddedLegs() : base(0x13DA) - { - Weight = 5.0; - } + public StuddedLegs() : base(0x13DA) => Weight = 5.0; public StuddedLegs(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Studded/StuddedMempo.cs b/Projects/Scripts/Items/Armor/Studded/StuddedMempo.cs index d30c6d7e4..f3d415acf 100644 --- a/Projects/Scripts/Items/Armor/Studded/StuddedMempo.cs +++ b/Projects/Scripts/Items/Armor/Studded/StuddedMempo.cs @@ -3,10 +3,7 @@ namespace Server.Items public class StuddedMempo : BaseArmor { [Constructible] - public StuddedMempo() : base(0x279D) - { - Weight = 2.0; - } + public StuddedMempo() : base(0x279D) => Weight = 2.0; public StuddedMempo(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Armor/Studded/StuddedSuneate.cs b/Projects/Scripts/Items/Armor/Studded/StuddedSuneate.cs index cbca5ac9e..e2e25c8ad 100644 --- a/Projects/Scripts/Items/Armor/Studded/StuddedSuneate.cs +++ b/Projects/Scripts/Items/Armor/Studded/StuddedSuneate.cs @@ -3,10 +3,7 @@ namespace Server.Items public class StuddedSuneate : BaseArmor { [Constructible] - public StuddedSuneate() : base(0x27D2) - { - Weight = 5.0; - } + public StuddedSuneate() : base(0x27D2) => Weight = 5.0; public StuddedSuneate(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Body Parts/Torso.cs b/Projects/Scripts/Items/Body Parts/Torso.cs index f9541aac4..87bd436ec 100644 --- a/Projects/Scripts/Items/Body Parts/Torso.cs +++ b/Projects/Scripts/Items/Body Parts/Torso.cs @@ -3,10 +3,7 @@ namespace Server.Items public class Torso : Item { [Constructible] - public Torso() : base(0x1D9F) - { - Weight = 2.0; - } + public Torso() : base(0x1D9F) => Weight = 2.0; public Torso(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Books/BaseBook.cs b/Projects/Scripts/Items/Books/BaseBook.cs index 906eebe8e..010e314f4 100644 --- a/Projects/Scripts/Items/Books/BaseBook.cs +++ b/Projects/Scripts/Items/Books/BaseBook.cs @@ -11,15 +11,9 @@ namespace Server.Items { public class BookPageInfo { - public BookPageInfo() - { - Lines = new string[0]; - } + public BookPageInfo() => Lines = new string[0]; - public BookPageInfo(params string[] lines) - { - Lines = lines; - } + public BookPageInfo(params string[] lines) => Lines = lines; public BookPageInfo(GenericReader reader) { diff --git a/Projects/Scripts/Items/Books/Defined/BlackthornWelcomeBook.cs b/Projects/Scripts/Items/Books/Defined/BlackthornWelcomeBook.cs index cfc163d41..2af39d036 100644 --- a/Projects/Scripts/Items/Books/Defined/BlackthornWelcomeBook.cs +++ b/Projects/Scripts/Items/Books/Defined/BlackthornWelcomeBook.cs @@ -266,10 +266,7 @@ namespace Server.Items ); [Constructible] - public BlackthornWelcomeBook() : base(false) - { - Hue = 0x89B; - } + public BlackthornWelcomeBook() : base(false) => Hue = 0x89B; public BlackthornWelcomeBook(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Books/Defined/NewAquariumBook.cs b/Projects/Scripts/Items/Books/Defined/NewAquariumBook.cs index 2778db166..e20b07547 100644 --- a/Projects/Scripts/Items/Books/Defined/NewAquariumBook.cs +++ b/Projects/Scripts/Items/Books/Defined/NewAquariumBook.cs @@ -101,10 +101,7 @@ namespace Server.Items ); [Constructible] - public NewAquariumBook() : base(false) - { - Hue = 0; - } + public NewAquariumBook() : base(false) => Hue = 0; public NewAquariumBook(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Champion Artifacts/Decorative/SkullPole.cs b/Projects/Scripts/Items/Champion Artifacts/Decorative/SkullPole.cs index f9bd3db44..44a1ffcdf 100644 --- a/Projects/Scripts/Items/Champion Artifacts/Decorative/SkullPole.cs +++ b/Projects/Scripts/Items/Champion Artifacts/Decorative/SkullPole.cs @@ -3,10 +3,7 @@ namespace Server.Items public class SkullPole : Item { [Constructible] - public SkullPole() : base(0x2204) - { - Weight = 5; - } + public SkullPole() : base(0x2204) => Weight = 5; public SkullPole(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Champion Artifacts/Decorative/TatteredAncientMummyWrapping.cs b/Projects/Scripts/Items/Champion Artifacts/Decorative/TatteredAncientMummyWrapping.cs index 3b2fe9ae6..41fae27f5 100644 --- a/Projects/Scripts/Items/Champion Artifacts/Decorative/TatteredAncientMummyWrapping.cs +++ b/Projects/Scripts/Items/Champion Artifacts/Decorative/TatteredAncientMummyWrapping.cs @@ -3,10 +3,7 @@ namespace Server.Items public class TatteredAncientMummyWrapping : Item { [Constructible] - public TatteredAncientMummyWrapping() : base(0xE21) - { - Hue = 0x909; - } + public TatteredAncientMummyWrapping() : base(0xE21) => Hue = 0x909; public TatteredAncientMummyWrapping(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Champion Artifacts/Shared/ANecromancerShroud.cs b/Projects/Scripts/Items/Champion Artifacts/Shared/ANecromancerShroud.cs index 6547f0cf9..7dfa52940 100644 --- a/Projects/Scripts/Items/Champion Artifacts/Shared/ANecromancerShroud.cs +++ b/Projects/Scripts/Items/Champion Artifacts/Shared/ANecromancerShroud.cs @@ -3,10 +3,7 @@ namespace Server.Items public class ANecromancerShroud : Robe { [Constructible] - public ANecromancerShroud() - { - Hue = 0x455; - } + public ANecromancerShroud() => Hue = 0x455; public ANecromancerShroud(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Champion Artifacts/Shared/SamaritanRobe.cs b/Projects/Scripts/Items/Champion Artifacts/Shared/SamaritanRobe.cs index 8a44bdc52..b78abe290 100644 --- a/Projects/Scripts/Items/Champion Artifacts/Shared/SamaritanRobe.cs +++ b/Projects/Scripts/Items/Champion Artifacts/Shared/SamaritanRobe.cs @@ -3,10 +3,7 @@ namespace Server.Items public class SamaritanRobe : Robe { [Constructible] - public SamaritanRobe() - { - Hue = 0x2a3; - } + public SamaritanRobe() => Hue = 0x2a3; public SamaritanRobe(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Clothing/BaseClothing.cs b/Projects/Scripts/Items/Clothing/BaseClothing.cs index 7c33d025f..2ff921345 100644 --- a/Projects/Scripts/Items/Clothing/BaseClothing.cs +++ b/Projects/Scripts/Items/Clothing/BaseClothing.cs @@ -561,10 +561,7 @@ namespace Server.Items return false; } - private string GetNameString() - { - return Name ?? $"#{LabelNumber}"; - } + private string GetNameString() => Name ?? $"#{LabelNumber}"; public override void AddNameProperty(ObjectPropertyList list) { @@ -856,10 +853,7 @@ namespace Server.Items flags |= toSet; } - private static bool GetSaveFlag(SaveFlag flags, SaveFlag toGet) - { - return (flags & toGet) != 0; - } + private static bool GetSaveFlag(SaveFlag flags, SaveFlag toGet) => (flags & toGet) != 0; [Flags] private enum SaveFlag diff --git a/Projects/Scripts/Items/Clothing/Cloaks.cs b/Projects/Scripts/Items/Clothing/Cloaks.cs index 79d180577..7ea31f336 100644 --- a/Projects/Scripts/Items/Clothing/Cloaks.cs +++ b/Projects/Scripts/Items/Clothing/Cloaks.cs @@ -31,10 +31,7 @@ namespace Server.Items public class Cloak : BaseCloak, IArcaneEquip { [Constructible] - public Cloak(int hue = 0) : base(0x1515, hue) - { - Weight = 5.0; - } + public Cloak(int hue = 0) : base(0x1515, hue) => Weight = 5.0; public Cloak(Serial serial) : base(serial) { @@ -273,10 +270,7 @@ namespace Server.Items public class FurCape : BaseCloak { [Constructible] - public FurCape(int hue = 0) : base(0x230A, hue) - { - Weight = 4.0; - } + public FurCape(int hue = 0) : base(0x230A, hue) => Weight = 4.0; public FurCape(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Clothing/Hats.cs b/Projects/Scripts/Items/Clothing/Hats.cs index 5c837356b..122a4c086 100644 --- a/Projects/Scripts/Items/Clothing/Hats.cs +++ b/Projects/Scripts/Items/Clothing/Hats.cs @@ -77,10 +77,7 @@ namespace Server.Items public class Kasa : BaseHat { [Constructible] - public Kasa(int hue = 0) : base(0x2798, hue) - { - Weight = 3.0; - } + public Kasa(int hue = 0) : base(0x2798, hue) => Weight = 3.0; public Kasa(Serial serial) : base(serial) { @@ -114,10 +111,7 @@ namespace Server.Items public class ClothNinjaHood : BaseHat { [Constructible] - public ClothNinjaHood(int hue = 0) : base(0x278F, hue) - { - Weight = 2.0; - } + public ClothNinjaHood(int hue = 0) : base(0x278F, hue) => Weight = 2.0; public ClothNinjaHood(Serial serial) : base(serial) { @@ -151,10 +145,7 @@ namespace Server.Items public class FlowerGarland : BaseHat { [Constructible] - public FlowerGarland(int hue = 0) : base(0x2306, hue) - { - Weight = 1.0; - } + public FlowerGarland(int hue = 0) : base(0x2306, hue) => Weight = 1.0; public FlowerGarland(Serial serial) : base(serial) { @@ -187,10 +178,7 @@ namespace Server.Items public class FloppyHat : BaseHat { [Constructible] - public FloppyHat(int hue = 0) : base(0x1713, hue) - { - Weight = 1.0; - } + public FloppyHat(int hue = 0) : base(0x1713, hue) => Weight = 1.0; public FloppyHat(Serial serial) : base(serial) { @@ -223,10 +211,7 @@ namespace Server.Items public class WideBrimHat : BaseHat { [Constructible] - public WideBrimHat(int hue = 0) : base(0x1714, hue) - { - Weight = 1.0; - } + public WideBrimHat(int hue = 0) : base(0x1714, hue) => Weight = 1.0; public WideBrimHat(Serial serial) : base(serial) { @@ -259,10 +244,7 @@ namespace Server.Items public class Cap : BaseHat { [Constructible] - public Cap(int hue = 0) : base(0x1715, hue) - { - Weight = 1.0; - } + public Cap(int hue = 0) : base(0x1715, hue) => Weight = 1.0; public Cap(Serial serial) : base(serial) { @@ -295,10 +277,7 @@ namespace Server.Items public class SkullCap : BaseHat { [Constructible] - public SkullCap(int hue = 0) : base(0x1544, hue) - { - Weight = 1.0; - } + public SkullCap(int hue = 0) : base(0x1544, hue) => Weight = 1.0; public SkullCap(Serial serial) : base(serial) { @@ -331,10 +310,7 @@ namespace Server.Items public class Bandana : BaseHat { [Constructible] - public Bandana(int hue = 0) : base(0x1540, hue) - { - Weight = 1.0; - } + public Bandana(int hue = 0) : base(0x1540, hue) => Weight = 1.0; public Bandana(Serial serial) : base(serial) { @@ -367,10 +343,7 @@ namespace Server.Items public class BearMask : BaseHat { [Constructible] - public BearMask(int hue = 0) : base(0x1545, hue) - { - Weight = 5.0; - } + public BearMask(int hue = 0) : base(0x1545, hue) => Weight = 5.0; public BearMask(Serial serial) : base(serial) { @@ -409,10 +382,7 @@ namespace Server.Items public class DeerMask : BaseHat { [Constructible] - public DeerMask(int hue = 0) : base(0x1547, hue) - { - Weight = 4.0; - } + public DeerMask(int hue = 0) : base(0x1547, hue) => Weight = 4.0; public DeerMask(Serial serial) : base(serial) { @@ -451,10 +421,7 @@ namespace Server.Items public class HornedTribalMask : BaseHat { [Constructible] - public HornedTribalMask(int hue = 0) : base(0x1549, hue) - { - Weight = 2.0; - } + public HornedTribalMask(int hue = 0) : base(0x1549, hue) => Weight = 2.0; public HornedTribalMask(Serial serial) : base(serial) { @@ -493,10 +460,7 @@ namespace Server.Items public class TribalMask : BaseHat { [Constructible] - public TribalMask(int hue = 0) : base(0x154B, hue) - { - Weight = 2.0; - } + public TribalMask(int hue = 0) : base(0x154B, hue) => Weight = 2.0; public TribalMask(Serial serial) : base(serial) { @@ -535,10 +499,7 @@ namespace Server.Items public class TallStrawHat : BaseHat { [Constructible] - public TallStrawHat(int hue = 0) : base(0x1716, hue) - { - Weight = 1.0; - } + public TallStrawHat(int hue = 0) : base(0x1716, hue) => Weight = 1.0; public TallStrawHat(Serial serial) : base(serial) { @@ -571,10 +532,7 @@ namespace Server.Items public class StrawHat : BaseHat { [Constructible] - public StrawHat(int hue = 0) : base(0x1717, hue) - { - Weight = 1.0; - } + public StrawHat(int hue = 0) : base(0x1717, hue) => Weight = 1.0; public StrawHat(Serial serial) : base(serial) { @@ -607,10 +565,7 @@ namespace Server.Items public class OrcishKinMask : BaseHat { [Constructible] - public OrcishKinMask(int hue = 0x8A4) : base(0x141B, hue) - { - Weight = 2.0; - } + public OrcishKinMask(int hue = 0x8A4) : base(0x141B, hue) => Weight = 2.0; public OrcishKinMask(Serial serial) : base(serial) { @@ -679,10 +634,7 @@ namespace Server.Items public SavageMask() : this(GetRandomHue()) {} [Constructible] - public SavageMask(int hue) : base(0x154B, hue) - { - Weight = 2.0; - } + public SavageMask(int hue) : base(0x154B, hue) => Weight = 2.0; public SavageMask(Serial serial) : base(serial) { @@ -734,10 +686,7 @@ namespace Server.Items public class WizardsHat : BaseHat { [Constructible] - public WizardsHat(int hue = 0) : base(0x1718, hue) - { - Weight = 1.0; - } + public WizardsHat(int hue = 0) : base(0x1718, hue) => Weight = 1.0; public WizardsHat(Serial serial) : base(serial) { @@ -770,10 +719,7 @@ namespace Server.Items public class MagicWizardsHat : BaseHat { [Constructible] - public MagicWizardsHat(int hue = 0) : base(0x1718, hue) - { - Weight = 1.0; - } + public MagicWizardsHat(int hue = 0) : base(0x1718, hue) => Weight = 1.0; public MagicWizardsHat(Serial serial) : base(serial) { @@ -812,10 +758,7 @@ namespace Server.Items public class Bonnet : BaseHat { [Constructible] - public Bonnet(int hue = 0) : base(0x1719, hue) - { - Weight = 1.0; - } + public Bonnet(int hue = 0) : base(0x1719, hue) => Weight = 1.0; public Bonnet(Serial serial) : base(serial) { @@ -848,10 +791,7 @@ namespace Server.Items public class FeatheredHat : BaseHat { [Constructible] - public FeatheredHat(int hue = 0) : base(0x171A, hue) - { - Weight = 1.0; - } + public FeatheredHat(int hue = 0) : base(0x171A, hue) => Weight = 1.0; public FeatheredHat(Serial serial) : base(serial) { @@ -884,10 +824,7 @@ namespace Server.Items public class TricorneHat : BaseHat { [Constructible] - public TricorneHat(int hue = 0) : base(0x171B, hue) - { - Weight = 1.0; - } + public TricorneHat(int hue = 0) : base(0x171B, hue) => Weight = 1.0; public TricorneHat(Serial serial) : base(serial) { @@ -920,10 +857,7 @@ namespace Server.Items public class JesterHat : BaseHat { [Constructible] - public JesterHat(int hue = 0) : base(0x171C, hue) - { - Weight = 1.0; - } + public JesterHat(int hue = 0) : base(0x171C, hue) => Weight = 1.0; public JesterHat(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Clothing/MiddleTorso.cs b/Projects/Scripts/Items/Clothing/MiddleTorso.cs index 4c6d6f254..0e5dfcbb6 100644 --- a/Projects/Scripts/Items/Clothing/MiddleTorso.cs +++ b/Projects/Scripts/Items/Clothing/MiddleTorso.cs @@ -29,10 +29,7 @@ namespace Server.Items public class BodySash : BaseMiddleTorso { [Constructible] - public BodySash(int hue = 0) : base(0x1541, hue) - { - Weight = 1.0; - } + public BodySash(int hue = 0) : base(0x1541, hue) => Weight = 1.0; public BodySash(Serial serial) : base(serial) { @@ -57,10 +54,7 @@ namespace Server.Items public class FullApron : BaseMiddleTorso { [Constructible] - public FullApron(int hue = 0) : base(0x153d, hue) - { - Weight = 4.0; - } + public FullApron(int hue = 0) : base(0x153d, hue) => Weight = 4.0; public FullApron(Serial serial) : base(serial) { @@ -85,10 +79,7 @@ namespace Server.Items public class Doublet : BaseMiddleTorso { [Constructible] - public Doublet(int hue = 0) : base(0x1F7B, hue) - { - Weight = 2.0; - } + public Doublet(int hue = 0) : base(0x1F7B, hue) => Weight = 2.0; public Doublet(Serial serial) : base(serial) { @@ -113,10 +104,7 @@ namespace Server.Items public class Surcoat : BaseMiddleTorso { [Constructible] - public Surcoat(int hue = 0) : base(0x1FFD, hue) - { - Weight = 6.0; - } + public Surcoat(int hue = 0) : base(0x1FFD, hue) => Weight = 6.0; public Surcoat(Serial serial) : base(serial) { @@ -144,10 +132,7 @@ namespace Server.Items public class Tunic : BaseMiddleTorso { [Constructible] - public Tunic(int hue = 0) : base(0x1FA1, hue) - { - Weight = 5.0; - } + public Tunic(int hue = 0) : base(0x1FA1, hue) => Weight = 5.0; public Tunic(Serial serial) : base(serial) { @@ -172,10 +157,7 @@ namespace Server.Items public class FormalShirt : BaseMiddleTorso { [Constructible] - public FormalShirt(int hue = 0) : base(0x2310, hue) - { - Weight = 1.0; - } + public FormalShirt(int hue = 0) : base(0x2310, hue) => Weight = 1.0; public FormalShirt(Serial serial) : base(serial) { @@ -203,10 +185,7 @@ namespace Server.Items public class JesterSuit : BaseMiddleTorso { [Constructible] - public JesterSuit(int hue = 0) : base(0x1F9F, hue) - { - Weight = 4.0; - } + public JesterSuit(int hue = 0) : base(0x1F9F, hue) => Weight = 4.0; public JesterSuit(Serial serial) : base(serial) { @@ -231,10 +210,7 @@ namespace Server.Items public class JinBaori : BaseMiddleTorso { [Constructible] - public JinBaori(int hue = 0) : base(0x27A1, hue) - { - Weight = 3.0; - } + public JinBaori(int hue = 0) : base(0x27A1, hue) => Weight = 3.0; public JinBaori(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Clothing/OuterLegs.cs b/Projects/Scripts/Items/Clothing/OuterLegs.cs index 89a9d66ea..3bf25d0c3 100644 --- a/Projects/Scripts/Items/Clothing/OuterLegs.cs +++ b/Projects/Scripts/Items/Clothing/OuterLegs.cs @@ -29,10 +29,7 @@ namespace Server.Items public class FurSarong : BaseOuterLegs { [Constructible] - public FurSarong(int hue = 0) : base(0x230C, hue) - { - Weight = 3.0; - } + public FurSarong(int hue = 0) : base(0x230C, hue) => Weight = 3.0; public FurSarong(Serial serial) : base(serial) { @@ -60,10 +57,7 @@ namespace Server.Items public class Skirt : BaseOuterLegs { [Constructible] - public Skirt(int hue = 0) : base(0x1516, hue) - { - Weight = 4.0; - } + public Skirt(int hue = 0) : base(0x1516, hue) => Weight = 4.0; public Skirt(Serial serial) : base(serial) { @@ -88,10 +82,7 @@ namespace Server.Items public class Kilt : BaseOuterLegs { [Constructible] - public Kilt(int hue = 0) : base(0x1537, hue) - { - Weight = 2.0; - } + public Kilt(int hue = 0) : base(0x1537, hue) => Weight = 2.0; public Kilt(Serial serial) : base(serial) { @@ -116,10 +107,7 @@ namespace Server.Items public class Hakama : BaseOuterLegs { [Constructible] - public Hakama(int hue = 0) : base(0x279A, hue) - { - Weight = 2.0; - } + public Hakama(int hue = 0) : base(0x279A, hue) => Weight = 2.0; public Hakama(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Clothing/OuterTorso.cs b/Projects/Scripts/Items/Clothing/OuterTorso.cs index d488983a1..8b9d4223f 100644 --- a/Projects/Scripts/Items/Clothing/OuterTorso.cs +++ b/Projects/Scripts/Items/Clothing/OuterTorso.cs @@ -32,10 +32,7 @@ namespace Server.Items public class GildedDress : BaseOuterTorso { [Constructible] - public GildedDress(int hue = 0) : base(0x230E, hue) - { - Weight = 3.0; - } + public GildedDress(int hue = 0) : base(0x230E, hue) => Weight = 3.0; public GildedDress(Serial serial) : base(serial) { @@ -60,10 +57,7 @@ namespace Server.Items public class FancyDress : BaseOuterTorso { [Constructible] - public FancyDress(int hue = 0) : base(0x1F00, hue) - { - Weight = 3.0; - } + public FancyDress(int hue = 0) : base(0x1F00, hue) => Weight = 3.0; public FancyDress(Serial serial) : base(serial) { @@ -447,10 +441,7 @@ namespace Server.Items public class Robe : BaseOuterTorso, IArcaneEquip { [Constructible] - public Robe(int hue = 0) : base(0x1F03, hue) - { - Weight = 3.0; - } + public Robe(int hue = 0) : base(0x1F03, hue) => Weight = 3.0; public Robe(Serial serial) : base(serial) { @@ -608,10 +599,7 @@ namespace Server.Items public class PlainDress : BaseOuterTorso { [Constructible] - public PlainDress(int hue = 0) : base(0x1F01, hue) - { - Weight = 2.0; - } + public PlainDress(int hue = 0) : base(0x1F01, hue) => Weight = 2.0; public PlainDress(Serial serial) : base(serial) { @@ -639,10 +627,7 @@ namespace Server.Items public class Kamishimo : BaseOuterTorso { [Constructible] - public Kamishimo(int hue = 0) : base(0x2799, hue) - { - Weight = 3.0; - } + public Kamishimo(int hue = 0) : base(0x2799, hue) => Weight = 3.0; public Kamishimo(Serial serial) : base(serial) { @@ -667,10 +652,7 @@ namespace Server.Items public class HakamaShita : BaseOuterTorso { [Constructible] - public HakamaShita(int hue = 0) : base(0x279C, hue) - { - Weight = 3.0; - } + public HakamaShita(int hue = 0) : base(0x279C, hue) => Weight = 3.0; public HakamaShita(Serial serial) : base(serial) { @@ -695,10 +677,7 @@ namespace Server.Items public class MaleKimono : BaseOuterTorso { [Constructible] - public MaleKimono(int hue = 0) : base(0x2782, hue) - { - Weight = 3.0; - } + public MaleKimono(int hue = 0) : base(0x2782, hue) => Weight = 3.0; public MaleKimono(Serial serial) : base(serial) { @@ -725,10 +704,7 @@ namespace Server.Items public class FemaleKimono : BaseOuterTorso { [Constructible] - public FemaleKimono(int hue = 0) : base(0x2783, hue) - { - Weight = 3.0; - } + public FemaleKimono(int hue = 0) : base(0x2783, hue) => Weight = 3.0; public FemaleKimono(Serial serial) : base(serial) { @@ -755,10 +731,7 @@ namespace Server.Items public class MaleElvenRobe : BaseOuterTorso { [Constructible] - public MaleElvenRobe(int hue = 0) : base(0x2FB9, hue) - { - Weight = 2.0; - } + public MaleElvenRobe(int hue = 0) : base(0x2FB9, hue) => Weight = 2.0; public MaleElvenRobe(Serial serial) : base(serial) { @@ -785,10 +758,7 @@ namespace Server.Items public class FemaleElvenRobe : BaseOuterTorso { [Constructible] - public FemaleElvenRobe(int hue = 0) : base(0x2FBA, hue) - { - Weight = 2.0; - } + public FemaleElvenRobe(int hue = 0) : base(0x2FBA, hue) => Weight = 2.0; public FemaleElvenRobe(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Clothing/Pants.cs b/Projects/Scripts/Items/Clothing/Pants.cs index 194f64a86..f6bad0f72 100644 --- a/Projects/Scripts/Items/Clothing/Pants.cs +++ b/Projects/Scripts/Items/Clothing/Pants.cs @@ -29,10 +29,7 @@ namespace Server.Items public class ShortPants : BasePants { [Constructible] - public ShortPants(int hue = 0) : base(0x152E, hue) - { - Weight = 2.0; - } + public ShortPants(int hue = 0) : base(0x152E, hue) => Weight = 2.0; public ShortPants(Serial serial) : base(serial) { @@ -57,10 +54,7 @@ namespace Server.Items public class LongPants : BasePants { [Constructible] - public LongPants(int hue = 0) : base(0x1539, hue) - { - Weight = 2.0; - } + public LongPants(int hue = 0) : base(0x1539, hue) => Weight = 2.0; public LongPants(Serial serial) : base(serial) { @@ -85,10 +79,7 @@ namespace Server.Items public class TattsukeHakama : BasePants { [Constructible] - public TattsukeHakama(int hue = 0) : base(0x279B, hue) - { - Weight = 2.0; - } + public TattsukeHakama(int hue = 0) : base(0x279B, hue) => Weight = 2.0; public TattsukeHakama(Serial serial) : base(serial) { @@ -113,10 +104,7 @@ namespace Server.Items public class ElvenPants : BasePants { [Constructible] - public ElvenPants(int hue = 0) : base(0x2FC3, hue) - { - Weight = 2.0; - } + public ElvenPants(int hue = 0) : base(0x2FC3, hue) => Weight = 2.0; public ElvenPants(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Clothing/Shirts.cs b/Projects/Scripts/Items/Clothing/Shirts.cs index 7fecc9b4a..dff12db1a 100644 --- a/Projects/Scripts/Items/Clothing/Shirts.cs +++ b/Projects/Scripts/Items/Clothing/Shirts.cs @@ -29,10 +29,7 @@ namespace Server.Items public class FancyShirt : BaseShirt { [Constructible] - public FancyShirt(int hue = 0) : base(0x1EFD, hue) - { - Weight = 2.0; - } + public FancyShirt(int hue = 0) : base(0x1EFD, hue) => Weight = 2.0; public FancyShirt(Serial serial) : base(serial) { @@ -57,10 +54,7 @@ namespace Server.Items public class Shirt : BaseShirt { [Constructible] - public Shirt(int hue = 0) : base(0x1517, hue) - { - Weight = 1.0; - } + public Shirt(int hue = 0) : base(0x1517, hue) => Weight = 1.0; public Shirt(Serial serial) : base(serial) { @@ -116,10 +110,7 @@ namespace Server.Items public class ElvenShirt : BaseShirt { [Constructible] - public ElvenShirt(int hue = 0) : base(0x3175, hue) - { - Weight = 2.0; - } + public ElvenShirt(int hue = 0) : base(0x3175, hue) => Weight = 2.0; public ElvenShirt(Serial serial) : base(serial) @@ -146,10 +137,7 @@ namespace Server.Items public class ElvenDarkShirt : BaseShirt { [Constructible] - public ElvenDarkShirt(int hue = 0) : base(0x3176, hue) - { - Weight = 2.0; - } + public ElvenDarkShirt(int hue = 0) : base(0x3176, hue) => Weight = 2.0; public ElvenDarkShirt(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Clothing/Shoes.cs b/Projects/Scripts/Items/Clothing/Shoes.cs index ffdc83f57..025f61e25 100644 --- a/Projects/Scripts/Items/Clothing/Shoes.cs +++ b/Projects/Scripts/Items/Clothing/Shoes.cs @@ -53,10 +53,7 @@ namespace Server.Items public class FurBoots : BaseShoes { [Constructible] - public FurBoots(int hue = 0) : base(0x2307, hue) - { - Weight = 3.0; - } + public FurBoots(int hue = 0) : base(0x2307, hue) => Weight = 3.0; public FurBoots(Serial serial) : base(serial) { @@ -81,10 +78,7 @@ namespace Server.Items public class Boots : BaseShoes { [Constructible] - public Boots(int hue = 0) : base(0x170B, hue) - { - Weight = 3.0; - } + public Boots(int hue = 0) : base(0x170B, hue) => Weight = 3.0; public Boots(Serial serial) : base(serial) { @@ -111,10 +105,7 @@ namespace Server.Items public class ThighBoots : BaseShoes, IArcaneEquip { [Constructible] - public ThighBoots(int hue = 0) : base(0x1711, hue) - { - Weight = 4.0; - } + public ThighBoots(int hue = 0) : base(0x1711, hue) => Weight = 4.0; public ThighBoots(Serial serial) : base(serial) { @@ -237,10 +228,7 @@ namespace Server.Items public class Shoes : BaseShoes { [Constructible] - public Shoes(int hue = 0) : base(0x170F, hue) - { - Weight = 2.0; - } + public Shoes(int hue = 0) : base(0x170F, hue) => Weight = 2.0; public Shoes(Serial serial) : base(serial) { @@ -267,10 +255,7 @@ namespace Server.Items public class Sandals : BaseShoes { [Constructible] - public Sandals(int hue = 0) : base(0x170D, hue) - { - Weight = 1.0; - } + public Sandals(int hue = 0) : base(0x170D, hue) => Weight = 1.0; public Sandals(Serial serial) : base(serial) { @@ -278,10 +263,7 @@ namespace Server.Items public override CraftResource DefaultResource => CraftResource.RegularLeather; - public override bool Dye(Mobile from, DyeTub sender) - { - return false; - } + public override bool Dye(Mobile from, DyeTub sender) => false; public override void Serialize(GenericWriter writer) { @@ -302,10 +284,7 @@ namespace Server.Items public class NinjaTabi : BaseShoes { [Constructible] - public NinjaTabi(int hue = 0) : base(0x2797, hue) - { - Weight = 2.0; - } + public NinjaTabi(int hue = 0) : base(0x2797, hue) => Weight = 2.0; public NinjaTabi(Serial serial) : base(serial) { @@ -330,10 +309,7 @@ namespace Server.Items public class SamuraiTabi : BaseShoes { [Constructible] - public SamuraiTabi(int hue = 0) : base(0x2796, hue) - { - Weight = 2.0; - } + public SamuraiTabi(int hue = 0) : base(0x2796, hue) => Weight = 2.0; public SamuraiTabi(Serial serial) : base(serial) { @@ -358,10 +334,7 @@ namespace Server.Items public class Waraji : BaseShoes { [Constructible] - public Waraji(int hue = 0) : base(0x2796, hue) - { - Weight = 2.0; - } + public Waraji(int hue = 0) : base(0x2796, hue) => Weight = 2.0; public Waraji(Serial serial) : base(serial) { @@ -386,10 +359,7 @@ namespace Server.Items public class ElvenBoots : BaseShoes { [Constructible] - public ElvenBoots(int hue = 0) : base(0x2FC4, hue) - { - Weight = 2.0; - } + public ElvenBoots(int hue = 0) : base(0x2FC4, hue) => Weight = 2.0; public ElvenBoots(Serial serial) : base(serial) { @@ -399,10 +369,7 @@ namespace Server.Items public override Race RequiredRace => Race.Elf; - public override bool Dye(Mobile from, DyeTub sender) - { - return false; - } + public override bool Dye(Mobile from, DyeTub sender) => false; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Items/Clothing/Waist.cs b/Projects/Scripts/Items/Clothing/Waist.cs index 5c6f62b9e..562645e9f 100644 --- a/Projects/Scripts/Items/Clothing/Waist.cs +++ b/Projects/Scripts/Items/Clothing/Waist.cs @@ -29,10 +29,7 @@ namespace Server.Items public class HalfApron : BaseWaist { [Constructible] - public HalfApron(int hue = 0) : base(0x153b, hue) - { - Weight = 2.0; - } + public HalfApron(int hue = 0) : base(0x153b, hue) => Weight = 2.0; public HalfApron(Serial serial) : base(serial) { @@ -57,10 +54,7 @@ namespace Server.Items public class Obi : BaseWaist { [Constructible] - public Obi(int hue = 0) : base(0x27A0, hue) - { - Weight = 1.0; - } + public Obi(int hue = 0) : base(0x27A0, hue) => Weight = 1.0; public Obi(Serial serial) : base(serial) { @@ -85,10 +79,7 @@ namespace Server.Items public class WoodlandBelt : BaseWaist { [Constructible] - public WoodlandBelt(int hue = 0) : base(0x2B68, hue) - { - Weight = 4.0; - } + public WoodlandBelt(int hue = 0) : base(0x2B68, hue) => Weight = 4.0; public WoodlandBelt(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Construction/Ankhs.cs b/Projects/Scripts/Items/Construction/Ankhs.cs index 16dd12f07..850bd4c10 100644 --- a/Projects/Scripts/Items/Construction/Ankhs.cs +++ b/Projects/Scripts/Items/Construction/Ankhs.cs @@ -65,10 +65,7 @@ namespace Server.Items { private PlayerMobile m_Mobile; - public LockKarmaEntry(PlayerMobile mobile) : base(mobile.KarmaLocked ? 6197 : 6196, LockRange) - { - m_Mobile = mobile; - } + public LockKarmaEntry(PlayerMobile mobile) : base(mobile.KarmaLocked ? 6197 : 6196, LockRange) => m_Mobile = mobile; public override void OnClick() { diff --git a/Projects/Scripts/Items/Construction/Chairs/Benchs.cs b/Projects/Scripts/Items/Construction/Chairs/Benchs.cs index 26e3e5fb7..ff2c8a84a 100644 --- a/Projects/Scripts/Items/Construction/Chairs/Benchs.cs +++ b/Projects/Scripts/Items/Construction/Chairs/Benchs.cs @@ -5,10 +5,7 @@ namespace Server.Items public class WoodenBench : Item { [Constructible] - public WoodenBench() : base(0xB2D) - { - Weight = 6; - } + public WoodenBench() : base(0xB2D) => Weight = 6; public WoodenBench(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Construction/Chairs/Chairs.cs b/Projects/Scripts/Items/Construction/Chairs/Chairs.cs index 85d185d73..eddc5a868 100644 --- a/Projects/Scripts/Items/Construction/Chairs/Chairs.cs +++ b/Projects/Scripts/Items/Construction/Chairs/Chairs.cs @@ -5,10 +5,7 @@ namespace Server.Items public class FancyWoodenChairCushion : Item { [Constructible] - public FancyWoodenChairCushion() : base(0xB4F) - { - Weight = 20.0; - } + public FancyWoodenChairCushion() : base(0xB4F) => Weight = 20.0; public FancyWoodenChairCushion(Serial serial) : base(serial) { @@ -37,10 +34,7 @@ namespace Server.Items public class WoodenChairCushion : Item { [Constructible] - public WoodenChairCushion() : base(0xB53) - { - Weight = 20.0; - } + public WoodenChairCushion() : base(0xB53) => Weight = 20.0; public WoodenChairCushion(Serial serial) : base(serial) { @@ -69,10 +63,7 @@ namespace Server.Items public class WoodenChair : Item { [Constructible] - public WoodenChair() : base(0xB57) - { - Weight = 20.0; - } + public WoodenChair() : base(0xB57) => Weight = 20.0; public WoodenChair(Serial serial) : base(serial) { @@ -101,10 +92,7 @@ namespace Server.Items public class BambooChair : Item { [Constructible] - public BambooChair() : base(0xB5B) - { - Weight = 20.0; - } + public BambooChair() : base(0xB5B) => Weight = 20.0; public BambooChair(Serial serial) : base(serial) { @@ -133,10 +121,7 @@ namespace Server.Items public class StoneChair : Item { [Constructible] - public StoneChair() : base(0x1218) - { - Weight = 20; - } + public StoneChair() : base(0x1218) => Weight = 20; public StoneChair(Serial serial) : base(serial) { @@ -162,10 +147,7 @@ namespace Server.Items public class OrnateElvenChair : Item { [Constructible] - public OrnateElvenChair() : base(0x2DE3) - { - Weight = 1.0; - } + public OrnateElvenChair() : base(0x2DE3) => Weight = 1.0; public OrnateElvenChair(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Construction/Chairs/Stools.cs b/Projects/Scripts/Items/Construction/Chairs/Stools.cs index d6d2af532..8cacfa889 100644 --- a/Projects/Scripts/Items/Construction/Chairs/Stools.cs +++ b/Projects/Scripts/Items/Construction/Chairs/Stools.cs @@ -4,10 +4,7 @@ namespace Server.Items public class Stool : Item { [Constructible] - public Stool() : base(0xA2A) - { - Weight = 10.0; - } + public Stool() : base(0xA2A) => Weight = 10.0; public Stool(Serial serial) : base(serial) { @@ -35,10 +32,7 @@ namespace Server.Items public class FootStool : Item { [Constructible] - public FootStool() : base(0xB5E) - { - Weight = 6.0; - } + public FootStool() : base(0xB5E) => Weight = 6.0; public FootStool(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Construction/Chairs/Thrones.cs b/Projects/Scripts/Items/Construction/Chairs/Thrones.cs index 5258ce788..2a93db750 100644 --- a/Projects/Scripts/Items/Construction/Chairs/Thrones.cs +++ b/Projects/Scripts/Items/Construction/Chairs/Thrones.cs @@ -5,10 +5,7 @@ namespace Server.Items public class Throne : Item { [Constructible] - public Throne() : base(0xB33) - { - Weight = 1.0; - } + public Throne() : base(0xB33) => Weight = 1.0; public Throne(Serial serial) : base(serial) { @@ -37,10 +34,7 @@ namespace Server.Items public class WoodenThrone : Item { [Constructible] - public WoodenThrone() : base(0xB2E) - { - Weight = 15.0; - } + public WoodenThrone() : base(0xB2E) => Weight = 15.0; public WoodenThrone(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Construction/Decorative/DecorativeShield.cs b/Projects/Scripts/Items/Construction/Decorative/DecorativeShield.cs index ec21931e6..b0960a44b 100644 --- a/Projects/Scripts/Items/Construction/Decorative/DecorativeShield.cs +++ b/Projects/Scripts/Items/Construction/Decorative/DecorativeShield.cs @@ -4,10 +4,7 @@ namespace Server.Items public class DecorativeShield1 : Item { [Constructible] - public DecorativeShield1() : base(0x156C) - { - Movable = false; - } + public DecorativeShield1() : base(0x156C) => Movable = false; public DecorativeShield1(Serial serial) : base(serial) { @@ -32,10 +29,7 @@ namespace Server.Items public class DecorativeShield2 : Item { [Constructible] - public DecorativeShield2() : base(0x156E) - { - Movable = false; - } + public DecorativeShield2() : base(0x156E) => Movable = false; public DecorativeShield2(Serial serial) : base(serial) { @@ -60,10 +54,7 @@ namespace Server.Items public class DecorativeShield3 : Item { [Constructible] - public DecorativeShield3() : base(0x1570) - { - Movable = false; - } + public DecorativeShield3() : base(0x1570) => Movable = false; public DecorativeShield3(Serial serial) : base(serial) { @@ -88,10 +79,7 @@ namespace Server.Items public class DecorativeShield4 : Item { [Constructible] - public DecorativeShield4() : base(0x1572) - { - Movable = false; - } + public DecorativeShield4() : base(0x1572) => Movable = false; public DecorativeShield4(Serial serial) : base(serial) { @@ -116,10 +104,7 @@ namespace Server.Items public class DecorativeShield5 : Item { [Constructible] - public DecorativeShield5() : base(0x1574) - { - Movable = false; - } + public DecorativeShield5() : base(0x1574) => Movable = false; public DecorativeShield5(Serial serial) : base(serial) { @@ -144,10 +129,7 @@ namespace Server.Items public class DecorativeShield6 : Item { [Constructible] - public DecorativeShield6() : base(0x1576) - { - Movable = false; - } + public DecorativeShield6() : base(0x1576) => Movable = false; public DecorativeShield6(Serial serial) : base(serial) { @@ -172,10 +154,7 @@ namespace Server.Items public class DecorativeShield7 : Item { [Constructible] - public DecorativeShield7() : base(0x1578) - { - Movable = false; - } + public DecorativeShield7() : base(0x1578) => Movable = false; public DecorativeShield7(Serial serial) : base(serial) { @@ -200,10 +179,7 @@ namespace Server.Items public class DecorativeShield8 : Item { [Constructible] - public DecorativeShield8() : base(0x157A) - { - Movable = false; - } + public DecorativeShield8() : base(0x157A) => Movable = false; public DecorativeShield8(Serial serial) : base(serial) { @@ -228,10 +204,7 @@ namespace Server.Items public class DecorativeShield9 : Item { [Constructible] - public DecorativeShield9() : base(0x157C) - { - Movable = false; - } + public DecorativeShield9() : base(0x157C) => Movable = false; public DecorativeShield9(Serial serial) : base(serial) { @@ -256,10 +229,7 @@ namespace Server.Items public class DecorativeShield10 : Item { [Constructible] - public DecorativeShield10() : base(0x157E) - { - Movable = false; - } + public DecorativeShield10() : base(0x157E) => Movable = false; public DecorativeShield10(Serial serial) : base(serial) { @@ -284,10 +254,7 @@ namespace Server.Items public class DecorativeShield11 : Item { [Constructible] - public DecorativeShield11() : base(0x1580) - { - Movable = false; - } + public DecorativeShield11() : base(0x1580) => Movable = false; public DecorativeShield11(Serial serial) : base(serial) { @@ -312,10 +279,7 @@ namespace Server.Items public class DecorativeShieldSword1North : Item { [Constructible] - public DecorativeShieldSword1North() : base(Utility.Random(0x1582, 2)) - { - Movable = false; - } + public DecorativeShieldSword1North() : base(Utility.Random(0x1582, 2)) => Movable = false; public DecorativeShieldSword1North(Serial serial) : base(serial) { @@ -340,10 +304,7 @@ namespace Server.Items public class DecorativeShieldSword1West : Item { [Constructible] - public DecorativeShieldSword1West() : base(Utility.Random(0x1634, 2)) - { - Movable = false; - } + public DecorativeShieldSword1West() : base(Utility.Random(0x1634, 2)) => Movable = false; public DecorativeShieldSword1West(Serial serial) : base(serial) { @@ -368,10 +329,7 @@ namespace Server.Items public class DecorativeShieldSword2North : Item { [Constructible] - public DecorativeShieldSword2North() : base(Utility.Random(0x1584, 2)) - { - Movable = false; - } + public DecorativeShieldSword2North() : base(Utility.Random(0x1584, 2)) => Movable = false; public DecorativeShieldSword2North(Serial serial) : base(serial) { @@ -396,10 +354,7 @@ namespace Server.Items public class DecorativeShieldSword2West : Item { [Constructible] - public DecorativeShieldSword2West() : base(Utility.Random(0x1636, 2)) - { - Movable = false; - } + public DecorativeShieldSword2West() : base(Utility.Random(0x1636, 2)) => Movable = false; public DecorativeShieldSword2West(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Construction/Decorative/DecorativeWeapon.cs b/Projects/Scripts/Items/Construction/Decorative/DecorativeWeapon.cs index c60acdffc..f5ddae119 100644 --- a/Projects/Scripts/Items/Construction/Decorative/DecorativeWeapon.cs +++ b/Projects/Scripts/Items/Construction/Decorative/DecorativeWeapon.cs @@ -4,10 +4,7 @@ namespace Server.Items public class DecorativeBowWest : Item { [Constructible] - public DecorativeBowWest() : base(Utility.Random(0x155E, 2)) - { - Movable = false; - } + public DecorativeBowWest() : base(Utility.Random(0x155E, 2)) => Movable = false; public DecorativeBowWest(Serial serial) : base(serial) { @@ -32,10 +29,7 @@ namespace Server.Items public class DecorativeBowNorth : Item { [Constructible] - public DecorativeBowNorth() : base(Utility.Random(0x155C, 2)) - { - Movable = false; - } + public DecorativeBowNorth() : base(Utility.Random(0x155C, 2)) => Movable = false; public DecorativeBowNorth(Serial serial) : base(serial) { @@ -60,10 +54,7 @@ namespace Server.Items public class DecorativeAxeNorth : Item { [Constructible] - public DecorativeAxeNorth() : base(Utility.Random(0x1560, 2)) - { - Movable = false; - } + public DecorativeAxeNorth() : base(Utility.Random(0x1560, 2)) => Movable = false; public DecorativeAxeNorth(Serial serial) : base(serial) { @@ -88,10 +79,7 @@ namespace Server.Items public class DecorativeAxeWest : Item { [Constructible] - public DecorativeAxeWest() : base(Utility.Random(0x1562, 2)) - { - Movable = false; - } + public DecorativeAxeWest() : base(Utility.Random(0x1562, 2)) => Movable = false; public DecorativeAxeWest(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Construction/Decorative/PaintingPortraits.cs b/Projects/Scripts/Items/Construction/Decorative/PaintingPortraits.cs index 6940d0632..697191fdc 100644 --- a/Projects/Scripts/Items/Construction/Decorative/PaintingPortraits.cs +++ b/Projects/Scripts/Items/Construction/Decorative/PaintingPortraits.cs @@ -3,10 +3,7 @@ namespace Server.Items public class LargePainting : Item { [Constructible] - public LargePainting() : base(0x0EA0) - { - Movable = false; - } + public LargePainting() : base(0x0EA0) => Movable = false; public LargePainting(Serial serial) : base(serial) { @@ -31,10 +28,7 @@ namespace Server.Items public class WomanPortrait1 : Item { [Constructible] - public WomanPortrait1() : base(0x0E9F) - { - Movable = false; - } + public WomanPortrait1() : base(0x0E9F) => Movable = false; public WomanPortrait1(Serial serial) : base(serial) { @@ -59,10 +53,7 @@ namespace Server.Items public class WomanPortrait2 : Item { [Constructible] - public WomanPortrait2() : base(0x0EE7) - { - Movable = false; - } + public WomanPortrait2() : base(0x0EE7) => Movable = false; public WomanPortrait2(Serial serial) : base(serial) { @@ -87,10 +78,7 @@ namespace Server.Items public class ManPortrait1 : Item { [Constructible] - public ManPortrait1() : base(0x0EA2) - { - Movable = false; - } + public ManPortrait1() : base(0x0EA2) => Movable = false; public ManPortrait1(Serial serial) : base(serial) { @@ -115,10 +103,7 @@ namespace Server.Items public class ManPortrait2 : Item { [Constructible] - public ManPortrait2() : base(0x0EA3) - { - Movable = false; - } + public ManPortrait2() : base(0x0EA3) => Movable = false; public ManPortrait2(Serial serial) : base(serial) { @@ -143,10 +128,7 @@ namespace Server.Items public class LadyPortrait1 : Item { [Constructible] - public LadyPortrait1() : base(0x0EA6) - { - Movable = false; - } + public LadyPortrait1() : base(0x0EA6) => Movable = false; public LadyPortrait1(Serial serial) : base(serial) { @@ -171,10 +153,7 @@ namespace Server.Items public class LadyPortrait2 : Item { [Constructible] - public LadyPortrait2() : base(0x0EA7) - { - Movable = false; - } + public LadyPortrait2() : base(0x0EA7) => Movable = false; public LadyPortrait2(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Construction/Doors/BaseDoor.cs b/Projects/Scripts/Items/Construction/Doors/BaseDoor.cs index 03e43fc4d..00e5889d3 100644 --- a/Projects/Scripts/Items/Construction/Doors/BaseDoor.cs +++ b/Projects/Scripts/Items/Construction/Doors/BaseDoor.cs @@ -273,10 +273,7 @@ namespace Server.Items } } - public static Point3D GetOffset(DoorFacing facing) - { - return m_Offsets[(int)facing]; - } + public static Point3D GetOffset(DoorFacing facing) => m_Offsets[(int)facing]; public bool CanClose() { @@ -371,15 +368,9 @@ namespace Server.Items return freeToClose; } - public virtual bool IsInside(Mobile from) - { - return false; - } + public virtual bool IsInside(Mobile from) => false; - public virtual bool UseLocks() - { - return true; - } + public virtual bool UseLocks() => true; public virtual void Use(Mobile from) { diff --git a/Projects/Scripts/Items/Construction/Doors/HouseDoors.cs b/Projects/Scripts/Items/Construction/Doors/HouseDoors.cs index f872c42b9..87c28db25 100644 --- a/Projects/Scripts/Items/Construction/Doors/HouseDoors.cs +++ b/Projects/Scripts/Items/Construction/Doors/HouseDoors.cs @@ -152,10 +152,7 @@ namespace Server.Items house.Visits++; } - public override bool UseLocks() - { - return FindHouse()?.IsAosRules != true; - } + public override bool UseLocks() => FindHouse()?.IsAosRules != true; public override void Use(Mobile from) { diff --git a/Projects/Scripts/Items/Construction/Floors/Floors.cs b/Projects/Scripts/Items/Construction/Floors/Floors.cs index a50951236..70e62daef 100644 --- a/Projects/Scripts/Items/Construction/Floors/Floors.cs +++ b/Projects/Scripts/Items/Construction/Floors/Floors.cs @@ -2,10 +2,7 @@ namespace Server.Items { public abstract class BaseFloor : Item { - public BaseFloor(int itemID, int count) : base(Utility.Random(itemID, count)) - { - Movable = false; - } + public BaseFloor(int itemID, int count) : base(Utility.Random(itemID, count)) => Movable = false; public BaseFloor(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Construction/Misc/BarrelParts.cs b/Projects/Scripts/Items/Construction/Misc/BarrelParts.cs index 302963cf7..6259ef922 100644 --- a/Projects/Scripts/Items/Construction/Misc/BarrelParts.cs +++ b/Projects/Scripts/Items/Construction/Misc/BarrelParts.cs @@ -3,10 +3,7 @@ namespace Server.Items public class BarrelLid : Item { [Constructible] - public BarrelLid() : base(0x1DB8) - { - Weight = 2; - } + public BarrelLid() : base(0x1DB8) => Weight = 2; public BarrelLid(Serial serial) : base(serial) { @@ -31,10 +28,7 @@ namespace Server.Items public class BarrelStaves : Item { [Constructible] - public BarrelStaves() : base(0x1EB1) - { - Weight = 1; - } + public BarrelStaves() : base(0x1EB1) => Weight = 1; public BarrelStaves(Serial serial) : base(serial) { @@ -58,10 +52,7 @@ namespace Server.Items public class BarrelHoops : Item { [Constructible] - public BarrelHoops() : base(0x1DB7) - { - Weight = 5; - } + public BarrelHoops() : base(0x1DB7) => Weight = 5; public BarrelHoops(Serial serial) : base(serial) { @@ -87,10 +78,7 @@ namespace Server.Items public class BarrelTap : Item { [Constructible] - public BarrelTap() : base(0x1004) - { - Weight = 1; - } + public BarrelTap() : base(0x1004) => Weight = 1; public BarrelTap(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Construction/Misc/Easle.cs b/Projects/Scripts/Items/Construction/Misc/Easle.cs index 854f432b1..78bd73ca8 100644 --- a/Projects/Scripts/Items/Construction/Misc/Easle.cs +++ b/Projects/Scripts/Items/Construction/Misc/Easle.cs @@ -5,10 +5,7 @@ namespace Server.Items public class Easle : Item { [Constructible] - public Easle() : base(0xF65) - { - Weight = 25.0; - } + public Easle() : base(0xF65) => Weight = 25.0; public Easle(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Construction/Misc/MusicStand.cs b/Projects/Scripts/Items/Construction/Misc/MusicStand.cs index a196a6e04..9e900ca69 100644 --- a/Projects/Scripts/Items/Construction/Misc/MusicStand.cs +++ b/Projects/Scripts/Items/Construction/Misc/MusicStand.cs @@ -5,10 +5,7 @@ namespace Server.Items public class TallMusicStand : Item { [Constructible] - public TallMusicStand() : base(0xEBB) - { - Weight = 10.0; - } + public TallMusicStand() : base(0xEBB) => Weight = 10.0; public TallMusicStand(Serial serial) : base(serial) { @@ -37,10 +34,7 @@ namespace Server.Items public class ShortMusicStand : Item { [Constructible] - public ShortMusicStand() : base(0xEB6) - { - Weight = 10.0; - } + public ShortMusicStand() : base(0xEB6) => Weight = 10.0; public ShortMusicStand(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Construction/Misc/Obelisk.cs b/Projects/Scripts/Items/Construction/Misc/Obelisk.cs index 96b3d953a..dfbc3b7b9 100644 --- a/Projects/Scripts/Items/Construction/Misc/Obelisk.cs +++ b/Projects/Scripts/Items/Construction/Misc/Obelisk.cs @@ -3,10 +3,7 @@ namespace Server.Items public class Obelisk : Item { [Constructible] - public Obelisk() : base(0x1184) - { - Movable = false; - } + public Obelisk() : base(0x1184) => Movable = false; public Obelisk(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Construction/Misc/Screens.cs b/Projects/Scripts/Items/Construction/Misc/Screens.cs index 347ae9300..e4c2e8613 100644 --- a/Projects/Scripts/Items/Construction/Misc/Screens.cs +++ b/Projects/Scripts/Items/Construction/Misc/Screens.cs @@ -5,10 +5,7 @@ namespace Server.Items public class BambooScreen : Item { [Constructible] - public BambooScreen() : base(0x24D0) - { - Weight = 20.0; - } + public BambooScreen() : base(0x24D0) => Weight = 20.0; public BambooScreen(Serial serial) : base(serial) { @@ -34,10 +31,7 @@ namespace Server.Items public class ShojiScreen : Item { [Constructible] - public ShojiScreen() : base(0x24CB) - { - Weight = 20.0; - } + public ShojiScreen() : base(0x24CB) => Weight = 20.0; public ShojiScreen(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Construction/Misc/Statues.cs b/Projects/Scripts/Items/Construction/Misc/Statues.cs index 32337d1ab..29133b474 100644 --- a/Projects/Scripts/Items/Construction/Misc/Statues.cs +++ b/Projects/Scripts/Items/Construction/Misc/Statues.cs @@ -3,10 +3,7 @@ namespace Server.Items public class StatueSouth : Item { [Constructible] - public StatueSouth() : base(0x139A) - { - Weight = 10; - } + public StatueSouth() : base(0x139A) => Weight = 10; public StatueSouth(Serial serial) : base(serial) { @@ -32,10 +29,7 @@ namespace Server.Items public class StatueSouth2 : Item { [Constructible] - public StatueSouth2() : base(0x1227) - { - Weight = 10; - } + public StatueSouth2() : base(0x1227) => Weight = 10; public StatueSouth2(Serial serial) : base(serial) { @@ -61,10 +55,7 @@ namespace Server.Items public class StatueNorth : Item { [Constructible] - public StatueNorth() : base(0x139B) - { - Weight = 10; - } + public StatueNorth() : base(0x139B) => Weight = 10; public StatueNorth(Serial serial) : base(serial) { @@ -90,10 +81,7 @@ namespace Server.Items public class StatueWest : Item { [Constructible] - public StatueWest() : base(0x1226) - { - Weight = 10; - } + public StatueWest() : base(0x1226) => Weight = 10; public StatueWest(Serial serial) : base(serial) { @@ -119,10 +107,7 @@ namespace Server.Items public class StatueEast : Item { [Constructible] - public StatueEast() : base(0x139C) - { - Weight = 10; - } + public StatueEast() : base(0x139C) => Weight = 10; public StatueEast(Serial serial) : base(serial) { @@ -148,10 +133,7 @@ namespace Server.Items public class StatueEast2 : Item { [Constructible] - public StatueEast2() : base(0x1224) - { - Weight = 10; - } + public StatueEast2() : base(0x1224) => Weight = 10; public StatueEast2(Serial serial) : base(serial) { @@ -177,10 +159,7 @@ namespace Server.Items public class StatueSouthEast : Item { [Constructible] - public StatueSouthEast() : base(0x1225) - { - Weight = 10; - } + public StatueSouthEast() : base(0x1225) => Weight = 10; public StatueSouthEast(Serial serial) : base(serial) { @@ -206,10 +185,7 @@ namespace Server.Items public class BustSouth : Item { [Constructible] - public BustSouth() : base(0x12CB) - { - Weight = 10; - } + public BustSouth() : base(0x12CB) => Weight = 10; public BustSouth(Serial serial) : base(serial) { @@ -235,10 +211,7 @@ namespace Server.Items public class BustEast : Item { [Constructible] - public BustEast() : base(0x12CA) - { - Weight = 10; - } + public BustEast() : base(0x12CA) => Weight = 10; public BustEast(Serial serial) : base(serial) { @@ -264,10 +237,7 @@ namespace Server.Items public class StatuePegasus : Item { [Constructible] - public StatuePegasus() : base(0x139D) - { - Weight = 10; - } + public StatuePegasus() : base(0x139D) => Weight = 10; public StatuePegasus(Serial serial) : base(serial) { @@ -293,10 +263,7 @@ namespace Server.Items public class StatuePegasus2 : Item { [Constructible] - public StatuePegasus2() : base(0x1228) - { - Weight = 10; - } + public StatuePegasus2() : base(0x1228) => Weight = 10; public StatuePegasus2(Serial serial) : base(serial) { @@ -322,10 +289,7 @@ namespace Server.Items public class SmallTowerSculpture : Item { [Constructible] - public SmallTowerSculpture() : base(0x241A) - { - Weight = 20.0; - } + public SmallTowerSculpture() : base(0x241A) => Weight = 20.0; public SmallTowerSculpture(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Construction/Misc/Vase.cs b/Projects/Scripts/Items/Construction/Misc/Vase.cs index f0f18f05e..4c099743a 100644 --- a/Projects/Scripts/Items/Construction/Misc/Vase.cs +++ b/Projects/Scripts/Items/Construction/Misc/Vase.cs @@ -3,10 +3,7 @@ namespace Server.Items public class Vase : Item { [Constructible] - public Vase() : base(0xB46) - { - Weight = 10; - } + public Vase() : base(0xB46) => Weight = 10; public Vase(Serial serial) : base(serial) { @@ -30,10 +27,7 @@ namespace Server.Items public class LargeVase : Item { [Constructible] - public LargeVase() : base(0xB45) - { - Weight = 15; - } + public LargeVase() : base(0xB45) => Weight = 15; public LargeVase(Serial serial) : base(serial) { @@ -57,10 +51,7 @@ namespace Server.Items public class SmallUrn : Item { [Constructible] - public SmallUrn() : base(0x241C) - { - Weight = 20.0; - } + public SmallUrn() : base(0x241C) => Weight = 20.0; public SmallUrn(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Construction/Ruined/RuinedItemSingle.cs b/Projects/Scripts/Items/Construction/Ruined/RuinedItemSingle.cs index b9a1e39c7..77e553491 100644 --- a/Projects/Scripts/Items/Construction/Ruined/RuinedItemSingle.cs +++ b/Projects/Scripts/Items/Construction/Ruined/RuinedItemSingle.cs @@ -4,10 +4,7 @@ namespace Server.Items public class RuinedFallenChairA : Item { [Constructible] - public RuinedFallenChairA() : base(0xC10) - { - Movable = false; - } + public RuinedFallenChairA() : base(0xC10) => Movable = false; public RuinedFallenChairA(Serial serial) : base(serial) { @@ -32,10 +29,7 @@ namespace Server.Items public class RuinedArmoire : Item { [Constructible] - public RuinedArmoire() : base(0xC13) - { - Movable = false; - } + public RuinedArmoire() : base(0xC13) => Movable = false; public RuinedArmoire(Serial serial) : base(serial) { @@ -60,10 +54,7 @@ namespace Server.Items public class RuinedBookcase : Item { [Constructible] - public RuinedBookcase() : base(0xC14) - { - Movable = false; - } + public RuinedBookcase() : base(0xC14) => Movable = false; public RuinedBookcase(Serial serial) : base(serial) { @@ -87,10 +78,7 @@ namespace Server.Items public class RuinedBooks : Item { [Constructible] - public RuinedBooks() : base(0xC16) - { - Movable = false; - } + public RuinedBooks() : base(0xC16) => Movable = false; public RuinedBooks(Serial serial) : base(serial) { @@ -115,10 +103,7 @@ namespace Server.Items public class CoveredChair : Item { [Constructible] - public CoveredChair() : base(0xC17) - { - Movable = false; - } + public CoveredChair() : base(0xC17) => Movable = false; public CoveredChair(Serial serial) : base(serial) { @@ -143,10 +128,7 @@ namespace Server.Items public class RuinedFallenChairB : Item { [Constructible] - public RuinedFallenChairB() : base(0xC19) - { - Movable = false; - } + public RuinedFallenChairB() : base(0xC19) => Movable = false; public RuinedFallenChairB(Serial serial) : base(serial) { @@ -171,10 +153,7 @@ namespace Server.Items public class RuinedChair : Item { [Constructible] - public RuinedChair() : base(0xC1B) - { - Movable = false; - } + public RuinedChair() : base(0xC1B) => Movable = false; public RuinedChair(Serial serial) : base(serial) { @@ -198,10 +177,7 @@ namespace Server.Items public class RuinedClock : Item { [Constructible] - public RuinedClock() : base(0xC1F) - { - Movable = false; - } + public RuinedClock() : base(0xC1F) => Movable = false; public RuinedClock(Serial serial) : base(serial) { @@ -226,10 +202,7 @@ namespace Server.Items public class RuinedDrawers : Item { [Constructible] - public RuinedDrawers() : base(0xC24) - { - Movable = false; - } + public RuinedDrawers() : base(0xC24) => Movable = false; public RuinedDrawers(Serial serial) : base(serial) { @@ -253,10 +226,7 @@ namespace Server.Items public class RuinedPainting : Item { [Constructible] - public RuinedPainting() : base(0xC2C) - { - Movable = false; - } + public RuinedPainting() : base(0xC2C) => Movable = false; public RuinedPainting(Serial serial) : base(serial) { @@ -281,10 +251,7 @@ namespace Server.Items public class WoodDebris : Item { [Constructible] - public WoodDebris() : base(0xC2D) - { - Movable = false; - } + public WoodDebris() : base(0xC2D) => Movable = false; public WoodDebris(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Construction/Signs/BaseSign.cs b/Projects/Scripts/Items/Construction/Signs/BaseSign.cs index 69e194137..4f997a7ce 100644 --- a/Projects/Scripts/Items/Construction/Signs/BaseSign.cs +++ b/Projects/Scripts/Items/Construction/Signs/BaseSign.cs @@ -2,10 +2,7 @@ namespace Server.Items { public abstract class BaseSign : Item { - public BaseSign(int dispID) : base(dispID) - { - Movable = false; - } + public BaseSign(int dispID) : base(dispID) => Movable = false; public BaseSign(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Construction/Signs/LocalizedSign.cs b/Projects/Scripts/Items/Construction/Signs/LocalizedSign.cs index bfabffa9e..bb06dda71 100644 --- a/Projects/Scripts/Items/Construction/Signs/LocalizedSign.cs +++ b/Projects/Scripts/Items/Construction/Signs/LocalizedSign.cs @@ -5,16 +5,10 @@ namespace Server.Items private int m_LabelNumber; [Constructible] - public LocalizedSign(SignType type, SignFacing facing, int labelNumber) : base(0xB95 + 2 * (int)type + (int)facing) - { - m_LabelNumber = labelNumber; - } + public LocalizedSign(SignType type, SignFacing facing, int labelNumber) : base(0xB95 + 2 * (int)type + (int)facing) => m_LabelNumber = labelNumber; [Constructible] - public LocalizedSign(int itemID, int labelNumber) : base(itemID) - { - m_LabelNumber = labelNumber; - } + public LocalizedSign(int itemID, int labelNumber) : base(itemID) => m_LabelNumber = labelNumber; public LocalizedSign(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Construction/Signs/SubtextSign.cs b/Projects/Scripts/Items/Construction/Signs/SubtextSign.cs index 8ba2cd0d9..901406e77 100644 --- a/Projects/Scripts/Items/Construction/Signs/SubtextSign.cs +++ b/Projects/Scripts/Items/Construction/Signs/SubtextSign.cs @@ -6,17 +6,13 @@ namespace Server.Items [Constructible] public SubtextSign(SignType type, SignFacing facing, string subtext) - : base(type, facing) - { + : base(type, facing) => m_Subtext = subtext; - } [Constructible] public SubtextSign(int itemID, string subtext) - : base(itemID) - { + : base(itemID) => m_Subtext = subtext; - } public SubtextSign(Serial serial) : base(serial) diff --git a/Projects/Scripts/Items/Construction/Tables/Tables.cs b/Projects/Scripts/Items/Construction/Tables/Tables.cs index e7fd287ec..c3bd47c89 100644 --- a/Projects/Scripts/Items/Construction/Tables/Tables.cs +++ b/Projects/Scripts/Items/Construction/Tables/Tables.cs @@ -4,10 +4,7 @@ namespace Server.Items public class ElegantLowTable : Item { [Constructible] - public ElegantLowTable() : base(0x2819) - { - Weight = 1.0; - } + public ElegantLowTable() : base(0x2819) => Weight = 1.0; public ElegantLowTable(Serial serial) : base(serial) { @@ -32,10 +29,7 @@ namespace Server.Items public class PlainLowTable : Item { [Constructible] - public PlainLowTable() : base(0x281A) - { - Weight = 1.0; - } + public PlainLowTable() : base(0x281A) => Weight = 1.0; public PlainLowTable(Serial serial) : base(serial) { @@ -61,10 +55,7 @@ namespace Server.Items public class LargeTable : Item { [Constructible] - public LargeTable() : base(0xB90) - { - Weight = 1.0; - } + public LargeTable() : base(0xB90) => Weight = 1.0; public LargeTable(Serial serial) : base(serial) { @@ -93,10 +84,7 @@ namespace Server.Items public class Nightstand : Item { [Constructible] - public Nightstand() : base(0xB35) - { - Weight = 1.0; - } + public Nightstand() : base(0xB35) => Weight = 1.0; public Nightstand(Serial serial) : base(serial) { @@ -125,10 +113,7 @@ namespace Server.Items public class YewWoodTable : Item { [Constructible] - public YewWoodTable() : base(0xB8F) - { - Weight = 1.0; - } + public YewWoodTable() : base(0xB8F) => Weight = 1.0; public YewWoodTable(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Construction/Tables/WritingTable.cs b/Projects/Scripts/Items/Construction/Tables/WritingTable.cs index 46d0fa91c..5a5497098 100644 --- a/Projects/Scripts/Items/Construction/Tables/WritingTable.cs +++ b/Projects/Scripts/Items/Construction/Tables/WritingTable.cs @@ -5,10 +5,7 @@ namespace Server.Items public class WritingTable : Item { [Constructible] - public WritingTable() : base(0xB4A) - { - Weight = 1.0; - } + public WritingTable() : base(0xB4A) => Weight = 1.0; public WritingTable(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Construction/Walls/BaseWall.cs b/Projects/Scripts/Items/Construction/Walls/BaseWall.cs index 54a2c6d4d..d509dd345 100644 --- a/Projects/Scripts/Items/Construction/Walls/BaseWall.cs +++ b/Projects/Scripts/Items/Construction/Walls/BaseWall.cs @@ -2,10 +2,7 @@ namespace Server.Items { public abstract class BaseWall : Item { - public BaseWall(int itemID) : base(itemID) - { - Movable = false; - } + public BaseWall(int itemID) : base(itemID) => Movable = false; public BaseWall(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Containers/Container.cs b/Projects/Scripts/Items/Containers/Container.cs index 0cc191977..5dec60a0c 100644 --- a/Projects/Scripts/Items/Containers/Container.cs +++ b/Projects/Scripts/Items/Containers/Container.cs @@ -193,15 +193,9 @@ namespace Server.Items return false; } - public override bool OnDragDropInto(Mobile from, Item item, Point3D p) - { - return false; - } + public override bool OnDragDropInto(Mobile from, Item item, Point3D p) => false; - public override bool TryDropItem(Mobile from, Item dropped, bool sendFullMessage) - { - return false; - } + public override bool TryDropItem(Mobile from, Item dropped, bool sendFullMessage) => false; public override void Serialize(GenericWriter writer) { @@ -236,16 +230,11 @@ namespace Server.Items public override int DefaultMaxWeight => 1600; - public override bool CheckHold(Mobile m, Item item, bool message, bool checkItems, int plusItems, int plusWeight) - { - return base.CheckHold(m, item, false, checkItems, plusItems, plusWeight); - } + public override bool CheckHold(Mobile m, Item item, bool message, bool checkItems, int plusItems, int plusWeight) => base.CheckHold(m, item, false, checkItems, plusItems, plusWeight); - public override bool CheckContentDisplay(Mobile from) - { - return RootParent is BaseCreature creature && creature.Controlled && creature.ControlMaster == from || - base.CheckContentDisplay(from); - } + public override bool CheckContentDisplay(Mobile from) => + RootParent is BaseCreature creature && creature.Controlled && creature.ControlMaster == from || + base.CheckContentDisplay(from); public override void Serialize(GenericWriter writer) { @@ -319,10 +308,7 @@ namespace Server.Items public class Pouch : TrappableContainer { [Constructible] - public Pouch() : base(0xE79) - { - Weight = 1.0; - } + public Pouch() : base(0xE79) => Weight = 1.0; public Pouch(Serial serial) : base(serial) { @@ -345,10 +331,7 @@ namespace Server.Items public abstract class BaseBagBall : BaseContainer, IDyable { - public BaseBagBall(int itemID) : base(itemID) - { - Weight = 1.0; - } + public BaseBagBall(int itemID) : base(itemID) => Weight = 1.0; public BaseBagBall(Serial serial) : base(serial) { @@ -434,10 +417,7 @@ namespace Server.Items public class Bag : BaseContainer, IDyable { [Constructible] - public Bag() : base(0xE76) - { - Weight = 2.0; - } + public Bag() : base(0xE76) => Weight = 2.0; public Bag(Serial serial) : base(serial) { @@ -470,10 +450,7 @@ namespace Server.Items public class Barrel : BaseContainer { [Constructible] - public Barrel() : base(0xE77) - { - Weight = 25.0; - } + public Barrel() : base(0xE77) => Weight = 25.0; public Barrel(Serial serial) : base(serial) { @@ -500,10 +477,7 @@ namespace Server.Items public class Keg : BaseContainer { [Constructible] - public Keg() : base(0xE7F) - { - Weight = 15.0; - } + public Keg() : base(0xE7F) => Weight = 15.0; public Keg(Serial serial) : base(serial) { @@ -527,10 +501,7 @@ namespace Server.Items public class PicnicBasket : BaseContainer { [Constructible] - public PicnicBasket() : base(0xE7A) - { - Weight = 2.0; // Stratics doesn't know weight - } + public PicnicBasket() : base(0xE7A) => Weight = 2.0; public PicnicBasket(Serial serial) : base(serial) { @@ -554,10 +525,7 @@ namespace Server.Items public class Basket : BaseContainer { [Constructible] - public Basket() : base(0x990) - { - Weight = 1.0; // Stratics doesn't know weight - } + public Basket() : base(0x990) => Weight = 1.0; public Basket(Serial serial) : base(serial) { @@ -583,10 +551,7 @@ namespace Server.Items public class WoodenBox : LockableContainer { [Constructible] - public WoodenBox() : base(0x9AA) - { - Weight = 4.0; - } + public WoodenBox() : base(0x9AA) => Weight = 4.0; public WoodenBox(Serial serial) : base(serial) { @@ -612,10 +577,7 @@ namespace Server.Items public class SmallCrate : LockableContainer { [Constructible] - public SmallCrate() : base(0x9A9) - { - Weight = 2.0; - } + public SmallCrate() : base(0x9A9) => Weight = 2.0; public SmallCrate(Serial serial) : base(serial) { @@ -644,10 +606,7 @@ namespace Server.Items public class MediumCrate : LockableContainer { [Constructible] - public MediumCrate() : base(0xE3F) - { - Weight = 2.0; - } + public MediumCrate() : base(0xE3F) => Weight = 2.0; public MediumCrate(Serial serial) : base(serial) { @@ -676,10 +635,7 @@ namespace Server.Items public class LargeCrate : LockableContainer { [Constructible] - public LargeCrate() : base(0xE3D) - { - Weight = 1.0; - } + public LargeCrate() : base(0xE3D) => Weight = 1.0; public LargeCrate(Serial serial) : base(serial) { @@ -801,10 +757,7 @@ namespace Server.Items public class WoodenChest : LockableContainer { [Constructible] - public WoodenChest() : base(0xe43) - { - Weight = 2.0; - } + public WoodenChest() : base(0xe43) => Weight = 2.0; public WoodenChest(Serial serial) : base(serial) { @@ -926,10 +879,7 @@ namespace Server.Items public class WoodenFootLocker : LockableContainer { [Constructible] - public WoodenFootLocker() : base(0x2811) - { - GumpID = 0x10B; - } + public WoodenFootLocker() : base(0x2811) => GumpID = 0x10B; public WoodenFootLocker(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Containers/FillableContainers.cs b/Projects/Scripts/Items/Containers/FillableContainers.cs index 735a701b9..13b08e542 100644 --- a/Projects/Scripts/Items/Containers/FillableContainers.cs +++ b/Projects/Scripts/Items/Containers/FillableContainers.cs @@ -12,10 +12,8 @@ namespace Server.Items protected Timer m_RespawnTimer; public FillableContainer(int itemID) - : base(itemID) - { + : base(itemID) => Movable = false; - } public FillableContainer(Serial serial) : base(serial) @@ -271,10 +269,8 @@ namespace Server.Items { [Constructible] public LibraryBookcase() - : base(0xA97) - { + : base(0xA97) => Weight = 1.0; - } public LibraryBookcase(Serial serial) : base(serial) @@ -284,10 +280,7 @@ namespace Server.Items public override bool IsLockable => false; public override int SpawnThreshold => 5; - protected override int GetSpawnCount() - { - return 5 - GetItemsCount(); - } + protected override int GetSpawnCount() => 5 - GetItemsCount(); public override void AcquireContent() { @@ -323,10 +316,8 @@ namespace Server.Items { [Constructible] public FillableLargeCrate() - : base(0xE3D) - { + : base(0xE3D) => Weight = 1.0; - } public FillableLargeCrate(Serial serial) : base(serial) @@ -353,10 +344,8 @@ namespace Server.Items { [Constructible] public FillableSmallCrate() - : base(0x9A9) - { + : base(0x9A9) => Weight = 1.0; - } public FillableSmallCrate(Serial serial) : base(serial) @@ -383,10 +372,8 @@ namespace Server.Items { [Constructible] public FillableWoodenBox() - : base(0x9AA) - { + : base(0x9AA) => Weight = 4.0; - } public FillableWoodenBox(Serial serial) : base(serial) @@ -631,10 +618,8 @@ namespace Server.Items } public FillableBvrge(int weight, Type type, BeverageType content) - : base(weight, type) - { + : base(weight, type) => Content = content; - } public BeverageType Content{ get; } diff --git a/Projects/Scripts/Items/Containers/FurnitureContainer.cs b/Projects/Scripts/Items/Containers/FurnitureContainer.cs index 254c825c1..19cf6d72c 100644 --- a/Projects/Scripts/Items/Containers/FurnitureContainer.cs +++ b/Projects/Scripts/Items/Containers/FurnitureContainer.cs @@ -8,10 +8,7 @@ namespace Server.Items public class TallCabinet : BaseContainer { [Constructible] - public TallCabinet() : base(0x2815) - { - Weight = 1.0; - } + public TallCabinet() : base(0x2815) => Weight = 1.0; public TallCabinet(Serial serial) : base(serial) { @@ -35,10 +32,7 @@ namespace Server.Items public class ShortCabinet : BaseContainer { [Constructible] - public ShortCabinet() : base(0x2817) - { - Weight = 1.0; - } + public ShortCabinet() : base(0x2817) => Weight = 1.0; public ShortCabinet(Serial serial) : base(serial) { @@ -63,10 +57,7 @@ namespace Server.Items public class RedArmoire : BaseContainer { [Constructible] - public RedArmoire() : base(0x2857) - { - Weight = 1.0; - } + public RedArmoire() : base(0x2857) => Weight = 1.0; public RedArmoire(Serial serial) : base(serial) { @@ -90,10 +81,7 @@ namespace Server.Items public class CherryArmoire : BaseContainer { [Constructible] - public CherryArmoire() : base(0x285D) - { - Weight = 1.0; - } + public CherryArmoire() : base(0x285D) => Weight = 1.0; public CherryArmoire(Serial serial) : base(serial) { @@ -117,10 +105,7 @@ namespace Server.Items public class MapleArmoire : BaseContainer { [Constructible] - public MapleArmoire() : base(0x285B) - { - Weight = 1.0; - } + public MapleArmoire() : base(0x285B) => Weight = 1.0; public MapleArmoire(Serial serial) : base(serial) { @@ -144,10 +129,7 @@ namespace Server.Items public class ElegantArmoire : BaseContainer { [Constructible] - public ElegantArmoire() : base(0x2859) - { - Weight = 1.0; - } + public ElegantArmoire() : base(0x2859) => Weight = 1.0; public ElegantArmoire(Serial serial) : base(serial) { @@ -171,10 +153,7 @@ namespace Server.Items public class FullBookcase : BaseContainer { [Constructible] - public FullBookcase() : base(0xA97) - { - Weight = 1.0; - } + public FullBookcase() : base(0xA97) => Weight = 1.0; public FullBookcase(Serial serial) : base(serial) { @@ -228,10 +207,7 @@ namespace Server.Items public class Drawer : BaseContainer { [Constructible] - public Drawer() : base(0xA2C) - { - Weight = 1.0; - } + public Drawer() : base(0xA2C) => Weight = 1.0; public Drawer(Serial serial) : base(serial) { @@ -255,10 +231,7 @@ namespace Server.Items public class FancyDrawer : BaseContainer { [Constructible] - public FancyDrawer() : base(0xA30) - { - Weight = 1.0; - } + public FancyDrawer() : base(0xA30) => Weight = 1.0; public FancyDrawer(Serial serial) : base(serial) { @@ -282,10 +255,7 @@ namespace Server.Items public class Armoire : BaseContainer { [Constructible] - public Armoire() : base(0xA4F) - { - Weight = 1.0; - } + public Armoire() : base(0xA4F) => Weight = 1.0; public Armoire(Serial serial) : base(serial) { @@ -317,10 +287,7 @@ namespace Server.Items public class FancyArmoire : BaseContainer { [Constructible] - public FancyArmoire() : base(0xA4D) - { - Weight = 1.0; - } + public FancyArmoire() : base(0xA4D) => Weight = 1.0; public FancyArmoire(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Containers/LockableContainer.cs b/Projects/Scripts/Items/Containers/LockableContainer.cs index 0212a6716..783f90b0a 100644 --- a/Projects/Scripts/Items/Containers/LockableContainer.cs +++ b/Projects/Scripts/Items/Containers/LockableContainer.cs @@ -8,10 +8,7 @@ namespace Server.Items { private bool m_Locked; - public LockableContainer(int itemID) : base(itemID) - { - MaxLockLevel = 100; - } + public LockableContainer(int itemID) : base(itemID) => MaxLockLevel = 100; public LockableContainer(Serial serial) : base(serial) { @@ -200,10 +197,7 @@ namespace Server.Items } } - public override bool CheckContentDisplay(Mobile from) - { - return !m_Locked && base.CheckContentDisplay(from); - } + public override bool CheckContentDisplay(Mobile from) => !m_Locked && base.CheckContentDisplay(from); public override bool TryDropItem(Mobile from, Item dropped, bool sendFullMessage) { diff --git a/Projects/Scripts/Items/Containers/Strongbox.cs b/Projects/Scripts/Items/Containers/Strongbox.cs index 6149db6ed..cc3c967d0 100644 --- a/Projects/Scripts/Items/Containers/Strongbox.cs +++ b/Projects/Scripts/Items/Containers/Strongbox.cs @@ -110,12 +110,10 @@ namespace Server.Items } } - public override bool IsAccessibleTo(Mobile m) - { - return m_Owner?.Deleted != false || m_House?.Deleted != false || - m.AccessLevel >= AccessLevel.GameMaster || - m == m_Owner && m_House.IsCoOwner(m) && base.IsAccessibleTo(m); - } + public override bool IsAccessibleTo(Mobile m) => + m_Owner?.Deleted != false || m_House?.Deleted != false || + m.AccessLevel >= AccessLevel.GameMaster || + m == m_Owner && m_House.IsCoOwner(m) && base.IsAccessibleTo(m); private void Chop(Mobile from) { diff --git a/Projects/Scripts/Items/Containers/TreasureMapChest.cs b/Projects/Scripts/Items/Containers/TreasureMapChest.cs index 7c3291520..ed88814a9 100644 --- a/Projects/Scripts/Items/Containers/TreasureMapChest.cs +++ b/Projects/Scripts/Items/Containers/TreasureMapChest.cs @@ -365,15 +365,9 @@ namespace Server.Items return false; } - public override bool CheckItemUse(Mobile from, Item item) - { - return CheckLoot(from, item != this) && base.CheckItemUse(from, item); - } + public override bool CheckItemUse(Mobile from, Item item) => CheckLoot(from, item != this) && base.CheckItemUse(from, item); - public override bool CheckLift(Mobile from, Item item, ref LRReason reject) - { - return CheckLoot(from, true) && base.CheckLift(from, item, ref reject); - } + public override bool CheckLift(Mobile from, Item item, ref LRReason reject) => CheckLoot(from, true) && base.CheckLift(from, item, ref reject); public override void OnItemLifted(Mobile from, Item item) { diff --git a/Projects/Scripts/Items/Decoration Artifacts/BaseDecorationArtifact.cs b/Projects/Scripts/Items/Decoration Artifacts/BaseDecorationArtifact.cs index a489ba826..07ec39a87 100644 --- a/Projects/Scripts/Items/Decoration Artifacts/BaseDecorationArtifact.cs +++ b/Projects/Scripts/Items/Decoration Artifacts/BaseDecorationArtifact.cs @@ -2,10 +2,7 @@ namespace Server.Items { public abstract class BaseDecorationArtifact : Item { - public BaseDecorationArtifact(int itemID) : base(itemID) - { - Weight = 10.0; - } + public BaseDecorationArtifact(int itemID) : base(itemID) => Weight = 10.0; public BaseDecorationArtifact(Serial serial) : base(serial) { @@ -39,10 +36,7 @@ namespace Server.Items public abstract class BaseDecorationContainerArtifact : BaseContainer { - public BaseDecorationContainerArtifact(int itemID) : base(itemID) - { - Weight = 10.0; - } + public BaseDecorationContainerArtifact(int itemID) : base(itemID) => Weight = 10.0; public BaseDecorationContainerArtifact(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Decoration Artifacts/DoomDecorationArtifacts.cs b/Projects/Scripts/Items/Decoration Artifacts/DoomDecorationArtifacts.cs index 7f4532a07..6d8037e13 100644 --- a/Projects/Scripts/Items/Decoration Artifacts/DoomDecorationArtifacts.cs +++ b/Projects/Scripts/Items/Decoration Artifacts/DoomDecorationArtifacts.cs @@ -197,10 +197,7 @@ namespace Server.Items public class BrazierArtifact : BaseDecorationArtifact { [Constructible] - public BrazierArtifact() : base(0xE31) - { - Light = LightType.Circle150; - } + public BrazierArtifact() : base(0xE31) => Light = LightType.Circle150; public BrazierArtifact(Serial serial) : base(serial) { @@ -358,10 +355,7 @@ namespace Server.Items public class LampPostArtifact : BaseDecorationArtifact { [Constructible] - public LampPostArtifact() : base(0xB24) - { - Light = LightType.Circle300; - } + public LampPostArtifact() : base(0xB24) => Light = LightType.Circle300; public LampPostArtifact(Serial serial) : base(serial) { @@ -583,10 +577,7 @@ namespace Server.Items public class SkullCandleArtifact : BaseDecorationArtifact { [Constructible] - public SkullCandleArtifact() : base(0x1858) - { - Light = LightType.Circle150; - } + public SkullCandleArtifact() : base(0x1858) => Light = LightType.Circle150; public SkullCandleArtifact(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Decoration Artifacts/SEDecorationArtifacts.cs b/Projects/Scripts/Items/Decoration Artifacts/SEDecorationArtifacts.cs index ff29a730e..3b6864f60 100644 --- a/Projects/Scripts/Items/Decoration Artifacts/SEDecorationArtifacts.cs +++ b/Projects/Scripts/Items/Decoration Artifacts/SEDecorationArtifacts.cs @@ -1511,10 +1511,7 @@ namespace Server.Items public class TowerLanternArtifact : BaseDecorationArtifact { [Constructible] - public TowerLanternArtifact() : base(0x24C0) - { - Light = LightType.Circle225; - } + public TowerLanternArtifact() : base(0x24C0) => Light = LightType.Circle225; public TowerLanternArtifact(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Decoration Artifacts/StealableArtifactsSpawner.cs b/Projects/Scripts/Items/Decoration Artifacts/StealableArtifactsSpawner.cs index 5a1b4cea4..659928399 100644 --- a/Projects/Scripts/Items/Decoration Artifacts/StealableArtifactsSpawner.cs +++ b/Projects/Scripts/Items/Decoration Artifacts/StealableArtifactsSpawner.cs @@ -25,10 +25,7 @@ namespace Server.Items m_RespawnTimer = Timer.DelayCall(TimeSpan.Zero, TimeSpan.FromMinutes(15.0), CheckRespawn); } - public StealableArtifactsSpawner(Serial serial) : base(serial) - { - Instance = this; - } + public StealableArtifactsSpawner(Serial serial) : base(serial) => Instance = this; public static StealableEntry[] Entries{ get; } = { diff --git a/Projects/Scripts/Items/Deeds/ClothingBlessDeed.cs b/Projects/Scripts/Items/Deeds/ClothingBlessDeed.cs index 47b5f11e7..b467a4c0d 100644 --- a/Projects/Scripts/Items/Deeds/ClothingBlessDeed.cs +++ b/Projects/Scripts/Items/Deeds/ClothingBlessDeed.cs @@ -6,10 +6,7 @@ namespace Server.Items { private ClothingBlessDeed m_Deed; - public ClothingBlessTarget(ClothingBlessDeed deed) : base(1, false, TargetFlags.None) - { - m_Deed = deed; - } + public ClothingBlessTarget(ClothingBlessDeed deed) : base(1, false, TargetFlags.None) => m_Deed = deed; protected override void OnTarget(Mobile from, object target) // Override the protected OnTarget() for our feature { diff --git a/Projects/Scripts/Items/Deeds/CommodityDeed.cs b/Projects/Scripts/Items/Deeds/CommodityDeed.cs index 4393f8d22..183ef3819 100644 --- a/Projects/Scripts/Items/Deeds/CommodityDeed.cs +++ b/Projects/Scripts/Items/Deeds/CommodityDeed.cs @@ -187,10 +187,7 @@ namespace Server.Items { private CommodityDeed m_Deed; - public InternalTarget(CommodityDeed deed) : base(3, false, TargetFlags.None) - { - m_Deed = deed; - } + public InternalTarget(CommodityDeed deed) : base(3, false, TargetFlags.None) => m_Deed = deed; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Items/Deeds/DragonBardingDeed.cs b/Projects/Scripts/Items/Deeds/DragonBardingDeed.cs index 7ea718212..5b1a13ab5 100644 --- a/Projects/Scripts/Items/Deeds/DragonBardingDeed.cs +++ b/Projects/Scripts/Items/Deeds/DragonBardingDeed.cs @@ -12,10 +12,7 @@ namespace Server.Items private bool m_Exceptional; private CraftResource m_Resource; - public DragonBardingDeed() : base(0x14F0) - { - Weight = 1.0; - } + public DragonBardingDeed() : base(0x14F0) => Weight = 1.0; public DragonBardingDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Deeds/NameChangeDeed.cs b/Projects/Scripts/Items/Deeds/NameChangeDeed.cs index b50914696..fec987938 100644 --- a/Projects/Scripts/Items/Deeds/NameChangeDeed.cs +++ b/Projects/Scripts/Items/Deeds/NameChangeDeed.cs @@ -7,10 +7,7 @@ namespace Server.Items public class NameChangeDeed : Item { [Constructible] - public NameChangeDeed() : base(0x14F0) - { - LootType = LootType.Blessed; - } + public NameChangeDeed() : base(0x14F0) => LootType = LootType.Blessed; public NameChangeDeed(Serial serial) : base(serial) { @@ -82,15 +79,9 @@ namespace Server.Items AddTextEntry(x + 2, y + 2, width - 4, height - 4, 0, index, ""); } - public string Center(string text) - { - return $"
{text}
"; - } + public string Center(string text) => $"
{text}
"; - public string Color(string text, int color) - { - return $"{text}"; - } + public string Color(string text, int color) => $"{text}"; public void AddButtonLabeled(int x, int y, int buttonID, string text) { diff --git a/Projects/Scripts/Items/Deeds/NewPlayerTicket.cs b/Projects/Scripts/Items/Deeds/NewPlayerTicket.cs index e4b02d07e..01178d571 100644 --- a/Projects/Scripts/Items/Deeds/NewPlayerTicket.cs +++ b/Projects/Scripts/Items/Deeds/NewPlayerTicket.cs @@ -80,10 +80,7 @@ namespace Server.Items { private NewPlayerTicket m_Ticket; - public InternalTarget(NewPlayerTicket ticket) : base(2, false, TargetFlags.None) - { - m_Ticket = ticket; - } + public InternalTarget(NewPlayerTicket ticket) : base(2, false, TargetFlags.None) => m_Ticket = ticket; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Items/Deeds/VendorRentalContract.cs b/Projects/Scripts/Items/Deeds/VendorRentalContract.cs index 426a0e5ca..03b325947 100644 --- a/Projects/Scripts/Items/Deeds/VendorRentalContract.cs +++ b/Projects/Scripts/Items/Deeds/VendorRentalContract.cs @@ -225,10 +225,7 @@ namespace Server.Items { private VendorRentalContract m_Contract; - public ContractOptionEntry(VendorRentalContract contract) : base(6209) - { - m_Contract = contract; - } + public ContractOptionEntry(VendorRentalContract contract) : base(6209) => m_Contract = contract; public override void OnClick() { @@ -246,10 +243,7 @@ namespace Server.Items { private VendorRentalContract m_Contract; - public RentTarget(VendorRentalContract contract) : base(-1, false, TargetFlags.None) - { - m_Contract = contract; - } + public RentTarget(VendorRentalContract contract) : base(-1, false, TargetFlags.None) => m_Contract = contract; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Items/Farming/FarmableCabbage.cs b/Projects/Scripts/Items/Farming/FarmableCabbage.cs index ad1d7bde9..9d4da6d88 100644 --- a/Projects/Scripts/Items/Farming/FarmableCabbage.cs +++ b/Projects/Scripts/Items/Farming/FarmableCabbage.cs @@ -11,10 +11,7 @@ namespace Server.Items { } - public static int GetCropID() - { - return 3254; - } + public static int GetCropID() => 3254; public override Item GetCropObject() { @@ -25,10 +22,7 @@ namespace Server.Items return cabbage; } - public override int GetPickedID() - { - return 3254; - } + public override int GetPickedID() => 3254; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Items/Farming/FarmableCarrot.cs b/Projects/Scripts/Items/Farming/FarmableCarrot.cs index dcd043889..0e7b64441 100644 --- a/Projects/Scripts/Items/Farming/FarmableCarrot.cs +++ b/Projects/Scripts/Items/Farming/FarmableCarrot.cs @@ -11,10 +11,7 @@ namespace Server.Items { } - public static int GetCropID() - { - return 3190; - } + public static int GetCropID() => 3190; public override Item GetCropObject() { @@ -25,10 +22,7 @@ namespace Server.Items return carrot; } - public override int GetPickedID() - { - return 3254; - } + public override int GetPickedID() => 3254; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Items/Farming/FarmableCotton.cs b/Projects/Scripts/Items/Farming/FarmableCotton.cs index e6539ee02..750ca6f42 100644 --- a/Projects/Scripts/Items/Farming/FarmableCotton.cs +++ b/Projects/Scripts/Items/Farming/FarmableCotton.cs @@ -11,20 +11,11 @@ namespace Server.Items { } - public static int GetCropID() - { - return Utility.Random(3153, 4); - } + public static int GetCropID() => Utility.Random(3153, 4); - public override Item GetCropObject() - { - return new Cotton(); - } + public override Item GetCropObject() => new Cotton(); - public override int GetPickedID() - { - return 3254; - } + public override int GetPickedID() => 3254; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Items/Farming/FarmableCrop.cs b/Projects/Scripts/Items/Farming/FarmableCrop.cs index 6f0691f3a..7e3adb4e0 100644 --- a/Projects/Scripts/Items/Farming/FarmableCrop.cs +++ b/Projects/Scripts/Items/Farming/FarmableCrop.cs @@ -7,10 +7,7 @@ namespace Server.Items { private bool m_Picked; - public FarmableCrop(int itemID) : base(itemID) - { - Movable = false; - } + public FarmableCrop(int itemID) : base(itemID) => Movable = false; public FarmableCrop(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Farming/FarmableFlax.cs b/Projects/Scripts/Items/Farming/FarmableFlax.cs index 1fb45eb86..e5d0d2870 100644 --- a/Projects/Scripts/Items/Farming/FarmableFlax.cs +++ b/Projects/Scripts/Items/Farming/FarmableFlax.cs @@ -11,10 +11,7 @@ namespace Server.Items { } - public static int GetCropID() - { - return Utility.Random(6809, 3); - } + public static int GetCropID() => Utility.Random(6809, 3); public override Item GetCropObject() { @@ -25,10 +22,7 @@ namespace Server.Items return flax; } - public override int GetPickedID() - { - return 3254; - } + public override int GetPickedID() => 3254; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Items/Farming/FarmableLettuce.cs b/Projects/Scripts/Items/Farming/FarmableLettuce.cs index 3db700ba8..148eb35f1 100644 --- a/Projects/Scripts/Items/Farming/FarmableLettuce.cs +++ b/Projects/Scripts/Items/Farming/FarmableLettuce.cs @@ -11,10 +11,7 @@ namespace Server.Items { } - public static int GetCropID() - { - return 3254; - } + public static int GetCropID() => 3254; public override Item GetCropObject() { @@ -25,10 +22,7 @@ namespace Server.Items return lettuce; } - public override int GetPickedID() - { - return 3254; - } + public override int GetPickedID() => 3254; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Items/Farming/FarmableOnion.cs b/Projects/Scripts/Items/Farming/FarmableOnion.cs index 8ea9dd70e..ec0779c4e 100644 --- a/Projects/Scripts/Items/Farming/FarmableOnion.cs +++ b/Projects/Scripts/Items/Farming/FarmableOnion.cs @@ -11,10 +11,7 @@ namespace Server.Items { } - public static int GetCropID() - { - return 3183; - } + public static int GetCropID() => 3183; public override Item GetCropObject() { @@ -25,10 +22,7 @@ namespace Server.Items return onion; } - public override int GetPickedID() - { - return 3254; - } + public override int GetPickedID() => 3254; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Items/Farming/FarmablePumpkin.cs b/Projects/Scripts/Items/Farming/FarmablePumpkin.cs index 9174594a5..c1704c36b 100644 --- a/Projects/Scripts/Items/Farming/FarmablePumpkin.cs +++ b/Projects/Scripts/Items/Farming/FarmablePumpkin.cs @@ -13,10 +13,7 @@ namespace Server.Items { } - public static int GetCropID() - { - return Utility.Random(3166, 3); - } + public static int GetCropID() => Utility.Random(3166, 3); public override Item GetCropObject() { @@ -27,10 +24,7 @@ namespace Server.Items return pumpkin; } - public override int GetPickedID() - { - return Utility.Random(3166, 3); - } + public override int GetPickedID() => Utility.Random(3166, 3); public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Items/Farming/FarmableTurnip.cs b/Projects/Scripts/Items/Farming/FarmableTurnip.cs index 881dd8f65..e65a5780a 100644 --- a/Projects/Scripts/Items/Farming/FarmableTurnip.cs +++ b/Projects/Scripts/Items/Farming/FarmableTurnip.cs @@ -11,10 +11,7 @@ namespace Server.Items { } - public static int GetCropID() - { - return Utility.Random(3169, 3); - } + public static int GetCropID() => Utility.Random(3169, 3); public override Item GetCropObject() { @@ -25,10 +22,7 @@ namespace Server.Items return turnip; } - public override int GetPickedID() - { - return 3254; - } + public override int GetPickedID() => 3254; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Items/Farming/FarmableWheat.cs b/Projects/Scripts/Items/Farming/FarmableWheat.cs index 7f6250420..0e1f62c9c 100644 --- a/Projects/Scripts/Items/Farming/FarmableWheat.cs +++ b/Projects/Scripts/Items/Farming/FarmableWheat.cs @@ -11,20 +11,11 @@ namespace Server.Items { } - public static int GetCropID() - { - return Utility.Random(3157, 4); - } + public static int GetCropID() => Utility.Random(3157, 4); - public override Item GetCropObject() - { - return new WheatSheaf(); - } + public override Item GetCropObject() => new WheatSheaf(); - public override int GetPickedID() - { - return Utility.Random(3502, 2); - } + public override int GetPickedID() => Utility.Random(3502, 2); public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Items/Food/Asian.cs b/Projects/Scripts/Items/Food/Asian.cs index edf6ce827..9077bb107 100644 --- a/Projects/Scripts/Items/Food/Asian.cs +++ b/Projects/Scripts/Items/Food/Asian.cs @@ -3,10 +3,7 @@ namespace Server.Items public class Wasabi : Item { [Constructible] - public Wasabi() : base(0x24E8) - { - Weight = 1.0; - } + public Wasabi() : base(0x24E8) => Weight = 1.0; public Wasabi(Serial serial) : base(serial) { @@ -59,10 +56,7 @@ namespace Server.Items public class EmptyBentoBox : Item { [Constructible] - public EmptyBentoBox() : base(0x2834) - { - Weight = 5.0; - } + public EmptyBentoBox() : base(0x2834) => Weight = 5.0; public EmptyBentoBox(Serial serial) : base(serial) { @@ -182,10 +176,7 @@ namespace Server.Items public class GreenTeaBasket : Item { [Constructible] - public GreenTeaBasket() : base(0x284B) - { - Weight = 10.0; - } + public GreenTeaBasket() : base(0x284B) => Weight = 10.0; public GreenTeaBasket(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Food/Beverage.cs b/Projects/Scripts/Items/Food/Beverage.cs index 451663c65..3e5e9268c 100644 --- a/Projects/Scripts/Items/Food/Beverage.cs +++ b/Projects/Scripts/Items/Food/Beverage.cs @@ -37,10 +37,8 @@ namespace Server.Items { [Constructible] public BeverageBottle(BeverageType type) - : base(type) - { + : base(type) => Weight = 1.0; - } public BeverageBottle(Serial serial) : base(serial) @@ -114,10 +112,8 @@ namespace Server.Items { [Constructible] public Jug(BeverageType type) - : base(type) - { + : base(type) => Weight = 1.0; - } public Jug(Serial serial) : base(serial) @@ -154,17 +150,12 @@ namespace Server.Items public class CeramicMug : BaseBeverage { [Constructible] - public CeramicMug() - { - Weight = 1.0; - } + public CeramicMug() => Weight = 1.0; [Constructible] public CeramicMug(BeverageType type) - : base(type) - { + : base(type) => Weight = 1.0; - } public CeramicMug(Serial serial) : base(serial) @@ -202,17 +193,12 @@ namespace Server.Items public class PewterMug : BaseBeverage { [Constructible] - public PewterMug() - { - Weight = 1.0; - } + public PewterMug() => Weight = 1.0; [Constructible] public PewterMug(BeverageType type) - : base(type) - { + : base(type) => Weight = 1.0; - } public PewterMug(Serial serial) : base(serial) @@ -248,17 +234,12 @@ namespace Server.Items public class Goblet : BaseBeverage { [Constructible] - public Goblet() - { - Weight = 1.0; - } + public Goblet() => Weight = 1.0; [Constructible] public Goblet(BeverageType type) - : base(type) - { + : base(type) => Weight = 1.0; - } public Goblet(Serial serial) : base(serial) @@ -296,17 +277,12 @@ namespace Server.Items public class GlassMug : BaseBeverage { [Constructible] - public GlassMug() - { - Weight = 1.0; - } + public GlassMug() => Weight = 1.0; [Constructible] public GlassMug(BeverageType type) - : base(type) - { + : base(type) => Weight = 1.0; - } public GlassMug(Serial serial) : base(serial) @@ -399,17 +375,12 @@ namespace Server.Items public class Pitcher : BaseBeverage { [Constructible] - public Pitcher() - { - Weight = 2.0; - } + public Pitcher() => Weight = 2.0; [Constructible] public Pitcher(BeverageType type) - : base(type) - { + : base(type) => Weight = 2.0; - } public Pitcher(Serial serial) : base(serial) @@ -560,10 +531,7 @@ namespace Server.Items private BeverageType m_Content; private int m_Quantity; - public BaseBeverage() - { - ItemID = ComputeItemID(); - } + public BaseBeverage() => ItemID = ComputeItemID(); public BaseBeverage(BeverageType type) { @@ -993,10 +961,7 @@ namespace Server.Items } } - public static bool ConsumeTotal(Container pack, BeverageType content, int quantity) - { - return ConsumeTotal(pack, typeof(BaseBeverage), content, quantity); - } + public static bool ConsumeTotal(Container pack, BeverageType content, int quantity) => ConsumeTotal(pack, typeof(BaseBeverage), content, quantity); public static bool ConsumeTotal(Container pack, Type itemType, BeverageType content, int quantity) { @@ -1051,10 +1016,7 @@ namespace Server.Items writer.Write(m_Quantity); } - protected bool CheckType(string name) - { - return World.LoadingType == $"Server.Items.{name}"; - } + protected bool CheckType(string name) => World.LoadingType == $"Server.Items.{name}"; public override void Deserialize(GenericReader reader) { diff --git a/Projects/Scripts/Items/Food/BeverageEmpty.cs b/Projects/Scripts/Items/Food/BeverageEmpty.cs index d768e5594..1b02cb9dc 100644 --- a/Projects/Scripts/Items/Food/BeverageEmpty.cs +++ b/Projects/Scripts/Items/Food/BeverageEmpty.cs @@ -4,10 +4,7 @@ namespace Server.Items public class Glass : Item { [Constructible] - public Glass() : base(0x1f81) - { - Weight = 0.1; - } + public Glass() : base(0x1f81) => Weight = 0.1; public Glass(Serial serial) : base(serial) { @@ -31,10 +28,7 @@ namespace Server.Items public class GlassBottle : Item { [Constructible] - public GlassBottle() : base(0xe2b) - { - Weight = 0.3; - } + public GlassBottle() : base(0xe2b) => Weight = 0.3; public GlassBottle(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Food/Bowls.cs b/Projects/Scripts/Items/Food/Bowls.cs index 164d4b1da..75ecb9da3 100644 --- a/Projects/Scripts/Items/Food/Bowls.cs +++ b/Projects/Scripts/Items/Food/Bowls.cs @@ -3,10 +3,7 @@ namespace Server.Items public class EmptyWoodenBowl : Item { [Constructible] - public EmptyWoodenBowl() : base(0x15F8) - { - Weight = 1.0; - } + public EmptyWoodenBowl() : base(0x15F8) => Weight = 1.0; public EmptyWoodenBowl(Serial serial) : base(serial) { @@ -30,10 +27,7 @@ namespace Server.Items public class EmptyPewterBowl : Item { [Constructible] - public EmptyPewterBowl() : base(0x15FD) - { - Weight = 1.0; - } + public EmptyPewterBowl() : base(0x15FD) => Weight = 1.0; public EmptyPewterBowl(Serial serial) : base(serial) { @@ -400,10 +394,7 @@ namespace Server.Items public class EmptyWoodenTub : Item { [Constructible] - public EmptyWoodenTub() : base(0x1605) - { - Weight = 2.0; - } + public EmptyWoodenTub() : base(0x1605) => Weight = 2.0; public EmptyWoodenTub(Serial serial) : base(serial) { @@ -428,10 +419,7 @@ namespace Server.Items public class EmptyPewterTub : Item { [Constructible] - public EmptyPewterTub() : base(0x1603) - { - Weight = 2.0; - } + public EmptyPewterTub() : base(0x1603) => Weight = 2.0; public EmptyPewterTub(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Food/Chocolatiering.cs b/Projects/Scripts/Items/Food/Chocolatiering.cs index e536d4a7f..94161400f 100644 --- a/Projects/Scripts/Items/Food/Chocolatiering.cs +++ b/Projects/Scripts/Items/Food/Chocolatiering.cs @@ -4,10 +4,8 @@ namespace Server.Items { [Constructible] public CocoaLiquor() - : base(0x103F) - { + : base(0x103F) => Hue = 0x46A; - } public CocoaLiquor(Serial serial) : base(serial) @@ -70,10 +68,8 @@ namespace Server.Items { [Constructible] public CocoaButter() - : base(0x1044) - { + : base(0x1044) => Hue = 0x457; - } public CocoaButter(Serial serial) : base(serial) diff --git a/Projects/Scripts/Items/Food/CookableFood.cs b/Projects/Scripts/Items/Food/CookableFood.cs index 0854404e5..cb03e9e15 100644 --- a/Projects/Scripts/Items/Food/CookableFood.cs +++ b/Projects/Scripts/Items/Food/CookableFood.cs @@ -8,10 +8,7 @@ namespace Server.Items [CommandProperty(AccessLevel.GameMaster)] public int CookingLevel{ get; set; } - public CookableFood(int itemID, int cookingLevel) : base(itemID) - { - CookingLevel = cookingLevel; - } + public CookableFood(int itemID, int cookingLevel) : base(itemID) => CookingLevel = cookingLevel; public CookableFood(Serial serial) : base(serial) { @@ -88,10 +85,7 @@ namespace Server.Items { private CookableFood m_Item; - public InternalTarget(CookableFood item) : base(1, false, TargetFlags.None) - { - m_Item = item; - } + public InternalTarget(CookableFood item) : base(1, false, TargetFlags.None) => m_Item = item; protected override void OnTarget(Mobile from, object targeted) { @@ -186,10 +180,7 @@ namespace Server.Items int version = reader.ReadInt(); } - public override Food Cook() - { - return new Ribs(); - } + public override Food Cook() => new Ribs(); } @@ -224,10 +215,7 @@ namespace Server.Items Weight = -1; } - public override Food Cook() - { - return new LambLeg(); - } + public override Food Cook() => new LambLeg(); } // ********** RawChickenLeg ********** @@ -258,10 +246,7 @@ namespace Server.Items int version = reader.ReadInt(); } - public override Food Cook() - { - return new ChickenLeg(); - } + public override Food Cook() => new ChickenLeg(); } @@ -294,10 +279,7 @@ namespace Server.Items int version = reader.ReadInt(); } - public override Food Cook() - { - return new CookedBird(); - } + public override Food Cook() => new CookedBird(); } @@ -305,10 +287,7 @@ namespace Server.Items public class UnbakedPeachCobbler : CookableFood { [Constructible] - public UnbakedPeachCobbler() : base(0x1042, 25) - { - Weight = 1.0; - } + public UnbakedPeachCobbler() : base(0x1042, 25) => Weight = 1.0; public UnbakedPeachCobbler(Serial serial) : base(serial) { @@ -330,20 +309,14 @@ namespace Server.Items int version = reader.ReadInt(); } - public override Food Cook() - { - return new PeachCobbler(); - } + public override Food Cook() => new PeachCobbler(); } // ********** UnbakedFruitPie ********** public class UnbakedFruitPie : CookableFood { [Constructible] - public UnbakedFruitPie() : base(0x1042, 25) - { - Weight = 1.0; - } + public UnbakedFruitPie() : base(0x1042, 25) => Weight = 1.0; public UnbakedFruitPie(Serial serial) : base(serial) { @@ -365,20 +338,14 @@ namespace Server.Items int version = reader.ReadInt(); } - public override Food Cook() - { - return new FruitPie(); - } + public override Food Cook() => new FruitPie(); } // ********** UnbakedMeatPie ********** public class UnbakedMeatPie : CookableFood { [Constructible] - public UnbakedMeatPie() : base(0x1042, 25) - { - Weight = 1.0; - } + public UnbakedMeatPie() : base(0x1042, 25) => Weight = 1.0; public UnbakedMeatPie(Serial serial) : base(serial) { @@ -400,20 +367,14 @@ namespace Server.Items int version = reader.ReadInt(); } - public override Food Cook() - { - return new MeatPie(); - } + public override Food Cook() => new MeatPie(); } // ********** UnbakedPumpkinPie ********** public class UnbakedPumpkinPie : CookableFood { [Constructible] - public UnbakedPumpkinPie() : base(0x1042, 25) - { - Weight = 1.0; - } + public UnbakedPumpkinPie() : base(0x1042, 25) => Weight = 1.0; public UnbakedPumpkinPie(Serial serial) : base(serial) { @@ -435,20 +396,14 @@ namespace Server.Items int version = reader.ReadInt(); } - public override Food Cook() - { - return new PumpkinPie(); - } + public override Food Cook() => new PumpkinPie(); } // ********** UnbakedApplePie ********** public class UnbakedApplePie : CookableFood { [Constructible] - public UnbakedApplePie() : base(0x1042, 25) - { - Weight = 1.0; - } + public UnbakedApplePie() : base(0x1042, 25) => Weight = 1.0; public UnbakedApplePie(Serial serial) : base(serial) { @@ -470,10 +425,7 @@ namespace Server.Items int version = reader.ReadInt(); } - public override Food Cook() - { - return new ApplePie(); - } + public override Food Cook() => new ApplePie(); } // ********** UncookedCheesePizza ********** @@ -481,10 +433,7 @@ namespace Server.Items public class UncookedCheesePizza : CookableFood { [Constructible] - public UncookedCheesePizza() : base(0x1083, 20) - { - Weight = 1.0; - } + public UncookedCheesePizza() : base(0x1083, 20) => Weight = 1.0; public UncookedCheesePizza(Serial serial) : base(serial) { @@ -512,20 +461,14 @@ namespace Server.Items Hue = 0; } - public override Food Cook() - { - return new CheesePizza(); - } + public override Food Cook() => new CheesePizza(); } // ********** UncookedSausagePizza ********** public class UncookedSausagePizza : CookableFood { [Constructible] - public UncookedSausagePizza() : base(0x1083, 20) - { - Weight = 1.0; - } + public UncookedSausagePizza() : base(0x1083, 20) => Weight = 1.0; public UncookedSausagePizza(Serial serial) : base(serial) { @@ -547,61 +490,14 @@ namespace Server.Items int version = reader.ReadInt(); } - public override Food Cook() - { - return new SausagePizza(); - } + public override Food Cook() => new SausagePizza(); } -#if false -// ********** UncookedPizza ********** - public class UncookedPizza : CookableFood - { - [Constructible] - public UncookedPizza() : base( 0x1083, 20 ) - { - Weight = 1.0; - } - - public UncookedPizza( 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(); - - if ( ItemID == 0x1040 ) - ItemID = 0x1083; - - if ( Hue == 51 ) - Hue = 0; - } - - public override Food Cook() - { - return new Pizza(); - } - } -#endif - // ********** UnbakedQuiche ********** public class UnbakedQuiche : CookableFood { [Constructible] - public UnbakedQuiche() : base(0x1042, 25) - { - Weight = 1.0; - } + public UnbakedQuiche() : base(0x1042, 25) => Weight = 1.0; public UnbakedQuiche(Serial serial) : base(serial) { @@ -623,10 +519,7 @@ namespace Server.Items int version = reader.ReadInt(); } - public override Food Cook() - { - return new Quiche(); - } + public override Food Cook() => new Quiche(); } // ********** Eggs ********** @@ -666,10 +559,7 @@ namespace Server.Items } } - public override Food Cook() - { - return new FriedEggs(); - } + public override Food Cook() => new FriedEggs(); } // ********** BrightlyColoredEggs ********** @@ -702,10 +592,7 @@ namespace Server.Items int version = reader.ReadInt(); } - public override Food Cook() - { - return new FriedEggs(); - } + public override Food Cook() => new FriedEggs(); } // ********** EasterEggs ********** @@ -738,20 +625,14 @@ namespace Server.Items int version = reader.ReadInt(); } - public override Food Cook() - { - return new FriedEggs(); - } + public override Food Cook() => new FriedEggs(); } // ********** CookieMix ********** public class CookieMix : CookableFood { [Constructible] - public CookieMix() : base(0x103F, 20) - { - Weight = 1.0; - } + public CookieMix() : base(0x103F, 20) => Weight = 1.0; public CookieMix(Serial serial) : base(serial) { @@ -771,20 +652,14 @@ namespace Server.Items int version = reader.ReadInt(); } - public override Food Cook() - { - return new Cookies(); - } + public override Food Cook() => new Cookies(); } // ********** CakeMix ********** public class CakeMix : CookableFood { [Constructible] - public CakeMix() : base(0x103F, 40) - { - Weight = 1.0; - } + public CakeMix() : base(0x103F, 40) => Weight = 1.0; public CakeMix(Serial serial) : base(serial) { @@ -806,10 +681,7 @@ namespace Server.Items int version = reader.ReadInt(); } - public override Food Cook() - { - return new Cake(); - } + public override Food Cook() => new Cake(); } public class RawFishSteak : CookableFood @@ -827,10 +699,7 @@ namespace Server.Items public override double DefaultWeight => 0.1; - public override Food Cook() - { - return new FishSteak(); - } + public override Food Cook() => new FishSteak(); public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Items/Food/Cooking.cs b/Projects/Scripts/Items/Food/Cooking.cs index 5bf3cc134..a3a7136df 100644 --- a/Projects/Scripts/Items/Food/Cooking.cs +++ b/Projects/Scripts/Items/Food/Cooking.cs @@ -65,10 +65,7 @@ namespace Server.Items { private Dough m_Item; - public InternalTarget(Dough item) : base(1, false, TargetFlags.None) - { - m_Item = item; - } + public InternalTarget(Dough item) : base(1, false, TargetFlags.None) => m_Item = item; protected override void OnTarget(Mobile from, object targeted) { @@ -156,10 +153,7 @@ namespace Server.Items { private SweetDough m_Item; - public InternalTarget(SweetDough item) : base(1, false, TargetFlags.None) - { - m_Item = item; - } + public InternalTarget(SweetDough item) : base(1, false, TargetFlags.None) => m_Item = item; protected override void OnTarget(Mobile from, object targeted) { @@ -255,10 +249,7 @@ namespace Server.Items { private JarHoney m_Item; - public InternalTarget(JarHoney item) : base(1, false, TargetFlags.None) - { - m_Item = item; - } + public InternalTarget(JarHoney item) : base(1, false, TargetFlags.None) => m_Item = item; protected override void OnTarget(Mobile from, object targeted) { @@ -287,10 +278,7 @@ namespace Server.Items public class BowlFlour : Item { [Constructible] - public BowlFlour() : base(0xa1e) - { - Weight = 1.0; - } + public BowlFlour() : base(0xa1e) => Weight = 1.0; public BowlFlour(Serial serial) : base(serial) { @@ -315,10 +303,7 @@ namespace Server.Items public class WoodenBowl : Item { [Constructible] - public WoodenBowl() : base(0x15f8) - { - Weight = 1.0; - } + public WoodenBowl() : base(0x15f8) => Weight = 1.0; public WoodenBowl(Serial serial) : base(serial) { @@ -481,93 +466,11 @@ namespace Server.Items } } -#if false -// ********** SackFlourOpen ********** - public class SackFlourOpen : Item - { - public override int LabelNumber => 1024166; // open sack of flour - - [Constructible] - public SackFlourOpen() : base(UtilityItem.RandomChoice( 0x1046, 0x103a )) - { - Weight = 1.0; - } - - public SackFlourOpen( 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(); - } - - public override void OnDoubleClick( Mobile from ) - { - if ( !Movable ) - return; - - from.Target = new InternalTarget( this ); - } - - private class InternalTarget : Target - { - private SackFlourOpen m_Item; - - public InternalTarget( SackFlourOpen item ) : base( 1, false, TargetFlags.None ) - { - m_Item = item; - } - - protected override void OnTarget( Mobile from, object targeted ) - { - if ( m_Item.Deleted ) return; - - if ( targeted is WoodenBowl ) - { - m_Item.Delete(); - ((WoodenBowl)targeted).Delete(); - - from.AddToBackpack( new BowlFlour() ); - } - else if ( targeted is TribalBerry ) - { - if ( from.Skills.Cooking.Base >= 80.0 ) - { - m_Item.Delete(); - ((TribalBerry)targeted).Delete(); - - from.AddToBackpack( new TribalPaint() ); - - from.SendLocalizedMessage( 1042002 ); // You combine the berry and the flour into the tribal paint worn by the savages. - } - else - { - from.SendLocalizedMessage( 1042003 ); // You don't have the cooking skill to create the body paint. - } - } - } - } - } -#endif - // ********** Eggshells ********** public class Eggshells : Item { [Constructible] - public Eggshells() : base(0x9b4) - { - Weight = 0.5; - } + public Eggshells() : base(0x9b4) => Weight = 0.5; public Eggshells(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Food/Food.cs b/Projects/Scripts/Items/Food/Food.cs index 119cf2b98..cdf5ca6eb 100644 --- a/Projects/Scripts/Items/Food/Food.cs +++ b/Projects/Scripts/Items/Food/Food.cs @@ -63,10 +63,7 @@ namespace Server.Items return false; } - public virtual bool CheckHunger(Mobile from) - { - return FillHunger(from, FillFactor); - } + public virtual bool CheckHunger(Mobile from) => FillHunger(from, FillFactor); public static bool FillHunger(Mobile from, int fillFactor) { @@ -253,10 +250,7 @@ namespace Server.Items public class FishSteak : Food { [Constructible] - public FishSteak(int amount = 1) : base(0x97B, amount) - { - FillFactor = 3; - } + public FishSteak(int amount = 1) : base(0x97B, amount) => FillFactor = 3; public FishSteak(Serial serial) : base(serial) { @@ -282,10 +276,7 @@ namespace Server.Items public class CheeseWheel : Food { [Constructible] - public CheeseWheel(int amount = 1) : base(0x97E, amount) - { - FillFactor = 3; - } + public CheeseWheel(int amount = 1) : base(0x97E, amount) => FillFactor = 3; public CheeseWheel(Serial serial) : base(serial) { @@ -311,10 +302,7 @@ namespace Server.Items public class CheeseWedge : Food { [Constructible] - public CheeseWedge(int amount = 1) : base(0x97D, amount) - { - FillFactor = 3; - } + public CheeseWedge(int amount = 1) : base(0x97D, amount) => FillFactor = 3; public CheeseWedge(Serial serial) : base(serial) { @@ -340,10 +328,7 @@ namespace Server.Items public class CheeseSlice : Food { [Constructible] - public CheeseSlice(int amount = 1) : base(0x97C, amount) - { - FillFactor = 1; - } + public CheeseSlice(int amount = 1) : base(0x97C, amount) => FillFactor = 1; public CheeseSlice(Serial serial) : base(serial) { @@ -713,37 +698,6 @@ namespace Server.Items } } -#if false - public class Pizza : Food - { - [Constructible] - public Pizza() : base( 0x1040 ) - { - Stackable = false; - this.Weight = 1.0; - this.FillFactor = 6; - } - - public Pizza( 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(); - } - } -#endif - public class FruitPie : Food { [Constructible] @@ -1133,10 +1087,7 @@ namespace Server.Items public class SheafOfHay : Item { [Constructible] - public SheafOfHay() : base(0xF36) - { - Weight = 10.0; - } + public SheafOfHay() : base(0xF36) => Weight = 10.0; public SheafOfHay(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Games/BaseBoard.cs b/Projects/Scripts/Items/Games/BaseBoard.cs index d5b8767fa..fd292b550 100644 --- a/Projects/Scripts/Items/Games/BaseBoard.cs +++ b/Projects/Scripts/Items/Games/BaseBoard.cs @@ -66,10 +66,7 @@ namespace Server.Items Weight = 5.0; } - public override bool OnDragDrop(Mobile from, Item dropped) - { - return dropped is BasePiece piece && piece.Board == this && base.OnDragDrop(from, dropped); - } + public override bool OnDragDrop(Mobile from, Item dropped) => dropped is BasePiece piece && piece.Board == this && base.OnDragDrop(from, dropped); public override bool OnDragDropInto(Mobile from, Item dropped, Point3D point) { @@ -103,15 +100,11 @@ namespace Server.Items SetSecureLevelEntry.AddTo(from, this, list); } - public static bool ValidateDefault(Mobile from, BaseBoard board) - { - // Fixed this because it implies you can use it from your bank, if you can access your bank - // while in your house. (!(board.RootParent is Mobile) || board.RootParent == from) - return !board.Deleted && (from.AccessLevel >= AccessLevel.GameMaster || from.Alive && - (board.IsChildOf(from.Backpack) || !(board.RootParent is Mobile) && - board.Map == from.Map && from.InRange(board.GetWorldLocation(), 1) && - BaseHouse.FindHouseAt(board)?.IsOwner(from) == true)); - } + public static bool ValidateDefault(Mobile from, BaseBoard board) => + !board.Deleted && (from.AccessLevel >= AccessLevel.GameMaster || from.Alive && + (board.IsChildOf(from.Backpack) || !(board.RootParent is Mobile) && + board.Map == from.Map && from.InRange(board.GetWorldLocation(), 1) && + BaseHouse.FindHouseAt(board)?.IsOwner(from) == true)); public class DefaultEntry : ContextMenuEntry { diff --git a/Projects/Scripts/Items/Games/BasePiece.cs b/Projects/Scripts/Items/Games/BasePiece.cs index bd0cb36f8..bec7c3fda 100644 --- a/Projects/Scripts/Items/Games/BasePiece.cs +++ b/Projects/Scripts/Items/Games/BasePiece.cs @@ -2,10 +2,7 @@ namespace Server.Items { public class BasePiece : Item { - public BasePiece(int itemID, BaseBoard board) : base(itemID) - { - Board = board; - } + public BasePiece(int itemID, BaseBoard board) : base(itemID) => Board = board; public BasePiece(Serial serial) : base(serial) { @@ -72,24 +69,12 @@ namespace Server.Items return true; } - public override bool DropToMobile(Mobile from, Mobile target, Point3D p) - { - return false; - } + public override bool DropToMobile(Mobile from, Mobile target, Point3D p) => false; - public override bool DropToItem(Mobile from, Item target, Point3D p) - { - return target == Board && p.X != -1 && p.Y != -1 && base.DropToItem(from, target, p); - } + public override bool DropToItem(Mobile from, Item target, Point3D p) => target == Board && p.X != -1 && p.Y != -1 && base.DropToItem(from, target, p); - public override bool DropToWorld(Mobile from, Point3D p) - { - return false; - } + public override bool DropToWorld(Mobile from, Point3D p) => false; - public override int GetLiftSound(Mobile from) - { - return -1; - } + public override int GetLiftSound(Mobile from) => -1; } } diff --git a/Projects/Scripts/Items/Games/Dices.cs b/Projects/Scripts/Items/Games/Dices.cs index dad2dc13b..d065caaed 100644 --- a/Projects/Scripts/Items/Games/Dices.cs +++ b/Projects/Scripts/Items/Games/Dices.cs @@ -5,10 +5,7 @@ namespace Server.Items public class Dices : Item, ITelekinesisable { [Constructible] - public Dices() : base(0xFA7) - { - Weight = 1.0; - } + public Dices() : base(0xFA7) => Weight = 1.0; public Dices(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Games/Mahjong/MahjongGame.cs b/Projects/Scripts/Items/Games/Mahjong/MahjongGame.cs index 17b9edd1e..cefbd322a 100644 --- a/Projects/Scripts/Items/Games/Mahjong/MahjongGame.cs +++ b/Projects/Scripts/Items/Games/Mahjong/MahjongGame.cs @@ -280,10 +280,7 @@ namespace Server.Engines.Mahjong { private MahjongGame m_Game; - public ResetGameEntry(MahjongGame game) : base(6162) - { - m_Game = game; - } + public ResetGameEntry(MahjongGame game) : base(6162) => m_Game = game; public override void OnClick() { diff --git a/Projects/Scripts/Items/Games/Mahjong/MahjongPieceDim.cs b/Projects/Scripts/Items/Games/Mahjong/MahjongPieceDim.cs index 68aba572b..cc1f4af8e 100644 --- a/Projects/Scripts/Items/Games/Mahjong/MahjongPieceDim.cs +++ b/Projects/Scripts/Items/Games/Mahjong/MahjongPieceDim.cs @@ -15,16 +15,11 @@ namespace Server.Engines.Mahjong Height = height; } - public bool IsValid() - { - return Position.X >= 0 && Position.Y >= 0 && Position.X + Width <= 670 && Position.Y + Height <= 670; - } + public bool IsValid() => Position.X >= 0 && Position.Y >= 0 && Position.X + Width <= 670 && Position.Y + Height <= 670; - public bool IsOverlapping(MahjongPieceDim dim) - { - return Position.X < dim.Position.X + dim.Width && Position.Y < dim.Position.Y + dim.Height && - Position.X + Width > dim.Position.X && Position.Y + Height > dim.Position.Y; - } + public bool IsOverlapping(MahjongPieceDim dim) => + Position.X < dim.Position.X + dim.Width && Position.Y < dim.Position.Y + dim.Height && + Position.X + Width > dim.Position.X && Position.Y + Height > dim.Position.Y; public int GetHandArea() { diff --git a/Projects/Scripts/Items/Games/Mahjong/MahjongPlayers.cs b/Projects/Scripts/Items/Games/Mahjong/MahjongPlayers.cs index 22c810a28..dfb2f99bc 100644 --- a/Projects/Scripts/Items/Games/Mahjong/MahjongPlayers.cs +++ b/Projects/Scripts/Items/Games/Mahjong/MahjongPlayers.cs @@ -89,10 +89,7 @@ namespace Server.Engines.Mahjong return IsInGamePlayer(index); } - public bool IsSpectator(Mobile mobile) - { - return m_Spectators.Contains(mobile); - } + public bool IsSpectator(Mobile mobile) => m_Spectators.Contains(mobile); public int GetScore(int index) { diff --git a/Projects/Scripts/Items/Games/Mahjong/MahjongWallBreakIndicator.cs b/Projects/Scripts/Items/Games/Mahjong/MahjongWallBreakIndicator.cs index 400822753..09e64d92f 100644 --- a/Projects/Scripts/Items/Games/Mahjong/MahjongWallBreakIndicator.cs +++ b/Projects/Scripts/Items/Games/Mahjong/MahjongWallBreakIndicator.cs @@ -23,10 +23,7 @@ namespace Server.Engines.Mahjong public MahjongPieceDim Dimensions => GetDimensions(Position); - public static MahjongPieceDim GetDimensions(Point2D position) - { - return new MahjongPieceDim(position, 20, 20); - } + public static MahjongPieceDim GetDimensions(Point2D position) => new MahjongPieceDim(position, 20, 20); public void Move(Point2D position) { diff --git a/Projects/Scripts/Items/Guilds/GuildDeed.cs b/Projects/Scripts/Items/Guilds/GuildDeed.cs index adafeffe2..ea4197781 100644 --- a/Projects/Scripts/Items/Guilds/GuildDeed.cs +++ b/Projects/Scripts/Items/Guilds/GuildDeed.cs @@ -7,10 +7,7 @@ namespace Server.Items public class GuildDeed : Item { [Constructible] - public GuildDeed() : base(0x14F0) - { - Weight = 1.0; - } + public GuildDeed() : base(0x14F0) => Weight = 1.0; public GuildDeed(Serial serial) : base(serial) { @@ -76,10 +73,7 @@ namespace Server.Items { private GuildDeed m_Deed; - public InternalPrompt(GuildDeed deed) - { - m_Deed = deed; - } + public InternalPrompt(GuildDeed deed) => m_Deed = deed; public override void OnResponse(Mobile from, string text) { diff --git a/Projects/Scripts/Items/Guilds/Guildstone.cs b/Projects/Scripts/Items/Guilds/Guildstone.cs index 776687b53..c02b0cca4 100644 --- a/Projects/Scripts/Items/Guilds/Guildstone.cs +++ b/Projects/Scripts/Items/Guilds/Guildstone.cs @@ -266,10 +266,7 @@ namespace Server.Items public Item Deed => new GuildstoneDeed(Guild, m_GuildName, m_GuildAbbrev); - public bool CouldFit(IPoint3D p, Map map) - { - return map.CanFit(p.X, p.Y, p.Z, ItemData.Height); - } + public bool CouldFit(IPoint3D p, Map map) => map.CanFit(p.X, p.Y, p.Z, ItemData.Height); #endregion } diff --git a/Projects/Scripts/Items/Jewels/Beads.cs b/Projects/Scripts/Items/Jewels/Beads.cs index 7519565c3..b20cfcebd 100644 --- a/Projects/Scripts/Items/Jewels/Beads.cs +++ b/Projects/Scripts/Items/Jewels/Beads.cs @@ -3,10 +3,7 @@ namespace Server.Items public class Beads : Item { [Constructible] - public Beads() : base(0x108B) - { - Weight = 1.0; - } + public Beads() : base(0x108B) => Weight = 1.0; public Beads(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Jewels/Bracelet.cs b/Projects/Scripts/Items/Jewels/Bracelet.cs index 9890fb42b..ef3b27344 100644 --- a/Projects/Scripts/Items/Jewels/Bracelet.cs +++ b/Projects/Scripts/Items/Jewels/Bracelet.cs @@ -30,10 +30,7 @@ namespace Server.Items public class GoldBracelet : BaseBracelet { [Constructible] - public GoldBracelet() : base(0x1086) - { - Weight = 0.1; - } + public GoldBracelet() : base(0x1086) => Weight = 0.1; public GoldBracelet(Serial serial) : base(serial) { @@ -57,10 +54,7 @@ namespace Server.Items public class SilverBracelet : BaseBracelet { [Constructible] - public SilverBracelet() : base(0x1F06) - { - Weight = 0.1; - } + public SilverBracelet() : base(0x1F06) => Weight = 0.1; public SilverBracelet(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Jewels/Earrings.cs b/Projects/Scripts/Items/Jewels/Earrings.cs index db762236a..2c6378a9a 100644 --- a/Projects/Scripts/Items/Jewels/Earrings.cs +++ b/Projects/Scripts/Items/Jewels/Earrings.cs @@ -30,10 +30,7 @@ namespace Server.Items public class GoldEarrings : BaseEarrings { [Constructible] - public GoldEarrings() : base(0x1087) - { - Weight = 0.1; - } + public GoldEarrings() : base(0x1087) => Weight = 0.1; public GoldEarrings(Serial serial) : base(serial) { @@ -57,10 +54,7 @@ namespace Server.Items public class SilverEarrings : BaseEarrings { [Constructible] - public SilverEarrings() : base(0x1F07) - { - Weight = 0.1; - } + public SilverEarrings() : base(0x1F07) => Weight = 0.1; public SilverEarrings(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Jewels/Necklace.cs b/Projects/Scripts/Items/Jewels/Necklace.cs index 14b70f5e2..b92d00e4f 100644 --- a/Projects/Scripts/Items/Jewels/Necklace.cs +++ b/Projects/Scripts/Items/Jewels/Necklace.cs @@ -30,10 +30,7 @@ namespace Server.Items public class Necklace : BaseNecklace { [Constructible] - public Necklace() : base(0x1085) - { - Weight = 0.1; - } + public Necklace() : base(0x1085) => Weight = 0.1; public Necklace(Serial serial) : base(serial) { @@ -57,10 +54,7 @@ namespace Server.Items public class GoldNecklace : BaseNecklace { [Constructible] - public GoldNecklace() : base(0x1088) - { - Weight = 0.1; - } + public GoldNecklace() : base(0x1088) => Weight = 0.1; public GoldNecklace(Serial serial) : base(serial) { @@ -84,10 +78,7 @@ namespace Server.Items public class GoldBeadNecklace : BaseNecklace { [Constructible] - public GoldBeadNecklace() : base(0x1089) - { - Weight = 0.1; - } + public GoldBeadNecklace() : base(0x1089) => Weight = 0.1; public GoldBeadNecklace(Serial serial) : base(serial) { @@ -112,10 +103,7 @@ namespace Server.Items public class SilverNecklace : BaseNecklace { [Constructible] - public SilverNecklace() : base(0x1F08) - { - Weight = 0.1; - } + public SilverNecklace() : base(0x1F08) => Weight = 0.1; public SilverNecklace(Serial serial) : base(serial) { @@ -139,10 +127,7 @@ namespace Server.Items public class SilverBeadNecklace : BaseNecklace { [Constructible] - public SilverBeadNecklace() : base(0x1F05) - { - Weight = 0.1; - } + public SilverBeadNecklace() : base(0x1F05) => Weight = 0.1; public SilverBeadNecklace(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Jewels/Ring.cs b/Projects/Scripts/Items/Jewels/Ring.cs index 57de851c1..ad036812b 100644 --- a/Projects/Scripts/Items/Jewels/Ring.cs +++ b/Projects/Scripts/Items/Jewels/Ring.cs @@ -30,10 +30,7 @@ namespace Server.Items public class GoldRing : BaseRing { [Constructible] - public GoldRing() : base(0x108a) - { - Weight = 0.1; - } + public GoldRing() : base(0x108a) => Weight = 0.1; public GoldRing(Serial serial) : base(serial) { @@ -57,10 +54,7 @@ namespace Server.Items public class SilverRing : BaseRing { [Constructible] - public SilverRing() : base(0x1F09) - { - Weight = 0.1; - } + public SilverRing() : base(0x1F09) => Weight = 0.1; public SilverRing(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Lights/BaseEquippableLight.cs b/Projects/Scripts/Items/Lights/BaseEquippableLight.cs index 9067f1c9b..88d3c8bb0 100644 --- a/Projects/Scripts/Items/Lights/BaseEquippableLight.cs +++ b/Projects/Scripts/Items/Lights/BaseEquippableLight.cs @@ -3,10 +3,7 @@ namespace Server.Items public abstract class BaseEquipableLight : BaseLight { [Constructible] - public BaseEquipableLight(int itemID) : base(itemID) - { - Layer = Layer.TwoHanded; - } + public BaseEquipableLight(int itemID) : base(itemID) => Layer = Layer.TwoHanded; public BaseEquipableLight(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Lights/Lantern.cs b/Projects/Scripts/Items/Lights/Lantern.cs index 70f9fc271..c6ae604fa 100644 --- a/Projects/Scripts/Items/Lights/Lantern.cs +++ b/Projects/Scripts/Items/Lights/Lantern.cs @@ -59,10 +59,7 @@ namespace Server.Items public class LanternOfSouls : Lantern { [Constructible] - public LanternOfSouls() - { - Hue = 0x482; - } + public LanternOfSouls() => Hue = 0x482; public LanternOfSouls(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Maps/MapItem.cs b/Projects/Scripts/Items/Maps/MapItem.cs index 651b37ec3..d60d321cd 100644 --- a/Projects/Scripts/Items/Maps/MapItem.cs +++ b/Projects/Scripts/Items/Maps/MapItem.cs @@ -160,10 +160,7 @@ namespace Server.Items y = Height - 1; } - public virtual bool ValidateEdit(Mobile from) - { - return m_Editable && Validate(from); - } + public virtual bool ValidateEdit(Mobile from) => m_Editable && Validate(from); public virtual bool Validate(Mobile from) { diff --git a/Projects/Scripts/Items/Maps/TreasureMap.cs b/Projects/Scripts/Items/Maps/TreasureMap.cs index 900af3744..7d03d0fbf 100644 --- a/Projects/Scripts/Items/Maps/TreasureMap.cs +++ b/Projects/Scripts/Items/Maps/TreasureMap.cs @@ -187,37 +187,34 @@ namespace Server.Items List havenList = new List(); if (File.Exists(filePath)) - using (StreamReader ip = new StreamReader(filePath)) - { - string line; + { + using StreamReader ip = new StreamReader(filePath); + string line; - while ((line = ip.ReadLine()) != null) - try - { - string[] split = line.Split(' '); + while ((line = ip.ReadLine()) != null) + try + { + string[] split = line.Split(' '); - int x = Convert.ToInt32(split[0]), y = Convert.ToInt32(split[1]); + int x = Convert.ToInt32(split[0]), y = Convert.ToInt32(split[1]); - Point2D loc = new Point2D(x, y); - list.Add(loc); + Point2D loc = new Point2D(x, y); + list.Add(loc); - if (IsInHavenIsland(loc)) - havenList.Add(loc); - } - catch - { - // ignored - } - } + if (IsInHavenIsland(loc)) + havenList.Add(loc); + } + catch + { + // ignored + } + } m_Locations = list.ToArray(); m_HavenLocations = havenList.ToArray(); } - public static bool IsInHavenIsland(IPoint2D loc) - { - return loc.X >= 3314 && loc.X <= 3814 && loc.Y >= 2345 && loc.Y <= 3095; - } + public static bool IsInHavenIsland(IPoint2D loc) => loc.X >= 3314 && loc.X <= 3814 && loc.Y >= 2345 && loc.Y <= 3095; public static BaseCreature Spawn(int level, Point3D p, bool guardian) { @@ -386,10 +383,7 @@ namespace Server.Items } } - private bool HasRequiredSkill(Mobile from) - { - return from.Skills.Cartography.Value >= GetMinSkillLevel(); - } + private bool HasRequiredSkill(Mobile from) => from.Skills.Cartography.Value >= GetMinSkillLevel(); public void Decode(Mobile from) { @@ -562,10 +556,7 @@ namespace Server.Items { private TreasureMap m_Map; - public DigTarget(TreasureMap map) : base(6, true, TargetFlags.None) - { - m_Map = map; - } + public DigTarget(TreasureMap map) : base(6, true, TargetFlags.None) => m_Map = map; protected override void OnTarget(Mobile from, object targeted) { @@ -882,10 +873,7 @@ namespace Server.Items { private TreasureMap m_Map; - public DecodeMapEntry(TreasureMap map) : base(6147, 2) - { - m_Map = map; - } + public DecodeMapEntry(TreasureMap map) : base(6147, 2) => m_Map = map; public override void OnClick() { @@ -898,10 +886,7 @@ namespace Server.Items { private TreasureMap m_Map; - public OpenMapEntry(TreasureMap map) : base(6150, 2) - { - m_Map = map; - } + public OpenMapEntry(TreasureMap map) : base(6150, 2) => m_Map = map; public override void OnClick() { diff --git a/Projects/Scripts/Items/Minor Artifacts/AdmiralsHeartyRum.cs b/Projects/Scripts/Items/Minor Artifacts/AdmiralsHeartyRum.cs index b083ac4f8..ffa82c84c 100644 --- a/Projects/Scripts/Items/Minor Artifacts/AdmiralsHeartyRum.cs +++ b/Projects/Scripts/Items/Minor Artifacts/AdmiralsHeartyRum.cs @@ -3,10 +3,7 @@ namespace Server.Items public class AdmiralsHeartyRum : BeverageBottle { [Constructible] - public AdmiralsHeartyRum() : base(BeverageType.Ale) - { - Hue = 0x66C; - } + public AdmiralsHeartyRum() : base(BeverageType.Ale) => Hue = 0x66C; public AdmiralsHeartyRum(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Minor Artifacts/GhostShipAnchor.cs b/Projects/Scripts/Items/Minor Artifacts/GhostShipAnchor.cs index 41cb026a4..8e4a2e4c7 100644 --- a/Projects/Scripts/Items/Minor Artifacts/GhostShipAnchor.cs +++ b/Projects/Scripts/Items/Minor Artifacts/GhostShipAnchor.cs @@ -3,10 +3,7 @@ namespace Server.Items public class GhostShipAnchor : Item { [Constructible] - public GhostShipAnchor() : base(0x14F7) - { - Hue = 0x47E; - } + public GhostShipAnchor() : base(0x14F7) => Hue = 0x47E; public GhostShipAnchor(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Minor Artifacts/ML/TotemOfVoid.cs b/Projects/Scripts/Items/Minor Artifacts/ML/TotemOfVoid.cs index cfd6a9b5a..68492720e 100644 --- a/Projects/Scripts/Items/Minor Artifacts/ML/TotemOfVoid.cs +++ b/Projects/Scripts/Items/Minor Artifacts/ML/TotemOfVoid.cs @@ -25,10 +25,7 @@ namespace Server.Items public override int LabelNumber => 1075035; // Totem of the Void public override bool ForceShowName => true; - public override Type GetSummoner() - { - return Utility.RandomBool() ? typeof(SummonedSkeletalKnight) : typeof(SummonedSheep); - } + public override Type GetSummoner() => Utility.RandomBool() ? typeof(SummonedSkeletalKnight) : typeof(SummonedSheep); public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Items/Minor Artifacts/PhillipsWoodenSteed.cs b/Projects/Scripts/Items/Minor Artifacts/PhillipsWoodenSteed.cs index ca51b9c11..82c33f76c 100644 --- a/Projects/Scripts/Items/Minor Artifacts/PhillipsWoodenSteed.cs +++ b/Projects/Scripts/Items/Minor Artifacts/PhillipsWoodenSteed.cs @@ -3,10 +3,7 @@ namespace Server.Items public class PhillipsWoodenSteed : MonsterStatuette { [Constructible] - public PhillipsWoodenSteed() : base(MonsterStatuetteType.PhillipsWoodenSteed) - { - LootType = LootType.Regular; - } + public PhillipsWoodenSteed() : base(MonsterStatuetteType.PhillipsWoodenSteed) => LootType = LootType.Regular; public PhillipsWoodenSteed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Minor Artifacts/ShieldOfInvulnerability.cs b/Projects/Scripts/Items/Minor Artifacts/ShieldOfInvulnerability.cs index 06b90c40f..e71bebd93 100644 --- a/Projects/Scripts/Items/Minor Artifacts/ShieldOfInvulnerability.cs +++ b/Projects/Scripts/Items/Minor Artifacts/ShieldOfInvulnerability.cs @@ -28,10 +28,7 @@ namespace Server.Items public override int InitMinHits => 255; public override int InitMaxHits => 255; - public override bool Validate(Mobile m) - { - return true; - } + public override bool Validate(Mobile m) => true; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Items/Minor Artifacts/ShipModelOfTheHMSCape.cs b/Projects/Scripts/Items/Minor Artifacts/ShipModelOfTheHMSCape.cs index 1e2304232..232d769d8 100644 --- a/Projects/Scripts/Items/Minor Artifacts/ShipModelOfTheHMSCape.cs +++ b/Projects/Scripts/Items/Minor Artifacts/ShipModelOfTheHMSCape.cs @@ -3,10 +3,7 @@ namespace Server.Items public class ShipModelOfTheHMSCape : Item { [Constructible] - public ShipModelOfTheHMSCape() : base(0x14F3) - { - Hue = 0x37B; - } + public ShipModelOfTheHMSCape() : base(0x14F3) => Hue = 0x37B; public ShipModelOfTheHMSCape(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Misc/Blighted Grove/EternallyCorruptTree.cs b/Projects/Scripts/Items/Misc/Blighted Grove/EternallyCorruptTree.cs index 737b2dc80..25345379e 100644 --- a/Projects/Scripts/Items/Misc/Blighted Grove/EternallyCorruptTree.cs +++ b/Projects/Scripts/Items/Misc/Blighted Grove/EternallyCorruptTree.cs @@ -3,10 +3,7 @@ namespace Server.Items public class EternallyCorruptTree : Item { [Constructible] - public EternallyCorruptTree() : base(0x20FA) - { - Hue = Utility.RandomMinMax(0x899, 0x8B0); - } + public EternallyCorruptTree() : base(0x20FA) => Hue = Utility.RandomMinMax(0x899, 0x8B0); public EternallyCorruptTree(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Misc/Blighted Grove/MelisandesHairDye.cs b/Projects/Scripts/Items/Misc/Blighted Grove/MelisandesHairDye.cs index 2c02c7bdf..2000ae56a 100644 --- a/Projects/Scripts/Items/Misc/Blighted Grove/MelisandesHairDye.cs +++ b/Projects/Scripts/Items/Misc/Blighted Grove/MelisandesHairDye.cs @@ -5,10 +5,7 @@ namespace Server.Items public class MelisandesHairDye : Item { [Constructible] - public MelisandesHairDye() : base(0xEFF) - { - Hue = Utility.RandomMinMax(0x47E, 0x499); - } + public MelisandesHairDye() : base(0xEFF) => Hue = Utility.RandomMinMax(0x47E, 0x499); public MelisandesHairDye(Serial serial) : base(serial) { @@ -54,10 +51,7 @@ namespace Server.Items { private Item m_Item; - public ConfirmGump(Item item) - { - m_Item = item; - } + public ConfirmGump(Item item) => m_Item = item; public override int TitleNumber => 1074395; //
Use Permanent Hair Dye
diff --git a/Projects/Scripts/Items/Misc/Blighted Grove/SamplesOfCorruptedWater.cs b/Projects/Scripts/Items/Misc/Blighted Grove/SamplesOfCorruptedWater.cs index 7a71fa60f..b1cede35b 100644 --- a/Projects/Scripts/Items/Misc/Blighted Grove/SamplesOfCorruptedWater.cs +++ b/Projects/Scripts/Items/Misc/Blighted Grove/SamplesOfCorruptedWater.cs @@ -3,10 +3,7 @@ namespace Server.Items public class SamplesOfCorruptedWater : Item { [Constructible] - public SamplesOfCorruptedWater() : base(0xEFE) - { - LootType = LootType.Blessed; - } + public SamplesOfCorruptedWater() : base(0xEFE) => LootType = LootType.Blessed; public SamplesOfCorruptedWater(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Misc/Blocker.cs b/Projects/Scripts/Items/Misc/Blocker.cs index ef07f1532..b5baf8be0 100644 --- a/Projects/Scripts/Items/Misc/Blocker.cs +++ b/Projects/Scripts/Items/Misc/Blocker.cs @@ -5,10 +5,7 @@ namespace Server.Items public class Blocker : Item { [Constructible] - public Blocker() : base(0x21A4) - { - Movable = false; - } + public Blocker() : base(0x21A4) => Movable = false; public Blocker(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Misc/Bola.cs b/Projects/Scripts/Items/Misc/Bola.cs index ced67e757..e82137b12 100644 --- a/Projects/Scripts/Items/Misc/Bola.cs +++ b/Projects/Scripts/Items/Misc/Bola.cs @@ -147,10 +147,7 @@ namespace Server.Items { private Bola m_Bola; - public BolaTarget(Bola bola) : base(8, false, TargetFlags.Harmful) - { - m_Bola = bola; - } + public BolaTarget(Bola bola) : base(8, false, TargetFlags.Harmful) => m_Bola = bola; protected override void OnTarget(Mobile from, object obj) { diff --git a/Projects/Scripts/Items/Misc/BulletinBoards.cs b/Projects/Scripts/Items/Misc/BulletinBoards.cs index 5199469ec..69ec0b014 100644 --- a/Projects/Scripts/Items/Misc/BulletinBoards.cs +++ b/Projects/Scripts/Items/Misc/BulletinBoards.cs @@ -56,10 +56,7 @@ namespace Server.Items [CommandProperty(AccessLevel.GameMaster)] public string BoardName{ get; set; } - public static bool CheckTime(DateTime time, TimeSpan range) - { - return time + range < DateTime.UtcNow; - } + public static bool CheckTime(DateTime time, TimeSpan range) => time + range < DateTime.UtcNow; public static string FormatTS(TimeSpan ts) { @@ -367,20 +364,11 @@ namespace Server.Items public string[] Lines{ get; private set; } - public string GetTimeAsString() - { - return Time.ToString("MMM dd, yyyy"); - } + public string GetTimeAsString() => Time.ToString("MMM dd, yyyy"); - public override bool CheckTarget(Mobile from, Target targ, object targeted) - { - return false; - } + public override bool CheckTarget(Mobile from, Target targ, object targeted) => false; - public override bool IsAccessibleTo(Mobile check) - { - return false; - } + public override bool IsAccessibleTo(Mobile check) => false; public override void Serialize(GenericWriter writer) { @@ -528,10 +516,7 @@ namespace Server.Items m_Stream.Write((byte)0); } - public string SafeString(string v) - { - return v ?? string.Empty; - } + public string SafeString(string v) => v ?? string.Empty; } public class BBMessageContent : Packet diff --git a/Projects/Scripts/Items/Misc/CommunicationCrystals.cs b/Projects/Scripts/Items/Misc/CommunicationCrystals.cs index 6d532e7bf..e67ff411e 100644 --- a/Projects/Scripts/Items/Misc/CommunicationCrystals.cs +++ b/Projects/Scripts/Items/Misc/CommunicationCrystals.cs @@ -174,10 +174,7 @@ namespace Server.Items { private BroadcastCrystal m_Crystal; - public InternalTarget(BroadcastCrystal crystal) : base(2, false, TargetFlags.None) - { - m_Crystal = crystal; - } + public InternalTarget(BroadcastCrystal crystal) : base(2, false, TargetFlags.None) => m_Crystal = crystal; protected override void OnTarget(Mobile from, object targeted) { @@ -280,10 +277,7 @@ namespace Server.Items private BroadcastCrystal m_Sender; [Constructible] - public ReceiverCrystal() : base(0x1ED0) - { - Light = LightType.Circle150; - } + public ReceiverCrystal() : base(0x1ED0) => Light = LightType.Circle150; public ReceiverCrystal(Serial serial) : base(serial) { @@ -388,10 +382,7 @@ namespace Server.Items { private ReceiverCrystal m_Crystal; - public InternalTarget(ReceiverCrystal crystal) : base(-1, false, TargetFlags.None) - { - m_Crystal = crystal; - } + public InternalTarget(ReceiverCrystal crystal) : base(-1, false, TargetFlags.None) => m_Crystal = crystal; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Items/Misc/Corpses/Corpse.cs b/Projects/Scripts/Items/Misc/Corpses/Corpse.cs index df1cba941..5aaa1f3fc 100644 --- a/Projects/Scripts/Items/Misc/Corpses/Corpse.cs +++ b/Projects/Scripts/Items/Misc/Corpses/Corpse.cs @@ -337,12 +337,10 @@ namespace Server.Items } } - public override bool IsChildVisibleTo(Mobile m, Item child) - { - return !m.Player || m.AccessLevel > AccessLevel.Player || m_InstancedItems == null || - !m_InstancedItems.TryGetValue(child, out InstancedItemInfo info) || !InstancedCorpse && !info.Perpetual - || info.IsOwner(m); - } + public override bool IsChildVisibleTo(Mobile m, Item child) => + !m.Player || m.AccessLevel > AccessLevel.Player || m_InstancedItems == null || + !m_InstancedItems.TryGetValue(child, out InstancedItemInfo info) || !InstancedCorpse && !info.Perpetual + || info.IsOwner(m); private void AssignInstancedLoot() { @@ -470,10 +468,7 @@ namespace Server.Items m_DecayTimer = null; } - public static string GetCorpseName(Mobile m) - { - return m is BaseCreature bc ? bc.CorpseNameOverride ?? bc.CorpseName : null; - } + public static string GetCorpseName(Mobile m) => m is BaseCreature bc ? bc.CorpseNameOverride ?? bc.CorpseName : null; public static void Initialize() { @@ -521,10 +516,7 @@ namespace Server.Items return c; } - protected bool GetFlag(CorpseFlag flag) - { - return (m_Flags & flag) != 0; - } + protected bool GetFlag(CorpseFlag flag) => (m_Flags & flag) != 0; protected void SetFlag(CorpseFlag flag, bool on) { @@ -791,15 +783,9 @@ namespace Server.Items return NotorietyHandlers.CorpseNotoriety(from, this) == Notoriety.Innocent; } - public override bool CheckItemUse(Mobile from, Item item) - { - return base.CheckItemUse(from, item) && (item == this || CanLoot(from, item)); - } + public override bool CheckItemUse(Mobile from, Item item) => base.CheckItemUse(from, item) && (item == this || CanLoot(from, item)); - public override bool CheckLift(Mobile from, Item item, ref LRReason reject) - { - return base.CheckLift(from, item, ref reject) && CanLoot(from, item); - } + public override bool CheckLift(Mobile from, Item item, ref LRReason reject) => base.CheckLift(from, item, ref reject) && CanLoot(from, item); public override void OnItemUsed(Mobile from, Item item) { @@ -843,10 +829,7 @@ namespace Server.Items list.Add(new OpenCorpseEntry()); } - public bool GetRestoreInfo(Item item, ref Point3D loc) - { - return item != null && m_RestoreTable?.TryGetValue(item, out loc) == true; - } + public bool GetRestoreInfo(Item item, ref Point3D loc) => item != null && m_RestoreTable?.TryGetValue(item, out loc) == true; public void SetRestoreInfo(Item item, Point3D loc) { @@ -870,10 +853,7 @@ namespace Server.Items m_RestoreTable = null; } - public bool CanLoot(Mobile from, Item item) - { - return !IsCriminalAction(from) || (Map.Rules & MapRules.HarmfulRestrictions) == 0; - } + public bool CanLoot(Mobile from, Item item) => !IsCriminalAction(from) || (Map.Rules & MapRules.HarmfulRestrictions) == 0; public bool CheckLoot(Mobile from, Item item) { @@ -1062,10 +1042,7 @@ namespace Server.Items Open(from, Core.AOS); } - public override bool CheckContentDisplay(Mobile from) - { - return false; - } + public override bool CheckContentDisplay(Mobile from) => false; public override void AddNameProperty(ObjectPropertyList list) { diff --git a/Projects/Scripts/Items/Misc/Corpses/CorpseNameAttribute.cs b/Projects/Scripts/Items/Misc/Corpses/CorpseNameAttribute.cs index 000c86454..7338c269f 100644 --- a/Projects/Scripts/Items/Misc/Corpses/CorpseNameAttribute.cs +++ b/Projects/Scripts/Items/Misc/Corpses/CorpseNameAttribute.cs @@ -5,10 +5,7 @@ namespace Server [AttributeUsage(AttributeTargets.Class)] public class CorpseNameAttribute : Attribute { - public CorpseNameAttribute(string name) - { - Name = name; - } + public CorpseNameAttribute(string name) => Name = name; public string Name{ get; } } diff --git a/Projects/Scripts/Items/Misc/Corpses/DecayedCorpse.cs b/Projects/Scripts/Items/Misc/Corpses/DecayedCorpse.cs index 752af35fb..911313def 100644 --- a/Projects/Scripts/Items/Misc/Corpses/DecayedCorpse.cs +++ b/Projects/Scripts/Items/Misc/Corpses/DecayedCorpse.cs @@ -41,10 +41,7 @@ namespace Server.Items } // Do not display (x items, y stones) - public override bool CheckContentDisplay(Mobile from) - { - return false; - } + public override bool CheckContentDisplay(Mobile from) => false; public override void AddNameProperty(ObjectPropertyList list) { diff --git a/Projects/Scripts/Items/Misc/EffectController.cs b/Projects/Scripts/Items/Misc/EffectController.cs index 22b49ef0b..16f94d462 100644 --- a/Projects/Scripts/Items/Misc/EffectController.cs +++ b/Projects/Scripts/Items/Misc/EffectController.cs @@ -214,10 +214,7 @@ namespace Server.Items writer.WriteEncodedInt(TriggerRange); } - private IEntity ReadEntity(GenericReader reader) - { - return World.FindEntity(reader.ReadUInt()); - } + private IEntity ReadEntity(GenericReader reader) => World.FindEntity(reader.ReadUInt()); public override void Deserialize(GenericReader reader) { diff --git a/Projects/Scripts/Items/Misc/EffectItem.cs b/Projects/Scripts/Items/Misc/EffectItem.cs index b54e8ab45..dcddd3b74 100644 --- a/Projects/Scripts/Items/Misc/EffectItem.cs +++ b/Projects/Scripts/Items/Misc/EffectItem.cs @@ -10,9 +10,8 @@ namespace Server.Items public static readonly TimeSpan DefaultDuration = TimeSpan.FromSeconds(5.0); private EffectItem() : base(1) // nodraw - { - Movable = false; - } + => + Movable = false; public EffectItem(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Misc/ExecutionersCap.cs b/Projects/Scripts/Items/Misc/ExecutionersCap.cs index 4ea91829d..758af6533 100644 --- a/Projects/Scripts/Items/Misc/ExecutionersCap.cs +++ b/Projects/Scripts/Items/Misc/ExecutionersCap.cs @@ -3,10 +3,7 @@ namespace Server.Items public class ExecutionersCap : Item { [Constructible] - public ExecutionersCap() : base(0xF83) - { - Weight = 1.0; - } + public ExecutionersCap() : base(0xF83) => Weight = 1.0; public ExecutionersCap(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Misc/Firebomb.cs b/Projects/Scripts/Items/Misc/Firebomb.cs index e3dde80f3..71c702a73 100644 --- a/Projects/Scripts/Items/Misc/Firebomb.cs +++ b/Projects/Scripts/Items/Misc/Firebomb.cs @@ -183,10 +183,8 @@ namespace Server.Items private class ThrowTarget : Target { public ThrowTarget(Firebomb bomb) - : base(12, true, TargetFlags.None) - { + : base(12, true, TargetFlags.None) => Bomb = bomb; - } public Firebomb Bomb{ get; } diff --git a/Projects/Scripts/Items/Misc/FlippableAddonAttribute.cs b/Projects/Scripts/Items/Misc/FlippableAddonAttribute.cs index 3ac04de4b..b1266ea8d 100644 --- a/Projects/Scripts/Items/Misc/FlippableAddonAttribute.cs +++ b/Projects/Scripts/Items/Misc/FlippableAddonAttribute.cs @@ -14,10 +14,7 @@ namespace Server.Items typeof(Mobile), typeof(Direction) }; - public FlippableAddonAttribute(params Direction[] directions) - { - Directions = directions; - } + public FlippableAddonAttribute(params Direction[] directions) => Directions = directions; public Direction[] Directions{ get; } diff --git a/Projects/Scripts/Items/Misc/FlippableAttribute.cs b/Projects/Scripts/Items/Misc/FlippableAttribute.cs index 12ceeacd8..40540d265 100644 --- a/Projects/Scripts/Items/Misc/FlippableAttribute.cs +++ b/Projects/Scripts/Items/Misc/FlippableAttribute.cs @@ -55,10 +55,7 @@ namespace Server.Items [AttributeUsage(AttributeTargets.Class)] public class FlippableAttribute : Attribute { - public FlippableAttribute(params int[] itemIDs) - { - ItemIDs = itemIDs; - } + public FlippableAttribute(params int[] itemIDs) => ItemIDs = itemIDs; public int[] ItemIDs{ get; } diff --git a/Projects/Scripts/Items/Misc/Guillotine.cs b/Projects/Scripts/Items/Misc/Guillotine.cs index c490d14d6..a38c2f7e4 100644 --- a/Projects/Scripts/Items/Misc/Guillotine.cs +++ b/Projects/Scripts/Items/Misc/Guillotine.cs @@ -10,10 +10,8 @@ namespace Server.Items [Constructible] public Guillotine() - : base(4656) - { + : base(4656) => Movable = false; - } public Guillotine(Serial serial) : base(serial) diff --git a/Projects/Scripts/Items/Misc/HairDye.cs b/Projects/Scripts/Items/Misc/HairDye.cs index 323f13b54..4e49df800 100644 --- a/Projects/Scripts/Items/Misc/HairDye.cs +++ b/Projects/Scripts/Items/Misc/HairDye.cs @@ -6,10 +6,7 @@ namespace Server.Items public class HairDye : Item { [Constructible] - public HairDye() : base(0xEFF) - { - Weight = 1.0; - } + public HairDye() : base(0xEFF) => Weight = 1.0; public HairDye(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Misc/Key.cs b/Projects/Scripts/Items/Misc/Key.cs index 715e1f349..475b3492b 100644 --- a/Projects/Scripts/Items/Misc/Key.cs +++ b/Projects/Scripts/Items/Misc/Key.cs @@ -70,10 +70,7 @@ namespace Server.Items [CommandProperty(AccessLevel.GameMaster)] public Item Link{ get; set; } - public static uint RandomValue() - { - return (uint)(0xFFFFFFFE * Utility.RandomDouble()) + 1; - } + public static uint RandomValue() => (uint)(0xFFFFFFFE * Utility.RandomDouble()) + 1; public static void RemoveKeys(Mobile m, uint keyValue) { @@ -273,10 +270,7 @@ namespace Server.Items { private Key m_Key; - public RenamePrompt(Key key) - { - m_Key = key; - } + public RenamePrompt(Key key) => m_Key = key; public override void OnResponse(Mobile from, string text) { @@ -336,10 +330,7 @@ namespace Server.Items { private Key m_Key; - public CopyTarget(Key key) : base(3, false, TargetFlags.None) - { - m_Key = key; - } + public CopyTarget(Key key) : base(3, false, TargetFlags.None) => m_Key = key; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Items/Misc/KeyRing.cs b/Projects/Scripts/Items/Misc/KeyRing.cs index c73052af0..4965f6827 100644 --- a/Projects/Scripts/Items/Misc/KeyRing.cs +++ b/Projects/Scripts/Items/Misc/KeyRing.cs @@ -152,10 +152,7 @@ namespace Server.Items { private KeyRing m_KeyRing; - public InternalTarget(KeyRing keyRing) : base(-1, false, TargetFlags.None) - { - m_KeyRing = keyRing; - } + public InternalTarget(KeyRing keyRing) : base(-1, false, TargetFlags.None) => m_KeyRing = keyRing; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Items/Misc/LOSBlocker.cs b/Projects/Scripts/Items/Misc/LOSBlocker.cs index ba4dad9ac..2d44cef77 100644 --- a/Projects/Scripts/Items/Misc/LOSBlocker.cs +++ b/Projects/Scripts/Items/Misc/LOSBlocker.cs @@ -5,10 +5,7 @@ namespace Server.Items public class LOSBlocker : Item { [Constructible] - public LOSBlocker() : base(0x21A2) - { - Movable = false; - } + public LOSBlocker() : base(0x21A2) => Movable = false; public LOSBlocker(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Misc/Moonstone.cs b/Projects/Scripts/Items/Misc/Moonstone.cs index 53d4d38f0..d0212edb3 100644 --- a/Projects/Scripts/Items/Misc/Moonstone.cs +++ b/Projects/Scripts/Items/Misc/Moonstone.cs @@ -106,10 +106,7 @@ namespace Server.Items } } - public Map GetTargetMap() - { - return m_Type == MoonstoneType.Felucca ? Map.Felucca : Map.Trammel; - } + public Map GetTargetMap() => m_Type == MoonstoneType.Felucca ? Map.Felucca : Map.Trammel; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Items/Misc/OilCloth.cs b/Projects/Scripts/Items/Misc/OilCloth.cs index 73a25632d..3bcf4bd83 100644 --- a/Projects/Scripts/Items/Misc/OilCloth.cs +++ b/Projects/Scripts/Items/Misc/OilCloth.cs @@ -8,10 +8,7 @@ namespace Server.Items public class OilCloth : Item, IScissorable, IDyable { [Constructible] - public OilCloth() : base(0x175D) - { - Hue = 2001; - } + public OilCloth() : base(0x175D) => Hue = 2001; public OilCloth(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Misc/Origami.cs b/Projects/Scripts/Items/Misc/Origami.cs index 3adb1b226..c673eb468 100644 --- a/Projects/Scripts/Items/Misc/Origami.cs +++ b/Projects/Scripts/Items/Misc/Origami.cs @@ -72,10 +72,7 @@ namespace Server.Items public class OrigamiButterfly : Item { [Constructible] - public OrigamiButterfly() : base(0x2838) - { - LootType = LootType.Blessed; - } + public OrigamiButterfly() : base(0x2838) => LootType = LootType.Blessed; public OrigamiButterfly(Serial serial) : base(serial) { @@ -101,10 +98,7 @@ namespace Server.Items public class OrigamiSwan : Item { [Constructible] - public OrigamiSwan() : base(0x2839) - { - LootType = LootType.Blessed; - } + public OrigamiSwan() : base(0x2839) => LootType = LootType.Blessed; public OrigamiSwan(Serial serial) : base(serial) { @@ -130,10 +124,7 @@ namespace Server.Items public class OrigamiFrog : Item { [Constructible] - public OrigamiFrog() : base(0x283A) - { - LootType = LootType.Blessed; - } + public OrigamiFrog() : base(0x283A) => LootType = LootType.Blessed; public OrigamiFrog(Serial serial) : base(serial) { @@ -159,10 +150,7 @@ namespace Server.Items public class OrigamiShape : Item { [Constructible] - public OrigamiShape() : base(0x283B) - { - LootType = LootType.Blessed; - } + public OrigamiShape() : base(0x283B) => LootType = LootType.Blessed; public OrigamiShape(Serial serial) : base(serial) { @@ -188,10 +176,7 @@ namespace Server.Items public class OrigamiSongbird : Item { [Constructible] - public OrigamiSongbird() : base(0x283C) - { - LootType = LootType.Blessed; - } + public OrigamiSongbird() : base(0x283C) => LootType = LootType.Blessed; public OrigamiSongbird(Serial serial) : base(serial) { @@ -217,10 +202,7 @@ namespace Server.Items public class OrigamiFish : Item { [Constructible] - public OrigamiFish() : base(0x283D) - { - LootType = LootType.Blessed; - } + public OrigamiFish() : base(0x283D) => LootType = LootType.Blessed; public OrigamiFish(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Misc/Palace of Paroxysmus/AcidProofRope.cs b/Projects/Scripts/Items/Misc/Palace of Paroxysmus/AcidProofRope.cs index c0785fca9..b173429ed 100644 --- a/Projects/Scripts/Items/Misc/Palace of Paroxysmus/AcidProofRope.cs +++ b/Projects/Scripts/Items/Misc/Palace of Paroxysmus/AcidProofRope.cs @@ -3,10 +3,7 @@ namespace Server.Items public class AcidProofRope : Item { [Constructible] - public AcidProofRope() : base(0x20D) - { - Hue = 0x3D1; // TODO check - } + public AcidProofRope() : base(0x20D) => Hue = 0x3D1; public AcidProofRope(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Misc/PlayerBulletinBoards.cs b/Projects/Scripts/Items/Misc/PlayerBulletinBoards.cs index 06354eb33..967f5760f 100644 --- a/Projects/Scripts/Items/Misc/PlayerBulletinBoards.cs +++ b/Projects/Scripts/Items/Misc/PlayerBulletinBoards.cs @@ -9,592 +9,586 @@ using Server.ContextMenus; namespace Server.Items { - public class PlayerBBSouth : BasePlayerBB - { - public override int LabelNumber => 1062421; // bulletin board (south) - - [Constructible] - public PlayerBBSouth() : base( 0x2311 ) - { - Weight = 15.0; - } + public class PlayerBBSouth : BasePlayerBB + { + public override int LabelNumber => 1062421; // bulletin board (south) - public PlayerBBSouth( Serial serial ) : base( serial ) - { - } + [Constructible] + public PlayerBBSouth() : base( 0x2311 ) => Weight = 15.0; - public override void Serialize( GenericWriter writer ) - { - base.Serialize( writer ); + public PlayerBBSouth( Serial serial ) : base( serial ) + { + } - writer.Write( 0 ); // version - } + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); - public override void Deserialize( GenericReader reader ) - { - base.Deserialize( reader ); - - int version = reader.ReadInt(); - } - } - - public class PlayerBBEast : BasePlayerBB - { - public override int LabelNumber => 1062420; // bulletin board (east) - - [Constructible] - public PlayerBBEast() : base( 0x2312 ) - { - Weight = 15.0; - } + writer.Write( 0 ); // version + } - public PlayerBBEast( Serial serial ) : base( serial ) - { - } + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); - public override void Serialize( GenericWriter writer ) - { - base.Serialize( writer ); + int version = reader.ReadInt(); + } + } - writer.Write( 0 ); // version - } + public class PlayerBBEast : BasePlayerBB + { + public override int LabelNumber => 1062420; // bulletin board (east) - public override void Deserialize( GenericReader reader ) - { - base.Deserialize( reader ); + [Constructible] + public PlayerBBEast() : base( 0x2312 ) => Weight = 15.0; - int version = reader.ReadInt(); - } - } + public PlayerBBEast( Serial serial ) : base( serial ) + { + } - public abstract class BasePlayerBB : Item, ISecurable - { - public List Messages { get; private set; } + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); - public PlayerBBMessage Greeting { get; set; } - - [CommandProperty( AccessLevel.GameMaster )] - public string Title { get; set; } + writer.Write( 0 ); // version + } - [CommandProperty( AccessLevel.GameMaster )] - public SecureLevel Level { get; set; } - - public BasePlayerBB( int itemID ) : base( itemID ) - { - Messages = new List(); - Level = SecureLevel.Anyone; - } - - public BasePlayerBB( Serial serial ) : base( serial ) - { - } - - public override void GetContextMenuEntries( Mobile from, List list ) - { - base.GetContextMenuEntries( from, list ); - SetSecureLevelEntry.AddTo( from, this, list ); - } - - public override void Serialize( GenericWriter writer ) - { - base.Serialize( writer ); - - writer.Write( 1 ); - - writer.Write( (int) Level ); - - writer.Write( Title ); - - if ( Greeting != null ) - { - writer.Write( true ); - Greeting.Serialize( writer ); - } - else - { - writer.Write( false ); - } - - writer.WriteEncodedInt( Messages.Count ); - - for ( int i = 0; i < Messages.Count; ++i ) - Messages[i].Serialize( writer ); - } - - public override void Deserialize( GenericReader reader ) - { - base.Deserialize( reader ); - - int version = reader.ReadInt(); - - switch ( version ) - { - case 1: - { - Level = (SecureLevel)reader.ReadInt(); - goto case 0; - } - case 0: - { - if ( version < 1 ) - Level = SecureLevel.Anyone; - - Title = reader.ReadString(); - - if ( reader.ReadBool() ) - Greeting = new PlayerBBMessage( reader ); - - int count = reader.ReadEncodedInt(); - - Messages = new List( count ); - - for ( int i = 0; i < count; ++i ) - Messages.Add( new PlayerBBMessage( reader ) ); - - break; - } - } - } - - public static bool CheckAccess( BaseHouse house, Mobile from ) - { - if ( house.Public || !house.IsAosRules ) - return !house.IsBanned( from ); - - return house.HasAccess( from ); - } - - public override void OnDoubleClick( Mobile from ) - { - BaseHouse house = BaseHouse.FindHouseAt( this ); - - if ( house == null || !house.HasLockedDownItem( this ) ) - from.SendLocalizedMessage( 1062396 ); // This bulletin board must be locked down in a house to be usable. - else if ( !from.InRange( GetWorldLocation(), 2 ) || !from.InLOS( this ) ) - from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. - else if ( CheckAccess( house, from ) ) - from.SendGump( new PlayerBBGump( from, house, this, 0 ) ); - } - - public class PostPrompt : Prompt - { - private int m_Page; - private BaseHouse m_House; - private BasePlayerBB m_Board; - private bool m_Greeting; - - public PostPrompt( int page, BaseHouse house, BasePlayerBB board, bool greeting ) - { - m_Page = page; - m_House = house; - m_Board = board; - m_Greeting = greeting; - } - - public override void OnCancel( Mobile from ) - { - OnResponse( from, "" ); - } - - public override void OnResponse( Mobile from, string text ) - { - int page = m_Page; - BaseHouse house = m_House; - BasePlayerBB board = m_Board; - - if ( house == null || !house.HasLockedDownItem( board ) ) - { - from.SendLocalizedMessage( 1062396 ); // This bulletin board must be locked down in a house to be usable. - return; - } - - if ( !from.InRange( board.GetWorldLocation(), 2 ) || !from.InLOS( board ) ) - { - from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. - return; - } - if ( !CheckAccess( house, from ) ) - { - from.SendLocalizedMessage( 1062398 ); // You are not allowed to post to this bulletin board. - return; - } - if ( m_Greeting && !house.IsOwner( from ) ) - { - return; - } - - text = text.Trim(); - - if ( text.Length > 255 ) - text = text.Substring( 0, 255 ); - - if ( text.Length > 0 ) - { - PlayerBBMessage message = new PlayerBBMessage( DateTime.UtcNow, from, text ); - - if ( m_Greeting ) - { - board.Greeting = message; - } - else - { - board.Messages.Add( message ); - - if ( board.Messages.Count > 50 ) - { - board.Messages.RemoveAt( 0 ); - - if ( page > 0 ) - --page; - } - } - } - - from.SendGump( new PlayerBBGump( from, house, board, page ) ); - } - } - - public class SetTitlePrompt : Prompt - { - private int m_Page; - private BaseHouse m_House; - private BasePlayerBB m_Board; - - public SetTitlePrompt( int page, BaseHouse house, BasePlayerBB board ) - { - m_Page = page; - m_House = house; - m_Board = board; - } - - public override void OnCancel( Mobile from ) - { - OnResponse( from, "" ); - } - - public override void OnResponse( Mobile from, string text ) - { - int page = m_Page; - BaseHouse house = m_House; - BasePlayerBB board = m_Board; - - if ( house == null || !house.HasLockedDownItem( board ) ) - { - from.SendLocalizedMessage( 1062396 ); // This bulletin board must be locked down in a house to be usable. - return; - } - - if ( !from.InRange( board.GetWorldLocation(), 2 ) || !from.InLOS( board ) ) - { - from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. - return; - } - if ( !CheckAccess( house, from ) ) - { - from.SendLocalizedMessage( 1062398 ); // You are not allowed to post to this bulletin board. - return; - } - - text = text.Trim(); - - if ( text.Length > 255 ) - text = text.Substring( 0, 255 ); - - if ( text.Length > 0 ) - board.Title = text; - - from.SendGump( new PlayerBBGump( from, house, board, page ) ); - } - } - } - - public class PlayerBBMessage - { - [CommandProperty( AccessLevel.GameMaster )] - public DateTime Time { get; set; } - - [CommandProperty( AccessLevel.GameMaster )] - public Mobile Poster { get; set; } - - [CommandProperty( AccessLevel.GameMaster )] - public string Message { get; set; } - - public PlayerBBMessage( DateTime time, Mobile poster, string message ) - { - Time = time; - Poster = poster; - Message = message; - } - - public PlayerBBMessage( GenericReader reader ) - { - int version = reader.ReadEncodedInt(); - - switch ( version ) - { - case 0: - { - Time = reader.ReadDateTime(); - Poster = reader.ReadMobile(); - Message = reader.ReadString(); - break; - } - } - } - - public void Serialize( GenericWriter writer ) - { - writer.WriteEncodedInt( 0 ); // version - - writer.Write( Time ); - writer.Write( Poster ); - writer.Write( Message ); - } - } - - public class PlayerBBGump : Gump - { - private int m_Page; - private Mobile m_From; - private BaseHouse m_House; - private BasePlayerBB m_Board; - - private const int LabelColor = 0x7FFF; - private const int LabelHue = 1153; - - public override void OnResponse( NetState sender, RelayInfo info ) - { - int page = m_Page; - Mobile from = m_From; - BaseHouse house = m_House; - BasePlayerBB board = m_Board; - - if ( house == null || !house.HasLockedDownItem( board ) ) - { - from.SendLocalizedMessage( 1062396 ); // This bulletin board must be locked down in a house to be usable. - return; - } - - if ( !from.InRange( board.GetWorldLocation(), 2 ) || !from.InLOS( board ) ) - { - from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. - return; - } - if ( !BasePlayerBB.CheckAccess( house, from ) ) - { - from.SendLocalizedMessage( 1062398 ); // You are not allowed to post to this bulletin board. - return; - } - - switch ( info.ButtonID ) - { - case 1: // Post message - { - from.Prompt = new BasePlayerBB.PostPrompt( page, house, board, false ); - from.SendLocalizedMessage( 1062397 ); // Please enter your message: - - break; - } - case 2: // Set title - { - if ( house.IsOwner( from ) ) - { - from.Prompt = new BasePlayerBB.SetTitlePrompt( page, house, board ); - from.SendLocalizedMessage( 1062402 ); // Enter new title: - } - - break; - } - case 3: // Post greeting - { - if ( house.IsOwner( from ) ) - { - from.Prompt = new BasePlayerBB.PostPrompt( page, house, board, true ); - from.SendLocalizedMessage( 1062404 ); // Enter new greeting (this will always be the first post): - } - - break; - } - case 4: // Scroll up - { - if ( page == 0 ) - page = board.Messages.Count; - else - page -= 1; - - from.SendGump( new PlayerBBGump( from, house, board, page ) ); - - break; - } - case 5: // Scroll down - { - page += 1; - page %= board.Messages.Count + 1; - - from.SendGump( new PlayerBBGump( from, house, board, page ) ); - - break; - } - case 6: // Banish poster - { - if ( house.IsOwner( from ) ) - { - if ( page >= 1 && page <= board.Messages.Count ) - { - PlayerBBMessage message = board.Messages[page - 1]; - Mobile poster = message.Poster; - - if ( poster == null ) - { - from.SendGump( new PlayerBBGump( from, house, board, page ) ); - return; - } - - if ( poster.AccessLevel > AccessLevel.Player && from.AccessLevel <= poster.AccessLevel ) - { - from.SendLocalizedMessage( 501354 ); // Uh oh...a bigger boot may be required. - } - else if ( house.IsFriend( poster ) ) - { - from.SendLocalizedMessage( 1060750 ); // That person is a friend, co-owner, or owner of this house, and therefore cannot be banished! - } - else if ( poster is PlayerVendor ) - { - from.SendLocalizedMessage( 501351 ); // You cannot eject a vendor. - } - else if ( house.Bans.Count >= BaseHouse.MaxBans ) - { - from.SendLocalizedMessage( 501355 ); // The ban limit for this house has been reached! - } - else if ( house.IsBanned( poster ) ) - { - from.SendLocalizedMessage( 501356 ); // This person is already banned! - } - else if ( poster is BaseCreature creature && creature.NoHouseRestrictions ) - { - from.SendLocalizedMessage( 1062040 ); // You cannot ban that. - } - else - { - if ( !house.Bans.Contains( poster ) ) - house.Bans.Add( poster ); - - from.SendLocalizedMessage( 1062417 ); // That person has been banned from this house. - - if ( house.IsInside( poster ) && !BasePlayerBB.CheckAccess( house, poster ) ) - poster.MoveToWorld( house.BanLocation, house.Map ); - } - } - - from.SendGump( new PlayerBBGump( from, house, board, page ) ); - } - - break; - } - case 7: // Delete message - { - if ( house.IsOwner( from ) ) - { - if ( page >= 1 && page <= board.Messages.Count ) - board.Messages.RemoveAt( page - 1 ); - - from.SendGump( new PlayerBBGump( from, house, board, 0 ) ); - } - - break; - } - case 8: // Post props - { - if ( from.AccessLevel >= AccessLevel.GameMaster ) - { - PlayerBBMessage message = board.Greeting; - - if ( page >= 1 && page <= board.Messages.Count ) - message = board.Messages[page - 1]; - - from.SendGump( new PlayerBBGump( from, house, board, page ) ); - from.SendGump( new PropertiesGump( from, message ) ); - } - - break; - } - } - } - - public PlayerBBGump( Mobile from, BaseHouse house, BasePlayerBB board, int page ) : base( 50, 10 ) - { - from.CloseGump(); - - m_Page = page; - m_From = from; - m_House = house; - m_Board = board; - - AddPage( 0 ); - - AddImage( 30, 30, 5400 ); - - AddButton( 393, 145, 2084, 2084, 4); // Scroll up - AddButton( 390, 371, 2085, 2085, 5); // Scroll down - - AddButton( 32, 183, 5412, 5413, 1); // Post message - - if ( house.IsOwner( from ) ) - { - AddButton( 63, 90, 5601, 5605, 2); - AddHtmlLocalized( 81, 89, 230, 20, 1062400, LabelColor ); // Set title - - AddButton( 63, 109, 5601, 5605, 3); - AddHtmlLocalized( 81, 108, 230, 20, 1062401, LabelColor ); // Post greeting - } - - string title = board.Title; - - if ( title != null ) - AddHtml( 183, 68, 180, 23, title ); - - AddHtmlLocalized( 385, 89, 60, 20, 1062409, LabelColor ); // Post - - AddLabel( 440, 89, LabelHue, page.ToString() ); - AddLabel( 455, 89, LabelHue, "/" ); - AddLabel( 470, 89, LabelHue, board.Messages.Count.ToString() ); - - PlayerBBMessage message = board.Greeting; - - if ( page >= 1 && page <= board.Messages.Count ) - message = board.Messages[page - 1]; + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); - AddImageTiled( 150, 220, 240, 1, 2700 ); // Separator + int version = reader.ReadInt(); + } + } - AddHtmlLocalized( 150, 180, 100, 20, 1062405, 16715 ); // Posted On: - AddHtmlLocalized( 150, 200, 100, 20, 1062406, 16715 ); // Posted By: + public abstract class BasePlayerBB : Item, ISecurable + { + public List Messages { get; private set; } - if ( message != null ) - { - AddHtml( 255, 180, 150, 20, message.Time.ToString( "yyyy-MM-dd HH:mm:ss" ) ); + public PlayerBBMessage Greeting { get; set; } - Mobile poster = message.Poster; - string name = poster?.Name; + [CommandProperty( AccessLevel.GameMaster )] + public string Title { get; set; } - if ( name == null || (name = name.Trim()).Length == 0 ) - name = "Someone"; + [CommandProperty( AccessLevel.GameMaster )] + public SecureLevel Level { get; set; } - AddHtml( 255, 200, 150, 20, name ); + public BasePlayerBB( int itemID ) : base( itemID ) + { + Messages = new List(); + Level = SecureLevel.Anyone; + } + + public BasePlayerBB( Serial serial ) : base( serial ) + { + } + + public override void GetContextMenuEntries( Mobile from, List list ) + { + base.GetContextMenuEntries( from, list ); + SetSecureLevelEntry.AddTo( from, this, list ); + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.Write( 1 ); + + writer.Write( (int) Level ); + + writer.Write( Title ); + + if ( Greeting != null ) + { + writer.Write( true ); + Greeting.Serialize( writer ); + } + else + { + writer.Write( false ); + } + + writer.WriteEncodedInt( Messages.Count ); + + for ( int i = 0; i < Messages.Count; ++i ) + Messages[i].Serialize( writer ); + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + int version = reader.ReadInt(); + + switch ( version ) + { + case 1: + { + Level = (SecureLevel)reader.ReadInt(); + goto case 0; + } + case 0: + { + if ( version < 1 ) + Level = SecureLevel.Anyone; + + Title = reader.ReadString(); + + if ( reader.ReadBool() ) + Greeting = new PlayerBBMessage( reader ); + + int count = reader.ReadEncodedInt(); + + Messages = new List( count ); + + for ( int i = 0; i < count; ++i ) + Messages.Add( new PlayerBBMessage( reader ) ); + + break; + } + } + } + + public static bool CheckAccess( BaseHouse house, Mobile from ) + { + if ( house.Public || !house.IsAosRules ) + return !house.IsBanned( from ); + + return house.HasAccess( from ); + } + + public override void OnDoubleClick( Mobile from ) + { + BaseHouse house = BaseHouse.FindHouseAt( this ); + + if ( house == null || !house.HasLockedDownItem( this ) ) + from.SendLocalizedMessage( 1062396 ); // This bulletin board must be locked down in a house to be usable. + else if ( !from.InRange( GetWorldLocation(), 2 ) || !from.InLOS( this ) ) + from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. + else if ( CheckAccess( house, from ) ) + from.SendGump( new PlayerBBGump( from, house, this, 0 ) ); + } + + public class PostPrompt : Prompt + { + private int m_Page; + private BaseHouse m_House; + private BasePlayerBB m_Board; + private bool m_Greeting; + + public PostPrompt( int page, BaseHouse house, BasePlayerBB board, bool greeting ) + { + m_Page = page; + m_House = house; + m_Board = board; + m_Greeting = greeting; + } + + public override void OnCancel( Mobile from ) + { + OnResponse( from, "" ); + } + + public override void OnResponse( Mobile from, string text ) + { + int page = m_Page; + BaseHouse house = m_House; + BasePlayerBB board = m_Board; + + if ( house == null || !house.HasLockedDownItem( board ) ) + { + from.SendLocalizedMessage( 1062396 ); // This bulletin board must be locked down in a house to be usable. + return; + } + + if ( !from.InRange( board.GetWorldLocation(), 2 ) || !from.InLOS( board ) ) + { + from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. + return; + } + if ( !CheckAccess( house, from ) ) + { + from.SendLocalizedMessage( 1062398 ); // You are not allowed to post to this bulletin board. + return; + } + if ( m_Greeting && !house.IsOwner( from ) ) + { + return; + } + + text = text.Trim(); + + if ( text.Length > 255 ) + text = text.Substring( 0, 255 ); + + if ( text.Length > 0 ) + { + PlayerBBMessage message = new PlayerBBMessage( DateTime.UtcNow, from, text ); + + if ( m_Greeting ) + { + board.Greeting = message; + } + else + { + board.Messages.Add( message ); + + if ( board.Messages.Count > 50 ) + { + board.Messages.RemoveAt( 0 ); + + if ( page > 0 ) + --page; + } + } + } + + from.SendGump( new PlayerBBGump( from, house, board, page ) ); + } + } + + public class SetTitlePrompt : Prompt + { + private int m_Page; + private BaseHouse m_House; + private BasePlayerBB m_Board; + + public SetTitlePrompt( int page, BaseHouse house, BasePlayerBB board ) + { + m_Page = page; + m_House = house; + m_Board = board; + } + + public override void OnCancel( Mobile from ) + { + OnResponse( from, "" ); + } + + public override void OnResponse( Mobile from, string text ) + { + int page = m_Page; + BaseHouse house = m_House; + BasePlayerBB board = m_Board; + + if ( house == null || !house.HasLockedDownItem( board ) ) + { + from.SendLocalizedMessage( 1062396 ); // This bulletin board must be locked down in a house to be usable. + return; + } + + if ( !from.InRange( board.GetWorldLocation(), 2 ) || !from.InLOS( board ) ) + { + from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. + return; + } + if ( !CheckAccess( house, from ) ) + { + from.SendLocalizedMessage( 1062398 ); // You are not allowed to post to this bulletin board. + return; + } + + text = text.Trim(); + + if ( text.Length > 255 ) + text = text.Substring( 0, 255 ); + + if ( text.Length > 0 ) + board.Title = text; + + from.SendGump( new PlayerBBGump( from, house, board, page ) ); + } + } + } + + public class PlayerBBMessage + { + [CommandProperty( AccessLevel.GameMaster )] + public DateTime Time { get; set; } + + [CommandProperty( AccessLevel.GameMaster )] + public Mobile Poster { get; set; } + + [CommandProperty( AccessLevel.GameMaster )] + public string Message { get; set; } + + public PlayerBBMessage( DateTime time, Mobile poster, string message ) + { + Time = time; + Poster = poster; + Message = message; + } + + public PlayerBBMessage( GenericReader reader ) + { + int version = reader.ReadEncodedInt(); + + switch ( version ) + { + case 0: + { + Time = reader.ReadDateTime(); + Poster = reader.ReadMobile(); + Message = reader.ReadString(); + break; + } + } + } + + public void Serialize( GenericWriter writer ) + { + writer.WriteEncodedInt( 0 ); // version + + writer.Write( Time ); + writer.Write( Poster ); + writer.Write( Message ); + } + } + + public class PlayerBBGump : Gump + { + private int m_Page; + private Mobile m_From; + private BaseHouse m_House; + private BasePlayerBB m_Board; + + private const int LabelColor = 0x7FFF; + private const int LabelHue = 1153; + + public override void OnResponse( NetState sender, RelayInfo info ) + { + int page = m_Page; + Mobile from = m_From; + BaseHouse house = m_House; + BasePlayerBB board = m_Board; + + if ( house == null || !house.HasLockedDownItem( board ) ) + { + from.SendLocalizedMessage( 1062396 ); // This bulletin board must be locked down in a house to be usable. + return; + } + + if ( !from.InRange( board.GetWorldLocation(), 2 ) || !from.InLOS( board ) ) + { + from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. + return; + } + if ( !BasePlayerBB.CheckAccess( house, from ) ) + { + from.SendLocalizedMessage( 1062398 ); // You are not allowed to post to this bulletin board. + return; + } + + switch ( info.ButtonID ) + { + case 1: // Post message + { + from.Prompt = new BasePlayerBB.PostPrompt( page, house, board, false ); + from.SendLocalizedMessage( 1062397 ); // Please enter your message: + + break; + } + case 2: // Set title + { + if ( house.IsOwner( from ) ) + { + from.Prompt = new BasePlayerBB.SetTitlePrompt( page, house, board ); + from.SendLocalizedMessage( 1062402 ); // Enter new title: + } + + break; + } + case 3: // Post greeting + { + if ( house.IsOwner( from ) ) + { + from.Prompt = new BasePlayerBB.PostPrompt( page, house, board, true ); + from.SendLocalizedMessage( 1062404 ); // Enter new greeting (this will always be the first post): + } + + break; + } + case 4: // Scroll up + { + if ( page == 0 ) + page = board.Messages.Count; + else + page -= 1; + + from.SendGump( new PlayerBBGump( from, house, board, page ) ); + + break; + } + case 5: // Scroll down + { + page += 1; + page %= board.Messages.Count + 1; + + from.SendGump( new PlayerBBGump( from, house, board, page ) ); + + break; + } + case 6: // Banish poster + { + if ( house.IsOwner( from ) ) + { + if ( page >= 1 && page <= board.Messages.Count ) + { + PlayerBBMessage message = board.Messages[page - 1]; + Mobile poster = message.Poster; + + if ( poster == null ) + { + from.SendGump( new PlayerBBGump( from, house, board, page ) ); + return; + } + + if ( poster.AccessLevel > AccessLevel.Player && from.AccessLevel <= poster.AccessLevel ) + { + from.SendLocalizedMessage( 501354 ); // Uh oh...a bigger boot may be required. + } + else if ( house.IsFriend( poster ) ) + { + from.SendLocalizedMessage( 1060750 ); // That person is a friend, co-owner, or owner of this house, and therefore cannot be banished! + } + else if ( poster is PlayerVendor ) + { + from.SendLocalizedMessage( 501351 ); // You cannot eject a vendor. + } + else if ( house.Bans.Count >= BaseHouse.MaxBans ) + { + from.SendLocalizedMessage( 501355 ); // The ban limit for this house has been reached! + } + else if ( house.IsBanned( poster ) ) + { + from.SendLocalizedMessage( 501356 ); // This person is already banned! + } + else if ( poster is BaseCreature creature && creature.NoHouseRestrictions ) + { + from.SendLocalizedMessage( 1062040 ); // You cannot ban that. + } + else + { + if ( !house.Bans.Contains( poster ) ) + house.Bans.Add( poster ); + + from.SendLocalizedMessage( 1062417 ); // That person has been banned from this house. + + if ( house.IsInside( poster ) && !BasePlayerBB.CheckAccess( house, poster ) ) + poster.MoveToWorld( house.BanLocation, house.Map ); + } + } + + from.SendGump( new PlayerBBGump( from, house, board, page ) ); + } + + break; + } + case 7: // Delete message + { + if ( house.IsOwner( from ) ) + { + if ( page >= 1 && page <= board.Messages.Count ) + board.Messages.RemoveAt( page - 1 ); + + from.SendGump( new PlayerBBGump( from, house, board, 0 ) ); + } + + break; + } + case 8: // Post props + { + if ( from.AccessLevel >= AccessLevel.GameMaster ) + { + PlayerBBMessage message = board.Greeting; + + if ( page >= 1 && page <= board.Messages.Count ) + message = board.Messages[page - 1]; + + from.SendGump( new PlayerBBGump( from, house, board, page ) ); + from.SendGump( new PropertiesGump( from, message ) ); + } + + break; + } + } + } + + public PlayerBBGump( Mobile from, BaseHouse house, BasePlayerBB board, int page ) : base( 50, 10 ) + { + from.CloseGump(); + + m_Page = page; + m_From = from; + m_House = house; + m_Board = board; + + AddPage( 0 ); + + AddImage( 30, 30, 5400 ); + + AddButton( 393, 145, 2084, 2084, 4); // Scroll up + AddButton( 390, 371, 2085, 2085, 5); // Scroll down + + AddButton( 32, 183, 5412, 5413, 1); // Post message + + if ( house.IsOwner( from ) ) + { + AddButton( 63, 90, 5601, 5605, 2); + AddHtmlLocalized( 81, 89, 230, 20, 1062400, LabelColor ); // Set title + + AddButton( 63, 109, 5601, 5605, 3); + AddHtmlLocalized( 81, 108, 230, 20, 1062401, LabelColor ); // Post greeting + } + + string title = board.Title; + + if ( title != null ) + AddHtml( 183, 68, 180, 23, title ); + + AddHtmlLocalized( 385, 89, 60, 20, 1062409, LabelColor ); // Post + + AddLabel( 440, 89, LabelHue, page.ToString() ); + AddLabel( 455, 89, LabelHue, "/" ); + AddLabel( 470, 89, LabelHue, board.Messages.Count.ToString() ); + + PlayerBBMessage message = board.Greeting; + + if ( page >= 1 && page <= board.Messages.Count ) + message = board.Messages[page - 1]; + + AddImageTiled( 150, 220, 240, 1, 2700 ); // Separator + + AddHtmlLocalized( 150, 180, 100, 20, 1062405, 16715 ); // Posted On: + AddHtmlLocalized( 150, 200, 100, 20, 1062406, 16715 ); // Posted By: + + if ( message != null ) + { + AddHtml( 255, 180, 150, 20, message.Time.ToString( "yyyy-MM-dd HH:mm:ss" ) ); + + Mobile poster = message.Poster; + string name = poster?.Name; + + if ( name == null || (name = name.Trim()).Length == 0 ) + name = "Someone"; + + AddHtml( 255, 200, 150, 20, name ); AddHtml( 150, 240, 250, 100, message.Message ?? "" ); - if ( message != board.Greeting && house.IsOwner( from ) ) - { - AddButton( 130, 395, 1209, 1210, 6); - AddHtmlLocalized( 150, 393, 150, 20, 1062410, LabelColor ); // Banish Poster + if ( message != board.Greeting && house.IsOwner( from ) ) + { + AddButton( 130, 395, 1209, 1210, 6); + AddHtmlLocalized( 150, 393, 150, 20, 1062410, LabelColor ); // Banish Poster - AddButton( 310, 395, 1209, 1210, 7); - AddHtmlLocalized( 330, 393, 150, 20, 1062411, LabelColor ); // Delete Message - } + AddButton( 310, 395, 1209, 1210, 7); + AddHtmlLocalized( 330, 393, 150, 20, 1062411, LabelColor ); // Delete Message + } - if ( from.AccessLevel >= AccessLevel.GameMaster ) - AddButton( 135, 242, 1209, 1210, 8); // Post props - } - } - } + if ( from.AccessLevel >= AccessLevel.GameMaster ) + AddButton( 135, 242, 1209, 1210, 8); // Post props + } + } + } } diff --git a/Projects/Scripts/Items/Misc/PlayerVendorDeed.cs b/Projects/Scripts/Items/Misc/PlayerVendorDeed.cs index c52bd9d21..b6054b3b3 100644 --- a/Projects/Scripts/Items/Misc/PlayerVendorDeed.cs +++ b/Projects/Scripts/Items/Misc/PlayerVendorDeed.cs @@ -6,11 +6,7 @@ namespace Server.Items public class ContractOfEmployment : Item { [Constructible] - public ContractOfEmployment() : base(0x14F0) - { - Weight = 1.0; - //LootType = LootType.Blessed; - } + public ContractOfEmployment() : base(0x14F0) => Weight = 1.0; public ContractOfEmployment(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Misc/PoolOfAcid.cs b/Projects/Scripts/Items/Misc/PoolOfAcid.cs index bd1d162d4..e3fefdb3c 100644 --- a/Projects/Scripts/Items/Misc/PoolOfAcid.cs +++ b/Projects/Scripts/Items/Misc/PoolOfAcid.cs @@ -4,92 +4,92 @@ using System.Collections.Generic; namespace Server.Items { - public class PoolOfAcid : Item - { - private TimeSpan m_Duration; - private int m_MinDamage; - private int m_MaxDamage; - private DateTime m_Created; - private bool m_Drying; - private Timer m_Timer; + public class PoolOfAcid : Item + { + private TimeSpan m_Duration; + private int m_MinDamage; + private int m_MaxDamage; + private DateTime m_Created; + private bool m_Drying; + private Timer m_Timer; - [Constructible] - public PoolOfAcid() : this( TimeSpan.FromSeconds( 10.0 ), 2, 5 ) - { - } + [Constructible] + public PoolOfAcid() : this( TimeSpan.FromSeconds( 10.0 ), 2, 5 ) + { + } - public override string DefaultName => "a pool of acid"; + public override string DefaultName => "a pool of acid"; - [Constructible] - public PoolOfAcid( TimeSpan duration, int minDamage, int maxDamage ) - : base( 0x122A ) - { - Hue = 0x3F; - Movable = false; + [Constructible] + public PoolOfAcid( TimeSpan duration, int minDamage, int maxDamage ) + : base( 0x122A ) + { + Hue = 0x3F; + Movable = false; - m_MinDamage = minDamage; - m_MaxDamage = maxDamage; - m_Created = DateTime.UtcNow; - m_Duration = duration; + m_MinDamage = minDamage; + m_MaxDamage = maxDamage; + m_Created = DateTime.UtcNow; + m_Duration = duration; - m_Timer = Timer.DelayCall( TimeSpan.Zero, TimeSpan.FromSeconds( 1 ), OnTick ); - } + m_Timer = Timer.DelayCall( TimeSpan.Zero, TimeSpan.FromSeconds( 1 ), OnTick ); + } - public override void OnAfterDelete() - { - m_Timer?.Stop(); - } + public override void OnAfterDelete() + { + m_Timer?.Stop(); + } - private void OnTick() - { - DateTime now = DateTime.UtcNow; - TimeSpan age = now - m_Created; + private void OnTick() + { + DateTime now = DateTime.UtcNow; + TimeSpan age = now - m_Created; - if ( age > m_Duration ) { - Delete(); - } else { - if ( !m_Drying && age > (m_Duration - age) ) - { - m_Drying = true; - ItemID = 0x122B; - } + if ( age > m_Duration ) { + Delete(); + } else { + if ( !m_Drying && age > (m_Duration - age) ) + { + m_Drying = true; + ItemID = 0x122B; + } - List toDamage = new List(); + List toDamage = new List(); - foreach( Mobile m in GetMobilesInRange( 0 ) ) - { - if ( m.Alive && !m.IsDeadBondedPet && (!(m is BaseCreature bc) || bc.Controlled || bc.Summoned) ) - { - toDamage.Add( m ); - } - } + foreach( Mobile m in GetMobilesInRange( 0 ) ) + { + if ( m.Alive && !m.IsDeadBondedPet && (!(m is BaseCreature bc) || bc.Controlled || bc.Summoned) ) + { + toDamage.Add( m ); + } + } - for ( int i = 0; i < toDamage.Count; i++ ) - Damage( toDamage[i] ); - } - } - public override bool OnMoveOver( Mobile m ) - { - Damage( m ); - return true; - } + for ( int i = 0; i < toDamage.Count; i++ ) + Damage( toDamage[i] ); + } + } + public override bool OnMoveOver( Mobile m ) + { + Damage( m ); + return true; + } - public void Damage ( Mobile m ) - { - m.Damage( Utility.RandomMinMax( m_MinDamage, m_MaxDamage ) ); - } + public void Damage ( Mobile m ) + { + m.Damage( Utility.RandomMinMax( m_MinDamage, m_MaxDamage ) ); + } - public PoolOfAcid( Serial serial ) : base( serial ) - { - } + public PoolOfAcid( Serial serial ) : base( serial ) + { + } - public override void Serialize( GenericWriter writer ) - { - //Don't serialize these - } + public override void Serialize( GenericWriter writer ) + { + //Don't serialize these + } - public override void Deserialize( GenericReader reader ) - { - } - } + public override void Deserialize( GenericReader reader ) + { + } + } } diff --git a/Projects/Scripts/Items/Misc/PowerCrystal.cs b/Projects/Scripts/Items/Misc/PowerCrystal.cs index 7c8df6a9b..0e6735210 100644 --- a/Projects/Scripts/Items/Misc/PowerCrystal.cs +++ b/Projects/Scripts/Items/Misc/PowerCrystal.cs @@ -5,10 +5,7 @@ namespace Server.Items public class PowerCrystal : Item { [Constructible] - public PowerCrystal() : base(0x1F1C) - { - Weight = 1.0; - } + public PowerCrystal() : base(0x1F1C) => Weight = 1.0; public PowerCrystal(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Misc/Prism of Light/LuckyDagger.cs b/Projects/Scripts/Items/Misc/Prism of Light/LuckyDagger.cs index c9ba7c3ce..0546473bc 100644 --- a/Projects/Scripts/Items/Misc/Prism of Light/LuckyDagger.cs +++ b/Projects/Scripts/Items/Misc/Prism of Light/LuckyDagger.cs @@ -3,10 +3,7 @@ namespace Server.Items public class LuckyDagger : Item { [Constructible] - public LuckyDagger() : base(0xF52) - { - Hue = 0x8A5; - } + public LuckyDagger() : base(0xF52) => Hue = 0x8A5; public LuckyDagger(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Misc/PromotionalToken.cs b/Projects/Scripts/Items/Misc/PromotionalToken.cs index 4746e18ce..4e584f4bf 100644 --- a/Projects/Scripts/Items/Misc/PromotionalToken.cs +++ b/Projects/Scripts/Items/Misc/PromotionalToken.cs @@ -3,154 +3,154 @@ using Server.Network; namespace Server.Items { - public abstract class PromotionalToken : Item - { - public abstract Item CreateItemFor( Mobile from ); + public abstract class PromotionalToken : Item + { + public abstract Item CreateItemFor( Mobile from ); - public abstract TextDefinition ItemName{ get; } - public abstract TextDefinition ItemReceiveMessage { get; } - public abstract TextDefinition ItemGumpName { get; } + public abstract TextDefinition ItemName{ get; } + public abstract TextDefinition ItemReceiveMessage { get; } + public abstract TextDefinition ItemGumpName { get; } - public PromotionalToken() : base( 0x2AAA ) - { - LootType = LootType.Blessed; - Light = LightType.Circle300; - Weight = 5.0; - } + public PromotionalToken() : base( 0x2AAA ) + { + LootType = LootType.Blessed; + Light = LightType.Circle300; + Weight = 5.0; + } - public PromotionalToken( Serial serial ) : base( serial ) - { - } + public PromotionalToken( Serial serial ) : base( serial ) + { + } - public override void GetProperties( ObjectPropertyList list ) - { - base.GetProperties( list ); + public override void GetProperties( ObjectPropertyList list ) + { + base.GetProperties( list ); - list.Add( 1070998, ItemName.ToString() ); // Use this to redeem
your ~1_PROMO~ - } + list.Add( 1070998, ItemName.ToString() ); // Use this to redeem
your ~1_PROMO~ + } - public override void OnDoubleClick( Mobile from ) - { - if ( !IsChildOf( from.Backpack ) ) - { - from.SendLocalizedMessage( 1062334 ); // This item must be in your backpack to be used. - } - else - { - from.CloseGump(); - from.SendGump( new PromotionalTokenGump( this ) ); - } - } + public override void OnDoubleClick( Mobile from ) + { + if ( !IsChildOf( from.Backpack ) ) + { + from.SendLocalizedMessage( 1062334 ); // This item must be in your backpack to be used. + } + else + { + from.CloseGump(); + from.SendGump( new PromotionalTokenGump( this ) ); + } + } - public override void OnRemoved(IEntity parent) - { - Mobile m = null; + public override void OnRemoved(IEntity parent) + { + Mobile m = null; - if ( parent is Item item ) - m = item.RootParent as Mobile; - else if ( parent is Mobile mobile ) - m = mobile; + if ( parent is Item item ) + m = item.RootParent as Mobile; + else if ( parent is Mobile mobile ) + m = mobile; - m?.CloseGump(); - } + m?.CloseGump(); + } - public override void Serialize( GenericWriter writer ) - { - base.Serialize( writer ); + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); - writer.Write( 0 ); - } + writer.Write( 0 ); + } - public override void Deserialize( GenericReader reader ) - { - base.Deserialize( reader ); + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); - int version = reader.ReadInt(); - } + int version = reader.ReadInt(); + } - public override int LabelNumber => 1070997; // A promotional token + public override int LabelNumber => 1070997; // A promotional token - private class PromotionalTokenGump : Gump - { - private PromotionalToken m_Token; + private class PromotionalTokenGump : Gump + { + private PromotionalToken m_Token; - public PromotionalTokenGump( PromotionalToken token ) : base( 10, 10 ) - { - m_Token = token; + public PromotionalTokenGump( PromotionalToken token ) : base( 10, 10 ) + { + m_Token = token; - AddPage( 0 ); + AddPage( 0 ); - AddBackground( 0, 0, 240, 135, 0x2422 ); - AddHtmlLocalized( 15, 15, 210, 75, 1070972, 0x0, true ); // Click "OKAY" to redeem the following promotional item: - TextDefinition.AddHtmlText( this, 15, 60, 210, 75, m_Token.ItemGumpName, false, false ); + AddBackground( 0, 0, 240, 135, 0x2422 ); + AddHtmlLocalized( 15, 15, 210, 75, 1070972, 0x0, true ); // Click "OKAY" to redeem the following promotional item: + TextDefinition.AddHtmlText( this, 15, 60, 210, 75, m_Token.ItemGumpName, false, false ); - AddButton( 160, 95, 0xF7, 0xF8, 1); //Okay - AddButton( 90, 95, 0xF2, 0xF1, 0); //Cancel - } + AddButton( 160, 95, 0xF7, 0xF8, 1); //Okay + AddButton( 90, 95, 0xF2, 0xF1, 0); //Cancel + } - public override void OnResponse( NetState sender, RelayInfo info ) - { - if ( info.ButtonID != 1 ) - return; + public override void OnResponse( NetState sender, RelayInfo info ) + { + if ( info.ButtonID != 1 ) + return; - Mobile from = sender.Mobile; + Mobile from = sender.Mobile; - if ( !m_Token.IsChildOf( from.Backpack ) ) - { - from.SendLocalizedMessage( 1062334 ); // This item must be in your backpack to be used. - } - else - { - Item i = m_Token.CreateItemFor( from ); + if ( !m_Token.IsChildOf( from.Backpack ) ) + { + from.SendLocalizedMessage( 1062334 ); // This item must be in your backpack to be used. + } + else + { + Item i = m_Token.CreateItemFor( from ); - if ( i != null ) - { - from.BankBox.AddItem( i ); - TextDefinition.SendMessageTo( from, m_Token.ItemReceiveMessage ); - m_Token.Delete(); - } - } - } - } - } + if ( i != null ) + { + from.BankBox.AddItem( i ); + TextDefinition.SendMessageTo( from, m_Token.ItemReceiveMessage ); + m_Token.Delete(); + } + } + } + } + } - public class SoulstoneFragmentToken : PromotionalToken - { + public class SoulstoneFragmentToken : PromotionalToken + { - public override Item CreateItemFor( Mobile from ) - { - if ( from?.Account != null ) - return new SoulstoneFragment( from.Account.ToString() ); + public override Item CreateItemFor( Mobile from ) + { + if ( from?.Account != null ) + return new SoulstoneFragment( from.Account.ToString() ); - return null; - } + return null; + } - public override TextDefinition ItemGumpName => 1070999;//
Soulstone Fragment
- public override TextDefinition ItemName => 1071000;//soulstone fragment - public override TextDefinition ItemReceiveMessage => 1070976; // A soulstone fragment has been created in your bank box. + public override TextDefinition ItemGumpName => 1070999;//
Soulstone Fragment
+ public override TextDefinition ItemName => 1071000;//soulstone fragment + public override TextDefinition ItemReceiveMessage => 1070976; // A soulstone fragment has been created in your bank box. - [Constructible] - public SoulstoneFragmentToken() - { - } + [Constructible] + public SoulstoneFragmentToken() + { + } - public SoulstoneFragmentToken( Serial serial ) : base( serial ) - { - } + public SoulstoneFragmentToken( Serial serial ) : base( serial ) + { + } - public override void Serialize( GenericWriter writer ) - { - base.Serialize( writer ); + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); - writer.Write( 0 ); - } + writer.Write( 0 ); + } - public override void Deserialize( GenericReader reader ) - { - base.Deserialize( reader ); + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); - int version = reader.ReadInt(); - } - } + int version = reader.ReadInt(); + } + } } diff --git a/Projects/Scripts/Items/Misc/Rares.cs b/Projects/Scripts/Items/Misc/Rares.cs index ecf56c624..e27213051 100644 --- a/Projects/Scripts/Items/Misc/Rares.cs +++ b/Projects/Scripts/Items/Misc/Rares.cs @@ -285,10 +285,7 @@ namespace Server.Items public class HorseShoes : Item { [Constructible] - public HorseShoes() : base(0xFB6) - { - Weight = 3.0; - } + public HorseShoes() : base(0xFB6) => Weight = 3.0; public HorseShoes(Serial serial) : base(serial) { @@ -312,10 +309,7 @@ namespace Server.Items public class ForgedMetal : Item { [Constructible] - public ForgedMetal() : base(0xFB8) - { - Weight = 5.0; - } + public ForgedMetal() : base(0xFB8) => Weight = 5.0; public ForgedMetal(Serial serial) : base(serial) { @@ -339,10 +333,7 @@ namespace Server.Items public class Whip : Item { [Constructible] - public Whip() : base(0x166E) - { - Weight = 1.0; - } + public Whip() : base(0x166E) => Weight = 1.0; public Whip(Serial serial) : base(serial) { @@ -366,10 +357,7 @@ namespace Server.Items public class PaintsAndBrush : Item { [Constructible] - public PaintsAndBrush() : base(0xFC1) - { - Weight = 1.0; - } + public PaintsAndBrush() : base(0xFC1) => Weight = 1.0; public PaintsAndBrush(Serial serial) : base(serial) { @@ -393,10 +381,7 @@ namespace Server.Items public class PenAndInk : Item { [Constructible] - public PenAndInk() : base(0xFBF) - { - Weight = 1.0; - } + public PenAndInk() : base(0xFBF) => Weight = 1.0; public PenAndInk(Serial serial) : base(serial) { @@ -420,10 +405,7 @@ namespace Server.Items public class ChiselsNorth : Item { [Constructible] - public ChiselsNorth() : base(0x1026) - { - Weight = 1.0; - } + public ChiselsNorth() : base(0x1026) => Weight = 1.0; public ChiselsNorth(Serial serial) : base(serial) { @@ -447,10 +429,7 @@ namespace Server.Items public class ChiselsWest : Item { [Constructible] - public ChiselsWest() : base(0x1027) - { - Weight = 1.0; - } + public ChiselsWest() : base(0x1027) => Weight = 1.0; public ChiselsWest(Serial serial) : base(serial) { @@ -474,10 +453,7 @@ namespace Server.Items public class DirtyPan : Item { [Constructible] - public DirtyPan() : base(0x9E8) - { - Weight = 1.0; - } + public DirtyPan() : base(0x9E8) => Weight = 1.0; public DirtyPan(Serial serial) : base(serial) { @@ -501,10 +477,7 @@ namespace Server.Items public class DirtySmallRoundPot : Item { [Constructible] - public DirtySmallRoundPot() : base(0x9E7) - { - Weight = 1.0; - } + public DirtySmallRoundPot() : base(0x9E7) => Weight = 1.0; public DirtySmallRoundPot(Serial serial) : base(serial) { @@ -528,10 +501,7 @@ namespace Server.Items public class DirtyPot : Item { [Constructible] - public DirtyPot() : base(0x9E6) - { - Weight = 1.0; - } + public DirtyPot() : base(0x9E6) => Weight = 1.0; public DirtyPot(Serial serial) : base(serial) { @@ -555,10 +525,7 @@ namespace Server.Items public class DirtyRoundPot : Item { [Constructible] - public DirtyRoundPot() : base(0x9DF) - { - Weight = 1.0; - } + public DirtyRoundPot() : base(0x9DF) => Weight = 1.0; public DirtyRoundPot(Serial serial) : base(serial) { @@ -582,10 +549,7 @@ namespace Server.Items public class DirtyFrypan : Item { [Constructible] - public DirtyFrypan() : base(0x9DE) - { - Weight = 1.0; - } + public DirtyFrypan() : base(0x9DE) => Weight = 1.0; public DirtyFrypan(Serial serial) : base(serial) { @@ -609,10 +573,7 @@ namespace Server.Items public class DirtySmallPot : Item { [Constructible] - public DirtySmallPot() : base(0x9DD) - { - Weight = 1.0; - } + public DirtySmallPot() : base(0x9DD) => Weight = 1.0; public DirtySmallPot(Serial serial) : base(serial) { @@ -636,10 +597,7 @@ namespace Server.Items public class DirtyKettle : Item { [Constructible] - public DirtyKettle() : base(0x9DC) - { - Weight = 1.0; - } + public DirtyKettle() : base(0x9DC) => Weight = 1.0; public DirtyKettle(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Misc/Scales.cs b/Projects/Scripts/Items/Misc/Scales.cs index 9c33239e4..dd3aa8b56 100644 --- a/Projects/Scripts/Items/Misc/Scales.cs +++ b/Projects/Scripts/Items/Misc/Scales.cs @@ -5,10 +5,7 @@ namespace Server.Items public class Scales : Item { [Constructible] - public Scales() : base(0x1852) - { - Weight = 4.0; - } + public Scales() : base(0x1852) => Weight = 4.0; public Scales(Serial serial) : base(serial) { @@ -38,10 +35,7 @@ namespace Server.Items { private Scales m_Item; - public InternalTarget(Scales item) : base(1, false, TargetFlags.None) - { - m_Item = item; - } + public InternalTarget(Scales item) : base(1, false, TargetFlags.None) => m_Item = item; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Items/Misc/Static.cs b/Projects/Scripts/Items/Misc/Static.cs index bac253619..8e8263c17 100644 --- a/Projects/Scripts/Items/Misc/Static.cs +++ b/Projects/Scripts/Items/Misc/Static.cs @@ -2,16 +2,10 @@ namespace Server.Items { public class Static : Item { - public Static() : base(0x80) - { - Movable = false; - } + public Static() : base(0x80) => Movable = false; [Constructible] - public Static(int itemID) : base(itemID) - { - Movable = false; - } + public Static(int itemID) : base(itemID) => Movable = false; [Constructible] public Static(int itemID, int count) : this(Utility.Random(itemID, count)) @@ -50,10 +44,7 @@ namespace Server.Items } [Constructible] - public LocalizedStatic(int itemID, int labelNumber) : base(itemID) - { - m_LabelNumber = labelNumber; - } + public LocalizedStatic(int itemID, int labelNumber) : base(itemID) => m_LabelNumber = labelNumber; public LocalizedStatic(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Misc/Teleporter.cs b/Projects/Scripts/Items/Misc/Teleporter.cs index bffd28486..bf922bff7 100644 --- a/Projects/Scripts/Items/Misc/Teleporter.cs +++ b/Projects/Scripts/Items/Misc/Teleporter.cs @@ -548,10 +548,7 @@ namespace Server.Items base.DoTeleport(m); } - public override bool OnMoveOver(Mobile m) - { - return true; - } + public override bool OnMoveOver(Mobile m) => true; public override void GetProperties(ObjectPropertyList list) { @@ -761,10 +758,8 @@ namespace Server.Items [Constructible] public TimeoutTeleporter(Point3D pointDest, Map mapDest = null, bool creatures = false) - : base(pointDest, mapDest, creatures) - { + : base(pointDest, mapDest, creatures) => m_Teleporting = new Dictionary(); - } public TimeoutTeleporter(Serial serial) : base(serial) @@ -1151,10 +1146,7 @@ namespace Server.Items m_Flags = (ConditionFlag)reader.ReadInt(); } - protected bool GetFlag(ConditionFlag flag) - { - return (m_Flags & flag) != 0; - } + protected bool GetFlag(ConditionFlag flag) => (m_Flags & flag) != 0; protected void SetFlag(ConditionFlag flag, bool value) { diff --git a/Projects/Scripts/Items/Misc/The Citadel/DragonFlameSectBadge.cs b/Projects/Scripts/Items/Misc/The Citadel/DragonFlameSectBadge.cs index 26161790b..f62b2c332 100644 --- a/Projects/Scripts/Items/Misc/The Citadel/DragonFlameSectBadge.cs +++ b/Projects/Scripts/Items/Misc/The Citadel/DragonFlameSectBadge.cs @@ -3,10 +3,7 @@ namespace Server.Items public class DragonFlameSectBadge : Item { [Constructible] - public DragonFlameSectBadge() : base(0x23E) - { - LootType = LootType.Blessed; - } + public DragonFlameSectBadge() : base(0x23E) => LootType = LootType.Blessed; public DragonFlameSectBadge(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Misc/The Citadel/OrdersFromMinax.cs b/Projects/Scripts/Items/Misc/The Citadel/OrdersFromMinax.cs index 020fe0383..1934408ea 100644 --- a/Projects/Scripts/Items/Misc/The Citadel/OrdersFromMinax.cs +++ b/Projects/Scripts/Items/Misc/The Citadel/OrdersFromMinax.cs @@ -3,10 +3,7 @@ namespace Server.Items public class OrdersFromMinax : Item { [Constructible] - public OrdersFromMinax() : base(0x2279) - { - LootType = LootType.Blessed; - } + public OrdersFromMinax() : base(0x2279) => LootType = LootType.Blessed; public OrdersFromMinax(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Misc/The Citadel/SerpentFangSectBadge.cs b/Projects/Scripts/Items/Misc/The Citadel/SerpentFangSectBadge.cs index ab7068d86..c56c10f05 100644 --- a/Projects/Scripts/Items/Misc/The Citadel/SerpentFangSectBadge.cs +++ b/Projects/Scripts/Items/Misc/The Citadel/SerpentFangSectBadge.cs @@ -3,10 +3,7 @@ namespace Server.Items public class SerpentFangSectBadge : Item { [Constructible] - public SerpentFangSectBadge() : base(0x23C) - { - LootType = LootType.Blessed; - } + public SerpentFangSectBadge() : base(0x23C) => LootType = LootType.Blessed; public SerpentFangSectBadge(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Misc/The Citadel/TigerClawSectBadge.cs b/Projects/Scripts/Items/Misc/The Citadel/TigerClawSectBadge.cs index fc3b855c9..2f5a29e3b 100644 --- a/Projects/Scripts/Items/Misc/The Citadel/TigerClawSectBadge.cs +++ b/Projects/Scripts/Items/Misc/The Citadel/TigerClawSectBadge.cs @@ -3,10 +3,7 @@ namespace Server.Items public class TigerClawSectBadge : Item { [Constructible] - public TigerClawSectBadge() : base(0x23D) - { - LootType = LootType.Blessed; - } + public TigerClawSectBadge() : base(0x23D) => LootType = LootType.Blessed; public TigerClawSectBadge(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Misc/TrashChest.cs b/Projects/Scripts/Items/Misc/TrashChest.cs index fcfa4bbf4..ee7cc902b 100644 --- a/Projects/Scripts/Items/Misc/TrashChest.cs +++ b/Projects/Scripts/Items/Misc/TrashChest.cs @@ -6,10 +6,7 @@ namespace Server.Items public class TrashChest : Container { [Constructible] - public TrashChest() : base(0xE41) - { - Movable = false; - } + public TrashChest() : base(0xE41) => Movable = false; public TrashChest(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Misc/WarningItem.cs b/Projects/Scripts/Items/Misc/WarningItem.cs index dbf60eeea..4493776ac 100644 --- a/Projects/Scripts/Items/Misc/WarningItem.cs +++ b/Projects/Scripts/Items/Misc/WarningItem.cs @@ -157,16 +157,10 @@ namespace Server.Items public class HintItem : WarningItem { [Constructible] - public HintItem(int itemID, int range, int warning, int hint) : base(itemID, range, warning) - { - HintNumber = hint; - } + public HintItem(int itemID, int range, int warning, int hint) : base(itemID, range, warning) => HintNumber = hint; [Constructible] - public HintItem(int itemID, int range, string warning, string hint) : base(itemID, range, warning) - { - HintString = hint; - } + public HintItem(int itemID, int range, string warning, string hint) : base(itemID, range, warning) => HintString = hint; public HintItem(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Misc/Waypoint.cs b/Projects/Scripts/Items/Misc/Waypoint.cs index 8046e6242..a0cc0d02d 100644 --- a/Projects/Scripts/Items/Misc/Waypoint.cs +++ b/Projects/Scripts/Items/Misc/Waypoint.cs @@ -96,10 +96,7 @@ namespace Server.Items { private WayPoint m_Point; - public NextPointTarget(WayPoint pt) : base(-1, false, TargetFlags.None) - { - m_Point = pt; - } + public NextPointTarget(WayPoint pt) : base(-1, false, TargetFlags.None) => m_Point = pt; protected override void OnTarget(Mobile from, object target) { @@ -114,10 +111,7 @@ namespace Server.Items { private WayPoint m_Last; - public WayPointSeqTarget(WayPoint last) : base(-1, true, TargetFlags.None) - { - m_Last = last; - } + public WayPointSeqTarget(WayPoint last) : base(-1, true, TargetFlags.None) => m_Last = last; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Items/Misc/WindChimes.cs b/Projects/Scripts/Items/Misc/WindChimes.cs index 30a70a429..d76d8d7b5 100644 --- a/Projects/Scripts/Items/Misc/WindChimes.cs +++ b/Projects/Scripts/Items/Misc/WindChimes.cs @@ -50,10 +50,7 @@ namespace Server.Items list.Add(502696); // turned off } - public bool IsOwner(Mobile mob) - { - return BaseHouse.FindHouseAt(this)?.IsOwner(mob) == true; - } + public bool IsOwner(Mobile mob) => BaseHouse.FindHouseAt(this)?.IsOwner(mob) == true; public override void OnDoubleClick(Mobile from) { diff --git a/Projects/Scripts/Items/New Haven Quest Rewards/WalkersLeggings.cs b/Projects/Scripts/Items/New Haven Quest Rewards/WalkersLeggings.cs index 610599b3e..f3bae83b2 100644 --- a/Projects/Scripts/Items/New Haven Quest Rewards/WalkersLeggings.cs +++ b/Projects/Scripts/Items/New Haven Quest Rewards/WalkersLeggings.cs @@ -3,10 +3,7 @@ namespace Server.Items public class WalkersLeggings : LeatherNinjaPants { [Constructible] - public WalkersLeggings() - { - LootType = LootType.Blessed; - } + public WalkersLeggings() => LootType = LootType.Blessed; public WalkersLeggings(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/PlantsFlowers/Potted/EmptyPots.cs b/Projects/Scripts/Items/PlantsFlowers/Potted/EmptyPots.cs index 59063c847..2298b8b19 100644 --- a/Projects/Scripts/Items/PlantsFlowers/Potted/EmptyPots.cs +++ b/Projects/Scripts/Items/PlantsFlowers/Potted/EmptyPots.cs @@ -3,10 +3,7 @@ namespace Server.Items public class SmallEmptyPot : Item { [Constructible] - public SmallEmptyPot() : base(0x11C6) - { - Weight = 100; - } + public SmallEmptyPot() : base(0x11C6) => Weight = 100; public SmallEmptyPot(Serial serial) : base(serial) { @@ -30,10 +27,7 @@ namespace Server.Items public class LargeEmptyPot : Item { [Constructible] - public LargeEmptyPot() : base(0x11C7) - { - Weight = 6; - } + public LargeEmptyPot() : base(0x11C7) => Weight = 6; public LargeEmptyPot(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/PlantsFlowers/Potted/PottedCactus.cs b/Projects/Scripts/Items/PlantsFlowers/Potted/PottedCactus.cs index a926f2aec..4611e4f55 100644 --- a/Projects/Scripts/Items/PlantsFlowers/Potted/PottedCactus.cs +++ b/Projects/Scripts/Items/PlantsFlowers/Potted/PottedCactus.cs @@ -3,10 +3,7 @@ namespace Server.Items public class PottedCactus : Item { [Constructible] - public PottedCactus() : base(0x1E0F) - { - Weight = 100; - } + public PottedCactus() : base(0x1E0F) => Weight = 100; public PottedCactus(Serial serial) : base(serial) { @@ -30,10 +27,7 @@ namespace Server.Items public class PottedCactus1 : Item { [Constructible] - public PottedCactus1() : base(0x1E10) - { - Weight = 100; - } + public PottedCactus1() : base(0x1E10) => Weight = 100; public PottedCactus1(Serial serial) : base(serial) { @@ -57,10 +51,7 @@ namespace Server.Items public class PottedCactus2 : Item { [Constructible] - public PottedCactus2() : base(0x1E11) - { - Weight = 100; - } + public PottedCactus2() : base(0x1E11) => Weight = 100; public PottedCactus2(Serial serial) : base(serial) { @@ -84,10 +75,7 @@ namespace Server.Items public class PottedCactus3 : Item { [Constructible] - public PottedCactus3() : base(0x1E12) - { - Weight = 100; - } + public PottedCactus3() : base(0x1E12) => Weight = 100; public PottedCactus3(Serial serial) : base(serial) { @@ -111,10 +99,7 @@ namespace Server.Items public class PottedCactus4 : Item { [Constructible] - public PottedCactus4() : base(0x1E13) - { - Weight = 100; - } + public PottedCactus4() : base(0x1E13) => Weight = 100; public PottedCactus4(Serial serial) : base(serial) { @@ -138,10 +123,7 @@ namespace Server.Items public class PottedCactus5 : Item { [Constructible] - public PottedCactus5() : base(0x1E14) - { - Weight = 100; - } + public PottedCactus5() : base(0x1E14) => Weight = 100; public PottedCactus5(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/PlantsFlowers/Potted/PottedPlants.cs b/Projects/Scripts/Items/PlantsFlowers/Potted/PottedPlants.cs index 0272c96a3..4309c5377 100644 --- a/Projects/Scripts/Items/PlantsFlowers/Potted/PottedPlants.cs +++ b/Projects/Scripts/Items/PlantsFlowers/Potted/PottedPlants.cs @@ -3,10 +3,7 @@ namespace Server.Items public class PottedPlant : Item { [Constructible] - public PottedPlant() : base(0x11CA) - { - Weight = 100; - } + public PottedPlant() : base(0x11CA) => Weight = 100; public PottedPlant(Serial serial) : base(serial) { @@ -30,10 +27,7 @@ namespace Server.Items public class PottedPlant1 : Item { [Constructible] - public PottedPlant1() : base(0x11CB) - { - Weight = 100; - } + public PottedPlant1() : base(0x11CB) => Weight = 100; public PottedPlant1(Serial serial) : base(serial) { @@ -57,10 +51,7 @@ namespace Server.Items public class PottedPlant2 : Item { [Constructible] - public PottedPlant2() : base(0x11CC) - { - Weight = 100; - } + public PottedPlant2() : base(0x11CC) => Weight = 100; public PottedPlant2(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/PlantsFlowers/Potted/PottedTrees.cs b/Projects/Scripts/Items/PlantsFlowers/Potted/PottedTrees.cs index 5de0dbe13..1c3411039 100644 --- a/Projects/Scripts/Items/PlantsFlowers/Potted/PottedTrees.cs +++ b/Projects/Scripts/Items/PlantsFlowers/Potted/PottedTrees.cs @@ -3,10 +3,7 @@ namespace Server.Items public class PottedTree : Item { [Constructible] - public PottedTree() : base(0x11C8) - { - Weight = 100; - } + public PottedTree() : base(0x11C8) => Weight = 100; public PottedTree(Serial serial) : base(serial) { @@ -30,10 +27,7 @@ namespace Server.Items public class PottedTree1 : Item { [Constructible] - public PottedTree1() : base(0x11C9) - { - Weight = 100; - } + public PottedTree1() : base(0x11C9) => Weight = 100; public PottedTree1(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Quivers/BaseQuiver.cs b/Projects/Scripts/Items/Quivers/BaseQuiver.cs index cded38db7..b3a4f691e 100644 --- a/Projects/Scripts/Items/Quivers/BaseQuiver.cs +++ b/Projects/Scripts/Items/Quivers/BaseQuiver.cs @@ -346,10 +346,7 @@ namespace Server.Items flags |= toSet; } - private static bool GetSaveFlag(SaveFlag flags, SaveFlag toGet) - { - return (flags & toGet) != 0; - } + private static bool GetSaveFlag(SaveFlag flags, SaveFlag toGet) => (flags & toGet) != 0; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Items/Quivers/ElvenQuiver.cs b/Projects/Scripts/Items/Quivers/ElvenQuiver.cs index 8fa899b54..8c13089f1 100644 --- a/Projects/Scripts/Items/Quivers/ElvenQuiver.cs +++ b/Projects/Scripts/Items/Quivers/ElvenQuiver.cs @@ -4,10 +4,7 @@ namespace Server.Items public class ElvenQuiver : BaseQuiver { [Constructible] - public ElvenQuiver() - { - WeightReduction = 30; - } + public ElvenQuiver() => WeightReduction = 30; public ElvenQuiver(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Quivers/QuiverOfBlight.cs b/Projects/Scripts/Items/Quivers/QuiverOfBlight.cs index 07b2b9706..937b15077 100644 --- a/Projects/Scripts/Items/Quivers/QuiverOfBlight.cs +++ b/Projects/Scripts/Items/Quivers/QuiverOfBlight.cs @@ -3,10 +3,7 @@ namespace Server.Items public class QuiverOfBlight : ElvenQuiver { [Constructible] - public QuiverOfBlight() - { - Hue = 0x4F3; - } + public QuiverOfBlight() => Hue = 0x4F3; public QuiverOfBlight(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Quivers/QuiverOfFire.cs b/Projects/Scripts/Items/Quivers/QuiverOfFire.cs index f191665b3..81e082da6 100644 --- a/Projects/Scripts/Items/Quivers/QuiverOfFire.cs +++ b/Projects/Scripts/Items/Quivers/QuiverOfFire.cs @@ -3,10 +3,7 @@ namespace Server.Items public class QuiverOfFire : ElvenQuiver { [Constructible] - public QuiverOfFire() - { - Hue = 0x4E7; - } + public QuiverOfFire() => Hue = 0x4E7; public QuiverOfFire(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Quivers/QuiverOfIce.cs b/Projects/Scripts/Items/Quivers/QuiverOfIce.cs index 66a95e8f2..011563fbf 100644 --- a/Projects/Scripts/Items/Quivers/QuiverOfIce.cs +++ b/Projects/Scripts/Items/Quivers/QuiverOfIce.cs @@ -3,10 +3,7 @@ namespace Server.Items public class QuiverOfIce : ElvenQuiver { [Constructible] - public QuiverOfIce() - { - Hue = 0x4ED; - } + public QuiverOfIce() => Hue = 0x4ED; public QuiverOfIce(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Quivers/QuiverOfLightning.cs b/Projects/Scripts/Items/Quivers/QuiverOfLightning.cs index 4039b8c0e..ea8a9135c 100644 --- a/Projects/Scripts/Items/Quivers/QuiverOfLightning.cs +++ b/Projects/Scripts/Items/Quivers/QuiverOfLightning.cs @@ -3,10 +3,7 @@ namespace Server.Items public class QuiverOfLightning : ElvenQuiver { [Constructible] - public QuiverOfLightning() - { - Hue = 0x4F9; - } + public QuiverOfLightning() => Hue = 0x4F9; public QuiverOfLightning(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Resources/Blacksmithing/Ore.cs b/Projects/Scripts/Items/Resources/Blacksmithing/Ore.cs index b97d59d31..1fabf6123 100644 --- a/Projects/Scripts/Items/Resources/Blacksmithing/Ore.cs +++ b/Projects/Scripts/Items/Resources/Blacksmithing/Ore.cs @@ -124,11 +124,9 @@ namespace Server.Items return 0x19B9; } - public override bool CanStackWith(Item dropped) - { - return dropped.Stackable && Stackable && dropped.GetType() == GetType() && dropped.Hue == Hue && - dropped.Name == Name && dropped.Amount + Amount <= 60000 && dropped != this; - } + public override bool CanStackWith(Item dropped) => + dropped.Stackable && Stackable && dropped.GetType() == GetType() && dropped.Hue == Hue && + dropped.Name == Name && dropped.Amount + Amount <= 60000 && dropped != this; public override void AddNameProperty(ObjectPropertyList list) { @@ -178,10 +176,7 @@ namespace Server.Items { private BaseOre m_Ore; - public InternalTarget(BaseOre ore) : base(2, false, TargetFlags.None) - { - m_Ore = ore; - } + public InternalTarget(BaseOre ore) : base(2, false, TargetFlags.None) => m_Ore = ore; private bool IsForge(object obj) { @@ -447,10 +442,7 @@ namespace Server.Items int version = reader.ReadInt(); } - public override BaseIngot GetIngot() - { - return new IronIngot(); - } + public override BaseIngot GetIngot() => new IronIngot(); } public class DullCopperOre : BaseOre @@ -478,10 +470,7 @@ namespace Server.Items int version = reader.ReadInt(); } - public override BaseIngot GetIngot() - { - return new DullCopperIngot(); - } + public override BaseIngot GetIngot() => new DullCopperIngot(); } public class ShadowIronOre : BaseOre @@ -509,10 +498,7 @@ namespace Server.Items int version = reader.ReadInt(); } - public override BaseIngot GetIngot() - { - return new ShadowIronIngot(); - } + public override BaseIngot GetIngot() => new ShadowIronIngot(); } public class CopperOre : BaseOre @@ -540,10 +526,7 @@ namespace Server.Items int version = reader.ReadInt(); } - public override BaseIngot GetIngot() - { - return new CopperIngot(); - } + public override BaseIngot GetIngot() => new CopperIngot(); } public class BronzeOre : BaseOre @@ -571,10 +554,7 @@ namespace Server.Items int version = reader.ReadInt(); } - public override BaseIngot GetIngot() - { - return new BronzeIngot(); - } + public override BaseIngot GetIngot() => new BronzeIngot(); } public class GoldOre : BaseOre @@ -602,10 +582,7 @@ namespace Server.Items int version = reader.ReadInt(); } - public override BaseIngot GetIngot() - { - return new GoldIngot(); - } + public override BaseIngot GetIngot() => new GoldIngot(); } public class AgapiteOre : BaseOre @@ -633,10 +610,7 @@ namespace Server.Items int version = reader.ReadInt(); } - public override BaseIngot GetIngot() - { - return new AgapiteIngot(); - } + public override BaseIngot GetIngot() => new AgapiteIngot(); } public class VeriteOre : BaseOre @@ -664,10 +638,7 @@ namespace Server.Items int version = reader.ReadInt(); } - public override BaseIngot GetIngot() - { - return new VeriteIngot(); - } + public override BaseIngot GetIngot() => new VeriteIngot(); } public class ValoriteOre : BaseOre @@ -695,9 +666,6 @@ namespace Server.Items int version = reader.ReadInt(); } - public override BaseIngot GetIngot() - { - return new ValoriteIngot(); - } + public override BaseIngot GetIngot() => new ValoriteIngot(); } } diff --git a/Projects/Scripts/Items/Resources/Fishing/MagicFish.cs b/Projects/Scripts/Items/Resources/Fishing/MagicFish.cs index 84eaf0db4..81571b072 100644 --- a/Projects/Scripts/Items/Resources/Fishing/MagicFish.cs +++ b/Projects/Scripts/Items/Resources/Fishing/MagicFish.cs @@ -6,10 +6,7 @@ namespace Server.Items { public abstract class BaseMagicFish : Item { - public BaseMagicFish(int hue) : base(0xDD6) - { - Hue = hue; - } + public BaseMagicFish(int hue) : base(0xDD6) => Hue = hue; public BaseMagicFish(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Resources/Tailor/Cotton.cs b/Projects/Scripts/Items/Resources/Tailor/Cotton.cs index 8809a69b5..75f5b33b2 100644 --- a/Projects/Scripts/Items/Resources/Tailor/Cotton.cs +++ b/Projects/Scripts/Items/Resources/Tailor/Cotton.cs @@ -66,10 +66,7 @@ namespace Server.Items { private Cotton m_Cotton; - public PickWheelTarget(Cotton cotton) : base(3, false, TargetFlags.None) - { - m_Cotton = cotton; - } + public PickWheelTarget(Cotton cotton) : base(3, false, TargetFlags.None) => m_Cotton = cotton; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Items/Resources/Tailor/Flax.cs b/Projects/Scripts/Items/Resources/Tailor/Flax.cs index db5685f9e..a358960c6 100644 --- a/Projects/Scripts/Items/Resources/Tailor/Flax.cs +++ b/Projects/Scripts/Items/Resources/Tailor/Flax.cs @@ -56,10 +56,7 @@ namespace Server.Items { private Flax m_Flax; - public PickWheelTarget(Flax flax) : base(3, false, TargetFlags.None) - { - m_Flax = flax; - } + public PickWheelTarget(Flax flax) : base(3, false, TargetFlags.None) => m_Flax = flax; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Items/Resources/Tailor/Wool.cs b/Projects/Scripts/Items/Resources/Tailor/Wool.cs index fa701e07e..40ab13c6f 100644 --- a/Projects/Scripts/Items/Resources/Tailor/Wool.cs +++ b/Projects/Scripts/Items/Resources/Tailor/Wool.cs @@ -66,10 +66,7 @@ namespace Server.Items { private Wool m_Wool; - public PickWheelTarget(Wool wool) : base(3, false, TargetFlags.None) - { - m_Wool = wool; - } + public PickWheelTarget(Wool wool) : base(3, false, TargetFlags.None) => m_Wool = wool; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Items/Resources/Tailor/YarnsAndThreads.cs b/Projects/Scripts/Items/Resources/Tailor/YarnsAndThreads.cs index 0d2ab0268..0a9944925 100644 --- a/Projects/Scripts/Items/Resources/Tailor/YarnsAndThreads.cs +++ b/Projects/Scripts/Items/Resources/Tailor/YarnsAndThreads.cs @@ -56,10 +56,7 @@ namespace Server.Items { private BaseClothMaterial m_Material; - public PickLoomTarget(BaseClothMaterial material) : base(3, false, TargetFlags.None) - { - m_Material = material; - } + public PickLoomTarget(BaseClothMaterial material) : base(3, false, TargetFlags.None) => m_Material = material; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Items/Shields/BronzeShield.cs b/Projects/Scripts/Items/Shields/BronzeShield.cs index fd0b45b2d..32595bd8d 100644 --- a/Projects/Scripts/Items/Shields/BronzeShield.cs +++ b/Projects/Scripts/Items/Shields/BronzeShield.cs @@ -3,10 +3,7 @@ namespace Server.Items public class BronzeShield : BaseShield { [Constructible] - public BronzeShield() : base(0x1B72) - { - Weight = 6.0; - } + public BronzeShield() : base(0x1B72) => Weight = 6.0; public BronzeShield(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Shields/Buckler.cs b/Projects/Scripts/Items/Shields/Buckler.cs index 5300c771e..6d5e84ac5 100644 --- a/Projects/Scripts/Items/Shields/Buckler.cs +++ b/Projects/Scripts/Items/Shields/Buckler.cs @@ -3,10 +3,7 @@ namespace Server.Items public class Buckler : BaseShield { [Constructible] - public Buckler() : base(0x1B73) - { - Weight = 5.0; - } + public Buckler() : base(0x1B73) => Weight = 5.0; public Buckler(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Shields/ChaosShield.cs b/Projects/Scripts/Items/Shields/ChaosShield.cs index 97e3a3aac..94e10a69f 100644 --- a/Projects/Scripts/Items/Shields/ChaosShield.cs +++ b/Projects/Scripts/Items/Shields/ChaosShield.cs @@ -44,10 +44,7 @@ namespace Server.Items writer.Write(0); //version } - public override bool OnEquip(Mobile from) - { - return Validate(from) && base.OnEquip(from); - } + public override bool OnEquip(Mobile from) => Validate(from) && base.OnEquip(from); public override void OnSingleClick(Mobile from) { diff --git a/Projects/Scripts/Items/Shields/HeaterShield.cs b/Projects/Scripts/Items/Shields/HeaterShield.cs index c9e6726fb..0f652de04 100644 --- a/Projects/Scripts/Items/Shields/HeaterShield.cs +++ b/Projects/Scripts/Items/Shields/HeaterShield.cs @@ -3,10 +3,7 @@ namespace Server.Items public class HeaterShield : BaseShield { [Constructible] - public HeaterShield() : base(0x1B76) - { - Weight = 8.0; - } + public HeaterShield() : base(0x1B76) => Weight = 8.0; public HeaterShield(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Shields/MetalKiteShield.cs b/Projects/Scripts/Items/Shields/MetalKiteShield.cs index 0e7b828e3..28664f67f 100644 --- a/Projects/Scripts/Items/Shields/MetalKiteShield.cs +++ b/Projects/Scripts/Items/Shields/MetalKiteShield.cs @@ -3,10 +3,7 @@ namespace Server.Items public class MetalKiteShield : BaseShield, IDyable { [Constructible] - public MetalKiteShield() : base(0x1B74) - { - Weight = 7.0; - } + public MetalKiteShield() : base(0x1B74) => Weight = 7.0; public MetalKiteShield(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Shields/MetalShield.cs b/Projects/Scripts/Items/Shields/MetalShield.cs index f27d06cd2..82a560125 100644 --- a/Projects/Scripts/Items/Shields/MetalShield.cs +++ b/Projects/Scripts/Items/Shields/MetalShield.cs @@ -3,10 +3,7 @@ namespace Server.Items public class MetalShield : BaseShield { [Constructible] - public MetalShield() : base(0x1B7B) - { - Weight = 6.0; - } + public MetalShield() : base(0x1B7B) => Weight = 6.0; public MetalShield(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Shields/OrderShield.cs b/Projects/Scripts/Items/Shields/OrderShield.cs index eb864f9c1..a560814b4 100644 --- a/Projects/Scripts/Items/Shields/OrderShield.cs +++ b/Projects/Scripts/Items/Shields/OrderShield.cs @@ -47,10 +47,7 @@ namespace Server.Items writer.Write(0); //version } - public override bool OnEquip(Mobile from) - { - return Validate(from) && base.OnEquip(from); - } + public override bool OnEquip(Mobile from) => Validate(from) && base.OnEquip(from); public override void OnSingleClick(Mobile from) { diff --git a/Projects/Scripts/Items/Shields/WoodenKiteShield.cs b/Projects/Scripts/Items/Shields/WoodenKiteShield.cs index 310c074c4..de5bd402e 100644 --- a/Projects/Scripts/Items/Shields/WoodenKiteShield.cs +++ b/Projects/Scripts/Items/Shields/WoodenKiteShield.cs @@ -3,10 +3,7 @@ namespace Server.Items public class WoodenKiteShield : BaseShield { [Constructible] - public WoodenKiteShield() : base(0x1B79) - { - Weight = 5.0; - } + public WoodenKiteShield() : base(0x1B79) => Weight = 5.0; public WoodenKiteShield(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Shields/WoodenShield.cs b/Projects/Scripts/Items/Shields/WoodenShield.cs index 079175f84..b2637c476 100644 --- a/Projects/Scripts/Items/Shields/WoodenShield.cs +++ b/Projects/Scripts/Items/Shields/WoodenShield.cs @@ -3,10 +3,7 @@ namespace Server.Items public class WoodenShield : BaseShield { [Constructible] - public WoodenShield() : base(0x1B7A) - { - Weight = 5.0; - } + public WoodenShield() : base(0x1B7A) => Weight = 5.0; public WoodenShield(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Blacksmith Items/Misc/AnvilForge.cs b/Projects/Scripts/Items/Skill Items/Blacksmith Items/Misc/AnvilForge.cs index 71d4416f9..51b2e1af9 100644 --- a/Projects/Scripts/Items/Skill Items/Blacksmith Items/Misc/AnvilForge.cs +++ b/Projects/Scripts/Items/Skill Items/Blacksmith Items/Misc/AnvilForge.cs @@ -7,10 +7,7 @@ namespace Server.Items public class Anvil : Item { [Constructible] - public Anvil() : base(0xFAF) - { - Movable = false; - } + public Anvil() : base(0xFAF) => Movable = false; public Anvil(Serial serial) : base(serial) { @@ -35,10 +32,7 @@ namespace Server.Items public class Forge : Item { [Constructible] - public Forge() : base(0xFB1) - { - Movable = false; - } + public Forge() : base(0xFB1) => Movable = false; public Forge(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Camping/Bedroll.cs b/Projects/Scripts/Items/Skill Items/Camping/Bedroll.cs index d19183d1e..8d3e317d6 100644 --- a/Projects/Scripts/Items/Skill Items/Camping/Bedroll.cs +++ b/Projects/Scripts/Items/Skill Items/Camping/Bedroll.cs @@ -9,10 +9,7 @@ namespace Server.Items public class Bedroll : Item { [Constructible] - public Bedroll() : base(0xA57) - { - Weight = 5.0; - } + public Bedroll() : base(0xA57) => Weight = 5.0; public Bedroll(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Carpenter Items/TaxidermyKit.cs b/Projects/Scripts/Items/Skill Items/Carpenter Items/TaxidermyKit.cs index d92e40725..fc59ebbd2 100644 --- a/Projects/Scripts/Items/Skill Items/Carpenter Items/TaxidermyKit.cs +++ b/Projects/Scripts/Items/Skill Items/Carpenter Items/TaxidermyKit.cs @@ -20,10 +20,7 @@ namespace Server.Items }; [Constructible] - public TaxidermyKit() : base(0x1EBA) - { - Weight = 1.0; - } + public TaxidermyKit() : base(0x1EBA) => Weight = 1.0; public TaxidermyKit(Serial serial) : base(serial) { @@ -86,10 +83,7 @@ namespace Server.Items { private TaxidermyKit m_Kit; - public CorpseTarget(TaxidermyKit kit) : base(3, false, TargetFlags.None) - { - m_Kit = kit; - } + public CorpseTarget(TaxidermyKit kit) : base(3, false, TargetFlags.None) => m_Kit = kit; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Items/Skill Items/Fishing/Misc/SOS.cs b/Projects/Scripts/Items/Skill Items/Fishing/Misc/SOS.cs index 50c127f7f..2b3639fc9 100644 --- a/Projects/Scripts/Items/Skill Items/Fishing/Misc/SOS.cs +++ b/Projects/Scripts/Items/Skill Items/Fishing/Misc/SOS.cs @@ -224,28 +224,6 @@ namespace Server.Items return water; } -#if false - private class MessageGump : Gump - { - public MessageGump( MessageEntry entry, Map map, Point3D loc ) : base( (640 - entry.Width) / 2, (480 - entry.Height) / 2 ) - { - int xLong = 0, yLat = 0; - int xMins = 0, yMins = 0; - bool xEast = false, ySouth = false; - string fmt; - - if ( Sextant.Format( loc, map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth ) ) - fmt = - String.Format( "{0}°{1}'{2},{3}°{4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W" ); - else - fmt = "?????"; - - AddPage( 0 ); - AddBackground( 0, 0, entry.Width, entry.Height, 2520 ); - AddHtml( 38, 38, entry.Width - 83, entry.Height - 86, String.Format( entry.Message, fmt ), false, false ); - } - } -#else private class MessageGump : Gump { public MessageGump(MessageEntry entry, Map map, Point3D loc) : base(150, 50) @@ -277,7 +255,6 @@ namespace Server.Items AddHtmlLocalized(70, 265, 100, 20, 1011036); // OKAY } } -#endif private class MessageEntry { diff --git a/Projects/Scripts/Items/Skill Items/Fishing/Misc/Sextant.cs b/Projects/Scripts/Items/Skill Items/Fishing/Misc/Sextant.cs index d2326362d..16bddb8c4 100644 --- a/Projects/Scripts/Items/Skill Items/Fishing/Misc/Sextant.cs +++ b/Projects/Scripts/Items/Skill Items/Fishing/Misc/Sextant.cs @@ -5,10 +5,7 @@ namespace Server.Items public class Sextant : Item { [Constructible] - public Sextant() : base(0x1058) - { - Weight = 2.0; - } + public Sextant() : base(0x1058) => Weight = 2.0; public Sextant(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Fishing/Misc/SpecialFishingNet.cs b/Projects/Scripts/Items/Skill Items/Fishing/Misc/SpecialFishingNet.cs index 0b9e50b33..e63840cd1 100644 --- a/Projects/Scripts/Items/Skill Items/Fishing/Misc/SpecialFishingNet.cs +++ b/Projects/Scripts/Items/Skill Items/Fishing/Misc/SpecialFishingNet.cs @@ -380,10 +380,7 @@ namespace Server.Items public class FabledFishingNet : SpecialFishingNet { [Constructible] - public FabledFishingNet() - { - Hue = 0x481; - } + public FabledFishingNet() => Hue = 0x481; public FabledFishingNet(Serial serial) : base(serial) { @@ -395,10 +392,7 @@ namespace Server.Items { } - protected override int GetSpawnCount() - { - return base.GetSpawnCount() + 4; - } + protected override int GetSpawnCount() => base.GetSpawnCount() + 4; protected override void FinishEffect(Point3D p, Map map, Mobile from) { diff --git a/Projects/Scripts/Items/Skill Items/Harvest Tools/ProspectorsTool.cs b/Projects/Scripts/Items/Skill Items/Harvest Tools/ProspectorsTool.cs index 8a7c12968..b04160279 100644 --- a/Projects/Scripts/Items/Skill Items/Harvest Tools/ProspectorsTool.cs +++ b/Projects/Scripts/Items/Skill Items/Harvest Tools/ProspectorsTool.cs @@ -163,10 +163,7 @@ namespace Server.Items { private ProspectorsTool m_Tool; - public InternalTarget(ProspectorsTool tool) : base(2, true, TargetFlags.None) - { - m_Tool = tool; - } + public InternalTarget(ProspectorsTool tool) : base(2, true, TargetFlags.None) => m_Tool = tool; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Items/Skill Items/Harvest Tools/Shovel.cs b/Projects/Scripts/Items/Skill Items/Harvest Tools/Shovel.cs index 7417a8973..9ece91b1c 100644 --- a/Projects/Scripts/Items/Skill Items/Harvest Tools/Shovel.cs +++ b/Projects/Scripts/Items/Skill Items/Harvest Tools/Shovel.cs @@ -5,10 +5,7 @@ namespace Server.Items public class Shovel : BaseHarvestTool { [Constructible] - public Shovel(int uses = 50) : base(0xF39, uses) - { - Weight = 5.0; - } + public Shovel(int uses = 50) : base(0xF39, uses) => Weight = 5.0; public Shovel(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Magical/BookOfBushido.cs b/Projects/Scripts/Items/Skill Items/Magical/BookOfBushido.cs index d41ac5435..b75ad8bb6 100644 --- a/Projects/Scripts/Items/Skill Items/Magical/BookOfBushido.cs +++ b/Projects/Scripts/Items/Skill Items/Magical/BookOfBushido.cs @@ -3,10 +3,7 @@ namespace Server.Items public class BookOfBushido : Spellbook { [Constructible] - public BookOfBushido(ulong content = 0x3F) : base(content, 0x238C) - { - Layer = Core.ML ? Layer.OneHanded : Layer.Invalid; - } + public BookOfBushido(ulong content = 0x3F) : base(content, 0x238C) => Layer = Core.ML ? Layer.OneHanded : Layer.Invalid; public BookOfBushido(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Magical/BookOfChivalry.cs b/Projects/Scripts/Items/Skill Items/Magical/BookOfChivalry.cs index de54ef4aa..c49621da4 100644 --- a/Projects/Scripts/Items/Skill Items/Magical/BookOfChivalry.cs +++ b/Projects/Scripts/Items/Skill Items/Magical/BookOfChivalry.cs @@ -3,10 +3,7 @@ namespace Server.Items public class BookOfChivalry : Spellbook { [Constructible] - public BookOfChivalry(ulong content = 0x3FF) : base(content, 0x2252) - { - Layer = Core.ML ? Layer.OneHanded : Layer.Invalid; - } + public BookOfChivalry(ulong content = 0x3FF) : base(content, 0x2252) => Layer = Core.ML ? Layer.OneHanded : Layer.Invalid; public BookOfChivalry(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Magical/BookOfNinjitsu.cs b/Projects/Scripts/Items/Skill Items/Magical/BookOfNinjitsu.cs index 370813216..217cb370d 100644 --- a/Projects/Scripts/Items/Skill Items/Magical/BookOfNinjitsu.cs +++ b/Projects/Scripts/Items/Skill Items/Magical/BookOfNinjitsu.cs @@ -3,10 +3,7 @@ namespace Server.Items public class BookOfNinjitsu : Spellbook { [Constructible] - public BookOfNinjitsu(ulong content = 0xFF) : base(content, 0x23A0) - { - Layer = Core.ML ? Layer.OneHanded : Layer.Invalid; - } + public BookOfNinjitsu(ulong content = 0xFF) : base(content, 0x23A0) => Layer = Core.ML ? Layer.OneHanded : Layer.Invalid; public BookOfNinjitsu(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Magical/Misc/Moongate.cs b/Projects/Scripts/Items/Skill Items/Magical/Misc/Moongate.cs index 8cbb850c1..b0e17a24e 100644 --- a/Projects/Scripts/Items/Skill Items/Magical/Misc/Moongate.cs +++ b/Projects/Scripts/Items/Skill Items/Magical/Misc/Moongate.cs @@ -196,10 +196,7 @@ namespace Server.Items from.SendMessage("This moongate does not seem to go anywhere."); } - public static bool IsInTown(Point3D p, Map map) - { - return map != null && Region.Find(p, map).GetRegion()?.IsDisabled() == false; - } + public static bool IsInTown(Point3D p, Map map) => map != null && Region.Find(p, map).GetRegion()?.IsDisabled() == false; private class DelayTimer : Timer { diff --git a/Projects/Scripts/Items/Skill Items/Magical/Misc/RecallRune.cs b/Projects/Scripts/Items/Skill Items/Magical/Misc/RecallRune.cs index 07f49d96a..af4e695b7 100644 --- a/Projects/Scripts/Items/Skill Items/Magical/Misc/RecallRune.cs +++ b/Projects/Scripts/Items/Skill Items/Magical/Misc/RecallRune.cs @@ -290,10 +290,7 @@ namespace Server.Items { private RecallRune m_Rune; - public RenamePrompt(RecallRune rune) - { - m_Rune = rune; - } + public RenamePrompt(RecallRune rune) => m_Rune = rune; public override void OnResponse(Mobile from, string text) { diff --git a/Projects/Scripts/Items/Skill Items/Magical/MysticSpellbook.cs b/Projects/Scripts/Items/Skill Items/Magical/MysticSpellbook.cs index 9b68fca9f..1aa7fe6c8 100644 --- a/Projects/Scripts/Items/Skill Items/Magical/MysticSpellbook.cs +++ b/Projects/Scripts/Items/Skill Items/Magical/MysticSpellbook.cs @@ -1,37 +1,35 @@ -namespace Server.Items -{ - public class MysticSpellbook : Spellbook - { - [Constructible] - public MysticSpellbook(ulong content = 0) - : base(content, 0x2D9D) - { - Layer = Layer.OneHanded; - } - - public MysticSpellbook(Serial serial) - : base(serial) - { - } - - public override SpellbookType SpellbookType => SpellbookType.Mystic; - - public override int BookOffset => 677; - public override int BookCount => 16; - - public override void Serialize(GenericWriter writer) - { - base.Serialize(writer); - - writer.Write(0); // version - } - - public override void Deserialize(GenericReader reader) - { - base.Deserialize(reader); - - /*int version = */ - reader.ReadInt(); - } - } -} +namespace Server.Items +{ + public class MysticSpellbook : Spellbook + { + [Constructible] + public MysticSpellbook(ulong content = 0) + : base(content, 0x2D9D) => + Layer = Layer.OneHanded; + + public MysticSpellbook(Serial serial) + : base(serial) + { + } + + public override SpellbookType SpellbookType => SpellbookType.Mystic; + + public override int BookOffset => 677; + public override int BookCount => 16; + + public override void Serialize(GenericWriter writer) + { + base.Serialize(writer); + + writer.Write(0); // version + } + + public override void Deserialize(GenericReader reader) + { + base.Deserialize(reader); + + /*int version = */ + reader.ReadInt(); + } + } +} diff --git a/Projects/Scripts/Items/Skill Items/Magical/NecromancerSpellbook.cs b/Projects/Scripts/Items/Skill Items/Magical/NecromancerSpellbook.cs index af6fa7818..b998a4655 100644 --- a/Projects/Scripts/Items/Skill Items/Magical/NecromancerSpellbook.cs +++ b/Projects/Scripts/Items/Skill Items/Magical/NecromancerSpellbook.cs @@ -3,10 +3,7 @@ namespace Server.Items public class NecromancerSpellbook : Spellbook { [Constructible] - public NecromancerSpellbook(ulong content = 0) : base(content, 0x2253) - { - Layer = Core.ML ? Layer.OneHanded : Layer.Invalid; - } + public NecromancerSpellbook(ulong content = 0) : base(content, 0x2253) => Layer = Core.ML ? Layer.OneHanded : Layer.Invalid; public NecromancerSpellbook(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Magical/Potions/BasePotion.cs b/Projects/Scripts/Items/Skill Items/Magical/Potions/BasePotion.cs index bcc478807..430a66278 100644 --- a/Projects/Scripts/Items/Skill Items/Magical/Potions/BasePotion.cs +++ b/Projects/Scripts/Items/Skill Items/Magical/Potions/BasePotion.cs @@ -254,10 +254,8 @@ namespace Server.Items return AOS.Scale(v, 100 + EnhancePotions(m)); } - public override bool StackWith(Mobile from, Item dropped, bool playSound) - { - return dropped is BasePotion potion && potion.m_PotionEffect == m_PotionEffect && - base.StackWith(from, potion, playSound); - } + public override bool StackWith(Mobile from, Item dropped, bool playSound) => + dropped is BasePotion potion && potion.m_PotionEffect == m_PotionEffect && + base.StackWith(from, potion, playSound); } } diff --git a/Projects/Scripts/Items/Skill Items/Magical/Potions/Conflagration Potions/BaseConflagrationPotion.cs b/Projects/Scripts/Items/Skill Items/Magical/Potions/Conflagration Potions/BaseConflagrationPotion.cs index caf6de7ca..42bf8fd11 100644 --- a/Projects/Scripts/Items/Skill Items/Magical/Potions/Conflagration Potions/BaseConflagrationPotion.cs +++ b/Projects/Scripts/Items/Skill Items/Magical/Potions/Conflagration Potions/BaseConflagrationPotion.cs @@ -9,10 +9,7 @@ namespace Server.Items { private List m_Users = new List(); - public BaseConflagrationPotion(PotionEffect effect) : base(0xF06, effect) - { - Hue = 0x489; - } + public BaseConflagrationPotion(PotionEffect effect) : base(0xF06, effect) => Hue = 0x489; public BaseConflagrationPotion(Serial serial) : base(serial) { @@ -92,10 +89,7 @@ namespace Server.Items private class ThrowTarget : Target { - public ThrowTarget(BaseConflagrationPotion potion) : base(12, true, TargetFlags.None) - { - Potion = potion; - } + public ThrowTarget(BaseConflagrationPotion potion) : base(12, true, TargetFlags.None) => Potion = potion; public BaseConflagrationPotion Potion{ get; } @@ -164,10 +158,7 @@ namespace Server.Items m_Timer?.Stop(); } - public int GetDamage() - { - return Utility.RandomMinMax(m_MinDamage, m_MaxDamage); - } + public int GetDamage() => Utility.RandomMinMax(m_MinDamage, m_MaxDamage); private void SetDamage(int min, int max) { diff --git a/Projects/Scripts/Items/Skill Items/Magical/Potions/Confusion Blast Potions/BaseConfusionBlastPotion.cs b/Projects/Scripts/Items/Skill Items/Magical/Potions/Confusion Blast Potions/BaseConfusionBlastPotion.cs index 1722c96d0..87dab3ec9 100644 --- a/Projects/Scripts/Items/Skill Items/Magical/Potions/Confusion Blast Potions/BaseConfusionBlastPotion.cs +++ b/Projects/Scripts/Items/Skill Items/Magical/Potions/Confusion Blast Potions/BaseConfusionBlastPotion.cs @@ -11,10 +11,7 @@ namespace Server.Items { private List m_Users = new List(); - public BaseConfusionBlastPotion(PotionEffect effect) : base(0xF06, effect) - { - Hue = 0x48D; - } + public BaseConfusionBlastPotion(PotionEffect effect) : base(0xF06, effect) => Hue = 0x48D; public BaseConfusionBlastPotion(Serial serial) : base(serial) { @@ -97,10 +94,7 @@ namespace Server.Items private class ThrowTarget : Target { - public ThrowTarget(BaseConfusionBlastPotion potion) : base(12, true, TargetFlags.None) - { - Potion = potion; - } + public ThrowTarget(BaseConfusionBlastPotion potion) : base(12, true, TargetFlags.None) => Potion = potion; public BaseConfusionBlastPotion Potion{ get; } diff --git a/Projects/Scripts/Items/Skill Items/Magical/Potions/DarkglowPotion.cs b/Projects/Scripts/Items/Skill Items/Magical/Potions/DarkglowPotion.cs index 27ac6a488..873c26b28 100644 --- a/Projects/Scripts/Items/Skill Items/Magical/Potions/DarkglowPotion.cs +++ b/Projects/Scripts/Items/Skill Items/Magical/Potions/DarkglowPotion.cs @@ -3,10 +3,7 @@ namespace Server.Items public class DarkglowPotion : BasePoisonPotion { [Constructible] - public DarkglowPotion() : base(PotionEffect.Darkglow) - { - Hue = 0x96; - } + public DarkglowPotion() : base(PotionEffect.Darkglow) => Hue = 0x96; public DarkglowPotion(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Magical/Potions/Explosion Potions/BaseExplosionPotion.cs b/Projects/Scripts/Items/Skill Items/Magical/Potions/Explosion Potions/BaseExplosionPotion.cs index a0a7f3027..e4d0a5341 100644 --- a/Projects/Scripts/Items/Skill Items/Magical/Potions/Explosion Potions/BaseExplosionPotion.cs +++ b/Projects/Scripts/Items/Skill Items/Magical/Potions/Explosion Potions/BaseExplosionPotion.cs @@ -221,10 +221,7 @@ namespace Server.Items private class ThrowTarget : Target { - public ThrowTarget(BaseExplosionPotion potion) : base(12, true, TargetFlags.None) - { - Potion = potion; - } + public ThrowTarget(BaseExplosionPotion potion) : base(12, true, TargetFlags.None) => Potion = potion; public BaseExplosionPotion Potion{ get; } diff --git a/Projects/Scripts/Items/Skill Items/Magical/Potions/InvisibilityPotion.cs b/Projects/Scripts/Items/Skill Items/Magical/Potions/InvisibilityPotion.cs index e83f79a6f..1cabcc641 100644 --- a/Projects/Scripts/Items/Skill Items/Magical/Potions/InvisibilityPotion.cs +++ b/Projects/Scripts/Items/Skill Items/Magical/Potions/InvisibilityPotion.cs @@ -8,10 +8,7 @@ namespace Server.Items private static Dictionary m_Table = new Dictionary(); [Constructible] - public InvisibilityPotion() : base(0xF0A, PotionEffect.Invisibility) - { - Hue = 0x48D; - } + public InvisibilityPotion() : base(0xF0A, PotionEffect.Invisibility) => Hue = 0x48D; public InvisibilityPotion(Serial serial) : base(serial) { @@ -60,10 +57,7 @@ namespace Server.Items RemoveTimer(m); } - public static bool HasTimer(Mobile m) - { - return m_Table.ContainsKey(m); - } + public static bool HasTimer(Mobile m) => m_Table.ContainsKey(m); public static void RemoveTimer(Mobile m, bool interrupted = false) { diff --git a/Projects/Scripts/Items/Skill Items/Magical/Potions/ParasiticPotion.cs b/Projects/Scripts/Items/Skill Items/Magical/Potions/ParasiticPotion.cs index 3aa405262..add75a6b0 100644 --- a/Projects/Scripts/Items/Skill Items/Magical/Potions/ParasiticPotion.cs +++ b/Projects/Scripts/Items/Skill Items/Magical/Potions/ParasiticPotion.cs @@ -3,10 +3,7 @@ namespace Server.Items public class ParasiticPotion : BasePoisonPotion { [Constructible] - public ParasiticPotion() : base(PotionEffect.Parasitic) - { - Hue = 0x17C; - } + public ParasiticPotion() : base(PotionEffect.Parasitic) => Hue = 0x17C; public ParasiticPotion(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Magical/Runebook.cs b/Projects/Scripts/Items/Skill Items/Magical/Runebook.cs index b2cfad96a..2bc7d5692 100644 --- a/Projects/Scripts/Items/Skill Items/Magical/Runebook.cs +++ b/Projects/Scripts/Items/Skill Items/Magical/Runebook.cs @@ -139,10 +139,7 @@ namespace Server.Items [CommandProperty(AccessLevel.GameMaster)] public SecureLevel Level{ get; set; } - public override bool AllowEquippedCast(Mobile from) - { - return true; - } + public override bool AllowEquippedCast(Mobile from) => true; public override void GetContextMenuEntries(Mobile from, List list) { diff --git a/Projects/Scripts/Items/Skill Items/Magical/Scrolls/SpellweavingScrolls.cs b/Projects/Scripts/Items/Skill Items/Magical/Scrolls/SpellweavingScrolls.cs index 6e48cba52..5fa0b2759 100644 --- a/Projects/Scripts/Items/Skill Items/Magical/Scrolls/SpellweavingScrolls.cs +++ b/Projects/Scripts/Items/Skill Items/Magical/Scrolls/SpellweavingScrolls.cs @@ -4,10 +4,8 @@ namespace Server.Items { [Constructible] public ArcaneCircleScroll(int amount = 1) - : base(600, 0x2D51, amount) - { + : base(600, 0x2D51, amount) => Hue = 0x8FD; - } public ArcaneCircleScroll(Serial serial) : base(serial) @@ -33,10 +31,8 @@ namespace Server.Items { [Constructible] public GiftOfRenewalScroll(int amount = 1) - : base(601, 0x2D52, amount) - { + : base(601, 0x2D52, amount) => Hue = 0x8FD; - } public GiftOfRenewalScroll(Serial serial) : base(serial) @@ -62,10 +58,8 @@ namespace Server.Items { [Constructible] public ImmolatingWeaponScroll(int amount = 1) - : base(602, 0x2D53, amount) - { + : base(602, 0x2D53, amount) => Hue = 0x8FD; - } public ImmolatingWeaponScroll(Serial serial) : base(serial) @@ -91,10 +85,8 @@ namespace Server.Items { [Constructible] public AttuneWeaponScroll(int amount = 1) - : base(603, 0x2D54, amount) - { + : base(603, 0x2D54, amount) => Hue = 0x8FD; - } public AttuneWeaponScroll(Serial serial) : base(serial) @@ -120,10 +112,8 @@ namespace Server.Items { [Constructible] public ThunderstormScroll(int amount = 1) - : base(604, 0x2D55, amount) - { + : base(604, 0x2D55, amount) => Hue = 0x8FD; - } public ThunderstormScroll(Serial serial) : base(serial) @@ -149,10 +139,8 @@ namespace Server.Items { [Constructible] public NatureFuryScroll(int amount = 1) - : base(605, 0x2D56, amount) - { + : base(605, 0x2D56, amount) => Hue = 0x8FD; - } public NatureFuryScroll(Serial serial) : base(serial) @@ -178,10 +166,8 @@ namespace Server.Items { [Constructible] public SummonFeyScroll(int amount = 1) - : base(606, 0x2D57, amount) - { + : base(606, 0x2D57, amount) => Hue = 0x8FD; - } public SummonFeyScroll(Serial serial) : base(serial) @@ -207,10 +193,8 @@ namespace Server.Items { [Constructible] public SummonFiendScroll(int amount = 1) - : base(607, 0x2D58, amount) - { + : base(607, 0x2D58, amount) => Hue = 0x8FD; - } public SummonFiendScroll(Serial serial) : base(serial) @@ -236,10 +220,8 @@ namespace Server.Items { [Constructible] public ReaperFormScroll(int amount = 1) - : base(608, 0x2D59, amount) - { + : base(608, 0x2D59, amount) => Hue = 0x8FD; - } public ReaperFormScroll(Serial serial) : base(serial) @@ -265,10 +247,8 @@ namespace Server.Items { [Constructible] public WildfireScroll(int amount = 1) - : base(609, 0x2D5A, amount) - { + : base(609, 0x2D5A, amount) => Hue = 0x8FD; - } public WildfireScroll(Serial serial) : base(serial) @@ -294,10 +274,8 @@ namespace Server.Items { [Constructible] public EssenceOfWindScroll(int amount = 1) - : base(610, 0x2D5B, amount) - { + : base(610, 0x2D5B, amount) => Hue = 0x8FD; - } public EssenceOfWindScroll(Serial serial) : base(serial) @@ -323,10 +301,8 @@ namespace Server.Items { [Constructible] public DryadAllureScroll(int amount = 1) - : base(611, 0x2D5C, amount) - { + : base(611, 0x2D5C, amount) => Hue = 0x8FD; - } public DryadAllureScroll(Serial serial) : base(serial) @@ -352,10 +328,8 @@ namespace Server.Items { [Constructible] public EtherealVoyageScroll(int amount = 1) - : base(612, 0x2D5D, amount) - { + : base(612, 0x2D5D, amount) => Hue = 0x8FD; - } public EtherealVoyageScroll(Serial serial) : base(serial) @@ -381,10 +355,8 @@ namespace Server.Items { [Constructible] public WordOfDeathScroll(int amount = 1) - : base(613, 0x2D5E, amount) - { + : base(613, 0x2D5E, amount) => Hue = 0x8FD; - } public WordOfDeathScroll(Serial serial) : base(serial) @@ -410,10 +382,8 @@ namespace Server.Items { [Constructible] public GiftOfLifeScroll(int amount = 1) - : base(614, 0x2D5F, amount) - { + : base(614, 0x2D5F, amount) => Hue = 0x8FD; - } public GiftOfLifeScroll(Serial serial) : base(serial) @@ -439,10 +409,8 @@ namespace Server.Items { [Constructible] public ArcaneEmpowermentScroll(int amount = 1) - : base(615, 0x2D60, amount) - { + : base(615, 0x2D60, amount) => Hue = 0x8FD; - } public ArcaneEmpowermentScroll(Serial serial) : base(serial) diff --git a/Projects/Scripts/Items/Skill Items/Magical/Spellbook.cs b/Projects/Scripts/Items/Skill Items/Magical/Spellbook.cs index ca2e19308..a55c16924 100644 --- a/Projects/Scripts/Items/Skill Items/Magical/Spellbook.cs +++ b/Projects/Scripts/Items/Skill Items/Magical/Spellbook.cs @@ -374,45 +374,21 @@ namespace Server.Items return SpellbookType.Invalid; } - public static Spellbook FindRegular(Mobile from) - { - return Find(from, -1, SpellbookType.Regular); - } + public static Spellbook FindRegular(Mobile from) => Find(from, -1, SpellbookType.Regular); - public static Spellbook FindNecromancer(Mobile from) - { - return Find(from, -1, SpellbookType.Necromancer); - } + public static Spellbook FindNecromancer(Mobile from) => Find(from, -1, SpellbookType.Necromancer); - public static Spellbook FindPaladin(Mobile from) - { - return Find(from, -1, SpellbookType.Paladin); - } + public static Spellbook FindPaladin(Mobile from) => Find(from, -1, SpellbookType.Paladin); - public static Spellbook FindSamurai(Mobile from) - { - return Find(from, -1, SpellbookType.Samurai); - } + public static Spellbook FindSamurai(Mobile from) => Find(from, -1, SpellbookType.Samurai); - public static Spellbook FindNinja(Mobile from) - { - return Find(from, -1, SpellbookType.Ninja); - } + public static Spellbook FindNinja(Mobile from) => Find(from, -1, SpellbookType.Ninja); - public static Spellbook FindArcanist(Mobile from) - { - return Find(from, -1, SpellbookType.Arcanist); - } + public static Spellbook FindArcanist(Mobile from) => Find(from, -1, SpellbookType.Arcanist); - public static Spellbook FindMystic(Mobile from) - { - return Find(from, -1, SpellbookType.Mystic); - } + public static Spellbook FindMystic(Mobile from) => Find(from, -1, SpellbookType.Mystic); - public static Spellbook Find(Mobile from, int spellID) - { - return Find(from, spellID, GetTypeForSpell(spellID)); - } + public static Spellbook Find(Mobile from, int spellID) => Find(from, spellID, GetTypeForSpell(spellID)); public static Spellbook Find(Mobile from, int spellID, SpellbookType type) { @@ -485,15 +461,9 @@ namespace Server.Items return list; } - public static Spellbook FindEquippedSpellbook(Mobile from) - { - return from.FindItemOnLayer(Layer.OneHanded) as Spellbook; - } + public static Spellbook FindEquippedSpellbook(Mobile from) => from.FindItemOnLayer(Layer.OneHanded) as Spellbook; - public static bool ValidateSpellbook(Spellbook book, int spellID, SpellbookType type) - { - return book.SpellbookType == type && (spellID == -1 || book.HasSpell(spellID)); - } + public static bool ValidateSpellbook(Spellbook book, int spellID, SpellbookType type) => book.SpellbookType == type && (spellID == -1 || book.HasSpell(spellID)); public override bool AllowSecureTrade(Mobile from, Mobile to, Mobile newOwner, bool accepted) { @@ -512,10 +482,7 @@ namespace Server.Items return base.CanEquip(from); } - public override bool AllowEquippedCast(Mobile from) - { - return true; - } + public override bool AllowEquippedCast(Mobile from) => true; public override bool OnDragDrop(Mobile from, Item dropped) { diff --git a/Projects/Scripts/Items/Skill Items/Misc/Bandage.cs b/Projects/Scripts/Items/Skill Items/Misc/Bandage.cs index 7d93906f6..831f1734f 100644 --- a/Projects/Scripts/Items/Skill Items/Misc/Bandage.cs +++ b/Projects/Scripts/Items/Skill Items/Misc/Bandage.cs @@ -100,10 +100,7 @@ namespace Server.Items { private Bandage m_Bandage; - public InternalTarget(Bandage bandage) : base(Bandage.Range, false, TargetFlags.Beneficial) - { - m_Bandage = bandage; - } + public InternalTarget(Bandage bandage) : base(Bandage.Range, false, TargetFlags.Beneficial) => m_Bandage = bandage; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Items/Skill Items/Misc/FireHorn.cs b/Projects/Scripts/Items/Skill Items/Misc/FireHorn.cs index beb1b5975..5e0d9c5d0 100644 --- a/Projects/Scripts/Items/Skill Items/Misc/FireHorn.cs +++ b/Projects/Scripts/Items/Skill Items/Misc/FireHorn.cs @@ -196,10 +196,7 @@ namespace Server.Items { private FireHorn m_Horn; - public InternalTarget(FireHorn horn) : base(Core.AOS ? 3 : 2, true, TargetFlags.Harmful) - { - m_Horn = horn; - } + public InternalTarget(FireHorn horn) : base(Core.AOS ? 3 : 2, true, TargetFlags.Harmful) => m_Horn = horn; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Items/Skill Items/Misc/RecipeScroll.cs b/Projects/Scripts/Items/Skill Items/Misc/RecipeScroll.cs index 65e13ecb8..de220eeb2 100644 --- a/Projects/Scripts/Items/Skill Items/Misc/RecipeScroll.cs +++ b/Projects/Scripts/Items/Skill Items/Misc/RecipeScroll.cs @@ -13,10 +13,7 @@ namespace Server.Items } [Constructible] - public RecipeScroll(int recipeID) : base(0x2831) - { - m_RecipeID = recipeID; - } + public RecipeScroll(int recipeID) : base(0x2831) => m_RecipeID = recipeID; public RecipeScroll(Serial serial) : base(serial) diff --git a/Projects/Scripts/Items/Skill Items/Misc/RepairDeed.cs b/Projects/Scripts/Items/Skill Items/Misc/RepairDeed.cs index 89f0c4139..3cd3ef76e 100644 --- a/Projects/Scripts/Items/Skill Items/Misc/RepairDeed.cs +++ b/Projects/Scripts/Items/Skill Items/Misc/RepairDeed.cs @@ -156,11 +156,7 @@ namespace Server.Items return false; } - public bool VerifyRegion(Mobile m) - { - //TODO: When the entire region system data is in, convert to that instead of a proximity thing. - return m.Region.IsPartOf() && Faction.IsNearType(m, RepairSkillInfo.GetInfo(m_Skill).NearbyTypes, 6); - } + public bool VerifyRegion(Mobile m) => m.Region.IsPartOf() && Faction.IsNearType(m, RepairSkillInfo.GetInfo(m_Skill).NearbyTypes, 6); public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Items/Skill Items/Musical Instruments/BambooFlute.cs b/Projects/Scripts/Items/Skill Items/Musical Instruments/BambooFlute.cs index 4c12b615a..f13c876e4 100644 --- a/Projects/Scripts/Items/Skill Items/Musical Instruments/BambooFlute.cs +++ b/Projects/Scripts/Items/Skill Items/Musical Instruments/BambooFlute.cs @@ -3,10 +3,7 @@ namespace Server.Items public class BambooFlute : BaseInstrument { [Constructible] - public BambooFlute() : base(0x2805, 0x504, 0x503) - { - Weight = 2.0; - } + public BambooFlute() : base(0x2805, 0x504, 0x503) => Weight = 2.0; public BambooFlute(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Musical Instruments/BaseInstrument.cs b/Projects/Scripts/Items/Skill Items/Musical Instruments/BaseInstrument.cs index a8a76404a..b1e840c8b 100644 --- a/Projects/Scripts/Items/Skill Items/Musical Instruments/BaseInstrument.cs +++ b/Projects/Scripts/Items/Skill Items/Musical Instruments/BaseInstrument.cs @@ -179,10 +179,7 @@ namespace Server.Items UsesRemaining = UsesRemaining * 100 / GetUsesScalar(); } - public int GetUsesScalar() - { - return m_Quality == InstrumentQuality.Exceptional ? 200 : 100; - } + public int GetUsesScalar() => m_Quality == InstrumentQuality.Exceptional ? 200 : 100; public void ConsumeUse(Mobile from) { @@ -209,10 +206,7 @@ namespace Server.Items return null; } - public static int GetBardRange(Mobile bard, SkillName skill) - { - return 8 + (int)(bard.Skills[skill].Value / 15); - } + public static int GetBardRange(Mobile bard, SkillName skill) => 8 + (int)(bard.Skills[skill].Value / 15); public static void PickInstrument(Mobile from, InstrumentPickedCallback callback) { @@ -241,25 +235,13 @@ namespace Server.Items } } - public static bool IsMageryCreature(BaseCreature bc) - { - return bc?.AI == AIType.AI_Mage && bc.Skills.Magery.Base > 5.0; - } + public static bool IsMageryCreature(BaseCreature bc) => bc?.AI == AIType.AI_Mage && bc.Skills.Magery.Base > 5.0; - public static bool IsFireBreathingCreature(BaseCreature bc) - { - return bc?.HasBreath == true; - } + public static bool IsFireBreathingCreature(BaseCreature bc) => bc?.HasBreath == true; - public static bool IsPoisonImmune(BaseCreature bc) - { - return bc?.PoisonImmune != null; - } + public static bool IsPoisonImmune(BaseCreature bc) => bc?.PoisonImmune != null; - public static int GetPoisonLevel(BaseCreature bc) - { - return (bc?.HitPoison.Level ?? -1) + 1; - } + public static int GetPoisonLevel(BaseCreature bc) => (bc?.HitPoison.Level ?? -1) + 1; public static double GetBaseDifficulty(Mobile targ) { diff --git a/Projects/Scripts/Items/Skill Items/Musical Instruments/Drums.cs b/Projects/Scripts/Items/Skill Items/Musical Instruments/Drums.cs index 395f63510..ce9492398 100644 --- a/Projects/Scripts/Items/Skill Items/Musical Instruments/Drums.cs +++ b/Projects/Scripts/Items/Skill Items/Musical Instruments/Drums.cs @@ -3,10 +3,7 @@ namespace Server.Items public class Drums : BaseInstrument { [Constructible] - public Drums() : base(0xE9C, 0x38, 0x39) - { - Weight = 4.0; - } + public Drums() : base(0xE9C, 0x38, 0x39) => Weight = 4.0; public Drums(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Musical Instruments/Harp.cs b/Projects/Scripts/Items/Skill Items/Musical Instruments/Harp.cs index 355bf9613..fc46d1786 100644 --- a/Projects/Scripts/Items/Skill Items/Musical Instruments/Harp.cs +++ b/Projects/Scripts/Items/Skill Items/Musical Instruments/Harp.cs @@ -3,10 +3,7 @@ namespace Server.Items public class Harp : BaseInstrument { [Constructible] - public Harp() : base(0xEB1, 0x43, 0x44) - { - Weight = 35.0; - } + public Harp() : base(0xEB1, 0x43, 0x44) => Weight = 35.0; public Harp(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Musical Instruments/LapHarp.cs b/Projects/Scripts/Items/Skill Items/Musical Instruments/LapHarp.cs index 0ea59ad1b..a2b0b9c7a 100644 --- a/Projects/Scripts/Items/Skill Items/Musical Instruments/LapHarp.cs +++ b/Projects/Scripts/Items/Skill Items/Musical Instruments/LapHarp.cs @@ -3,10 +3,7 @@ namespace Server.Items public class LapHarp : BaseInstrument { [Constructible] - public LapHarp() : base(0xEB2, 0x45, 0x46) - { - Weight = 10.0; - } + public LapHarp() : base(0xEB2, 0x45, 0x46) => Weight = 10.0; public LapHarp(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Musical Instruments/Lute.cs b/Projects/Scripts/Items/Skill Items/Musical Instruments/Lute.cs index 9c4287530..d16dd707a 100644 --- a/Projects/Scripts/Items/Skill Items/Musical Instruments/Lute.cs +++ b/Projects/Scripts/Items/Skill Items/Musical Instruments/Lute.cs @@ -3,10 +3,7 @@ namespace Server.Items public class Lute : BaseInstrument { [Constructible] - public Lute() : base(0xEB3, 0x4C, 0x4D) - { - Weight = 5.0; - } + public Lute() : base(0xEB3, 0x4C, 0x4D) => Weight = 5.0; public Lute(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Musical Instruments/Tambourine.cs b/Projects/Scripts/Items/Skill Items/Musical Instruments/Tambourine.cs index 0cc0ac795..492b4b42f 100644 --- a/Projects/Scripts/Items/Skill Items/Musical Instruments/Tambourine.cs +++ b/Projects/Scripts/Items/Skill Items/Musical Instruments/Tambourine.cs @@ -3,10 +3,7 @@ namespace Server.Items public class Tambourine : BaseInstrument { [Constructible] - public Tambourine() : base(0xE9D, 0x52, 0x53) - { - Weight = 1.0; - } + public Tambourine() : base(0xE9D, 0x52, 0x53) => Weight = 1.0; public Tambourine(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Musical Instruments/TambourineTassel.cs b/Projects/Scripts/Items/Skill Items/Musical Instruments/TambourineTassel.cs index 52d623faa..f057e968e 100644 --- a/Projects/Scripts/Items/Skill Items/Musical Instruments/TambourineTassel.cs +++ b/Projects/Scripts/Items/Skill Items/Musical Instruments/TambourineTassel.cs @@ -3,10 +3,7 @@ namespace Server.Items public class TambourineTassel : BaseInstrument { [Constructible] - public TambourineTassel() : base(0xE9E, 0x52, 0x53) - { - Weight = 1.0; - } + public TambourineTassel() : base(0xE9E, 0x52, 0x53) => Weight = 1.0; public TambourineTassel(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Ninjitsu/NinjaWeapons.cs b/Projects/Scripts/Items/Skill Items/Ninjitsu/NinjaWeapons.cs index d93982b05..ad77d5ab0 100644 --- a/Projects/Scripts/Items/Skill Items/Ninjitsu/NinjaWeapons.cs +++ b/Projects/Scripts/Items/Skill Items/Ninjitsu/NinjaWeapons.cs @@ -278,10 +278,8 @@ namespace Server.Items private INinjaWeapon weapon; public LoadEntry(INinjaWeapon wep, int entry) - : base(entry, 0) - { + : base(entry, 0) => weapon = wep; - } public override void OnClick() { diff --git a/Projects/Scripts/Items/Skill Items/Specialized/GlassblowingBook.cs b/Projects/Scripts/Items/Skill Items/Specialized/GlassblowingBook.cs index e6fff9baf..c811500b5 100644 --- a/Projects/Scripts/Items/Skill Items/Specialized/GlassblowingBook.cs +++ b/Projects/Scripts/Items/Skill Items/Specialized/GlassblowingBook.cs @@ -5,10 +5,7 @@ namespace Server.Items public class GlassblowingBook : Item { [Constructible] - public GlassblowingBook() : base(0xFF4) - { - Weight = 1.0; - } + public GlassblowingBook() : base(0xFF4) => Weight = 1.0; public GlassblowingBook(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Specialized/MasonryBook.cs b/Projects/Scripts/Items/Skill Items/Specialized/MasonryBook.cs index 47b8ca4c6..9e15c86e6 100644 --- a/Projects/Scripts/Items/Skill Items/Specialized/MasonryBook.cs +++ b/Projects/Scripts/Items/Skill Items/Specialized/MasonryBook.cs @@ -5,10 +5,7 @@ namespace Server.Items public class MasonryBook : Item { [Constructible] - public MasonryBook() : base(0xFBE) - { - Weight = 1.0; - } + public MasonryBook() : base(0xFBE) => Weight = 1.0; public MasonryBook(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Specialized/SandMiningBook.cs b/Projects/Scripts/Items/Skill Items/Specialized/SandMiningBook.cs index 1d983a0bf..417241e75 100644 --- a/Projects/Scripts/Items/Skill Items/Specialized/SandMiningBook.cs +++ b/Projects/Scripts/Items/Skill Items/Specialized/SandMiningBook.cs @@ -5,10 +5,7 @@ namespace Server.Items public class SandMiningBook : Item { [Constructible] - public SandMiningBook() : base(0xFF4) - { - Weight = 1.0; - } + public SandMiningBook() : base(0xFF4) => Weight = 1.0; public SandMiningBook(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Specialized/StoneMiningBook.cs b/Projects/Scripts/Items/Skill Items/Specialized/StoneMiningBook.cs index 26350217c..9c61dbf0e 100644 --- a/Projects/Scripts/Items/Skill Items/Specialized/StoneMiningBook.cs +++ b/Projects/Scripts/Items/Skill Items/Specialized/StoneMiningBook.cs @@ -5,10 +5,7 @@ namespace Server.Items public class StoneMiningBook : Item { [Constructible] - public StoneMiningBook() : base(0xFBE) - { - Weight = 1.0; - } + public StoneMiningBook() : base(0xFBE) => Weight = 1.0; public StoneMiningBook(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/CustomHuePicker.cs b/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/CustomHuePicker.cs index 55d936f8c..e5ba3d041 100644 --- a/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/CustomHuePicker.cs +++ b/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/CustomHuePicker.cs @@ -124,10 +124,7 @@ namespace Server.Items RenderCategories(); } - private int GetRadioID(int group, int index) - { - return index * m_Definition.Groups.Length + group; - } + private int GetRadioID(int group, int index) => index * m_Definition.Groups.Length + group; private void RenderBackground() { diff --git a/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/DyeTub.cs b/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/DyeTub.cs index 598ee3e56..7feb1cc72 100644 --- a/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/DyeTub.cs +++ b/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/DyeTub.cs @@ -129,10 +129,7 @@ namespace Server.Items { private DyeTub m_Tub; - public InternalTarget(DyeTub tub) : base(1, false, TargetFlags.None) - { - m_Tub = tub; - } + public InternalTarget(DyeTub tub) : base(1, false, TargetFlags.None) => m_Tub = tub; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/FurnitureDyeTub.cs b/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/FurnitureDyeTub.cs index 1dd3920f4..8da63ce79 100644 --- a/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/FurnitureDyeTub.cs +++ b/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/FurnitureDyeTub.cs @@ -5,10 +5,7 @@ namespace Server.Items public class FurnitureDyeTub : DyeTub, IRewardItem { [Constructible] - public FurnitureDyeTub() - { - LootType = LootType.Blessed; - } + public FurnitureDyeTub() => LootType = LootType.Blessed; public FurnitureDyeTub(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/LeatherDyeTub.cs b/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/LeatherDyeTub.cs index 1540a7c08..a738e1624 100644 --- a/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/LeatherDyeTub.cs +++ b/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/LeatherDyeTub.cs @@ -5,10 +5,7 @@ namespace Server.Items public class LeatherDyeTub : DyeTub, IRewardItem { [Constructible] - public LeatherDyeTub() - { - LootType = LootType.Blessed; - } + public LeatherDyeTub() => LootType = LootType.Blessed; public LeatherDyeTub(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/MetallicClothDyetub.cs b/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/MetallicClothDyetub.cs index 7c32abf80..c80b006db 100644 --- a/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/MetallicClothDyetub.cs +++ b/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/MetallicClothDyetub.cs @@ -3,10 +3,7 @@ namespace Server.Items public class MetallicClothDyetub : DyeTub { [Constructible] - public MetallicClothDyetub() - { - LootType = LootType.Blessed; - } + public MetallicClothDyetub() => LootType = LootType.Blessed; public MetallicClothDyetub(Serial serial) : base(serial) diff --git a/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/MetallicLeatherDyeTub.cs b/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/MetallicLeatherDyeTub.cs index 015f017dc..04e31a1e7 100644 --- a/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/MetallicLeatherDyeTub.cs +++ b/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/MetallicLeatherDyeTub.cs @@ -3,10 +3,7 @@ namespace Server.Items public class MetallicLeatherDyeTub : LeatherDyeTub { [Constructible] - public MetallicLeatherDyeTub() - { - LootType = LootType.Blessed; - } + public MetallicLeatherDyeTub() => LootType = LootType.Blessed; public MetallicLeatherDyeTub(Serial serial) : base(serial) diff --git a/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/RunebookDyeTub.cs b/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/RunebookDyeTub.cs index 2dbf03023..7bc5bb76e 100644 --- a/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/RunebookDyeTub.cs +++ b/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/RunebookDyeTub.cs @@ -5,10 +5,7 @@ namespace Server.Items public class RunebookDyeTub : DyeTub, IRewardItem { [Constructible] - public RunebookDyeTub() - { - LootType = LootType.Blessed; - } + public RunebookDyeTub() => LootType = LootType.Blessed; public RunebookDyeTub(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/SpecialDyeTub.cs b/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/SpecialDyeTub.cs index 22521aa78..a34fc2501 100644 --- a/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/SpecialDyeTub.cs +++ b/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/SpecialDyeTub.cs @@ -5,10 +5,7 @@ namespace Server.Items public class SpecialDyeTub : DyeTub, IRewardItem { [Constructible] - public SpecialDyeTub() - { - LootType = LootType.Blessed; - } + public SpecialDyeTub() => LootType = LootType.Blessed; public SpecialDyeTub(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/StatuetteDyeTub.cs b/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/StatuetteDyeTub.cs index cf14e926b..0f3ce996b 100644 --- a/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/StatuetteDyeTub.cs +++ b/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/StatuetteDyeTub.cs @@ -5,10 +5,7 @@ namespace Server.Items public class StatuetteDyeTub : DyeTub, IRewardItem { [Constructible] - public StatuetteDyeTub() - { - LootType = LootType.Blessed; - } + public StatuetteDyeTub() => LootType = LootType.Blessed; public StatuetteDyeTub(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/WhiteClothDyeTub.cs b/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/WhiteClothDyeTub.cs index 6d5af436c..5329090c0 100644 --- a/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/WhiteClothDyeTub.cs +++ b/Projects/Scripts/Items/Skill Items/Tailor Items/Dyetubs/WhiteClothDyeTub.cs @@ -3,10 +3,7 @@ namespace Server.Items /* High seas, loot from merchant ship's hold, also a "unc public class WhiteClothDyeTub : DyeTub { [Constructible] - public WhiteClothDyeTub() - { - DyedHue = Hue = 0x9C2; - } + public WhiteClothDyeTub() => DyedHue = Hue = 0x9C2; public WhiteClothDyeTub(Serial serial) : base(serial) diff --git a/Projects/Scripts/Items/Skill Items/Tailor Items/Misc/Dressform.cs b/Projects/Scripts/Items/Skill Items/Tailor Items/Misc/Dressform.cs index 4f534da44..2044ef111 100644 --- a/Projects/Scripts/Items/Skill Items/Tailor Items/Misc/Dressform.cs +++ b/Projects/Scripts/Items/Skill Items/Tailor Items/Misc/Dressform.cs @@ -4,10 +4,7 @@ namespace Server.Items public class Dressform : Item { [Constructible] - public Dressform() : base(0xec6) - { - Weight = 10; - } + public Dressform() : base(0xec6) => Weight = 10; public Dressform(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Tailor Items/Misc/Dyes.cs b/Projects/Scripts/Items/Skill Items/Tailor Items/Misc/Dyes.cs index 3e7e45065..8a86ab078 100644 --- a/Projects/Scripts/Items/Skill Items/Tailor Items/Misc/Dyes.cs +++ b/Projects/Scripts/Items/Skill Items/Tailor Items/Misc/Dyes.cs @@ -15,12 +15,7 @@ namespace Server.Items */ [Constructible] - public Dyes() : base(0xFA9) - { - Weight = 3.0; - - /* m_UsesRemaining = 25; */ - } + public Dyes() : base(0xFA9) => Weight = 3.0; public Dyes(Serial serial) : base(serial) { @@ -96,10 +91,7 @@ namespace Server.Items { private DyeTub m_Tub; - public InternalPicker(DyeTub tub) : base(tub.ItemID) - { - m_Tub = tub; - } + public InternalPicker(DyeTub tub) : base(tub.ItemID) => m_Tub = tub; public override void OnResponse(int hue) { diff --git a/Projects/Scripts/Items/Skill Items/Tailor Items/Misc/Scissors.cs b/Projects/Scripts/Items/Skill Items/Tailor Items/Misc/Scissors.cs index 23bacd1a6..2ee191098 100644 --- a/Projects/Scripts/Items/Skill Items/Tailor Items/Misc/Scissors.cs +++ b/Projects/Scripts/Items/Skill Items/Tailor Items/Misc/Scissors.cs @@ -11,10 +11,7 @@ namespace Server.Items public class Scissors : Item { [Constructible] - public Scissors() : base(0xF9F) - { - Weight = 1.0; - } + public Scissors() : base(0xF9F) => Weight = 1.0; public Scissors(Serial serial) : base(serial) { @@ -58,10 +55,7 @@ namespace Server.Items { private Scissors m_Item; - public InternalTarget(Scissors item) : base(2, false, TargetFlags.None) - { - m_Item = item; - } + public InternalTarget(Scissors item) : base(2, false, TargetFlags.None) => m_Item = item; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Items/Skill Items/Thief/DisguiseKit.cs b/Projects/Scripts/Items/Skill Items/Thief/DisguiseKit.cs index 5ce7d8084..11131873c 100644 --- a/Projects/Scripts/Items/Skill Items/Thief/DisguiseKit.cs +++ b/Projects/Scripts/Items/Skill Items/Thief/DisguiseKit.cs @@ -14,10 +14,7 @@ namespace Server.Items public class DisguiseKit : Item { [Constructible] - public DisguiseKit() : base(0xE05) - { - Weight = 1.0; - } + public DisguiseKit() : base(0xE05) => Weight = 1.0; public DisguiseKit(Serial serial) : base(serial) { @@ -269,10 +266,7 @@ namespace Server.Items t?.Start(); } - public static bool IsDisguised(Mobile m) - { - return Timers.ContainsKey(m); - } + public static bool IsDisguised(Mobile m) => Timers.ContainsKey(m); public static void StopTimer(Mobile m) { @@ -296,10 +290,7 @@ namespace Server.Items } } - public static TimeSpan TimeRemaining(Mobile m) - { - return Timers.TryGetValue(m, out Timer t) ? t.Next - DateTime.UtcNow : TimeSpan.Zero; - } + public static TimeSpan TimeRemaining(Mobile m) => Timers.TryGetValue(m, out Timer t) ? t.Next - DateTime.UtcNow : TimeSpan.Zero; private class InternalTimer : Timer { diff --git a/Projects/Scripts/Items/Skill Items/Thief/DisguisePersistance.cs b/Projects/Scripts/Items/Skill Items/Thief/DisguisePersistance.cs index 5220a033f..50d3b0ccf 100644 --- a/Projects/Scripts/Items/Skill Items/Thief/DisguisePersistance.cs +++ b/Projects/Scripts/Items/Skill Items/Thief/DisguisePersistance.cs @@ -15,10 +15,7 @@ namespace Server.Items base.Delete(); } - public DisguisePersistance(Serial serial) : base(serial) - { - Instance = this; - } + public DisguisePersistance(Serial serial) : base(serial) => Instance = this; public static DisguisePersistance Instance{ get; private set; } diff --git a/Projects/Scripts/Items/Skill Items/Thief/LockPick.cs b/Projects/Scripts/Items/Skill Items/Thief/LockPick.cs index 1221a4eb5..61280ed9c 100644 --- a/Projects/Scripts/Items/Skill Items/Thief/LockPick.cs +++ b/Projects/Scripts/Items/Skill Items/Thief/LockPick.cs @@ -56,10 +56,7 @@ namespace Server.Items { private Lockpick m_Item; - public InternalTarget(Lockpick item) : base(1, false, TargetFlags.None) - { - m_Item = item; - } + public InternalTarget(Lockpick item) : base(1, false, TargetFlags.None) => m_Item = item; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Items/Skill Items/Tinkering/Clocks.cs b/Projects/Scripts/Items/Skill Items/Tinkering/Clocks.cs index 2ef758a5a..5bb22fcaa 100644 --- a/Projects/Scripts/Items/Skill Items/Tinkering/Clocks.cs +++ b/Projects/Scripts/Items/Skill Items/Tinkering/Clocks.cs @@ -23,10 +23,7 @@ namespace Server.Items private static DateTime WorldStart = new DateTime(1997, 9, 1); [Constructible] - public Clock(int itemID = 0x104B) : base(itemID) - { - Weight = 3.0; - } + public Clock(int itemID = 0x104B) : base(itemID) => Weight = 3.0; public Clock(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Tinkering/Globe.cs b/Projects/Scripts/Items/Skill Items/Tinkering/Globe.cs index c2608840d..c5dc481f2 100644 --- a/Projects/Scripts/Items/Skill Items/Tinkering/Globe.cs +++ b/Projects/Scripts/Items/Skill Items/Tinkering/Globe.cs @@ -4,9 +4,8 @@ namespace Server.Items { [Constructible] public Globe() : base(0x1047) // It isn't flippable - { - Weight = 3.0; - } + => + Weight = 3.0; public Globe(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Tinkering/Spyglass.cs b/Projects/Scripts/Items/Skill Items/Tinkering/Spyglass.cs index 85824e3c3..2dae504f3 100644 --- a/Projects/Scripts/Items/Skill Items/Tinkering/Spyglass.cs +++ b/Projects/Scripts/Items/Skill Items/Tinkering/Spyglass.cs @@ -9,10 +9,7 @@ namespace Server.Items public class Spyglass : Item { [Constructible] - public Spyglass() : base(0x14F5) - { - Weight = 3.0; - } + public Spyglass() : base(0x14F5) => Weight = 3.0; public Spyglass(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Tinkering/Utensils.cs b/Projects/Scripts/Items/Skill Items/Tinkering/Utensils.cs index 09ad722dd..cbecdb63c 100644 --- a/Projects/Scripts/Items/Skill Items/Tinkering/Utensils.cs +++ b/Projects/Scripts/Items/Skill Items/Tinkering/Utensils.cs @@ -4,10 +4,7 @@ namespace Server.Items public class Fork : Item { [Constructible] - public Fork() : base(0x9F4) - { - Weight = 1.0; - } + public Fork() : base(0x9F4) => Weight = 1.0; public Fork(Serial serial) : base(serial) { @@ -31,10 +28,7 @@ namespace Server.Items public class ForkLeft : Item { [Constructible] - public ForkLeft() : base(0x9F4) - { - Weight = 1.0; - } + public ForkLeft() : base(0x9F4) => Weight = 1.0; public ForkLeft(Serial serial) : base(serial) { @@ -58,10 +52,7 @@ namespace Server.Items public class ForkRight : Item { [Constructible] - public ForkRight() : base(0x9F5) - { - Weight = 1.0; - } + public ForkRight() : base(0x9F5) => Weight = 1.0; public ForkRight(Serial serial) : base(serial) { @@ -86,10 +77,7 @@ namespace Server.Items public class Spoon : Item { [Constructible] - public Spoon() : base(0x9F8) - { - Weight = 1.0; - } + public Spoon() : base(0x9F8) => Weight = 1.0; public Spoon(Serial serial) : base(serial) { @@ -113,10 +101,7 @@ namespace Server.Items public class SpoonLeft : Item { [Constructible] - public SpoonLeft() : base(0x9F8) - { - Weight = 1.0; - } + public SpoonLeft() : base(0x9F8) => Weight = 1.0; public SpoonLeft(Serial serial) : base(serial) { @@ -140,10 +125,7 @@ namespace Server.Items public class SpoonRight : Item { [Constructible] - public SpoonRight() : base(0x9F9) - { - Weight = 1.0; - } + public SpoonRight() : base(0x9F9) => Weight = 1.0; public SpoonRight(Serial serial) : base(serial) { @@ -168,10 +150,7 @@ namespace Server.Items public class Knife : Item { [Constructible] - public Knife() : base(0x9F6) - { - Weight = 1.0; - } + public Knife() : base(0x9F6) => Weight = 1.0; public Knife(Serial serial) : base(serial) { @@ -195,10 +174,7 @@ namespace Server.Items public class KnifeLeft : Item { [Constructible] - public KnifeLeft() : base(0x9F6) - { - Weight = 1.0; - } + public KnifeLeft() : base(0x9F6) => Weight = 1.0; public KnifeLeft(Serial serial) : base(serial) { @@ -222,10 +198,7 @@ namespace Server.Items public class KnifeRight : Item { [Constructible] - public KnifeRight() : base(0x9F7) - { - Weight = 1.0; - } + public KnifeRight() : base(0x9F7) => Weight = 1.0; public KnifeRight(Serial serial) : base(serial) { @@ -249,10 +222,7 @@ namespace Server.Items public class Plate : Item { [Constructible] - public Plate() : base(0x9D7) - { - Weight = 1.0; - } + public Plate() : base(0x9D7) => Weight = 1.0; public Plate(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Tools/BaseRunicTool.cs b/Projects/Scripts/Items/Skill Items/Tools/BaseRunicTool.cs index 1d9dc0593..89afc377d 100644 --- a/Projects/Scripts/Items/Skill Items/Tools/BaseRunicTool.cs +++ b/Projects/Scripts/Items/Skill Items/Tools/BaseRunicTool.cs @@ -55,15 +55,9 @@ namespace Server.Items private static int[] m_Possible = new int[MaxProperties]; private CraftResource m_Resource; - public BaseRunicTool(CraftResource resource, int itemID) : base(itemID) - { - m_Resource = resource; - } + public BaseRunicTool(CraftResource resource, int itemID) : base(itemID) => m_Resource = resource; - public BaseRunicTool(CraftResource resource, int uses, int itemID) : base(uses, itemID) - { - m_Resource = resource; - } + public BaseRunicTool(CraftResource resource, int uses, int itemID) : base(uses, itemID) => m_Resource = resource; public BaseRunicTool(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Tools/BaseTool.cs b/Projects/Scripts/Items/Skill Items/Tools/BaseTool.cs index bbeb337b2..d8a6a2d46 100644 --- a/Projects/Scripts/Items/Skill Items/Tools/BaseTool.cs +++ b/Projects/Scripts/Items/Skill Items/Tools/BaseTool.cs @@ -131,10 +131,7 @@ namespace Server.Items LabelToAffix(m, 1017323, AffixType.Append, ": " + m_UsesRemaining); // Durability } - public static bool CheckAccessible(Item tool, Mobile m) - { - return tool.IsChildOf(m) || tool.Parent == m; - } + public static bool CheckAccessible(Item tool, Mobile m) => tool.IsChildOf(m) || tool.Parent == m; public static bool CheckTool(Item tool, Mobile m) { diff --git a/Projects/Scripts/Items/Skill Items/Tools/DovetailSaw.cs b/Projects/Scripts/Items/Skill Items/Tools/DovetailSaw.cs index f9661b7a7..60ca4c9ab 100644 --- a/Projects/Scripts/Items/Skill Items/Tools/DovetailSaw.cs +++ b/Projects/Scripts/Items/Skill Items/Tools/DovetailSaw.cs @@ -6,16 +6,10 @@ namespace Server.Items public class DovetailSaw : BaseTool { [Constructible] - public DovetailSaw() : base(0x1028) - { - Weight = 2.0; - } + public DovetailSaw() : base(0x1028) => Weight = 2.0; [Constructible] - public DovetailSaw(int uses) : base(uses, 0x1028) - { - Weight = 2.0; - } + public DovetailSaw(int uses) : base(uses, 0x1028) => Weight = 2.0; public DovetailSaw(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Tools/DrawKnife.cs b/Projects/Scripts/Items/Skill Items/Tools/DrawKnife.cs index 3c3e6fe46..66c720bfc 100644 --- a/Projects/Scripts/Items/Skill Items/Tools/DrawKnife.cs +++ b/Projects/Scripts/Items/Skill Items/Tools/DrawKnife.cs @@ -5,16 +5,10 @@ namespace Server.Items public class DrawKnife : BaseTool { [Constructible] - public DrawKnife() : base(0x10E4) - { - Weight = 1.0; - } + public DrawKnife() : base(0x10E4) => Weight = 1.0; [Constructible] - public DrawKnife(int uses) : base(uses, 0x10E4) - { - Weight = 1.0; - } + public DrawKnife(int uses) : base(uses, 0x10E4) => Weight = 1.0; public DrawKnife(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Tools/FletcherTools.cs b/Projects/Scripts/Items/Skill Items/Tools/FletcherTools.cs index 6454dd88c..b2ed69fe3 100644 --- a/Projects/Scripts/Items/Skill Items/Tools/FletcherTools.cs +++ b/Projects/Scripts/Items/Skill Items/Tools/FletcherTools.cs @@ -6,16 +6,10 @@ namespace Server.Items public class FletcherTools : BaseTool { [Constructible] - public FletcherTools() : base(0x1022) - { - Weight = 2.0; - } + public FletcherTools() : base(0x1022) => Weight = 2.0; [Constructible] - public FletcherTools(int uses) : base(uses, 0x1022) - { - Weight = 2.0; - } + public FletcherTools(int uses) : base(uses, 0x1022) => Weight = 2.0; public FletcherTools(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Tools/FlourSifter.cs b/Projects/Scripts/Items/Skill Items/Tools/FlourSifter.cs index cf825cb8d..ca1aa7437 100644 --- a/Projects/Scripts/Items/Skill Items/Tools/FlourSifter.cs +++ b/Projects/Scripts/Items/Skill Items/Tools/FlourSifter.cs @@ -5,16 +5,10 @@ namespace Server.Items public class FlourSifter : BaseTool { [Constructible] - public FlourSifter() : base(0x103E) - { - Weight = 1.0; - } + public FlourSifter() : base(0x103E) => Weight = 1.0; [Constructible] - public FlourSifter(int uses) : base(uses, 0x103E) - { - Weight = 1.0; - } + public FlourSifter(int uses) : base(uses, 0x103E) => Weight = 1.0; public FlourSifter(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Tools/Froe.cs b/Projects/Scripts/Items/Skill Items/Tools/Froe.cs index 5a635a39a..ec800f9b5 100644 --- a/Projects/Scripts/Items/Skill Items/Tools/Froe.cs +++ b/Projects/Scripts/Items/Skill Items/Tools/Froe.cs @@ -5,16 +5,10 @@ namespace Server.Items public class Froe : BaseTool { [Constructible] - public Froe() : base(0x10E5) - { - Weight = 1.0; - } + public Froe() : base(0x10E5) => Weight = 1.0; [Constructible] - public Froe(int uses) : base(uses, 0x10E5) - { - Weight = 1.0; - } + public Froe(int uses) : base(uses, 0x10E5) => Weight = 1.0; public Froe(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Tools/Hammer.cs b/Projects/Scripts/Items/Skill Items/Tools/Hammer.cs index 7de71ebbd..ae628d76e 100644 --- a/Projects/Scripts/Items/Skill Items/Tools/Hammer.cs +++ b/Projects/Scripts/Items/Skill Items/Tools/Hammer.cs @@ -5,16 +5,10 @@ namespace Server.Items public class Hammer : BaseTool { [Constructible] - public Hammer() : base(0x102A) - { - Weight = 2.0; - } + public Hammer() : base(0x102A) => Weight = 2.0; [Constructible] - public Hammer(int uses) : base(uses, 0x102A) - { - Weight = 2.0; - } + public Hammer(int uses) : base(uses, 0x102A) => Weight = 2.0; public Hammer(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Tools/Inshave.cs b/Projects/Scripts/Items/Skill Items/Tools/Inshave.cs index adff4c2db..54b944067 100644 --- a/Projects/Scripts/Items/Skill Items/Tools/Inshave.cs +++ b/Projects/Scripts/Items/Skill Items/Tools/Inshave.cs @@ -5,16 +5,10 @@ namespace Server.Items public class Inshave : BaseTool { [Constructible] - public Inshave() : base(0x10E6) - { - Weight = 1.0; - } + public Inshave() : base(0x10E6) => Weight = 1.0; [Constructible] - public Inshave(int uses) : base(uses, 0x10E6) - { - Weight = 1.0; - } + public Inshave(int uses) : base(uses, 0x10E6) => Weight = 1.0; public Inshave(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Tools/JointingPlane.cs b/Projects/Scripts/Items/Skill Items/Tools/JointingPlane.cs index 3d5eade58..7a9c496c1 100644 --- a/Projects/Scripts/Items/Skill Items/Tools/JointingPlane.cs +++ b/Projects/Scripts/Items/Skill Items/Tools/JointingPlane.cs @@ -6,16 +6,10 @@ namespace Server.Items public class JointingPlane : BaseTool { [Constructible] - public JointingPlane() : base(0x1030) - { - Weight = 2.0; - } + public JointingPlane() : base(0x1030) => Weight = 2.0; [Constructible] - public JointingPlane(int uses) : base(uses, 0x1030) - { - Weight = 2.0; - } + public JointingPlane(int uses) : base(uses, 0x1030) => Weight = 2.0; public JointingPlane(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Tools/MalletAndChisel.cs b/Projects/Scripts/Items/Skill Items/Tools/MalletAndChisel.cs index 057774c95..2743fa4d5 100644 --- a/Projects/Scripts/Items/Skill Items/Tools/MalletAndChisel.cs +++ b/Projects/Scripts/Items/Skill Items/Tools/MalletAndChisel.cs @@ -5,16 +5,10 @@ namespace Server.Items public class MalletAndChisel : BaseTool { [Constructible] - public MalletAndChisel() : base(0x12B3) - { - Weight = 1.0; - } + public MalletAndChisel() : base(0x12B3) => Weight = 1.0; [Constructible] - public MalletAndChisel(int uses) : base(uses, 0x12B3) - { - Weight = 1.0; - } + public MalletAndChisel(int uses) : base(uses, 0x12B3) => Weight = 1.0; public MalletAndChisel(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Tools/MapmakersPen.cs b/Projects/Scripts/Items/Skill Items/Tools/MapmakersPen.cs index f3931a789..86058f6a2 100644 --- a/Projects/Scripts/Items/Skill Items/Tools/MapmakersPen.cs +++ b/Projects/Scripts/Items/Skill Items/Tools/MapmakersPen.cs @@ -6,16 +6,10 @@ namespace Server.Items public class MapmakersPen : BaseTool { [Constructible] - public MapmakersPen() : base(0x0FBF) - { - Weight = 1.0; - } + public MapmakersPen() : base(0x0FBF) => Weight = 1.0; [Constructible] - public MapmakersPen(int uses) : base(uses, 0x0FBF) - { - Weight = 1.0; - } + public MapmakersPen(int uses) : base(uses, 0x0FBF) => Weight = 1.0; public MapmakersPen(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Tools/MortarPestle.cs b/Projects/Scripts/Items/Skill Items/Tools/MortarPestle.cs index 54770387f..41d038eba 100644 --- a/Projects/Scripts/Items/Skill Items/Tools/MortarPestle.cs +++ b/Projects/Scripts/Items/Skill Items/Tools/MortarPestle.cs @@ -5,16 +5,10 @@ namespace Server.Items public class MortarPestle : BaseTool { [Constructible] - public MortarPestle() : base(0xE9B) - { - Weight = 1.0; - } + public MortarPestle() : base(0xE9B) => Weight = 1.0; [Constructible] - public MortarPestle(int uses) : base(uses, 0xE9B) - { - Weight = 1.0; - } + public MortarPestle(int uses) : base(uses, 0xE9B) => Weight = 1.0; public MortarPestle(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Tools/MouldingPlane.cs b/Projects/Scripts/Items/Skill Items/Tools/MouldingPlane.cs index d4b4932d3..7a0ec9291 100644 --- a/Projects/Scripts/Items/Skill Items/Tools/MouldingPlane.cs +++ b/Projects/Scripts/Items/Skill Items/Tools/MouldingPlane.cs @@ -6,16 +6,10 @@ namespace Server.Items public class MouldingPlane : BaseTool { [Constructible] - public MouldingPlane() : base(0x102C) - { - Weight = 2.0; - } + public MouldingPlane() : base(0x102C) => Weight = 2.0; [Constructible] - public MouldingPlane(int uses) : base(uses, 0x102C) - { - Weight = 2.0; - } + public MouldingPlane(int uses) : base(uses, 0x102C) => Weight = 2.0; public MouldingPlane(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Tools/Nails.cs b/Projects/Scripts/Items/Skill Items/Tools/Nails.cs index 8bb379b0e..46a94d819 100644 --- a/Projects/Scripts/Items/Skill Items/Tools/Nails.cs +++ b/Projects/Scripts/Items/Skill Items/Tools/Nails.cs @@ -6,16 +6,10 @@ namespace Server.Items public class Nails : BaseTool { [Constructible] - public Nails() : base(0x102E) - { - Weight = 2.0; - } + public Nails() : base(0x102E) => Weight = 2.0; [Constructible] - public Nails(int uses) : base(uses, 0x102C) - { - Weight = 2.0; - } + public Nails(int uses) : base(uses, 0x102C) => Weight = 2.0; public Nails(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Tools/RollingPin.cs b/Projects/Scripts/Items/Skill Items/Tools/RollingPin.cs index ce779b34f..e165f94ff 100644 --- a/Projects/Scripts/Items/Skill Items/Tools/RollingPin.cs +++ b/Projects/Scripts/Items/Skill Items/Tools/RollingPin.cs @@ -5,16 +5,10 @@ namespace Server.Items public class RollingPin : BaseTool { [Constructible] - public RollingPin() : base(0x1043) - { - Weight = 1.0; - } + public RollingPin() : base(0x1043) => Weight = 1.0; [Constructible] - public RollingPin(int uses) : base(uses, 0x1043) - { - Weight = 1.0; - } + public RollingPin(int uses) : base(uses, 0x1043) => Weight = 1.0; public RollingPin(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Tools/Saw.cs b/Projects/Scripts/Items/Skill Items/Tools/Saw.cs index c28458d86..dbdec8ea5 100644 --- a/Projects/Scripts/Items/Skill Items/Tools/Saw.cs +++ b/Projects/Scripts/Items/Skill Items/Tools/Saw.cs @@ -6,16 +6,10 @@ namespace Server.Items public class Saw : BaseTool { [Constructible] - public Saw() : base(0x1034) - { - Weight = 2.0; - } + public Saw() : base(0x1034) => Weight = 2.0; [Constructible] - public Saw(int uses) : base(uses, 0x1034) - { - Weight = 2.0; - } + public Saw(int uses) : base(uses, 0x1034) => Weight = 2.0; public Saw(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Tools/Scorp.cs b/Projects/Scripts/Items/Skill Items/Tools/Scorp.cs index b78fc6aa0..eb334c32d 100644 --- a/Projects/Scripts/Items/Skill Items/Tools/Scorp.cs +++ b/Projects/Scripts/Items/Skill Items/Tools/Scorp.cs @@ -5,16 +5,10 @@ namespace Server.Items public class Scorp : BaseTool { [Constructible] - public Scorp() : base(0x10E7) - { - Weight = 1.0; - } + public Scorp() : base(0x10E7) => Weight = 1.0; [Constructible] - public Scorp(int uses) : base(uses, 0x10E7) - { - Weight = 1.0; - } + public Scorp(int uses) : base(uses, 0x10E7) => Weight = 1.0; public Scorp(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Tools/ScribesPen.cs b/Projects/Scripts/Items/Skill Items/Tools/ScribesPen.cs index 90023c912..52c7bc875 100644 --- a/Projects/Scripts/Items/Skill Items/Tools/ScribesPen.cs +++ b/Projects/Scripts/Items/Skill Items/Tools/ScribesPen.cs @@ -6,16 +6,10 @@ namespace Server.Items public class ScribesPen : BaseTool { [Constructible] - public ScribesPen() : base(0x0FBF) - { - Weight = 1.0; - } + public ScribesPen() : base(0x0FBF) => Weight = 1.0; [Constructible] - public ScribesPen(int uses) : base(uses, 0x0FBF) - { - Weight = 1.0; - } + public ScribesPen(int uses) : base(uses, 0x0FBF) => Weight = 1.0; public ScribesPen(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Tools/SewingKit.cs b/Projects/Scripts/Items/Skill Items/Tools/SewingKit.cs index bd777a1dd..e471a0b06 100644 --- a/Projects/Scripts/Items/Skill Items/Tools/SewingKit.cs +++ b/Projects/Scripts/Items/Skill Items/Tools/SewingKit.cs @@ -5,16 +5,10 @@ namespace Server.Items public class SewingKit : BaseTool { [Constructible] - public SewingKit() : base(0xF9D) - { - Weight = 2.0; - } + public SewingKit() : base(0xF9D) => Weight = 2.0; [Constructible] - public SewingKit(int uses) : base(uses, 0xF9D) - { - Weight = 2.0; - } + public SewingKit(int uses) : base(uses, 0xF9D) => Weight = 2.0; public SewingKit(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Tools/Skillet.cs b/Projects/Scripts/Items/Skill Items/Tools/Skillet.cs index 812058ec0..8e8bcfa84 100644 --- a/Projects/Scripts/Items/Skill Items/Tools/Skillet.cs +++ b/Projects/Scripts/Items/Skill Items/Tools/Skillet.cs @@ -5,16 +5,10 @@ namespace Server.Items public class Skillet : BaseTool { [Constructible] - public Skillet() : base(0x97F) - { - Weight = 1.0; - } + public Skillet() : base(0x97F) => Weight = 1.0; [Constructible] - public Skillet(int uses) : base(uses, 0x97F) - { - Weight = 1.0; - } + public Skillet(int uses) : base(uses, 0x97F) => Weight = 1.0; public Skillet(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Tools/SledgeHammer.cs b/Projects/Scripts/Items/Skill Items/Tools/SledgeHammer.cs index b54d23da8..2964a1114 100644 --- a/Projects/Scripts/Items/Skill Items/Tools/SledgeHammer.cs +++ b/Projects/Scripts/Items/Skill Items/Tools/SledgeHammer.cs @@ -6,16 +6,10 @@ namespace Server.Items public class SledgeHammer : BaseTool { [Constructible] - public SledgeHammer() : base(0xFB5) - { - Layer = Layer.OneHanded; - } + public SledgeHammer() : base(0xFB5) => Layer = Layer.OneHanded; [Constructible] - public SledgeHammer(int uses) : base(uses, 0xFB5) - { - Layer = Layer.OneHanded; - } + public SledgeHammer(int uses) : base(uses, 0xFB5) => Layer = Layer.OneHanded; public SledgeHammer(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Tools/SmoothingPlane.cs b/Projects/Scripts/Items/Skill Items/Tools/SmoothingPlane.cs index b84ebb800..cf11dcb08 100644 --- a/Projects/Scripts/Items/Skill Items/Tools/SmoothingPlane.cs +++ b/Projects/Scripts/Items/Skill Items/Tools/SmoothingPlane.cs @@ -6,16 +6,10 @@ namespace Server.Items public class SmoothingPlane : BaseTool { [Constructible] - public SmoothingPlane() : base(0x1032) - { - Weight = 1.0; - } + public SmoothingPlane() : base(0x1032) => Weight = 1.0; [Constructible] - public SmoothingPlane(int uses) : base(uses, 0x1032) - { - Weight = 1.0; - } + public SmoothingPlane(int uses) : base(uses, 0x1032) => Weight = 1.0; public SmoothingPlane(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Skill Items/Tools/TinkerTools.cs b/Projects/Scripts/Items/Skill Items/Tools/TinkerTools.cs index 37b19f5f4..8f98c6f0f 100644 --- a/Projects/Scripts/Items/Skill Items/Tools/TinkerTools.cs +++ b/Projects/Scripts/Items/Skill Items/Tools/TinkerTools.cs @@ -6,16 +6,10 @@ namespace Server.Items public class TinkerTools : BaseTool { [Constructible] - public TinkerTools() : base(0x1EB8) - { - Weight = 1.0; - } + public TinkerTools() : base(0x1EB8) => Weight = 1.0; [Constructible] - public TinkerTools(int uses) : base(uses, 0x1EB8) - { - Weight = 1.0; - } + public TinkerTools(int uses) : base(uses, 0x1EB8) => Weight = 1.0; public TinkerTools(Serial serial) : base(serial) { @@ -42,17 +36,13 @@ namespace Server.Items { [Constructible] public TinkersTools() - : base(0x1EBC) - { + : base(0x1EBC) => Weight = 1.0; - } [Constructible] public TinkersTools(int uses) - : base(uses, 0x1EBC) - { + : base(uses, 0x1EBC) => Weight = 1.0; - } public TinkersTools(Serial serial) : base(serial) diff --git a/Projects/Scripts/Items/Skill Items/Tools/Tongs.cs b/Projects/Scripts/Items/Skill Items/Tools/Tongs.cs index ed9f3c300..b8fe7aac3 100644 --- a/Projects/Scripts/Items/Skill Items/Tools/Tongs.cs +++ b/Projects/Scripts/Items/Skill Items/Tools/Tongs.cs @@ -6,16 +6,10 @@ namespace Server.Items public class Tongs : BaseTool { [Constructible] - public Tongs() : base(0xFBB) - { - Weight = 2.0; - } + public Tongs() : base(0xFBB) => Weight = 2.0; [Constructible] - public Tongs(int uses) : base(uses, 0xFBB) - { - Weight = 2.0; - } + public Tongs(int uses) : base(uses, 0xFBB) => Weight = 2.0; public Tongs(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/11th Year promo/EarringsOfProtection.cs b/Projects/Scripts/Items/Special/11th Year promo/EarringsOfProtection.cs index 660822792..388f3686f 100644 --- a/Projects/Scripts/Items/Special/11th Year promo/EarringsOfProtection.cs +++ b/Projects/Scripts/Items/Special/11th Year promo/EarringsOfProtection.cs @@ -79,10 +79,7 @@ m_Attribute = (AosElementAttribute)reader.ReadInt(); } - public static AosElementAttribute RandomType() - { - return GetTypes(Utility.Random(5)); - } + public static AosElementAttribute RandomType() => GetTypes(Utility.Random(5)); public static AosElementAttribute GetTypes(int value) { diff --git a/Projects/Scripts/Items/Special/8th Anniversary Items/Dawn's Music Box/DawnsMusicBox.cs b/Projects/Scripts/Items/Special/8th Anniversary Items/Dawn's Music Box/DawnsMusicBox.cs index 905c742d8..a5e75ee43 100644 --- a/Projects/Scripts/Items/Special/8th Anniversary Items/Dawn's Music Box/DawnsMusicBox.cs +++ b/Projects/Scripts/Items/Special/8th Anniversary Items/Dawn's Music Box/DawnsMusicBox.cs @@ -149,10 +149,7 @@ namespace Server.Items } } - public bool HasAccces(Mobile m) - { - return m.AccessLevel >= AccessLevel.GameMaster || BaseHouse.FindHouseAt(this)?.HasAccess(m) == true; - } + public bool HasAccces(Mobile m) => m.AccessLevel >= AccessLevel.GameMaster || BaseHouse.FindHouseAt(this)?.HasAccess(m) == true; public void PlayMusic(Mobile m, MusicName music) { diff --git a/Projects/Scripts/Items/Special/8th Anniversary Items/Dawn's Music Box/DawnsMusicGear.cs b/Projects/Scripts/Items/Special/8th Anniversary Items/Dawn's Music Box/DawnsMusicGear.cs index 21a8a01f8..dc8b90df8 100644 --- a/Projects/Scripts/Items/Special/8th Anniversary Items/Dawn's Music Box/DawnsMusicGear.cs +++ b/Projects/Scripts/Items/Special/8th Anniversary Items/Dawn's Music Box/DawnsMusicGear.cs @@ -102,10 +102,7 @@ namespace Server.Items { private DawnsMusicGear m_Gear; - public InternalTarget(DawnsMusicGear gear) : base(2, false, TargetFlags.None) - { - m_Gear = gear; - } + public InternalTarget(DawnsMusicGear gear) : base(2, false, TargetFlags.None) => m_Gear = gear; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Items/Special/8th Anniversary Items/FountainOfLife.cs b/Projects/Scripts/Items/Special/8th Anniversary Items/FountainOfLife.cs index dd919783b..60400b9b6 100644 --- a/Projects/Scripts/Items/Special/8th Anniversary Items/FountainOfLife.cs +++ b/Projects/Scripts/Items/Special/8th Anniversary Items/FountainOfLife.cs @@ -6,10 +6,8 @@ namespace Server.Items { [Constructible] public EnhancedBandage(int amount = 1) - : base(amount) - { + : base(amount) => Hue = 0x8A5; - } public EnhancedBandage(Serial serial) : base(serial) @@ -20,10 +18,7 @@ namespace Server.Items public override int LabelNumber => 1152441; // enhanced bandage - public override bool Dye(Mobile from, DyeTub sender) - { - return false; - } + public override bool Dye(Mobile from, DyeTub sender) => false; public override void AddNameProperties(ObjectPropertyList list) { @@ -88,10 +83,7 @@ namespace Server.Items } } - public override bool OnDragLift(Mobile from) - { - return false; - } + public override bool OnDragLift(Mobile from) => false; public override bool OnDragDrop(Mobile from, Item dropped) { diff --git a/Projects/Scripts/Items/Special/Broken Furniture Collection/BrokenArmoire.cs b/Projects/Scripts/Items/Special/Broken Furniture Collection/BrokenArmoire.cs index 5e20d9672..931c17d81 100644 --- a/Projects/Scripts/Items/Special/Broken Furniture Collection/BrokenArmoire.cs +++ b/Projects/Scripts/Items/Special/Broken Furniture Collection/BrokenArmoire.cs @@ -60,10 +60,7 @@ namespace Server.Items public class BrokenArmoireDeed : BaseAddonDeed { [Constructible] - public BrokenArmoireDeed() - { - LootType = LootType.Blessed; - } + public BrokenArmoireDeed() => LootType = LootType.Blessed; public BrokenArmoireDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Broken Furniture Collection/BrokenBed.cs b/Projects/Scripts/Items/Special/Broken Furniture Collection/BrokenBed.cs index ed8f7f072..84f898e19 100644 --- a/Projects/Scripts/Items/Special/Broken Furniture Collection/BrokenBed.cs +++ b/Projects/Scripts/Items/Special/Broken Furniture Collection/BrokenBed.cs @@ -50,10 +50,7 @@ namespace Server.Items private bool m_East; [Constructible] - public BrokenBedDeed() - { - LootType = LootType.Blessed; - } + public BrokenBedDeed() => LootType = LootType.Blessed; public BrokenBedDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Broken Furniture Collection/BrokenBookcase.cs b/Projects/Scripts/Items/Special/Broken Furniture Collection/BrokenBookcase.cs index e712b2624..3d7bd59f0 100644 --- a/Projects/Scripts/Items/Special/Broken Furniture Collection/BrokenBookcase.cs +++ b/Projects/Scripts/Items/Special/Broken Furniture Collection/BrokenBookcase.cs @@ -60,10 +60,7 @@ namespace Server.Items public class BrokenBookcaseDeed : BaseAddonDeed { [Constructible] - public BrokenBookcaseDeed() - { - LootType = LootType.Blessed; - } + public BrokenBookcaseDeed() => LootType = LootType.Blessed; public BrokenBookcaseDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Broken Furniture Collection/BrokenChestOfDrawers.cs b/Projects/Scripts/Items/Special/Broken Furniture Collection/BrokenChestOfDrawers.cs index 60eb46317..90f733a72 100644 --- a/Projects/Scripts/Items/Special/Broken Furniture Collection/BrokenChestOfDrawers.cs +++ b/Projects/Scripts/Items/Special/Broken Furniture Collection/BrokenChestOfDrawers.cs @@ -60,10 +60,7 @@ namespace Server.Items public class BrokenChestOfDrawersDeed : BaseAddonDeed { [Constructible] - public BrokenChestOfDrawersDeed() - { - LootType = LootType.Blessed; - } + public BrokenChestOfDrawersDeed() => LootType = LootType.Blessed; public BrokenChestOfDrawersDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Broken Furniture Collection/BrokenCoveredChair.cs b/Projects/Scripts/Items/Special/Broken Furniture Collection/BrokenCoveredChair.cs index b78f38077..c50cae0e8 100644 --- a/Projects/Scripts/Items/Special/Broken Furniture Collection/BrokenCoveredChair.cs +++ b/Projects/Scripts/Items/Special/Broken Furniture Collection/BrokenCoveredChair.cs @@ -60,10 +60,7 @@ namespace Server.Items public class BrokenCoveredChairDeed : BaseAddonDeed { [Constructible] - public BrokenCoveredChairDeed() - { - LootType = LootType.Blessed; - } + public BrokenCoveredChairDeed() => LootType = LootType.Blessed; public BrokenCoveredChairDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Broken Furniture Collection/BrokenFallenChair.cs b/Projects/Scripts/Items/Special/Broken Furniture Collection/BrokenFallenChair.cs index 076319e93..237fac450 100644 --- a/Projects/Scripts/Items/Special/Broken Furniture Collection/BrokenFallenChair.cs +++ b/Projects/Scripts/Items/Special/Broken Furniture Collection/BrokenFallenChair.cs @@ -63,10 +63,7 @@ namespace Server.Items public class BrokenFallenChairDeed : BaseAddonDeed { [Constructible] - public BrokenFallenChairDeed() - { - LootType = LootType.Blessed; - } + public BrokenFallenChairDeed() => LootType = LootType.Blessed; public BrokenFallenChairDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Broken Furniture Collection/BrokenVanity.cs b/Projects/Scripts/Items/Special/Broken Furniture Collection/BrokenVanity.cs index 419c15241..61bd0753e 100644 --- a/Projects/Scripts/Items/Special/Broken Furniture Collection/BrokenVanity.cs +++ b/Projects/Scripts/Items/Special/Broken Furniture Collection/BrokenVanity.cs @@ -46,10 +46,7 @@ namespace Server.Items private bool m_East; [Constructible] - public BrokenVanityDeed() - { - LootType = LootType.Blessed; - } + public BrokenVanityDeed() => LootType = LootType.Blessed; public BrokenVanityDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Broken Furniture Collection/StandingBrokenChair.cs b/Projects/Scripts/Items/Special/Broken Furniture Collection/StandingBrokenChair.cs index fdcc7a362..967755fac 100644 --- a/Projects/Scripts/Items/Special/Broken Furniture Collection/StandingBrokenChair.cs +++ b/Projects/Scripts/Items/Special/Broken Furniture Collection/StandingBrokenChair.cs @@ -60,10 +60,7 @@ namespace Server.Items public class StandingBrokenChairDeed : BaseAddonDeed { [Constructible] - public StandingBrokenChairDeed() - { - LootType = LootType.Blessed; - } + public StandingBrokenChairDeed() => LootType = LootType.Blessed; public StandingBrokenChairDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Bulk Order Rewards/Blacksmithy/GlovesOfMining.cs b/Projects/Scripts/Items/Special/Bulk Order Rewards/Blacksmithy/GlovesOfMining.cs index 8aea8c172..62b68ed70 100644 --- a/Projects/Scripts/Items/Special/Bulk Order Rewards/Blacksmithy/GlovesOfMining.cs +++ b/Projects/Scripts/Items/Special/Bulk Order Rewards/Blacksmithy/GlovesOfMining.cs @@ -4,10 +4,7 @@ namespace Server.Items public class LeatherGlovesOfMining : BaseGlovesOfMining { [Constructible] - public LeatherGlovesOfMining(int bonus) : base(bonus, 0x13C6) - { - Weight = 1; - } + public LeatherGlovesOfMining(int bonus) : base(bonus, 0x13C6) => Weight = 1; public LeatherGlovesOfMining(Serial serial) : base(serial) { @@ -51,10 +48,7 @@ namespace Server.Items public class StuddedGlovesOfMining : BaseGlovesOfMining { [Constructible] - public StuddedGlovesOfMining(int bonus) : base(bonus, 0x13D5) - { - Weight = 2; - } + public StuddedGlovesOfMining(int bonus) : base(bonus, 0x13D5) => Weight = 2; public StuddedGlovesOfMining(Serial serial) : base(serial) { @@ -96,10 +90,7 @@ namespace Server.Items public class RingmailGlovesOfMining : BaseGlovesOfMining { [Constructible] - public RingmailGlovesOfMining(int bonus) : base(bonus, 0x13EB) - { - Weight = 1; - } + public RingmailGlovesOfMining(int bonus) : base(bonus, 0x13EB) => Weight = 1; public RingmailGlovesOfMining(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Bulk Order Rewards/Blacksmithy/PowderOfTemperament.cs b/Projects/Scripts/Items/Special/Bulk Order Rewards/Blacksmithy/PowderOfTemperament.cs index 7458f7f5c..9bc48dcf4 100644 --- a/Projects/Scripts/Items/Special/Bulk Order Rewards/Blacksmithy/PowderOfTemperament.cs +++ b/Projects/Scripts/Items/Special/Bulk Order Rewards/Blacksmithy/PowderOfTemperament.cs @@ -93,10 +93,7 @@ namespace Server.Items { private PowderOfTemperament m_Powder; - public InternalTarget(PowderOfTemperament powder) : base(2, false, TargetFlags.None) - { - m_Powder = powder; - } + public InternalTarget(PowderOfTemperament powder) : base(2, false, TargetFlags.None) => m_Powder = powder; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Items/Special/Evil Home Decor Collection/AwesomeDisturbingPortrait.cs b/Projects/Scripts/Items/Special/Evil Home Decor Collection/AwesomeDisturbingPortrait.cs index 798bf00e9..de67d6d7b 100644 --- a/Projects/Scripts/Items/Special/Evil Home Decor Collection/AwesomeDisturbingPortrait.cs +++ b/Projects/Scripts/Items/Special/Evil Home Decor Collection/AwesomeDisturbingPortrait.cs @@ -155,10 +155,7 @@ namespace Server.Items public class AwesomeDisturbingPortraitDeed : BaseAddonDeed { [Constructible] - public AwesomeDisturbingPortraitDeed() - { - LootType = LootType.Blessed; - } + public AwesomeDisturbingPortraitDeed() => LootType = LootType.Blessed; public AwesomeDisturbingPortraitDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Evil Home Decor Collection/BedOfNails.cs b/Projects/Scripts/Items/Special/Evil Home Decor Collection/BedOfNails.cs index a499c7843..dc8fbe79e 100644 --- a/Projects/Scripts/Items/Special/Evil Home Decor Collection/BedOfNails.cs +++ b/Projects/Scripts/Items/Special/Evil Home Decor Collection/BedOfNails.cs @@ -159,10 +159,7 @@ namespace Server.Items public class BedOfNailsDeed : BaseAddonDeed { [Constructible] - public BedOfNailsDeed() - { - LootType = LootType.Blessed; - } + public BedOfNailsDeed() => LootType = LootType.Blessed; public BedOfNailsDeed(Serial serial) : base(serial) diff --git a/Projects/Scripts/Items/Special/Evil Home Decor Collection/BoneCouch.cs b/Projects/Scripts/Items/Special/Evil Home Decor Collection/BoneCouch.cs index cb071cd1b..02e407b6e 100644 --- a/Projects/Scripts/Items/Special/Evil Home Decor Collection/BoneCouch.cs +++ b/Projects/Scripts/Items/Special/Evil Home Decor Collection/BoneCouch.cs @@ -88,10 +88,7 @@ namespace Server.Items public class BoneCouchDeed : BaseAddonDeed { [Constructible] - public BoneCouchDeed() - { - LootType = LootType.Blessed; - } + public BoneCouchDeed() => LootType = LootType.Blessed; public BoneCouchDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Evil Home Decor Collection/BoneTable.cs b/Projects/Scripts/Items/Special/Evil Home Decor Collection/BoneTable.cs index ae79185ea..8ecbbcd76 100644 --- a/Projects/Scripts/Items/Special/Evil Home Decor Collection/BoneTable.cs +++ b/Projects/Scripts/Items/Special/Evil Home Decor Collection/BoneTable.cs @@ -32,10 +32,7 @@ namespace Server.Items public class BoneTableDeed : BaseAddonDeed { [Constructible] - public BoneTableDeed() - { - LootType = LootType.Blessed; - } + public BoneTableDeed() => LootType = LootType.Blessed; public BoneTableDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Evil Home Decor Collection/BoneThrone.cs b/Projects/Scripts/Items/Special/Evil Home Decor Collection/BoneThrone.cs index b17d23ef6..912a90f10 100644 --- a/Projects/Scripts/Items/Special/Evil Home Decor Collection/BoneThrone.cs +++ b/Projects/Scripts/Items/Special/Evil Home Decor Collection/BoneThrone.cs @@ -70,10 +70,7 @@ namespace Server.Items public class BoneThroneDeed : BaseAddonDeed { [Constructible] - public BoneThroneDeed() - { - LootType = LootType.Blessed; - } + public BoneThroneDeed() => LootType = LootType.Blessed; public BoneThroneDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Evil Home Decor Collection/CreepyPortrait.cs b/Projects/Scripts/Items/Special/Evil Home Decor Collection/CreepyPortrait.cs index 5820c5070..fad4aea70 100644 --- a/Projects/Scripts/Items/Special/Evil Home Decor Collection/CreepyPortrait.cs +++ b/Projects/Scripts/Items/Special/Evil Home Decor Collection/CreepyPortrait.cs @@ -108,10 +108,7 @@ namespace Server.Items public class CreepyPortraitDeed : BaseAddonDeed { [Constructible] - public CreepyPortraitDeed() - { - LootType = LootType.Blessed; - } + public CreepyPortraitDeed() => LootType = LootType.Blessed; public CreepyPortraitDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Evil Home Decor Collection/DisturbingPortrait.cs b/Projects/Scripts/Items/Special/Evil Home Decor Collection/DisturbingPortrait.cs index b3a894690..ddd256aca 100644 --- a/Projects/Scripts/Items/Special/Evil Home Decor Collection/DisturbingPortrait.cs +++ b/Projects/Scripts/Items/Special/Evil Home Decor Collection/DisturbingPortrait.cs @@ -8,10 +8,7 @@ namespace Server.Items { private Timer m_Timer; - public DisturbingPortraitComponent() : base(0x2A5D) - { - m_Timer = Timer.DelayCall(TimeSpan.FromMinutes(3), TimeSpan.FromMinutes(3), Change); - } + public DisturbingPortraitComponent() : base(0x2A5D) => m_Timer = Timer.DelayCall(TimeSpan.FromMinutes(3), TimeSpan.FromMinutes(3), Change); public DisturbingPortraitComponent(Serial serial) : base(serial) { @@ -92,10 +89,7 @@ namespace Server.Items public class DisturbingPortraitDeed : BaseAddonDeed { [Constructible] - public DisturbingPortraitDeed() - { - LootType = LootType.Blessed; - } + public DisturbingPortraitDeed() => LootType = LootType.Blessed; public DisturbingPortraitDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Evil Home Decor Collection/HauntedMirror.cs b/Projects/Scripts/Items/Special/Evil Home Decor Collection/HauntedMirror.cs index f595fd7d3..02f7848a1 100644 --- a/Projects/Scripts/Items/Special/Evil Home Decor Collection/HauntedMirror.cs +++ b/Projects/Scripts/Items/Special/Evil Home Decor Collection/HauntedMirror.cs @@ -83,10 +83,7 @@ namespace Server.Items public class HaunterMirrorDeed : BaseAddonDeed { [Constructible] - public HaunterMirrorDeed() - { - LootType = LootType.Blessed; - } + public HaunterMirrorDeed() => LootType = LootType.Blessed; public HaunterMirrorDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Evil Home Decor Collection/MountedPixieBlue.cs b/Projects/Scripts/Items/Special/Evil Home Decor Collection/MountedPixieBlue.cs index b049148be..59c6f8fd9 100644 --- a/Projects/Scripts/Items/Special/Evil Home Decor Collection/MountedPixieBlue.cs +++ b/Projects/Scripts/Items/Special/Evil Home Decor Collection/MountedPixieBlue.cs @@ -69,10 +69,7 @@ namespace Server.Items public class MountedPixieBlueDeed : BaseAddonDeed { [Constructible] - public MountedPixieBlueDeed() - { - LootType = LootType.Blessed; - } + public MountedPixieBlueDeed() => LootType = LootType.Blessed; public MountedPixieBlueDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Evil Home Decor Collection/MountedPixieGreen.cs b/Projects/Scripts/Items/Special/Evil Home Decor Collection/MountedPixieGreen.cs index 649d0c46d..aec15ca1c 100644 --- a/Projects/Scripts/Items/Special/Evil Home Decor Collection/MountedPixieGreen.cs +++ b/Projects/Scripts/Items/Special/Evil Home Decor Collection/MountedPixieGreen.cs @@ -69,10 +69,7 @@ namespace Server.Items public class MountedPixieGreenDeed : BaseAddonDeed { [Constructible] - public MountedPixieGreenDeed() - { - LootType = LootType.Blessed; - } + public MountedPixieGreenDeed() => LootType = LootType.Blessed; public MountedPixieGreenDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Evil Home Decor Collection/MountedPixieLime.cs b/Projects/Scripts/Items/Special/Evil Home Decor Collection/MountedPixieLime.cs index 3bb190f72..a24289c7f 100644 --- a/Projects/Scripts/Items/Special/Evil Home Decor Collection/MountedPixieLime.cs +++ b/Projects/Scripts/Items/Special/Evil Home Decor Collection/MountedPixieLime.cs @@ -69,10 +69,7 @@ namespace Server.Items public class MountedPixieLimeDeed : BaseAddonDeed { [Constructible] - public MountedPixieLimeDeed() - { - LootType = LootType.Blessed; - } + public MountedPixieLimeDeed() => LootType = LootType.Blessed; public MountedPixieLimeDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Evil Home Decor Collection/MountedPixieOrange.cs b/Projects/Scripts/Items/Special/Evil Home Decor Collection/MountedPixieOrange.cs index c91e44cdd..df1aae5e5 100644 --- a/Projects/Scripts/Items/Special/Evil Home Decor Collection/MountedPixieOrange.cs +++ b/Projects/Scripts/Items/Special/Evil Home Decor Collection/MountedPixieOrange.cs @@ -69,10 +69,7 @@ namespace Server.Items public class MountedPixieOrangeDeed : BaseAddonDeed { [Constructible] - public MountedPixieOrangeDeed() - { - LootType = LootType.Blessed; - } + public MountedPixieOrangeDeed() => LootType = LootType.Blessed; public MountedPixieOrangeDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Evil Home Decor Collection/MountedPixieWhite.cs b/Projects/Scripts/Items/Special/Evil Home Decor Collection/MountedPixieWhite.cs index 30a0d2db3..d8e3a3cac 100644 --- a/Projects/Scripts/Items/Special/Evil Home Decor Collection/MountedPixieWhite.cs +++ b/Projects/Scripts/Items/Special/Evil Home Decor Collection/MountedPixieWhite.cs @@ -69,10 +69,7 @@ namespace Server.Items public class MountedPixieWhiteDeed : BaseAddonDeed { [Constructible] - public MountedPixieWhiteDeed() - { - LootType = LootType.Blessed; - } + public MountedPixieWhiteDeed() => LootType = LootType.Blessed; public MountedPixieWhiteDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Evil Home Decor Collection/SacrificialAltar.cs b/Projects/Scripts/Items/Special/Evil Home Decor Collection/SacrificialAltar.cs index 8b7428d41..c8dfa3341 100644 --- a/Projects/Scripts/Items/Special/Evil Home Decor Collection/SacrificialAltar.cs +++ b/Projects/Scripts/Items/Special/Evil Home Decor Collection/SacrificialAltar.cs @@ -130,10 +130,7 @@ namespace Server.Items public class SacrificialAltarDeed : BaseAddonContainerDeed { [Constructible] - public SacrificialAltarDeed() - { - LootType = LootType.Blessed; - } + public SacrificialAltarDeed() => LootType = LootType.Blessed; public SacrificialAltarDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Evil Home Decor Collection/UnsettlingPortrait.cs b/Projects/Scripts/Items/Special/Evil Home Decor Collection/UnsettlingPortrait.cs index 4577d93a8..7210d97da 100644 --- a/Projects/Scripts/Items/Special/Evil Home Decor Collection/UnsettlingPortrait.cs +++ b/Projects/Scripts/Items/Special/Evil Home Decor Collection/UnsettlingPortrait.cs @@ -8,10 +8,7 @@ namespace Server.Items { private Timer m_Timer; - public UnsettlingPortraitComponent() : base(0x2A65) - { - m_Timer = Timer.DelayCall(TimeSpan.FromMinutes(3), TimeSpan.FromMinutes(3), ChangeDirection); - } + public UnsettlingPortraitComponent() : base(0x2A65) => m_Timer = Timer.DelayCall(TimeSpan.FromMinutes(3), TimeSpan.FromMinutes(3), ChangeDirection); public UnsettlingPortraitComponent(Serial serial) : base(serial) { @@ -95,10 +92,7 @@ namespace Server.Items public class UnsettlingPortraitDeed : BaseAddonDeed { [Constructible] - public UnsettlingPortraitDeed() - { - LootType = LootType.Blessed; - } + public UnsettlingPortraitDeed() => LootType = LootType.Blessed; public UnsettlingPortraitDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Gifts/HearthOfHomeFire.cs b/Projects/Scripts/Items/Special/Gifts/HearthOfHomeFire.cs index e6312618a..6006adbfd 100644 --- a/Projects/Scripts/Items/Special/Gifts/HearthOfHomeFire.cs +++ b/Projects/Scripts/Items/Special/Gifts/HearthOfHomeFire.cs @@ -53,10 +53,7 @@ namespace Server.Items private bool m_East; [Constructible] - public HearthOfHomeFireDeed() - { - LootType = LootType.Blessed; - } + public HearthOfHomeFireDeed() => LootType = LootType.Blessed; public HearthOfHomeFireDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Heritage Items/AppleTrunk.cs b/Projects/Scripts/Items/Special/Heritage Items/AppleTrunk.cs index ba3ba7b7b..d7b759133 100644 --- a/Projects/Scripts/Items/Special/Heritage Items/AppleTrunk.cs +++ b/Projects/Scripts/Items/Special/Heritage Items/AppleTrunk.cs @@ -32,10 +32,7 @@ namespace Server.Items public class AppleTrunkDeed : BaseAddonDeed { [Constructible] - public AppleTrunkDeed() - { - LootType = LootType.Blessed; - } + public AppleTrunkDeed() => LootType = LootType.Blessed; public AppleTrunkDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Heritage Items/BlueDecorativeRug.cs b/Projects/Scripts/Items/Special/Heritage Items/BlueDecorativeRug.cs index a84d76e24..19ae135b6 100644 --- a/Projects/Scripts/Items/Special/Heritage Items/BlueDecorativeRug.cs +++ b/Projects/Scripts/Items/Special/Heritage Items/BlueDecorativeRug.cs @@ -40,10 +40,7 @@ namespace Server.Items public class BlueDecorativeRugDeed : BaseAddonDeed { [Constructible] - public BlueDecorativeRugDeed() - { - LootType = LootType.Blessed; - } + public BlueDecorativeRugDeed() => LootType = LootType.Blessed; public BlueDecorativeRugDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Heritage Items/BlueFancyRug.cs b/Projects/Scripts/Items/Special/Heritage Items/BlueFancyRug.cs index 7bb39b6f7..2a0c305f0 100644 --- a/Projects/Scripts/Items/Special/Heritage Items/BlueFancyRug.cs +++ b/Projects/Scripts/Items/Special/Heritage Items/BlueFancyRug.cs @@ -40,10 +40,7 @@ namespace Server.Items public class BlueFancyRugDeed : BaseAddonDeed { [Constructible] - public BlueFancyRugDeed() - { - LootType = LootType.Blessed; - } + public BlueFancyRugDeed() => LootType = LootType.Blessed; public BlueFancyRugDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Heritage Items/BluePlainRug.cs b/Projects/Scripts/Items/Special/Heritage Items/BluePlainRug.cs index 4746e7357..81d26a931 100644 --- a/Projects/Scripts/Items/Special/Heritage Items/BluePlainRug.cs +++ b/Projects/Scripts/Items/Special/Heritage Items/BluePlainRug.cs @@ -40,10 +40,7 @@ namespace Server.Items public class BluePlainRugDeed : BaseAddonDeed { [Constructible] - public BluePlainRugDeed() - { - LootType = LootType.Blessed; - } + public BluePlainRugDeed() => LootType = LootType.Blessed; public BluePlainRugDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Heritage Items/BoilingCauldron.cs b/Projects/Scripts/Items/Special/Heritage Items/BoilingCauldron.cs index 0eed82cf5..fd1aab38c 100644 --- a/Projects/Scripts/Items/Special/Heritage Items/BoilingCauldron.cs +++ b/Projects/Scripts/Items/Special/Heritage Items/BoilingCauldron.cs @@ -37,10 +37,7 @@ namespace Server.Items public class BoilingCauldronDeed : BaseAddonContainerDeed { [Constructible] - public BoilingCauldronDeed() - { - LootType = LootType.Blessed; - } + public BoilingCauldronDeed() => LootType = LootType.Blessed; public BoilingCauldronDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Heritage Items/CherryBlossomTree.cs b/Projects/Scripts/Items/Special/Heritage Items/CherryBlossomTree.cs index 82540e7e8..a0c979ec5 100644 --- a/Projects/Scripts/Items/Special/Heritage Items/CherryBlossomTree.cs +++ b/Projects/Scripts/Items/Special/Heritage Items/CherryBlossomTree.cs @@ -33,10 +33,7 @@ namespace Server.Items public class CherryBlossomTreeDeed : BaseAddonDeed { [Constructible] - public CherryBlossomTreeDeed() - { - LootType = LootType.Blessed; - } + public CherryBlossomTreeDeed() => LootType = LootType.Blessed; public CherryBlossomTreeDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Heritage Items/CherryBlossomTrunk.cs b/Projects/Scripts/Items/Special/Heritage Items/CherryBlossomTrunk.cs index ca1b4965a..b0aa10344 100644 --- a/Projects/Scripts/Items/Special/Heritage Items/CherryBlossomTrunk.cs +++ b/Projects/Scripts/Items/Special/Heritage Items/CherryBlossomTrunk.cs @@ -32,10 +32,7 @@ namespace Server.Items public class CherryBlossomTrunkDeed : BaseAddonDeed { [Constructible] - public CherryBlossomTrunkDeed() - { - LootType = LootType.Blessed; - } + public CherryBlossomTrunkDeed() => LootType = LootType.Blessed; public CherryBlossomTrunkDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Heritage Items/CinnamonFancyRug.cs b/Projects/Scripts/Items/Special/Heritage Items/CinnamonFancyRug.cs index f1ae357ff..0e6db8e12 100644 --- a/Projects/Scripts/Items/Special/Heritage Items/CinnamonFancyRug.cs +++ b/Projects/Scripts/Items/Special/Heritage Items/CinnamonFancyRug.cs @@ -40,10 +40,7 @@ namespace Server.Items public class CinnamonFancyRugDeed : BaseAddonDeed { [Constructible] - public CinnamonFancyRugDeed() - { - LootType = LootType.Blessed; - } + public CinnamonFancyRugDeed() => LootType = LootType.Blessed; public CinnamonFancyRugDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Heritage Items/Curtains.cs b/Projects/Scripts/Items/Special/Heritage Items/Curtains.cs index 860182768..dee1b74c4 100644 --- a/Projects/Scripts/Items/Special/Heritage Items/Curtains.cs +++ b/Projects/Scripts/Items/Special/Heritage Items/Curtains.cs @@ -5,10 +5,7 @@ namespace Server.Items { public class CurtainsComponent : AddonComponent, IDyable { - public CurtainsComponent(int itemID, int closedID) : base(itemID) - { - ClosedID = closedID; - } + public CurtainsComponent(int itemID, int closedID) : base(itemID) => ClosedID = closedID; public CurtainsComponent(Serial serial) : base(serial) { @@ -119,10 +116,7 @@ namespace Server.Items private bool m_East; [Constructible] - public CurtainsDeed() - { - LootType = LootType.Blessed; - } + public CurtainsDeed() => LootType = LootType.Blessed; public CurtainsDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Heritage Items/Fountain.cs b/Projects/Scripts/Items/Special/Heritage Items/Fountain.cs index 4806d278f..2e60e5f69 100644 --- a/Projects/Scripts/Items/Special/Heritage Items/Fountain.cs +++ b/Projects/Scripts/Items/Special/Heritage Items/Fountain.cs @@ -31,10 +31,7 @@ namespace Server.Items public class FountainDeed : BaseAddonDeed { [Constructible] - public FountainDeed() - { - LootType = LootType.Blessed; - } + public FountainDeed() => LootType = LootType.Blessed; public FountainDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Heritage Items/FruitTrees.cs b/Projects/Scripts/Items/Special/Heritage Items/FruitTrees.cs index b58f59661..620d4763c 100644 --- a/Projects/Scripts/Items/Special/Heritage Items/FruitTrees.cs +++ b/Projects/Scripts/Items/Special/Heritage Items/FruitTrees.cs @@ -128,10 +128,7 @@ namespace Server.Items public class AppleTreeDeed : BaseAddonDeed { [Constructible] - public AppleTreeDeed() - { - LootType = LootType.Blessed; - } + public AppleTreeDeed() => LootType = LootType.Blessed; public AppleTreeDeed(Serial serial) : base(serial) { @@ -189,10 +186,7 @@ namespace Server.Items public class PeachTreeDeed : BaseAddonDeed { [Constructible] - public PeachTreeDeed() - { - LootType = LootType.Blessed; - } + public PeachTreeDeed() => LootType = LootType.Blessed; public PeachTreeDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Heritage Items/GoldenDecorativeRug.cs b/Projects/Scripts/Items/Special/Heritage Items/GoldenDecorativeRug.cs index 638760f9b..37c866b0b 100644 --- a/Projects/Scripts/Items/Special/Heritage Items/GoldenDecorativeRug.cs +++ b/Projects/Scripts/Items/Special/Heritage Items/GoldenDecorativeRug.cs @@ -40,10 +40,7 @@ namespace Server.Items public class GoldenDecorativeRugDeed : BaseAddonDeed { [Constructible] - public GoldenDecorativeRugDeed() - { - LootType = LootType.Blessed; - } + public GoldenDecorativeRugDeed() => LootType = LootType.Blessed; public GoldenDecorativeRugDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Heritage Items/Guillotine.cs b/Projects/Scripts/Items/Special/Heritage Items/Guillotine.cs index 4bfd83c0b..48c51c89f 100644 --- a/Projects/Scripts/Items/Special/Heritage Items/Guillotine.cs +++ b/Projects/Scripts/Items/Special/Heritage Items/Guillotine.cs @@ -138,10 +138,7 @@ namespace Server.Items public class GuillotineDeed : BaseAddonDeed { [Constructible] - public GuillotineDeed() - { - LootType = LootType.Blessed; - } + public GuillotineDeed() => LootType = LootType.Blessed; public GuillotineDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Heritage Items/HangingAxes.cs b/Projects/Scripts/Items/Special/Heritage Items/HangingAxes.cs index e8a8ae820..d59e8babc 100644 --- a/Projects/Scripts/Items/Special/Heritage Items/HangingAxes.cs +++ b/Projects/Scripts/Items/Special/Heritage Items/HangingAxes.cs @@ -46,10 +46,7 @@ namespace Server.Items private bool m_East; [Constructible] - public HangingAxesDeed() - { - LootType = LootType.Blessed; - } + public HangingAxesDeed() => LootType = LootType.Blessed; public HangingAxesDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Heritage Items/HangingSwords.cs b/Projects/Scripts/Items/Special/Heritage Items/HangingSwords.cs index 71836fb09..697391d71 100644 --- a/Projects/Scripts/Items/Special/Heritage Items/HangingSwords.cs +++ b/Projects/Scripts/Items/Special/Heritage Items/HangingSwords.cs @@ -46,10 +46,7 @@ namespace Server.Items private bool m_East; [Constructible] - public HangingSwordsDeed() - { - LootType = LootType.Blessed; - } + public HangingSwordsDeed() => LootType = LootType.Blessed; public HangingSwordsDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Heritage Items/HouseLadder.cs b/Projects/Scripts/Items/Special/Heritage Items/HouseLadder.cs index 9068c93de..f5114c946 100644 --- a/Projects/Scripts/Items/Special/Heritage Items/HouseLadder.cs +++ b/Projects/Scripts/Items/Special/Heritage Items/HouseLadder.cs @@ -71,10 +71,7 @@ namespace Server.Items private int m_Type; [Constructible] - public HouseLadderDeed() - { - LootType = LootType.Blessed; - } + public HouseLadderDeed() => LootType = LootType.Blessed; public HouseLadderDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Heritage Items/IronMaiden.cs b/Projects/Scripts/Items/Special/Heritage Items/IronMaiden.cs index 3d8889f0a..fac038c83 100644 --- a/Projects/Scripts/Items/Special/Heritage Items/IronMaiden.cs +++ b/Projects/Scripts/Items/Special/Heritage Items/IronMaiden.cs @@ -98,10 +98,7 @@ namespace Server.Items public class IronMaidenDeed : BaseAddonDeed { [Constructible] - public IronMaidenDeed() - { - LootType = LootType.Blessed; - } + public IronMaidenDeed() => LootType = LootType.Blessed; public IronMaidenDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Heritage Items/LargeFishingNet.cs b/Projects/Scripts/Items/Special/Heritage Items/LargeFishingNet.cs index 69f60ac75..136c63c9f 100644 --- a/Projects/Scripts/Items/Special/Heritage Items/LargeFishingNet.cs +++ b/Projects/Scripts/Items/Special/Heritage Items/LargeFishingNet.cs @@ -60,10 +60,7 @@ namespace Server.Items public class LargeFishingNetDeed : BaseAddonDeed { [Constructible] - public LargeFishingNetDeed() - { - LootType = LootType.Blessed; - } + public LargeFishingNetDeed() => LootType = LootType.Blessed; public LargeFishingNetDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Heritage Items/PeachTrunk.cs b/Projects/Scripts/Items/Special/Heritage Items/PeachTrunk.cs index a5c40976d..d8e4a81c3 100644 --- a/Projects/Scripts/Items/Special/Heritage Items/PeachTrunk.cs +++ b/Projects/Scripts/Items/Special/Heritage Items/PeachTrunk.cs @@ -32,10 +32,7 @@ namespace Server.Items public class PeachTrunkDeed : BaseAddonDeed { [Constructible] - public PeachTrunkDeed() - { - LootType = LootType.Blessed; - } + public PeachTrunkDeed() => LootType = LootType.Blessed; public PeachTrunkDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Heritage Items/PinkFancyRug.cs b/Projects/Scripts/Items/Special/Heritage Items/PinkFancyRug.cs index 2ca208d0b..16049fac2 100644 --- a/Projects/Scripts/Items/Special/Heritage Items/PinkFancyRug.cs +++ b/Projects/Scripts/Items/Special/Heritage Items/PinkFancyRug.cs @@ -40,10 +40,7 @@ namespace Server.Items public class PinkFancyRugDeed : BaseAddonDeed { [Constructible] - public PinkFancyRugDeed() - { - LootType = LootType.Blessed; - } + public PinkFancyRugDeed() => LootType = LootType.Blessed; public PinkFancyRugDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Heritage Items/RedPlainRug.cs b/Projects/Scripts/Items/Special/Heritage Items/RedPlainRug.cs index 5ae76630e..ff94dc9ba 100644 --- a/Projects/Scripts/Items/Special/Heritage Items/RedPlainRug.cs +++ b/Projects/Scripts/Items/Special/Heritage Items/RedPlainRug.cs @@ -40,10 +40,7 @@ namespace Server.Items public class RedPlainRugDeed : BaseAddonDeed { [Constructible] - public RedPlainRugDeed() - { - LootType = LootType.Blessed; - } + public RedPlainRugDeed() => LootType = LootType.Blessed; public RedPlainRugDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Heritage Items/Scarecrow.cs b/Projects/Scripts/Items/Special/Heritage Items/Scarecrow.cs index 95c4b17b6..437464e6c 100644 --- a/Projects/Scripts/Items/Special/Heritage Items/Scarecrow.cs +++ b/Projects/Scripts/Items/Special/Heritage Items/Scarecrow.cs @@ -60,10 +60,7 @@ namespace Server.Items public class ScarecrowDeed : BaseAddonDeed { [Constructible] - public ScarecrowDeed() - { - LootType = LootType.Blessed; - } + public ScarecrowDeed() => LootType = LootType.Blessed; public ScarecrowDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Heritage Items/SmallFishingNet.cs b/Projects/Scripts/Items/Special/Heritage Items/SmallFishingNet.cs index 84c4c5b81..b256ee366 100644 --- a/Projects/Scripts/Items/Special/Heritage Items/SmallFishingNet.cs +++ b/Projects/Scripts/Items/Special/Heritage Items/SmallFishingNet.cs @@ -60,10 +60,7 @@ namespace Server.Items public class SmallFishingNetDeed : BaseAddonDeed { [Constructible] - public SmallFishingNetDeed() - { - LootType = LootType.Blessed; - } + public SmallFishingNetDeed() => LootType = LootType.Blessed; public SmallFishingNetDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Heritage Items/Statue.cs b/Projects/Scripts/Items/Special/Heritage Items/Statue.cs index e20d6428c..6f73a0a38 100644 --- a/Projects/Scripts/Items/Special/Heritage Items/Statue.cs +++ b/Projects/Scripts/Items/Special/Heritage Items/Statue.cs @@ -48,10 +48,7 @@ namespace Server.Items private bool m_East; [Constructible] - public StoneStatueDeed() - { - LootType = LootType.Blessed; - } + public StoneStatueDeed() => LootType = LootType.Blessed; public StoneStatueDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Heritage Items/SuitOfGoldArmor.cs b/Projects/Scripts/Items/Special/Heritage Items/SuitOfGoldArmor.cs index 4f361aac1..d2da3a635 100644 --- a/Projects/Scripts/Items/Special/Heritage Items/SuitOfGoldArmor.cs +++ b/Projects/Scripts/Items/Special/Heritage Items/SuitOfGoldArmor.cs @@ -60,10 +60,7 @@ namespace Server.Items public class SuitOfGoldArmorDeed : BaseAddonDeed { [Constructible] - public SuitOfGoldArmorDeed() - { - LootType = LootType.Blessed; - } + public SuitOfGoldArmorDeed() => LootType = LootType.Blessed; public SuitOfGoldArmorDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Heritage Items/SuitOfSilverArmor.cs b/Projects/Scripts/Items/Special/Heritage Items/SuitOfSilverArmor.cs index 6eaf4ee7d..4dcd5b0f0 100644 --- a/Projects/Scripts/Items/Special/Heritage Items/SuitOfSilverArmor.cs +++ b/Projects/Scripts/Items/Special/Heritage Items/SuitOfSilverArmor.cs @@ -60,10 +60,7 @@ namespace Server.Items public class SuitOfSilverArmorDeed : BaseAddonDeed { [Constructible] - public SuitOfSilverArmorDeed() - { - LootType = LootType.Blessed; - } + public SuitOfSilverArmorDeed() => LootType = LootType.Blessed; public SuitOfSilverArmorDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Heritage Items/TableWithBlueCloth.cs b/Projects/Scripts/Items/Special/Heritage Items/TableWithBlueCloth.cs index 547713e3c..231159587 100644 --- a/Projects/Scripts/Items/Special/Heritage Items/TableWithBlueCloth.cs +++ b/Projects/Scripts/Items/Special/Heritage Items/TableWithBlueCloth.cs @@ -32,10 +32,7 @@ namespace Server.Items public class TableWithBlueClothDeed : BaseAddonDeed { [Constructible] - public TableWithBlueClothDeed() - { - LootType = LootType.Blessed; - } + public TableWithBlueClothDeed() => LootType = LootType.Blessed; public TableWithBlueClothDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Heritage Items/TableWithOrangeCloth.cs b/Projects/Scripts/Items/Special/Heritage Items/TableWithOrangeCloth.cs index e2b6820b3..e5afaff19 100644 --- a/Projects/Scripts/Items/Special/Heritage Items/TableWithOrangeCloth.cs +++ b/Projects/Scripts/Items/Special/Heritage Items/TableWithOrangeCloth.cs @@ -32,10 +32,7 @@ namespace Server.Items public class TableWithOrangeClothDeed : BaseAddonDeed { [Constructible] - public TableWithOrangeClothDeed() - { - LootType = LootType.Blessed; - } + public TableWithOrangeClothDeed() => LootType = LootType.Blessed; public TableWithOrangeClothDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Heritage Items/TableWithPurpleCloth.cs b/Projects/Scripts/Items/Special/Heritage Items/TableWithPurpleCloth.cs index ebdb22702..ac7d5d963 100644 --- a/Projects/Scripts/Items/Special/Heritage Items/TableWithPurpleCloth.cs +++ b/Projects/Scripts/Items/Special/Heritage Items/TableWithPurpleCloth.cs @@ -32,10 +32,7 @@ namespace Server.Items public class TableWithPurpleClothDeed : BaseAddonDeed { [Constructible] - public TableWithPurpleClothDeed() - { - LootType = LootType.Blessed; - } + public TableWithPurpleClothDeed() => LootType = LootType.Blessed; public TableWithPurpleClothDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Heritage Items/TableWithRedCloth.cs b/Projects/Scripts/Items/Special/Heritage Items/TableWithRedCloth.cs index 3a3d2ac9c..12e7197e1 100644 --- a/Projects/Scripts/Items/Special/Heritage Items/TableWithRedCloth.cs +++ b/Projects/Scripts/Items/Special/Heritage Items/TableWithRedCloth.cs @@ -32,10 +32,7 @@ namespace Server.Items public class TableWithRedClothDeed : BaseAddonDeed { [Constructible] - public TableWithRedClothDeed() - { - LootType = LootType.Blessed; - } + public TableWithRedClothDeed() => LootType = LootType.Blessed; public TableWithRedClothDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Heritage Items/UnmadeBed.cs b/Projects/Scripts/Items/Special/Heritage Items/UnmadeBed.cs index e40633445..1572458c2 100644 --- a/Projects/Scripts/Items/Special/Heritage Items/UnmadeBed.cs +++ b/Projects/Scripts/Items/Special/Heritage Items/UnmadeBed.cs @@ -50,10 +50,7 @@ namespace Server.Items private bool m_East; [Constructible] - public UnmadeBedDeed() - { - LootType = LootType.Blessed; - } + public UnmadeBedDeed() => LootType = LootType.Blessed; public UnmadeBedDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Heritage Items/Vanity.cs b/Projects/Scripts/Items/Special/Heritage Items/Vanity.cs index 98358f36b..6dff982f0 100644 --- a/Projects/Scripts/Items/Special/Heritage Items/Vanity.cs +++ b/Projects/Scripts/Items/Special/Heritage Items/Vanity.cs @@ -43,10 +43,7 @@ namespace Server.Items private bool m_East; [Constructible] - public VanityDeed() - { - LootType = LootType.Blessed; - } + public VanityDeed() => LootType = LootType.Blessed; public VanityDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Heritage Items/WallTorch.cs b/Projects/Scripts/Items/Special/Heritage Items/WallTorch.cs index d4c26a8c6..779769a63 100644 --- a/Projects/Scripts/Items/Special/Heritage Items/WallTorch.cs +++ b/Projects/Scripts/Items/Special/Heritage Items/WallTorch.cs @@ -90,10 +90,7 @@ namespace Server.Items public class WallTorchDeed : BaseAddonDeed { [Constructible] - public WallTorchDeed() - { - LootType = LootType.Blessed; - } + public WallTorchDeed() => LootType = LootType.Blessed; public WallTorchDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Heritage Items/WoodenCoffin.cs b/Projects/Scripts/Items/Special/Heritage Items/WoodenCoffin.cs index f6a593960..6ff15e7e6 100644 --- a/Projects/Scripts/Items/Special/Heritage Items/WoodenCoffin.cs +++ b/Projects/Scripts/Items/Special/Heritage Items/WoodenCoffin.cs @@ -75,10 +75,7 @@ namespace Server.Items private bool m_East; [Constructible] - public WoodenCoffinDeed() - { - LootType = LootType.Blessed; - } + public WoodenCoffinDeed() => LootType = LootType.Blessed; public WoodenCoffinDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Holiday/Christmas/HolidayTree.cs b/Projects/Scripts/Items/Special/Holiday/Christmas/HolidayTree.cs index f7de42c69..8123cebe3 100644 --- a/Projects/Scripts/Items/Special/Holiday/Christmas/HolidayTree.cs +++ b/Projects/Scripts/Items/Special/Holiday/Christmas/HolidayTree.cs @@ -102,10 +102,7 @@ namespace Server.Items public override int LabelNumber => 1041117; // a tree for the holidays - public bool CouldFit(IPoint3D p, Map map) - { - return map.CanFit((Point3D)p, 20); - } + public bool CouldFit(IPoint3D p, Map map) => map.CanFit((Point3D)p, 20); Item IAddon.Deed => new HolidayTreeDeed(); @@ -217,10 +214,7 @@ namespace Server.Items private class Ornament : Item { - public Ornament(int itemID) : base(itemID) - { - Movable = false; - } + public Ornament(int itemID) : base(itemID) => Movable = false; public Ornament(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Holiday/HolidayFoods.cs b/Projects/Scripts/Items/Special/Holiday/HolidayFoods.cs index f8643b919..1090667ae 100644 --- a/Projects/Scripts/Items/Special/Holiday/HolidayFoods.cs +++ b/Projects/Scripts/Items/Special/Holiday/HolidayFoods.cs @@ -32,10 +32,7 @@ namespace Server.Items return timer; } - public static int GetToothAche(Mobile from) - { - return m_ToothAches.TryGetValue(from, out CandyCaneTimer timer) ? timer.Eaten : 0; - } + public static int GetToothAche(Mobile from) => m_ToothAches.TryGetValue(from, out CandyCaneTimer timer) ? timer.Eaten : 0; public static void SetToothAche(Mobile from, int value) { diff --git a/Projects/Scripts/Items/Special/Holiday/HolidayGiftBoxes.cs b/Projects/Scripts/Items/Special/Holiday/HolidayGiftBoxes.cs index 8c8602387..44effdb8f 100644 --- a/Projects/Scripts/Items/Special/Holiday/HolidayGiftBoxes.cs +++ b/Projects/Scripts/Items/Special/Holiday/HolidayGiftBoxes.cs @@ -47,10 +47,8 @@ { [Constructible] public GiftBoxRectangle() - : base(Utility.RandomBool() ? 0x46A5 : 0x46A6) - { + : base(Utility.RandomBool() ? 0x46A5 : 0x46A6) => Hue = GiftBoxHues.RandomGiftBoxHue; - } public GiftBoxRectangle(Serial serial) : base(serial) @@ -76,10 +74,8 @@ { [Constructible] public GiftBoxCube() - : base(0x46A2) - { + : base(0x46A2) => Hue = GiftBoxHues.RandomGiftBoxHue; - } public GiftBoxCube(Serial serial) : base(serial) @@ -105,10 +101,8 @@ { [Constructible] public GiftBoxCylinder() - : base(0x46A3) - { + : base(0x46A3) => Hue = GiftBoxHues.RandomGiftBoxHue; - } public GiftBoxCylinder(Serial serial) : base(serial) @@ -134,10 +128,8 @@ { [Constructible] public GiftBoxOctogon() - : base(0x46A4) - { + : base(0x46A4) => Hue = GiftBoxHues.RandomGiftBoxHue; - } public GiftBoxOctogon(Serial serial) : base(serial) @@ -163,10 +155,8 @@ { [Constructible] public GiftBoxAngel() - : base(0x46A7) - { + : base(0x46A7) => Hue = GiftBoxHues.RandomGiftBoxHue; - } public GiftBoxAngel(Serial serial) : base(serial) @@ -193,10 +183,8 @@ { [Constructible] public GiftBoxNeon() - : base(Utility.RandomBool() ? 0x232A : 0x232B) - { + : base(Utility.RandomBool() ? 0x232A : 0x232B) => Hue = GiftBoxHues.RandomNeonBoxHue; - } public GiftBoxNeon(Serial serial) : base(serial) diff --git a/Projects/Scripts/Items/Special/Holiday/HolidayPottedPlant.cs b/Projects/Scripts/Items/Special/Holiday/HolidayPottedPlant.cs index d876aa30e..8465581a4 100644 --- a/Projects/Scripts/Items/Special/Holiday/HolidayPottedPlant.cs +++ b/Projects/Scripts/Items/Special/Holiday/HolidayPottedPlant.cs @@ -43,10 +43,8 @@ namespace Server.Items { [Constructible] public PottedPlantDeed() - : base(0x14F0) - { + : base(0x14F0) => LootType = LootType.Blessed; - } public PottedPlantDeed(Serial serial) : base(serial) diff --git a/Projects/Scripts/Items/Special/Holiday/IcyPatch.cs b/Projects/Scripts/Items/Special/Holiday/IcyPatch.cs index f1aa2b058..99b898ce0 100644 --- a/Projects/Scripts/Items/Special/Holiday/IcyPatch.cs +++ b/Projects/Scripts/Items/Special/Holiday/IcyPatch.cs @@ -15,10 +15,8 @@ namespace Server.Items } public IcyPatch(int itemid) - : base(itemid) - { + : base(itemid) => Hue = 0x481; - } public IcyPatch(Serial serial) : base(serial) diff --git a/Projects/Scripts/Items/Special/Holiday/SnowGlobes.cs b/Projects/Scripts/Items/Special/Holiday/SnowGlobes.cs index 35b53dcdb..b80895735 100644 --- a/Projects/Scripts/Items/Special/Holiday/SnowGlobes.cs +++ b/Projects/Scripts/Items/Special/Holiday/SnowGlobes.cs @@ -65,10 +65,7 @@ namespace Server.Items } [Constructible] - public SnowGlobeOne(SnowGlobeTypeOne type) - { - m_Type = type; - } + public SnowGlobeOne(SnowGlobeTypeOne type) => m_Type = type; public SnowGlobeOne(Serial serial) : base(serial) @@ -171,10 +168,7 @@ namespace Server.Items } [Constructible] - public SnowGlobeTwo(SnowGlobeTypeTwo type) - { - m_Type = type; - } + public SnowGlobeTwo(SnowGlobeTypeTwo type) => m_Type = type; public SnowGlobeTwo(Serial serial) : base(serial) @@ -261,10 +255,7 @@ namespace Server.Items } [Constructible] - public SnowGlobeThree(SnowGlobeTypeThree type) - { - m_Type = type; - } + public SnowGlobeThree(SnowGlobeTypeThree type) => m_Type = type; public SnowGlobeThree(Serial serial) : base(serial) diff --git a/Projects/Scripts/Items/Special/Holiday/SnowPiles.cs b/Projects/Scripts/Items/Special/Holiday/SnowPiles.cs index 2f140b4fc..d5081133a 100644 --- a/Projects/Scripts/Items/Special/Holiday/SnowPiles.cs +++ b/Projects/Scripts/Items/Special/Holiday/SnowPiles.cs @@ -12,10 +12,8 @@ [Constructible] public SnowPileDeco(int itemid) - : base(itemid) - { + : base(itemid) => Hue = 0x481; - } public SnowPileDeco(Serial serial) : base(serial) diff --git a/Projects/Scripts/Items/Special/Holiday/SnowStatue.cs b/Projects/Scripts/Items/Special/Holiday/SnowStatue.cs index 3e940388a..ea4803924 100644 --- a/Projects/Scripts/Items/Special/Holiday/SnowStatue.cs +++ b/Projects/Scripts/Items/Special/Holiday/SnowStatue.cs @@ -131,10 +131,8 @@ namespace Server.Items { [Constructible] public SnowStatueDeed() - : base(0x14F0) - { + : base(0x14F0) => LootType = LootType.Blessed; - } public SnowStatueDeed(Serial serial) : base(serial) diff --git a/Projects/Scripts/Items/Special/House Raffle/HouseRaffleDeed.cs b/Projects/Scripts/Items/Special/House Raffle/HouseRaffleDeed.cs index f03f70c66..52a3b6a62 100644 --- a/Projects/Scripts/Items/Special/House Raffle/HouseRaffleDeed.cs +++ b/Projects/Scripts/Items/Special/House Raffle/HouseRaffleDeed.cs @@ -82,10 +82,7 @@ namespace Server.Items public override double DefaultWeight => 1.0; - public bool ValidLocation() - { - return m_PlotLocation != Point3D.Zero && m_Facet != null && m_Facet != Map.Internal; - } + public bool ValidLocation() => m_PlotLocation != Point3D.Zero && m_Facet != null && m_Facet != Map.Internal; public override void GetProperties(ObjectPropertyList list) { diff --git a/Projects/Scripts/Items/Special/House Raffle/HouseRaffleManagementGump.cs b/Projects/Scripts/Items/Special/House Raffle/HouseRaffleManagementGump.cs index 38e0ecb39..3334198af 100644 --- a/Projects/Scripts/Items/Special/House Raffle/HouseRaffleManagementGump.cs +++ b/Projects/Scripts/Items/Special/House Raffle/HouseRaffleManagementGump.cs @@ -144,20 +144,11 @@ namespace Server.Gumps } } - public string Right(string text) - { - return $"
{text}
"; - } + public string Right(string text) => $"
{text}
"; - public string Center(string text) - { - return $"
{text}
"; - } + public string Center(string text) => $"
{text}
"; - public string Color(string text, int color) - { - return $"{text}"; - } + public string Color(string text, int color) => $"{text}"; public override void OnResponse(NetState sender, RelayInfo info) { diff --git a/Projects/Scripts/Items/Special/House Raffle/HouseRaffleRegion.cs b/Projects/Scripts/Items/Special/House Raffle/HouseRaffleRegion.cs index ced944ec7..35fa20d43 100644 --- a/Projects/Scripts/Items/Special/House Raffle/HouseRaffleRegion.cs +++ b/Projects/Scripts/Items/Special/House Raffle/HouseRaffleRegion.cs @@ -10,10 +10,8 @@ namespace Server.Regions private HouseRaffleStone m_Stone; public HouseRaffleRegion(HouseRaffleStone stone) - : base(null, stone.PlotFacet, DefaultPriority, stone.PlotBounds) - { + : base(null, stone.PlotFacet, DefaultPriority, stone.PlotBounds) => m_Stone = stone; - } public override bool AllowHousing(Mobile from, Point3D p) { diff --git a/Projects/Scripts/Items/Special/House Raffle/HouseRaffleStone.cs b/Projects/Scripts/Items/Special/House Raffle/HouseRaffleStone.cs index ba20c1f90..9186c5dc1 100644 --- a/Projects/Scripts/Items/Special/House Raffle/HouseRaffleStone.cs +++ b/Projects/Scripts/Items/Special/House Raffle/HouseRaffleStone.cs @@ -271,11 +271,9 @@ namespace Server.Items Timer.DelayCall(TimeSpan.FromMinutes(1.0), TimeSpan.FromMinutes(1.0), CheckEnd_OnTick); } - public bool ValidLocation() - { - return m_Bounds.Start != Point2D.Zero && m_Bounds.End != Point2D.Zero && m_Facet != null && - m_Facet != Map.Internal; - } + public bool ValidLocation() => + m_Bounds.Start != Point2D.Zero && m_Bounds.End != Point2D.Zero && m_Facet != null && + m_Facet != Map.Internal; private void InvalidateRegion() { @@ -362,10 +360,7 @@ namespace Server.Items return FormatLocation(GetPlotCenter(), m_Facet, true); } - public string FormatPrice() - { - return m_TicketPrice == 0 ? "FREE" : $"{m_TicketPrice} gold"; - } + public string FormatPrice() => m_TicketPrice == 0 ? "FREE" : $"{m_TicketPrice} gold"; public override void GetProperties(ObjectPropertyList list) { diff --git a/Projects/Scripts/Items/Special/ML/GrizzledMareStatuette.cs b/Projects/Scripts/Items/Special/ML/GrizzledMareStatuette.cs index 4272dd2a9..e2c9e5059 100644 --- a/Projects/Scripts/Items/Special/ML/GrizzledMareStatuette.cs +++ b/Projects/Scripts/Items/Special/ML/GrizzledMareStatuette.cs @@ -6,10 +6,7 @@ namespace Server.Items public class GrizzledMareStatuette : BaseImprisonedMobile { [Constructible] - public GrizzledMareStatuette() : base(0x2617) - { - Weight = 1.0; - } + public GrizzledMareStatuette() : base(0x2617) => Weight = 1.0; public GrizzledMareStatuette(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/ML/MinotaurHedge.cs b/Projects/Scripts/Items/Special/ML/MinotaurHedge.cs index 4c695f54c..511cd2716 100644 --- a/Projects/Scripts/Items/Special/ML/MinotaurHedge.cs +++ b/Projects/Scripts/Items/Special/ML/MinotaurHedge.cs @@ -3,10 +3,7 @@ namespace Server.Items public class MinotaurHedge : Item { [Constructible] - public MinotaurHedge() : base(Utility.Random(3215, 4)) - { - Weight = 1.0; - } + public MinotaurHedge() : base(Utility.Random(3215, 4)) => Weight = 1.0; public MinotaurHedge(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/ML/TormentedChains.cs b/Projects/Scripts/Items/Special/ML/TormentedChains.cs index 730c0254f..baa97cf2d 100644 --- a/Projects/Scripts/Items/Special/ML/TormentedChains.cs +++ b/Projects/Scripts/Items/Special/ML/TormentedChains.cs @@ -3,10 +3,7 @@ namespace Server.Items public class TormentedChains : Item { [Constructible] - public TormentedChains() : base(Utility.Random(6663, 2)) - { - Weight = 1.0; - } + public TormentedChains() : base(Utility.Random(6663, 2)) => Weight = 1.0; public TormentedChains(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/MonsterStatuette.cs b/Projects/Scripts/Items/Special/MonsterStatuette.cs index 2384fb81f..67fd6a21b 100644 --- a/Projects/Scripts/Items/Special/MonsterStatuette.cs +++ b/Projects/Scripts/Items/Special/MonsterStatuette.cs @@ -220,10 +220,7 @@ namespace Server.Items list.Add(502696); // turned off } - public bool IsOwner(Mobile mob) - { - return BaseHouse.FindHouseAt(this)?.IsOwner(mob) == true; - } + public bool IsOwner(Mobile mob) => BaseHouse.FindHouseAt(this)?.IsOwner(mob) == true; public override void OnDoubleClick(Mobile from) { diff --git a/Projects/Scripts/Items/Special/Mutation Core/PlagueBeastBackpack.cs b/Projects/Scripts/Items/Special/Mutation Core/PlagueBeastBackpack.cs index 036936d66..06ffeb582 100644 --- a/Projects/Scripts/Items/Special/Mutation Core/PlagueBeastBackpack.cs +++ b/Projects/Scripts/Items/Special/Mutation Core/PlagueBeastBackpack.cs @@ -16,10 +16,7 @@ namespace Server.Items 0x2B, 0x42, 0x54, 0x60 }; - public PlagueBeastBackpack() : base(0x261B) - { - Layer = Layer.Backpack; - } + public PlagueBeastBackpack() : base(0x261B) => Layer = Layer.Backpack; public PlagueBeastBackpack(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Mutation Core/PlagueBeastBlood.cs b/Projects/Scripts/Items/Special/Mutation Core/PlagueBeastBlood.cs index 5d83bd08e..de2ccc7b3 100644 --- a/Projects/Scripts/Items/Special/Mutation Core/PlagueBeastBlood.cs +++ b/Projects/Scripts/Items/Special/Mutation Core/PlagueBeastBlood.cs @@ -7,10 +7,7 @@ namespace Server.Items { private Timer m_Timer; - public PlagueBeastBlood() : base(0x122C, 0) - { - m_Timer = Timer.DelayCall(TimeSpan.FromSeconds(1.5), TimeSpan.FromSeconds(1.5), 3, Hemorrhage); - } + public PlagueBeastBlood() : base(0x122C, 0) => m_Timer = Timer.DelayCall(TimeSpan.FromSeconds(1.5), TimeSpan.FromSeconds(1.5), 3, Hemorrhage); public PlagueBeastBlood(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Mutation Core/PlagueBeastHeart.cs b/Projects/Scripts/Items/Special/Mutation Core/PlagueBeastHeart.cs index 098b5a787..31c52e418 100644 --- a/Projects/Scripts/Items/Special/Mutation Core/PlagueBeastHeart.cs +++ b/Projects/Scripts/Items/Special/Mutation Core/PlagueBeastHeart.cs @@ -44,10 +44,7 @@ namespace Server.Items private bool m_Delay; private PlagueBeastHeart m_Heart; - public InternalTimer(PlagueBeastHeart heart) : base(TimeSpan.FromSeconds(0.5), TimeSpan.FromSeconds(0.5)) - { - m_Heart = heart; - } + public InternalTimer(PlagueBeastHeart heart) : base(TimeSpan.FromSeconds(0.5), TimeSpan.FromSeconds(0.5)) => m_Heart = heart; protected override void OnTick() { diff --git a/Projects/Scripts/Items/Special/Mutation Core/PlagueBeastInnard.cs b/Projects/Scripts/Items/Special/Mutation Core/PlagueBeastInnard.cs index 80599c4fb..217c474cc 100644 --- a/Projects/Scripts/Items/Special/Mutation Core/PlagueBeastInnard.cs +++ b/Projects/Scripts/Items/Special/Mutation Core/PlagueBeastInnard.cs @@ -23,15 +23,9 @@ namespace Server.Items { } - public virtual bool Scissor(Mobile from, Scissors scissors) - { - return false; - } + public virtual bool Scissor(Mobile from, Scissors scissors) => false; - public virtual bool OnBandage(Mobile from) - { - return false; - } + public virtual bool OnBandage(Mobile from) => false; public override bool IsAccessibleTo(Mobile check) { @@ -76,10 +70,7 @@ namespace Server.Items public class PlagueBeastComponent : PlagueBeastInnard { - public PlagueBeastComponent(int itemID, int hue, bool movable = false) : base(itemID, hue) - { - Movable = movable; - } + public PlagueBeastComponent(int itemID, int hue, bool movable = false) : base(itemID, hue) => Movable = movable; public PlagueBeastComponent(Serial serial) : base(serial) { @@ -93,25 +84,13 @@ namespace Server.Items public bool IsReceptacle => ItemID == 0x9DF; - public override bool DropToItem(Mobile from, Item target, Point3D p) - { - return target is PlagueBeastBackpack && base.DropToItem(from, target, p); - } + public override bool DropToItem(Mobile from, Item target, Point3D p) => target is PlagueBeastBackpack && base.DropToItem(from, target, p); - public override bool AllowSecureTrade(Mobile from, Mobile to, Mobile newOwner, bool accepted) - { - return false; - } + public override bool AllowSecureTrade(Mobile from, Mobile to, Mobile newOwner, bool accepted) => false; - public override bool DropToMobile(Mobile from, Mobile target, Point3D p) - { - return false; - } + public override bool DropToMobile(Mobile from, Mobile target, Point3D p) => false; - public override bool DropToWorld(Mobile from, Point3D p) - { - return false; - } + public override bool DropToWorld(Mobile from, Point3D p) => false; public override bool OnDragDrop(Mobile from, Item dropped) { diff --git a/Projects/Scripts/Items/Special/Mutation Core/PlagueBeastOrgans.cs b/Projects/Scripts/Items/Special/Mutation Core/PlagueBeastOrgans.cs index 0330e8496..353c5bddb 100644 --- a/Projects/Scripts/Items/Special/Mutation Core/PlagueBeastOrgans.cs +++ b/Projects/Scripts/Items/Special/Mutation Core/PlagueBeastOrgans.cs @@ -69,15 +69,9 @@ namespace Server.Items m_Timer.Stop(); } - public virtual bool OnLifted(Mobile from, PlagueBeastComponent c) - { - return c.IsGland || c.IsBrain; - } + public virtual bool OnLifted(Mobile from, PlagueBeastComponent c) => c.IsGland || c.IsBrain; - public virtual bool OnDropped(Mobile from, Item item, PlagueBeastComponent to) - { - return false; - } + public virtual bool OnDropped(Mobile from, Item item, PlagueBeastComponent to) => false; public virtual void FinishOpening(Mobile from) { @@ -225,10 +219,7 @@ namespace Server.Items private int m_Veins; - public PlagueBeastRubbleOrgan() - { - m_Veins = 3; - } + public PlagueBeastRubbleOrgan() => m_Veins = 3; public PlagueBeastRubbleOrgan(Serial serial) : base(serial) { @@ -446,10 +437,7 @@ namespace Server.Items { private int m_Brains; - public PlagueBeastMainOrgan() - { - m_Brains = 0; - } + public PlagueBeastMainOrgan() => m_Brains = 0; public PlagueBeastMainOrgan(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Mutation Core/PlagueBeastVein.cs b/Projects/Scripts/Items/Special/Mutation Core/PlagueBeastVein.cs index 6cdf4780d..3f5c6a6bd 100644 --- a/Projects/Scripts/Items/Special/Mutation Core/PlagueBeastVein.cs +++ b/Projects/Scripts/Items/Special/Mutation Core/PlagueBeastVein.cs @@ -7,10 +7,7 @@ namespace Server.Items { private Timer m_Timer; - public PlagueBeastVein(int itemID, int hue) : base(itemID, hue) - { - Cut = false; - } + public PlagueBeastVein(int itemID, int hue) : base(itemID, hue) => Cut = false; public PlagueBeastVein(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Rares/Containers/BaseWaterContainer.cs b/Projects/Scripts/Items/Special/Rares/Containers/BaseWaterContainer.cs index b268d118f..7b4101441 100644 --- a/Projects/Scripts/Items/Special/Rares/Containers/BaseWaterContainer.cs +++ b/Projects/Scripts/Items/Special/Rares/Containers/BaseWaterContainer.cs @@ -5,10 +5,8 @@ private int m_Quantity; public BaseWaterContainer(int Item_Id, bool filled) - : base(Item_Id) - { + : base(Item_Id) => m_Quantity = filled ? MaxQuantity : 0; - } public BaseWaterContainer(Serial serial) : base(serial) diff --git a/Projects/Scripts/Items/Special/Solen Items/BagOfSending.cs b/Projects/Scripts/Items/Special/Solen Items/BagOfSending.cs index fc5733db4..612b9cb5f 100644 --- a/Projects/Scripts/Items/Special/Solen Items/BagOfSending.cs +++ b/Projects/Scripts/Items/Special/Solen Items/BagOfSending.cs @@ -216,10 +216,7 @@ namespace Server.Items { private BagOfSending m_Bag; - public SendTarget(BagOfSending bag) : base(-1, false, TargetFlags.None) - { - m_Bag = bag; - } + public SendTarget(BagOfSending bag) : base(-1, false, TargetFlags.None) => m_Bag = bag; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Items/Special/Solen Items/BallOfSummoning.cs b/Projects/Scripts/Items/Special/Solen Items/BallOfSummoning.cs index 356bd5951..e807a7fed 100644 --- a/Projects/Scripts/Items/Special/Solen Items/BallOfSummoning.cs +++ b/Projects/Scripts/Items/Special/Solen Items/BallOfSummoning.cs @@ -326,10 +326,7 @@ namespace Server.Items { private BallCallback m_Callback; - public BallEntry(BallCallback callback, int number) : base(number, 2) - { - m_Callback = callback; - } + public BallEntry(BallCallback callback, int number) : base(number, 2) => m_Callback = callback; public override void OnClick() { @@ -344,10 +341,7 @@ namespace Server.Items { private BallOfSummoning m_Ball; - public PetLinkTarget(BallOfSummoning ball) : base(-1, false, TargetFlags.None) - { - m_Ball = ball; - } + public PetLinkTarget(BallOfSummoning ball) : base(-1, false, TargetFlags.None) => m_Ball = ball; protected override void OnTarget(Mobile from, object targeted) { @@ -415,25 +409,13 @@ namespace Server.Items public override TimeSpan CastDelayBase => TimeSpan.FromSeconds(2.0); - public override TimeSpan GetCastRecovery() - { - return TimeSpan.Zero; - } + public override TimeSpan GetCastRecovery() => TimeSpan.Zero; - public override int GetMana() - { - return 0; - } + public override int GetMana() => 0; - public override bool ConsumeReagents() - { - return true; - } + public override bool ConsumeReagents() => true; - public override bool CheckFizzle() - { - return true; - } + public override bool CheckFizzle() => true; public void Stop() { diff --git a/Projects/Scripts/Items/Special/Solen Items/BraceletOfBinding.cs b/Projects/Scripts/Items/Special/Solen Items/BraceletOfBinding.cs index 8fa8deb06..e24e2907b 100644 --- a/Projects/Scripts/Items/Special/Solen Items/BraceletOfBinding.cs +++ b/Projects/Scripts/Items/Special/Solen Items/BraceletOfBinding.cs @@ -399,10 +399,7 @@ namespace Server.Items { private BraceletOfBinding m_Bracelet; - public BindTarget(BraceletOfBinding bracelet) : base(-1, false, TargetFlags.None) - { - m_Bracelet = bracelet; - } + public BindTarget(BraceletOfBinding bracelet) : base(-1, false, TargetFlags.None) => m_Bracelet = bracelet; protected override void OnTarget(Mobile from, object targeted) { @@ -443,10 +440,7 @@ namespace Server.Items { private BraceletOfBinding m_Bracelet; - public InscribePrompt(BraceletOfBinding bracelet) - { - m_Bracelet = bracelet; - } + public InscribePrompt(BraceletOfBinding bracelet) => m_Bracelet = bracelet; public override void OnResponse(Mobile from, string text) { diff --git a/Projects/Scripts/Items/Special/Solen Items/PowderOfTranslocation.cs b/Projects/Scripts/Items/Special/Solen Items/PowderOfTranslocation.cs index 7fc1ef3e3..ddf6278a7 100644 --- a/Projects/Scripts/Items/Special/Solen Items/PowderOfTranslocation.cs +++ b/Projects/Scripts/Items/Special/Solen Items/PowderOfTranslocation.cs @@ -52,10 +52,7 @@ namespace Server.Items { private PowderOfTranslocation m_Powder; - public InternalTarget(PowderOfTranslocation powder) : base(-1, false, TargetFlags.None) - { - m_Powder = powder; - } + public InternalTarget(PowderOfTranslocation powder) : base(-1, false, TargetFlags.None) => m_Powder = powder; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Items/Special/SoulStone.cs b/Projects/Scripts/Items/Special/SoulStone.cs index fd9d672d4..786d8055f 100644 --- a/Projects/Scripts/Items/Special/SoulStone.cs +++ b/Projects/Scripts/Items/Special/SoulStone.cs @@ -818,10 +818,8 @@ namespace Server.Items [Constructible] public SoulstoneFragment(int usesRemaining = 5, string account = null) : - base(account, Utility.Random(0x2AA1, 9)) - { + base(account, Utility.Random(0x2AA1, 9)) => m_UsesRemaining = usesRemaining; - } public SoulstoneFragment(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Special Scrolls/SpecialScroll.cs b/Projects/Scripts/Items/Special/Special Scrolls/SpecialScroll.cs index 6565b7e8a..374b46a0e 100644 --- a/Projects/Scripts/Items/Special/Special Scrolls/SpecialScroll.cs +++ b/Projects/Scripts/Items/Special/Special Scrolls/SpecialScroll.cs @@ -36,10 +36,7 @@ namespace Server.Items [CommandProperty(AccessLevel.GameMaster)] public double Value{ get; set; } - public virtual string GetNameLocalized() - { - return string.Concat("#", AosSkillBonuses.GetLabel(Skill).ToString()); - } + public virtual string GetNameLocalized() => string.Concat("#", AosSkillBonuses.GetLabel(Skill).ToString()); public virtual string GetName() { diff --git a/Projects/Scripts/Items/Special/Special Scrolls/StatScroll.cs b/Projects/Scripts/Items/Special/Special Scrolls/StatScroll.cs index b24ed42ad..4ebb96f5c 100644 --- a/Projects/Scripts/Items/Special/Special Scrolls/StatScroll.cs +++ b/Projects/Scripts/Items/Special/Special Scrolls/StatScroll.cs @@ -5,10 +5,7 @@ namespace Server.Items public class StatCapScroll : SpecialScroll { [Constructible] - public StatCapScroll(int value = 105) : base(SkillName.Alchemy, value) - { - Hue = 0x481; - } + public StatCapScroll(int value = 105) : base(SkillName.Alchemy, value) => Hue = 0x481; public StatCapScroll(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Veteran Rewards/BloodyPentagram.cs b/Projects/Scripts/Items/Special/Veteran Rewards/BloodyPentagram.cs index b5137593d..125912bc9 100644 --- a/Projects/Scripts/Items/Special/Veteran Rewards/BloodyPentagram.cs +++ b/Projects/Scripts/Items/Special/Veteran Rewards/BloodyPentagram.cs @@ -128,10 +128,7 @@ namespace Server.Items private bool m_IsRewardItem; [Constructible] - public BloodyPentagramDeed() - { - LootType = LootType.Blessed; - } + public BloodyPentagramDeed() => LootType = LootType.Blessed; public BloodyPentagramDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Veteran Rewards/Cannon.cs b/Projects/Scripts/Items/Special/Veteran Rewards/Cannon.cs index 13634ade1..a39989919 100644 --- a/Projects/Scripts/Items/Special/Veteran Rewards/Cannon.cs +++ b/Projects/Scripts/Items/Special/Veteran Rewards/Cannon.cs @@ -9,10 +9,7 @@ namespace Server.Items { public class CannonAddonComponent : AddonComponent { - public CannonAddonComponent(int itemID) : base(itemID) - { - LootType = LootType.Blessed; - } + public CannonAddonComponent(int itemID) : base(itemID) => LootType = LootType.Blessed; public CannonAddonComponent(Serial serial) : base(serial) { @@ -254,10 +251,7 @@ namespace Server.Items { private CannonAddon m_Cannon; - public InternalTarget(CannonAddon cannon) : base(12, true, TargetFlags.None) - { - m_Cannon = cannon; - } + public InternalTarget(CannonAddon cannon) : base(12, true, TargetFlags.None) => m_Cannon = cannon; protected override void OnTarget(Mobile from, object targeted) { @@ -373,10 +367,7 @@ namespace Server.Items private bool m_IsRewardItem; [Constructible] - public CannonDeed() - { - LootType = LootType.Blessed; - } + public CannonDeed() => LootType = LootType.Blessed; public CannonDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Veteran Rewards/DecorativeShield.cs b/Projects/Scripts/Items/Special/Veteran Rewards/DecorativeShield.cs index 545432dd1..27347c66d 100644 --- a/Projects/Scripts/Items/Special/Veteran Rewards/DecorativeShield.cs +++ b/Projects/Scripts/Items/Special/Veteran Rewards/DecorativeShield.cs @@ -11,10 +11,7 @@ namespace Server.Items private bool m_IsRewardItem; [Constructible] - public DecorativeShield(int itemID = 0x156C) : base(itemID) - { - Movable = false; - } + public DecorativeShield(int itemID = 0x156C) : base(itemID) => Movable = false; public DecorativeShield(Serial serial) : base(serial) { @@ -44,12 +41,10 @@ namespace Server.Items } } - public bool CouldFit(IPoint3D p, Map map) - { - return map?.CanFit(p.X, p.Y, p.Z, ItemData.Height) == true && (FacingSouth - && BaseAddon.IsWall(p.X, p.Y - 1, p.Z, map) - || BaseAddon.IsWall(p.X - 1, p.Y, p.Z, map)); - } + public bool CouldFit(IPoint3D p, Map map) => + map?.CanFit(p.X, p.Y, p.Z, ItemData.Height) == true && (FacingSouth + && BaseAddon.IsWall(p.X, p.Y - 1, p.Z, map) + || BaseAddon.IsWall(p.X - 1, p.Y, p.Z, map)); [CommandProperty(AccessLevel.GameMaster)] public bool IsRewardItem diff --git a/Projects/Scripts/Items/Special/Veteran Rewards/FlamingHead.cs b/Projects/Scripts/Items/Special/Veteran Rewards/FlamingHead.cs index 5e8aad4f6..61a2bf149 100644 --- a/Projects/Scripts/Items/Special/Veteran Rewards/FlamingHead.cs +++ b/Projects/Scripts/Items/Special/Veteran Rewards/FlamingHead.cs @@ -196,10 +196,7 @@ namespace Server.Items { private FlamingHeadDeed m_Head; - public InternalTarget(FlamingHeadDeed head) : base(-1, true, TargetFlags.None) - { - m_Head = head; - } + public InternalTarget(FlamingHeadDeed head) : base(-1, true, TargetFlags.None) => m_Head = head; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Items/Special/Veteran Rewards/MiningCart.cs b/Projects/Scripts/Items/Special/Veteran Rewards/MiningCart.cs index ab9255efd..e3c3b4926 100644 --- a/Projects/Scripts/Items/Special/Veteran Rewards/MiningCart.cs +++ b/Projects/Scripts/Items/Special/Veteran Rewards/MiningCart.cs @@ -337,10 +337,7 @@ namespace Server.Items private bool m_IsRewardItem; [Constructible] - public MiningCartDeed() - { - LootType = LootType.Blessed; - } + public MiningCartDeed() => LootType = LootType.Blessed; public MiningCartDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Veteran Rewards/MinotaurStatue.cs b/Projects/Scripts/Items/Special/Veteran Rewards/MinotaurStatue.cs index 55cb44c96..48b88628a 100644 --- a/Projects/Scripts/Items/Special/Veteran Rewards/MinotaurStatue.cs +++ b/Projects/Scripts/Items/Special/Veteran Rewards/MinotaurStatue.cs @@ -94,10 +94,7 @@ namespace Server.Items private MinotaurStatueType m_StatueType; [Constructible] - public MinotaurStatueDeed() - { - LootType = LootType.Blessed; - } + public MinotaurStatueDeed() => LootType = LootType.Blessed; public MinotaurStatueDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Veteran Rewards/PottedCactus.cs b/Projects/Scripts/Items/Special/Veteran Rewards/PottedCactus.cs index f6c196d6c..d4e317e4b 100644 --- a/Projects/Scripts/Items/Special/Veteran Rewards/PottedCactus.cs +++ b/Projects/Scripts/Items/Special/Veteran Rewards/PottedCactus.cs @@ -14,10 +14,7 @@ namespace Server.Items } [Constructible] - public RewardPottedCactus(int itemID) : base(itemID) - { - Weight = 5.0; - } + public RewardPottedCactus(int itemID) : base(itemID) => Weight = 5.0; public RewardPottedCactus(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Veteran Rewards/StoneAnkh.cs b/Projects/Scripts/Items/Special/Veteran Rewards/StoneAnkh.cs index d48c73219..b30a934fd 100644 --- a/Projects/Scripts/Items/Special/Veteran Rewards/StoneAnkh.cs +++ b/Projects/Scripts/Items/Special/Veteran Rewards/StoneAnkh.cs @@ -7,10 +7,7 @@ namespace Server.Items { public class StoneAnkhComponent : AddonComponent { - public StoneAnkhComponent(int itemID) : base(itemID) - { - Weight = 1.0; - } + public StoneAnkhComponent(int itemID) : base(itemID) => Weight = 1.0; public StoneAnkhComponent(Serial serial) : base(serial) { @@ -147,10 +144,7 @@ namespace Server.Items private bool m_IsRewardItem; [Constructible] - public StoneAnkhDeed() - { - LootType = LootType.Blessed; - } + public StoneAnkhDeed() => LootType = LootType.Blessed; public StoneAnkhDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Veteran Rewards/TreeStump.cs b/Projects/Scripts/Items/Special/Veteran Rewards/TreeStump.cs index 5e17e6956..a86615836 100644 --- a/Projects/Scripts/Items/Special/Veteran Rewards/TreeStump.cs +++ b/Projects/Scripts/Items/Special/Veteran Rewards/TreeStump.cs @@ -190,10 +190,7 @@ namespace Server.Items private int m_Logs; [Constructible] - public TreeStumpDeed() - { - LootType = LootType.Blessed; - } + public TreeStumpDeed() => LootType = LootType.Blessed; public TreeStumpDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Veteran Rewards/WallBanner.cs b/Projects/Scripts/Items/Special/Veteran Rewards/WallBanner.cs index bf3a270f4..0eac7fbf3 100644 --- a/Projects/Scripts/Items/Special/Veteran Rewards/WallBanner.cs +++ b/Projects/Scripts/Items/Special/Veteran Rewards/WallBanner.cs @@ -269,10 +269,7 @@ namespace Server.Items private bool m_IsRewardItem; [Constructible] - public WallBannerDeed() - { - LootType = LootType.Blessed; - } + public WallBannerDeed() => LootType = LootType.Blessed; public WallBannerDeed(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Special/Veteran Rewards/WeaponEngravingTool.cs b/Projects/Scripts/Items/Special/Veteran Rewards/WeaponEngravingTool.cs index 403059879..1aedb0211 100644 --- a/Projects/Scripts/Items/Special/Veteran Rewards/WeaponEngravingTool.cs +++ b/Projects/Scripts/Items/Special/Veteran Rewards/WeaponEngravingTool.cs @@ -185,19 +185,13 @@ namespace Server.Items } } - public static WeaponEngravingTool Find(Mobile from) - { - return from.Backpack?.FindItemByType(); - } + public static WeaponEngravingTool Find(Mobile from) => from.Backpack?.FindItemByType(); private class TargetWeapon : Target { private WeaponEngravingTool m_Tool; - public TargetWeapon(WeaponEngravingTool tool) : base(-1, true, TargetFlags.None) - { - m_Tool = tool; - } + public TargetWeapon(WeaponEngravingTool tool) : base(-1, true, TargetFlags.None) => m_Tool = tool; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Items/Suits/BaseSuit.cs b/Projects/Scripts/Items/Suits/BaseSuit.cs index d824c571e..3e687c3d7 100644 --- a/Projects/Scripts/Items/Suits/BaseSuit.cs +++ b/Projects/Scripts/Items/Suits/BaseSuit.cs @@ -67,10 +67,7 @@ namespace Server.Items base.OnDoubleClick(from); } - public override bool VerifyMove(Mobile from) - { - return from.AccessLevel >= AccessLevel; - } + public override bool VerifyMove(Mobile from) => from.AccessLevel >= AccessLevel; public override bool OnEquip(Mobile from) { diff --git a/Projects/Scripts/Items/Talismans/BaseTalisman.cs b/Projects/Scripts/Items/Talismans/BaseTalisman.cs index 1450952b7..2d6ec4b6a 100644 --- a/Projects/Scripts/Items/Talismans/BaseTalisman.cs +++ b/Projects/Scripts/Items/Talismans/BaseTalisman.cs @@ -440,10 +440,7 @@ namespace Server.Items flags |= toSet; } - private static bool GetSaveFlag(SaveFlag flags, SaveFlag toGet) - { - return (flags & toGet) != 0; - } + private static bool GetSaveFlag(SaveFlag flags, SaveFlag toGet) => (flags & toGet) != 0; public override void Serialize(GenericWriter writer) { @@ -598,10 +595,7 @@ namespace Server.Items InvalidateProperties(); } - public virtual Type GetSummoner() - { - return null; - } + public virtual Type GetSummoner() => null; public virtual void SetSummoner(Type type, TextDefinition name) { @@ -646,10 +640,8 @@ namespace Server.Items private BaseTalisman m_Talisman; public TalismanTarget(BaseTalisman talisman) - : base(12, false, TargetFlags.Beneficial) - { + : base(12, false, TargetFlags.Beneficial) => m_Talisman = talisman; - } protected override void OnTarget(Mobile from, object o) { @@ -937,10 +929,7 @@ namespace Server.Items 0x2F58, 0x2F59, 0x2F5A, 0x2F5B }; - public static int GetRandomItemID() - { - return Utility.RandomList(m_ItemIDs); - } + public static int GetRandomItemID() => Utility.RandomList(m_ItemIDs); private static Type[] m_Summons = { @@ -992,10 +981,7 @@ namespace Server.Items 1023817 // clean bandage }; - public static Type GetRandomSummonType() - { - return m_Summons[Utility.Random(m_Summons.Length)]; - } + public static Type GetRandomSummonType() => m_Summons[Utility.Random(m_Summons.Length)]; public static TalismanAttribute GetRandomSummoner() { @@ -1052,10 +1038,7 @@ namespace Server.Items 1072493, 1072494, 1072495, 1072498 }; - public static TalismanAttribute GetRandomKiller() - { - return GetRandomKiller(true); - } + public static TalismanAttribute GetRandomKiller() => GetRandomKiller(true); public static TalismanAttribute GetRandomKiller(bool includingNone) { @@ -1067,10 +1050,7 @@ namespace Server.Items return new TalismanAttribute(m_Killers[num], m_KillerLabels[num], Utility.RandomMinMax(10, 100)); } - public static TalismanAttribute GetRandomProtection() - { - return GetRandomProtection(true); - } + public static TalismanAttribute GetRandomProtection() => GetRandomProtection(true); public static TalismanAttribute GetRandomProtection(bool includingNone) { @@ -1095,10 +1075,7 @@ namespace Server.Items SkillName.Tinkering }; - public static SkillName GetRandomSkill() - { - return m_Skills[Utility.Random(m_Skills.Length)]; - } + public static SkillName GetRandomSkill() => m_Skills[Utility.Random(m_Skills.Length)]; public static int GetRandomExceptional() { @@ -1124,20 +1101,11 @@ namespace Server.Items return 0; } - public static bool GetRandomBlessed() - { - return 0.02 > Utility.RandomDouble(); - } + public static bool GetRandomBlessed() => 0.02 > Utility.RandomDouble(); - public static TalismanSlayerName GetRandomSlayer() - { - return 0.01 > Utility.RandomDouble() ? (TalismanSlayerName)Utility.RandomMinMax(1, 9) : TalismanSlayerName.None; - } + public static TalismanSlayerName GetRandomSlayer() => 0.01 > Utility.RandomDouble() ? (TalismanSlayerName)Utility.RandomMinMax(1, 9) : TalismanSlayerName.None; - public static int GetRandomCharges() - { - return 0.5 > Utility.RandomDouble() ? Utility.RandomMinMax(10, 50) : 0; - } + public static int GetRandomCharges() => 0.5 > Utility.RandomDouble() ? Utility.RandomMinMax(10, 50) : 0; #endregion } diff --git a/Projects/Scripts/Items/Talismans/Items/EnchantedSwitch.cs b/Projects/Scripts/Items/Talismans/Items/EnchantedSwitch.cs index 24e0498bf..dbcca242b 100644 --- a/Projects/Scripts/Items/Talismans/Items/EnchantedSwitch.cs +++ b/Projects/Scripts/Items/Talismans/Items/EnchantedSwitch.cs @@ -3,10 +3,7 @@ namespace Server.Items public class EnchantedSwitch : Item { [Constructible] - public EnchantedSwitch() : base(0x2F5C) - { - Weight = 1.0; - } + public EnchantedSwitch() : base(0x2F5C) => Weight = 1.0; public EnchantedSwitch(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Talismans/Items/HollowPrism.cs b/Projects/Scripts/Items/Talismans/Items/HollowPrism.cs index accf931af..416061cf8 100644 --- a/Projects/Scripts/Items/Talismans/Items/HollowPrism.cs +++ b/Projects/Scripts/Items/Talismans/Items/HollowPrism.cs @@ -3,10 +3,7 @@ namespace Server.Items public class HollowPrism : Item { [Constructible] - public HollowPrism() : base(0x2F5D) - { - Weight = 1.0; - } + public HollowPrism() : base(0x2F5D) => Weight = 1.0; public HollowPrism(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Talismans/Items/JeweledFiligree.cs b/Projects/Scripts/Items/Talismans/Items/JeweledFiligree.cs index 3141ffb00..142a703f0 100644 --- a/Projects/Scripts/Items/Talismans/Items/JeweledFiligree.cs +++ b/Projects/Scripts/Items/Talismans/Items/JeweledFiligree.cs @@ -3,10 +3,7 @@ namespace Server.Items public class JeweledFiligree : Item { [Constructible] - public JeweledFiligree() : base(0x2F5E) - { - Weight = 1.0; - } + public JeweledFiligree() : base(0x2F5E) => Weight = 1.0; public JeweledFiligree(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Talismans/Items/RunedPrism.cs b/Projects/Scripts/Items/Talismans/Items/RunedPrism.cs index 79542f684..f7efabd2e 100644 --- a/Projects/Scripts/Items/Talismans/Items/RunedPrism.cs +++ b/Projects/Scripts/Items/Talismans/Items/RunedPrism.cs @@ -3,10 +3,7 @@ namespace Server.Items public class RunedPrism : Item { [Constructible] - public RunedPrism() : base(0x2F57) - { - Weight = 1.0; - } + public RunedPrism() : base(0x2F57) => Weight = 1.0; public RunedPrism(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Talismans/Items/RunedSwitch.cs b/Projects/Scripts/Items/Talismans/Items/RunedSwitch.cs index c6546ddcb..55caec5d3 100644 --- a/Projects/Scripts/Items/Talismans/Items/RunedSwitch.cs +++ b/Projects/Scripts/Items/Talismans/Items/RunedSwitch.cs @@ -1,81 +1,75 @@ -using Server.Targeting; - -namespace Server.Items -{ - public class RunedSwitch : Item - { - [Constructible] - public RunedSwitch() : base(0x2F61) - { - Weight = 1.0; - } - - public RunedSwitch(Serial serial) : base(serial) - { - } - - public override int LabelNumber => 1072896; // runed switch - - public override void OnDoubleClick(Mobile from) - { - if (IsChildOf(from.Backpack)) - { - from.SendLocalizedMessage(1075101); // Please select an item to recharge. - from.Target = new InternalTarget(this); - } - else - { - from.SendLocalizedMessage(1060640); // The item must be in your backpack to use it. - } - } - - public override void Serialize(GenericWriter writer) - { - base.Serialize(writer); - - writer.Write(0); // version - } - - public override void Deserialize(GenericReader reader) - { - base.Deserialize(reader); - - int version = reader.ReadInt(); - } - - private class InternalTarget : Target - { - private RunedSwitch m_Item; - - public InternalTarget(RunedSwitch item) : base(0, false, TargetFlags.None) - { - m_Item = item; - } - - protected override void OnTarget(Mobile from, object o) - { - if (m_Item?.Deleted != false) - return; - - if (o is BaseTalisman talisman) - { - if (talisman.Charges == 0) - { - talisman.Charges = talisman.MaxCharges; - m_Item.Delete(); - from.SendLocalizedMessage(1075100); // The item has been recharged. - } - else - { - from.SendLocalizedMessage( - 1075099); // You cannot recharge that item until all of its current charges have been used. - } - } - else - { - from.SendLocalizedMessage(1046439); // That is not a valid target. - } - } - } - } -} +using Server.Targeting; + +namespace Server.Items +{ + public class RunedSwitch : Item + { + [Constructible] + public RunedSwitch() : base(0x2F61) => Weight = 1.0; + + public RunedSwitch(Serial serial) : base(serial) + { + } + + public override int LabelNumber => 1072896; // runed switch + + public override void OnDoubleClick(Mobile from) + { + if (IsChildOf(from.Backpack)) + { + from.SendLocalizedMessage(1075101); // Please select an item to recharge. + from.Target = new InternalTarget(this); + } + else + { + from.SendLocalizedMessage(1060640); // The item must be in your backpack to use it. + } + } + + public override void Serialize(GenericWriter writer) + { + base.Serialize(writer); + + writer.Write(0); // version + } + + public override void Deserialize(GenericReader reader) + { + base.Deserialize(reader); + + int version = reader.ReadInt(); + } + + private class InternalTarget : Target + { + private RunedSwitch m_Item; + + public InternalTarget(RunedSwitch item) : base(0, false, TargetFlags.None) => m_Item = item; + + protected override void OnTarget(Mobile from, object o) + { + if (m_Item?.Deleted != false) + return; + + if (o is BaseTalisman talisman) + { + if (talisman.Charges == 0) + { + talisman.Charges = talisman.MaxCharges; + m_Item.Delete(); + from.SendLocalizedMessage(1075100); // The item has been recharged. + } + else + { + from.SendLocalizedMessage( + 1075099); // You cannot recharge that item until all of its current charges have been used. + } + } + else + { + from.SendLocalizedMessage(1046439); // That is not a valid target. + } + } + } + } +} diff --git a/Projects/Scripts/Items/Talismans/TalismanAttribute.cs b/Projects/Scripts/Items/Talismans/TalismanAttribute.cs index 43884bb1f..47caa5503 100644 --- a/Projects/Scripts/Items/Talismans/TalismanAttribute.cs +++ b/Projects/Scripts/Items/Talismans/TalismanAttribute.cs @@ -57,10 +57,7 @@ namespace Server.Items [CommandProperty(AccessLevel.GameMaster)] public bool IsItem => Type?.Namespace.Equals("Server.Items") == true; - public override string ToString() - { - return Type?.Name ?? "None"; - } + public override string ToString() => Type?.Name ?? "None"; private static void SetSaveFlag(ref SaveFlag flags, SaveFlag toSet, bool setIf) { @@ -68,10 +65,7 @@ namespace Server.Items flags |= toSet; } - private static bool GetSaveFlag(SaveFlag flags, SaveFlag toGet) - { - return (flags & toGet) != 0; - } + private static bool GetSaveFlag(SaveFlag flags, SaveFlag toGet) => (flags & toGet) != 0; public virtual void Serialize(GenericWriter writer) { @@ -95,10 +89,7 @@ namespace Server.Items writer.WriteEncodedInt(Amount); } - public int DamageBonus(Mobile to) - { - return to?.GetType() == Type ? Amount : 0; - } + public int DamageBonus(Mobile to) => to?.GetType() == Type ? Amount : 0; [Flags] private enum SaveFlag diff --git a/Projects/Scripts/Items/Talismans/TalismanSummons.cs b/Projects/Scripts/Items/Talismans/TalismanSummons.cs index 259c7186e..e2e4e933f 100644 --- a/Projects/Scripts/Items/Talismans/TalismanSummons.cs +++ b/Projects/Scripts/Items/Talismans/TalismanSummons.cs @@ -45,10 +45,7 @@ namespace Server.Mobiles { private Mobile m_Mobile; - public TalismanReleaseEntry(Mobile m) : base(6118, 3) - { - m_Mobile = m; - } + public TalismanReleaseEntry(Mobile m) : base(6118, 3) => m_Mobile = m; public override void OnClick() { diff --git a/Projects/Scripts/Items/Traps/BaseTrap.cs b/Projects/Scripts/Items/Traps/BaseTrap.cs index 5465c84e4..9bb1f5a53 100644 --- a/Projects/Scripts/Items/Traps/BaseTrap.cs +++ b/Projects/Scripts/Items/Traps/BaseTrap.cs @@ -6,10 +6,7 @@ namespace Server.Items { private DateTime m_NextPassiveTrigger, m_NextActiveTrigger; - public BaseTrap(int itemID) : base(itemID) - { - Movable = false; - } + public BaseTrap(int itemID) : base(itemID) => Movable = false; public BaseTrap(Serial serial) : base(serial) { @@ -36,16 +33,11 @@ namespace Server.Items return hue - 1; } - public bool CheckRange(Point3D loc, Point3D oldLoc, int range) - { - return CheckRange(loc, range) && !CheckRange(oldLoc, range); - } + public bool CheckRange(Point3D loc, Point3D oldLoc, int range) => CheckRange(loc, range) && !CheckRange(oldLoc, range); - public bool CheckRange(Point3D loc, int range) - { - return Z + 8 >= loc.Z && loc.Z + 16 > Z - && Utility.InRange(GetWorldLocation(), loc, range); - } + public bool CheckRange(Point3D loc, int range) => + Z + 8 >= loc.Z && loc.Z + 16 > Z + && Utility.InRange(GetWorldLocation(), loc, range); public override void OnMovement(Mobile m, Point3D oldLocation) { diff --git a/Projects/Scripts/Items/Traps/FlameSpurtTrap.cs b/Projects/Scripts/Items/Traps/FlameSpurtTrap.cs index 977014e94..97b5b54fb 100644 --- a/Projects/Scripts/Items/Traps/FlameSpurtTrap.cs +++ b/Projects/Scripts/Items/Traps/FlameSpurtTrap.cs @@ -10,10 +10,7 @@ namespace Server.Items private Timer m_Timer; [Constructible] - public FlameSpurtTrap() : base(0x1B71) - { - Visible = false; - } + public FlameSpurtTrap() : base(0x1B71) => Visible = false; public FlameSpurtTrap(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Traps/GasTrap.cs b/Projects/Scripts/Items/Traps/GasTrap.cs index f27d4b99b..4057251ec 100644 --- a/Projects/Scripts/Items/Traps/GasTrap.cs +++ b/Projects/Scripts/Items/Traps/GasTrap.cs @@ -23,10 +23,7 @@ namespace Server.Items } [Constructible] - public GasTrap(GasTrapType type, Poison poison = null) : base(GetBaseID(type)) - { - Poison = poison; - } + public GasTrap(GasTrapType type, Poison poison = null) : base(GetBaseID(type)) => Poison = poison; public GasTrap(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Traps/SpikeTrap.cs b/Projects/Scripts/Items/Traps/SpikeTrap.cs index 2c54beb08..41ed063a7 100644 --- a/Projects/Scripts/Items/Traps/SpikeTrap.cs +++ b/Projects/Scripts/Items/Traps/SpikeTrap.cs @@ -84,10 +84,7 @@ namespace Server.Items return 0; } - public static int GetExtendedID(SpikeTrapType type) - { - return GetBaseID(type) + GetExtendedOffset(type); - } + public static int GetExtendedID(SpikeTrapType type) => GetBaseID(type) + GetExtendedOffset(type); public static int GetExtendedOffset(SpikeTrapType type) { diff --git a/Projects/Scripts/Items/Traps/StoneFaceTrap.cs b/Projects/Scripts/Items/Traps/StoneFaceTrap.cs index d7c4443d0..3b50cfb86 100644 --- a/Projects/Scripts/Items/Traps/StoneFaceTrap.cs +++ b/Projects/Scripts/Items/Traps/StoneFaceTrap.cs @@ -13,10 +13,7 @@ namespace Server.Items public class StoneFaceTrap : BaseTrap { [Constructible] - public StoneFaceTrap() : base(0x10FC) - { - Light = LightType.Circle225; - } + public StoneFaceTrap() : base(0x10FC) => Light = LightType.Circle225; public StoneFaceTrap(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Wands/BaseWand.cs b/Projects/Scripts/Items/Wands/BaseWand.cs index 1f079c219..d5a75526b 100644 --- a/Projects/Scripts/Items/Wands/BaseWand.cs +++ b/Projects/Scripts/Items/Wands/BaseWand.cs @@ -300,9 +300,6 @@ namespace Server.Items ConsumeCharge(from); } - public virtual bool OnWandTarget(Mobile from, object o) - { - return true; - } + public virtual bool OnWandTarget(Mobile from, object o) => true; } } \ No newline at end of file diff --git a/Projects/Scripts/Items/Wands/RandomWand.cs b/Projects/Scripts/Items/Wands/RandomWand.cs index 10db0d613..4e05c2212 100644 --- a/Projects/Scripts/Items/Wands/RandomWand.cs +++ b/Projects/Scripts/Items/Wands/RandomWand.cs @@ -2,32 +2,8 @@ namespace Server.Items { public class RandomWand { - public static BaseWand CreateWand() - { - return CreateRandomWand(); - } + public static BaseWand CreateWand() => CreateRandomWand(); - public static BaseWand CreateRandomWand() - { - return Loot.RandomWand(); - - /* - switch ( Utility.Random( 11 ) ) - { - default: - case 0: return new ClumsyWand(); - case 1: return new FeebleWand(); - case 2: return new FireballWand(); - case 3: return new GreaterHealWand(); - case 4: return new HarmWand(); - case 5: return new HealWand(); - case 6: return new IDWand(); - case 7: return new LightningWand(); - case 8: return new MagicArrowWand(); - case 9: return new ManaDrainWand(); - case 10: return new WeaknessWand(); - } - */ - } + public static BaseWand CreateRandomWand() => Loot.RandomWand(); } } \ No newline at end of file diff --git a/Projects/Scripts/Items/Wands/WandTarget.cs b/Projects/Scripts/Items/Wands/WandTarget.cs index 783d4cf1e..29d2fc9fc 100644 --- a/Projects/Scripts/Items/Wands/WandTarget.cs +++ b/Projects/Scripts/Items/Wands/WandTarget.cs @@ -6,15 +6,9 @@ namespace Server.Targeting { private BaseWand m_Item; - public WandTarget(BaseWand item) : base(6, false, TargetFlags.None) - { - m_Item = item; - } + public WandTarget(BaseWand item) : base(6, false, TargetFlags.None) => m_Item = item; - private static int GetOffset(Mobile caster) - { - return 5 + (int)(caster.Skills.Magery.Value * 0.02); - } + private static int GetOffset(Mobile caster) => 5 + (int)(caster.Skills.Magery.Value * 0.02); protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Items/Weapons/Abilities/BleedAttack.cs b/Projects/Scripts/Items/Weapons/Abilities/BleedAttack.cs index a96bb777b..e95ac29ba 100644 --- a/Projects/Scripts/Items/Weapons/Abilities/BleedAttack.cs +++ b/Projects/Scripts/Items/Weapons/Abilities/BleedAttack.cs @@ -51,10 +51,7 @@ namespace Server.Items BeginBleed(defender, attacker); } - public static bool IsBleeding(Mobile m) - { - return m_Table.ContainsKey(m); - } + public static bool IsBleeding(Mobile m) => m_Table.ContainsKey(m); public static void BeginBleed(Mobile m, Mobile from) { diff --git a/Projects/Scripts/Items/Weapons/Abilities/InfectiousStrike.cs b/Projects/Scripts/Items/Weapons/Abilities/InfectiousStrike.cs index 174559345..3c29e3c94 100644 --- a/Projects/Scripts/Items/Weapons/Abilities/InfectiousStrike.cs +++ b/Projects/Scripts/Items/Weapons/Abilities/InfectiousStrike.cs @@ -17,10 +17,7 @@ namespace Server.Items { public override int BaseMana => 15; - public override bool RequiresTactics(Mobile from) - { - return false; - } + public override bool RequiresTactics(Mobile from) => false; public override void OnHit(Mobile attacker, Mobile defender, int damage) { diff --git a/Projects/Scripts/Items/Weapons/Abilities/MortalStrike.cs b/Projects/Scripts/Items/Weapons/Abilities/MortalStrike.cs index 8e7a4bae2..2888acdce 100644 --- a/Projects/Scripts/Items/Weapons/Abilities/MortalStrike.cs +++ b/Projects/Scripts/Items/Weapons/Abilities/MortalStrike.cs @@ -34,10 +34,7 @@ namespace Server.Items BeginWound(defender, defender.Player ? PlayerDuration : NPCDuration); } - public static bool IsWounded(Mobile m) - { - return m_Table.ContainsKey(m); - } + public static bool IsWounded(Mobile m) => m_Table.ContainsKey(m); public static void BeginWound(Mobile m, TimeSpan duration) { diff --git a/Projects/Scripts/Items/Weapons/Abilities/MovingShot.cs b/Projects/Scripts/Items/Weapons/Abilities/MovingShot.cs index 5912ac572..9cdbf1d2c 100644 --- a/Projects/Scripts/Items/Weapons/Abilities/MovingShot.cs +++ b/Projects/Scripts/Items/Weapons/Abilities/MovingShot.cs @@ -11,10 +11,7 @@ namespace Server.Items public override bool ValidatesDuringHit => false; - public override bool OnBeforeSwing(Mobile attacker, Mobile defender) - { - return Validate(attacker) && CheckMana(attacker, true); - } + public override bool OnBeforeSwing(Mobile attacker, Mobile defender) => Validate(attacker) && CheckMana(attacker, true); public override void OnMiss(Mobile attacker, Mobile defender) { diff --git a/Projects/Scripts/Items/Weapons/Abilities/ParalyzingBlow.cs b/Projects/Scripts/Items/Weapons/Abilities/ParalyzingBlow.cs index a7e49c16c..53a3185cc 100644 --- a/Projects/Scripts/Items/Weapons/Abilities/ParalyzingBlow.cs +++ b/Projects/Scripts/Items/Weapons/Abilities/ParalyzingBlow.cs @@ -36,10 +36,7 @@ namespace Server.Items return false; }*/ - public override bool RequiresTactics(Mobile from) - { - return !(from.Weapon is BaseWeapon weapon && weapon.Skill == SkillName.Wrestling); - } + public override bool RequiresTactics(Mobile from) => !(from.Weapon is BaseWeapon weapon && weapon.Skill == SkillName.Wrestling); public override bool OnBeforeSwing(Mobile attacker, Mobile defender) { @@ -80,10 +77,7 @@ namespace Server.Items BeginImmunity(defender, duration + FreezeDelayDuration); } - public static bool IsImmune(Mobile m) - { - return m_Table.ContainsKey(m); - } + public static bool IsImmune(Mobile m) => m_Table.ContainsKey(m); public static void BeginImmunity(Mobile m, TimeSpan duration) { diff --git a/Projects/Scripts/Items/Weapons/Abilities/ShadowStrike.cs b/Projects/Scripts/Items/Weapons/Abilities/ShadowStrike.cs index 8ca36679f..cce1f37e4 100644 --- a/Projects/Scripts/Items/Weapons/Abilities/ShadowStrike.cs +++ b/Projects/Scripts/Items/Weapons/Abilities/ShadowStrike.cs @@ -10,10 +10,7 @@ namespace Server.Items public override int BaseMana => 20; public override double DamageScalar => 1.25; - public override bool RequiresTactics(Mobile from) - { - return false; - } + public override bool RequiresTactics(Mobile from) => false; public override bool CheckSkills(Mobile from) { diff --git a/Projects/Scripts/Items/Weapons/Abilities/WeaponAbility.cs b/Projects/Scripts/Items/Weapons/Abilities/WeaponAbility.cs index 0cc25c81e..dff3bf72e 100644 --- a/Projects/Scripts/Items/Weapons/Abilities/WeaponAbility.cs +++ b/Projects/Scripts/Items/Weapons/Abilities/WeaponAbility.cs @@ -102,21 +102,11 @@ namespace Server.Items { } - public virtual bool OnBeforeSwing(Mobile attacker, Mobile defender) - { - // Here because you must be sure you can use the skill before calling CheckHit if the ability has a HCI bonus for example - return true; - } + public virtual bool OnBeforeSwing(Mobile attacker, Mobile defender) => true; - public virtual bool OnBeforeDamage(Mobile attacker, Mobile defender) - { - return true; - } + public virtual bool OnBeforeDamage(Mobile attacker, Mobile defender) => true; - public virtual bool RequiresTactics(Mobile from) - { - return true; - } + public virtual bool RequiresTactics(Mobile from) => true; public virtual double GetRequiredSkill(Mobile from) { @@ -203,10 +193,7 @@ namespace Server.Items return false; } - public virtual bool CheckSkills(Mobile from) - { - return CheckWeaponSkill(from); - } + public virtual bool CheckSkills(Mobile from) => CheckWeaponSkill(from); public virtual double GetSkill(Mobile from, SkillName skillName) => from.Skills[skillName]?.Value ?? 0.0; @@ -327,11 +314,9 @@ namespace Server.Items return CheckSkills(from) && CheckMana(from, false); } - public static bool IsWeaponAbility(Mobile m, WeaponAbility a) - { - return a == null || !m.Player || m.Weapon is BaseWeapon weapon && - (weapon.PrimaryAbility == a || weapon.SecondaryAbility == a); - } + public static bool IsWeaponAbility(Mobile m, WeaponAbility a) => + a == null || !m.Player || m.Weapon is BaseWeapon weapon && + (weapon.PrimaryAbility == a || weapon.SecondaryAbility == a); public static WeaponAbility GetCurrentAbility(Mobile m) { @@ -459,10 +444,7 @@ namespace Server.Items private class WeaponAbilityContext { - public WeaponAbilityContext(Timer timer) - { - Timer = timer; - } + public WeaponAbilityContext(Timer timer) => Timer = timer; public Timer Timer{ get; } } diff --git a/Projects/Scripts/Items/Weapons/Axes/Axe.cs b/Projects/Scripts/Items/Weapons/Axes/Axe.cs index 50af8f4c6..d05c5574f 100644 --- a/Projects/Scripts/Items/Weapons/Axes/Axe.cs +++ b/Projects/Scripts/Items/Weapons/Axes/Axe.cs @@ -4,10 +4,7 @@ namespace Server.Items public class Axe : BaseAxe { [Constructible] - public Axe() : base(0xF49) - { - Weight = 4.0; - } + public Axe() : base(0xF49) => Weight = 4.0; public Axe(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Axes/BaseAxe.cs b/Projects/Scripts/Items/Weapons/Axes/BaseAxe.cs index 340b8651d..f404c7210 100644 --- a/Projects/Scripts/Items/Weapons/Axes/BaseAxe.cs +++ b/Projects/Scripts/Items/Weapons/Axes/BaseAxe.cs @@ -18,10 +18,7 @@ namespace Server.Items private int m_UsesRemaining; - public BaseAxe(int itemID) : base(itemID) - { - m_UsesRemaining = 150; - } + public BaseAxe(int itemID) : base(itemID) => m_UsesRemaining = 150; public BaseAxe(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Axes/DoubleAxe.cs b/Projects/Scripts/Items/Weapons/Axes/DoubleAxe.cs index 794bacc3f..f4af93032 100644 --- a/Projects/Scripts/Items/Weapons/Axes/DoubleAxe.cs +++ b/Projects/Scripts/Items/Weapons/Axes/DoubleAxe.cs @@ -4,10 +4,7 @@ namespace Server.Items public class DoubleAxe : BaseAxe { [Constructible] - public DoubleAxe() : base(0xF4B) - { - Weight = 8.0; - } + public DoubleAxe() : base(0xF4B) => Weight = 8.0; public DoubleAxe(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Axes/ExecutionersAxe.cs b/Projects/Scripts/Items/Weapons/Axes/ExecutionersAxe.cs index 1d63c0515..115107625 100644 --- a/Projects/Scripts/Items/Weapons/Axes/ExecutionersAxe.cs +++ b/Projects/Scripts/Items/Weapons/Axes/ExecutionersAxe.cs @@ -4,10 +4,7 @@ namespace Server.Items public class ExecutionersAxe : BaseAxe { [Constructible] - public ExecutionersAxe() : base(0xF45) - { - Weight = 8.0; - } + public ExecutionersAxe() : base(0xF45) => Weight = 8.0; public ExecutionersAxe(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Axes/Hatchet.cs b/Projects/Scripts/Items/Weapons/Axes/Hatchet.cs index e88d88a91..86439be06 100644 --- a/Projects/Scripts/Items/Weapons/Axes/Hatchet.cs +++ b/Projects/Scripts/Items/Weapons/Axes/Hatchet.cs @@ -4,10 +4,7 @@ namespace Server.Items public class Hatchet : BaseAxe { [Constructible] - public Hatchet() : base(0xF43) - { - Weight = 4.0; - } + public Hatchet() : base(0xF43) => Weight = 4.0; public Hatchet(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Axes/HeavyOrnateAxe.cs b/Projects/Scripts/Items/Weapons/Axes/HeavyOrnateAxe.cs index 258a10915..007c69ea2 100644 --- a/Projects/Scripts/Items/Weapons/Axes/HeavyOrnateAxe.cs +++ b/Projects/Scripts/Items/Weapons/Axes/HeavyOrnateAxe.cs @@ -3,10 +3,7 @@ namespace Server.Items public class HeavyOrnateAxe : OrnateAxe { [Constructible] - public HeavyOrnateAxe() - { - Attributes.WeaponDamage = 8; - } + public HeavyOrnateAxe() => Attributes.WeaponDamage = 8; public HeavyOrnateAxe(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Axes/LargeBattleAxe.cs b/Projects/Scripts/Items/Weapons/Axes/LargeBattleAxe.cs index 372f83e53..b68a2d661 100644 --- a/Projects/Scripts/Items/Weapons/Axes/LargeBattleAxe.cs +++ b/Projects/Scripts/Items/Weapons/Axes/LargeBattleAxe.cs @@ -4,10 +4,7 @@ namespace Server.Items public class LargeBattleAxe : BaseAxe { [Constructible] - public LargeBattleAxe() : base(0x13FB) - { - Weight = 6.0; - } + public LargeBattleAxe() : base(0x13FB) => Weight = 6.0; public LargeBattleAxe(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Axes/ThunderingAxe.cs b/Projects/Scripts/Items/Weapons/Axes/ThunderingAxe.cs index 45acbb1c8..0c7efe25c 100644 --- a/Projects/Scripts/Items/Weapons/Axes/ThunderingAxe.cs +++ b/Projects/Scripts/Items/Weapons/Axes/ThunderingAxe.cs @@ -3,10 +3,7 @@ namespace Server.Items public class ThunderingAxe : OrnateAxe { [Constructible] - public ThunderingAxe() - { - WeaponAttributes.HitLightning = 10; - } + public ThunderingAxe() => WeaponAttributes.HitLightning = 10; public ThunderingAxe(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Axes/TwoHandedAxe.cs b/Projects/Scripts/Items/Weapons/Axes/TwoHandedAxe.cs index ae901f270..c01d6b19d 100644 --- a/Projects/Scripts/Items/Weapons/Axes/TwoHandedAxe.cs +++ b/Projects/Scripts/Items/Weapons/Axes/TwoHandedAxe.cs @@ -4,10 +4,7 @@ namespace Server.Items public class TwoHandedAxe : BaseAxe { [Constructible] - public TwoHandedAxe() : base(0x1443) - { - Weight = 8.0; - } + public TwoHandedAxe() : base(0x1443) => Weight = 8.0; public TwoHandedAxe(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Axes/WarAxe.cs b/Projects/Scripts/Items/Weapons/Axes/WarAxe.cs index fb73c5726..41cec664a 100644 --- a/Projects/Scripts/Items/Weapons/Axes/WarAxe.cs +++ b/Projects/Scripts/Items/Weapons/Axes/WarAxe.cs @@ -6,10 +6,7 @@ namespace Server.Items public class WarAxe : BaseAxe { [Constructible] - public WarAxe() : base(0x13B0) - { - Weight = 8.0; - } + public WarAxe() : base(0x13B0) => Weight = 8.0; public WarAxe(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/BaseWeapon.cs b/Projects/Scripts/Items/Weapons/BaseWeapon.cs index dd3a8c502..95eed3882 100644 --- a/Projects/Scripts/Items/Weapons/BaseWeapon.cs +++ b/Projects/Scripts/Items/Weapons/BaseWeapon.cs @@ -255,10 +255,7 @@ namespace Server.Items SpecialMove.ClearCurrentMove(attacker); } - public virtual TimeSpan OnSwing(Mobile attacker, Mobile defender) - { - return OnSwing(attacker, defender, 1.0); - } + public virtual TimeSpan OnSwing(Mobile attacker, Mobile defender) => OnSwing(attacker, defender, 1.0); public virtual void GetStatusDamage(Mobile from, out int min, out int max) { @@ -375,11 +372,9 @@ namespace Server.Items return false; } - public override bool AllowSecureTrade(Mobile from, Mobile to, Mobile newOwner, bool accepted) - { - return Ethic.CheckTrade(from, to, newOwner, this) && - base.AllowSecureTrade(from, to, newOwner, accepted); - } + public override bool AllowSecureTrade(Mobile from, Mobile to, Mobile newOwner, bool accepted) => + Ethic.CheckTrade(from, to, newOwner, this) && + base.AllowSecureTrade(from, to, newOwner, accepted); public override bool CanEquip(Mobile from) { @@ -553,20 +548,11 @@ namespace Server.Items return sk; } - public virtual double GetAttackSkillValue(Mobile attacker, Mobile defender) - { - return attacker.Skills[GetUsedSkill(attacker, true)].Value; - } + public virtual double GetAttackSkillValue(Mobile attacker, Mobile defender) => attacker.Skills[GetUsedSkill(attacker, true)].Value; - public virtual double GetDefendSkillValue(Mobile attacker, Mobile defender) - { - return defender.Skills[GetUsedSkill(defender, true)].Value; - } + public virtual double GetDefendSkillValue(Mobile attacker, Mobile defender) => defender.Skills[GetUsedSkill(defender, true)].Value; - private static bool CheckAnimal(Mobile m, Type type) - { - return AnimalForm.UnderTransformation(m, type); - } + private static bool CheckAnimal(Mobile m, Type type) => AnimalForm.UnderTransformation(m, type); public virtual bool CheckHit(Mobile attacker, Mobile defender) { @@ -1786,10 +1772,7 @@ namespace Server.Items return damage + (int)(damage * totalBonus); } - public virtual int ComputeDamageAOS(Mobile attacker, Mobile defender) - { - return (int)ScaleDamageAOS(attacker, GetBaseDamage(attacker), true); - } + public virtual int ComputeDamageAOS(Mobile attacker, Mobile defender) => (int)ScaleDamageAOS(attacker, GetBaseDamage(attacker), true); public virtual double ScaleDamageOld(Mobile attacker, double damage, bool checkSkills) { @@ -1981,10 +1964,7 @@ namespace Server.Items from.Animate(action, 7, 1, true, false, 0); } - private string GetNameString() - { - return Name ?? $"#{LabelNumber}"; - } + private string GetNameString() => Name ?? $"#{LabelNumber}"; public int GetElementalDamageHue() { @@ -2461,10 +2441,7 @@ namespace Server.Items { private Mobile m_Mobile; - public ResetEquipTimer(Mobile m, TimeSpan duration) : base(duration) - { - m_Mobile = m; - } + public ResetEquipTimer(Mobile m, TimeSpan duration) : base(duration) => m_Mobile = m; protected override void OnTick() { @@ -2928,20 +2905,11 @@ namespace Server.Items return sound; } - public virtual int GetHitDefendSound(Mobile attacker, Mobile defender) - { - return defender.GetHurtSound(); - } + public virtual int GetHitDefendSound(Mobile attacker, Mobile defender) => defender.GetHurtSound(); - public virtual int GetMissAttackSound(Mobile attacker, Mobile defender) - { - return attacker.GetAttackSound() == -1 ? MissSound : -1; - } + public virtual int GetMissAttackSound(Mobile attacker, Mobile defender) => attacker.GetAttackSound() == -1 ? MissSound : -1; - public virtual int GetMissDefendSound(Mobile attacker, Mobile defender) - { - return -1; - } + public virtual int GetMissDefendSound(Mobile attacker, Mobile defender) => -1; #endregion @@ -3108,10 +3076,7 @@ namespace Server.Items flags |= toSet; } - private static bool GetSaveFlag(SaveFlag flags, SaveFlag toGet) - { - return (flags & toGet) != 0; - } + private static bool GetSaveFlag(SaveFlag flags, SaveFlag toGet) => (flags & toGet) != 0; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Items/Weapons/HitLower.cs b/Projects/Scripts/Items/Weapons/HitLower.cs index a170d3fd5..fddfaac65 100644 --- a/Projects/Scripts/Items/Weapons/HitLower.cs +++ b/Projects/Scripts/Items/Weapons/HitLower.cs @@ -11,10 +11,7 @@ namespace Server.Items private static HashSet m_AttackTable = new HashSet(); private static HashSet m_DefenseTable = new HashSet(); - public static bool IsUnderAttackEffect(Mobile m) - { - return m_AttackTable.Contains(m); - } + public static bool IsUnderAttackEffect(Mobile m) => m_AttackTable.Contains(m); public static bool ApplyAttack(Mobile m) { @@ -34,10 +31,7 @@ namespace Server.Items m.SendLocalizedMessage(1062320); // Your attack chance has returned to normal. } - public static bool IsUnderDefenseEffect(Mobile m) - { - return m_DefenseTable.Contains(m); - } + public static bool IsUnderDefenseEffect(Mobile m) => m_DefenseTable.Contains(m); public static bool ApplyDefense(Mobile m) { diff --git a/Projects/Scripts/Items/Weapons/Knives/ButcherKnife.cs b/Projects/Scripts/Items/Weapons/Knives/ButcherKnife.cs index 4dd097708..69375b289 100644 --- a/Projects/Scripts/Items/Weapons/Knives/ButcherKnife.cs +++ b/Projects/Scripts/Items/Weapons/Knives/ButcherKnife.cs @@ -4,10 +4,7 @@ namespace Server.Items public class ButcherKnife : BaseKnife { [Constructible] - public ButcherKnife() : base(0x13F6) - { - Weight = 1.0; - } + public ButcherKnife() : base(0x13F6) => Weight = 1.0; public ButcherKnife(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Knives/Cleaver.cs b/Projects/Scripts/Items/Weapons/Knives/Cleaver.cs index 3811ac40f..f31c47176 100644 --- a/Projects/Scripts/Items/Weapons/Knives/Cleaver.cs +++ b/Projects/Scripts/Items/Weapons/Knives/Cleaver.cs @@ -4,10 +4,7 @@ namespace Server.Items public class Cleaver : BaseKnife { [Constructible] - public Cleaver() : base(0xEC3) - { - Weight = 2.0; - } + public Cleaver() : base(0xEC3) => Weight = 2.0; public Cleaver(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Knives/Dagger.cs b/Projects/Scripts/Items/Weapons/Knives/Dagger.cs index 37cfade1c..9f3a86f04 100644 --- a/Projects/Scripts/Items/Weapons/Knives/Dagger.cs +++ b/Projects/Scripts/Items/Weapons/Knives/Dagger.cs @@ -4,10 +4,7 @@ namespace Server.Items public class Dagger : BaseKnife { [Constructible] - public Dagger() : base(0xF52) - { - Weight = 1.0; - } + public Dagger() : base(0xF52) => Weight = 1.0; public Dagger(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Knives/SkinningKnife.cs b/Projects/Scripts/Items/Weapons/Knives/SkinningKnife.cs index 353fac536..d8ec1199a 100644 --- a/Projects/Scripts/Items/Weapons/Knives/SkinningKnife.cs +++ b/Projects/Scripts/Items/Weapons/Knives/SkinningKnife.cs @@ -4,10 +4,7 @@ namespace Server.Items public class SkinningKnife : BaseKnife { [Constructible] - public SkinningKnife() : base(0xEC4) - { - Weight = 1.0; - } + public SkinningKnife() : base(0xEC4) => Weight = 1.0; public SkinningKnife(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Knives/ThrowingDagger.cs b/Projects/Scripts/Items/Weapons/Knives/ThrowingDagger.cs index df6ec41d6..2adf560cb 100644 --- a/Projects/Scripts/Items/Weapons/Knives/ThrowingDagger.cs +++ b/Projects/Scripts/Items/Weapons/Knives/ThrowingDagger.cs @@ -50,10 +50,7 @@ namespace Server.Items { private ThrowingDagger m_Dagger; - public InternalTarget(ThrowingDagger dagger) : base(10, false, TargetFlags.Harmful) - { - m_Dagger = dagger; - } + public InternalTarget(ThrowingDagger dagger) : base(10, false, TargetFlags.Harmful) => m_Dagger = dagger; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Items/Weapons/ML Weapons/AssassinSpike.cs b/Projects/Scripts/Items/Weapons/ML Weapons/AssassinSpike.cs index 0a4d99c25..2ddd98672 100644 --- a/Projects/Scripts/Items/Weapons/ML Weapons/AssassinSpike.cs +++ b/Projects/Scripts/Items/Weapons/ML Weapons/AssassinSpike.cs @@ -4,10 +4,7 @@ namespace Server.Items public class AssassinSpike : BaseKnife { [Constructible] - public AssassinSpike() : base(0x2D21) - { - Weight = 4.0; - } + public AssassinSpike() : base(0x2D21) => Weight = 4.0; public AssassinSpike(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/ML Weapons/DiamondMace.cs b/Projects/Scripts/Items/Weapons/ML Weapons/DiamondMace.cs index c031b0f79..00c5173b9 100644 --- a/Projects/Scripts/Items/Weapons/ML Weapons/DiamondMace.cs +++ b/Projects/Scripts/Items/Weapons/ML Weapons/DiamondMace.cs @@ -4,10 +4,7 @@ namespace Server.Items public class DiamondMace : BaseBashing { [Constructible] - public DiamondMace() : base(0x2D24) - { - Weight = 10.0; - } + public DiamondMace() : base(0x2D24) => Weight = 10.0; public DiamondMace(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/ML Weapons/ElvenCompositeLongbow.cs b/Projects/Scripts/Items/Weapons/ML Weapons/ElvenCompositeLongbow.cs index 83961ec2c..53087bfb9 100644 --- a/Projects/Scripts/Items/Weapons/ML Weapons/ElvenCompositeLongbow.cs +++ b/Projects/Scripts/Items/Weapons/ML Weapons/ElvenCompositeLongbow.cs @@ -6,10 +6,7 @@ namespace Server.Items public class ElvenCompositeLongbow : BaseRanged { [Constructible] - public ElvenCompositeLongbow() : base(0x2D1E) - { - Weight = 8.0; - } + public ElvenCompositeLongbow() : base(0x2D1E) => Weight = 8.0; public ElvenCompositeLongbow(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/ML Weapons/ElvenMachete.cs b/Projects/Scripts/Items/Weapons/ML Weapons/ElvenMachete.cs index ba861a8aa..8aa657957 100644 --- a/Projects/Scripts/Items/Weapons/ML Weapons/ElvenMachete.cs +++ b/Projects/Scripts/Items/Weapons/ML Weapons/ElvenMachete.cs @@ -4,10 +4,7 @@ namespace Server.Items public class ElvenMachete : BaseSword { [Constructible] - public ElvenMachete() : base(0x2D35) - { - Weight = 6.0; - } + public ElvenMachete() : base(0x2D35) => Weight = 6.0; public ElvenMachete(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/ML Weapons/Leafblade.cs b/Projects/Scripts/Items/Weapons/ML Weapons/Leafblade.cs index cc5e29ad2..41761e202 100644 --- a/Projects/Scripts/Items/Weapons/ML Weapons/Leafblade.cs +++ b/Projects/Scripts/Items/Weapons/ML Weapons/Leafblade.cs @@ -4,10 +4,7 @@ namespace Server.Items public class Leafblade : BaseKnife { [Constructible] - public Leafblade() : base(0x2D22) - { - Weight = 8.0; - } + public Leafblade() : base(0x2D22) => Weight = 8.0; public Leafblade(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/ML Weapons/MagicalShortbow.cs b/Projects/Scripts/Items/Weapons/ML Weapons/MagicalShortbow.cs index f2cf0412d..1db2a153e 100644 --- a/Projects/Scripts/Items/Weapons/ML Weapons/MagicalShortbow.cs +++ b/Projects/Scripts/Items/Weapons/ML Weapons/MagicalShortbow.cs @@ -6,10 +6,7 @@ namespace Server.Items public class MagicalShortbow : BaseRanged { [Constructible] - public MagicalShortbow() : base(0x2D2B) - { - Weight = 6.0; - } + public MagicalShortbow() : base(0x2D2B) => Weight = 6.0; public MagicalShortbow(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/ML Weapons/RadiantScimitar.cs b/Projects/Scripts/Items/Weapons/ML Weapons/RadiantScimitar.cs index 0f43415bf..2c82d9937 100644 --- a/Projects/Scripts/Items/Weapons/ML Weapons/RadiantScimitar.cs +++ b/Projects/Scripts/Items/Weapons/ML Weapons/RadiantScimitar.cs @@ -4,10 +4,7 @@ namespace Server.Items public class RadiantScimitar : BaseSword { [Constructible] - public RadiantScimitar() : base(0x2D33) - { - Weight = 9.0; - } + public RadiantScimitar() : base(0x2D33) => Weight = 9.0; public RadiantScimitar(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/ML Weapons/WarCleaver.cs b/Projects/Scripts/Items/Weapons/ML Weapons/WarCleaver.cs index 0941e1dd3..0e46329c2 100644 --- a/Projects/Scripts/Items/Weapons/ML Weapons/WarCleaver.cs +++ b/Projects/Scripts/Items/Weapons/ML Weapons/WarCleaver.cs @@ -4,10 +4,7 @@ namespace Server.Items public class WarCleaver : BaseKnife { [Constructible] - public WarCleaver() : base(0x2D2F) - { - Weight = 10.0; - } + public WarCleaver() : base(0x2D2F) => Weight = 10.0; public WarCleaver(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/ML Weapons/WildStaff.cs b/Projects/Scripts/Items/Weapons/ML Weapons/WildStaff.cs index ae81740a7..745db0b1b 100644 --- a/Projects/Scripts/Items/Weapons/ML Weapons/WildStaff.cs +++ b/Projects/Scripts/Items/Weapons/ML Weapons/WildStaff.cs @@ -4,10 +4,7 @@ namespace Server.Items public class WildStaff : BaseStaff { [Constructible] - public WildStaff() : base(0x2D25) - { - Weight = 8.0; - } + public WildStaff() : base(0x2D25) => Weight = 8.0; public WildStaff(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Maces/Club.cs b/Projects/Scripts/Items/Weapons/Maces/Club.cs index 54f22cb79..09cc70754 100644 --- a/Projects/Scripts/Items/Weapons/Maces/Club.cs +++ b/Projects/Scripts/Items/Weapons/Maces/Club.cs @@ -4,10 +4,7 @@ namespace Server.Items public class Club : BaseBashing { [Constructible] - public Club() : base(0x13B4) - { - Weight = 9.0; - } + public Club() : base(0x13B4) => Weight = 9.0; public Club(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Maces/EmeraldMace.cs b/Projects/Scripts/Items/Weapons/Maces/EmeraldMace.cs index 2826c5a88..8557380b6 100644 --- a/Projects/Scripts/Items/Weapons/Maces/EmeraldMace.cs +++ b/Projects/Scripts/Items/Weapons/Maces/EmeraldMace.cs @@ -3,10 +3,7 @@ namespace Server.Items public class EmeraldMace : DiamondMace { [Constructible] - public EmeraldMace() - { - WeaponAttributes.ResistPoisonBonus = 5; - } + public EmeraldMace() => WeaponAttributes.ResistPoisonBonus = 5; public EmeraldMace(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Maces/Mace.cs b/Projects/Scripts/Items/Weapons/Maces/Mace.cs index 97c556ba8..6d329293d 100644 --- a/Projects/Scripts/Items/Weapons/Maces/Mace.cs +++ b/Projects/Scripts/Items/Weapons/Maces/Mace.cs @@ -4,10 +4,7 @@ namespace Server.Items public class Mace : BaseBashing { [Constructible] - public Mace() : base(0xF5C) - { - Weight = 14.0; - } + public Mace() : base(0xF5C) => Weight = 14.0; public Mace(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Maces/MagicWand.cs b/Projects/Scripts/Items/Weapons/Maces/MagicWand.cs index aa2e79192..7d0109ada 100644 --- a/Projects/Scripts/Items/Weapons/Maces/MagicWand.cs +++ b/Projects/Scripts/Items/Weapons/Maces/MagicWand.cs @@ -3,10 +3,7 @@ namespace Server.Items public class MagicWand : BaseBashing { [Constructible] - public MagicWand() : base(0xDF2) - { - Weight = 1.0; - } + public MagicWand() : base(0xDF2) => Weight = 1.0; public MagicWand(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Maces/Maul.cs b/Projects/Scripts/Items/Weapons/Maces/Maul.cs index 7bddd8241..7338d516b 100644 --- a/Projects/Scripts/Items/Weapons/Maces/Maul.cs +++ b/Projects/Scripts/Items/Weapons/Maces/Maul.cs @@ -4,10 +4,7 @@ namespace Server.Items public class Maul : BaseBashing { [Constructible] - public Maul() : base(0x143B) - { - Weight = 10.0; - } + public Maul() : base(0x143B) => Weight = 10.0; public Maul(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Maces/RubyMace.cs b/Projects/Scripts/Items/Weapons/Maces/RubyMace.cs index 7b3881752..918e6999d 100644 --- a/Projects/Scripts/Items/Weapons/Maces/RubyMace.cs +++ b/Projects/Scripts/Items/Weapons/Maces/RubyMace.cs @@ -3,10 +3,7 @@ namespace Server.Items public class RubyMace : DiamondMace { [Constructible] - public RubyMace() - { - Attributes.WeaponDamage = 5; - } + public RubyMace() => Attributes.WeaponDamage = 5; public RubyMace(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Maces/SapphireMace.cs b/Projects/Scripts/Items/Weapons/Maces/SapphireMace.cs index bfca7746b..29406b9e2 100644 --- a/Projects/Scripts/Items/Weapons/Maces/SapphireMace.cs +++ b/Projects/Scripts/Items/Weapons/Maces/SapphireMace.cs @@ -3,10 +3,7 @@ namespace Server.Items public class SapphireMace : DiamondMace { [Constructible] - public SapphireMace() - { - WeaponAttributes.ResistEnergyBonus = 5; - } + public SapphireMace() => WeaponAttributes.ResistEnergyBonus = 5; public SapphireMace(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Maces/Scepter.cs b/Projects/Scripts/Items/Weapons/Maces/Scepter.cs index 65fe9eea1..766e1ef26 100644 --- a/Projects/Scripts/Items/Weapons/Maces/Scepter.cs +++ b/Projects/Scripts/Items/Weapons/Maces/Scepter.cs @@ -4,10 +4,7 @@ namespace Server.Items public class Scepter : BaseBashing { [Constructible] - public Scepter() : base(0x26BC) - { - Weight = 8.0; - } + public Scepter() : base(0x26BC) => Weight = 8.0; public Scepter(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Maces/SilverEtchedMace.cs b/Projects/Scripts/Items/Weapons/Maces/SilverEtchedMace.cs index 1cfa4a8e8..895ad56b9 100644 --- a/Projects/Scripts/Items/Weapons/Maces/SilverEtchedMace.cs +++ b/Projects/Scripts/Items/Weapons/Maces/SilverEtchedMace.cs @@ -3,10 +3,7 @@ namespace Server.Items public class SilverEtchedMace : DiamondMace { [Constructible] - public SilverEtchedMace() - { - Slayer = SlayerName.Exorcism; - } + public SilverEtchedMace() => Slayer = SlayerName.Exorcism; public SilverEtchedMace(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Maces/WarMace.cs b/Projects/Scripts/Items/Weapons/Maces/WarMace.cs index ca568b671..6d50b555b 100644 --- a/Projects/Scripts/Items/Weapons/Maces/WarMace.cs +++ b/Projects/Scripts/Items/Weapons/Maces/WarMace.cs @@ -4,10 +4,7 @@ namespace Server.Items public class WarMace : BaseBashing { [Constructible] - public WarMace() : base(0x1407) - { - Weight = 17.0; - } + public WarMace() : base(0x1407) => Weight = 17.0; public WarMace(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/PoleArms/Bardiche.cs b/Projects/Scripts/Items/Weapons/PoleArms/Bardiche.cs index 7ec70cfec..16f92a859 100644 --- a/Projects/Scripts/Items/Weapons/PoleArms/Bardiche.cs +++ b/Projects/Scripts/Items/Weapons/PoleArms/Bardiche.cs @@ -4,10 +4,7 @@ namespace Server.Items public class Bardiche : BasePoleArm { [Constructible] - public Bardiche() : base(0xF4D) - { - Weight = 7.0; - } + public Bardiche() : base(0xF4D) => Weight = 7.0; public Bardiche(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/PoleArms/BasePoleArm.cs b/Projects/Scripts/Items/Weapons/PoleArms/BasePoleArm.cs index abe653266..99641fc37 100644 --- a/Projects/Scripts/Items/Weapons/PoleArms/BasePoleArm.cs +++ b/Projects/Scripts/Items/Weapons/PoleArms/BasePoleArm.cs @@ -12,10 +12,7 @@ namespace Server.Items private int m_UsesRemaining; - public BasePoleArm(int itemID) : base(itemID) - { - m_UsesRemaining = 150; - } + public BasePoleArm(int itemID) : base(itemID) => m_UsesRemaining = 150; public BasePoleArm(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/PoleArms/Halberd.cs b/Projects/Scripts/Items/Weapons/PoleArms/Halberd.cs index dcb7dbb3c..cbc9a8de6 100644 --- a/Projects/Scripts/Items/Weapons/PoleArms/Halberd.cs +++ b/Projects/Scripts/Items/Weapons/PoleArms/Halberd.cs @@ -4,10 +4,7 @@ namespace Server.Items public class Halberd : BasePoleArm { [Constructible] - public Halberd() : base(0x143E) - { - Weight = 16.0; - } + public Halberd() : base(0x143E) => Weight = 16.0; public Halberd(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/PoleArms/Scythe.cs b/Projects/Scripts/Items/Weapons/PoleArms/Scythe.cs index 0787f8b46..26c957ff4 100644 --- a/Projects/Scripts/Items/Weapons/PoleArms/Scythe.cs +++ b/Projects/Scripts/Items/Weapons/PoleArms/Scythe.cs @@ -6,10 +6,7 @@ namespace Server.Items public class Scythe : BasePoleArm { [Constructible] - public Scythe() : base(0x26BA) - { - Weight = 5.0; - } + public Scythe() : base(0x26BA) => Weight = 5.0; public Scythe(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Ranged/BarbedLongbow.cs b/Projects/Scripts/Items/Weapons/Ranged/BarbedLongbow.cs index fe17943d0..97c5d4507 100644 --- a/Projects/Scripts/Items/Weapons/Ranged/BarbedLongbow.cs +++ b/Projects/Scripts/Items/Weapons/Ranged/BarbedLongbow.cs @@ -3,10 +3,7 @@ namespace Server.Items public class BarbedLongbow : ElvenCompositeLongbow { [Constructible] - public BarbedLongbow() - { - Attributes.ReflectPhysical = 12; - } + public BarbedLongbow() => Attributes.ReflectPhysical = 12; public BarbedLongbow(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Ranged/CompositeBow.cs b/Projects/Scripts/Items/Weapons/Ranged/CompositeBow.cs index 4f6ac1a79..9221ed0a0 100644 --- a/Projects/Scripts/Items/Weapons/Ranged/CompositeBow.cs +++ b/Projects/Scripts/Items/Weapons/Ranged/CompositeBow.cs @@ -6,10 +6,7 @@ namespace Server.Items public class CompositeBow : BaseRanged { [Constructible] - public CompositeBow() : base(0x26C2) - { - Weight = 5.0; - } + public CompositeBow() : base(0x26C2) => Weight = 5.0; public CompositeBow(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Ranged/LightweightShortbow.cs b/Projects/Scripts/Items/Weapons/Ranged/LightweightShortbow.cs index b79dcb08d..5c43812cb 100644 --- a/Projects/Scripts/Items/Weapons/Ranged/LightweightShortbow.cs +++ b/Projects/Scripts/Items/Weapons/Ranged/LightweightShortbow.cs @@ -3,10 +3,7 @@ namespace Server.Items public class LightweightShortbow : MagicalShortbow { [Constructible] - public LightweightShortbow() - { - Balanced = true; - } + public LightweightShortbow() => Balanced = true; public LightweightShortbow(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Ranged/LongbowOfMight.cs b/Projects/Scripts/Items/Weapons/Ranged/LongbowOfMight.cs index d6dcef563..e81cdc496 100644 --- a/Projects/Scripts/Items/Weapons/Ranged/LongbowOfMight.cs +++ b/Projects/Scripts/Items/Weapons/Ranged/LongbowOfMight.cs @@ -3,10 +3,7 @@ namespace Server.Items public class LongbowOfMight : ElvenCompositeLongbow { [Constructible] - public LongbowOfMight() - { - Attributes.WeaponDamage = 5; - } + public LongbowOfMight() => Attributes.WeaponDamage = 5; public LongbowOfMight(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Ranged/RangersShortbow.cs b/Projects/Scripts/Items/Weapons/Ranged/RangersShortbow.cs index 8e0c1ef59..9119b38f3 100644 --- a/Projects/Scripts/Items/Weapons/Ranged/RangersShortbow.cs +++ b/Projects/Scripts/Items/Weapons/Ranged/RangersShortbow.cs @@ -3,10 +3,7 @@ namespace Server.Items public class RangersShortbow : MagicalShortbow { [Constructible] - public RangersShortbow() - { - Attributes.WeaponSpeed = 5; - } + public RangersShortbow() => Attributes.WeaponSpeed = 5; public RangersShortbow(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Ranged/RepeatingCrossbow.cs b/Projects/Scripts/Items/Weapons/Ranged/RepeatingCrossbow.cs index 6ad769d9d..3c54f15f2 100644 --- a/Projects/Scripts/Items/Weapons/Ranged/RepeatingCrossbow.cs +++ b/Projects/Scripts/Items/Weapons/Ranged/RepeatingCrossbow.cs @@ -6,10 +6,7 @@ namespace Server.Items public class RepeatingCrossbow : BaseRanged { [Constructible] - public RepeatingCrossbow() : base(0x26C3) - { - Weight = 6.0; - } + public RepeatingCrossbow() : base(0x26C3) => Weight = 6.0; public RepeatingCrossbow(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Ranged/SlayerLongbow.cs b/Projects/Scripts/Items/Weapons/Ranged/SlayerLongbow.cs index 0ea51d838..913478e66 100644 --- a/Projects/Scripts/Items/Weapons/Ranged/SlayerLongbow.cs +++ b/Projects/Scripts/Items/Weapons/Ranged/SlayerLongbow.cs @@ -3,10 +3,7 @@ namespace Server.Items public class SlayerLongbow : ElvenCompositeLongbow { [Constructible] - public SlayerLongbow() - { - Slayer2 = (SlayerName)Utility.RandomMinMax(1, 27); - } + public SlayerLongbow() => Slayer2 = (SlayerName)Utility.RandomMinMax(1, 27); public SlayerLongbow(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/SE Weapons/Bokuto.cs b/Projects/Scripts/Items/Weapons/SE Weapons/Bokuto.cs index f1a44879e..190510384 100644 --- a/Projects/Scripts/Items/Weapons/SE Weapons/Bokuto.cs +++ b/Projects/Scripts/Items/Weapons/SE Weapons/Bokuto.cs @@ -4,10 +4,7 @@ namespace Server.Items public class Bokuto : BaseSword { [Constructible] - public Bokuto() : base(0x27A8) - { - Weight = 7.0; - } + public Bokuto() : base(0x27A8) => Weight = 7.0; public Bokuto(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/SE Weapons/Nunchaku.cs b/Projects/Scripts/Items/Weapons/SE Weapons/Nunchaku.cs index 3d95ee61f..487909dcf 100644 --- a/Projects/Scripts/Items/Weapons/SE Weapons/Nunchaku.cs +++ b/Projects/Scripts/Items/Weapons/SE Weapons/Nunchaku.cs @@ -4,10 +4,7 @@ namespace Server.Items public class Nunchaku : BaseBashing { [Constructible] - public Nunchaku() : base(0x27AE) - { - Weight = 5.0; - } + public Nunchaku() : base(0x27AE) => Weight = 5.0; public Nunchaku(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/SpearsAndForks/BladedStaff.cs b/Projects/Scripts/Items/Weapons/SpearsAndForks/BladedStaff.cs index 9a3193224..d8dc579c2 100644 --- a/Projects/Scripts/Items/Weapons/SpearsAndForks/BladedStaff.cs +++ b/Projects/Scripts/Items/Weapons/SpearsAndForks/BladedStaff.cs @@ -4,10 +4,7 @@ namespace Server.Items public class BladedStaff : BaseSpear { [Constructible] - public BladedStaff() : base(0x26BD) - { - Weight = 4.0; - } + public BladedStaff() : base(0x26BD) => Weight = 4.0; public BladedStaff(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/SpearsAndForks/DoubleBladedStaff.cs b/Projects/Scripts/Items/Weapons/SpearsAndForks/DoubleBladedStaff.cs index b094bb0d4..1148d6658 100644 --- a/Projects/Scripts/Items/Weapons/SpearsAndForks/DoubleBladedStaff.cs +++ b/Projects/Scripts/Items/Weapons/SpearsAndForks/DoubleBladedStaff.cs @@ -4,10 +4,7 @@ namespace Server.Items public class DoubleBladedStaff : BaseSpear { [Constructible] - public DoubleBladedStaff() : base(0x26BF) - { - Weight = 2.0; - } + public DoubleBladedStaff() : base(0x26BF) => Weight = 2.0; public DoubleBladedStaff(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/SpearsAndForks/Pike.cs b/Projects/Scripts/Items/Weapons/SpearsAndForks/Pike.cs index 7a215b95d..21804ccb8 100644 --- a/Projects/Scripts/Items/Weapons/SpearsAndForks/Pike.cs +++ b/Projects/Scripts/Items/Weapons/SpearsAndForks/Pike.cs @@ -4,10 +4,7 @@ namespace Server.Items public class Pike : BaseSpear { [Constructible] - public Pike() : base(0x26BE) - { - Weight = 8.0; - } + public Pike() : base(0x26BE) => Weight = 8.0; public Pike(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/SpearsAndForks/Pitchfork.cs b/Projects/Scripts/Items/Weapons/SpearsAndForks/Pitchfork.cs index 01f857eb9..a1da0befe 100644 --- a/Projects/Scripts/Items/Weapons/SpearsAndForks/Pitchfork.cs +++ b/Projects/Scripts/Items/Weapons/SpearsAndForks/Pitchfork.cs @@ -4,10 +4,7 @@ namespace Server.Items public class Pitchfork : BaseSpear { [Constructible] - public Pitchfork() : base(0xE87) - { - Weight = 11.0; - } + public Pitchfork() : base(0xE87) => Weight = 11.0; public Pitchfork(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/SpearsAndForks/ShortSpear.cs b/Projects/Scripts/Items/Weapons/SpearsAndForks/ShortSpear.cs index 4c18525c8..a4eb0fe97 100644 --- a/Projects/Scripts/Items/Weapons/SpearsAndForks/ShortSpear.cs +++ b/Projects/Scripts/Items/Weapons/SpearsAndForks/ShortSpear.cs @@ -4,10 +4,7 @@ namespace Server.Items public class ShortSpear : BaseSpear { [Constructible] - public ShortSpear() : base(0x1403) - { - Weight = 4.0; - } + public ShortSpear() : base(0x1403) => Weight = 4.0; public ShortSpear(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/SpearsAndForks/Spear.cs b/Projects/Scripts/Items/Weapons/SpearsAndForks/Spear.cs index 8dd62b6df..0d43048fe 100644 --- a/Projects/Scripts/Items/Weapons/SpearsAndForks/Spear.cs +++ b/Projects/Scripts/Items/Weapons/SpearsAndForks/Spear.cs @@ -4,10 +4,7 @@ namespace Server.Items public class Spear : BaseSpear { [Constructible] - public Spear() : base(0xF62) - { - Weight = 7.0; - } + public Spear() : base(0xF62) => Weight = 7.0; public Spear(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/SpearsAndForks/WarFork.cs b/Projects/Scripts/Items/Weapons/SpearsAndForks/WarFork.cs index 4d7692f4c..ba6e8fab7 100644 --- a/Projects/Scripts/Items/Weapons/SpearsAndForks/WarFork.cs +++ b/Projects/Scripts/Items/Weapons/SpearsAndForks/WarFork.cs @@ -4,10 +4,7 @@ namespace Server.Items public class WarFork : BaseSpear { [Constructible] - public WarFork() : base(0x1405) - { - Weight = 9.0; - } + public WarFork() : base(0x1405) => Weight = 9.0; public WarFork(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Staves/BlackStaff.cs b/Projects/Scripts/Items/Weapons/Staves/BlackStaff.cs index 9714b9ca7..a0c862f4c 100644 --- a/Projects/Scripts/Items/Weapons/Staves/BlackStaff.cs +++ b/Projects/Scripts/Items/Weapons/Staves/BlackStaff.cs @@ -4,10 +4,7 @@ namespace Server.Items public class BlackStaff : BaseStaff { [Constructible] - public BlackStaff() : base(0xDF0) - { - Weight = 6.0; - } + public BlackStaff() : base(0xDF0) => Weight = 6.0; public BlackStaff(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Staves/GnarledStaff.cs b/Projects/Scripts/Items/Weapons/Staves/GnarledStaff.cs index 03cb5cbb9..e58977249 100644 --- a/Projects/Scripts/Items/Weapons/Staves/GnarledStaff.cs +++ b/Projects/Scripts/Items/Weapons/Staves/GnarledStaff.cs @@ -4,10 +4,7 @@ namespace Server.Items public class GnarledStaff : BaseStaff { [Constructible] - public GnarledStaff() : base(0x13F8) - { - Weight = 3.0; - } + public GnarledStaff() : base(0x13F8) => Weight = 3.0; public GnarledStaff(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Staves/QuarterStaff.cs b/Projects/Scripts/Items/Weapons/Staves/QuarterStaff.cs index 0d1500e28..6f8ee629f 100644 --- a/Projects/Scripts/Items/Weapons/Staves/QuarterStaff.cs +++ b/Projects/Scripts/Items/Weapons/Staves/QuarterStaff.cs @@ -4,10 +4,7 @@ namespace Server.Items public class QuarterStaff : BaseStaff { [Constructible] - public QuarterStaff() : base(0xE89) - { - Weight = 4.0; - } + public QuarterStaff() : base(0xE89) => Weight = 4.0; public QuarterStaff(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Staves/ShepherdsCrook.cs b/Projects/Scripts/Items/Weapons/Staves/ShepherdsCrook.cs index df6f0cfb4..dab5c1bb5 100644 --- a/Projects/Scripts/Items/Weapons/Staves/ShepherdsCrook.cs +++ b/Projects/Scripts/Items/Weapons/Staves/ShepherdsCrook.cs @@ -10,10 +10,7 @@ namespace Server.Items public class ShepherdsCrook : BaseStaff { [Constructible] - public ShepherdsCrook() : base(0xE81) - { - Weight = 4.0; - } + public ShepherdsCrook() : base(0xE81) => Weight = 4.0; public ShepherdsCrook(Serial serial) : base(serial) { @@ -133,10 +130,7 @@ namespace Server.Items { private BaseCreature m_Creature; - public InternalTarget(BaseCreature c) : base(10, true, TargetFlags.None) - { - m_Creature = c; - } + public InternalTarget(BaseCreature c) : base(10, true, TargetFlags.None) => m_Creature = c; protected override void OnTarget(Mobile from, object targ) { diff --git a/Projects/Scripts/Items/Weapons/Swords/AdventurersMachete.cs b/Projects/Scripts/Items/Weapons/Swords/AdventurersMachete.cs index 78417929c..6b562727f 100644 --- a/Projects/Scripts/Items/Weapons/Swords/AdventurersMachete.cs +++ b/Projects/Scripts/Items/Weapons/Swords/AdventurersMachete.cs @@ -3,10 +3,7 @@ namespace Server.Items public class AdventurersMachete : ElvenMachete { [Constructible] - public AdventurersMachete() - { - Attributes.Luck = 20; - } + public AdventurersMachete() => Attributes.Luck = 20; public AdventurersMachete(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Swords/BoneHarvester.cs b/Projects/Scripts/Items/Weapons/Swords/BoneHarvester.cs index 5a7c97070..55546f3a6 100644 --- a/Projects/Scripts/Items/Weapons/Swords/BoneHarvester.cs +++ b/Projects/Scripts/Items/Weapons/Swords/BoneHarvester.cs @@ -4,10 +4,7 @@ namespace Server.Items public class BoneHarvester : BaseSword { [Constructible] - public BoneHarvester() : base(0x26BB) - { - Weight = 3.0; - } + public BoneHarvester() : base(0x26BB) => Weight = 3.0; public BoneHarvester(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Swords/BoneMachete.cs b/Projects/Scripts/Items/Weapons/Swords/BoneMachete.cs index 161a4ae13..13e677135 100644 --- a/Projects/Scripts/Items/Weapons/Swords/BoneMachete.cs +++ b/Projects/Scripts/Items/Weapons/Swords/BoneMachete.cs @@ -5,10 +5,7 @@ namespace Server.Items public class BoneMachete : ElvenMachete, ITicket { [Constructible] - public BoneMachete() - { - ItemID = 0x20E; - } + public BoneMachete() => ItemID = 0x20E; public BoneMachete(Serial serial) : base(serial) diff --git a/Projects/Scripts/Items/Weapons/Swords/Broadsword.cs b/Projects/Scripts/Items/Weapons/Swords/Broadsword.cs index 25873490e..180155339 100644 --- a/Projects/Scripts/Items/Weapons/Swords/Broadsword.cs +++ b/Projects/Scripts/Items/Weapons/Swords/Broadsword.cs @@ -4,10 +4,7 @@ namespace Server.Items public class Broadsword : BaseSword { [Constructible] - public Broadsword() : base(0xF5E) - { - Weight = 6.0; - } + public Broadsword() : base(0xF5E) => Weight = 6.0; public Broadsword(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Swords/ChargedAssassinSpike.cs b/Projects/Scripts/Items/Weapons/Swords/ChargedAssassinSpike.cs index c82eeb40c..0780f677b 100644 --- a/Projects/Scripts/Items/Weapons/Swords/ChargedAssassinSpike.cs +++ b/Projects/Scripts/Items/Weapons/Swords/ChargedAssassinSpike.cs @@ -3,10 +3,7 @@ namespace Server.Items public class ChargedAssassinSpike : AssassinSpike { [Constructible] - public ChargedAssassinSpike() - { - WeaponAttributes.HitLightning = 10; - } + public ChargedAssassinSpike() => WeaponAttributes.HitLightning = 10; public ChargedAssassinSpike(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Swords/CrescentBlade.cs b/Projects/Scripts/Items/Weapons/Swords/CrescentBlade.cs index badc76c16..fe36c1fcd 100644 --- a/Projects/Scripts/Items/Weapons/Swords/CrescentBlade.cs +++ b/Projects/Scripts/Items/Weapons/Swords/CrescentBlade.cs @@ -4,10 +4,7 @@ namespace Server.Items public class CrescentBlade : BaseSword { [Constructible] - public CrescentBlade() : base(0x26C1) - { - Weight = 1.0; - } + public CrescentBlade() : base(0x26C1) => Weight = 1.0; public CrescentBlade(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Swords/Cutlass.cs b/Projects/Scripts/Items/Weapons/Swords/Cutlass.cs index 0a26665e1..81dc203d3 100644 --- a/Projects/Scripts/Items/Weapons/Swords/Cutlass.cs +++ b/Projects/Scripts/Items/Weapons/Swords/Cutlass.cs @@ -4,10 +4,7 @@ namespace Server.Items public class Cutlass : BaseSword { [Constructible] - public Cutlass() : base(0x1441) - { - Weight = 8.0; - } + public Cutlass() : base(0x1441) => Weight = 8.0; public Cutlass(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Swords/DarkglowScimitar.cs b/Projects/Scripts/Items/Weapons/Swords/DarkglowScimitar.cs index 8cf5dc523..b1a8bf928 100644 --- a/Projects/Scripts/Items/Weapons/Swords/DarkglowScimitar.cs +++ b/Projects/Scripts/Items/Weapons/Swords/DarkglowScimitar.cs @@ -3,10 +3,7 @@ namespace Server.Items public class DarkglowScimitar : RadiantScimitar { [Constructible] - public DarkglowScimitar() - { - WeaponAttributes.HitDispel = 10; - } + public DarkglowScimitar() => WeaponAttributes.HitDispel = 10; public DarkglowScimitar(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Swords/DiseasedMachete.cs b/Projects/Scripts/Items/Weapons/Swords/DiseasedMachete.cs index b01ffc5fa..9bb745ee3 100644 --- a/Projects/Scripts/Items/Weapons/Swords/DiseasedMachete.cs +++ b/Projects/Scripts/Items/Weapons/Swords/DiseasedMachete.cs @@ -3,10 +3,7 @@ namespace Server.Items public class DiseasedMachete : ElvenMachete { [Constructible] - public DiseasedMachete() - { - WeaponAttributes.HitPoisonArea = 25; - } + public DiseasedMachete() => WeaponAttributes.HitPoisonArea = 25; public DiseasedMachete(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Swords/FierySpellblade.cs b/Projects/Scripts/Items/Weapons/Swords/FierySpellblade.cs index ebda09d81..dd3c324f0 100644 --- a/Projects/Scripts/Items/Weapons/Swords/FierySpellblade.cs +++ b/Projects/Scripts/Items/Weapons/Swords/FierySpellblade.cs @@ -3,10 +3,7 @@ namespace Server.Items public class FierySpellblade : ElvenSpellblade { [Constructible] - public FierySpellblade() - { - WeaponAttributes.ResistFireBonus = 5; - } + public FierySpellblade() => WeaponAttributes.ResistFireBonus = 5; public FierySpellblade(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Swords/IcyScimitar.cs b/Projects/Scripts/Items/Weapons/Swords/IcyScimitar.cs index 7ff484692..59b4c5c78 100644 --- a/Projects/Scripts/Items/Weapons/Swords/IcyScimitar.cs +++ b/Projects/Scripts/Items/Weapons/Swords/IcyScimitar.cs @@ -3,10 +3,7 @@ namespace Server.Items public class IcyScimitar : RadiantScimitar { [Constructible] - public IcyScimitar() - { - WeaponAttributes.HitHarm = 15; - } + public IcyScimitar() => WeaponAttributes.HitHarm = 15; public IcyScimitar(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Swords/IcySpellblade.cs b/Projects/Scripts/Items/Weapons/Swords/IcySpellblade.cs index c889b1b07..edf399a08 100644 --- a/Projects/Scripts/Items/Weapons/Swords/IcySpellblade.cs +++ b/Projects/Scripts/Items/Weapons/Swords/IcySpellblade.cs @@ -3,10 +3,7 @@ namespace Server.Items public class IcySpellblade : ElvenSpellblade { [Constructible] - public IcySpellblade() - { - WeaponAttributes.ResistColdBonus = 5; - } + public IcySpellblade() => WeaponAttributes.ResistColdBonus = 5; public IcySpellblade(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Swords/Katana.cs b/Projects/Scripts/Items/Weapons/Swords/Katana.cs index ad2b6d1e4..19f0d8563 100644 --- a/Projects/Scripts/Items/Weapons/Swords/Katana.cs +++ b/Projects/Scripts/Items/Weapons/Swords/Katana.cs @@ -4,10 +4,7 @@ namespace Server.Items public class Katana : BaseSword { [Constructible] - public Katana() : base(0x13FF) - { - Weight = 6.0; - } + public Katana() : base(0x13FF) => Weight = 6.0; public Katana(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Swords/KnightsWarCleaver.cs b/Projects/Scripts/Items/Weapons/Swords/KnightsWarCleaver.cs index fab35ce5a..d673bdc78 100644 --- a/Projects/Scripts/Items/Weapons/Swords/KnightsWarCleaver.cs +++ b/Projects/Scripts/Items/Weapons/Swords/KnightsWarCleaver.cs @@ -3,10 +3,7 @@ namespace Server.Items public class KnightsWarCleaver : WarCleaver { [Constructible] - public KnightsWarCleaver() - { - Attributes.RegenHits = 3; - } + public KnightsWarCleaver() => Attributes.RegenHits = 3; public KnightsWarCleaver(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Swords/Kryss.cs b/Projects/Scripts/Items/Weapons/Swords/Kryss.cs index b63f00b9a..e4d8e3e38 100644 --- a/Projects/Scripts/Items/Weapons/Swords/Kryss.cs +++ b/Projects/Scripts/Items/Weapons/Swords/Kryss.cs @@ -4,10 +4,7 @@ namespace Server.Items public class Kryss : BaseSword { [Constructible] - public Kryss() : base(0x1401) - { - Weight = 2.0; - } + public Kryss() : base(0x1401) => Weight = 2.0; public Kryss(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Swords/Lance.cs b/Projects/Scripts/Items/Weapons/Swords/Lance.cs index 16c6c578b..99f827e65 100644 --- a/Projects/Scripts/Items/Weapons/Swords/Lance.cs +++ b/Projects/Scripts/Items/Weapons/Swords/Lance.cs @@ -4,10 +4,7 @@ namespace Server.Items public class Lance : BaseSword { [Constructible] - public Lance() : base(0x26C0) - { - Weight = 12.0; - } + public Lance() : base(0x26C0) => Weight = 12.0; public Lance(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Swords/LeafbladeOfEase.cs b/Projects/Scripts/Items/Weapons/Swords/LeafbladeOfEase.cs index 5699c5b25..2c7c2ba6c 100644 --- a/Projects/Scripts/Items/Weapons/Swords/LeafbladeOfEase.cs +++ b/Projects/Scripts/Items/Weapons/Swords/LeafbladeOfEase.cs @@ -3,10 +3,7 @@ namespace Server.Items public class LeafbladeOfEase : Leafblade { [Constructible] - public LeafbladeOfEase() - { - WeaponAttributes.UseBestSkill = 1; - } + public LeafbladeOfEase() => WeaponAttributes.UseBestSkill = 1; public LeafbladeOfEase(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Swords/Longsword.cs b/Projects/Scripts/Items/Weapons/Swords/Longsword.cs index 64b315d5e..0bdf580a8 100644 --- a/Projects/Scripts/Items/Weapons/Swords/Longsword.cs +++ b/Projects/Scripts/Items/Weapons/Swords/Longsword.cs @@ -4,10 +4,7 @@ namespace Server.Items public class Longsword : BaseSword { [Constructible] - public Longsword() : base(0xF61) - { - Weight = 7.0; - } + public Longsword() : base(0xF61) => Weight = 7.0; public Longsword(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Swords/Luckblade.cs b/Projects/Scripts/Items/Weapons/Swords/Luckblade.cs index 8bc842a42..fef0c2b4b 100644 --- a/Projects/Scripts/Items/Weapons/Swords/Luckblade.cs +++ b/Projects/Scripts/Items/Weapons/Swords/Luckblade.cs @@ -3,10 +3,7 @@ namespace Server.Items public class Luckblade : Leafblade { [Constructible] - public Luckblade() - { - Attributes.Luck = 20; - } + public Luckblade() => Attributes.Luck = 20; public Luckblade(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Swords/MacheteOfDefense.cs b/Projects/Scripts/Items/Weapons/Swords/MacheteOfDefense.cs index 16c4f8033..492ed7daa 100644 --- a/Projects/Scripts/Items/Weapons/Swords/MacheteOfDefense.cs +++ b/Projects/Scripts/Items/Weapons/Swords/MacheteOfDefense.cs @@ -3,10 +3,7 @@ namespace Server.Items public class MacheteOfDefense : ElvenMachete { [Constructible] - public MacheteOfDefense() - { - Attributes.DefendChance = 5; - } + public MacheteOfDefense() => Attributes.DefendChance = 5; public MacheteOfDefense(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Swords/MagekillerAssassinSpike.cs b/Projects/Scripts/Items/Weapons/Swords/MagekillerAssassinSpike.cs index 3e922e6c4..74d8e79a4 100644 --- a/Projects/Scripts/Items/Weapons/Swords/MagekillerAssassinSpike.cs +++ b/Projects/Scripts/Items/Weapons/Swords/MagekillerAssassinSpike.cs @@ -3,10 +3,7 @@ namespace Server.Items public class MagekillerAssassinSpike : AssassinSpike { [Constructible] - public MagekillerAssassinSpike() - { - WeaponAttributes.HitLeechMana = 16; - } + public MagekillerAssassinSpike() => WeaponAttributes.HitLeechMana = 16; public MagekillerAssassinSpike(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Swords/MagekillerLeafblade.cs b/Projects/Scripts/Items/Weapons/Swords/MagekillerLeafblade.cs index 1962eba43..99b2c89fd 100644 --- a/Projects/Scripts/Items/Weapons/Swords/MagekillerLeafblade.cs +++ b/Projects/Scripts/Items/Weapons/Swords/MagekillerLeafblade.cs @@ -3,10 +3,7 @@ namespace Server.Items public class MagekillerLeafblade : Leafblade { [Constructible] - public MagekillerLeafblade() - { - WeaponAttributes.HitLeechMana = 16; - } + public MagekillerLeafblade() => WeaponAttributes.HitLeechMana = 16; public MagekillerLeafblade(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Swords/MagesRuneBlade.cs b/Projects/Scripts/Items/Weapons/Swords/MagesRuneBlade.cs index c97416ad5..e3e1dfb46 100644 --- a/Projects/Scripts/Items/Weapons/Swords/MagesRuneBlade.cs +++ b/Projects/Scripts/Items/Weapons/Swords/MagesRuneBlade.cs @@ -3,10 +3,7 @@ namespace Server.Items public class MagesRuneBlade : RuneBlade { [Constructible] - public MagesRuneBlade() - { - Attributes.CastSpeed = 1; - } + public MagesRuneBlade() => Attributes.CastSpeed = 1; public MagesRuneBlade(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Swords/RuneBladeOfKnowledge.cs b/Projects/Scripts/Items/Weapons/Swords/RuneBladeOfKnowledge.cs index f6c00e314..dfe7e6e61 100644 --- a/Projects/Scripts/Items/Weapons/Swords/RuneBladeOfKnowledge.cs +++ b/Projects/Scripts/Items/Weapons/Swords/RuneBladeOfKnowledge.cs @@ -3,10 +3,7 @@ namespace Server.Items public class RuneBladeOfKnowledge : RuneBlade { [Constructible] - public RuneBladeOfKnowledge() - { - Attributes.SpellDamage = 5; - } + public RuneBladeOfKnowledge() => Attributes.SpellDamage = 5; public RuneBladeOfKnowledge(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Swords/Scimitar.cs b/Projects/Scripts/Items/Weapons/Swords/Scimitar.cs index aee828f4e..3fbfb7dcf 100644 --- a/Projects/Scripts/Items/Weapons/Swords/Scimitar.cs +++ b/Projects/Scripts/Items/Weapons/Swords/Scimitar.cs @@ -4,10 +4,7 @@ namespace Server.Items public class Scimitar : BaseSword { [Constructible] - public Scimitar() : base(0x13B6) - { - Weight = 5.0; - } + public Scimitar() : base(0x13B6) => Weight = 5.0; public Scimitar(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Swords/SerratedWarCleaver.cs b/Projects/Scripts/Items/Weapons/Swords/SerratedWarCleaver.cs index e07a65ca5..c4439cc8f 100644 --- a/Projects/Scripts/Items/Weapons/Swords/SerratedWarCleaver.cs +++ b/Projects/Scripts/Items/Weapons/Swords/SerratedWarCleaver.cs @@ -3,10 +3,7 @@ namespace Server.Items public class SerratedWarCleaver : WarCleaver { [Constructible] - public SerratedWarCleaver() - { - Attributes.WeaponDamage = 7; - } + public SerratedWarCleaver() => Attributes.WeaponDamage = 7; public SerratedWarCleaver(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Swords/SpellbladeOfDefense.cs b/Projects/Scripts/Items/Weapons/Swords/SpellbladeOfDefense.cs index abf724196..5856e9af1 100644 --- a/Projects/Scripts/Items/Weapons/Swords/SpellbladeOfDefense.cs +++ b/Projects/Scripts/Items/Weapons/Swords/SpellbladeOfDefense.cs @@ -3,10 +3,7 @@ namespace Server.Items public class SpellbladeOfDefense : ElvenSpellblade { [Constructible] - public SpellbladeOfDefense() - { - Attributes.DefendChance = 5; - } + public SpellbladeOfDefense() => Attributes.DefendChance = 5; public SpellbladeOfDefense(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Swords/ThinLongsword.cs b/Projects/Scripts/Items/Weapons/Swords/ThinLongsword.cs index d9a6d8113..b02796784 100644 --- a/Projects/Scripts/Items/Weapons/Swords/ThinLongsword.cs +++ b/Projects/Scripts/Items/Weapons/Swords/ThinLongsword.cs @@ -4,10 +4,7 @@ namespace Server.Items public class ThinLongsword : BaseSword { [Constructible] - public ThinLongsword() : base(0x13B8) - { - Weight = 1.0; - } + public ThinLongsword() : base(0x13B8) => Weight = 1.0; public ThinLongsword(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Swords/TrueLeafblade.cs b/Projects/Scripts/Items/Weapons/Swords/TrueLeafblade.cs index bf4f5c269..cbc06d944 100644 --- a/Projects/Scripts/Items/Weapons/Swords/TrueLeafblade.cs +++ b/Projects/Scripts/Items/Weapons/Swords/TrueLeafblade.cs @@ -3,10 +3,7 @@ namespace Server.Items public class TrueLeafblade : Leafblade { [Constructible] - public TrueLeafblade() - { - WeaponAttributes.ResistPoisonBonus = 5; - } + public TrueLeafblade() => WeaponAttributes.ResistPoisonBonus = 5; public TrueLeafblade(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Swords/TrueRadiantScimitar.cs b/Projects/Scripts/Items/Weapons/Swords/TrueRadiantScimitar.cs index 6de73eaca..752c41068 100644 --- a/Projects/Scripts/Items/Weapons/Swords/TrueRadiantScimitar.cs +++ b/Projects/Scripts/Items/Weapons/Swords/TrueRadiantScimitar.cs @@ -3,10 +3,7 @@ namespace Server.Items public class TrueRadiantScimitar : RadiantScimitar { [Constructible] - public TrueRadiantScimitar() - { - Attributes.NightSight = 1; - } + public TrueRadiantScimitar() => Attributes.NightSight = 1; public TrueRadiantScimitar(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Swords/TwinklingScimitar.cs b/Projects/Scripts/Items/Weapons/Swords/TwinklingScimitar.cs index 99f21e10c..6b1a9646b 100644 --- a/Projects/Scripts/Items/Weapons/Swords/TwinklingScimitar.cs +++ b/Projects/Scripts/Items/Weapons/Swords/TwinklingScimitar.cs @@ -3,10 +3,7 @@ namespace Server.Items public class TwinklingScimitar : RadiantScimitar { [Constructible] - public TwinklingScimitar() - { - Attributes.DefendChance = 6; - } + public TwinklingScimitar() => Attributes.DefendChance = 6; public TwinklingScimitar(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Swords/VikingSword.cs b/Projects/Scripts/Items/Weapons/Swords/VikingSword.cs index 5e490c228..640e944c8 100644 --- a/Projects/Scripts/Items/Weapons/Swords/VikingSword.cs +++ b/Projects/Scripts/Items/Weapons/Swords/VikingSword.cs @@ -4,10 +4,7 @@ namespace Server.Items public class VikingSword : BaseSword { [Constructible] - public VikingSword() : base(0x13B9) - { - Weight = 6.0; - } + public VikingSword() : base(0x13B9) => Weight = 6.0; public VikingSword(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Swords/WoundingAssassinSpike.cs b/Projects/Scripts/Items/Weapons/Swords/WoundingAssassinSpike.cs index 69c7ab8cd..dfb79dfc9 100644 --- a/Projects/Scripts/Items/Weapons/Swords/WoundingAssassinSpike.cs +++ b/Projects/Scripts/Items/Weapons/Swords/WoundingAssassinSpike.cs @@ -3,10 +3,7 @@ namespace Server.Items public class WoundingAssassinSpike : AssassinSpike { [Constructible] - public WoundingAssassinSpike() - { - WeaponAttributes.HitHarm = 15; - } + public WoundingAssassinSpike() => WeaponAttributes.HitHarm = 15; public WoundingAssassinSpike(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Wooden/AncientWildStaff.cs b/Projects/Scripts/Items/Weapons/Wooden/AncientWildStaff.cs index a2b9f6e95..39521635a 100644 --- a/Projects/Scripts/Items/Weapons/Wooden/AncientWildStaff.cs +++ b/Projects/Scripts/Items/Weapons/Wooden/AncientWildStaff.cs @@ -3,10 +3,7 @@ namespace Server.Items public class AncientWildStaff : WildStaff { [Constructible] - public AncientWildStaff() - { - WeaponAttributes.ResistPoisonBonus = 5; - } + public AncientWildStaff() => WeaponAttributes.ResistPoisonBonus = 5; public AncientWildStaff(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Wooden/HardenedWildStaff.cs b/Projects/Scripts/Items/Weapons/Wooden/HardenedWildStaff.cs index 9a985ed61..f652ffae9 100644 --- a/Projects/Scripts/Items/Weapons/Wooden/HardenedWildStaff.cs +++ b/Projects/Scripts/Items/Weapons/Wooden/HardenedWildStaff.cs @@ -3,10 +3,7 @@ namespace Server.Items public class HardenedWildStaff : WildStaff { [Constructible] - public HardenedWildStaff() - { - Attributes.WeaponDamage = 5; - } + public HardenedWildStaff() => Attributes.WeaponDamage = 5; public HardenedWildStaff(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Items/Weapons/Wooden/ThornedWildStaff.cs b/Projects/Scripts/Items/Weapons/Wooden/ThornedWildStaff.cs index ea01f95fe..99ded7282 100644 --- a/Projects/Scripts/Items/Weapons/Wooden/ThornedWildStaff.cs +++ b/Projects/Scripts/Items/Weapons/Wooden/ThornedWildStaff.cs @@ -3,10 +3,7 @@ namespace Server.Items public class ThornedWildStaff : WildStaff { [Constructible] - public ThornedWildStaff() - { - Attributes.ReflectPhysical = 12; - } + public ThornedWildStaff() => Attributes.ReflectPhysical = 12; public ThornedWildStaff(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Misc/AOS.cs b/Projects/Scripts/Misc/AOS.cs index 5c5f56900..ac0c559eb 100644 --- a/Projects/Scripts/Misc/AOS.cs +++ b/Projects/Scripts/Misc/AOS.cs @@ -24,32 +24,19 @@ namespace Server } } - public static int Damage(Mobile m, int damage, bool ignoreArmor, int phys, int fire, int cold, int pois, int nrgy) - { - return Damage(m, null, damage, ignoreArmor, phys, fire, cold, pois, nrgy); - } + public static int Damage(Mobile m, int damage, bool ignoreArmor, int phys, int fire, int cold, int pois, int nrgy) => Damage(m, null, damage, ignoreArmor, phys, fire, cold, pois, nrgy); - public static int Damage(Mobile m, int damage, int phys, int fire, int cold, int pois, int nrgy) - { - return Damage(m, null, damage, phys, fire, cold, pois, nrgy); - } + public static int Damage(Mobile m, int damage, int phys, int fire, int cold, int pois, int nrgy) => Damage(m, null, damage, phys, fire, cold, pois, nrgy); - public static int Damage(Mobile m, Mobile from, int damage, int phys, int fire, int cold, int pois, int nrgy) - { - return Damage(m, from, damage, false, phys, fire, cold, pois, nrgy); - } + public static int Damage(Mobile m, Mobile from, int damage, int phys, int fire, int cold, int pois, int nrgy) => Damage(m, from, damage, false, phys, fire, cold, pois, nrgy); public static int Damage(Mobile m, Mobile from, int damage, int phys, int fire, int cold, int pois, int nrgy, - int chaos) - { - return Damage(m, from, damage, false, phys, fire, cold, pois, nrgy, chaos); - } + int chaos) => + Damage(m, from, damage, false, phys, fire, cold, pois, nrgy, chaos); public static int Damage(Mobile m, Mobile from, int damage, int phys, int fire, int cold, int pois, int nrgy, - bool keepAlive) - { - return Damage(m, from, damage, false, phys, fire, cold, pois, nrgy, 0, 0, keepAlive); - } + bool keepAlive) => + Damage(m, from, damage, false, phys, fire, cold, pois, nrgy, 0, 0, keepAlive); public static int Damage(Mobile m, Mobile from, int damage, bool ignoreArmor, int phys, int fire, int cold, int pois, int nrgy, int chaos = 0, int direct = 0, bool keepAlive = false, bool archer = false, bool deathStrike = false) @@ -203,10 +190,7 @@ namespace Server val = 0; } - public static int Scale(int input, int percent) - { - return input * percent / 100; - } + public static int Scale(int input, int percent) => input * percent / 100; public static int GetStatus(Mobile from, int index) { @@ -525,10 +509,7 @@ namespace Server return value; } - public override string ToString() - { - return "..."; - } + public override string ToString() => "..."; public void AddStatBonuses(Mobile to) { @@ -824,10 +805,7 @@ namespace Server return value; } - public override string ToString() - { - return "..."; - } + public override string ToString() => "..."; } [Flags] @@ -921,10 +899,7 @@ namespace Server return value; } - public override string ToString() - { - return "..."; - } + public override string ToString() => "..."; } public sealed class AosSkillBonuses : BaseAttributes @@ -1140,10 +1115,7 @@ namespace Server SetValues(index, GetSkill(index), bonus); } - public override string ToString() - { - return "..."; - } + public override string ToString() => "..."; public void CheckCancelMorph(Mobile m) { @@ -1279,10 +1251,7 @@ namespace Server set => this[AosElementAttribute.Direct] = value; } - public override string ToString() - { - return "..."; - } + public override string ToString() => "..."; } [PropertyObject] diff --git a/Projects/Scripts/Misc/AutoSave.cs b/Projects/Scripts/Misc/AutoSave.cs index 07e4f260f..2a36ed745 100644 --- a/Projects/Scripts/Misc/AutoSave.cs +++ b/Projects/Scripts/Misc/AutoSave.cs @@ -16,10 +16,7 @@ namespace Server.Misc "Most Recent" }; - public AutoSave() : base(m_Delay - m_Warning, m_Delay) - { - Priority = TimerPriority.OneMinute; - } + public AutoSave() : base(m_Delay - m_Warning, m_Delay) => Priority = TimerPriority.OneMinute; public static bool SavesEnabled{ get; set; } = true; //private static TimeSpan m_Warning = TimeSpan.FromSeconds( 15.0 ); @@ -161,10 +158,7 @@ namespace Server.Misc return null; } - private static string FormatDirectory(string root, string name, string timeStamp) - { - return Path.Combine(root, $"{name} ({timeStamp})"); - } + private static string FormatDirectory(string root, string name, string timeStamp) => Path.Combine(root, $"{name} ({timeStamp})"); private static string FindTimeStamp(string input) { diff --git a/Projects/Scripts/Misc/BuffIcons.cs b/Projects/Scripts/Misc/BuffIcons.cs index daffd1f35..6884f63c9 100644 --- a/Projects/Scripts/Misc/BuffIcons.cs +++ b/Projects/Scripts/Misc/BuffIcons.cs @@ -80,10 +80,8 @@ namespace Server } public BuffInfo(BuffIcon iconID, int titleCliloc, int secondaryCliloc, TextDefinition args) - : this(iconID, titleCliloc, secondaryCliloc) - { + : this(iconID, titleCliloc, secondaryCliloc) => Args = args; - } public BuffInfo(BuffIcon iconID, int titleCliloc, bool retainThroughDeath) : this(iconID, titleCliloc, titleCliloc + 1, retainThroughDeath) @@ -91,10 +89,8 @@ namespace Server } public BuffInfo(BuffIcon iconID, int titleCliloc, int secondaryCliloc, bool retainThroughDeath) - : this(iconID, titleCliloc, secondaryCliloc) - { + : this(iconID, titleCliloc, secondaryCliloc) => RetainThroughDeath = retainThroughDeath; - } public BuffInfo(BuffIcon iconID, int titleCliloc, TextDefinition args, bool retainThroughDeath) : this(iconID, titleCliloc, titleCliloc + 1, args, retainThroughDeath) @@ -102,10 +98,8 @@ namespace Server } public BuffInfo(BuffIcon iconID, int titleCliloc, int secondaryCliloc, TextDefinition args, bool retainThroughDeath) - : this(iconID, titleCliloc, secondaryCliloc, args) - { + : this(iconID, titleCliloc, secondaryCliloc, args) => RetainThroughDeath = retainThroughDeath; - } public BuffInfo(BuffIcon iconID, int titleCliloc, TimeSpan length, Mobile m, TextDefinition args) : this(iconID, titleCliloc, titleCliloc + 1, length, m, args) @@ -114,10 +108,8 @@ namespace Server public BuffInfo(BuffIcon iconID, int titleCliloc, int secondaryCliloc, TimeSpan length, Mobile m, TextDefinition args) - : this(iconID, titleCliloc, secondaryCliloc, length, m) - { + : this(iconID, titleCliloc, secondaryCliloc, length, m) => Args = args; - } public BuffInfo(BuffIcon iconID, int titleCliloc, TimeSpan length, Mobile m, TextDefinition args, bool retainThroughDeath) diff --git a/Projects/Scripts/Misc/DoorGenerator.cs b/Projects/Scripts/Misc/DoorGenerator.cs index 5ad35ea67..a95e8807b 100644 --- a/Projects/Scripts/Misc/DoorGenerator.cs +++ b/Projects/Scripts/Misc/DoorGenerator.cs @@ -407,25 +407,13 @@ namespace Server return false; } - public static bool IsNorthFrame(int id) - { - return IsFrame(id, m_NorthFrames); - } + public static bool IsNorthFrame(int id) => IsFrame(id, m_NorthFrames); - public static bool IsSouthFrame(int id) - { - return IsFrame(id, m_SouthFrames); - } + public static bool IsSouthFrame(int id) => IsFrame(id, m_SouthFrames); - public static bool IsWestFrame(int id) - { - return IsFrame(id, m_WestFrames); - } + public static bool IsWestFrame(int id) => IsFrame(id, m_WestFrames); - public static bool IsEastFrame(int id) - { - return IsFrame(id, m_EastFrames); - } + public static bool IsEastFrame(int id) => IsFrame(id, m_EastFrames); public static bool IsEastFrame(int x, int y, int z) { diff --git a/Projects/Scripts/Misc/Emitter.cs b/Projects/Scripts/Misc/Emitter.cs index ceaca1f69..17088f615 100644 --- a/Projects/Scripts/Misc/Emitter.cs +++ b/Projects/Scripts/Misc/Emitter.cs @@ -5,673 +5,664 @@ using System.Reflection.Emit; namespace Server { - public class AssemblyEmitter - { - private string m_AssemblyName; + public class AssemblyEmitter + { + private string m_AssemblyName; - private AppDomain m_AppDomain; - private AssemblyBuilder m_AssemblyBuilder; - private ModuleBuilder m_ModuleBuilder; + private AppDomain m_AppDomain; + private AssemblyBuilder m_AssemblyBuilder; + private ModuleBuilder m_ModuleBuilder; - public AssemblyEmitter( string assemblyName ) - { - m_AssemblyName = assemblyName; + public AssemblyEmitter( string assemblyName ) + { + m_AssemblyName = assemblyName; - m_AppDomain = AppDomain.CurrentDomain; + m_AppDomain = AppDomain.CurrentDomain; - m_AssemblyBuilder = AssemblyBuilder.DefineDynamicAssembly( - new AssemblyName( assemblyName ), - AssemblyBuilderAccess.Run - ); + m_AssemblyBuilder = AssemblyBuilder.DefineDynamicAssembly( + new AssemblyName( assemblyName ), + AssemblyBuilderAccess.Run + ); m_ModuleBuilder = m_AssemblyBuilder.DefineDynamicModule(assemblyName); - } + } - public TypeBuilder DefineType( string typeName, TypeAttributes attrs, Type parentType ) - { - return m_ModuleBuilder.DefineType( typeName, attrs, parentType ); - } - } + public TypeBuilder DefineType( string typeName, TypeAttributes attrs, Type parentType ) => m_ModuleBuilder.DefineType( typeName, attrs, parentType ); + } - public class MethodEmitter - { - private Type[] m_ArgumentTypes; + public class MethodEmitter + { + private Type[] m_ArgumentTypes; - public TypeBuilder Type { get; } + public TypeBuilder Type { get; } - public ILGenerator Generator { get; private set; } + public ILGenerator Generator { get; private set; } - private class CallInfo - { - public Type type; - public MethodInfo method; + private class CallInfo + { + public Type type; + public MethodInfo method; - public int index; - public ParameterInfo[] parms; + public int index; + public ParameterInfo[] parms; - public CallInfo( Type type, MethodInfo method ) - { - this.type = type; - this.method = method; + public CallInfo( Type type, MethodInfo method ) + { + this.type = type; + this.method = method; - parms = method.GetParameters(); - } - } + parms = method.GetParameters(); + } + } - private Stack m_Stack; - private Stack m_Calls; + private Stack m_Stack; + private Stack m_Calls; - private Dictionary> m_Temps; + private Dictionary> m_Temps; - public MethodBuilder Method { get; private set; } + public MethodBuilder Method { get; private set; } - public MethodEmitter( TypeBuilder typeBuilder ) - { - Type = typeBuilder; + public MethodEmitter( TypeBuilder typeBuilder ) + { + Type = typeBuilder; - m_Temps = new Dictionary>(); + m_Temps = new Dictionary>(); - m_Stack = new Stack(); - m_Calls = new Stack(); - } + m_Stack = new Stack(); + m_Calls = new Stack(); + } - public void Define( string name, MethodAttributes attr, Type returnType, Type[] parms ) - { - Method = Type.DefineMethod( name, attr, returnType, parms ); - Generator = Method.GetILGenerator(); + public void Define( string name, MethodAttributes attr, Type returnType, Type[] parms ) + { + Method = Type.DefineMethod( name, attr, returnType, parms ); + Generator = Method.GetILGenerator(); - m_ArgumentTypes = parms; - } + m_ArgumentTypes = parms; + } - public LocalBuilder CreateLocal( Type localType ) - { - return Generator.DeclareLocal( localType ); - } + public LocalBuilder CreateLocal( Type localType ) => Generator.DeclareLocal( localType ); - public LocalBuilder AcquireTemp( Type localType ) - { - if (!m_Temps.TryGetValue( localType, out Queue list )) - m_Temps[localType] = list = new Queue(); + public LocalBuilder AcquireTemp( Type localType ) + { + if (!m_Temps.TryGetValue( localType, out Queue list )) + m_Temps[localType] = list = new Queue(); - return list.Count > 0 ? list.Dequeue() : CreateLocal( localType ); - } + return list.Count > 0 ? list.Dequeue() : CreateLocal( localType ); + } - public void ReleaseTemp( LocalBuilder local ) - { - if (local.LocalType == null) - return; + public void ReleaseTemp( LocalBuilder local ) + { + if (local.LocalType == null) + return; - if (!m_Temps.TryGetValue( local.LocalType, out Queue list )) - m_Temps[local.LocalType] = list = new Queue(); + if (!m_Temps.TryGetValue( local.LocalType, out Queue list )) + m_Temps[local.LocalType] = list = new Queue(); - list.Enqueue( local ); - } + list.Enqueue( local ); + } - public void Branch( Label label ) - { - Generator.Emit( OpCodes.Br, label ); - } + public void Branch( Label label ) + { + Generator.Emit( OpCodes.Br, label ); + } - public void BranchIfFalse( Label label ) - { - Pop( typeof( object ) ); + public void BranchIfFalse( Label label ) + { + Pop( typeof( object ) ); - Generator.Emit( OpCodes.Brfalse, label ); - } + Generator.Emit( OpCodes.Brfalse, label ); + } - public void BranchIfTrue( Label label ) - { - Pop( typeof( object ) ); + public void BranchIfTrue( Label label ) + { + Pop( typeof( object ) ); - Generator.Emit( OpCodes.Brtrue, label ); - } + Generator.Emit( OpCodes.Brtrue, label ); + } - public Label CreateLabel() - { - return Generator.DefineLabel(); - } + public Label CreateLabel() => Generator.DefineLabel(); - public void MarkLabel( Label label ) - { - Generator.MarkLabel( label ); - } + public void MarkLabel( Label label ) + { + Generator.MarkLabel( label ); + } - public void Pop() - { - m_Stack.Pop(); - } + public void Pop() + { + m_Stack.Pop(); + } - public void Pop( Type expected ) - { - if ( expected == null ) - throw new InvalidOperationException( "Expected type cannot be null." ); + public void Pop( Type expected ) + { + if ( expected == null ) + throw new InvalidOperationException( "Expected type cannot be null." ); - Type onStack = m_Stack.Pop(); + Type onStack = m_Stack.Pop(); - if ( expected == typeof( bool ) ) - expected = typeof( int ); + if ( expected == typeof( bool ) ) + expected = typeof( int ); - if ( onStack == typeof( bool ) ) - onStack = typeof( int ); + if ( onStack == typeof( bool ) ) + onStack = typeof( int ); - if ( !expected.IsAssignableFrom( onStack ) ) - throw new InvalidOperationException( "Unexpected stack state." ); - } + if ( !expected.IsAssignableFrom( onStack ) ) + throw new InvalidOperationException( "Unexpected stack state." ); + } - public void Push( Type type ) - { - m_Stack.Push( type ); - } + public void Push( Type type ) + { + m_Stack.Push( type ); + } - public void Return() - { - if ( m_Stack.Count != ( Method.ReturnType == typeof( void ) ? 0 : 1 ) ) - throw new InvalidOperationException( "Stack return mismatch." ); + public void Return() + { + if ( m_Stack.Count != ( Method.ReturnType == typeof( void ) ? 0 : 1 ) ) + throw new InvalidOperationException( "Stack return mismatch." ); - Generator.Emit( OpCodes.Ret ); - } + Generator.Emit( OpCodes.Ret ); + } - public void LoadNull() - { - LoadNull( typeof( object ) ); - } - - public void LoadNull( Type type ) - { - Push( type ); + public void LoadNull() + { + LoadNull( typeof( object ) ); + } - Generator.Emit( OpCodes.Ldnull ); - } + public void LoadNull( Type type ) + { + Push( type ); - public void Load( string value ) - { - Push( typeof( string ) ); + Generator.Emit( OpCodes.Ldnull ); + } - if ( value != null ) - Generator.Emit( OpCodes.Ldstr, value ); - else - Generator.Emit( OpCodes.Ldnull ); - } + public void Load( string value ) + { + Push( typeof( string ) ); - public void Load( Enum value ) - { - int toLoad = ((IConvertible)value).ToInt32( null ); - Load( toLoad ); - - Pop(); - Push( value.GetType() ); - } - - public void Load( long value ) - { - Push( typeof( long ) ); + if ( value != null ) + Generator.Emit( OpCodes.Ldstr, value ); + else + Generator.Emit( OpCodes.Ldnull ); + } - Generator.Emit( OpCodes.Ldc_I8, value ); - } - - public void Load( float value ) - { - Push( typeof( float ) ); + public void Load( Enum value ) + { + int toLoad = ((IConvertible)value).ToInt32( null ); + Load( toLoad ); - Generator.Emit( OpCodes.Ldc_R4, value ); - } + Pop(); + Push( value.GetType() ); + } - public void Load( double value ) - { - Push( typeof( double ) ); - - Generator.Emit( OpCodes.Ldc_R8, value ); - } + public void Load( long value ) + { + Push( typeof( long ) ); - public void Load( char value ) - { - Load( (int) value ); - - Pop(); - Push( typeof( char ) ); - } + Generator.Emit( OpCodes.Ldc_I8, value ); + } - public void Load( bool value ) - { - Push( typeof( bool ) ); - - if ( value ) - Generator.Emit( OpCodes.Ldc_I4_1 ); - else - Generator.Emit( OpCodes.Ldc_I4_0 ); - } + public void Load( float value ) + { + Push( typeof( float ) ); - public void Load( int value ) - { - Push( typeof( int ) ); + Generator.Emit( OpCodes.Ldc_R4, value ); + } - switch ( value ) - { - case -1: - Generator.Emit( OpCodes.Ldc_I4_M1 ); - break; - - case 0: - Generator.Emit( OpCodes.Ldc_I4_0 ); - break; - - case 1: - Generator.Emit( OpCodes.Ldc_I4_1 ); - break; - - case 2: - Generator.Emit( OpCodes.Ldc_I4_2 ); - break; - - case 3: - Generator.Emit( OpCodes.Ldc_I4_3 ); - break; - - case 4: - Generator.Emit( OpCodes.Ldc_I4_4 ); - break; - - case 5: - Generator.Emit( OpCodes.Ldc_I4_5 ); - break; - - case 6: - Generator.Emit( OpCodes.Ldc_I4_6 ); - break; - - case 7: - Generator.Emit( OpCodes.Ldc_I4_7 ); - break; - - case 8: - Generator.Emit( OpCodes.Ldc_I4_8 ); - break; - - default: - if ( value >= sbyte.MinValue && value <= sbyte.MaxValue ) - Generator.Emit( OpCodes.Ldc_I4_S, (sbyte) value ); - else - Generator.Emit( OpCodes.Ldc_I4, value ); - - break; - } - } - - public void LoadField( FieldInfo field ) - { - Pop( field.DeclaringType ); - - Push( field.FieldType ); - - Generator.Emit( OpCodes.Ldfld, field ); - } + public void Load( double value ) + { + Push( typeof( double ) ); - public void LoadLocal( LocalBuilder local ) - { - Push( local.LocalType ); - - int index = local.LocalIndex; - - switch ( index ) - { - case 0: - Generator.Emit( OpCodes.Ldloc_0 ); - break; - - case 1: - Generator.Emit( OpCodes.Ldloc_1 ); - break; - - case 2: - Generator.Emit( OpCodes.Ldloc_2 ); - break; + Generator.Emit( OpCodes.Ldc_R8, value ); + } - case 3: - Generator.Emit( OpCodes.Ldloc_3 ); - break; + public void Load( char value ) + { + Load( (int) value ); - default: - if ( index >= byte.MinValue && index <= byte.MinValue ) - Generator.Emit( OpCodes.Ldloc_S, (byte) index ); - else - Generator.Emit( OpCodes.Ldloc, (short) index ); - - break; - } - } + Pop(); + Push( typeof( char ) ); + } - public void StoreLocal( LocalBuilder local ) - { - Pop( local.LocalType ); + public void Load( bool value ) + { + Push( typeof( bool ) ); + + if ( value ) + Generator.Emit( OpCodes.Ldc_I4_1 ); + else + Generator.Emit( OpCodes.Ldc_I4_0 ); + } - Generator.Emit( OpCodes.Stloc, local ); - } + public void Load( int value ) + { + Push( typeof( int ) ); - public void LoadArgument( int index ) - { - if ( index > 0 ) - Push( m_ArgumentTypes[index - 1] ); - else - Push( Type ); + switch ( value ) + { + case -1: + Generator.Emit( OpCodes.Ldc_I4_M1 ); + break; + + case 0: + Generator.Emit( OpCodes.Ldc_I4_0 ); + break; + + case 1: + Generator.Emit( OpCodes.Ldc_I4_1 ); + break; + + case 2: + Generator.Emit( OpCodes.Ldc_I4_2 ); + break; + + case 3: + Generator.Emit( OpCodes.Ldc_I4_3 ); + break; + + case 4: + Generator.Emit( OpCodes.Ldc_I4_4 ); + break; + + case 5: + Generator.Emit( OpCodes.Ldc_I4_5 ); + break; + + case 6: + Generator.Emit( OpCodes.Ldc_I4_6 ); + break; + + case 7: + Generator.Emit( OpCodes.Ldc_I4_7 ); + break; + + case 8: + Generator.Emit( OpCodes.Ldc_I4_8 ); + break; + + default: + if ( value >= sbyte.MinValue && value <= sbyte.MaxValue ) + Generator.Emit( OpCodes.Ldc_I4_S, (sbyte) value ); + else + Generator.Emit( OpCodes.Ldc_I4, value ); + + break; + } + } + + public void LoadField( FieldInfo field ) + { + Pop( field.DeclaringType ); + + Push( field.FieldType ); + + Generator.Emit( OpCodes.Ldfld, field ); + } - switch ( index ) - { - case 0: - Generator.Emit( OpCodes.Ldarg_0 ); - break; + public void LoadLocal( LocalBuilder local ) + { + Push( local.LocalType ); + + int index = local.LocalIndex; + + switch ( index ) + { + case 0: + Generator.Emit( OpCodes.Ldloc_0 ); + break; + + case 1: + Generator.Emit( OpCodes.Ldloc_1 ); + break; + + case 2: + Generator.Emit( OpCodes.Ldloc_2 ); + break; - case 1: - Generator.Emit( OpCodes.Ldarg_1 ); - break; + case 3: + Generator.Emit( OpCodes.Ldloc_3 ); + break; - case 2: - Generator.Emit( OpCodes.Ldarg_2 ); - break; + default: + if ( index >= byte.MinValue && index <= byte.MinValue ) + Generator.Emit( OpCodes.Ldloc_S, (byte) index ); + else + Generator.Emit( OpCodes.Ldloc, (short) index ); + + break; + } + } - case 3: - Generator.Emit( OpCodes.Ldarg_3 ); - break; - - default: - if ( index >= byte.MinValue && index <= byte.MaxValue ) - Generator.Emit( OpCodes.Ldarg_S, (byte) index ); - else - Generator.Emit( OpCodes.Ldarg, (short) index ); - - break; - } - } - - public void CastAs( Type type ) - { - Pop( typeof( object ) ); - Push( type ); - - Generator.Emit( OpCodes.Isinst, type ); - } - - public void Neg() - { - Pop( typeof( int ) ); - - Push( typeof( int ) ); - - Generator.Emit( OpCodes.Neg ); - } - - public void Compare( OpCode opCode ) - { - Pop(); - Pop(); - - Push( typeof( int ) ); - - Generator.Emit( opCode ); - } - - public void LogicalNot() - { - Pop( typeof( int ) ); - - Push( typeof( int ) ); - - Generator.Emit( OpCodes.Ldc_I4_0 ); - Generator.Emit( OpCodes.Ceq ); - } - - public void Xor() - { - Pop( typeof( int ) ); - Pop( typeof( int ) ); - - Push( typeof( int ) ); - - Generator.Emit( OpCodes.Xor ); - } - - public Type Active => m_Stack.Peek(); - - public void Chain( Property prop ) - { - for ( int i = 0; i < prop.Chain.Length; ++i ) - Call( prop.Chain[i].GetGetMethod() ); - } - - public void Call( MethodInfo method ) - { - BeginCall( method ); - - CallInfo call = m_Calls.Peek(); - - if ( call.parms.Length > 0 ) - throw new InvalidOperationException( "Method requires parameters." ); - - FinishCall(); - } - - public delegate void Callback(); - - public bool CompareTo( int sign, Callback argGenerator ) - { - Type active = Active; - - MethodInfo compareTo = active.GetMethod( "CompareTo", new[] { active } ); - - if ( compareTo == null ) - { - /* This gets a little tricky... - * - * There's a scenario where we might be trying to use CompareTo on an interface - * which, while it doesn't explicitly implement CompareTo itself, is said to - * extend IComparable indirectly. The implementation is implicitly passed off - * to implementers... - * - * interface ISomeInterface : IComparable - * { - * void SomeMethod(); - * } - * - * class SomeClass : ISomeInterface - * { - * void SomeMethod() { ... } - * int CompareTo( object other ) { ... } - * } - * - * In this case, calling ISomeInterface.GetMethod( "CompareTo" ) will return null. - * - * Bleh. - */ - - Type[] ifaces = active.FindInterfaces((type, obj) => type.IsGenericType - && type.GetGenericTypeDefinition() == typeof(IComparable<>) - && type.GetGenericArguments()[0].IsAssignableFrom(active), null ); - - if ( ifaces.Length > 0 ) - { - compareTo = ifaces[0].GetMethod( "CompareTo", new[] { active } ); - } - else - { - ifaces = active.FindInterfaces((type, obj) => type == typeof(IComparable), null ); - - if ( ifaces.Length > 0 ) - compareTo = ifaces[0].GetMethod( "CompareTo", new[] { active } ); - } - } - - if ( compareTo == null ) - return false; - - if ( !active.IsValueType ) - { - /* This object is a reference type, so we have to make it behave - * - * null.CompareTo( null ) = 0 - * real.CompareTo( null ) = -1 - * null.CompareTo( real ) = +1 - * - */ - - LocalBuilder aValue = AcquireTemp( active ); - LocalBuilder bValue = AcquireTemp( active ); - - StoreLocal( aValue ); - - argGenerator(); - - StoreLocal( bValue ); - - /* if ( aValue == null ) - * { - * if ( bValue == null ) - * v = 0; - * else - * v = +1; - * } - * else if ( bValue == null ) - * { - * v = -1; - * } - * else - * { - * v = aValue.CompareTo( bValue ); - * } - */ - - Label store = CreateLabel(); - - Label aNotNull = CreateLabel(); - - LoadLocal( aValue ); - BranchIfTrue( aNotNull ); - // if ( aValue == null ) - { - Label bNotNull = CreateLabel(); - - LoadLocal( bValue ); - BranchIfTrue( bNotNull ); - // if ( bValue == null ) - { - Load( 0 ); - Pop( typeof( int ) ); - Branch( store ); - } - MarkLabel( bNotNull ); - // else - { - Load( sign ); - Pop( typeof( int ) ); - Branch( store ); - } - } - MarkLabel( aNotNull ); - // else - { - Label bNotNull = CreateLabel(); - - LoadLocal( bValue ); - BranchIfTrue( bNotNull ); - // bValue == null - { - Load( -sign ); - Pop( typeof( int ) ); - Branch( store ); - } - MarkLabel( bNotNull ); - // else - { - LoadLocal( aValue ); - BeginCall( compareTo ); - - LoadLocal( bValue ); - ArgumentPushed(); - - FinishCall(); - - if ( sign == -1 ) - Neg(); - } - } - - MarkLabel( store ); - - ReleaseTemp( aValue ); - ReleaseTemp( bValue ); - } - else - { - BeginCall( compareTo ); - - argGenerator(); - - ArgumentPushed(); - - FinishCall(); - - if ( sign == -1 ) - Neg(); - } - - return true; - } - - public void BeginCall( MethodInfo method ) - { - Type type; - - if ( ( method.CallingConvention & CallingConventions.HasThis ) != 0 ) - type = m_Stack.Peek(); - else - type = method.DeclaringType; - - m_Calls.Push( new CallInfo( type, method ) ); - - if ( type.IsValueType ) - { - LocalBuilder temp = AcquireTemp( type ); - - Generator.Emit( OpCodes.Stloc, temp ); - Generator.Emit( OpCodes.Ldloca, temp ); - - ReleaseTemp( temp ); - } - } - - public void FinishCall() - { - CallInfo call = m_Calls.Pop(); - - if ( ( call.type.IsValueType || call.type.IsByRef ) && call.method.DeclaringType != call.type ) - Generator.Emit( OpCodes.Constrained, call.type ); - - if ( call.method.DeclaringType?.IsValueType == true || call.method.IsStatic ) - Generator.Emit( OpCodes.Call, call.method ); - else - Generator.Emit( OpCodes.Callvirt, call.method ); - - for ( int i = call.parms.Length - 1; i >= 0; --i ) - Pop( call.parms[i].ParameterType ); - - if ( ( call.method.CallingConvention & CallingConventions.HasThis ) != 0 ) - Pop( call.method.DeclaringType ); - - if ( call.method.ReturnType != typeof( void ) ) - Push( call.method.ReturnType ); - } - - public void ArgumentPushed() - { - CallInfo call = m_Calls.Peek(); + public void StoreLocal( LocalBuilder local ) + { + Pop( local.LocalType ); - ParameterInfo parm = call.parms[call.index++]; + Generator.Emit( OpCodes.Stloc, local ); + } - Type argumentType = m_Stack.Peek(); + public void LoadArgument( int index ) + { + if ( index > 0 ) + Push( m_ArgumentTypes[index - 1] ); + else + Push( Type ); - if ( !parm.ParameterType.IsAssignableFrom( argumentType ) ) - throw new InvalidOperationException( "Parameter type mismatch." ); + switch ( index ) + { + case 0: + Generator.Emit( OpCodes.Ldarg_0 ); + break; - if ( argumentType.IsValueType && !parm.ParameterType.IsValueType ) - Generator.Emit( OpCodes.Box, argumentType ); - } - } + case 1: + Generator.Emit( OpCodes.Ldarg_1 ); + break; + + case 2: + Generator.Emit( OpCodes.Ldarg_2 ); + break; + + case 3: + Generator.Emit( OpCodes.Ldarg_3 ); + break; + + default: + if ( index >= byte.MinValue && index <= byte.MaxValue ) + Generator.Emit( OpCodes.Ldarg_S, (byte) index ); + else + Generator.Emit( OpCodes.Ldarg, (short) index ); + + break; + } + } + + public void CastAs( Type type ) + { + Pop( typeof( object ) ); + Push( type ); + + Generator.Emit( OpCodes.Isinst, type ); + } + + public void Neg() + { + Pop( typeof( int ) ); + + Push( typeof( int ) ); + + Generator.Emit( OpCodes.Neg ); + } + + public void Compare( OpCode opCode ) + { + Pop(); + Pop(); + + Push( typeof( int ) ); + + Generator.Emit( opCode ); + } + + public void LogicalNot() + { + Pop( typeof( int ) ); + + Push( typeof( int ) ); + + Generator.Emit( OpCodes.Ldc_I4_0 ); + Generator.Emit( OpCodes.Ceq ); + } + + public void Xor() + { + Pop( typeof( int ) ); + Pop( typeof( int ) ); + + Push( typeof( int ) ); + + Generator.Emit( OpCodes.Xor ); + } + + public Type Active => m_Stack.Peek(); + + public void Chain( Property prop ) + { + for ( int i = 0; i < prop.Chain.Length; ++i ) + Call( prop.Chain[i].GetGetMethod() ); + } + + public void Call( MethodInfo method ) + { + BeginCall( method ); + + CallInfo call = m_Calls.Peek(); + + if ( call.parms.Length > 0 ) + throw new InvalidOperationException( "Method requires parameters." ); + + FinishCall(); + } + + public delegate void Callback(); + + public bool CompareTo( int sign, Callback argGenerator ) + { + Type active = Active; + + MethodInfo compareTo = active.GetMethod( "CompareTo", new[] { active } ); + + if ( compareTo == null ) + { + /* This gets a little tricky... + * + * There's a scenario where we might be trying to use CompareTo on an interface + * which, while it doesn't explicitly implement CompareTo itself, is said to + * extend IComparable indirectly. The implementation is implicitly passed off + * to implementers... + * + * interface ISomeInterface : IComparable + * { + * void SomeMethod(); + * } + * + * class SomeClass : ISomeInterface + * { + * void SomeMethod() { ... } + * int CompareTo( object other ) { ... } + * } + * + * In this case, calling ISomeInterface.GetMethod( "CompareTo" ) will return null. + * + * Bleh. + */ + + Type[] ifaces = active.FindInterfaces((type, obj) => type.IsGenericType + && type.GetGenericTypeDefinition() == typeof(IComparable<>) + && type.GetGenericArguments()[0].IsAssignableFrom(active), null ); + + if ( ifaces.Length > 0 ) + { + compareTo = ifaces[0].GetMethod( "CompareTo", new[] { active } ); + } + else + { + ifaces = active.FindInterfaces((type, obj) => type == typeof(IComparable), null ); + + if ( ifaces.Length > 0 ) + compareTo = ifaces[0].GetMethod( "CompareTo", new[] { active } ); + } + } + + if ( compareTo == null ) + return false; + + if ( !active.IsValueType ) + { + /* This object is a reference type, so we have to make it behave + * + * null.CompareTo( null ) = 0 + * real.CompareTo( null ) = -1 + * null.CompareTo( real ) = +1 + * + */ + + LocalBuilder aValue = AcquireTemp( active ); + LocalBuilder bValue = AcquireTemp( active ); + + StoreLocal( aValue ); + + argGenerator(); + + StoreLocal( bValue ); + + /* if ( aValue == null ) + * { + * if ( bValue == null ) + * v = 0; + * else + * v = +1; + * } + * else if ( bValue == null ) + * { + * v = -1; + * } + * else + * { + * v = aValue.CompareTo( bValue ); + * } + */ + + Label store = CreateLabel(); + + Label aNotNull = CreateLabel(); + + LoadLocal( aValue ); + BranchIfTrue( aNotNull ); + // if ( aValue == null ) + { + Label bNotNull = CreateLabel(); + + LoadLocal( bValue ); + BranchIfTrue( bNotNull ); + // if ( bValue == null ) + { + Load( 0 ); + Pop( typeof( int ) ); + Branch( store ); + } + MarkLabel( bNotNull ); + // else + { + Load( sign ); + Pop( typeof( int ) ); + Branch( store ); + } + } + MarkLabel( aNotNull ); + // else + { + Label bNotNull = CreateLabel(); + + LoadLocal( bValue ); + BranchIfTrue( bNotNull ); + // bValue == null + { + Load( -sign ); + Pop( typeof( int ) ); + Branch( store ); + } + MarkLabel( bNotNull ); + // else + { + LoadLocal( aValue ); + BeginCall( compareTo ); + + LoadLocal( bValue ); + ArgumentPushed(); + + FinishCall(); + + if ( sign == -1 ) + Neg(); + } + } + + MarkLabel( store ); + + ReleaseTemp( aValue ); + ReleaseTemp( bValue ); + } + else + { + BeginCall( compareTo ); + + argGenerator(); + + ArgumentPushed(); + + FinishCall(); + + if ( sign == -1 ) + Neg(); + } + + return true; + } + + public void BeginCall( MethodInfo method ) + { + Type type; + + if ( ( method.CallingConvention & CallingConventions.HasThis ) != 0 ) + type = m_Stack.Peek(); + else + type = method.DeclaringType; + + m_Calls.Push( new CallInfo( type, method ) ); + + if ( type.IsValueType ) + { + LocalBuilder temp = AcquireTemp( type ); + + Generator.Emit( OpCodes.Stloc, temp ); + Generator.Emit( OpCodes.Ldloca, temp ); + + ReleaseTemp( temp ); + } + } + + public void FinishCall() + { + CallInfo call = m_Calls.Pop(); + + if ( ( call.type.IsValueType || call.type.IsByRef ) && call.method.DeclaringType != call.type ) + Generator.Emit( OpCodes.Constrained, call.type ); + + if ( call.method.DeclaringType?.IsValueType == true || call.method.IsStatic ) + Generator.Emit( OpCodes.Call, call.method ); + else + Generator.Emit( OpCodes.Callvirt, call.method ); + + for ( int i = call.parms.Length - 1; i >= 0; --i ) + Pop( call.parms[i].ParameterType ); + + if ( ( call.method.CallingConvention & CallingConventions.HasThis ) != 0 ) + Pop( call.method.DeclaringType ); + + if ( call.method.ReturnType != typeof( void ) ) + Push( call.method.ReturnType ); + } + + public void ArgumentPushed() + { + CallInfo call = m_Calls.Peek(); + + ParameterInfo parm = call.parms[call.index++]; + + Type argumentType = m_Stack.Peek(); + + if ( !parm.ParameterType.IsAssignableFrom( argumentType ) ) + throw new InvalidOperationException( "Parameter type mismatch." ); + + if ( argumentType.IsValueType && !parm.ParameterType.IsValueType ) + Generator.Emit( OpCodes.Box, argumentType ); + } + } } diff --git a/Projects/Scripts/Misc/FoodDecay.cs b/Projects/Scripts/Misc/FoodDecay.cs index a3ccad80f..4b3d44d52 100644 --- a/Projects/Scripts/Misc/FoodDecay.cs +++ b/Projects/Scripts/Misc/FoodDecay.cs @@ -5,10 +5,7 @@ namespace Server.Misc { public class FoodDecayTimer : Timer { - public FoodDecayTimer() : base(TimeSpan.FromMinutes(5), TimeSpan.FromMinutes(5)) - { - Priority = TimerPriority.OneMinute; - } + public FoodDecayTimer() : base(TimeSpan.FromMinutes(5), TimeSpan.FromMinutes(5)) => Priority = TimerPriority.OneMinute; public static void Initialize() { diff --git a/Projects/Scripts/Misc/Geometry.cs b/Projects/Scripts/Misc/Geometry.cs index f5374c516..ff3fccdde 100644 --- a/Projects/Scripts/Misc/Geometry.cs +++ b/Projects/Scripts/Misc/Geometry.cs @@ -13,15 +13,9 @@ namespace Server.Misc b = temp; } - public static double RadiansToDegrees(double angle) - { - return angle * (180.0 / Math.PI); - } + public static double RadiansToDegrees(double angle) => angle * (180.0 / Math.PI); - public static double DegreesToRadians(double angle) - { - return angle * (Math.PI / 180.0); - } + public static double DegreesToRadians(double angle) => angle * (Math.PI / 180.0); public static Point2D ArcPoint(Point3D loc, int radius, int angle) { diff --git a/Projects/Scripts/Misc/Gifts/Winter2004/PileOfGlacialSnow.cs b/Projects/Scripts/Misc/Gifts/Winter2004/PileOfGlacialSnow.cs index 596e0b145..1c6a17a03 100644 --- a/Projects/Scripts/Misc/Gifts/Winter2004/PileOfGlacialSnow.cs +++ b/Projects/Scripts/Misc/Gifts/Winter2004/PileOfGlacialSnow.cs @@ -80,10 +80,7 @@ namespace Server.Items { private Mobile m_From; - public InternalTimer(Mobile from) : base(TimeSpan.FromSeconds(5.0)) - { - m_From = from; - } + public InternalTimer(Mobile from) : base(TimeSpan.FromSeconds(5.0)) => m_From = from; protected override void OnTick() { diff --git a/Projects/Scripts/Misc/Gifts/Winter2004/SnowPile.cs b/Projects/Scripts/Misc/Gifts/Winter2004/SnowPile.cs index 4f98d1f0a..a2eb26b83 100644 --- a/Projects/Scripts/Misc/Gifts/Winter2004/SnowPile.cs +++ b/Projects/Scripts/Misc/Gifts/Winter2004/SnowPile.cs @@ -66,10 +66,7 @@ namespace Server.Items { private Mobile m_From; - public InternalTimer(Mobile from) : base(TimeSpan.FromSeconds(5.0)) - { - m_From = from; - } + public InternalTimer(Mobile from) : base(TimeSpan.FromSeconds(5.0)) => m_From = from; protected override void OnTick() { diff --git a/Projects/Scripts/Misc/Guild.cs b/Projects/Scripts/Misc/Guild.cs index 23e76fc11..b63a27646 100644 --- a/Projects/Scripts/Misc/Guild.cs +++ b/Projects/Scripts/Misc/Guild.cs @@ -61,10 +61,7 @@ namespace Server.Guilds public RankFlags Flags{ get; private set; } - public bool GetFlag(RankFlags flag) - { - return (Flags & flag) != 0; - } + public bool GetFlag(RankFlags flag) => (Flags & flag) != 0; public void SetFlag(RankFlags flag, bool value) { @@ -267,25 +264,19 @@ namespace Server.Guilds private AllianceInfo m_Alliance; public AllianceRosterGump(PlayerMobile pm, Guild g, AllianceInfo alliance) : base(pm, g, true, "", 0, - alliance.m_Members, alliance.Name) - { + alliance.m_Members, alliance.Name) => m_Alliance = alliance; - } public AllianceRosterGump(PlayerMobile pm, Guild g, AllianceInfo alliance, IComparer currentComparer, bool ascending, string filter, int startNumber) : base(pm, g, currentComparer, ascending, filter, - startNumber, alliance.m_Members, alliance.Name) - { + startNumber, alliance.m_Members, alliance.Name) => m_Alliance = alliance; - } protected override bool AllowAdvancedSearch => false; public override Gump GetResentGump(PlayerMobile pm, Guild g, IComparer comparer, bool ascending, - string filter, int startNumber) - { - return new AllianceRosterGump(pm, g, m_Alliance, comparer, ascending, filter, startNumber); - } + string filter, int startNumber) => + new AllianceRosterGump(pm, g, m_Alliance, comparer, ascending, filter, startNumber); public override void OnResponse(NetState sender, RelayInfo info) { @@ -498,10 +489,7 @@ namespace Server.Guilds { private static TimeSpan InternalDelay = TimeSpan.FromMinutes(1.0); - public WarTimer() : base(InternalDelay, InternalDelay) - { - Priority = TimerPriority.FiveSeconds; - } + public WarTimer() : base(InternalDelay, InternalDelay) => Priority = TimerPriority.FiveSeconds; public static void Initialize() { @@ -989,20 +977,11 @@ namespace Server.Guilds #region Is(...) - public bool IsMember(Mobile m) - { - return Members.Contains(m); - } + public bool IsMember(Mobile m) => Members.Contains(m); - public bool IsAlly(Guild g) - { - return NewGuildSystem ? Alliance?.IsMember(this) == true && Alliance.IsMember(g) : Allies.Contains(g); - } + public bool IsAlly(Guild g) => NewGuildSystem ? Alliance?.IsMember(this) == true && Alliance.IsMember(g) : Allies.Contains(g); - public bool IsEnemy(Guild g) - { - return Type != GuildType.Regular && g.Type != GuildType.Regular && Type != g.Type || IsWar(g); - } + public bool IsEnemy(Guild g) => Type != GuildType.Regular && g.Type != GuildType.Regular && Type != g.Type || IsWar(g); public bool IsWar(Guild g) { @@ -1385,16 +1364,11 @@ namespace Server.Guilds #region Voting - public bool CanVote(Mobile m) - { - return (!NewGuildSystem || m is PlayerMobile pm && pm.GuildRank.GetFlag(RankFlags.CanVote)) && - m?.Deleted == false && m.Guild == this; - } + public bool CanVote(Mobile m) => + (!NewGuildSystem || m is PlayerMobile pm && pm.GuildRank.GetFlag(RankFlags.CanVote)) && + m?.Deleted == false && m.Guild == this; - public bool CanBeVotedFor(Mobile m) - { - return (!NewGuildSystem || m is PlayerMobile pm && pm.LastOnline + InactiveTime >= DateTime.UtcNow) && m?.Deleted == false && m.Guild == this; - } + public bool CanBeVotedFor(Mobile m) => (!NewGuildSystem || m is PlayerMobile pm && pm.LastOnline + InactiveTime >= DateTime.UtcNow) && m?.Deleted == false && m.Guild == this; public void CalculateGuildmaster() { diff --git a/Projects/Scripts/Misc/InhumanSpeech.cs b/Projects/Scripts/Misc/InhumanSpeech.cs index fbb1b038d..ab20965f7 100644 --- a/Projects/Scripts/Misc/InhumanSpeech.cs +++ b/Projects/Scripts/Misc/InhumanSpeech.cs @@ -4,561 +4,558 @@ using System.Text; namespace Server.Misc { - [Flags] - public enum IHSFlags - { - None = 0x00, - OnDamaged = 0x01, - OnDeath = 0x02, - OnMovement = 0x04, - OnSpeech = 0x08, - All = OnDamaged | OnDeath | OnMovement - } // NOTE: To enable monster conversations, add " | OnSpeech" to the "All" line - - public class InhumanSpeech - { - private static InhumanSpeech m_RatmanSpeech; - - public static InhumanSpeech Ratman - { - get - { - if ( m_RatmanSpeech == null ) - { - m_RatmanSpeech = new InhumanSpeech(); - - m_RatmanSpeech.Hue = 149; - m_RatmanSpeech.Sound = 438; - - m_RatmanSpeech.Flags = IHSFlags.All; - - m_RatmanSpeech.Keywords = new[] - { - "meat", "gold", "kill", "killing", "slay", - "sword", "axe", "spell", "magic", "spells", - "swords", "axes", "mace", "maces", "monster", - "monsters", "food", "run", "escape", "away", - "help", "dead", "die", "dying", "lose", - "losing", "life", "lives", "death", "ghost", - "ghosts", "british", "blackthorn", "guild", - "guilds", "dragon", "dragons", "game", "games", - "ultima", "silly", "stupid", "dumb", "idiot", - "idiots", "cheesy", "cheezy", "crazy", "dork", - "jerk", "fool", "foolish", "ugly", "insult", "scum" - }; - - m_RatmanSpeech.Responses = new[] - { - "meat", "kill", "pound", "crush", "yum yum", - "crunch", "destroy", "murder", "eat", "munch", - "massacre", "food", "monster", "evil", "run", - "die", "lose", "dumb", "idiot", "fool", "crazy", - "dinner", "lunch", "breakfast", "fight", "battle", - "doomed", "rip apart", "tear apart", "smash", - "edible?", "shred", "disembowel", "ugly", "smelly", - "stupid", "hideous", "smell", "tasty", "invader", - "attack", "raid", "plunder", "pillage", "treasure", - "loser", "lose", "scum" - }; - - m_RatmanSpeech.Syllables = new[] - { - "skrit", - - "ch", "ch", - "it", "ti", "it", "ti", - - "ak", "ek", "ik", "ok", "uk", "yk", - "ka", "ke", "ki", "ko", "ku", "ky", - "at", "et", "it", "ot", "ut", "yt", - - "cha", "che", "chi", "cho", "chu", "chy", - "ach", "ech", "ich", "och", "uch", "ych", - "att", "ett", "itt", "ott", "utt", "ytt", - "tat", "tet", "tit", "tot", "tut", "tyt", - "tta", "tte", "tti", "tto", "ttu", "tty", - "tak", "tek", "tik", "tok", "tuk", "tyk", - "ack", "eck", "ick", "ock", "uck", "yck", - "cka", "cke", "cki", "cko", "cku", "cky", - "rak", "rek", "rik", "rok", "ruk", "ryk", - - "tcha", "tche", "tchi", "tcho", "tchu", "tchy", - "rach", "rech", "rich", "roch", "ruch", "rych", - "rrap", "rrep", "rrip", "rrop", "rrup", "rryp", - "ccka", "ccke", "ccki", "ccko", "ccku", "ccky" - }; - } - - return m_RatmanSpeech; - } - } - - private static InhumanSpeech m_OrcSpeech; - - public static InhumanSpeech Orc - { - get - { - if ( m_OrcSpeech == null ) - { - m_OrcSpeech = new InhumanSpeech(); - - m_OrcSpeech.Hue = 34; - m_OrcSpeech.Sound = 432; - - m_OrcSpeech.Flags = IHSFlags.All; - - m_OrcSpeech.Keywords = new[] - { - "meat", "gold", "kill", "killing", "slay", - "sword", "axe", "spell", "magic", "spells", - "swords", "axes", "mace", "maces", "monster", - "monsters", "food", "run", "escape", "away", - "help", "dead", "die", "dying", "lose", - "losing", "life", "lives", "death", "ghost", - "ghosts", "british", "blackthorn", "guild", - "guilds", "dragon", "dragons", "game", "games", - "ultima", "silly", "stupid", "dumb", "idiot", - "idiots", "cheesy", "cheezy", "crazy", "dork", - "jerk", "fool", "foolish", "ugly", "insult", "scum" - }; - - m_OrcSpeech.Responses = new[] - { - "meat", "kill", "pound", "crush", "yum yum", - "crunch", "destroy", "murder", "eat", "munch", - "massacre", "food", "monster", "evil", "run", - "die", "lose", "dumb", "idiot", "fool", "crazy", - "dinner", "lunch", "breakfast", "fight", "battle", - "doomed", "rip apart", "tear apart", "smash", - "edible?", "shred", "disembowel", "ugly", "smelly", - "stupid", "hideous", "smell", "tasty", "invader", - "attack", "raid", "plunder", "pillage", "treasure", - "loser", "lose", "scum" - }; - - m_OrcSpeech.Syllables = new[] - { - "bu", "du", "fu", "ju", "gu", - "ulg", "gug", "gub", "gur", "oog", - "gub", "log", "ru", "stu", "glu", - "ug", "ud", "og", "log", "ro", "flu", - "bo", "duf", "fun", "nog", "dun", "bog", - "dug", "gh", "ghu", "gho", "nug", "ig", - "igh", "ihg", "luh", "duh", "bug", "dug", - "dru", "urd", "gurt", "grut", "grunt", - "snarf", "urgle", "igg", "glu", "glug", - "foo", "bar", "baz", "ghat", "ab", "ad", - "gugh", "guk", "ag", "alm", "thu", "log", - "bilge", "augh", "gha", "gig", "goth", - "zug", "pig", "auh", "gan", "azh", "bag", - "hig", "oth", "dagh", "gulg", "ugh", "ba", - "bid", "gug", "bug", "rug", "hat", "brui", - "gagh", "buad", "buil", "buim", "bum", - "hug", "hug", "buo", "ma", "buor", "ghed", - "buu", "ca", "guk", "clog", "thurg", "car", - "cro", "thu", "da", "cuk", "gil", "cur", "dak", - "dar", "deak", "der", "dil", "dit", "at", "ag", - "dor", "gar", "dre", "tk", "dri", "gka", "rim", - "eag", "egg", "ha", "rod", "eg", "lat", "eichel", - "ek", "ep", "ka", "it", "ut", "ewk", "ba", "dagh", - "faugh", "foz", "fog", "fid", "fruk", "gag", "fub", - "fud", "fur", "bog", "fup", "hagh", "gaa", "kt", - "rekk", "lub", "lug", "tug", "gna", "urg", "l", - "gno", "gnu", "gol", "gom", "kug", "ukk", "jak", - "jek", "rukk", "jja", "akt", "nuk", "hok", "hrol", - "olm", "natz", "i", "i", "o", "u", "ikk", "ign", - "juk", "kh", "kgh", "ka", "hig", "ke", "ki", "klap", - "klu", "knod", "kod", "knu", "thnu", "krug", "nug", - "nar", "nag", "neg", "neh", "oag", "ob", "ogh", "oh", - "om", "dud", "oo", "pa", "hrak", "qo", "quad", "quil", - "ghig", "rur", "sag", "sah", "sg" - }; - } - - return m_OrcSpeech; - } - } - - private static InhumanSpeech m_LizardmanSpeech; - - public static InhumanSpeech Lizardman - { - get - { - if ( m_LizardmanSpeech == null ) - { - m_LizardmanSpeech = new InhumanSpeech(); - - m_LizardmanSpeech.Hue = 58; - m_LizardmanSpeech.Sound = 418; - - m_LizardmanSpeech.Flags = IHSFlags.All; - - m_LizardmanSpeech.Keywords = new[] - { - "meat", "gold", "kill", "killing", "slay", - "sword", "axe", "spell", "magic", "spells", - "swords", "axes", "mace", "maces", "monster", - "monsters", "food", "run", "escape", "away", - "help", "dead", "die", "dying", "lose", - "losing", "life", "lives", "death", "ghost", - "ghosts", "british", "blackthorn", "guild", - "guilds", "dragon", "dragons", "game", "games", - "ultima", "silly", "stupid", "dumb", "idiot", - "idiots", "cheesy", "cheezy", "crazy", "dork", - "jerk", "fool", "foolish", "ugly", "insult", "scum" - }; - - m_LizardmanSpeech.Responses = new[] - { - "meat", "kill", "pound", "crush", "yum yum", - "crunch", "destroy", "murder", "eat", "munch", - "massacre", "food", "monster", "evil", "run", - "die", "lose", "dumb", "idiot", "fool", "crazy", - "dinner", "lunch", "breakfast", "fight", "battle", - "doomed", "rip apart", "tear apart", "smash", - "edible?", "shred", "disembowel", "ugly", "smelly", - "stupid", "hideous", "smell", "tasty", "invader", - "attack", "raid", "plunder", "pillage", "treasure", - "loser", "lose", "scum" - }; - - m_LizardmanSpeech.Syllables = new[] - { - "ss", "sth", "iss", "is", "ith", "kth", - "sith", "this", "its", "sit", "tis", "tsi", - "ssi", "sil", "lis", "sis", "lil", "thil", - "lith", "sthi", "lish", "shi", "shash", "sal", - "miss", "ra", "tha", "thes", "ses", "sas", "las", - "les", "sath", "sia", "ais", "isa", "asi", "asth", - "stha", "sthi", "isth", "asa", "ath", "tha", "als", - "sla", "thth", "ci", "ce", "cy", "yss", "ys", "yth", - "syth", "thys", "yts", "syt", "tys", "tsy", "ssy", - "syl", "lys", "sys", "lyl", "thyl", "lyth", "sthy", - "lysh", "shy", "myss", "ysa", "sthy", "ysth" - }; - } - - return m_LizardmanSpeech; - } - } - - private static InhumanSpeech m_WispSpeech; - - public static InhumanSpeech Wisp - { - get - { - if ( m_WispSpeech == null ) - { - m_WispSpeech = new InhumanSpeech(); - - m_WispSpeech.Hue = 89; - m_WispSpeech.Sound = 466; - - m_WispSpeech.Flags = IHSFlags.OnMovement; - - m_WispSpeech.Syllables = new[] - { - "b", "c", "d", "f", "g", "h", "i", - "j", "k", "l", "m", "n", "p", "r", - "s", "t", "v", "w", "x", "z", "c", - "c", "x", "x", "x", "x", "x", "y", - "y", "y", "y", "t", "t", "k", "k", - "l", "l", "m", "m", "m", "m", "z" - }; - } - - return m_WispSpeech; - } - } - - private string[] m_Keywords; - - private Dictionary m_KeywordHash; - - public string[] Syllables { get; set; } - - public string[] Keywords - { - get => m_Keywords; - set - { - m_Keywords = value; - m_KeywordHash = new Dictionary( m_Keywords.Length, StringComparer.OrdinalIgnoreCase ); - for ( int i = 0; i < m_Keywords.Length; ++i ) - m_KeywordHash[m_Keywords[i]] = m_Keywords[i]; - } - } - - public string[] Responses { get; set; } - - public int Hue { get; set; } - - public int Sound { get; set; } - - public IHSFlags Flags { get; set; } - - public string GetRandomSyllable() - { - return Syllables[Utility.Random( Syllables.Length )]; - } - - public string ConstructWord( int syllableCount ) - { - string[] syllables = new string[syllableCount]; - - for ( int i = 0; i < syllableCount; ++i ) - syllables[i] = GetRandomSyllable(); - - return string.Concat( syllables ); - } - - public string ConstructSentance( int wordCount ) - { - StringBuilder sentance = new StringBuilder(); - - bool needUpperCase = true; - - for ( int i = 0; i < wordCount; ++i ) - { - if ( i > 0 ) // not first word ) - { - int random = Utility.RandomMinMax( 1, 15 ); - - if ( random < 11 ) - { - sentance.Append( ' ' ); - } - else - { - needUpperCase = true; - - if ( random > 13 ) - sentance.Append( "! " ); - else - sentance.Append( ". " ); - } - } - - int syllableCount; - - if ( 30 > Utility.Random( 100 ) ) - syllableCount = Utility.Random( 1, 5 ); - else - syllableCount = Utility.Random( 1, 3 ); - - string word = ConstructWord( syllableCount ); - - sentance.Append( word ); - - if ( needUpperCase ) - sentance.Replace( word[0], char.ToUpper( word[0] ), sentance.Length - word.Length, 1 ); - - needUpperCase = false; - } - - if ( Utility.RandomMinMax( 1, 5 ) == 1 ) - sentance.Append( '!' ); - else - sentance.Append( '.' ); - - return sentance.ToString(); - } - - public void SayRandomTranslate( Mobile mob, params string[] sentancesInEnglish ) - { - SaySentance( mob, Utility.RandomMinMax( 2, 3 ) ); - mob.Say( sentancesInEnglish[Utility.Random( sentancesInEnglish.Length )] ); - } - - private string GetRandomResponseWord( List keywordsFound ) - { - int random = Utility.Random( keywordsFound.Count + Responses.Length ); - - if ( random < keywordsFound.Count ) - return keywordsFound[random]; - - return Responses[random - keywordsFound.Count]; - } - - public bool OnSpeech( Mobile mob, Mobile speaker, string text ) - { - if ( (Flags & IHSFlags.OnSpeech) == 0 || m_Keywords == null || Responses == null || m_KeywordHash == null ) - return false; // not enabled - - if ( !speaker.Alive ) - return false; - - if ( !speaker.InRange( mob, 3 ) ) - return false; - - if ( (speaker.Direction & Direction.Mask) != speaker.GetDirectionTo( mob ) ) - return false; - - if ( (mob.Direction & Direction.Mask) != mob.GetDirectionTo( speaker ) ) - return false; - - string[] split = text.Split( ' ' ); - List keywordsFound = new List(); - - for ( int i = 0; i < split.Length; ++i ) - { - if (m_KeywordHash.TryGetValue( split[i], out string keyword )) - keywordsFound.Add( keyword ); - } - - if ( keywordsFound.Count > 0 ) - { - string responseWord; - - if ( Utility.RandomBool() ) - responseWord = GetRandomResponseWord( keywordsFound ); - else - responseWord = keywordsFound[Utility.Random( keywordsFound.Count )]; - - string secondResponseWord = GetRandomResponseWord( keywordsFound ); - - StringBuilder response = new StringBuilder(); - - switch ( Utility.Random( 6 ) ) - { - default: - case 0: - { - response.Append( "Me " ).Append( responseWord ).Append( '?' ); - break; - } - case 1: - { - response.Append( responseWord ).Append( " thee!" ); - response.Replace( responseWord[0], char.ToUpper( responseWord[0] ), 0, 1 ); - break; - } - case 2: - { - response.Append( responseWord ).Append( '?' ); - response.Replace( responseWord[0], char.ToUpper( responseWord[0] ), 0, 1 ); - break; - } - case 3: - { - response.Append( responseWord ).Append( "! " ).Append( secondResponseWord ).Append( '.' ); - response.Replace( responseWord[0], char.ToUpper( responseWord[0] ), 0, 1 ); - response.Replace( secondResponseWord[0], char.ToUpper( secondResponseWord[0] ), responseWord.Length + 2, 1 ); - break; - } - case 4: - { - response.Append( responseWord ).Append( '.' ); - response.Replace( responseWord[0], char.ToUpper( responseWord[0] ), 0, 1 ); - break; - } - case 5: - { - response.Append( responseWord ).Append( "? " ).Append( secondResponseWord ).Append( '.' ); - response.Replace( responseWord[0], char.ToUpper( responseWord[0] ), 0, 1 ); - response.Replace( secondResponseWord[0], char.ToUpper( secondResponseWord[0] ), responseWord.Length + 2, 1 ); - break; - } - } - - int maxWords = (split.Length / 2) + 1; - - if ( maxWords < 2 ) - maxWords = 2; - else if ( maxWords > 6 ) - maxWords = 6; - - SaySentance( mob, Utility.RandomMinMax( 2, maxWords ) ); - mob.Say( response.ToString() ); - - return true; - } - - return false; - } - - public void OnDeath( Mobile mob ) - { - if ( (Flags & IHSFlags.OnDeath) == 0 ) - return; // not enabled - - if ( 90 > Utility.Random( 100 ) ) - return; // 90% chance to do nothing; 10% chance to talk - - SayRandomTranslate( mob, - "Revenge!", - "NOOooo!", - "I... I...", - "Me no die!", - "Me die!", - "Must... not die...", - "Oooh, me hurt...", - "Me dying?" ); - } - - public void OnMovement( Mobile mob, Mobile mover, Point3D oldLocation ) - { - if ( (Flags & IHSFlags.OnMovement) == 0 ) - return; // not enabled - - if ( !mover.Player || (mover.Hidden && mover.AccessLevel > AccessLevel.Player) ) - return; - - if ( !mob.InRange( mover, 5 ) || mob.InRange( oldLocation, 5 ) ) - return; // only talk when they enter 5 tile range - - if ( 90 > Utility.Random( 100 ) ) - return; // 90% chance to do nothing; 10% chance to talk - - SaySentance( mob, 6 ); - } - - public void OnDamage( Mobile mob, int amount ) - { - if ( (Flags & IHSFlags.OnDamaged) == 0 ) - return; // not enabled - - if ( 90 > Utility.Random( 100 ) ) - return; // 90% chance to do nothing; 10% chance to talk - - if ( amount < 5 ) - { - SayRandomTranslate( mob, - "Ouch!", - "Me not hurt bad!", - "Thou fight bad.", - "Thy blows soft!", - "You bad with weapon!" ); - } - else - { - SayRandomTranslate( mob, - "Ouch! Me hurt!", - "No, kill me not!", - "Me hurt!", - "Away with thee!", - "Oof! That hurt!", - "Aaah! That hurt...", - "Good blow!" ); - } - } - - public void OnConstruct( Mobile mob ) - { - mob.SpeechHue = Hue; - } - - public void SaySentance( Mobile mob, int wordCount ) - { - mob.Say( ConstructSentance( wordCount ) ); - mob.PlaySound( Sound ); - } - - public InhumanSpeech() - { - } - } + [Flags] + public enum IHSFlags + { + None = 0x00, + OnDamaged = 0x01, + OnDeath = 0x02, + OnMovement = 0x04, + OnSpeech = 0x08, + All = OnDamaged | OnDeath | OnMovement + } // NOTE: To enable monster conversations, add " | OnSpeech" to the "All" line + + public class InhumanSpeech + { + private static InhumanSpeech m_RatmanSpeech; + + public static InhumanSpeech Ratman + { + get + { + if ( m_RatmanSpeech == null ) + { + m_RatmanSpeech = new InhumanSpeech(); + + m_RatmanSpeech.Hue = 149; + m_RatmanSpeech.Sound = 438; + + m_RatmanSpeech.Flags = IHSFlags.All; + + m_RatmanSpeech.Keywords = new[] + { + "meat", "gold", "kill", "killing", "slay", + "sword", "axe", "spell", "magic", "spells", + "swords", "axes", "mace", "maces", "monster", + "monsters", "food", "run", "escape", "away", + "help", "dead", "die", "dying", "lose", + "losing", "life", "lives", "death", "ghost", + "ghosts", "british", "blackthorn", "guild", + "guilds", "dragon", "dragons", "game", "games", + "ultima", "silly", "stupid", "dumb", "idiot", + "idiots", "cheesy", "cheezy", "crazy", "dork", + "jerk", "fool", "foolish", "ugly", "insult", "scum" + }; + + m_RatmanSpeech.Responses = new[] + { + "meat", "kill", "pound", "crush", "yum yum", + "crunch", "destroy", "murder", "eat", "munch", + "massacre", "food", "monster", "evil", "run", + "die", "lose", "dumb", "idiot", "fool", "crazy", + "dinner", "lunch", "breakfast", "fight", "battle", + "doomed", "rip apart", "tear apart", "smash", + "edible?", "shred", "disembowel", "ugly", "smelly", + "stupid", "hideous", "smell", "tasty", "invader", + "attack", "raid", "plunder", "pillage", "treasure", + "loser", "lose", "scum" + }; + + m_RatmanSpeech.Syllables = new[] + { + "skrit", + + "ch", "ch", + "it", "ti", "it", "ti", + + "ak", "ek", "ik", "ok", "uk", "yk", + "ka", "ke", "ki", "ko", "ku", "ky", + "at", "et", "it", "ot", "ut", "yt", + + "cha", "che", "chi", "cho", "chu", "chy", + "ach", "ech", "ich", "och", "uch", "ych", + "att", "ett", "itt", "ott", "utt", "ytt", + "tat", "tet", "tit", "tot", "tut", "tyt", + "tta", "tte", "tti", "tto", "ttu", "tty", + "tak", "tek", "tik", "tok", "tuk", "tyk", + "ack", "eck", "ick", "ock", "uck", "yck", + "cka", "cke", "cki", "cko", "cku", "cky", + "rak", "rek", "rik", "rok", "ruk", "ryk", + + "tcha", "tche", "tchi", "tcho", "tchu", "tchy", + "rach", "rech", "rich", "roch", "ruch", "rych", + "rrap", "rrep", "rrip", "rrop", "rrup", "rryp", + "ccka", "ccke", "ccki", "ccko", "ccku", "ccky" + }; + } + + return m_RatmanSpeech; + } + } + + private static InhumanSpeech m_OrcSpeech; + + public static InhumanSpeech Orc + { + get + { + if ( m_OrcSpeech == null ) + { + m_OrcSpeech = new InhumanSpeech(); + + m_OrcSpeech.Hue = 34; + m_OrcSpeech.Sound = 432; + + m_OrcSpeech.Flags = IHSFlags.All; + + m_OrcSpeech.Keywords = new[] + { + "meat", "gold", "kill", "killing", "slay", + "sword", "axe", "spell", "magic", "spells", + "swords", "axes", "mace", "maces", "monster", + "monsters", "food", "run", "escape", "away", + "help", "dead", "die", "dying", "lose", + "losing", "life", "lives", "death", "ghost", + "ghosts", "british", "blackthorn", "guild", + "guilds", "dragon", "dragons", "game", "games", + "ultima", "silly", "stupid", "dumb", "idiot", + "idiots", "cheesy", "cheezy", "crazy", "dork", + "jerk", "fool", "foolish", "ugly", "insult", "scum" + }; + + m_OrcSpeech.Responses = new[] + { + "meat", "kill", "pound", "crush", "yum yum", + "crunch", "destroy", "murder", "eat", "munch", + "massacre", "food", "monster", "evil", "run", + "die", "lose", "dumb", "idiot", "fool", "crazy", + "dinner", "lunch", "breakfast", "fight", "battle", + "doomed", "rip apart", "tear apart", "smash", + "edible?", "shred", "disembowel", "ugly", "smelly", + "stupid", "hideous", "smell", "tasty", "invader", + "attack", "raid", "plunder", "pillage", "treasure", + "loser", "lose", "scum" + }; + + m_OrcSpeech.Syllables = new[] + { + "bu", "du", "fu", "ju", "gu", + "ulg", "gug", "gub", "gur", "oog", + "gub", "log", "ru", "stu", "glu", + "ug", "ud", "og", "log", "ro", "flu", + "bo", "duf", "fun", "nog", "dun", "bog", + "dug", "gh", "ghu", "gho", "nug", "ig", + "igh", "ihg", "luh", "duh", "bug", "dug", + "dru", "urd", "gurt", "grut", "grunt", + "snarf", "urgle", "igg", "glu", "glug", + "foo", "bar", "baz", "ghat", "ab", "ad", + "gugh", "guk", "ag", "alm", "thu", "log", + "bilge", "augh", "gha", "gig", "goth", + "zug", "pig", "auh", "gan", "azh", "bag", + "hig", "oth", "dagh", "gulg", "ugh", "ba", + "bid", "gug", "bug", "rug", "hat", "brui", + "gagh", "buad", "buil", "buim", "bum", + "hug", "hug", "buo", "ma", "buor", "ghed", + "buu", "ca", "guk", "clog", "thurg", "car", + "cro", "thu", "da", "cuk", "gil", "cur", "dak", + "dar", "deak", "der", "dil", "dit", "at", "ag", + "dor", "gar", "dre", "tk", "dri", "gka", "rim", + "eag", "egg", "ha", "rod", "eg", "lat", "eichel", + "ek", "ep", "ka", "it", "ut", "ewk", "ba", "dagh", + "faugh", "foz", "fog", "fid", "fruk", "gag", "fub", + "fud", "fur", "bog", "fup", "hagh", "gaa", "kt", + "rekk", "lub", "lug", "tug", "gna", "urg", "l", + "gno", "gnu", "gol", "gom", "kug", "ukk", "jak", + "jek", "rukk", "jja", "akt", "nuk", "hok", "hrol", + "olm", "natz", "i", "i", "o", "u", "ikk", "ign", + "juk", "kh", "kgh", "ka", "hig", "ke", "ki", "klap", + "klu", "knod", "kod", "knu", "thnu", "krug", "nug", + "nar", "nag", "neg", "neh", "oag", "ob", "ogh", "oh", + "om", "dud", "oo", "pa", "hrak", "qo", "quad", "quil", + "ghig", "rur", "sag", "sah", "sg" + }; + } + + return m_OrcSpeech; + } + } + + private static InhumanSpeech m_LizardmanSpeech; + + public static InhumanSpeech Lizardman + { + get + { + if ( m_LizardmanSpeech == null ) + { + m_LizardmanSpeech = new InhumanSpeech(); + + m_LizardmanSpeech.Hue = 58; + m_LizardmanSpeech.Sound = 418; + + m_LizardmanSpeech.Flags = IHSFlags.All; + + m_LizardmanSpeech.Keywords = new[] + { + "meat", "gold", "kill", "killing", "slay", + "sword", "axe", "spell", "magic", "spells", + "swords", "axes", "mace", "maces", "monster", + "monsters", "food", "run", "escape", "away", + "help", "dead", "die", "dying", "lose", + "losing", "life", "lives", "death", "ghost", + "ghosts", "british", "blackthorn", "guild", + "guilds", "dragon", "dragons", "game", "games", + "ultima", "silly", "stupid", "dumb", "idiot", + "idiots", "cheesy", "cheezy", "crazy", "dork", + "jerk", "fool", "foolish", "ugly", "insult", "scum" + }; + + m_LizardmanSpeech.Responses = new[] + { + "meat", "kill", "pound", "crush", "yum yum", + "crunch", "destroy", "murder", "eat", "munch", + "massacre", "food", "monster", "evil", "run", + "die", "lose", "dumb", "idiot", "fool", "crazy", + "dinner", "lunch", "breakfast", "fight", "battle", + "doomed", "rip apart", "tear apart", "smash", + "edible?", "shred", "disembowel", "ugly", "smelly", + "stupid", "hideous", "smell", "tasty", "invader", + "attack", "raid", "plunder", "pillage", "treasure", + "loser", "lose", "scum" + }; + + m_LizardmanSpeech.Syllables = new[] + { + "ss", "sth", "iss", "is", "ith", "kth", + "sith", "this", "its", "sit", "tis", "tsi", + "ssi", "sil", "lis", "sis", "lil", "thil", + "lith", "sthi", "lish", "shi", "shash", "sal", + "miss", "ra", "tha", "thes", "ses", "sas", "las", + "les", "sath", "sia", "ais", "isa", "asi", "asth", + "stha", "sthi", "isth", "asa", "ath", "tha", "als", + "sla", "thth", "ci", "ce", "cy", "yss", "ys", "yth", + "syth", "thys", "yts", "syt", "tys", "tsy", "ssy", + "syl", "lys", "sys", "lyl", "thyl", "lyth", "sthy", + "lysh", "shy", "myss", "ysa", "sthy", "ysth" + }; + } + + return m_LizardmanSpeech; + } + } + + private static InhumanSpeech m_WispSpeech; + + public static InhumanSpeech Wisp + { + get + { + if ( m_WispSpeech == null ) + { + m_WispSpeech = new InhumanSpeech(); + + m_WispSpeech.Hue = 89; + m_WispSpeech.Sound = 466; + + m_WispSpeech.Flags = IHSFlags.OnMovement; + + m_WispSpeech.Syllables = new[] + { + "b", "c", "d", "f", "g", "h", "i", + "j", "k", "l", "m", "n", "p", "r", + "s", "t", "v", "w", "x", "z", "c", + "c", "x", "x", "x", "x", "x", "y", + "y", "y", "y", "t", "t", "k", "k", + "l", "l", "m", "m", "m", "m", "z" + }; + } + + return m_WispSpeech; + } + } + + private string[] m_Keywords; + + private Dictionary m_KeywordHash; + + public string[] Syllables { get; set; } + + public string[] Keywords + { + get => m_Keywords; + set + { + m_Keywords = value; + m_KeywordHash = new Dictionary( m_Keywords.Length, StringComparer.OrdinalIgnoreCase ); + for ( int i = 0; i < m_Keywords.Length; ++i ) + m_KeywordHash[m_Keywords[i]] = m_Keywords[i]; + } + } + + public string[] Responses { get; set; } + + public int Hue { get; set; } + + public int Sound { get; set; } + + public IHSFlags Flags { get; set; } + + public string GetRandomSyllable() => Syllables[Utility.Random( Syllables.Length )]; + + public string ConstructWord( int syllableCount ) + { + string[] syllables = new string[syllableCount]; + + for ( int i = 0; i < syllableCount; ++i ) + syllables[i] = GetRandomSyllable(); + + return string.Concat( syllables ); + } + + public string ConstructSentance( int wordCount ) + { + StringBuilder sentance = new StringBuilder(); + + bool needUpperCase = true; + + for ( int i = 0; i < wordCount; ++i ) + { + if ( i > 0 ) // not first word ) + { + int random = Utility.RandomMinMax( 1, 15 ); + + if ( random < 11 ) + { + sentance.Append( ' ' ); + } + else + { + needUpperCase = true; + + if ( random > 13 ) + sentance.Append( "! " ); + else + sentance.Append( ". " ); + } + } + + int syllableCount; + + if ( 30 > Utility.Random( 100 ) ) + syllableCount = Utility.Random( 1, 5 ); + else + syllableCount = Utility.Random( 1, 3 ); + + string word = ConstructWord( syllableCount ); + + sentance.Append( word ); + + if ( needUpperCase ) + sentance.Replace( word[0], char.ToUpper( word[0] ), sentance.Length - word.Length, 1 ); + + needUpperCase = false; + } + + if ( Utility.RandomMinMax( 1, 5 ) == 1 ) + sentance.Append( '!' ); + else + sentance.Append( '.' ); + + return sentance.ToString(); + } + + public void SayRandomTranslate( Mobile mob, params string[] sentancesInEnglish ) + { + SaySentance( mob, Utility.RandomMinMax( 2, 3 ) ); + mob.Say( sentancesInEnglish[Utility.Random( sentancesInEnglish.Length )] ); + } + + private string GetRandomResponseWord( List keywordsFound ) + { + int random = Utility.Random( keywordsFound.Count + Responses.Length ); + + if ( random < keywordsFound.Count ) + return keywordsFound[random]; + + return Responses[random - keywordsFound.Count]; + } + + public bool OnSpeech( Mobile mob, Mobile speaker, string text ) + { + if ( (Flags & IHSFlags.OnSpeech) == 0 || m_Keywords == null || Responses == null || m_KeywordHash == null ) + return false; // not enabled + + if ( !speaker.Alive ) + return false; + + if ( !speaker.InRange( mob, 3 ) ) + return false; + + if ( (speaker.Direction & Direction.Mask) != speaker.GetDirectionTo( mob ) ) + return false; + + if ( (mob.Direction & Direction.Mask) != mob.GetDirectionTo( speaker ) ) + return false; + + string[] split = text.Split( ' ' ); + List keywordsFound = new List(); + + for ( int i = 0; i < split.Length; ++i ) + { + if (m_KeywordHash.TryGetValue( split[i], out string keyword )) + keywordsFound.Add( keyword ); + } + + if ( keywordsFound.Count > 0 ) + { + string responseWord; + + if ( Utility.RandomBool() ) + responseWord = GetRandomResponseWord( keywordsFound ); + else + responseWord = keywordsFound[Utility.Random( keywordsFound.Count )]; + + string secondResponseWord = GetRandomResponseWord( keywordsFound ); + + StringBuilder response = new StringBuilder(); + + switch ( Utility.Random( 6 ) ) + { + default: + case 0: + { + response.Append( "Me " ).Append( responseWord ).Append( '?' ); + break; + } + case 1: + { + response.Append( responseWord ).Append( " thee!" ); + response.Replace( responseWord[0], char.ToUpper( responseWord[0] ), 0, 1 ); + break; + } + case 2: + { + response.Append( responseWord ).Append( '?' ); + response.Replace( responseWord[0], char.ToUpper( responseWord[0] ), 0, 1 ); + break; + } + case 3: + { + response.Append( responseWord ).Append( "! " ).Append( secondResponseWord ).Append( '.' ); + response.Replace( responseWord[0], char.ToUpper( responseWord[0] ), 0, 1 ); + response.Replace( secondResponseWord[0], char.ToUpper( secondResponseWord[0] ), responseWord.Length + 2, 1 ); + break; + } + case 4: + { + response.Append( responseWord ).Append( '.' ); + response.Replace( responseWord[0], char.ToUpper( responseWord[0] ), 0, 1 ); + break; + } + case 5: + { + response.Append( responseWord ).Append( "? " ).Append( secondResponseWord ).Append( '.' ); + response.Replace( responseWord[0], char.ToUpper( responseWord[0] ), 0, 1 ); + response.Replace( secondResponseWord[0], char.ToUpper( secondResponseWord[0] ), responseWord.Length + 2, 1 ); + break; + } + } + + int maxWords = (split.Length / 2) + 1; + + if ( maxWords < 2 ) + maxWords = 2; + else if ( maxWords > 6 ) + maxWords = 6; + + SaySentance( mob, Utility.RandomMinMax( 2, maxWords ) ); + mob.Say( response.ToString() ); + + return true; + } + + return false; + } + + public void OnDeath( Mobile mob ) + { + if ( (Flags & IHSFlags.OnDeath) == 0 ) + return; // not enabled + + if ( 90 > Utility.Random( 100 ) ) + return; // 90% chance to do nothing; 10% chance to talk + + SayRandomTranslate( mob, + "Revenge!", + "NOOooo!", + "I... I...", + "Me no die!", + "Me die!", + "Must... not die...", + "Oooh, me hurt...", + "Me dying?" ); + } + + public void OnMovement( Mobile mob, Mobile mover, Point3D oldLocation ) + { + if ( (Flags & IHSFlags.OnMovement) == 0 ) + return; // not enabled + + if ( !mover.Player || (mover.Hidden && mover.AccessLevel > AccessLevel.Player) ) + return; + + if ( !mob.InRange( mover, 5 ) || mob.InRange( oldLocation, 5 ) ) + return; // only talk when they enter 5 tile range + + if ( 90 > Utility.Random( 100 ) ) + return; // 90% chance to do nothing; 10% chance to talk + + SaySentance( mob, 6 ); + } + + public void OnDamage( Mobile mob, int amount ) + { + if ( (Flags & IHSFlags.OnDamaged) == 0 ) + return; // not enabled + + if ( 90 > Utility.Random( 100 ) ) + return; // 90% chance to do nothing; 10% chance to talk + + if ( amount < 5 ) + { + SayRandomTranslate( mob, + "Ouch!", + "Me not hurt bad!", + "Thou fight bad.", + "Thy blows soft!", + "You bad with weapon!" ); + } + else + { + SayRandomTranslate( mob, + "Ouch! Me hurt!", + "No, kill me not!", + "Me hurt!", + "Away with thee!", + "Oof! That hurt!", + "Aaah! That hurt...", + "Good blow!" ); + } + } + + public void OnConstruct( Mobile mob ) + { + mob.SpeechHue = Hue; + } + + public void SaySentance( Mobile mob, int wordCount ) + { + mob.Say( ConstructSentance( wordCount ) ); + mob.PlaySound( Sound ); + } + + public InhumanSpeech() + { + } + } } diff --git a/Projects/Scripts/Misc/LanguageStatistics.cs b/Projects/Scripts/Misc/LanguageStatistics.cs index 43c528e66..7221b42f5 100644 --- a/Projects/Scripts/Misc/LanguageStatistics.cs +++ b/Projects/Scripts/Misc/LanguageStatistics.cs @@ -189,60 +189,58 @@ namespace Server.Misc { Dictionary ht = new Dictionary(); - using (StreamWriter writer = new StreamWriter("languages.txt")) - { - if (CountAccounts) - foreach (Account acc in Accounts.GetAccounts()) - for (int i = 0; i < acc.Length; i++) - { - Mobile mob = acc[i]; + using StreamWriter writer = new StreamWriter("languages.txt"); + if (CountAccounts) + foreach (Account acc in Accounts.GetAccounts()) + for (int i = 0; i < acc.Length; i++) + { + Mobile mob = acc[i]; - string lang = mob?.Language; + string lang = mob?.Language; - if (lang == null) - continue; + if (lang == null) + continue; - lang = lang.ToUpper(); + lang = lang.ToUpper(); - if (ht.TryGetValue(lang, out InternationalCodeCounter codes)) - codes.Increase(); - else - ht[lang] = new InternationalCodeCounter(lang); + if (ht.TryGetValue(lang, out InternationalCodeCounter codes)) + codes.Increase(); + else + ht[lang] = new InternationalCodeCounter(lang); - break; - } - else - foreach (Mobile mob in World.Mobiles.Values) - if (mob.Player) - { - string lang = mob.Language; + break; + } + else + foreach (Mobile mob in World.Mobiles.Values) + if (mob.Player) + { + string lang = mob.Language; - if (lang == null) - continue; + if (lang == null) + continue; - lang = lang.ToUpper(); + lang = lang.ToUpper(); - if (ht.TryGetValue(lang, out InternationalCodeCounter codes)) - codes.Increase(); - else - ht[lang] = new InternationalCodeCounter(lang); - } + if (ht.TryGetValue(lang, out InternationalCodeCounter codes)) + codes.Increase(); + else + ht[lang] = new InternationalCodeCounter(lang); + } - writer.WriteLine( - $"Language statistics. Numbers show how many {(CountAccounts ? "accounts" : "playermobile")} use the specified language."); - writer.WriteLine( - "===================================================================================================="); - writer.WriteLine(); + writer.WriteLine( + $"Language statistics. Numbers show how many {(CountAccounts ? "accounts" : "playermobile")} use the specified language."); + writer.WriteLine( + "===================================================================================================="); + writer.WriteLine(); - // sort the list - List list = new List(ht.Values); - list.Sort(InternationalCodeComparer.Instance); + // sort the list + List list = new List(ht.Values); + list.Sort(InternationalCodeComparer.Instance); - foreach (InternationalCodeCounter c in list) - writer.WriteLine($"{GetFormattedInfo(c.Code)}‎ : {c.Count}"); + foreach (InternationalCodeCounter c in list) + writer.WriteLine($"{GetFormattedInfo(c.Code)}‎ : {c.Count}"); - e.Mobile.SendMessage("Languages list generated."); - } + e.Mobile.SendMessage("Languages list generated."); } private struct InternationalCode @@ -260,10 +258,8 @@ namespace Server.Misc public string Country_LocalName{ get; } public InternationalCode(string code, string language, string country) : this(code, language, country, null, - null) - { + null) => m_HasLocalInfo = false; - } public InternationalCode(string code, string language, string country, string language_localname, string country_localname) diff --git a/Projects/Scripts/Misc/LightCycle.cs b/Projects/Scripts/Misc/LightCycle.cs index 331da6b85..bafcc0295 100644 --- a/Projects/Scripts/Misc/LightCycle.cs +++ b/Projects/Scripts/Misc/LightCycle.cs @@ -99,10 +99,7 @@ namespace Server private class LightCycleTimer : Timer { - public LightCycleTimer() : base(TimeSpan.FromSeconds(0), TimeSpan.FromSeconds(5.0)) - { - Priority = TimerPriority.FiveSeconds; - } + public LightCycleTimer() : base(TimeSpan.FromSeconds(0), TimeSpan.FromSeconds(5.0)) => Priority = TimerPriority.FiveSeconds; protected override void OnTick() { diff --git a/Projects/Scripts/Misc/Loot.cs b/Projects/Scripts/Misc/Loot.cs index 4ffc7b06e..ace2e2c7a 100644 --- a/Projects/Scripts/Misc/Loot.cs +++ b/Projects/Scripts/Misc/Loot.cs @@ -359,10 +359,7 @@ namespace Server return Construct(OldWandTypes, WandTypes, NewWandTypes) as BaseWand; } - public static BaseClothing RandomClothing() - { - return RandomClothing(false, false); - } + public static BaseClothing RandomClothing() => RandomClothing(false, false); public static BaseClothing RandomClothing(bool inTokuno, bool isMondain) { @@ -382,10 +379,7 @@ namespace Server return Construct(ClothingTypes) as BaseClothing; } - public static BaseWeapon RandomRangedWeapon() - { - return RandomRangedWeapon(false, false); - } + public static BaseWeapon RandomRangedWeapon() => RandomRangedWeapon(false, false); public static BaseWeapon RandomRangedWeapon(bool inTokuno, bool isMondain) { @@ -405,10 +399,7 @@ namespace Server return Construct(RangedWeaponTypes) as BaseWeapon; } - public static BaseWeapon RandomWeapon() - { - return RandomWeapon(false, false); - } + public static BaseWeapon RandomWeapon() => RandomWeapon(false, false); public static BaseWeapon RandomWeapon(bool inTokuno, bool isMondain) { @@ -428,10 +419,7 @@ namespace Server return Construct(WeaponTypes) as BaseWeapon; } - public static Item RandomWeaponOrJewelry() - { - return RandomWeaponOrJewelry(false, false); - } + public static Item RandomWeaponOrJewelry() => RandomWeaponOrJewelry(false, false); public static Item RandomWeaponOrJewelry(bool inTokuno, bool isMondain) { @@ -451,15 +439,9 @@ namespace Server return Construct(WeaponTypes, JewelryTypes); } - public static BaseJewel RandomJewelry() - { - return Construct(JewelryTypes) as BaseJewel; - } + public static BaseJewel RandomJewelry() => Construct(JewelryTypes) as BaseJewel; - public static BaseArmor RandomArmor() - { - return RandomArmor(false, false); - } + public static BaseArmor RandomArmor() => RandomArmor(false, false); public static BaseArmor RandomArmor(bool inTokuno, bool isMondain) { @@ -476,10 +458,7 @@ namespace Server return Construct(ArmorTypes) as BaseArmor; } - public static BaseHat RandomHat() - { - return RandomHat(false); - } + public static BaseHat RandomHat() => RandomHat(false); public static BaseHat RandomHat(bool inTokuno) { @@ -492,10 +471,7 @@ namespace Server return Construct(HatTypes) as BaseHat; } - public static Item RandomArmorOrHat() - { - return RandomArmorOrHat(false, false); - } + public static Item RandomArmorOrHat() => RandomArmorOrHat(false, false); public static Item RandomArmorOrHat(bool inTokuno, bool isMondain) { @@ -523,10 +499,7 @@ namespace Server return Construct(ShieldTypes) as BaseShield; } - public static BaseArmor RandomArmorOrShield() - { - return RandomArmorOrShield(false, false); - } + public static BaseArmor RandomArmorOrShield() => RandomArmorOrShield(false, false); public static BaseArmor RandomArmorOrShield(bool inTokuno, bool isMondain) { @@ -546,10 +519,7 @@ namespace Server return Construct(ArmorTypes, ShieldTypes) as BaseArmor; } - public static Item RandomArmorOrShieldOrJewelry() - { - return RandomArmorOrShieldOrJewelry(false, false); - } + public static Item RandomArmorOrShieldOrJewelry() => RandomArmorOrShieldOrJewelry(false, false); public static Item RandomArmorOrShieldOrJewelry(bool inTokuno, bool isMondain) { @@ -570,10 +540,7 @@ namespace Server return Construct(ArmorTypes, HatTypes, ShieldTypes, JewelryTypes); } - public static Item RandomArmorOrShieldOrWeapon() - { - return RandomArmorOrShieldOrWeapon(false, false); - } + public static Item RandomArmorOrShieldOrWeapon() => RandomArmorOrShieldOrWeapon(false, false); public static Item RandomArmorOrShieldOrWeapon(bool inTokuno, bool isMondain) { @@ -597,10 +564,7 @@ namespace Server return Construct(WeaponTypes, RangedWeaponTypes, ArmorTypes, HatTypes, ShieldTypes); } - public static Item RandomArmorOrShieldOrWeaponOrJewelry() - { - return RandomArmorOrShieldOrWeaponOrJewelry(false, false); - } + public static Item RandomArmorOrShieldOrWeaponOrJewelry() => RandomArmorOrShieldOrWeaponOrJewelry(false, false); public static Item RandomArmorOrShieldOrWeaponOrJewelry(bool inTokuno, bool isMondain) { @@ -627,27 +591,15 @@ namespace Server #region Chest of Heirlooms - public static Item ChestOfHeirloomsContains() - { - return Construct(SEArmorTypes, SEHatTypes, SEWeaponTypes, SERangedWeaponTypes, JewelryTypes); - } + public static Item ChestOfHeirloomsContains() => Construct(SEArmorTypes, SEHatTypes, SEWeaponTypes, SERangedWeaponTypes, JewelryTypes); #endregion - public static Item RandomGem() - { - return Construct(GemTypes); - } + public static Item RandomGem() => Construct(GemTypes); - public static Item RandomReagent() - { - return Construct(RegTypes); - } + public static Item RandomReagent() => Construct(RegTypes); - public static Item RandomNecromancyReagent() - { - return Construct(NecroRegTypes); - } + public static Item RandomNecromancyReagent() => Construct(NecroRegTypes); public static Item RandomPossibleReagent() { @@ -657,10 +609,7 @@ namespace Server return Construct(RegTypes); } - public static Item RandomPotion() - { - return Construct(PotionTypes); - } + public static Item RandomPotion() => Construct(PotionTypes); public static BaseInstrument RandomInstrument() { @@ -670,10 +619,7 @@ namespace Server return Construct(InstrumentTypes) as BaseInstrument; } - public static Item RandomStatue() - { - return Construct(StatueTypes); - } + public static Item RandomStatue() => Construct(StatueTypes); public static SpellScroll RandomScroll(int minIndex, int maxIndex, SpellbookType type) { @@ -699,25 +645,13 @@ namespace Server return Construct(types, Utility.RandomMinMax(minIndex, maxIndex)) as SpellScroll; } - public static BaseBook RandomGrimmochJournal() - { - return Construct(GrimmochJournalTypes) as BaseBook; - } + public static BaseBook RandomGrimmochJournal() => Construct(GrimmochJournalTypes) as BaseBook; - public static BaseBook RandomLysanderNotebook() - { - return Construct(LysanderNotebookTypes) as BaseBook; - } + public static BaseBook RandomLysanderNotebook() => Construct(LysanderNotebookTypes) as BaseBook; - public static BaseBook RandomTavarasJournal() - { - return Construct(TavarasJournalTypes) as BaseBook; - } + public static BaseBook RandomTavarasJournal() => Construct(TavarasJournalTypes) as BaseBook; - public static BaseBook RandomLibraryBook() - { - return Construct(LibraryBookTypes) as BaseBook; - } + public static BaseBook RandomLibraryBook() => Construct(LibraryBookTypes) as BaseBook; public static BaseTalisman RandomTalisman() { diff --git a/Projects/Scripts/Misc/LootPack.cs b/Projects/Scripts/Misc/LootPack.cs index 3a39afbed..48bfa9f0a 100644 --- a/Projects/Scripts/Misc/LootPack.cs +++ b/Projects/Scripts/Misc/LootPack.cs @@ -88,10 +88,7 @@ namespace Server private LootPackEntry[] m_Entries; - public LootPack(LootPackEntry[] entries) - { - m_Entries = entries; - } + public LootPack(LootPackEntry[] entries) => m_Entries = entries; public static int GetLuckChance(Mobile killer, Mobile victim) { @@ -133,10 +130,7 @@ namespace Server return GetLuckChance(highest.m_Mobile, dead); } - public static bool CheckLuck(int chance) - { - return chance > Utility.Random(10000); - } + public static bool CheckLuck(int chance) => chance > Utility.Random(10000); public void Generate(Mobile from, Container cont, bool spawning, int luckChance) { @@ -592,10 +586,7 @@ namespace Server #region Mondain's Legacy - private static bool IsMondain(Mobile m) - { - return MondainsLegacy.IsMLRegion(m.Region); - } + private static bool IsMondain(Mobile m) => MondainsLegacy.IsMLRegion(m.Region); #endregion diff --git a/Projects/Scripts/Misc/MondainsLegacy.cs b/Projects/Scripts/Misc/MondainsLegacy.cs index 213dc69a2..46148afa9 100644 --- a/Projects/Scripts/Misc/MondainsLegacy.cs +++ b/Projects/Scripts/Misc/MondainsLegacy.cs @@ -62,17 +62,15 @@ namespace Server return false; } - public static bool IsMLRegion(Region region) - { - return region.IsPartOf("Twisted Weald") - || region.IsPartOf("Sanctuary") - || region.IsPartOf("The Prism of Light") - || region.IsPartOf("The Citadel") - || region.IsPartOf("Bedlam") - || region.IsPartOf("Blighted Grove") - || region.IsPartOf("The Painted Caves") - || region.IsPartOf("The Palace of Paroxysmus") - || region.IsPartOf("Labyrinth"); - } + public static bool IsMLRegion(Region region) => + region.IsPartOf("Twisted Weald") + || region.IsPartOf("Sanctuary") + || region.IsPartOf("The Prism of Light") + || region.IsPartOf("The Citadel") + || region.IsPartOf("Bedlam") + || region.IsPartOf("Blighted Grove") + || region.IsPartOf("The Painted Caves") + || region.IsPartOf("The Palace of Paroxysmus") + || region.IsPartOf("Labyrinth"); } } \ No newline at end of file diff --git a/Projects/Scripts/Misc/NameList.cs b/Projects/Scripts/Misc/NameList.cs index 88d7baa9a..36ba6a249 100644 --- a/Projects/Scripts/Misc/NameList.cs +++ b/Projects/Scripts/Misc/NameList.cs @@ -5,96 +5,93 @@ using System.Xml; namespace Server { - public class NameList - { - public string Type { get; } + public class NameList + { + public string Type { get; } - public string[] List { get; } + public string[] List { get; } - public bool ContainsName( string name ) - { - for ( int i = 0; i < List.Length; i++ ) - if ( name == List[i] ) - return true; + public bool ContainsName( string name ) + { + for ( int i = 0; i < List.Length; i++ ) + if ( name == List[i] ) + return true; - return false; - } + return false; + } - public NameList( string type, XmlElement xml ) - { - Type = type; - List = xml.InnerText.Split( ',' ); + public NameList( string type, XmlElement xml ) + { + Type = type; + List = xml.InnerText.Split( ',' ); - for ( int i = 0; i < List.Length; ++i ) - List[i] = Utility.Intern( List[i].Trim() ); - } + for ( int i = 0; i < List.Length; ++i ) + List[i] = Utility.Intern( List[i].Trim() ); + } - public string GetRandomName() - { - if ( List.Length > 0 ) - return List[Utility.Random( List.Length )]; + public string GetRandomName() + { + if ( List.Length > 0 ) + return List[Utility.Random( List.Length )]; - return ""; - } + return ""; + } - public static NameList GetNameList( string type ) - { - m_Table.TryGetValue( type, out NameList n ); - return n; - } + public static NameList GetNameList( string type ) + { + m_Table.TryGetValue( type, out NameList n ); + return n; + } - public static string RandomName( string type ) - { - return GetNameList( type )?.GetRandomName() ?? ""; - } + public static string RandomName( string type ) => GetNameList( type )?.GetRandomName() ?? ""; - private static Dictionary m_Table; + private static Dictionary m_Table; - static NameList() - { - m_Table = new Dictionary( StringComparer.OrdinalIgnoreCase ); + static NameList() + { + m_Table = new Dictionary( StringComparer.OrdinalIgnoreCase ); - string filePath = Path.Combine( Core.BaseDirectory, "Data/names.xml" ); + string filePath = Path.Combine( Core.BaseDirectory, "Data/names.xml" ); - if ( !File.Exists( filePath ) ) - return; + if ( !File.Exists( filePath ) ) + return; - try - { - Load( filePath ); - } - catch ( Exception e ) - { - Console.WriteLine( "Warning: Exception caught loading name lists:" ); - Console.WriteLine( e ); - } - } + try + { + Load( filePath ); + } + catch ( Exception e ) + { + Console.WriteLine( "Warning: Exception caught loading name lists:" ); + Console.WriteLine( e ); + } + } - private static void Load( string filePath ) - { - XmlDocument doc = new XmlDocument(); - doc.Load( filePath ); + private static void Load( string filePath ) + { + XmlDocument doc = new XmlDocument(); + doc.Load( filePath ); - XmlElement root = doc["names"]; + XmlElement root = doc["names"]; - foreach ( XmlElement element in root.GetElementsByTagName( "namelist" ) ) - { - string type = element.GetAttribute( "type" ); + foreach ( XmlElement element in root.GetElementsByTagName( "namelist" ) ) + { + string type = element.GetAttribute( "type" ); - if ( string.IsNullOrEmpty( type ) ) - continue; + if ( string.IsNullOrEmpty( type ) ) + continue; - try - { - NameList list = new NameList( type, element ); + try + { + NameList list = new NameList( type, element ); - m_Table[type] = list; - } + m_Table[type] = list; + } catch { // ignored } } - } - } + } + } } diff --git a/Projects/Scripts/Misc/NameVerification.cs b/Projects/Scripts/Misc/NameVerification.cs index 5684626fb..67b76d1d5 100644 --- a/Projects/Scripts/Misc/NameVerification.cs +++ b/Projects/Scripts/Misc/NameVerification.cs @@ -116,11 +116,9 @@ namespace Server.Misc } public static bool Validate(string name, int minLength, int maxLength, bool allowLetters, bool allowDigits, - bool noExceptionsAtStart, int maxExceptions, char[] exceptions) - { - return Validate(name, minLength, maxLength, allowLetters, allowDigits, noExceptionsAtStart, maxExceptions, + bool noExceptionsAtStart, int maxExceptions, char[] exceptions) => + Validate(name, minLength, maxLength, allowLetters, allowDigits, noExceptionsAtStart, maxExceptions, exceptions, Disallowed, StartDisallowed); - } public static bool Validate(string name, int minLength, int maxLength, bool allowLetters, bool allowDigits, bool noExceptionsAtStart, int maxExceptions, char[] exceptions, string[] disallowed, string[] startDisallowed) diff --git a/Projects/Scripts/Misc/Notoriety.cs b/Projects/Scripts/Misc/Notoriety.cs index 5df415155..a5ebf5459 100644 --- a/Projects/Scripts/Misc/Notoriety.cs +++ b/Projects/Scripts/Misc/Notoriety.cs @@ -426,15 +426,9 @@ namespace Server.Misc !house.IsFriend(c.ControlMaster); } - public static bool IsPet(BaseCreature c) - { - return c?.Controlled == true; - } + public static bool IsPet(BaseCreature c) => c?.Controlled == true; - public static bool IsSummoned(BaseCreature c) - { - return c?.Summoned == true; - } + public static bool IsSummoned(BaseCreature c) => c?.Summoned == true; public static bool CheckAggressor(List list, Mobile target) { diff --git a/Projects/Scripts/Misc/Poison.cs b/Projects/Scripts/Misc/Poison.cs index 7dd39920e..18fcb1caf 100644 --- a/Projects/Scripts/Misc/Poison.cs +++ b/Projects/Scripts/Misc/Poison.cs @@ -68,10 +68,7 @@ namespace Server return newPoison ?? oldPoison; } - public override Timer ConstructTimer(Mobile m) - { - return new PoisonTimer(m, this); - } + public override Timer ConstructTimer(Mobile m) => new PoisonTimer(m, this); public class PoisonTimer : Timer { diff --git a/Projects/Scripts/Misc/RaceDefinitions.cs b/Projects/Scripts/Misc/RaceDefinitions.cs index 29f53df3e..f6b0db296 100644 --- a/Projects/Scripts/Misc/RaceDefinitions.cs +++ b/Projects/Scripts/Misc/RaceDefinitions.cs @@ -99,10 +99,7 @@ namespace Server.Misc return hue; } - public override int RandomSkinHue() - { - return Utility.Random(1002, 57) | 0x8000; - } + public override int RandomSkinHue() => Utility.Random(1002, 57) | 0x8000; public override int ClipHairHue(int hue) { @@ -113,10 +110,7 @@ namespace Server.Misc return hue; } - public override int RandomHairHue() - { - return Utility.Random(1102, 48); - } + public override int RandomHairHue() => Utility.Random(1102, 48); } private class Elf : Race @@ -177,15 +171,9 @@ namespace Server.Misc } } - public override bool ValidateFacialHair(bool female, int itemID) - { - return itemID == 0; - } + public override bool ValidateFacialHair(bool female, int itemID) => itemID == 0; - public override int RandomFacialHair(bool female) - { - return 0; - } + public override int RandomFacialHair(bool female) => 0; public override int ClipSkinHue(int hue) { @@ -196,10 +184,7 @@ namespace Server.Misc return m_SkinHues[0]; } - public override int RandomSkinHue() - { - return m_SkinHues[Utility.Random(m_SkinHues.Length)] | 0x8000; - } + public override int RandomSkinHue() => m_SkinHues[Utility.Random(m_SkinHues.Length)] | 0x8000; public override int ClipHairHue(int hue) { @@ -210,10 +195,7 @@ namespace Server.Misc return m_HairHues[0]; } - public override int RandomHairHue() - { - return m_HairHues[Utility.Random(m_HairHues.Length)]; - } + public override int RandomHairHue() => m_HairHues[Utility.Random(m_HairHues.Length)]; } #region SA @@ -282,25 +264,13 @@ namespace Server.Misc return 0; } - public override bool ValidateFacialHair(bool female, int itemID) - { - return !female && itemID >= 0x42AD && itemID <= 0x42B0; - } + public override bool ValidateFacialHair(bool female, int itemID) => !female && itemID >= 0x42AD && itemID <= 0x42B0; - public override int RandomFacialHair(bool female) - { - return female ? 0 : Utility.RandomList(0, 0x42AD, 0x42AE, 0x42AF, 0x42B0); - } + public override int RandomFacialHair(bool female) => female ? 0 : Utility.RandomList(0, 0x42AD, 0x42AE, 0x42AF, 0x42B0); - public override int ClipSkinHue(int hue) - { - return hue; // for hue information gathering - } + public override int ClipSkinHue(int hue) => hue; - public override int RandomSkinHue() - { - return m_BodyHues[Utility.Random(m_BodyHues.Length)] | 0x8000; - } + public override int RandomSkinHue() => m_BodyHues[Utility.Random(m_BodyHues.Length)] | 0x8000; public override int ClipHairHue(int hue) { @@ -311,10 +281,7 @@ namespace Server.Misc return m_HornHues[0]; } - public override int RandomHairHue() - { - return m_HornHues[Utility.Random(m_HornHues.Length)]; - } + public override int RandomHairHue() => m_HornHues[Utility.Random(m_HornHues.Length)]; } #endregion diff --git a/Projects/Scripts/Misc/RegenRates.cs b/Projects/Scripts/Misc/RegenRates.cs index 26054fb8c..ecf5cee08 100644 --- a/Projects/Scripts/Misc/RegenRates.cs +++ b/Projects/Scripts/Misc/RegenRates.cs @@ -39,15 +39,9 @@ namespace Server.Misc m.CheckSkill(skill, n); } - private static bool CheckTransform(Mobile m, Type type) - { - return TransformationSpellHelper.UnderTransformation(m, type); - } + private static bool CheckTransform(Mobile m, Type type) => TransformationSpellHelper.UnderTransformation(m, type); - private static bool CheckAnimal(Mobile m, Type type) - { - return AnimalForm.UnderTransformation(m, type); - } + private static bool CheckAnimal(Mobile m, Type type) => AnimalForm.UnderTransformation(m, type); private static TimeSpan Mobile_HitsRegenRate(Mobile from) { diff --git a/Projects/Scripts/Misc/ResourceInfo.cs b/Projects/Scripts/Misc/ResourceInfo.cs index b408138d9..c2a493552 100644 --- a/Projects/Scripts/Misc/ResourceInfo.cs +++ b/Projects/Scripts/Misc/ResourceInfo.cs @@ -3,684 +3,681 @@ using System.Collections.Generic; namespace Server.Items { - public enum CraftResource - { - None = 0, - Iron = 1, - DullCopper, - ShadowIron, - Copper, - Bronze, - Gold, - Agapite, - Verite, - Valorite, + public enum CraftResource + { + None = 0, + Iron = 1, + DullCopper, + ShadowIron, + Copper, + Bronze, + Gold, + Agapite, + Verite, + Valorite, - RegularLeather = 101, - SpinedLeather, - HornedLeather, - BarbedLeather, + RegularLeather = 101, + SpinedLeather, + HornedLeather, + BarbedLeather, - RedScales = 201, - YellowScales, - BlackScales, - GreenScales, - WhiteScales, - BlueScales, + RedScales = 201, + YellowScales, + BlackScales, + GreenScales, + WhiteScales, + BlueScales, - RegularWood = 301, - OakWood, - AshWood, - YewWood, - Heartwood, - Bloodwood, - Frostwood - } + RegularWood = 301, + OakWood, + AshWood, + YewWood, + Heartwood, + Bloodwood, + Frostwood + } - public enum CraftResourceType - { - None, - Metal, - Leather, - Scales, - Wood - } - - public class CraftAttributeInfo - { - public int WeaponFireDamage { get; set; } - - public int WeaponColdDamage { get; set; } - - public int WeaponPoisonDamage { get; set; } - - public int WeaponEnergyDamage { get; set; } - - public int WeaponChaosDamage { get; set; } - - public int WeaponDirectDamage { get; set; } - - public int WeaponDurability { get; set; } - - public int WeaponLuck { get; set; } - - public int WeaponGoldIncrease { get; set; } - - public int WeaponLowerRequirements { get; set; } - - public int ArmorPhysicalResist { get; set; } - - public int ArmorFireResist { get; set; } - - public int ArmorColdResist { get; set; } - - public int ArmorPoisonResist { get; set; } - - public int ArmorEnergyResist { get; set; } - - public int ArmorDurability { get; set; } - - public int ArmorLuck { get; set; } - - public int ArmorGoldIncrease { get; set; } - - public int ArmorLowerRequirements { get; set; } - - public int RunicMinAttributes { get; set; } - - public int RunicMaxAttributes { get; set; } - - public int RunicMinIntensity { get; set; } - - public int RunicMaxIntensity { get; set; } - - public CraftAttributeInfo() - { - } - - public static readonly CraftAttributeInfo Blank; - public static readonly CraftAttributeInfo DullCopper, ShadowIron, Copper, Bronze, Golden, Agapite, Verite, Valorite; - public static readonly CraftAttributeInfo Spined, Horned, Barbed; - public static readonly CraftAttributeInfo RedScales, YellowScales, BlackScales, GreenScales, WhiteScales, BlueScales; - public static readonly CraftAttributeInfo OakWood, AshWood, YewWood, Heartwood, Bloodwood, Frostwood; - - static CraftAttributeInfo() - { - Blank = new CraftAttributeInfo(); - - CraftAttributeInfo dullCopper = DullCopper = new CraftAttributeInfo(); - - dullCopper.ArmorPhysicalResist = 6; - dullCopper.ArmorDurability = 50; - dullCopper.ArmorLowerRequirements = 20; - dullCopper.WeaponDurability = 100; - dullCopper.WeaponLowerRequirements = 50; - dullCopper.RunicMinAttributes = 1; - dullCopper.RunicMaxAttributes = 2; - if ( Core.ML ) - { - dullCopper.RunicMinIntensity = 40; - dullCopper.RunicMaxIntensity = 100; - } - else - { - dullCopper.RunicMinIntensity = 10; - dullCopper.RunicMaxIntensity = 35; - } - - CraftAttributeInfo shadowIron = ShadowIron = new CraftAttributeInfo(); - - shadowIron.ArmorPhysicalResist = 2; - shadowIron.ArmorFireResist = 1; - shadowIron.ArmorEnergyResist = 5; - shadowIron.ArmorDurability = 100; - shadowIron.WeaponColdDamage = 20; - shadowIron.WeaponDurability = 50; - shadowIron.RunicMinAttributes = 2; - shadowIron.RunicMaxAttributes = 2; - if ( Core.ML ) - { - shadowIron.RunicMinIntensity = 45; - shadowIron.RunicMaxIntensity = 100; - } - else - { - shadowIron.RunicMinIntensity = 20; - shadowIron.RunicMaxIntensity = 45; - } - - CraftAttributeInfo copper = Copper = new CraftAttributeInfo(); - - copper.ArmorPhysicalResist = 1; - copper.ArmorFireResist = 1; - copper.ArmorPoisonResist = 5; - copper.ArmorEnergyResist = 2; - copper.WeaponPoisonDamage = 10; - copper.WeaponEnergyDamage = 20; - copper.RunicMinAttributes = 2; - copper.RunicMaxAttributes = 3; - if ( Core.ML ) - { - copper.RunicMinIntensity = 50; - copper.RunicMaxIntensity = 100; - } - else - { - copper.RunicMinIntensity = 25; - copper.RunicMaxIntensity = 50; - } - - CraftAttributeInfo bronze = Bronze = new CraftAttributeInfo(); - - bronze.ArmorPhysicalResist = 3; - bronze.ArmorColdResist = 5; - bronze.ArmorPoisonResist = 1; - bronze.ArmorEnergyResist = 1; - bronze.WeaponFireDamage = 40; - bronze.RunicMinAttributes = 3; - bronze.RunicMaxAttributes = 3; - if ( Core.ML ) - { - bronze.RunicMinIntensity = 55; - bronze.RunicMaxIntensity = 100; - } - else - { - bronze.RunicMinIntensity = 30; - bronze.RunicMaxIntensity = 65; - } - - CraftAttributeInfo golden = Golden = new CraftAttributeInfo(); - - golden.ArmorPhysicalResist = 1; - golden.ArmorFireResist = 1; - golden.ArmorColdResist = 2; - golden.ArmorEnergyResist = 2; - golden.ArmorLuck = 40; - golden.ArmorLowerRequirements = 30; - golden.WeaponLuck = 40; - golden.WeaponLowerRequirements = 50; - golden.RunicMinAttributes = 3; - golden.RunicMaxAttributes = 4; - if ( Core.ML ) - { - golden.RunicMinIntensity = 60; - golden.RunicMaxIntensity = 100; - } - else - { - golden.RunicMinIntensity = 35; - golden.RunicMaxIntensity = 75; - } - - CraftAttributeInfo agapite = Agapite = new CraftAttributeInfo(); - - agapite.ArmorPhysicalResist = 2; - agapite.ArmorFireResist = 3; - agapite.ArmorColdResist = 2; - agapite.ArmorPoisonResist = 2; - agapite.ArmorEnergyResist = 2; - agapite.WeaponColdDamage = 30; - agapite.WeaponEnergyDamage = 20; - agapite.RunicMinAttributes = 4; - agapite.RunicMaxAttributes = 4; - if ( Core.ML ) - { - agapite.RunicMinIntensity = 65; - agapite.RunicMaxIntensity = 100; - } - else - { - agapite.RunicMinIntensity = 40; - agapite.RunicMaxIntensity = 80; - } - - CraftAttributeInfo verite = Verite = new CraftAttributeInfo(); - - verite.ArmorPhysicalResist = 3; - verite.ArmorFireResist = 3; - verite.ArmorColdResist = 2; - verite.ArmorPoisonResist = 3; - verite.ArmorEnergyResist = 1; - verite.WeaponPoisonDamage = 40; - verite.WeaponEnergyDamage = 20; - verite.RunicMinAttributes = 4; - verite.RunicMaxAttributes = 5; - if ( Core.ML ) - { - verite.RunicMinIntensity = 70; - verite.RunicMaxIntensity = 100; - } - else - { - verite.RunicMinIntensity = 45; - verite.RunicMaxIntensity = 90; - } - - CraftAttributeInfo valorite = Valorite = new CraftAttributeInfo(); - - valorite.ArmorPhysicalResist = 4; - valorite.ArmorColdResist = 3; - valorite.ArmorPoisonResist = 3; - valorite.ArmorEnergyResist = 3; - valorite.ArmorDurability = 50; - valorite.WeaponFireDamage = 10; - valorite.WeaponColdDamage = 20; - valorite.WeaponPoisonDamage = 10; - valorite.WeaponEnergyDamage = 20; - valorite.RunicMinAttributes = 5; - valorite.RunicMaxAttributes = 5; - if ( Core.ML ) - { - valorite.RunicMinIntensity = 85; - valorite.RunicMaxIntensity = 100; - } - else - { - valorite.RunicMinIntensity = 50; - valorite.RunicMaxIntensity = 100; - } - - CraftAttributeInfo spined = Spined = new CraftAttributeInfo(); - - spined.ArmorPhysicalResist = 5; - spined.ArmorLuck = 40; - spined.RunicMinAttributes = 1; - spined.RunicMaxAttributes = 3; - if ( Core.ML ) - { - spined.RunicMinIntensity = 40; - spined.RunicMaxIntensity = 100; - } - else - { - spined.RunicMinIntensity = 20; - spined.RunicMaxIntensity = 40; - } - - CraftAttributeInfo horned = Horned = new CraftAttributeInfo(); - - horned.ArmorPhysicalResist = 2; - horned.ArmorFireResist = 3; - horned.ArmorColdResist = 2; - horned.ArmorPoisonResist = 2; - horned.ArmorEnergyResist = 2; - horned.RunicMinAttributes = 3; - horned.RunicMaxAttributes = 4; - if ( Core.ML ) - { - horned.RunicMinIntensity = 45; - horned.RunicMaxIntensity = 100; - } - else - { - horned.RunicMinIntensity = 30; - horned.RunicMaxIntensity = 70; - } - - CraftAttributeInfo barbed = Barbed = new CraftAttributeInfo(); - - barbed.ArmorPhysicalResist = 2; - barbed.ArmorFireResist = 1; - barbed.ArmorColdResist = 2; - barbed.ArmorPoisonResist = 3; - barbed.ArmorEnergyResist = 4; - barbed.RunicMinAttributes = 4; - barbed.RunicMaxAttributes = 5; - if ( Core.ML ) - { - barbed.RunicMinIntensity = 50; - barbed.RunicMaxIntensity = 100; - } - else - { - barbed.RunicMinIntensity = 40; - barbed.RunicMaxIntensity = 100; - } - - CraftAttributeInfo red = RedScales = new CraftAttributeInfo(); - - red.ArmorFireResist = 10; - red.ArmorColdResist = -3; - - CraftAttributeInfo yellow = YellowScales = new CraftAttributeInfo(); - - yellow.ArmorPhysicalResist = -3; - yellow.ArmorLuck = 20; - - CraftAttributeInfo black = BlackScales = new CraftAttributeInfo(); - - black.ArmorPhysicalResist = 10; - black.ArmorEnergyResist = -3; - - CraftAttributeInfo green = GreenScales = new CraftAttributeInfo(); - - green.ArmorFireResist = -3; - green.ArmorPoisonResist = 10; - - CraftAttributeInfo white = WhiteScales = new CraftAttributeInfo(); - - white.ArmorPhysicalResist = -3; - white.ArmorColdResist = 10; - - CraftAttributeInfo blue = BlueScales = new CraftAttributeInfo(); - - blue.ArmorPoisonResist = -3; - blue.ArmorEnergyResist = 10; - - //public static readonly CraftAttributeInfo OakWood, AshWood, YewWood, Heartwood, Bloodwood, Frostwood; - - CraftAttributeInfo oak = OakWood = new CraftAttributeInfo(); - - CraftAttributeInfo ash = AshWood = new CraftAttributeInfo(); - - CraftAttributeInfo yew = YewWood = new CraftAttributeInfo(); - - CraftAttributeInfo heart = Heartwood = new CraftAttributeInfo(); - - CraftAttributeInfo blood = Bloodwood = new CraftAttributeInfo(); - - CraftAttributeInfo frost = Frostwood = new CraftAttributeInfo(); - } - } - - public class CraftResourceInfo - { - public int Hue { get; } - - public int Number { get; } - - public string Name { get; } - - public CraftAttributeInfo AttributeInfo { get; } - - public CraftResource Resource { get; } - - public Type[] ResourceTypes { get; } - - public CraftResourceInfo( int hue, int number, string name, CraftAttributeInfo attributeInfo, CraftResource resource, params Type[] resourceTypes ) - { - Hue = hue; - Number = number; - Name = name; - AttributeInfo = attributeInfo; - Resource = resource; - ResourceTypes = resourceTypes; - - for ( int i = 0; i < resourceTypes.Length; ++i ) - CraftResources.RegisterType( resourceTypes[i], resource ); - } - } - - public class CraftResources - { - private static CraftResourceInfo[] m_MetalInfo = { - new CraftResourceInfo( 0x000, 1053109, "Iron", CraftAttributeInfo.Blank, CraftResource.Iron, typeof( IronIngot ), typeof( IronOre ), typeof( Granite ) ), - new CraftResourceInfo( 0x973, 1053108, "Dull Copper", CraftAttributeInfo.DullCopper, CraftResource.DullCopper, typeof( DullCopperIngot ), typeof( DullCopperOre ), typeof( DullCopperGranite ) ), - new CraftResourceInfo( 0x966, 1053107, "Shadow Iron", CraftAttributeInfo.ShadowIron, CraftResource.ShadowIron, typeof( ShadowIronIngot ), typeof( ShadowIronOre ), typeof( ShadowIronGranite ) ), - new CraftResourceInfo( 0x96D, 1053106, "Copper", CraftAttributeInfo.Copper, CraftResource.Copper, typeof( CopperIngot ), typeof( CopperOre ), typeof( CopperGranite ) ), - new CraftResourceInfo( 0x972, 1053105, "Bronze", CraftAttributeInfo.Bronze, CraftResource.Bronze, typeof( BronzeIngot ), typeof( BronzeOre ), typeof( BronzeGranite ) ), - new CraftResourceInfo( 0x8A5, 1053104, "Gold", CraftAttributeInfo.Golden, CraftResource.Gold, typeof( GoldIngot ), typeof( GoldOre ), typeof( GoldGranite ) ), - new CraftResourceInfo( 0x979, 1053103, "Agapite", CraftAttributeInfo.Agapite, CraftResource.Agapite, typeof( AgapiteIngot ), typeof( AgapiteOre ), typeof( AgapiteGranite ) ), - new CraftResourceInfo( 0x89F, 1053102, "Verite", CraftAttributeInfo.Verite, CraftResource.Verite, typeof( VeriteIngot ), typeof( VeriteOre ), typeof( VeriteGranite ) ), - new CraftResourceInfo( 0x8AB, 1053101, "Valorite", CraftAttributeInfo.Valorite, CraftResource.Valorite, typeof( ValoriteIngot ), typeof( ValoriteOre ), typeof( ValoriteGranite ) ) - }; - - private static CraftResourceInfo[] m_ScaleInfo = { - new CraftResourceInfo( 0x66D, 1053129, "Red Scales", CraftAttributeInfo.RedScales, CraftResource.RedScales, typeof( RedScales ) ), - new CraftResourceInfo( 0x8A8, 1053130, "Yellow Scales", CraftAttributeInfo.YellowScales, CraftResource.YellowScales, typeof( YellowScales ) ), - new CraftResourceInfo( 0x455, 1053131, "Black Scales", CraftAttributeInfo.BlackScales, CraftResource.BlackScales, typeof( BlackScales ) ), - new CraftResourceInfo( 0x851, 1053132, "Green Scales", CraftAttributeInfo.GreenScales, CraftResource.GreenScales, typeof( GreenScales ) ), - new CraftResourceInfo( 0x8FD, 1053133, "White Scales", CraftAttributeInfo.WhiteScales, CraftResource.WhiteScales, typeof( WhiteScales ) ), - new CraftResourceInfo( 0x8B0, 1053134, "Blue Scales", CraftAttributeInfo.BlueScales, CraftResource.BlueScales, typeof( BlueScales ) ) - }; - - private static CraftResourceInfo[] m_LeatherInfo = { - new CraftResourceInfo( 0x000, 1049353, "Normal", CraftAttributeInfo.Blank, CraftResource.RegularLeather, typeof( Leather ), typeof( Hides ) ), - new CraftResourceInfo( 0x283, 1049354, "Spined", CraftAttributeInfo.Spined, CraftResource.SpinedLeather, typeof( SpinedLeather ), typeof( SpinedHides ) ), - new CraftResourceInfo( 0x227, 1049355, "Horned", CraftAttributeInfo.Horned, CraftResource.HornedLeather, typeof( HornedLeather ), typeof( HornedHides ) ), - new CraftResourceInfo( 0x1C1, 1049356, "Barbed", CraftAttributeInfo.Barbed, CraftResource.BarbedLeather, typeof( BarbedLeather ), typeof( BarbedHides ) ) - }; - - private static CraftResourceInfo[] m_AOSLeatherInfo = { - new CraftResourceInfo( 0x000, 1049353, "Normal", CraftAttributeInfo.Blank, CraftResource.RegularLeather, typeof( Leather ), typeof( Hides ) ), - new CraftResourceInfo( 0x8AC, 1049354, "Spined", CraftAttributeInfo.Spined, CraftResource.SpinedLeather, typeof( SpinedLeather ), typeof( SpinedHides ) ), - new CraftResourceInfo( 0x845, 1049355, "Horned", CraftAttributeInfo.Horned, CraftResource.HornedLeather, typeof( HornedLeather ), typeof( HornedHides ) ), - new CraftResourceInfo( 0x851, 1049356, "Barbed", CraftAttributeInfo.Barbed, CraftResource.BarbedLeather, typeof( BarbedLeather ), typeof( BarbedHides ) ) - }; - - private static CraftResourceInfo[] m_WoodInfo = { - new CraftResourceInfo( 0x000, 1011542, "Normal", CraftAttributeInfo.Blank, CraftResource.RegularWood, typeof( Log ), typeof( Board ) ), - new CraftResourceInfo( 0x7DA, 1072533, "Oak", CraftAttributeInfo.OakWood, CraftResource.OakWood, typeof( OakLog ), typeof( OakBoard ) ), - new CraftResourceInfo( 0x4A7, 1072534, "Ash", CraftAttributeInfo.AshWood, CraftResource.AshWood, typeof( AshLog ), typeof( AshBoard ) ), - new CraftResourceInfo( 0x4A8, 1072535, "Yew", CraftAttributeInfo.YewWood, CraftResource.YewWood, typeof( YewLog ), typeof( YewBoard ) ), - new CraftResourceInfo( 0x4A9, 1072536, "Heartwood", CraftAttributeInfo.Heartwood, CraftResource.Heartwood, typeof( HeartwoodLog ), typeof( HeartwoodBoard ) ), - new CraftResourceInfo( 0x4AA, 1072538, "Bloodwood", CraftAttributeInfo.Bloodwood, CraftResource.Bloodwood, typeof( BloodwoodLog ), typeof( BloodwoodBoard ) ), - new CraftResourceInfo( 0x47F, 1072539, "Frostwood", CraftAttributeInfo.Frostwood, CraftResource.Frostwood, typeof( FrostwoodLog ), typeof( FrostwoodBoard ) ) - }; - - /// - /// Returns true if '' is None, Iron, RegularLeather or RegularWood. False if otherwise. - /// - public static bool IsStandard( CraftResource resource ) - { - return ( resource == CraftResource.None || resource == CraftResource.Iron || resource == CraftResource.RegularLeather || resource == CraftResource.RegularWood ); - } - - private static Dictionary m_TypeTable; - - /// - /// Registers that '' uses '' so that it can later be queried by - /// - public static void RegisterType( Type resourceType, CraftResource resource ) - { - if ( m_TypeTable == null ) - m_TypeTable = new Dictionary(); - - m_TypeTable[resourceType] = resource; - } - - /// - /// Returns the value for which '' uses -or- CraftResource.None if an unregistered type was specified. - /// - public static CraftResource GetFromType( Type resourceType ) - { - if ( m_TypeTable == null ) - return CraftResource.None; - - return m_TypeTable.TryGetValue(resourceType, out CraftResource res) ? res : CraftResource.None; - } - - /// - /// Returns a instance describing '' -or- null if an invalid resource was specified. - /// - public static CraftResourceInfo GetInfo( CraftResource resource ) - { - CraftResourceInfo[] list = null; - - switch ( GetType( resource ) ) - { - case CraftResourceType.Metal: list = m_MetalInfo; break; - case CraftResourceType.Leather: list = Core.AOS ? m_AOSLeatherInfo : m_LeatherInfo; break; - case CraftResourceType.Scales: list = m_ScaleInfo; break; - case CraftResourceType.Wood: list = m_WoodInfo; break; - } - - if ( list != null ) - { - int index = GetIndex( resource ); - - if ( index >= 0 && index < list.Length ) - return list[index]; - } - - return null; - } - - /// - /// Returns a value indiciating the type of ''. - /// - public static CraftResourceType GetType( CraftResource resource ) - { - if ( resource >= CraftResource.Iron && resource <= CraftResource.Valorite ) - return CraftResourceType.Metal; - - if ( resource >= CraftResource.RegularLeather && resource <= CraftResource.BarbedLeather ) - return CraftResourceType.Leather; - - if ( resource >= CraftResource.RedScales && resource <= CraftResource.BlueScales ) - return CraftResourceType.Scales; - - if ( resource >= CraftResource.RegularWood && resource <= CraftResource.Frostwood ) - return CraftResourceType.Wood; - - return CraftResourceType.None; - } - - /// - /// Returns the first in the series of resources for which '' belongs. - /// - public static CraftResource GetStart( CraftResource resource ) - { - switch ( GetType( resource ) ) - { - case CraftResourceType.Metal: return CraftResource.Iron; - case CraftResourceType.Leather: return CraftResource.RegularLeather; - case CraftResourceType.Scales: return CraftResource.RedScales; - case CraftResourceType.Wood: return CraftResource.RegularWood; - } - - return CraftResource.None; - } - - /// - /// Returns the index of '' in the seriest of resources for which it belongs. - /// - public static int GetIndex( CraftResource resource ) - { - CraftResource start = GetStart( resource ); - - if ( start == CraftResource.None ) - return 0; - - return resource - start; - } - - /// - /// Returns the property of '' -or- 0 if an invalid resource was specified. - /// - public static int GetLocalizationNumber( CraftResource resource ) - { - CraftResourceInfo info = GetInfo( resource ); - - return info?.Number ?? 0; - } - - /// - /// Returns the property of '' -or- 0 if an invalid resource was specified. - /// - public static int GetHue( CraftResource resource ) - { - CraftResourceInfo info = GetInfo( resource ); - - return info?.Hue ?? 0; - } - - /// - /// Returns the property of '' -or- an empty string if the resource specified was invalid. - /// - public static string GetName( CraftResource resource ) - { - CraftResourceInfo info = GetInfo( resource ); - - return ( info == null ? string.Empty : info.Name ); - } - - /// - /// Returns the value which represents '' -or- CraftResource.None if unable to convert. - /// - public static CraftResource GetFromOreInfo( OreInfo info ) - { - if ( info.Name.IndexOf( "Spined" ) >= 0 ) - return CraftResource.SpinedLeather; - if ( info.Name.IndexOf( "Horned" ) >= 0 ) - return CraftResource.HornedLeather; - if ( info.Name.IndexOf( "Barbed" ) >= 0 ) - return CraftResource.BarbedLeather; - if ( info.Name.IndexOf( "Leather" ) >= 0 ) - return CraftResource.RegularLeather; - - if ( info.Level == 0 ) - return CraftResource.Iron; - if ( info.Level == 1 ) - return CraftResource.DullCopper; - if ( info.Level == 2 ) - return CraftResource.ShadowIron; - if ( info.Level == 3 ) - return CraftResource.Copper; - if ( info.Level == 4 ) - return CraftResource.Bronze; - if ( info.Level == 5 ) - return CraftResource.Gold; - if ( info.Level == 6 ) - return CraftResource.Agapite; - if ( info.Level == 7 ) - return CraftResource.Verite; - if ( info.Level == 8 ) - return CraftResource.Valorite; - - return CraftResource.None; - } - - /// - /// Returns the value which represents '', using '' to help resolve leather OreInfo instances. - /// - public static CraftResource GetFromOreInfo( OreInfo info, ArmorMaterialType material ) - { - if ( material == ArmorMaterialType.Studded || material == ArmorMaterialType.Leather || material == ArmorMaterialType.Spined || - material == ArmorMaterialType.Horned || material == ArmorMaterialType.Barbed ) - { - if ( info.Level == 0 ) - return CraftResource.RegularLeather; - if ( info.Level == 1 ) - return CraftResource.SpinedLeather; - if ( info.Level == 2 ) - return CraftResource.HornedLeather; - if ( info.Level == 3 ) - return CraftResource.BarbedLeather; - - return CraftResource.None; - } - - return GetFromOreInfo( info ); - } - } - - // NOTE: This class is only for compatability with very old RunUO versions. - // No changes to it should be required for custom resources. - public class OreInfo - { - public static readonly OreInfo Iron = new OreInfo( 0, 0x000, "Iron" ); - public static readonly OreInfo DullCopper = new OreInfo( 1, 0x973, "Dull Copper" ); - public static readonly OreInfo ShadowIron = new OreInfo( 2, 0x966, "Shadow Iron" ); - public static readonly OreInfo Copper = new OreInfo( 3, 0x96D, "Copper" ); - public static readonly OreInfo Bronze = new OreInfo( 4, 0x972, "Bronze" ); - public static readonly OreInfo Gold = new OreInfo( 5, 0x8A5, "Gold" ); - public static readonly OreInfo Agapite = new OreInfo( 6, 0x979, "Agapite" ); - public static readonly OreInfo Verite = new OreInfo( 7, 0x89F, "Verite" ); - public static readonly OreInfo Valorite = new OreInfo( 8, 0x8AB, "Valorite" ); - - public OreInfo( int level, int hue, string name ) - { - Level = level; - Hue = hue; - Name = name; - } - - public int Level { get; } - - public int Hue { get; } - - public string Name { get; } - } + public enum CraftResourceType + { + None, + Metal, + Leather, + Scales, + Wood + } + + public class CraftAttributeInfo + { + public int WeaponFireDamage { get; set; } + + public int WeaponColdDamage { get; set; } + + public int WeaponPoisonDamage { get; set; } + + public int WeaponEnergyDamage { get; set; } + + public int WeaponChaosDamage { get; set; } + + public int WeaponDirectDamage { get; set; } + + public int WeaponDurability { get; set; } + + public int WeaponLuck { get; set; } + + public int WeaponGoldIncrease { get; set; } + + public int WeaponLowerRequirements { get; set; } + + public int ArmorPhysicalResist { get; set; } + + public int ArmorFireResist { get; set; } + + public int ArmorColdResist { get; set; } + + public int ArmorPoisonResist { get; set; } + + public int ArmorEnergyResist { get; set; } + + public int ArmorDurability { get; set; } + + public int ArmorLuck { get; set; } + + public int ArmorGoldIncrease { get; set; } + + public int ArmorLowerRequirements { get; set; } + + public int RunicMinAttributes { get; set; } + + public int RunicMaxAttributes { get; set; } + + public int RunicMinIntensity { get; set; } + + public int RunicMaxIntensity { get; set; } + + public CraftAttributeInfo() + { + } + + public static readonly CraftAttributeInfo Blank; + public static readonly CraftAttributeInfo DullCopper, ShadowIron, Copper, Bronze, Golden, Agapite, Verite, Valorite; + public static readonly CraftAttributeInfo Spined, Horned, Barbed; + public static readonly CraftAttributeInfo RedScales, YellowScales, BlackScales, GreenScales, WhiteScales, BlueScales; + public static readonly CraftAttributeInfo OakWood, AshWood, YewWood, Heartwood, Bloodwood, Frostwood; + + static CraftAttributeInfo() + { + Blank = new CraftAttributeInfo(); + + CraftAttributeInfo dullCopper = DullCopper = new CraftAttributeInfo(); + + dullCopper.ArmorPhysicalResist = 6; + dullCopper.ArmorDurability = 50; + dullCopper.ArmorLowerRequirements = 20; + dullCopper.WeaponDurability = 100; + dullCopper.WeaponLowerRequirements = 50; + dullCopper.RunicMinAttributes = 1; + dullCopper.RunicMaxAttributes = 2; + if ( Core.ML ) + { + dullCopper.RunicMinIntensity = 40; + dullCopper.RunicMaxIntensity = 100; + } + else + { + dullCopper.RunicMinIntensity = 10; + dullCopper.RunicMaxIntensity = 35; + } + + CraftAttributeInfo shadowIron = ShadowIron = new CraftAttributeInfo(); + + shadowIron.ArmorPhysicalResist = 2; + shadowIron.ArmorFireResist = 1; + shadowIron.ArmorEnergyResist = 5; + shadowIron.ArmorDurability = 100; + shadowIron.WeaponColdDamage = 20; + shadowIron.WeaponDurability = 50; + shadowIron.RunicMinAttributes = 2; + shadowIron.RunicMaxAttributes = 2; + if ( Core.ML ) + { + shadowIron.RunicMinIntensity = 45; + shadowIron.RunicMaxIntensity = 100; + } + else + { + shadowIron.RunicMinIntensity = 20; + shadowIron.RunicMaxIntensity = 45; + } + + CraftAttributeInfo copper = Copper = new CraftAttributeInfo(); + + copper.ArmorPhysicalResist = 1; + copper.ArmorFireResist = 1; + copper.ArmorPoisonResist = 5; + copper.ArmorEnergyResist = 2; + copper.WeaponPoisonDamage = 10; + copper.WeaponEnergyDamage = 20; + copper.RunicMinAttributes = 2; + copper.RunicMaxAttributes = 3; + if ( Core.ML ) + { + copper.RunicMinIntensity = 50; + copper.RunicMaxIntensity = 100; + } + else + { + copper.RunicMinIntensity = 25; + copper.RunicMaxIntensity = 50; + } + + CraftAttributeInfo bronze = Bronze = new CraftAttributeInfo(); + + bronze.ArmorPhysicalResist = 3; + bronze.ArmorColdResist = 5; + bronze.ArmorPoisonResist = 1; + bronze.ArmorEnergyResist = 1; + bronze.WeaponFireDamage = 40; + bronze.RunicMinAttributes = 3; + bronze.RunicMaxAttributes = 3; + if ( Core.ML ) + { + bronze.RunicMinIntensity = 55; + bronze.RunicMaxIntensity = 100; + } + else + { + bronze.RunicMinIntensity = 30; + bronze.RunicMaxIntensity = 65; + } + + CraftAttributeInfo golden = Golden = new CraftAttributeInfo(); + + golden.ArmorPhysicalResist = 1; + golden.ArmorFireResist = 1; + golden.ArmorColdResist = 2; + golden.ArmorEnergyResist = 2; + golden.ArmorLuck = 40; + golden.ArmorLowerRequirements = 30; + golden.WeaponLuck = 40; + golden.WeaponLowerRequirements = 50; + golden.RunicMinAttributes = 3; + golden.RunicMaxAttributes = 4; + if ( Core.ML ) + { + golden.RunicMinIntensity = 60; + golden.RunicMaxIntensity = 100; + } + else + { + golden.RunicMinIntensity = 35; + golden.RunicMaxIntensity = 75; + } + + CraftAttributeInfo agapite = Agapite = new CraftAttributeInfo(); + + agapite.ArmorPhysicalResist = 2; + agapite.ArmorFireResist = 3; + agapite.ArmorColdResist = 2; + agapite.ArmorPoisonResist = 2; + agapite.ArmorEnergyResist = 2; + agapite.WeaponColdDamage = 30; + agapite.WeaponEnergyDamage = 20; + agapite.RunicMinAttributes = 4; + agapite.RunicMaxAttributes = 4; + if ( Core.ML ) + { + agapite.RunicMinIntensity = 65; + agapite.RunicMaxIntensity = 100; + } + else + { + agapite.RunicMinIntensity = 40; + agapite.RunicMaxIntensity = 80; + } + + CraftAttributeInfo verite = Verite = new CraftAttributeInfo(); + + verite.ArmorPhysicalResist = 3; + verite.ArmorFireResist = 3; + verite.ArmorColdResist = 2; + verite.ArmorPoisonResist = 3; + verite.ArmorEnergyResist = 1; + verite.WeaponPoisonDamage = 40; + verite.WeaponEnergyDamage = 20; + verite.RunicMinAttributes = 4; + verite.RunicMaxAttributes = 5; + if ( Core.ML ) + { + verite.RunicMinIntensity = 70; + verite.RunicMaxIntensity = 100; + } + else + { + verite.RunicMinIntensity = 45; + verite.RunicMaxIntensity = 90; + } + + CraftAttributeInfo valorite = Valorite = new CraftAttributeInfo(); + + valorite.ArmorPhysicalResist = 4; + valorite.ArmorColdResist = 3; + valorite.ArmorPoisonResist = 3; + valorite.ArmorEnergyResist = 3; + valorite.ArmorDurability = 50; + valorite.WeaponFireDamage = 10; + valorite.WeaponColdDamage = 20; + valorite.WeaponPoisonDamage = 10; + valorite.WeaponEnergyDamage = 20; + valorite.RunicMinAttributes = 5; + valorite.RunicMaxAttributes = 5; + if ( Core.ML ) + { + valorite.RunicMinIntensity = 85; + valorite.RunicMaxIntensity = 100; + } + else + { + valorite.RunicMinIntensity = 50; + valorite.RunicMaxIntensity = 100; + } + + CraftAttributeInfo spined = Spined = new CraftAttributeInfo(); + + spined.ArmorPhysicalResist = 5; + spined.ArmorLuck = 40; + spined.RunicMinAttributes = 1; + spined.RunicMaxAttributes = 3; + if ( Core.ML ) + { + spined.RunicMinIntensity = 40; + spined.RunicMaxIntensity = 100; + } + else + { + spined.RunicMinIntensity = 20; + spined.RunicMaxIntensity = 40; + } + + CraftAttributeInfo horned = Horned = new CraftAttributeInfo(); + + horned.ArmorPhysicalResist = 2; + horned.ArmorFireResist = 3; + horned.ArmorColdResist = 2; + horned.ArmorPoisonResist = 2; + horned.ArmorEnergyResist = 2; + horned.RunicMinAttributes = 3; + horned.RunicMaxAttributes = 4; + if ( Core.ML ) + { + horned.RunicMinIntensity = 45; + horned.RunicMaxIntensity = 100; + } + else + { + horned.RunicMinIntensity = 30; + horned.RunicMaxIntensity = 70; + } + + CraftAttributeInfo barbed = Barbed = new CraftAttributeInfo(); + + barbed.ArmorPhysicalResist = 2; + barbed.ArmorFireResist = 1; + barbed.ArmorColdResist = 2; + barbed.ArmorPoisonResist = 3; + barbed.ArmorEnergyResist = 4; + barbed.RunicMinAttributes = 4; + barbed.RunicMaxAttributes = 5; + if ( Core.ML ) + { + barbed.RunicMinIntensity = 50; + barbed.RunicMaxIntensity = 100; + } + else + { + barbed.RunicMinIntensity = 40; + barbed.RunicMaxIntensity = 100; + } + + CraftAttributeInfo red = RedScales = new CraftAttributeInfo(); + + red.ArmorFireResist = 10; + red.ArmorColdResist = -3; + + CraftAttributeInfo yellow = YellowScales = new CraftAttributeInfo(); + + yellow.ArmorPhysicalResist = -3; + yellow.ArmorLuck = 20; + + CraftAttributeInfo black = BlackScales = new CraftAttributeInfo(); + + black.ArmorPhysicalResist = 10; + black.ArmorEnergyResist = -3; + + CraftAttributeInfo green = GreenScales = new CraftAttributeInfo(); + + green.ArmorFireResist = -3; + green.ArmorPoisonResist = 10; + + CraftAttributeInfo white = WhiteScales = new CraftAttributeInfo(); + + white.ArmorPhysicalResist = -3; + white.ArmorColdResist = 10; + + CraftAttributeInfo blue = BlueScales = new CraftAttributeInfo(); + + blue.ArmorPoisonResist = -3; + blue.ArmorEnergyResist = 10; + + //public static readonly CraftAttributeInfo OakWood, AshWood, YewWood, Heartwood, Bloodwood, Frostwood; + + CraftAttributeInfo oak = OakWood = new CraftAttributeInfo(); + + CraftAttributeInfo ash = AshWood = new CraftAttributeInfo(); + + CraftAttributeInfo yew = YewWood = new CraftAttributeInfo(); + + CraftAttributeInfo heart = Heartwood = new CraftAttributeInfo(); + + CraftAttributeInfo blood = Bloodwood = new CraftAttributeInfo(); + + CraftAttributeInfo frost = Frostwood = new CraftAttributeInfo(); + } + } + + public class CraftResourceInfo + { + public int Hue { get; } + + public int Number { get; } + + public string Name { get; } + + public CraftAttributeInfo AttributeInfo { get; } + + public CraftResource Resource { get; } + + public Type[] ResourceTypes { get; } + + public CraftResourceInfo( int hue, int number, string name, CraftAttributeInfo attributeInfo, CraftResource resource, params Type[] resourceTypes ) + { + Hue = hue; + Number = number; + Name = name; + AttributeInfo = attributeInfo; + Resource = resource; + ResourceTypes = resourceTypes; + + for ( int i = 0; i < resourceTypes.Length; ++i ) + CraftResources.RegisterType( resourceTypes[i], resource ); + } + } + + public class CraftResources + { + private static CraftResourceInfo[] m_MetalInfo = { + new CraftResourceInfo( 0x000, 1053109, "Iron", CraftAttributeInfo.Blank, CraftResource.Iron, typeof( IronIngot ), typeof( IronOre ), typeof( Granite ) ), + new CraftResourceInfo( 0x973, 1053108, "Dull Copper", CraftAttributeInfo.DullCopper, CraftResource.DullCopper, typeof( DullCopperIngot ), typeof( DullCopperOre ), typeof( DullCopperGranite ) ), + new CraftResourceInfo( 0x966, 1053107, "Shadow Iron", CraftAttributeInfo.ShadowIron, CraftResource.ShadowIron, typeof( ShadowIronIngot ), typeof( ShadowIronOre ), typeof( ShadowIronGranite ) ), + new CraftResourceInfo( 0x96D, 1053106, "Copper", CraftAttributeInfo.Copper, CraftResource.Copper, typeof( CopperIngot ), typeof( CopperOre ), typeof( CopperGranite ) ), + new CraftResourceInfo( 0x972, 1053105, "Bronze", CraftAttributeInfo.Bronze, CraftResource.Bronze, typeof( BronzeIngot ), typeof( BronzeOre ), typeof( BronzeGranite ) ), + new CraftResourceInfo( 0x8A5, 1053104, "Gold", CraftAttributeInfo.Golden, CraftResource.Gold, typeof( GoldIngot ), typeof( GoldOre ), typeof( GoldGranite ) ), + new CraftResourceInfo( 0x979, 1053103, "Agapite", CraftAttributeInfo.Agapite, CraftResource.Agapite, typeof( AgapiteIngot ), typeof( AgapiteOre ), typeof( AgapiteGranite ) ), + new CraftResourceInfo( 0x89F, 1053102, "Verite", CraftAttributeInfo.Verite, CraftResource.Verite, typeof( VeriteIngot ), typeof( VeriteOre ), typeof( VeriteGranite ) ), + new CraftResourceInfo( 0x8AB, 1053101, "Valorite", CraftAttributeInfo.Valorite, CraftResource.Valorite, typeof( ValoriteIngot ), typeof( ValoriteOre ), typeof( ValoriteGranite ) ) + }; + + private static CraftResourceInfo[] m_ScaleInfo = { + new CraftResourceInfo( 0x66D, 1053129, "Red Scales", CraftAttributeInfo.RedScales, CraftResource.RedScales, typeof( RedScales ) ), + new CraftResourceInfo( 0x8A8, 1053130, "Yellow Scales", CraftAttributeInfo.YellowScales, CraftResource.YellowScales, typeof( YellowScales ) ), + new CraftResourceInfo( 0x455, 1053131, "Black Scales", CraftAttributeInfo.BlackScales, CraftResource.BlackScales, typeof( BlackScales ) ), + new CraftResourceInfo( 0x851, 1053132, "Green Scales", CraftAttributeInfo.GreenScales, CraftResource.GreenScales, typeof( GreenScales ) ), + new CraftResourceInfo( 0x8FD, 1053133, "White Scales", CraftAttributeInfo.WhiteScales, CraftResource.WhiteScales, typeof( WhiteScales ) ), + new CraftResourceInfo( 0x8B0, 1053134, "Blue Scales", CraftAttributeInfo.BlueScales, CraftResource.BlueScales, typeof( BlueScales ) ) + }; + + private static CraftResourceInfo[] m_LeatherInfo = { + new CraftResourceInfo( 0x000, 1049353, "Normal", CraftAttributeInfo.Blank, CraftResource.RegularLeather, typeof( Leather ), typeof( Hides ) ), + new CraftResourceInfo( 0x283, 1049354, "Spined", CraftAttributeInfo.Spined, CraftResource.SpinedLeather, typeof( SpinedLeather ), typeof( SpinedHides ) ), + new CraftResourceInfo( 0x227, 1049355, "Horned", CraftAttributeInfo.Horned, CraftResource.HornedLeather, typeof( HornedLeather ), typeof( HornedHides ) ), + new CraftResourceInfo( 0x1C1, 1049356, "Barbed", CraftAttributeInfo.Barbed, CraftResource.BarbedLeather, typeof( BarbedLeather ), typeof( BarbedHides ) ) + }; + + private static CraftResourceInfo[] m_AOSLeatherInfo = { + new CraftResourceInfo( 0x000, 1049353, "Normal", CraftAttributeInfo.Blank, CraftResource.RegularLeather, typeof( Leather ), typeof( Hides ) ), + new CraftResourceInfo( 0x8AC, 1049354, "Spined", CraftAttributeInfo.Spined, CraftResource.SpinedLeather, typeof( SpinedLeather ), typeof( SpinedHides ) ), + new CraftResourceInfo( 0x845, 1049355, "Horned", CraftAttributeInfo.Horned, CraftResource.HornedLeather, typeof( HornedLeather ), typeof( HornedHides ) ), + new CraftResourceInfo( 0x851, 1049356, "Barbed", CraftAttributeInfo.Barbed, CraftResource.BarbedLeather, typeof( BarbedLeather ), typeof( BarbedHides ) ) + }; + + private static CraftResourceInfo[] m_WoodInfo = { + new CraftResourceInfo( 0x000, 1011542, "Normal", CraftAttributeInfo.Blank, CraftResource.RegularWood, typeof( Log ), typeof( Board ) ), + new CraftResourceInfo( 0x7DA, 1072533, "Oak", CraftAttributeInfo.OakWood, CraftResource.OakWood, typeof( OakLog ), typeof( OakBoard ) ), + new CraftResourceInfo( 0x4A7, 1072534, "Ash", CraftAttributeInfo.AshWood, CraftResource.AshWood, typeof( AshLog ), typeof( AshBoard ) ), + new CraftResourceInfo( 0x4A8, 1072535, "Yew", CraftAttributeInfo.YewWood, CraftResource.YewWood, typeof( YewLog ), typeof( YewBoard ) ), + new CraftResourceInfo( 0x4A9, 1072536, "Heartwood", CraftAttributeInfo.Heartwood, CraftResource.Heartwood, typeof( HeartwoodLog ), typeof( HeartwoodBoard ) ), + new CraftResourceInfo( 0x4AA, 1072538, "Bloodwood", CraftAttributeInfo.Bloodwood, CraftResource.Bloodwood, typeof( BloodwoodLog ), typeof( BloodwoodBoard ) ), + new CraftResourceInfo( 0x47F, 1072539, "Frostwood", CraftAttributeInfo.Frostwood, CraftResource.Frostwood, typeof( FrostwoodLog ), typeof( FrostwoodBoard ) ) + }; + + /// + /// Returns true if '' is None, Iron, RegularLeather or RegularWood. False if otherwise. + /// + public static bool IsStandard( CraftResource resource ) => ( resource == CraftResource.None || resource == CraftResource.Iron || resource == CraftResource.RegularLeather || resource == CraftResource.RegularWood ); + + private static Dictionary m_TypeTable; + + /// + /// Registers that '' uses '' so that it can later be queried by + /// + public static void RegisterType( Type resourceType, CraftResource resource ) + { + if ( m_TypeTable == null ) + m_TypeTable = new Dictionary(); + + m_TypeTable[resourceType] = resource; + } + + /// + /// Returns the value for which '' uses -or- CraftResource.None if an unregistered type was specified. + /// + public static CraftResource GetFromType( Type resourceType ) + { + if ( m_TypeTable == null ) + return CraftResource.None; + + return m_TypeTable.TryGetValue(resourceType, out CraftResource res) ? res : CraftResource.None; + } + + /// + /// Returns a instance describing '' -or- null if an invalid resource was specified. + /// + public static CraftResourceInfo GetInfo( CraftResource resource ) + { + CraftResourceInfo[] list = null; + + switch ( GetType( resource ) ) + { + case CraftResourceType.Metal: list = m_MetalInfo; break; + case CraftResourceType.Leather: list = Core.AOS ? m_AOSLeatherInfo : m_LeatherInfo; break; + case CraftResourceType.Scales: list = m_ScaleInfo; break; + case CraftResourceType.Wood: list = m_WoodInfo; break; + } + + if ( list != null ) + { + int index = GetIndex( resource ); + + if ( index >= 0 && index < list.Length ) + return list[index]; + } + + return null; + } + + /// + /// Returns a value indiciating the type of ''. + /// + public static CraftResourceType GetType( CraftResource resource ) + { + if ( resource >= CraftResource.Iron && resource <= CraftResource.Valorite ) + return CraftResourceType.Metal; + + if ( resource >= CraftResource.RegularLeather && resource <= CraftResource.BarbedLeather ) + return CraftResourceType.Leather; + + if ( resource >= CraftResource.RedScales && resource <= CraftResource.BlueScales ) + return CraftResourceType.Scales; + + if ( resource >= CraftResource.RegularWood && resource <= CraftResource.Frostwood ) + return CraftResourceType.Wood; + + return CraftResourceType.None; + } + + /// + /// Returns the first in the series of resources for which '' belongs. + /// + public static CraftResource GetStart( CraftResource resource ) + { + switch ( GetType( resource ) ) + { + case CraftResourceType.Metal: return CraftResource.Iron; + case CraftResourceType.Leather: return CraftResource.RegularLeather; + case CraftResourceType.Scales: return CraftResource.RedScales; + case CraftResourceType.Wood: return CraftResource.RegularWood; + } + + return CraftResource.None; + } + + /// + /// Returns the index of '' in the seriest of resources for which it belongs. + /// + public static int GetIndex( CraftResource resource ) + { + CraftResource start = GetStart( resource ); + + if ( start == CraftResource.None ) + return 0; + + return resource - start; + } + + /// + /// Returns the property of '' -or- 0 if an invalid resource was specified. + /// + public static int GetLocalizationNumber( CraftResource resource ) + { + CraftResourceInfo info = GetInfo( resource ); + + return info?.Number ?? 0; + } + + /// + /// Returns the property of '' -or- 0 if an invalid resource was specified. + /// + public static int GetHue( CraftResource resource ) + { + CraftResourceInfo info = GetInfo( resource ); + + return info?.Hue ?? 0; + } + + /// + /// Returns the property of '' -or- an empty string if the resource specified was invalid. + /// + public static string GetName( CraftResource resource ) + { + CraftResourceInfo info = GetInfo( resource ); + + return ( info == null ? string.Empty : info.Name ); + } + + /// + /// Returns the value which represents '' -or- CraftResource.None if unable to convert. + /// + public static CraftResource GetFromOreInfo( OreInfo info ) + { + if ( info.Name.IndexOf( "Spined" ) >= 0 ) + return CraftResource.SpinedLeather; + if ( info.Name.IndexOf( "Horned" ) >= 0 ) + return CraftResource.HornedLeather; + if ( info.Name.IndexOf( "Barbed" ) >= 0 ) + return CraftResource.BarbedLeather; + if ( info.Name.IndexOf( "Leather" ) >= 0 ) + return CraftResource.RegularLeather; + + if ( info.Level == 0 ) + return CraftResource.Iron; + if ( info.Level == 1 ) + return CraftResource.DullCopper; + if ( info.Level == 2 ) + return CraftResource.ShadowIron; + if ( info.Level == 3 ) + return CraftResource.Copper; + if ( info.Level == 4 ) + return CraftResource.Bronze; + if ( info.Level == 5 ) + return CraftResource.Gold; + if ( info.Level == 6 ) + return CraftResource.Agapite; + if ( info.Level == 7 ) + return CraftResource.Verite; + if ( info.Level == 8 ) + return CraftResource.Valorite; + + return CraftResource.None; + } + + /// + /// Returns the value which represents '', using '' to help resolve leather OreInfo instances. + /// + public static CraftResource GetFromOreInfo( OreInfo info, ArmorMaterialType material ) + { + if ( material == ArmorMaterialType.Studded || material == ArmorMaterialType.Leather || material == ArmorMaterialType.Spined || + material == ArmorMaterialType.Horned || material == ArmorMaterialType.Barbed ) + { + if ( info.Level == 0 ) + return CraftResource.RegularLeather; + if ( info.Level == 1 ) + return CraftResource.SpinedLeather; + if ( info.Level == 2 ) + return CraftResource.HornedLeather; + if ( info.Level == 3 ) + return CraftResource.BarbedLeather; + + return CraftResource.None; + } + + return GetFromOreInfo( info ); + } + } + + // NOTE: This class is only for compatability with very old RunUO versions. + // No changes to it should be required for custom resources. + public class OreInfo + { + public static readonly OreInfo Iron = new OreInfo( 0, 0x000, "Iron" ); + public static readonly OreInfo DullCopper = new OreInfo( 1, 0x973, "Dull Copper" ); + public static readonly OreInfo ShadowIron = new OreInfo( 2, 0x966, "Shadow Iron" ); + public static readonly OreInfo Copper = new OreInfo( 3, 0x96D, "Copper" ); + public static readonly OreInfo Bronze = new OreInfo( 4, 0x972, "Bronze" ); + public static readonly OreInfo Gold = new OreInfo( 5, 0x8A5, "Gold" ); + public static readonly OreInfo Agapite = new OreInfo( 6, 0x979, "Agapite" ); + public static readonly OreInfo Verite = new OreInfo( 7, 0x89F, "Verite" ); + public static readonly OreInfo Valorite = new OreInfo( 8, 0x8AB, "Valorite" ); + + public OreInfo( int level, int hue, string name ) + { + Level = level; + Hue = hue; + Name = name; + } + + public int Level { get; } + + public int Hue { get; } + + public string Name { get; } + } } diff --git a/Projects/Scripts/Misc/ShardPoller.cs b/Projects/Scripts/Misc/ShardPoller.cs index 51d724ed0..2e94a58c2 100644 --- a/Projects/Scripts/Misc/ShardPoller.cs +++ b/Projects/Scripts/Misc/ShardPoller.cs @@ -471,15 +471,9 @@ namespace Server.Misc m_Polls.Enqueue(poller); } - public string Center(string text) - { - return $"
{text}
"; - } + public string Center(string text) => $"
{text}
"; - public string Color(string text, int color) - { - return $"{text}"; - } + public string Color(string text, int color) => $"{text}"; public override void OnResponse(NetState sender, RelayInfo info) { diff --git a/Projects/Scripts/Misc/ShrinkTable.cs b/Projects/Scripts/Misc/ShrinkTable.cs index d78ad3cf5..731535b94 100644 --- a/Projects/Scripts/Misc/ShrinkTable.cs +++ b/Projects/Scripts/Misc/ShrinkTable.cs @@ -8,20 +8,11 @@ namespace Server private static int[] m_Table; - public static int Lookup(Mobile m) - { - return Lookup(m.Body.BodyID, DefaultItemID); - } + public static int Lookup(Mobile m) => Lookup(m.Body.BodyID, DefaultItemID); - public static int Lookup(int body) - { - return Lookup(body, DefaultItemID); - } + public static int Lookup(int body) => Lookup(body, DefaultItemID); - public static int Lookup(Mobile m, int defaultValue) - { - return Lookup(m.Body.BodyID, defaultValue); - } + public static int Lookup(Mobile m, int defaultValue) => Lookup(m.Body.BodyID, defaultValue); public static int Lookup(int body, int defaultValue) { @@ -51,35 +42,33 @@ namespace Server m_Table = new int[1000]; - using (StreamReader ip = new StreamReader(path)) + using StreamReader ip = new StreamReader(path); + string line; + + while ((line = ip.ReadLine()) != null) { - string line; + line = line.Trim(); - while ((line = ip.ReadLine()) != null) + if (line.Length == 0 || line.StartsWith("#")) + continue; + + try { - line = line.Trim(); + string[] split = line.Split('\t'); - if (line.Length == 0 || line.StartsWith("#")) - continue; - - try + if (split.Length >= 2) { - string[] split = line.Split('\t'); + int body = Utility.ToInt32(split[0]); + int item = Utility.ToInt32(split[1]); - if (split.Length >= 2) - { - int body = Utility.ToInt32(split[0]); - int item = Utility.ToInt32(split[1]); - - if (body >= 0 && body < m_Table.Length) - m_Table[body] = item; - } - } - catch - { - // ignored + if (body >= 0 && body < m_Table.Length) + m_Table[body] = item; } } + catch + { + // ignored + } } } } diff --git a/Projects/Scripts/Misc/TextDefinition.cs b/Projects/Scripts/Misc/TextDefinition.cs index 560b02e56..c3e1ab285 100644 --- a/Projects/Scripts/Misc/TextDefinition.cs +++ b/Projects/Scripts/Misc/TextDefinition.cs @@ -25,16 +25,11 @@ namespace Server public override string ToString() => Number > 0 ? $"#{Number}" : String ?? ""; - public string Format(bool propsGump) - { - return Number > 0 ? $"{Number} (0x{Number:X})" : - String != null ? $"\"{String}\"" : propsGump ? "-empty-" : "empty"; - } + public string Format(bool propsGump) => + Number > 0 ? $"{Number} (0x{Number:X})" : + String != null ? $"\"{String}\"" : propsGump ? "-empty-" : "empty"; - public string GetValue() - { - return Number > 0 ? Number.ToString() : String ?? ""; - } + public string GetValue() => Number > 0 ? Number.ToString() : String ?? ""; public static void Serialize(GenericWriter writer, TextDefinition def) { @@ -83,25 +78,13 @@ namespace Server list.Add(def.String); } - public static implicit operator TextDefinition(int v) - { - return new TextDefinition(v); - } + public static implicit operator TextDefinition(int v) => new TextDefinition(v); - public static implicit operator TextDefinition(string s) - { - return new TextDefinition(s); - } + public static implicit operator TextDefinition(string s) => new TextDefinition(s); - public static implicit operator int(TextDefinition m) - { - return m?.Number ?? 0; - } + public static implicit operator int(TextDefinition m) => m?.Number ?? 0; - public static implicit operator string(TextDefinition m) - { - return m?.String; - } + public static implicit operator string(TextDefinition m) => m?.String; public static void AddHtmlText(Gump g, int x, int y, int width, int height, TextDefinition def, bool back, bool scroll, int numberColor, int stringColor) @@ -180,9 +163,6 @@ namespace Server return isInteger ? new TextDefinition(i) : new TextDefinition(value); } - public static bool IsNullOrEmpty(TextDefinition def) - { - return def == null || def.IsEmpty; - } + public static bool IsNullOrEmpty(TextDefinition def) => def == null || def.IsEmpty; } } diff --git a/Projects/Scripts/Misc/Titles.cs b/Projects/Scripts/Misc/Titles.cs index c156ac6d1..40d2f03f9 100644 --- a/Projects/Scripts/Misc/Titles.cs +++ b/Projects/Scripts/Misc/Titles.cs @@ -357,10 +357,7 @@ namespace Server.Misc return highest; } - private static string GetSkillLevel(Skill skill) - { - return m_Levels[GetTableIndex(skill), GetTableType(skill)]; - } + private static string GetSkillLevel(Skill skill) => m_Levels[GetTableIndex(skill), GetTableType(skill)]; private static int GetTableType(Skill skill) { diff --git a/Projects/Scripts/Misc/TreasureMapProtection.cs b/Projects/Scripts/Misc/TreasureMapProtection.cs index 5007491f0..16f3951bc 100644 --- a/Projects/Scripts/Misc/TreasureMapProtection.cs +++ b/Projects/Scripts/Misc/TreasureMapProtection.cs @@ -22,43 +22,40 @@ namespace Server int i = 0, x = 0, y = 0; if (File.Exists(filePath)) - using (StreamReader ip = new StreamReader(filePath)) - { - string line; + { + using StreamReader ip = new StreamReader(filePath); + string line; - while ((line = ip.ReadLine()) != null) + while ((line = ip.ReadLine()) != null) + { + i++; + + try { - i++; + string[] split = line.Split(' '); + + x = Convert.ToInt32(split[0]); + y = Convert.ToInt32(split[1]); try { - string[] split = line.Split(' '); - - x = Convert.ToInt32(split[0]); - y = Convert.ToInt32(split[1]); - - try - { - new TreasureRegion(x, y, Map.Felucca); - new TreasureRegion(x, y, Map.Trammel); - } - catch (Exception e) - { - Console.WriteLine("{0} {1} {2} {3}", i, x, y, e); - } + new TreasureRegion(x, y, Map.Felucca); + new TreasureRegion(x, y, Map.Trammel); } - catch + catch (Exception e) { - Console.WriteLine("Warning: Error in Line '{0}' of Data/treasure.cfg", line); + Console.WriteLine("{0} {1} {2} {3}", i, x, y, e); } } + catch + { + Console.WriteLine("Warning: Error in Line '{0}' of Data/treasure.cfg", line); + } } + } } - public override bool AllowHousing(Mobile from, Point3D p) - { - return false; - } + public override bool AllowHousing(Mobile from, Point3D p) => false; public override void OnEnter(Mobile m) { diff --git a/Projects/Scripts/Misc/VendorGenerator.cs b/Projects/Scripts/Misc/VendorGenerator.cs index e3ad910f6..9c0c26a1c 100644 --- a/Projects/Scripts/Misc/VendorGenerator.cs +++ b/Projects/Scripts/Misc/VendorGenerator.cs @@ -106,18 +106,14 @@ namespace Server return itemID >= 0x406 && itemID <= 0x51A; } - private static bool IsStaticFloor(int itemID) - { - return itemID >= 0x495 && itemID <= 0x514 - || itemID >= 0x519 && itemID <= 0x53A; - } + private static bool IsStaticFloor(int itemID) => + itemID >= 0x495 && itemID <= 0x514 + || itemID >= 0x519 && itemID <= 0x53A; - private static bool IsDisplayCase(int itemID) - { - return itemID >= 0xB00 && itemID <= 0xB02 - || itemID >= 0xB06 && itemID <= 0xB0A - || itemID >= 0xB0D && itemID <= 0xB17; - } + private static bool IsDisplayCase(int itemID) => + itemID >= 0xB00 && itemID <= 0xB02 + || itemID >= 0xB06 && itemID <= 0xB0A + || itemID >= 0xB0D && itemID <= 0xB17; private static void Process(Map map, Rectangle2D[] regions) { @@ -258,31 +254,23 @@ namespace Server } } - private static bool IsClothes(int itemID) - { - return itemID >= 0x1515 && itemID <= 0x1518 || itemID >= 0x152E && itemID <= 0x1531 || itemID >= 0x1537 - && itemID <= 0x154C || itemID >= 0x1EFD && itemID <= 0x1F04 || itemID >= 0x170B && itemID <= 0x171C; - } + private static bool IsClothes(int itemID) => + itemID >= 0x1515 && itemID <= 0x1518 || itemID >= 0x152E && itemID <= 0x1531 || itemID >= 0x1537 + && itemID <= 0x154C || itemID >= 0x1EFD && itemID <= 0x1F04 || itemID >= 0x170B && itemID <= 0x171C; - private static bool IsArmor(int itemID) - { - return itemID >= 0x13BB && itemID <= 0x13E2 || itemID >= 0x13E5 && itemID <= 0x13F2 || - itemID >= 0x1408 && itemID <= 0x141A || itemID >= 0x144E && itemID <= 0x1457; - } + private static bool IsArmor(int itemID) => + itemID >= 0x13BB && itemID <= 0x13E2 || itemID >= 0x13E5 && itemID <= 0x13F2 || + itemID >= 0x1408 && itemID <= 0x141A || itemID >= 0x144E && itemID <= 0x1457; - private static bool IsMetalWeapon(int itemID) - { - return itemID >= 0xF43 && itemID <= 0xF4E || itemID >= 0xF51 && itemID <= 0xF52 || - itemID >= 0xF5C && itemID <= 0xF63 || itemID >= 0x13AF && itemID <= 0x13B0 || - itemID >= 0x13B5 && itemID <= 0x13BA || itemID >= 0x13FA && itemID <= 0x13FB || - itemID >= 0x13FE && itemID <= 0x1407 || itemID >= 0x1438 && itemID <= 0x1443; - } + private static bool IsMetalWeapon(int itemID) => + itemID >= 0xF43 && itemID <= 0xF4E || itemID >= 0xF51 && itemID <= 0xF52 || + itemID >= 0xF5C && itemID <= 0xF63 || itemID >= 0x13AF && itemID <= 0x13B0 || + itemID >= 0x13B5 && itemID <= 0x13BA || itemID >= 0x13FA && itemID <= 0x13FB || + itemID >= 0x13FE && itemID <= 0x1407 || itemID >= 0x1438 && itemID <= 0x1443; - private static bool IsArcheryWeapon(int itemID) - { - return itemID >= 0xF4F && itemID <= 0xF50 || itemID >= 0x13B1 && itemID <= 0x13B2 || - itemID >= 0x13FC && itemID <= 0x13FD; - } + private static bool IsArcheryWeapon(int itemID) => + itemID >= 0xF4F && itemID <= 0xF50 || itemID >= 0x13B1 && itemID <= 0x13B2 || + itemID >= 0x13FC && itemID <= 0x13FD; private static ShopFlags ProcessDisplayedItem(int itemID) { diff --git a/Projects/Scripts/Misc/Weather.cs b/Projects/Scripts/Misc/Weather.cs index 97f7e5e8a..b385591e4 100644 --- a/Projects/Scripts/Misc/Weather.cs +++ b/Projects/Scripts/Misc/Weather.cs @@ -5,353 +5,348 @@ using Server.Network; namespace Server.Misc { - public class Weather - { - private static Map[] m_Facets; - private static Dictionary> m_WeatherByFacet = new Dictionary>(); + public class Weather + { + private static Map[] m_Facets; + private static Dictionary> m_WeatherByFacet = new Dictionary>(); - public static void Initialize() - { - m_Facets = new[]{ Map.Felucca, Map.Trammel }; + public static void Initialize() + { + m_Facets = new[]{ Map.Felucca, Map.Trammel }; - /* Static weather: - * - * Format: - * AddWeather( temperature, chanceOfPercipitation, chanceOfExtremeTemperature, ); - */ + /* Static weather: + * + * Format: + * AddWeather( temperature, chanceOfPercipitation, chanceOfExtremeTemperature, ); + */ - // ice island - AddWeather( -15, 100, 5, new Rectangle2D( 3850, 160, 390, 320 ), new Rectangle2D( 3900, 480, 380, 180 ), new Rectangle2D( 4160, 660, 150, 110 ) ); + // ice island + AddWeather( -15, 100, 5, new Rectangle2D( 3850, 160, 390, 320 ), new Rectangle2D( 3900, 480, 380, 180 ), new Rectangle2D( 4160, 660, 150, 110 ) ); - // covetous entrance, around vesper and minoc - AddWeather( +15, 50, 5, new Rectangle2D( 2425, 725, 250, 250 ) ); + // covetous entrance, around vesper and minoc + AddWeather( +15, 50, 5, new Rectangle2D( 2425, 725, 250, 250 ) ); - // despise entrance, north of britain - AddWeather( +15, 50, 5, new Rectangle2D( 1245, 1045, 250, 250 ) ); + // despise entrance, north of britain + AddWeather( +15, 50, 5, new Rectangle2D( 1245, 1045, 250, 250 ) ); - /* Dynamic weather: - * - * Format: - * AddDynamicWeather( temperature, chanceOfPercipitation, chanceOfExtremeTemperature, moveSpeed, width, height, bounds ); - */ + /* Dynamic weather: + * + * Format: + * AddDynamicWeather( temperature, chanceOfPercipitation, chanceOfExtremeTemperature, moveSpeed, width, height, bounds ); + */ - for ( int i = 0; i < 15; ++i ) - AddDynamicWeather( +15, 100, 5, 8, 400, 400, new Rectangle2D( 0, 0, 5120, 4096 ) ); - } + for ( int i = 0; i < 15; ++i ) + AddDynamicWeather( +15, 100, 5, 8, 400, 400, new Rectangle2D( 0, 0, 5120, 4096 ) ); + } - public static List GetWeatherList( Map facet ) - { - if ( facet == null ) - return null; + public static List GetWeatherList( Map facet ) + { + if ( facet == null ) + return null; - if (!m_WeatherByFacet.TryGetValue( facet, out List list )) - m_WeatherByFacet[facet] = list = new List(); + if (!m_WeatherByFacet.TryGetValue( facet, out List list )) + m_WeatherByFacet[facet] = list = new List(); - return list; - } + return list; + } - public static void AddDynamicWeather( int temperature, int chanceOfPercipitation, int chanceOfExtremeTemperature, int moveSpeed, int width, int height, Rectangle2D bounds ) - { - for ( int i = 0; i < m_Facets.Length; ++i ) - { - Rectangle2D area = new Rectangle2D(); - bool isValid = false; + public static void AddDynamicWeather( int temperature, int chanceOfPercipitation, int chanceOfExtremeTemperature, int moveSpeed, int width, int height, Rectangle2D bounds ) + { + for ( int i = 0; i < m_Facets.Length; ++i ) + { + Rectangle2D area = new Rectangle2D(); + bool isValid = false; - for ( int j = 0; j < 10; ++j ) - { - area = new Rectangle2D( bounds.X + Utility.Random( bounds.Width - width ), bounds.Y + Utility.Random( bounds.Height - height ), width, height ); + for ( int j = 0; j < 10; ++j ) + { + area = new Rectangle2D( bounds.X + Utility.Random( bounds.Width - width ), bounds.Y + Utility.Random( bounds.Height - height ), width, height ); - if ( !CheckWeatherConflict( m_Facets[i], null, area ) ) - isValid = true; + if ( !CheckWeatherConflict( m_Facets[i], null, area ) ) + isValid = true; - if ( isValid ) - break; - } + if ( isValid ) + break; + } - if ( !isValid ) - continue; + if ( !isValid ) + continue; - new Weather(m_Facets[i], new[] { area }, temperature, chanceOfPercipitation, chanceOfExtremeTemperature, - TimeSpan.FromSeconds(30.0)) { Bounds = bounds, MoveSpeed = moveSpeed }; - } - } + new Weather(m_Facets[i], new[] { area }, temperature, chanceOfPercipitation, chanceOfExtremeTemperature, + TimeSpan.FromSeconds(30.0)) { Bounds = bounds, MoveSpeed = moveSpeed }; + } + } - public static void AddWeather( int temperature, int chanceOfPercipitation, int chanceOfExtremeTemperature, params Rectangle2D[] area ) - { - for ( int i = 0; i < m_Facets.Length; ++i ) - new Weather( m_Facets[i], area, temperature, chanceOfPercipitation, chanceOfExtremeTemperature, TimeSpan.FromSeconds( 30.0 ) ); - } + public static void AddWeather( int temperature, int chanceOfPercipitation, int chanceOfExtremeTemperature, params Rectangle2D[] area ) + { + for ( int i = 0; i < m_Facets.Length; ++i ) + new Weather( m_Facets[i], area, temperature, chanceOfPercipitation, chanceOfExtremeTemperature, TimeSpan.FromSeconds( 30.0 ) ); + } - public static bool CheckWeatherConflict( Map facet, Weather exclude, Rectangle2D area ) - { - List list = GetWeatherList( facet ); + public static bool CheckWeatherConflict( Map facet, Weather exclude, Rectangle2D area ) + { + List list = GetWeatherList( facet ); - if ( list == null ) - return false; + if ( list == null ) + return false; - for ( int i = 0; i < list.Count; ++i ) - { - Weather w = list[i]; + for ( int i = 0; i < list.Count; ++i ) + { + Weather w = list[i]; - if ( w != exclude && w.IntersectsWith( area ) ) - return true; - } + if ( w != exclude && w.IntersectsWith( area ) ) + return true; + } - return false; - } + return false; + } - public Map Facet { get; } + public Map Facet { get; } - public Rectangle2D[] Area { get; set; } + public Rectangle2D[] Area { get; set; } - public int Temperature { get; set; } + public int Temperature { get; set; } - public int ChanceOfPercipitation { get; set; } + public int ChanceOfPercipitation { get; set; } - public int ChanceOfExtremeTemperature { get; set; } + public int ChanceOfExtremeTemperature { get; set; } - // For dynamic weather: + // For dynamic weather: - public Rectangle2D Bounds { get; set; } + public Rectangle2D Bounds { get; set; } - public int MoveSpeed { get; set; } + public int MoveSpeed { get; set; } - public int MoveAngleX { get; set; } + public int MoveAngleX { get; set; } - public int MoveAngleY { get; set; } + public int MoveAngleY { get; set; } - public static bool CheckIntersection( Rectangle2D r1, Rectangle2D r2 ) - { - return r1.X < r2.X + r2.Width && r2.X < r1.X + r1.Width && r1.Y < r2.Y + r2.Height && r2.Y < r1.Y + r1.Height; - } + public static bool CheckIntersection( Rectangle2D r1, Rectangle2D r2 ) => r1.X < r2.X + r2.Width && r2.X < r1.X + r1.Width && r1.Y < r2.Y + r2.Height && r2.Y < r1.Y + r1.Height; - public static bool CheckContains( Rectangle2D big, Rectangle2D small ) - { - return small.X >= big.X && small.Y >= big.Y && small.X + small.Width <= big.X + big.Width - && small.Y + small.Height <= big.Y + big.Height; - } + public static bool CheckContains( Rectangle2D big, Rectangle2D small ) => + small.X >= big.X && small.Y >= big.Y && small.X + small.Width <= big.X + big.Width + && small.Y + small.Height <= big.Y + big.Height; - public virtual bool IntersectsWith( Rectangle2D area ) - { - for ( int i = 0; i < Area.Length; ++i ) - { - if ( CheckIntersection( area, Area[i] ) ) - return true; - } + public virtual bool IntersectsWith( Rectangle2D area ) + { + for ( int i = 0; i < Area.Length; ++i ) + { + if ( CheckIntersection( area, Area[i] ) ) + return true; + } - return false; - } + return false; + } - public Weather( Map facet, Rectangle2D[] area, int temperature, int chanceOfPercipitation, int chanceOfExtremeTemperature, TimeSpan interval ) - { - Facet = facet; - Area = area; - Temperature = temperature; - ChanceOfPercipitation = chanceOfPercipitation; - ChanceOfExtremeTemperature = chanceOfExtremeTemperature; + public Weather( Map facet, Rectangle2D[] area, int temperature, int chanceOfPercipitation, int chanceOfExtremeTemperature, TimeSpan interval ) + { + Facet = facet; + Area = area; + Temperature = temperature; + ChanceOfPercipitation = chanceOfPercipitation; + ChanceOfExtremeTemperature = chanceOfExtremeTemperature; - List list = GetWeatherList( facet ); + List list = GetWeatherList( facet ); - list?.Add( this ); + list?.Add( this ); - Timer.DelayCall( TimeSpan.FromSeconds( (0.2+Utility.RandomDouble()*0.8) * interval.TotalSeconds ), interval, OnTick ); - } + Timer.DelayCall( TimeSpan.FromSeconds( (0.2+Utility.RandomDouble()*0.8) * interval.TotalSeconds ), interval, OnTick ); + } - public virtual void Reposition() - { - if ( Area.Length == 0 ) - return; + public virtual void Reposition() + { + if ( Area.Length == 0 ) + return; - int width = Area[0].Width; - int height = Area[0].Height; + int width = Area[0].Width; + int height = Area[0].Height; - Rectangle2D area = new Rectangle2D(); - bool isValid = false; + Rectangle2D area = new Rectangle2D(); + bool isValid = false; - for ( int j = 0; j < 10; ++j ) - { - area = new Rectangle2D( Bounds.X + Utility.Random( Bounds.Width - width ), Bounds.Y + Utility.Random( Bounds.Height - height ), width, height ); + for ( int j = 0; j < 10; ++j ) + { + area = new Rectangle2D( Bounds.X + Utility.Random( Bounds.Width - width ), Bounds.Y + Utility.Random( Bounds.Height - height ), width, height ); - if ( !CheckWeatherConflict( Facet, this, area ) ) - isValid = true; + if ( !CheckWeatherConflict( Facet, this, area ) ) + isValid = true; - if ( isValid ) - break; - } + if ( isValid ) + break; + } - if ( !isValid ) - return; + if ( !isValid ) + return; - Area[0] = area; - } + Area[0] = area; + } - public virtual void RecalculateMovementAngle() - { - double angle = Utility.RandomDouble() * Math.PI * 2.0; + public virtual void RecalculateMovementAngle() + { + double angle = Utility.RandomDouble() * Math.PI * 2.0; - double cos = Math.Cos( angle ); - double sin = Math.Sin( angle ); + double cos = Math.Cos( angle ); + double sin = Math.Sin( angle ); - MoveAngleX = (int)(100 * cos); - MoveAngleY = (int)(100 * sin); - } + MoveAngleX = (int)(100 * cos); + MoveAngleY = (int)(100 * sin); + } - public virtual void MoveForward() - { - if ( Area.Length == 0 ) - return; + public virtual void MoveForward() + { + if ( Area.Length == 0 ) + return; - for ( int i = 0; i < 5; ++i ) // try 5 times to find a valid spot - { - int xOffset = MoveSpeed * MoveAngleX / 100; - int yOffset = MoveSpeed * MoveAngleY / 100; + for ( int i = 0; i < 5; ++i ) // try 5 times to find a valid spot + { + int xOffset = MoveSpeed * MoveAngleX / 100; + int yOffset = MoveSpeed * MoveAngleY / 100; - Rectangle2D oldArea = Area[0]; - Rectangle2D newArea = new Rectangle2D( oldArea.X + xOffset, oldArea.Y + yOffset, oldArea.Width, oldArea.Height ); + Rectangle2D oldArea = Area[0]; + Rectangle2D newArea = new Rectangle2D( oldArea.X + xOffset, oldArea.Y + yOffset, oldArea.Width, oldArea.Height ); - if ( !CheckWeatherConflict( Facet, this, newArea ) && CheckContains( Bounds, newArea ) ) - { - Area[0] = newArea; - break; - } - - RecalculateMovementAngle(); - } - } - - private int m_Stage; - private bool m_Active; - private bool m_ExtremeTemperature; - - public virtual void OnTick() - { - if ( m_Stage == 0 ) - { - m_Active = ChanceOfPercipitation > Utility.Random( 100 ); - m_ExtremeTemperature = ChanceOfExtremeTemperature > Utility.Random( 100 ); + if ( !CheckWeatherConflict( Facet, this, newArea ) && CheckContains( Bounds, newArea ) ) + { + Area[0] = newArea; + break; + } - if ( MoveSpeed > 0 ) - { - Reposition(); - RecalculateMovementAngle(); - } - } + RecalculateMovementAngle(); + } + } - if ( m_Active ) - { - if ( m_Stage > 0 && MoveSpeed > 0 ) - MoveForward(); + private int m_Stage; + private bool m_Active; + private bool m_ExtremeTemperature; - int type, density; - int temperature = Temperature; + public virtual void OnTick() + { + if ( m_Stage == 0 ) + { + m_Active = ChanceOfPercipitation > Utility.Random( 100 ); + m_ExtremeTemperature = ChanceOfExtremeTemperature > Utility.Random( 100 ); - if ( m_ExtremeTemperature ) - temperature *= -1; + if ( MoveSpeed > 0 ) + { + Reposition(); + RecalculateMovementAngle(); + } + } - if ( m_Stage < 15 ) - { - density = m_Stage * 5; - } - else - { - density = 150 - m_Stage * 5; + if ( m_Active ) + { + if ( m_Stage > 0 && MoveSpeed > 0 ) + MoveForward(); - if ( density < 10 ) - density = 10; - else if ( density > 70 ) - density = 70; - } + int type, density; + int temperature = Temperature; - if ( density == 0 ) - type = 0xFE; - else if ( temperature > 0 ) - type = 0; - else - type = 2; + if ( m_ExtremeTemperature ) + temperature *= -1; - List states = NetState.Instances; + if ( m_Stage < 15 ) + { + density = m_Stage * 5; + } + else + { + density = 150 - m_Stage * 5; - Packet weatherPacket = null; + if ( density < 10 ) + density = 10; + else if ( density > 70 ) + density = 70; + } - for ( int i = 0; i < states.Count; ++i ) - { - NetState ns = states[i]; - Mobile mob = ns.Mobile; + if ( density == 0 ) + type = 0xFE; + else if ( temperature > 0 ) + type = 0; + else + type = 2; - if ( mob == null || mob.Map != Facet ) - continue; + List states = NetState.Instances; - bool contains = Area.Length == 0; + Packet weatherPacket = null; - for ( int j = 0; !contains && j < Area.Length; ++j ) - contains = Area[j].Contains( mob.Location ); - - if ( !contains ) - continue; + for ( int i = 0; i < states.Count; ++i ) + { + NetState ns = states[i]; + Mobile mob = ns.Mobile; - if ( weatherPacket == null ) - weatherPacket = Packet.Acquire( new Server.Network.Weather( type, density, temperature ) ); + if ( mob == null || mob.Map != Facet ) + continue; - ns.Send( weatherPacket ); - } + bool contains = Area.Length == 0; - Packet.Release( weatherPacket ); - } - - m_Stage++; - m_Stage %= 30; - } - } + for ( int j = 0; !contains && j < Area.Length; ++j ) + contains = Area[j].Contains( mob.Location ); + + if ( !contains ) + continue; - public class WeatherMap : MapItem - { - public override string DefaultName => "weather map"; + if ( weatherPacket == null ) + weatherPacket = Packet.Acquire( new Server.Network.Weather( type, density, temperature ) ); - [Constructible] - public WeatherMap() - { - SetDisplay( 0, 0, 5119, 4095, 400, 400 ); - } + ns.Send( weatherPacket ); + } - public override void OnDoubleClick( Mobile from ) - { - Map facet = from.Map; + Packet.Release( weatherPacket ); + } + + m_Stage++; + m_Stage %= 30; + } + } - if ( facet == null ) - return; + public class WeatherMap : MapItem + { + public override string DefaultName => "weather map"; - List list = Weather.GetWeatherList( facet ); + [Constructible] + public WeatherMap() + { + SetDisplay( 0, 0, 5119, 4095, 400, 400 ); + } - ClearPins(); + public override void OnDoubleClick( Mobile from ) + { + Map facet = from.Map; - for ( int i = 0; i < list.Count; ++i ) - { - Weather w = list[i]; + if ( facet == null ) + return; - for ( int j = 0; j < w.Area.Length; ++j ) - AddWorldPin( w.Area[j].X + w.Area[j].Width/2, w.Area[j].Y + w.Area[j].Height/2 ); - } + List list = Weather.GetWeatherList( facet ); - base.OnDoubleClick( from ); - } + ClearPins(); - public WeatherMap( Serial serial ) : base( serial ) - { - } + for ( int i = 0; i < list.Count; ++i ) + { + Weather w = list[i]; - public override void Serialize( GenericWriter writer ) - { - base.Serialize( writer ); + for ( int j = 0; j < w.Area.Length; ++j ) + AddWorldPin( w.Area[j].X + w.Area[j].Width/2, w.Area[j].Y + w.Area[j].Height/2 ); + } - writer.Write( 0 ); - } + base.OnDoubleClick( from ); + } - public override void Deserialize( GenericReader reader ) - { - base.Deserialize( reader ); + public WeatherMap( Serial serial ) : base( serial ) + { + } - int version = reader.ReadInt(); - } - } + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.Write( 0 ); + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + int version = reader.ReadInt(); + } + } } diff --git a/Projects/Scripts/Misc/WebStatus.cs b/Projects/Scripts/Misc/WebStatus.cs index 8bc920bec..59d403446 100644 --- a/Projects/Scripts/Misc/WebStatus.cs +++ b/Projects/Scripts/Misc/WebStatus.cs @@ -24,10 +24,8 @@ namespace Server.Misc private static readonly object _StatusLock = new object(); public StatusPage() - : base(TimeSpan.FromSeconds(5.0), TimeSpan.FromSeconds(60.0)) - { + : base(TimeSpan.FromSeconds(5.0), TimeSpan.FromSeconds(60.0)) => Priority = TimerPriority.FiveSeconds; - } public static void Initialize() { diff --git a/Projects/Scripts/Misc/WeightOverloading.cs b/Projects/Scripts/Misc/WeightOverloading.cs index bbb9a3d68..27704df0a 100644 --- a/Projects/Scripts/Misc/WeightOverloading.cs +++ b/Projects/Scripts/Misc/WeightOverloading.cs @@ -43,13 +43,7 @@ namespace Server.Misc m.Stam -= (int)fatigue; } - public static int GetMaxWeight(Mobile m) - { - //return ((( Core.ML && m.Race == Race.Human) ? 100 : 40 ) + (int)(3.5 * m.Str)); - //Moved to core virtual method for use there - - return m.MaxWeight; - } + public static int GetMaxWeight(Mobile m) => m.MaxWeight; public static void EventSink_Movement(MovementEventArgs e) { diff --git a/Projects/Scripts/Mobiles/AI/AnimalAI.cs b/Projects/Scripts/Mobiles/AI/AnimalAI.cs index c9ebc1260..9cc4585ea 100644 --- a/Projects/Scripts/Mobiles/AI/AnimalAI.cs +++ b/Projects/Scripts/Mobiles/AI/AnimalAI.cs @@ -17,26 +17,6 @@ namespace Server.Mobiles public override bool DoActionWander() { - // Old: -#if false - if (AcquireFocusMob(m_Mobile.RangePerception, m_Mobile.FightMode, true, false, true)) - { - m_Mobile.DebugSay( "There is something near, I go away" ); - Action = ActionType.Backoff; - } - else if ( m_Mobile.IsHurt() || m_Mobile.Combatant != null ) - { - m_Mobile.DebugSay( "I am hurt or being attacked, I flee" ); - Action = ActionType.Flee; - } - else - { - base.DoActionWander(); - } - - return true; -#endif - // New, only flee @ 10% double hitPercent = (double)m_Mobile.Hits / m_Mobile.HitsMax; diff --git a/Projects/Scripts/Mobiles/AI/BaseAI.cs b/Projects/Scripts/Mobiles/AI/BaseAI.cs index 562653f29..5312434a6 100644 --- a/Projects/Scripts/Mobiles/AI/BaseAI.cs +++ b/Projects/Scripts/Mobiles/AI/BaseAI.cs @@ -789,10 +789,7 @@ namespace Server.Mobiles } } - public virtual bool OnAtWayPoint() - { - return true; - } + public virtual bool OnAtWayPoint() => true; public virtual bool DoActionWander() { @@ -901,15 +898,9 @@ namespace Server.Mobiles return true; } - public virtual bool DoActionInteract() - { - return true; - } + public virtual bool DoActionInteract() => true; - public virtual bool DoActionBackoff() - { - return true; - } + public virtual bool DoActionBackoff() => true; public virtual bool Obey() { @@ -1785,15 +1776,9 @@ namespace Server.Mobiles return delay; } - public virtual bool CheckMove() - { - return Core.TickCount - NextMove >= 0; - } + public virtual bool CheckMove() => Core.TickCount - NextMove >= 0; - public virtual bool DoMove(Direction d) - { - return DoMove(d, false); - } + public virtual bool DoMove(Direction d) => DoMove(d, false); public virtual bool DoMove(Direction d, bool badStateOk) { @@ -2561,10 +2546,7 @@ namespace Server.Mobiles { } - public static bool IsInCombat(BaseCreature creature) - { - return creature != null && (creature.Aggressors.Count > 0 || creature.Aggressed.Count > 0); - } + public static bool IsInCombat(BaseCreature creature) => creature != null && (creature.Aggressors.Count > 0 || creature.Aggressed.Count > 0); public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/AI/HealerAI.cs b/Projects/Scripts/Mobiles/AI/HealerAI.cs index b0ec783e4..f5fe4f341 100644 --- a/Projects/Scripts/Mobiles/AI/HealerAI.cs +++ b/Projects/Scripts/Mobiles/AI/HealerAI.cs @@ -137,20 +137,11 @@ namespace Server.Mobiles return null; } - private static bool NeedCure(Mobile m) - { - return m.Poisoned; - } + private static bool NeedCure(Mobile m) => m.Poisoned; - private static bool NeedGHeal(Mobile m) - { - return m.Hits < m.HitsMax - 40; - } + private static bool NeedGHeal(Mobile m) => m.Hits < m.HitsMax - 40; - private static bool NeedLHeal(Mobile m) - { - return m.Hits < m.HitsMax - 10; - } + private static bool NeedLHeal(Mobile m) => m.Hits < m.HitsMax - 10; private delegate bool NeedDelegate(Mobile m); } diff --git a/Projects/Scripts/Mobiles/AI/MageAI.cs b/Projects/Scripts/Mobiles/AI/MageAI.cs index 6d8a3f138..f3ed0413b 100644 --- a/Projects/Scripts/Mobiles/AI/MageAI.cs +++ b/Projects/Scripts/Mobiles/AI/MageAI.cs @@ -76,10 +76,7 @@ namespace Server.Mobiles return base.Think(); } - public virtual double ScaleBySkill(double v, SkillName skill) - { - return v * m_Mobile.Skills[skill].Value / 100; - } + public virtual double ScaleBySkill(double v, SkillName skill) => v * m_Mobile.Skills[skill].Value / 100; public override bool DoActionWander() { @@ -252,10 +249,7 @@ namespace Server.Mobiles return false; } - public virtual Spell GetRandomDamageSpell() - { - return UseNecromancy() ? GetRandomDamageSpellNecro() : GetRandomDamageSpellMage(); - } + public virtual Spell GetRandomDamageSpell() => UseNecromancy() ? GetRandomDamageSpellNecro() : GetRandomDamageSpellMage(); public virtual Spell GetRandomDamageSpellNecro() { @@ -308,10 +302,7 @@ namespace Server.Mobiles } } - public virtual Spell GetRandomCurseSpell() - { - return UseNecromancy() ? GetRandomCurseSpellNecro() : GetRandomCurseSpellMage(); - } + public virtual Spell GetRandomCurseSpell() => UseNecromancy() ? GetRandomCurseSpellNecro() : GetRandomCurseSpellMage(); public virtual Spell GetRandomCurseSpellNecro() { @@ -947,11 +938,9 @@ namespace Server.Mobiles return null; } - public bool CanDispel(Mobile m) - { - return m is BaseCreature creature && creature.Summoned && m_Mobile.CanBeHarmful(creature, false) && - !creature.IsAnimatedDead; - } + public bool CanDispel(Mobile m) => + m is BaseCreature creature && creature.Summoned && m_Mobile.CanBeHarmful(creature, false) && + !creature.IsAnimatedDead; private bool ProcessTarget() { diff --git a/Projects/Scripts/Mobiles/AI/OppositionGroup.cs b/Projects/Scripts/Mobiles/AI/OppositionGroup.cs index dfc7e1180..a3828733d 100644 --- a/Projects/Scripts/Mobiles/AI/OppositionGroup.cs +++ b/Projects/Scripts/Mobiles/AI/OppositionGroup.cs @@ -7,10 +7,7 @@ namespace Server { private Type[][] m_Types; - public OppositionGroup(Type[][] types) - { - m_Types = types; - } + public OppositionGroup(Type[][] types) => m_Types = types; public static OppositionGroup TerathansAndOphidians{ get; } = new OppositionGroup(new[] { diff --git a/Projects/Scripts/Mobiles/Animals/Birds/Crane.cs b/Projects/Scripts/Mobiles/Animals/Birds/Crane.cs index ad85aba59..5a708a899 100644 --- a/Projects/Scripts/Mobiles/Animals/Birds/Crane.cs +++ b/Projects/Scripts/Mobiles/Animals/Birds/Crane.cs @@ -42,30 +42,15 @@ namespace Server.Mobiles public override int Feathers => 25; - public override int GetAngerSound() - { - return 0x4D9; - } + public override int GetAngerSound() => 0x4D9; - public override int GetIdleSound() - { - return 0x4D8; - } + public override int GetIdleSound() => 0x4D8; - public override int GetAttackSound() - { - return 0x4D7; - } + public override int GetAttackSound() => 0x4D7; - public override int GetHurtSound() - { - return 0x4DA; - } + public override int GetHurtSound() => 0x4DA; - public override int GetDeathSound() - { - return 0x4D6; - } + public override int GetDeathSound() => 0x4D6; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Animals/Misc/Gaman.cs b/Projects/Scripts/Mobiles/Animals/Misc/Gaman.cs index c2e761e92..0905cff2c 100644 --- a/Projects/Scripts/Mobiles/Animals/Misc/Gaman.cs +++ b/Projects/Scripts/Mobiles/Animals/Misc/Gaman.cs @@ -49,30 +49,15 @@ namespace Server.Mobiles public override int Hides => 15; public override FoodType FavoriteFood => FoodType.GrainsAndHay; - public override int GetAngerSound() - { - return 0x4F8; - } + public override int GetAngerSound() => 0x4F8; - public override int GetIdleSound() - { - return 0x4F7; - } + public override int GetIdleSound() => 0x4F7; - public override int GetAttackSound() - { - return 0x4F6; - } + public override int GetAttackSound() => 0x4F6; - public override int GetHurtSound() - { - return 0x4F9; - } + public override int GetHurtSound() => 0x4F9; - public override int GetDeathSound() - { - return 0x4F5; - } + public override int GetDeathSound() => 0x4F5; public override void OnDeath(Container c) { diff --git a/Projects/Scripts/Mobiles/Animals/Misc/GreatHart.cs b/Projects/Scripts/Mobiles/Animals/Misc/GreatHart.cs index a7756ffd0..a1e53fdd0 100644 --- a/Projects/Scripts/Mobiles/Animals/Misc/GreatHart.cs +++ b/Projects/Scripts/Mobiles/Animals/Misc/GreatHart.cs @@ -47,20 +47,11 @@ namespace Server.Mobiles public override int Hides => 15; public override FoodType FavoriteFood => FoodType.FruitsAndVegies | FoodType.GrainsAndHay; - public override int GetAttackSound() - { - return 0x82; - } + public override int GetAttackSound() => 0x82; - public override int GetHurtSound() - { - return 0x83; - } + public override int GetHurtSound() => 0x83; - public override int GetDeathSound() - { - return 0x84; - } + public override int GetDeathSound() => 0x84; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Animals/Misc/Hind.cs b/Projects/Scripts/Mobiles/Animals/Misc/Hind.cs index 55a604cc4..c91d10138 100644 --- a/Projects/Scripts/Mobiles/Animals/Misc/Hind.cs +++ b/Projects/Scripts/Mobiles/Animals/Misc/Hind.cs @@ -46,20 +46,11 @@ namespace Server.Mobiles public override int Hides => 8; public override FoodType FavoriteFood => FoodType.FruitsAndVegies | FoodType.GrainsAndHay; - public override int GetAttackSound() - { - return 0x82; - } + public override int GetAttackSound() => 0x82; - public override int GetHurtSound() - { - return 0x83; - } + public override int GetHurtSound() => 0x83; - public override int GetDeathSound() - { - return 0x84; - } + public override int GetDeathSound() => 0x84; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Animals/Misc/PackHorse.cs b/Projects/Scripts/Mobiles/Animals/Misc/PackHorse.cs index e6d7c0f12..bbdd27994 100644 --- a/Projects/Scripts/Mobiles/Animals/Misc/PackHorse.cs +++ b/Projects/Scripts/Mobiles/Animals/Misc/PackHorse.cs @@ -90,10 +90,7 @@ namespace Server.Mobiles return true; } - public override DeathMoveResult GetInventoryMoveResultFor(Item item) - { - return DeathMoveResult.MoveToCorpse; - } + public override DeathMoveResult GetInventoryMoveResultFor(Item item) => DeathMoveResult.MoveToCorpse; public override bool IsSnoop(Mobile from) { @@ -117,15 +114,9 @@ namespace Server.Mobiles return base.OnDragDrop(from, item); } - public override bool CheckNonlocalDrop(Mobile from, Item item, Item target) - { - return PackAnimal.CheckAccess(this, from); - } + public override bool CheckNonlocalDrop(Mobile from, Item item, Item target) => PackAnimal.CheckAccess(this, from); - public override bool CheckNonlocalLift(Mobile from, Item item) - { - return PackAnimal.CheckAccess(this, from); - } + public override bool CheckNonlocalLift(Mobile from, Item item) => PackAnimal.CheckAccess(this, from); public override void OnDoubleClick(Mobile from) { diff --git a/Projects/Scripts/Mobiles/Animals/Misc/PackLlama.cs b/Projects/Scripts/Mobiles/Animals/Misc/PackLlama.cs index 8239aedc4..04d0d36f0 100644 --- a/Projects/Scripts/Mobiles/Animals/Misc/PackLlama.cs +++ b/Projects/Scripts/Mobiles/Animals/Misc/PackLlama.cs @@ -89,10 +89,7 @@ namespace Server.Mobiles return true; } - public override DeathMoveResult GetInventoryMoveResultFor(Item item) - { - return DeathMoveResult.MoveToCorpse; - } + public override DeathMoveResult GetInventoryMoveResultFor(Item item) => DeathMoveResult.MoveToCorpse; public override bool IsSnoop(Mobile from) { @@ -116,15 +113,9 @@ namespace Server.Mobiles return base.OnDragDrop(from, item); } - public override bool CheckNonlocalDrop(Mobile from, Item item, Item target) - { - return PackAnimal.CheckAccess(this, from); - } + public override bool CheckNonlocalDrop(Mobile from, Item item, Item target) => PackAnimal.CheckAccess(this, from); - public override bool CheckNonlocalLift(Mobile from, Item item) - { - return PackAnimal.CheckAccess(this, from); - } + public override bool CheckNonlocalLift(Mobile from, Item item) => PackAnimal.CheckAccess(this, from); public override void OnDoubleClick(Mobile from) { diff --git a/Projects/Scripts/Mobiles/Animals/Mounts/BaseMount.cs b/Projects/Scripts/Mobiles/Animals/Mounts/BaseMount.cs index f307189a3..dd14c6876 100644 --- a/Projects/Scripts/Mobiles/Animals/Mounts/BaseMount.cs +++ b/Projects/Scripts/Mobiles/Animals/Mounts/BaseMount.cs @@ -277,10 +277,7 @@ namespace Server.Mobiles return result; } - public virtual bool DoMountAbility(int damage, Mobile attacker) - { - return false; - } + public virtual bool DoMountAbility(int damage, Mobile attacker) => false; } public class MountItem : Item, IMountItem diff --git a/Projects/Scripts/Mobiles/Animals/Mounts/Beetle.cs b/Projects/Scripts/Mobiles/Animals/Mounts/Beetle.cs index c1313c59c..f45dc6ea5 100644 --- a/Projects/Scripts/Mobiles/Animals/Mounts/Beetle.cs +++ b/Projects/Scripts/Mobiles/Animals/Mounts/Beetle.cs @@ -59,30 +59,15 @@ namespace Server.Mobiles public override FoodType FavoriteFood => FoodType.Meat; - public override int GetAngerSound() - { - return 0x21D; - } + public override int GetAngerSound() => 0x21D; - public override int GetIdleSound() - { - return 0x21D; - } + public override int GetIdleSound() => 0x21D; - public override int GetAttackSound() - { - return 0x162; - } + public override int GetAttackSound() => 0x162; - public override int GetHurtSound() - { - return 0x163; - } + public override int GetHurtSound() => 0x163; - public override int GetDeathSound() - { - return 0x21D; - } + public override int GetDeathSound() => 0x21D; public override void OnHarmfulSpell(Mobile from) { @@ -122,10 +107,7 @@ namespace Server.Mobiles return true; } - public override DeathMoveResult GetInventoryMoveResultFor(Item item) - { - return DeathMoveResult.MoveToCorpse; - } + public override DeathMoveResult GetInventoryMoveResultFor(Item item) => DeathMoveResult.MoveToCorpse; public override bool IsSnoop(Mobile from) { @@ -149,15 +131,9 @@ namespace Server.Mobiles return base.OnDragDrop(from, item); } - public override bool CheckNonlocalDrop(Mobile from, Item item, Item target) - { - return PackAnimal.CheckAccess(this, from); - } + public override bool CheckNonlocalDrop(Mobile from, Item item, Item target) => PackAnimal.CheckAccess(this, from); - public override bool CheckNonlocalLift(Mobile from, Item item) - { - return PackAnimal.CheckAccess(this, from); - } + public override bool CheckNonlocalLift(Mobile from, Item item) => PackAnimal.CheckAccess(this, from); public override void GetContextMenuEntries(Mobile from, List list) { diff --git a/Projects/Scripts/Mobiles/Animals/Mounts/Ethereals.cs b/Projects/Scripts/Mobiles/Animals/Mounts/Ethereals.cs index b5bbed780..b2e2a7995 100644 --- a/Projects/Scripts/Mobiles/Animals/Mounts/Ethereals.cs +++ b/Projects/Scripts/Mobiles/Animals/Mounts/Ethereals.cs @@ -350,25 +350,13 @@ namespace Server.Mobiles m_Mount.IsDonationItem && RewardSystem.GetRewardLevel(m_Rider) < 3 ? 7.5 + (Core.AOS ? 3.0 : 2.0) : Core.AOS ? 3.0 : 2.0); - public override TimeSpan GetCastRecovery() - { - return TimeSpan.Zero; - } + public override TimeSpan GetCastRecovery() => TimeSpan.Zero; - public override int GetMana() - { - return 0; - } + public override int GetMana() => 0; - public override bool ConsumeReagents() - { - return true; - } + public override bool ConsumeReagents() => true; - public override bool CheckFizzle() - { - return true; - } + public override bool CheckFizzle() => true; public void Stop() { diff --git a/Projects/Scripts/Mobiles/Animals/Mounts/Hiryu.cs b/Projects/Scripts/Mobiles/Animals/Mounts/Hiryu.cs index 00d484fb2..f51c9df07 100644 --- a/Projects/Scripts/Mobiles/Animals/Mounts/Hiryu.cs +++ b/Projects/Scripts/Mobiles/Animals/Mounts/Hiryu.cs @@ -67,10 +67,7 @@ namespace Server.Mobiles public override FoodType FavoriteFood => FoodType.Meat; public override bool CanAngerOnTame => true; - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.Dismount; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.Dismount; private static int GetHue() { @@ -131,30 +128,15 @@ namespace Server.Mobiles } - public override int GetAngerSound() - { - return 0x4FE; - } + public override int GetAngerSound() => 0x4FE; - public override int GetIdleSound() - { - return 0x4FD; - } + public override int GetIdleSound() => 0x4FD; - public override int GetAttackSound() - { - return 0x4FC; - } + public override int GetAttackSound() => 0x4FC; - public override int GetHurtSound() - { - return 0x4FF; - } + public override int GetHurtSound() => 0x4FF; - public override int GetDeathSound() - { - return 0x4FB; - } + public override int GetDeathSound() => 0x4FB; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Animals/Mounts/LesserHiryu.cs b/Projects/Scripts/Mobiles/Animals/Mounts/LesserHiryu.cs index 42d015590..4411e4726 100644 --- a/Projects/Scripts/Mobiles/Animals/Mounts/LesserHiryu.cs +++ b/Projects/Scripts/Mobiles/Animals/Mounts/LesserHiryu.cs @@ -64,10 +64,7 @@ namespace Server.Mobiles public override FoodType FavoriteFood => FoodType.Meat; public override bool CanAngerOnTame => true; - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.Dismount; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.Dismount; private static int GetHue() { @@ -107,30 +104,15 @@ namespace Server.Mobiles return false; } - public override int GetAngerSound() - { - return 0x4FE; - } + public override int GetAngerSound() => 0x4FE; - public override int GetIdleSound() - { - return 0x4FD; - } + public override int GetIdleSound() => 0x4FD; - public override int GetAttackSound() - { - return 0x4FC; - } + public override int GetAttackSound() => 0x4FC; - public override int GetHurtSound() - { - return 0x4FF; - } + public override int GetHurtSound() => 0x4FF; - public override int GetDeathSound() - { - return 0x4FB; - } + public override int GetDeathSound() => 0x4FB; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Animals/Mounts/Ridgeback.cs b/Projects/Scripts/Mobiles/Animals/Mounts/Ridgeback.cs index 7827fcfe4..4d8880b63 100644 --- a/Projects/Scripts/Mobiles/Animals/Mounts/Ridgeback.cs +++ b/Projects/Scripts/Mobiles/Animals/Mounts/Ridgeback.cs @@ -48,15 +48,9 @@ namespace Server.Mobiles public override HideType HideType => HideType.Spined; public override FoodType FavoriteFood => FoodType.FruitsAndVegies | FoodType.GrainsAndHay; - public override bool OverrideBondingReqs() - { - return true; - } + public override bool OverrideBondingReqs() => true; - public override double GetControlChance(Mobile m, bool useBaseSkill = false) - { - return 1.0; - } + public override double GetControlChance(Mobile m, bool useBaseSkill = false) => 1.0; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Animals/Mounts/SavageRidgeback.cs b/Projects/Scripts/Mobiles/Animals/Mounts/SavageRidgeback.cs index 8f41123d2..8e0260e09 100644 --- a/Projects/Scripts/Mobiles/Animals/Mounts/SavageRidgeback.cs +++ b/Projects/Scripts/Mobiles/Animals/Mounts/SavageRidgeback.cs @@ -48,15 +48,9 @@ namespace Server.Mobiles public override HideType HideType => HideType.Spined; public override FoodType FavoriteFood => FoodType.FruitsAndVegies | FoodType.GrainsAndHay; - public override bool OverrideBondingReqs() - { - return true; - } + public override bool OverrideBondingReqs() => true; - public override double GetControlChance(Mobile m, bool useBaseSkill = false) - { - return 1.0; - } + public override double GetControlChance(Mobile m, bool useBaseSkill = false) => 1.0; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Animals/Mounts/ScaledSwampDragon.cs b/Projects/Scripts/Mobiles/Animals/Mounts/ScaledSwampDragon.cs index 441eb60ea..37cde1b9d 100644 --- a/Projects/Scripts/Mobiles/Animals/Mounts/ScaledSwampDragon.cs +++ b/Projects/Scripts/Mobiles/Animals/Mounts/ScaledSwampDragon.cs @@ -45,15 +45,9 @@ namespace Server.Mobiles public override bool AutoDispel => !Controlled; public override FoodType FavoriteFood => FoodType.Meat; - public override bool OverrideBondingReqs() - { - return true; - } + public override bool OverrideBondingReqs() => true; - public override double GetControlChance(Mobile m, bool useBaseSkill = false) - { - return 1.0; - } + public override double GetControlChance(Mobile m, bool useBaseSkill = false) => 1.0; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Animals/Mounts/SwampDragon.cs b/Projects/Scripts/Mobiles/Animals/Mounts/SwampDragon.cs index 27968bc3d..f3f11d264 100644 --- a/Projects/Scripts/Mobiles/Animals/Mounts/SwampDragon.cs +++ b/Projects/Scripts/Mobiles/Animals/Mounts/SwampDragon.cs @@ -139,35 +139,17 @@ namespace Server.Mobiles public override ScaleType ScaleType => ScaleType.Green; public override bool CanAngerOnTame => true; - public override bool OverrideBondingReqs() - { - return true; - } + public override bool OverrideBondingReqs() => true; - public override int GetIdleSound() - { - return 0x2CE; - } + public override int GetIdleSound() => 0x2CE; - public override int GetDeathSound() - { - return 0x2CC; - } + public override int GetDeathSound() => 0x2CC; - public override int GetHurtSound() - { - return 0x2D1; - } + public override int GetHurtSound() => 0x2D1; - public override int GetAttackSound() - { - return 0x2C8; - } + public override int GetAttackSound() => 0x2C8; - public override double GetControlChance(Mobile m, bool useBaseSkill = false) - { - return 1.0; - } + public override double GetControlChance(Mobile m, bool useBaseSkill = false) => 1.0; public override void GetProperties(ObjectPropertyList list) { diff --git a/Projects/Scripts/Mobiles/Animals/Rodents/JackRabbit.cs b/Projects/Scripts/Mobiles/Animals/Rodents/JackRabbit.cs index 6c480f50d..ed12447a7 100644 --- a/Projects/Scripts/Mobiles/Animals/Rodents/JackRabbit.cs +++ b/Projects/Scripts/Mobiles/Animals/Rodents/JackRabbit.cs @@ -47,20 +47,11 @@ namespace Server.Mobiles public override int Hides => 1; public override FoodType FavoriteFood => FoodType.FruitsAndVegies; - public override int GetAttackSound() - { - return 0xC9; - } + public override int GetAttackSound() => 0xC9; - public override int GetHurtSound() - { - return 0xCA; - } + public override int GetHurtSound() => 0xCA; - public override int GetDeathSound() - { - return 0xCB; - } + public override int GetDeathSound() => 0xCB; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Animals/Rodents/Rabbit.cs b/Projects/Scripts/Mobiles/Animals/Rodents/Rabbit.cs index 3b94236e4..10a2fcff8 100644 --- a/Projects/Scripts/Mobiles/Animals/Rodents/Rabbit.cs +++ b/Projects/Scripts/Mobiles/Animals/Rodents/Rabbit.cs @@ -48,20 +48,11 @@ namespace Server.Mobiles public override int Hides => 1; public override FoodType FavoriteFood => FoodType.FruitsAndVegies; - public override int GetAttackSound() - { - return 0xC9; - } + public override int GetAttackSound() => 0xC9; - public override int GetHurtSound() - { - return 0xCA; - } + public override int GetHurtSound() => 0xCA; - public override int GetDeathSound() - { - return 0xCB; - } + public override int GetDeathSound() => 0xCB; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Animals/Slimes/Jwilson.cs b/Projects/Scripts/Mobiles/Animals/Slimes/Jwilson.cs index 536f1c208..955234cc9 100644 --- a/Projects/Scripts/Mobiles/Animals/Slimes/Jwilson.cs +++ b/Projects/Scripts/Mobiles/Animals/Slimes/Jwilson.cs @@ -27,30 +27,15 @@ namespace Server.Mobiles public override string CorpseName => "a jwilson corpse"; public override string DefaultName => "a jwilson"; - public override int GetAngerSound() - { - return 0x1C8; - } + public override int GetAngerSound() => 0x1C8; - public override int GetIdleSound() - { - return 0x1C9; - } + public override int GetIdleSound() => 0x1C9; - public override int GetAttackSound() - { - return 0x1CA; - } + public override int GetAttackSound() => 0x1CA; - public override int GetHurtSound() - { - return 0x1CB; - } + public override int GetHurtSound() => 0x1CB; - public override int GetDeathSound() - { - return 0x1CC; - } + public override int GetDeathSound() => 0x1CC; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Animals/Town Critters/(UO 3D Only) Parrot.cs b/Projects/Scripts/Mobiles/Animals/Town Critters/(UO 3D Only) Parrot.cs index 0af534bf6..4c23a32d8 100644 --- a/Projects/Scripts/Mobiles/Animals/Town Critters/(UO 3D Only) Parrot.cs +++ b/Projects/Scripts/Mobiles/Animals/Town Critters/(UO 3D Only) Parrot.cs @@ -29,30 +29,15 @@ namespace Server.Mobiles public override string CorpseName => "a parrot corpse"; public override string DefaultName => "a parrot"; - public override int GetAngerSound() - { - return 0x1B; - } + public override int GetAngerSound() => 0x1B; - public override int GetIdleSound() - { - return 0x1C; - } + public override int GetIdleSound() => 0x1C; - public override int GetAttackSound() - { - return 0x1D; - } + public override int GetAttackSound() => 0x1D; - public override int GetHurtSound() - { - return 0x1E; - } + public override int GetHurtSound() => 0x1E; - public override int GetDeathSound() - { - return 0x1F; - } + public override int GetDeathSound() => 0x1F; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/BaseCreature.cs b/Projects/Scripts/Mobiles/BaseCreature.cs index 8fb55e7d9..378d84523 100644 --- a/Projects/Scripts/Mobiles/BaseCreature.cs +++ b/Projects/Scripts/Mobiles/BaseCreature.cs @@ -130,19 +130,13 @@ namespace Server.Mobiles m_Damage = damage; } - public int CompareTo(DamageStore ds) - { - return ds?.m_Damage ?? 0 - m_Damage; - } + public int CompareTo(DamageStore ds) => ds?.m_Damage ?? 0 - m_Damage; } [AttributeUsage(AttributeTargets.Class)] public class FriendlyNameAttribute : Attribute { - public FriendlyNameAttribute(TextDefinition friendlyName) - { - FriendlyName = friendlyName; - } + public FriendlyNameAttribute(TextDefinition friendlyName) => FriendlyName = friendlyName; //future use: Talisman 'Protection/Bonus vs. Specific Creature public TextDefinition FriendlyName{ get; } @@ -802,10 +796,7 @@ namespace Server.Mobiles public HonorContext ReceivedHonorContext{ get; set; } - public virtual WeaponAbility GetWeaponAbility() - { - return null; - } + public virtual WeaponAbility GetWeaponAbility() => null; public virtual bool IsEnemy(Mobile m) { @@ -868,10 +859,7 @@ namespace Server.Mobiles return false; } - public virtual bool CanBeControlledBy(Mobile m) - { - return GetControlChance(m) > 0.0; - } + public virtual bool CanBeControlledBy(Mobile m) => GetControlChance(m) > 0.0; public virtual double GetControlChance(Mobile m, bool useBaseSkill = false) { @@ -987,11 +975,9 @@ namespace Server.Mobiles return result; } - public override bool CheckPoisonImmunity(Mobile from, Poison poison) - { - return base.CheckPoisonImmunity(from, poison) || - (m_Paragon ? PoisonImpl.IncreaseLevel(PoisonImmune) : PoisonImmune)?.Level >= poison.Level; - } + public override bool CheckPoisonImmunity(Mobile from, Poison poison) => + base.CheckPoisonImmunity(from, poison) || + (m_Paragon ? PoisonImpl.IncreaseLevel(PoisonImmune) : PoisonImmune)?.Level >= poison.Level; public void Unpacify() { @@ -1571,15 +1557,9 @@ namespace Server.Mobiles AnimateDeadSpell.Register(m_SummonMaster, this); } - public virtual bool IsHumanInTown() - { - return Body.IsHuman && Region.IsPartOf(); - } + public virtual bool IsHumanInTown() => Body.IsHuman && Region.IsPartOf(); - public virtual bool CheckGold(Mobile from, Item dropped) - { - return dropped is Gold gold && OnGoldGiven(from, gold); - } + public virtual bool CheckGold(Mobile from, Item dropped) => dropped is Gold gold && OnGoldGiven(from, gold); public virtual bool OnGoldGiven(Mobile from, Gold dropped) { @@ -1614,10 +1594,7 @@ namespace Server.Mobiles return false; } - public virtual bool OverrideBondingReqs() - { - return false; - } + public virtual bool OverrideBondingReqs() => false; public override bool OnDragDrop(Mobile from, Item dropped) { @@ -1846,15 +1823,9 @@ namespace Server.Mobiles SetDirection((Direction)((((v & 0x7) + iTurnSteps) & 0x7) | (v & 0x80))); } - public bool IsHurt() - { - return Hits != HitsMax; - } + public bool IsHurt() => Hits != HitsMax; - public double GetHomeDistance() - { - return GetDistanceToSqrt(m_Home); - } + public double GetHomeDistance() => GetDistanceToSqrt(m_Home); public virtual int GetTeamSize(int iRange) { @@ -1974,11 +1945,9 @@ namespace Server.Mobiles } } - public override bool HandlesOnSpeech(Mobile from) - { - return (SpeechType?.Flags & IHSFlags.OnSpeech) != 0 && from.InRange(this, 3) || - AIObject?.HandlesOnSpeech(from) == true && from.InRange(this, RangePerception); - } + public override bool HandlesOnSpeech(Mobile from) => + (SpeechType?.Flags & IHSFlags.OnSpeech) != 0 && from.InRange(this, 3) || + AIObject?.HandlesOnSpeech(from) == true && from.InRange(this, RangePerception); public override void OnSpeech(SpeechEventArgs e) { @@ -1990,12 +1959,10 @@ namespace Server.Mobiles AIObject.OnSpeech(e); } - public override bool IsHarmfulCriminal(Mobile target) - { - return (!Controlled || target != m_ControlMaster) && (!Summoned || target != m_SummonMaster) && - (!(target is BaseCreature creature) || !creature.InitialInnocent || creature.Controlled) && - (!(target is PlayerMobile mobile) || mobile.PermaFlags.Count <= 0) && base.IsHarmfulCriminal(target); - } + public override bool IsHarmfulCriminal(Mobile target) => + (!Controlled || target != m_ControlMaster) && (!Summoned || target != m_SummonMaster) && + (!(target is BaseCreature creature) || !creature.InitialInnocent || creature.Controlled) && + (!(target is PlayerMobile mobile) || mobile.PermaFlags.Count <= 0) && base.IsHarmfulCriminal(target); public override void CriminalAction(bool message) { @@ -2774,11 +2741,9 @@ namespace Server.Mobiles return base.CanBeHarmful(target, message, ignoreOurBlessedness); } - public override bool CanBeRenamedBy(Mobile from) - { - return Controlled && from == ControlMaster && !from.Region.IsPartOf() || - base.CanBeRenamedBy(from); - } + public override bool CanBeRenamedBy(Mobile from) => + Controlled && from == ControlMaster && !from.Region.IsPartOf() || + base.CanBeRenamedBy(from); public bool SetControlMaster(Mobile m) { @@ -2842,10 +2807,7 @@ namespace Server.Mobiles } } - public static bool Summon(BaseCreature creature, Mobile caster, Point3D p, int sound, TimeSpan duration) - { - return Summon(creature, true, caster, p, sound, duration); - } + public static bool Summon(BaseCreature creature, Mobile caster, Point3D p, int sound, TimeSpan duration) => Summon(creature, true, caster, p, sound, duration); public static bool Summon(BaseCreature creature, bool controlled, Mobile caster, Point3D p, int sound, TimeSpan duration) @@ -3160,12 +3122,10 @@ namespace Server.Mobiles return base.CanBeDamaged(); } - private bool IsSpawnerBound() - { - return Map != null && Map != Map.Internal && - FightMode != FightMode.None && RangeHome >= 0 && - !Controlled && !Summoned && Spawner is Spawner spawner && spawner.Map == Map; - } + private bool IsSpawnerBound() => + Map != null && Map != Map.Internal && + FightMode != FightMode.None && RangeHome >= 0 && + !Controlled && !Summoned && Spawner is Spawner spawner && spawner.Map == Map; public override void OnSectorDeactivate() { @@ -3234,10 +3194,7 @@ namespace Server.Mobiles { private BaseCreature m_Charmed; - public DeathAdderCharmTarget(BaseCreature charmed) : base(-1, false, TargetFlags.Harmful) - { - m_Charmed = charmed; - } + public DeathAdderCharmTarget(BaseCreature charmed) : base(-1, false, TargetFlags.Harmful) => m_Charmed = charmed; protected override void OnTarget(Mobile from, object targeted) { @@ -3333,10 +3290,7 @@ namespace Server.Mobiles public virtual bool CanGiveMLQuest => MLQuests.Count != 0; public virtual bool StaticMLQuester => true; - protected virtual List ConstructQuestList() - { - return null; - } + protected virtual List ConstructQuestList() => null; public virtual bool CanShout => false; @@ -3767,10 +3721,7 @@ namespace Server.Mobiles kappa+acidslime, grizzles+whatever, etc. */ - public virtual Item NewHarmfulItem() - { - return new PoolOfAcid(TimeSpan.FromSeconds(10), 30, 30); - } + public virtual Item NewHarmfulItem() => new PoolOfAcid(TimeSpan.FromSeconds(10), 30, 30); #endregion @@ -3812,10 +3763,7 @@ namespace Server.Mobiles public virtual bool AllowNewPetFriend => Friends == null || Friends.Count < 5; - public virtual bool IsPetFriend(Mobile m) - { - return Friends.Contains(m); - } + public virtual bool IsPetFriend(Mobile m) => Friends.Contains(m); public virtual void AddPetFriend(Mobile m) { @@ -3830,11 +3778,9 @@ namespace Server.Mobiles Friends?.Remove(m); } - public virtual bool IsFriend(Mobile m) - { - return OppositionGroup?.IsEnemy(this, m) != true && m is BaseCreature c && m_Team == c.m_Team - && (m_bSummoned || m_Controlled) == (c.m_bSummoned || c.m_Controlled); - } + public virtual bool IsFriend(Mobile m) => + OppositionGroup?.IsEnemy(this, m) != true && m is BaseCreature c && m_Team == c.m_Team + && (m_bSummoned || m_Controlled) == (c.m_bSummoned || c.m_Controlled); #endregion @@ -4678,10 +4624,7 @@ namespace Server.Mobiles pack.Generate(this, backpack, m_Spawning, m_KillersLuck); } - public bool PackArmor(int minLevel, int maxLevel) - { - return PackArmor(minLevel, maxLevel, 1.0); - } + public bool PackArmor(int minLevel, int maxLevel) => PackArmor(minLevel, maxLevel, 1.0); public bool PackArmor(int minLevel, int maxLevel, double chance) { diff --git a/Projects/Scripts/Mobiles/Familiars/HordeMinion.cs b/Projects/Scripts/Mobiles/Familiars/HordeMinion.cs index 77c44bf05..8012f81be 100644 --- a/Projects/Scripts/Mobiles/Familiars/HordeMinion.cs +++ b/Projects/Scripts/Mobiles/Familiars/HordeMinion.cs @@ -136,10 +136,7 @@ namespace Server.Mobiles return true; } - public override DeathMoveResult GetInventoryMoveResultFor(Item item) - { - return DeathMoveResult.MoveToCorpse; - } + public override DeathMoveResult GetInventoryMoveResultFor(Item item) => DeathMoveResult.MoveToCorpse; public override bool IsSnoop(Mobile from) { @@ -163,15 +160,9 @@ namespace Server.Mobiles return base.OnDragDrop(from, item); } - public override bool CheckNonlocalDrop(Mobile from, Item item, Item target) - { - return PackAnimal.CheckAccess(this, from); - } + public override bool CheckNonlocalDrop(Mobile from, Item item, Item target) => PackAnimal.CheckAccess(this, from); - public override bool CheckNonlocalLift(Mobile from, Item item) - { - return PackAnimal.CheckAccess(this, from); - } + public override bool CheckNonlocalLift(Mobile from, Item item) => PackAnimal.CheckAccess(this, from); public override void OnDoubleClick(Mobile from) { diff --git a/Projects/Scripts/Mobiles/Guards/ArcherGuard.cs b/Projects/Scripts/Mobiles/Guards/ArcherGuard.cs index d618ce25b..6560b2652 100644 --- a/Projects/Scripts/Mobiles/Guards/ArcherGuard.cs +++ b/Projects/Scripts/Mobiles/Guards/ArcherGuard.cs @@ -201,9 +201,8 @@ namespace Server.Mobiles public AvengeTimer(Mobile focus) : base(TimeSpan.FromSeconds(2.5), TimeSpan.FromSeconds(1.0), 3) // After 2.5 seconds, one guard will spawn every 1.0 second, three times - { - m_Focus = focus; - } + => + m_Focus = focus; protected override void OnTick() { @@ -216,10 +215,7 @@ namespace Server.Mobiles private ArcherGuard m_Owner; // private bool m_Shooting; - public AttackTimer(ArcherGuard owner) : base(TimeSpan.FromSeconds(0.25), TimeSpan.FromSeconds(0.1)) - { - m_Owner = owner; - } + public AttackTimer(ArcherGuard owner) : base(TimeSpan.FromSeconds(0.25), TimeSpan.FromSeconds(0.1)) => m_Owner = owner; public void DoOnTick() { @@ -328,20 +324,11 @@ namespace Server.Mobiles }*/ } - private bool TimeToSpare() - { - return m_Owner.NextCombatTime - Core.TickCount > 1000; - } + private bool TimeToSpare() => m_Owner.NextCombatTime - Core.TickCount > 1000; - private bool OutOfMaxDistance(Mobile target) - { - return !m_Owner.InRange(target, m_Owner.Weapon.MaxRange); - } + private bool OutOfMaxDistance(Mobile target) => !m_Owner.InRange(target, m_Owner.Weapon.MaxRange); - private bool InMinDistance(Mobile target) - { - return m_Owner.InRange(target, 4); - } + private bool InMinDistance(Mobile target) => m_Owner.InRange(target, 4); private void TeleportTo(Mobile target) { @@ -364,10 +351,7 @@ namespace Server.Mobiles private ArcherGuard m_Owner; private int m_Stage; - public IdleTimer(ArcherGuard owner) : base(TimeSpan.FromSeconds(2.0), TimeSpan.FromSeconds(2.5)) - { - m_Owner = owner; - } + public IdleTimer(ArcherGuard owner) : base(TimeSpan.FromSeconds(2.0), TimeSpan.FromSeconds(2.5)) => m_Owner = owner; protected override void OnTick() { diff --git a/Projects/Scripts/Mobiles/Guards/WarriorGuard.cs b/Projects/Scripts/Mobiles/Guards/WarriorGuard.cs index ce759f260..1cad91a09 100644 --- a/Projects/Scripts/Mobiles/Guards/WarriorGuard.cs +++ b/Projects/Scripts/Mobiles/Guards/WarriorGuard.cs @@ -234,10 +234,7 @@ namespace Server.Mobiles { private Mobile m_Focus; - public AvengeTimer(Mobile focus) : base(TimeSpan.FromSeconds(2.5), TimeSpan.FromSeconds(1.0), 3) - { - m_Focus = focus; - } + public AvengeTimer(Mobile focus) : base(TimeSpan.FromSeconds(2.5), TimeSpan.FromSeconds(1.0), 3) => m_Focus = focus; protected override void OnTick() { @@ -249,10 +246,7 @@ namespace Server.Mobiles { private WarriorGuard m_Owner; - public AttackTimer(WarriorGuard owner) : base(TimeSpan.FromSeconds(0.25), TimeSpan.FromSeconds(0.1)) - { - m_Owner = owner; - } + public AttackTimer(WarriorGuard owner) : base(TimeSpan.FromSeconds(0.25), TimeSpan.FromSeconds(0.1)) => m_Owner = owner; public void DoOnTick() { @@ -354,10 +348,7 @@ namespace Server.Mobiles private WarriorGuard m_Owner; private int m_Stage; - public IdleTimer(WarriorGuard owner) : base(TimeSpan.FromSeconds(2.0), TimeSpan.FromSeconds(2.5)) - { - m_Owner = owner; - } + public IdleTimer(WarriorGuard owner) : base(TimeSpan.FromSeconds(2.0), TimeSpan.FromSeconds(2.5)) => m_Owner = owner; protected override void OnTick() { diff --git a/Projects/Scripts/Mobiles/Healers/BaseHealer.cs b/Projects/Scripts/Mobiles/Healers/BaseHealer.cs index 23144ecd8..38e1d2e70 100644 --- a/Projects/Scripts/Mobiles/Healers/BaseHealer.cs +++ b/Projects/Scripts/Mobiles/Healers/BaseHealer.cs @@ -70,10 +70,7 @@ namespace Server.Mobiles { } - public virtual int GetRobeColor() - { - return Utility.RandomYellowHue(); - } + public virtual int GetRobeColor() => Utility.RandomYellowHue(); public override void InitOutfit() { @@ -82,10 +79,7 @@ namespace Server.Mobiles AddItem(new Robe(GetRobeColor())); } - public virtual bool CheckResurrect(Mobile m) - { - return true; - } + public virtual bool CheckResurrect(Mobile m) => true; public virtual void OfferResurrection(Mobile m) { diff --git a/Projects/Scripts/Mobiles/Healers/FortuneTeller.cs b/Projects/Scripts/Mobiles/Healers/FortuneTeller.cs index 7b25759bc..d7bb52929 100644 --- a/Projects/Scripts/Mobiles/Healers/FortuneTeller.cs +++ b/Projects/Scripts/Mobiles/Healers/FortuneTeller.cs @@ -41,10 +41,7 @@ namespace Server.Mobiles SBInfos.Add(new SBFortuneTeller()); } - public override int GetRobeColor() - { - return Utility.RandomBrightHue(); - } + public override int GetRobeColor() => Utility.RandomBrightHue(); public override void InitOutfit() { diff --git a/Projects/Scripts/Mobiles/Healers/PricedHealer.cs b/Projects/Scripts/Mobiles/Healers/PricedHealer.cs index b28d4066e..2ed40bd62 100644 --- a/Projects/Scripts/Mobiles/Healers/PricedHealer.cs +++ b/Projects/Scripts/Mobiles/Healers/PricedHealer.cs @@ -39,10 +39,7 @@ namespace Server.Mobiles m.SendGump(new ResurrectGump(m, this, Price)); } - public override bool CheckResurrect(Mobile m) - { - return true; - } + public override bool CheckResurrect(Mobile m) => true; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/AOS/AbysmalHorror.cs b/Projects/Scripts/Mobiles/Monsters/AOS/AbysmalHorror.cs index 28685ab97..91a5157eb 100644 --- a/Projects/Scripts/Mobiles/Monsters/AOS/AbysmalHorror.cs +++ b/Projects/Scripts/Mobiles/Monsters/AOS/AbysmalHorror.cs @@ -56,10 +56,7 @@ namespace Server.Mobiles public override Poison PoisonImmune => Poison.Lethal; public override int TreasureMapLevel => 1; - public override WeaponAbility GetWeaponAbility() - { - return Utility.RandomBool() ? WeaponAbility.MortalStrike : WeaponAbility.WhirlwindAttack; - } + public override WeaponAbility GetWeaponAbility() => Utility.RandomBool() ? WeaponAbility.MortalStrike : WeaponAbility.WhirlwindAttack; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Monsters/AOS/CrystalElemental.cs b/Projects/Scripts/Mobiles/Monsters/AOS/CrystalElemental.cs index 3e7f2b6c6..93ca44bd9 100644 --- a/Projects/Scripts/Mobiles/Monsters/AOS/CrystalElemental.cs +++ b/Projects/Scripts/Mobiles/Monsters/AOS/CrystalElemental.cs @@ -52,10 +52,7 @@ namespace Server.Mobiles public override Poison PoisonImmune => Poison.Lethal; public override int TreasureMapLevel => 1; - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.BleedAttack; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.BleedAttack; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Monsters/AOS/DemonKnight.cs b/Projects/Scripts/Mobiles/Monsters/AOS/DemonKnight.cs index 65ef359f2..0ad8eceed 100644 --- a/Projects/Scripts/Mobiles/Monsters/AOS/DemonKnight.cs +++ b/Projects/Scripts/Mobiles/Monsters/AOS/DemonKnight.cs @@ -194,10 +194,7 @@ namespace Server.Mobiles return chance; } - public static bool CheckArtifactChance(Mobile boss) - { - return GetArtifactChance(boss) > Utility.Random(100000); - } + public static bool CheckArtifactChance(Mobile boss) => GetArtifactChance(boss) > Utility.Random(100000); public override WeaponAbility GetWeaponAbility() { diff --git a/Projects/Scripts/Mobiles/Monsters/AOS/FleshGolem.cs b/Projects/Scripts/Mobiles/Monsters/AOS/FleshGolem.cs index 593f7e007..80177d7d8 100644 --- a/Projects/Scripts/Mobiles/Monsters/AOS/FleshGolem.cs +++ b/Projects/Scripts/Mobiles/Monsters/AOS/FleshGolem.cs @@ -47,10 +47,7 @@ namespace Server.Mobiles public override bool BleedImmune => true; public override int TreasureMapLevel => 1; - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.BleedAttack; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.BleedAttack; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Monsters/AOS/FleshRenderer.cs b/Projects/Scripts/Mobiles/Monsters/AOS/FleshRenderer.cs index 84d5784e8..883c87c30 100644 --- a/Projects/Scripts/Mobiles/Monsters/AOS/FleshRenderer.cs +++ b/Projects/Scripts/Mobiles/Monsters/AOS/FleshRenderer.cs @@ -56,10 +56,7 @@ namespace Server.Mobiles public override int TreasureMapLevel => 1; - public override WeaponAbility GetWeaponAbility() - { - return Utility.RandomBool() ? WeaponAbility.Dismount : WeaponAbility.ParalyzingBlow; - } + public override WeaponAbility GetWeaponAbility() => Utility.RandomBool() ? WeaponAbility.Dismount : WeaponAbility.ParalyzingBlow; public override void GenerateLoot() { @@ -74,30 +71,15 @@ namespace Server.Mobiles DemonKnight.DistributeArtifact(this); } - public override int GetAttackSound() - { - return 0x34C; - } + public override int GetAttackSound() => 0x34C; - public override int GetHurtSound() - { - return 0x354; - } + public override int GetHurtSound() => 0x354; - public override int GetAngerSound() - { - return 0x34C; - } + public override int GetAngerSound() => 0x34C; - public override int GetIdleSound() - { - return 0x34C; - } + public override int GetIdleSound() => 0x34C; - public override int GetDeathSound() - { - return 0x354; - } + public override int GetDeathSound() => 0x354; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/AOS/Gibberling.cs b/Projects/Scripts/Mobiles/Monsters/AOS/Gibberling.cs index e104e507e..8da3660f0 100644 --- a/Projects/Scripts/Mobiles/Monsters/AOS/Gibberling.cs +++ b/Projects/Scripts/Mobiles/Monsters/AOS/Gibberling.cs @@ -48,10 +48,7 @@ namespace Server.Mobiles public override int TreasureMapLevel => 1; - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.Dismount; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.Dismount; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Monsters/AOS/GoreFiend.cs b/Projects/Scripts/Mobiles/Monsters/AOS/GoreFiend.cs index d1e9bb074..aa8182c21 100644 --- a/Projects/Scripts/Mobiles/Monsters/AOS/GoreFiend.cs +++ b/Projects/Scripts/Mobiles/Monsters/AOS/GoreFiend.cs @@ -49,10 +49,7 @@ namespace Server.Mobiles AddLoot(LootPack.Average); } - public override int GetDeathSound() - { - return 1218; - } + public override int GetDeathSound() => 1218; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/AOS/Impaler.cs b/Projects/Scripts/Mobiles/Monsters/AOS/Impaler.cs index f9a9463b9..8786e5818 100644 --- a/Projects/Scripts/Mobiles/Monsters/AOS/Impaler.cs +++ b/Projects/Scripts/Mobiles/Monsters/AOS/Impaler.cs @@ -57,10 +57,7 @@ namespace Server.Mobiles public override int TreasureMapLevel => 1; - public override WeaponAbility GetWeaponAbility() - { - return Utility.RandomBool() ? WeaponAbility.MortalStrike : WeaponAbility.BleedAttack; - } + public override WeaponAbility GetWeaponAbility() => Utility.RandomBool() ? WeaponAbility.MortalStrike : WeaponAbility.BleedAttack; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Monsters/AOS/PatchworkSkeleton.cs b/Projects/Scripts/Mobiles/Monsters/AOS/PatchworkSkeleton.cs index 0b94cbcdd..d6941b1a7 100644 --- a/Projects/Scripts/Mobiles/Monsters/AOS/PatchworkSkeleton.cs +++ b/Projects/Scripts/Mobiles/Monsters/AOS/PatchworkSkeleton.cs @@ -50,10 +50,7 @@ namespace Server.Mobiles public override int TreasureMapLevel => 1; - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.Dismount; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.Dismount; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Monsters/AOS/Ravager.cs b/Projects/Scripts/Mobiles/Monsters/AOS/Ravager.cs index bd29a6175..0f4ff94a4 100644 --- a/Projects/Scripts/Mobiles/Monsters/AOS/Ravager.cs +++ b/Projects/Scripts/Mobiles/Monsters/AOS/Ravager.cs @@ -44,10 +44,7 @@ namespace Server.Mobiles public override string DefaultName => "a ravager"; - public override WeaponAbility GetWeaponAbility() - { - return Utility.RandomBool() ? WeaponAbility.Dismount : WeaponAbility.CrushingBlow; - } + public override WeaponAbility GetWeaponAbility() => Utility.RandomBool() ? WeaponAbility.Dismount : WeaponAbility.CrushingBlow; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Monsters/AOS/ShadowKnight.cs b/Projects/Scripts/Mobiles/Monsters/AOS/ShadowKnight.cs index bb43140c9..3e8944ee2 100644 --- a/Projects/Scripts/Mobiles/Monsters/AOS/ShadowKnight.cs +++ b/Projects/Scripts/Mobiles/Monsters/AOS/ShadowKnight.cs @@ -65,10 +65,7 @@ namespace Server.Mobiles public override int TreasureMapLevel => 1; - public override WeaponAbility GetWeaponAbility() - { - return Utility.RandomBool() ? WeaponAbility.ConcussionBlow : WeaponAbility.CrushingBlow; - } + public override WeaponAbility GetWeaponAbility() => Utility.RandomBool() ? WeaponAbility.ConcussionBlow : WeaponAbility.CrushingBlow; public override void GenerateLoot() { @@ -83,25 +80,13 @@ namespace Server.Mobiles DemonKnight.DistributeArtifact(this); } - public override int GetIdleSound() - { - return 0x2CE; - } + public override int GetIdleSound() => 0x2CE; - public override int GetDeathSound() - { - return 0x2C1; - } + public override int GetDeathSound() => 0x2C1; - public override int GetHurtSound() - { - return 0x2D1; - } + public override int GetHurtSound() => 0x2D1; - public override int GetAttackSound() - { - return 0x2C8; - } + public override int GetAttackSound() => 0x2C8; public override void OnCombatantChange() { diff --git a/Projects/Scripts/Mobiles/Monsters/AOS/Treefellow.cs b/Projects/Scripts/Mobiles/Monsters/AOS/Treefellow.cs index f853fbf94..5d46d06dc 100644 --- a/Projects/Scripts/Mobiles/Monsters/AOS/Treefellow.cs +++ b/Projects/Scripts/Mobiles/Monsters/AOS/Treefellow.cs @@ -47,25 +47,13 @@ namespace Server.Mobiles public override bool BleedImmune => true; - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.Dismount; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.Dismount; - public override int GetIdleSound() - { - return 443; - } + public override int GetIdleSound() => 443; - public override int GetDeathSound() - { - return 31; - } + public override int GetDeathSound() => 31; - public override int GetAttackSound() - { - return 672; - } + public override int GetAttackSound() => 672; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Monsters/AOS/VampireBat.cs b/Projects/Scripts/Mobiles/Monsters/AOS/VampireBat.cs index f481fe210..809e98068 100644 --- a/Projects/Scripts/Mobiles/Monsters/AOS/VampireBat.cs +++ b/Projects/Scripts/Mobiles/Monsters/AOS/VampireBat.cs @@ -47,10 +47,7 @@ namespace Server.Mobiles AddLoot(LootPack.Poor); } - public override int GetIdleSound() - { - return 0x29B; - } + public override int GetIdleSound() => 0x29B; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/AOS/WailingBanshee.cs b/Projects/Scripts/Mobiles/Monsters/AOS/WailingBanshee.cs index 1379c2b9c..76cf4b780 100644 --- a/Projects/Scripts/Mobiles/Monsters/AOS/WailingBanshee.cs +++ b/Projects/Scripts/Mobiles/Monsters/AOS/WailingBanshee.cs @@ -48,10 +48,7 @@ namespace Server.Mobiles public override bool BleedImmune => true; - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.MortalStrike; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.MortalStrike; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Monsters/Ants/AntLion.cs b/Projects/Scripts/Mobiles/Monsters/Ants/AntLion.cs index 00cb8c534..57ee449a6 100644 --- a/Projects/Scripts/Mobiles/Monsters/Ants/AntLion.cs +++ b/Projects/Scripts/Mobiles/Monsters/Ants/AntLion.cs @@ -76,30 +76,15 @@ namespace Server.Mobiles public override string CorpseName => "an ant lion corpse"; public override string DefaultName => "an ant lion"; - public override int GetAngerSound() - { - return 0x5A; - } + public override int GetAngerSound() => 0x5A; - public override int GetIdleSound() - { - return 0x5A; - } + public override int GetIdleSound() => 0x5A; - public override int GetAttackSound() - { - return 0x164; - } + public override int GetAttackSound() => 0x164; - public override int GetHurtSound() - { - return 0x187; - } + public override int GetHurtSound() => 0x187; - public override int GetDeathSound() - { - return 0x1BA; - } + public override int GetDeathSound() => 0x1BA; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Monsters/Ants/BlackSolenInfiltratorQueen.cs b/Projects/Scripts/Mobiles/Monsters/Ants/BlackSolenInfiltratorQueen.cs index 51160029d..b27f95c04 100644 --- a/Projects/Scripts/Mobiles/Monsters/Ants/BlackSolenInfiltratorQueen.cs +++ b/Projects/Scripts/Mobiles/Monsters/Ants/BlackSolenInfiltratorQueen.cs @@ -49,30 +49,15 @@ namespace Server.Mobiles public override string CorpseName => "a solen infiltrator corpse"; public override string DefaultName => "a black solen infiltrator"; - public override int GetAngerSound() - { - return 0x259; - } + public override int GetAngerSound() => 0x259; - public override int GetIdleSound() - { - return 0x259; - } + public override int GetIdleSound() => 0x259; - public override int GetAttackSound() - { - return 0x195; - } + public override int GetAttackSound() => 0x195; - public override int GetHurtSound() - { - return 0x250; - } + public override int GetHurtSound() => 0x250; - public override int GetDeathSound() - { - return 0x25B; - } + public override int GetDeathSound() => 0x25B; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Monsters/Ants/BlackSolenInfiltratorWarrior.cs b/Projects/Scripts/Mobiles/Monsters/Ants/BlackSolenInfiltratorWarrior.cs index 882ddab3d..06199e310 100644 --- a/Projects/Scripts/Mobiles/Monsters/Ants/BlackSolenInfiltratorWarrior.cs +++ b/Projects/Scripts/Mobiles/Monsters/Ants/BlackSolenInfiltratorWarrior.cs @@ -49,30 +49,15 @@ namespace Server.Mobiles public override string CorpseName => "a solen infiltrator corpse"; public override string DefaultName => "a black solen infiltrator"; - public override int GetAngerSound() - { - return 0xB5; - } + public override int GetAngerSound() => 0xB5; - public override int GetIdleSound() - { - return 0xB5; - } + public override int GetIdleSound() => 0xB5; - public override int GetAttackSound() - { - return 0x289; - } + public override int GetAttackSound() => 0x289; - public override int GetHurtSound() - { - return 0xBC; - } + public override int GetHurtSound() => 0xBC; - public override int GetDeathSound() - { - return 0xE4; - } + public override int GetDeathSound() => 0xE4; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Monsters/Ants/BlackSolenQueen.cs b/Projects/Scripts/Mobiles/Monsters/Ants/BlackSolenQueen.cs index 9d92d542e..ddf36eec8 100644 --- a/Projects/Scripts/Mobiles/Monsters/Ants/BlackSolenQueen.cs +++ b/Projects/Scripts/Mobiles/Monsters/Ants/BlackSolenQueen.cs @@ -55,30 +55,15 @@ namespace Server.Mobiles public override string DefaultName => "a black solen queen"; - public override int GetAngerSound() - { - return 0x259; - } + public override int GetAngerSound() => 0x259; - public override int GetIdleSound() - { - return 0x259; - } + public override int GetIdleSound() => 0x259; - public override int GetAttackSound() - { - return 0x195; - } + public override int GetAttackSound() => 0x195; - public override int GetHurtSound() - { - return 0x250; - } + public override int GetHurtSound() => 0x250; - public override int GetDeathSound() - { - return 0x25B; - } + public override int GetDeathSound() => 0x25B; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Monsters/Ants/BlackSolenWarrior.cs b/Projects/Scripts/Mobiles/Monsters/Ants/BlackSolenWarrior.cs index e007db162..3ecb88b5a 100644 --- a/Projects/Scripts/Mobiles/Monsters/Ants/BlackSolenWarrior.cs +++ b/Projects/Scripts/Mobiles/Monsters/Ants/BlackSolenWarrior.cs @@ -55,30 +55,15 @@ namespace Server.Mobiles public override string DefaultName => "a black solen warrior"; - public override int GetAngerSound() - { - return 0xB5; - } + public override int GetAngerSound() => 0xB5; - public override int GetIdleSound() - { - return 0xB5; - } + public override int GetIdleSound() => 0xB5; - public override int GetAttackSound() - { - return 0x289; - } + public override int GetAttackSound() => 0x289; - public override int GetHurtSound() - { - return 0xBC; - } + public override int GetHurtSound() => 0xBC; - public override int GetDeathSound() - { - return 0xE4; - } + public override int GetDeathSound() => 0xE4; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Monsters/Ants/BlackSolenWorker.cs b/Projects/Scripts/Mobiles/Monsters/Ants/BlackSolenWorker.cs index 915ea5082..8e8ab4ed7 100644 --- a/Projects/Scripts/Mobiles/Monsters/Ants/BlackSolenWorker.cs +++ b/Projects/Scripts/Mobiles/Monsters/Ants/BlackSolenWorker.cs @@ -50,30 +50,15 @@ namespace Server.Mobiles public override string CorpseName => "a solen worker corpse"; public override string DefaultName => "a black solen worker"; - public override int GetAngerSound() - { - return 0x269; - } + public override int GetAngerSound() => 0x269; - public override int GetIdleSound() - { - return 0x269; - } + public override int GetIdleSound() => 0x269; - public override int GetAttackSound() - { - return 0x186; - } + public override int GetAttackSound() => 0x186; - public override int GetHurtSound() - { - return 0x1BE; - } + public override int GetHurtSound() => 0x1BE; - public override int GetDeathSound() - { - return 0x8E; - } + public override int GetDeathSound() => 0x8E; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Monsters/Ants/RedSolenInfiltratorQueen.cs b/Projects/Scripts/Mobiles/Monsters/Ants/RedSolenInfiltratorQueen.cs index 2b50295b6..ae161dc79 100644 --- a/Projects/Scripts/Mobiles/Monsters/Ants/RedSolenInfiltratorQueen.cs +++ b/Projects/Scripts/Mobiles/Monsters/Ants/RedSolenInfiltratorQueen.cs @@ -48,30 +48,15 @@ namespace Server.Mobiles public override string CorpseName => "a solen infiltrator corpse"; public override string DefaultName => "a red solen infiltrator"; - public override int GetAngerSound() - { - return 0x259; - } + public override int GetAngerSound() => 0x259; - public override int GetIdleSound() - { - return 0x259; - } + public override int GetIdleSound() => 0x259; - public override int GetAttackSound() - { - return 0x195; - } + public override int GetAttackSound() => 0x195; - public override int GetHurtSound() - { - return 0x250; - } + public override int GetHurtSound() => 0x250; - public override int GetDeathSound() - { - return 0x25B; - } + public override int GetDeathSound() => 0x25B; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Monsters/Ants/RedSolenInfiltratorWarrior.cs b/Projects/Scripts/Mobiles/Monsters/Ants/RedSolenInfiltratorWarrior.cs index 0d84604ca..f46be65d9 100644 --- a/Projects/Scripts/Mobiles/Monsters/Ants/RedSolenInfiltratorWarrior.cs +++ b/Projects/Scripts/Mobiles/Monsters/Ants/RedSolenInfiltratorWarrior.cs @@ -48,30 +48,15 @@ namespace Server.Mobiles public override string CorpseName => "a solen infiltrator corpse"; public override string DefaultName => "a red solen infiltrator"; - public override int GetAngerSound() - { - return 0xB5; - } + public override int GetAngerSound() => 0xB5; - public override int GetIdleSound() - { - return 0xB5; - } + public override int GetIdleSound() => 0xB5; - public override int GetAttackSound() - { - return 0x289; - } + public override int GetAttackSound() => 0x289; - public override int GetHurtSound() - { - return 0xBC; - } + public override int GetHurtSound() => 0xBC; - public override int GetDeathSound() - { - return 0xE4; - } + public override int GetDeathSound() => 0xE4; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Monsters/Ants/RedSolenQueen.cs b/Projects/Scripts/Mobiles/Monsters/Ants/RedSolenQueen.cs index f9994bb20..cbd6395ee 100644 --- a/Projects/Scripts/Mobiles/Monsters/Ants/RedSolenQueen.cs +++ b/Projects/Scripts/Mobiles/Monsters/Ants/RedSolenQueen.cs @@ -54,30 +54,15 @@ namespace Server.Mobiles public override string DefaultName => "a red solen queen"; - public override int GetAngerSound() - { - return 0x259; - } + public override int GetAngerSound() => 0x259; - public override int GetIdleSound() - { - return 0x259; - } + public override int GetIdleSound() => 0x259; - public override int GetAttackSound() - { - return 0x195; - } + public override int GetAttackSound() => 0x195; - public override int GetHurtSound() - { - return 0x250; - } + public override int GetHurtSound() => 0x250; - public override int GetDeathSound() - { - return 0x25B; - } + public override int GetDeathSound() => 0x25B; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Monsters/Ants/RedSolenWarrior.cs b/Projects/Scripts/Mobiles/Monsters/Ants/RedSolenWarrior.cs index 44c542cc4..05ce6d610 100644 --- a/Projects/Scripts/Mobiles/Monsters/Ants/RedSolenWarrior.cs +++ b/Projects/Scripts/Mobiles/Monsters/Ants/RedSolenWarrior.cs @@ -53,30 +53,15 @@ namespace Server.Mobiles public override string DefaultName => "a red solen warrior"; - public override int GetAngerSound() - { - return 0xB5; - } + public override int GetAngerSound() => 0xB5; - public override int GetIdleSound() - { - return 0xB5; - } + public override int GetIdleSound() => 0xB5; - public override int GetAttackSound() - { - return 0x289; - } + public override int GetAttackSound() => 0x289; - public override int GetHurtSound() - { - return 0xBC; - } + public override int GetHurtSound() => 0xBC; - public override int GetDeathSound() - { - return 0xE4; - } + public override int GetDeathSound() => 0xE4; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Monsters/Ants/RedSolenWorker.cs b/Projects/Scripts/Mobiles/Monsters/Ants/RedSolenWorker.cs index f72ffcffa..92dc5fed0 100644 --- a/Projects/Scripts/Mobiles/Monsters/Ants/RedSolenWorker.cs +++ b/Projects/Scripts/Mobiles/Monsters/Ants/RedSolenWorker.cs @@ -49,30 +49,15 @@ namespace Server.Mobiles public override string CorpseName => "a solen worker corpse"; public override string DefaultName => "a red solen worker"; - public override int GetAngerSound() - { - return 0x269; - } + public override int GetAngerSound() => 0x269; - public override int GetIdleSound() - { - return 0x269; - } + public override int GetIdleSound() => 0x269; - public override int GetAttackSound() - { - return 0x186; - } + public override int GetAttackSound() => 0x186; - public override int GetHurtSound() - { - return 0x1BE; - } + public override int GetHurtSound() => 0x1BE; - public override int GetDeathSound() - { - return 0x8E; - } + public override int GetDeathSound() => 0x8E; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Monsters/Humanoid/Magic/AncientLich.cs b/Projects/Scripts/Mobiles/Monsters/Humanoid/Magic/AncientLich.cs index d00543479..c608ede5a 100644 --- a/Projects/Scripts/Mobiles/Monsters/Humanoid/Magic/AncientLich.cs +++ b/Projects/Scripts/Mobiles/Monsters/Humanoid/Magic/AncientLich.cs @@ -57,30 +57,15 @@ namespace Server.Mobiles public override Poison PoisonImmune => Poison.Lethal; public override int TreasureMapLevel => 5; - public override int GetIdleSound() - { - return 0x19D; - } + public override int GetIdleSound() => 0x19D; - public override int GetAngerSound() - { - return 0x175; - } + public override int GetAngerSound() => 0x175; - public override int GetDeathSound() - { - return 0x108; - } + public override int GetDeathSound() => 0x108; - public override int GetAttackSound() - { - return 0xE2; - } + public override int GetAttackSound() => 0xE2; - public override int GetHurtSound() - { - return 0x28B; - } + public override int GetHurtSound() => 0x28B; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Monsters/Humanoid/Magic/ArcaneDaemon.cs b/Projects/Scripts/Mobiles/Monsters/Humanoid/Magic/ArcaneDaemon.cs index 0f6b61ba9..e468acb41 100644 --- a/Projects/Scripts/Mobiles/Monsters/Humanoid/Magic/ArcaneDaemon.cs +++ b/Projects/Scripts/Mobiles/Monsters/Humanoid/Magic/ArcaneDaemon.cs @@ -50,10 +50,7 @@ namespace Server.Mobiles public override Poison PoisonImmune => Poison.Deadly; - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.ConcussionBlow; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.ConcussionBlow; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Monsters/Humanoid/Magic/Betrayer.cs b/Projects/Scripts/Mobiles/Monsters/Humanoid/Magic/Betrayer.cs index bdfd7c0b4..981ca8028 100644 --- a/Projects/Scripts/Mobiles/Monsters/Humanoid/Magic/Betrayer.cs +++ b/Projects/Scripts/Mobiles/Monsters/Humanoid/Magic/Betrayer.cs @@ -87,20 +87,11 @@ namespace Server.Mobiles } } - public override int GetDeathSound() - { - return 0x423; - } + public override int GetDeathSound() => 0x423; - public override int GetAttackSound() - { - return 0x23B; - } + public override int GetAttackSound() => 0x23B; - public override int GetHurtSound() - { - return 0x140; - } + public override int GetHurtSound() => 0x140; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Monsters/Humanoid/Magic/GargoyleEnforcer.cs b/Projects/Scripts/Mobiles/Monsters/Humanoid/Magic/GargoyleEnforcer.cs index 59ca9a8c6..118c29b22 100644 --- a/Projects/Scripts/Mobiles/Monsters/Humanoid/Magic/GargoyleEnforcer.cs +++ b/Projects/Scripts/Mobiles/Monsters/Humanoid/Magic/GargoyleEnforcer.cs @@ -54,10 +54,7 @@ namespace Server.Mobiles public override int Meat => 1; - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.WhirlwindAttack; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.WhirlwindAttack; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/ChaosDaemon.cs b/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/ChaosDaemon.cs index c80d14888..dacba4e49 100644 --- a/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/ChaosDaemon.cs +++ b/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/ChaosDaemon.cs @@ -45,10 +45,7 @@ namespace Server.Mobiles public override string DefaultName => "a chaos daemon"; - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.CrushingBlow; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.CrushingBlow; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/Cursed.cs b/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/Cursed.cs index 7864d60ef..92d24c782 100644 --- a/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/Cursed.cs +++ b/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/Cursed.cs @@ -56,10 +56,7 @@ namespace Server.Mobiles public override bool AlwaysMurderer => true; - public override int GetAttackSound() - { - return -1; - } + public override int GetAttackSound() => -1; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/HordeMinion.cs b/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/HordeMinion.cs index 33daeddfd..a98e37b79 100644 --- a/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/HordeMinion.cs +++ b/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/HordeMinion.cs @@ -45,30 +45,15 @@ namespace Server.Mobiles public override string CorpseName => "a horde minion corpse"; public override string DefaultName => "a horde minion"; - public override int GetIdleSound() - { - return 338; - } + public override int GetIdleSound() => 338; - public override int GetAngerSound() - { - return 338; - } + public override int GetAngerSound() => 338; - public override int GetDeathSound() - { - return 338; - } + public override int GetDeathSound() => 338; - public override int GetAttackSound() - { - return 406; - } + public override int GetAttackSound() => 406; - public override int GetHurtSound() - { - return 194; - } + public override int GetHurtSound() => 194; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/Juggernaut.cs b/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/Juggernaut.cs index 9c518a4cc..12aaf70b0 100644 --- a/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/Juggernaut.cs +++ b/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/Juggernaut.cs @@ -90,20 +90,11 @@ namespace Server.Mobiles AddLoot(LootPack.Gems, 1); } - public override int GetDeathSound() - { - return 0x423; - } + public override int GetDeathSound() => 0x423; - public override int GetAttackSound() - { - return 0x23B; - } + public override int GetAttackSound() => 0x23B; - public override int GetHurtSound() - { - return 0x140; - } + public override int GetHurtSound() => 0x140; public override void OnGaveMeleeAttack(Mobile defender) { diff --git a/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/KhaldunRevenant.cs b/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/KhaldunRevenant.cs index 1db807d48..5bb6064aa 100644 --- a/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/KhaldunRevenant.cs +++ b/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/KhaldunRevenant.cs @@ -100,29 +100,17 @@ namespace Server.Mobiles m_Set.Add(killer); } - public static bool IsInsideKhaldun(Mobile from) - { - return from?.Region?.IsPartOf("Khaldun") == true; - } + public static bool IsInsideKhaldun(Mobile from) => from?.Region?.IsPartOf("Khaldun") == true; public override void DisplayPaperdollTo(Mobile to) { } - public override int GetIdleSound() - { - return 0x1BF; - } + public override int GetIdleSound() => 0x1BF; - public override int GetAngerSound() - { - return 0x107; - } + public override int GetAngerSound() => 0x107; - public override int GetDeathSound() - { - return 0xFD; - } + public override int GetDeathSound() => 0xFD; public override void OnThink() { diff --git a/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/KhaldunSummoner.cs b/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/KhaldunSummoner.cs index 5e32fbd40..5eceebcba 100644 --- a/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/KhaldunSummoner.cs +++ b/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/KhaldunSummoner.cs @@ -75,25 +75,13 @@ namespace Server.Mobiles public override bool AlwaysMurderer => true; public override bool Unprovokable => true; - public override int GetIdleSound() - { - return 0x184; - } + public override int GetIdleSound() => 0x184; - public override int GetAngerSound() - { - return 0x286; - } + public override int GetAngerSound() => 0x286; - public override int GetDeathSound() - { - return 0x288; - } + public override int GetDeathSound() => 0x288; - public override int GetHurtSound() - { - return 0x19F; - } + public override int GetHurtSound() => 0x19F; public override bool OnBeforeDeath() { diff --git a/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/KhaldunZealot.cs b/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/KhaldunZealot.cs index f0fc293c4..b01f3900e 100644 --- a/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/KhaldunZealot.cs +++ b/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/KhaldunZealot.cs @@ -84,25 +84,13 @@ namespace Server.Mobiles public override bool Unprovokable => true; public override Poison PoisonImmune => Poison.Deadly; - public override int GetIdleSound() - { - return 0x184; - } + public override int GetIdleSound() => 0x184; - public override int GetAngerSound() - { - return 0x286; - } + public override int GetAngerSound() => 0x286; - public override int GetDeathSound() - { - return 0x288; - } + public override int GetDeathSound() => 0x288; - public override int GetHurtSound() - { - return 0x19F; - } + public override int GetHurtSound() => 0x19F; public override bool OnBeforeDeath() { diff --git a/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/Moloch.cs b/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/Moloch.cs index c8887d418..ce0c77665 100644 --- a/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/Moloch.cs +++ b/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/Moloch.cs @@ -44,10 +44,7 @@ namespace Server.Mobiles public override Poison PoisonImmune => Poison.Regular; - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.ConcussionBlow; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.ConcussionBlow; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/RestlessSoul.cs b/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/RestlessSoul.cs index e339f1512..38339ef8f 100644 --- a/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/RestlessSoul.cs +++ b/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/RestlessSoul.cs @@ -68,20 +68,11 @@ namespace Server.Mobiles list.RemoveAt(i--); } - public override int GetIdleSound() - { - return 0x107; - } + public override int GetIdleSound() => 0x107; - public override int GetAngerSound() - { - return 0x1BF; - } + public override int GetAngerSound() => 0x1BF; - public override int GetDeathSound() - { - return 0xFD; - } + public override int GetDeathSound() => 0xFD; public override bool IsEnemy(Mobile m) { diff --git a/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/ShadowFiend.cs b/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/ShadowFiend.cs index 37d98c82e..b13112a87 100644 --- a/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/ShadowFiend.cs +++ b/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/ShadowFiend.cs @@ -56,30 +56,15 @@ namespace Server.Mobiles public override bool CanRummageCorpses => true; - public override int GetIdleSound() - { - return 0x37A; - } + public override int GetIdleSound() => 0x37A; - public override int GetAngerSound() - { - return 0x379; - } + public override int GetAngerSound() => 0x379; - public override int GetDeathSound() - { - return 0x381; - } + public override int GetDeathSound() => 0x381; - public override int GetAttackSound() - { - return 0x37F; - } + public override int GetAttackSound() => 0x37F; - public override int GetHurtSound() - { - return 0x380; - } + public override int GetHurtSound() => 0x380; public override bool OnBeforeDeath() { diff --git a/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/SpectralArmour.cs b/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/SpectralArmour.cs index 0e7480460..c40faf404 100644 --- a/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/SpectralArmour.cs +++ b/Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/SpectralArmour.cs @@ -60,15 +60,9 @@ namespace Server.Mobiles public override Poison PoisonImmune => Poison.Regular; - public override int GetIdleSound() - { - return 0x200; - } + public override int GetIdleSound() => 0x200; - public override int GetAngerSound() - { - return 0x56; - } + public override int GetAngerSound() => 0x56; public override bool OnBeforeDeath() { diff --git a/Projects/Scripts/Mobiles/Monsters/LBR/Exodus/ExodusMinion.cs b/Projects/Scripts/Mobiles/Monsters/LBR/Exodus/ExodusMinion.cs index 17d4eb230..5eb6ae499 100644 --- a/Projects/Scripts/Mobiles/Monsters/LBR/Exodus/ExodusMinion.cs +++ b/Projects/Scripts/Mobiles/Monsters/LBR/Exodus/ExodusMinion.cs @@ -76,30 +76,15 @@ namespace Server.Mobiles AddLoot(LootPack.Rich); } - public override int GetIdleSound() - { - return 0x218; - } + public override int GetIdleSound() => 0x218; - public override int GetAngerSound() - { - return 0x26C; - } + public override int GetAngerSound() => 0x26C; - public override int GetDeathSound() - { - return 0x211; - } + public override int GetDeathSound() => 0x211; - public override int GetAttackSound() - { - return 0x232; - } + public override int GetAttackSound() => 0x232; - public override int GetHurtSound() - { - return 0x140; - } + public override int GetHurtSound() => 0x140; public override void AlterMeleeDamageFrom(Mobile from, ref int damage) { diff --git a/Projects/Scripts/Mobiles/Monsters/LBR/Exodus/ExodusOverseer.cs b/Projects/Scripts/Mobiles/Monsters/LBR/Exodus/ExodusOverseer.cs index b15f26207..d6bb29e57 100644 --- a/Projects/Scripts/Mobiles/Monsters/LBR/Exodus/ExodusOverseer.cs +++ b/Projects/Scripts/Mobiles/Monsters/LBR/Exodus/ExodusOverseer.cs @@ -66,30 +66,15 @@ namespace Server.Mobiles AddLoot(LootPack.Rich); } - public override int GetIdleSound() - { - return 0xFD; - } + public override int GetIdleSound() => 0xFD; - public override int GetAngerSound() - { - return 0x26C; - } + public override int GetAngerSound() => 0x26C; - public override int GetDeathSound() - { - return 0x211; - } + public override int GetDeathSound() => 0x211; - public override int GetAttackSound() - { - return 0x23B; - } + public override int GetAttackSound() => 0x23B; - public override int GetHurtSound() - { - return 0x140; - } + public override int GetHurtSound() => 0x140; public override void AlterMeleeDamageFrom(Mobile from, ref int damage) { diff --git a/Projects/Scripts/Mobiles/Monsters/LBR/Jukas/ChaosDragoon.cs b/Projects/Scripts/Mobiles/Monsters/LBR/Jukas/ChaosDragoon.cs index 169b2cc62..9d2b18b15 100644 --- a/Projects/Scripts/Mobiles/Monsters/LBR/Jukas/ChaosDragoon.cs +++ b/Projects/Scripts/Mobiles/Monsters/LBR/Jukas/ChaosDragoon.cs @@ -155,25 +155,13 @@ namespace Server.Mobiles public override bool AlwaysMurderer => true; public override bool ShowFameTitle => false; - public override int GetIdleSound() - { - return 0x2CE; - } + public override int GetIdleSound() => 0x2CE; - public override int GetDeathSound() - { - return 0x2CC; - } + public override int GetDeathSound() => 0x2CC; - public override int GetHurtSound() - { - return 0x2D1; - } + public override int GetHurtSound() => 0x2D1; - public override int GetAttackSound() - { - return 0x2C8; - } + public override int GetAttackSound() => 0x2C8; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Monsters/LBR/Jukas/ChaosDragoonElite.cs b/Projects/Scripts/Mobiles/Monsters/LBR/Jukas/ChaosDragoonElite.cs index 3451d6d0e..d45bf6b0c 100644 --- a/Projects/Scripts/Mobiles/Monsters/LBR/Jukas/ChaosDragoonElite.cs +++ b/Projects/Scripts/Mobiles/Monsters/LBR/Jukas/ChaosDragoonElite.cs @@ -192,25 +192,13 @@ namespace Server.Mobiles public override bool AlwaysMurderer => true; public override bool ShowFameTitle => false; - public override int GetIdleSound() - { - return 0x2CE; - } + public override int GetIdleSound() => 0x2CE; - public override int GetDeathSound() - { - return 0x2CC; - } + public override int GetDeathSound() => 0x2CC; - public override int GetHurtSound() - { - return 0x2D1; - } + public override int GetHurtSound() => 0x2D1; - public override int GetAttackSound() - { - return 0x2C8; - } + public override int GetAttackSound() => 0x2C8; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Monsters/LBR/Jukas/JukaLord.cs b/Projects/Scripts/Mobiles/Monsters/LBR/Jukas/JukaLord.cs index 04c21ea30..e90400a27 100644 --- a/Projects/Scripts/Mobiles/Monsters/LBR/Jukas/JukaLord.cs +++ b/Projects/Scripts/Mobiles/Monsters/LBR/Jukas/JukaLord.cs @@ -90,25 +90,13 @@ namespace Server.Mobiles base.OnDamage(amount, from, willKill); } - public override int GetIdleSound() - { - return 0x262; - } + public override int GetIdleSound() => 0x262; - public override int GetAngerSound() - { - return 0x263; - } + public override int GetAngerSound() => 0x263; - public override int GetHurtSound() - { - return 0x1D0; - } + public override int GetHurtSound() => 0x1D0; - public override int GetDeathSound() - { - return 0x28D; - } + public override int GetDeathSound() => 0x28D; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/LBR/Jukas/JukaMage.cs b/Projects/Scripts/Mobiles/Monsters/LBR/Jukas/JukaMage.cs index 159f54faf..146e9a9e9 100644 --- a/Projects/Scripts/Mobiles/Monsters/LBR/Jukas/JukaMage.cs +++ b/Projects/Scripts/Mobiles/Monsters/LBR/Jukas/JukaMage.cs @@ -85,25 +85,13 @@ namespace Server.Mobiles AddLoot(LootPack.MedScrolls, 2); } - public override int GetIdleSound() - { - return 0x1AC; - } + public override int GetIdleSound() => 0x1AC; - public override int GetAngerSound() - { - return 0x1CD; - } + public override int GetAngerSound() => 0x1CD; - public override int GetHurtSound() - { - return 0x1D0; - } + public override int GetHurtSound() => 0x1D0; - public override int GetDeathSound() - { - return 0x28D; - } + public override int GetDeathSound() => 0x28D; public override void OnThink() { diff --git a/Projects/Scripts/Mobiles/Monsters/LBR/Jukas/JukaWarrior.cs b/Projects/Scripts/Mobiles/Monsters/LBR/Jukas/JukaWarrior.cs index 5ba4e0be6..3641abb3e 100644 --- a/Projects/Scripts/Mobiles/Monsters/LBR/Jukas/JukaWarrior.cs +++ b/Projects/Scripts/Mobiles/Monsters/LBR/Jukas/JukaWarrior.cs @@ -61,25 +61,13 @@ namespace Server.Mobiles AddLoot(LootPack.Gems, 1); } - public override int GetIdleSound() - { - return 0x1AC; - } + public override int GetIdleSound() => 0x1AC; - public override int GetAngerSound() - { - return 0x1CD; - } + public override int GetAngerSound() => 0x1CD; - public override int GetHurtSound() - { - return 0x1D0; - } + public override int GetHurtSound() => 0x1D0; - public override int GetDeathSound() - { - return 0x28D; - } + public override int GetDeathSound() => 0x28D; public override void OnGaveMeleeAttack(Mobile defender) { diff --git a/Projects/Scripts/Mobiles/Monsters/LBR/Meers/EnragedCreatures.cs b/Projects/Scripts/Mobiles/Monsters/LBR/Meers/EnragedCreatures.cs index 8212fa2fc..1457b3edd 100644 --- a/Projects/Scripts/Mobiles/Monsters/LBR/Meers/EnragedCreatures.cs +++ b/Projects/Scripts/Mobiles/Monsters/LBR/Meers/EnragedCreatures.cs @@ -4,10 +4,7 @@ namespace Server.Mobiles { public class EnragedRabbit : BaseEnraged { - public EnragedRabbit(Mobile summoner) : base(summoner) - { - Body = 0xcd; - } + public EnragedRabbit(Mobile summoner) : base(summoner) => Body = 0xcd; public EnragedRabbit(Serial serial) : base(serial) { @@ -16,20 +13,11 @@ namespace Server.Mobiles public override string CorpseName => "a hare corpse"; public override string DefaultName => "a rabbit"; - public override int GetAttackSound() - { - return 0xC9; - } + public override int GetAttackSound() => 0xC9; - public override int GetHurtSound() - { - return 0xCA; - } + public override int GetHurtSound() => 0xCA; - public override int GetDeathSound() - { - return 0xCB; - } + public override int GetDeathSound() => 0xCB; public override void Serialize(GenericWriter writer) { @@ -46,10 +34,7 @@ namespace Server.Mobiles public class EnragedHart : BaseEnraged { - public EnragedHart(Mobile summoner) : base(summoner) - { - Body = 0xea; - } + public EnragedHart(Mobile summoner) : base(summoner) => Body = 0xea; public EnragedHart(Serial serial) : base(serial) { @@ -58,20 +43,11 @@ namespace Server.Mobiles public override string CorpseName => "a deer corpse"; public override string DefaultName => "a great hart"; - public override int GetAttackSound() - { - return 0x82; - } + public override int GetAttackSound() => 0x82; - public override int GetHurtSound() - { - return 0x83; - } + public override int GetHurtSound() => 0x83; - public override int GetDeathSound() - { - return 0x84; - } + public override int GetDeathSound() => 0x84; public override void Serialize(GenericWriter writer) { @@ -88,10 +64,7 @@ namespace Server.Mobiles public class EnragedHind : BaseEnraged { - public EnragedHind(Mobile summoner) : base(summoner) - { - Body = 0xed; - } + public EnragedHind(Mobile summoner) : base(summoner) => Body = 0xed; public EnragedHind(Serial serial) : base(serial) { @@ -100,20 +73,11 @@ namespace Server.Mobiles public override string CorpseName => "a deer corpse"; public override string DefaultName => "a hind"; - public override int GetAttackSound() - { - return 0x82; - } + public override int GetAttackSound() => 0x82; - public override int GetHurtSound() - { - return 0x83; - } + public override int GetHurtSound() => 0x83; - public override int GetDeathSound() - { - return 0x84; - } + public override int GetDeathSound() => 0x84; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/LBR/Meers/MeerCaptain.cs b/Projects/Scripts/Mobiles/Monsters/LBR/Meers/MeerCaptain.cs index 239b2e436..4deb6abbc 100644 --- a/Projects/Scripts/Mobiles/Monsters/LBR/Meers/MeerCaptain.cs +++ b/Projects/Scripts/Mobiles/Monsters/LBR/Meers/MeerCaptain.cs @@ -107,20 +107,11 @@ namespace Server.Mobiles AddLoot(LootPack.Meager); } - public override int GetHurtSound() - { - return 0x14D; - } + public override int GetHurtSound() => 0x14D; - public override int GetDeathSound() - { - return 0x314; - } + public override int GetDeathSound() => 0x314; - public override int GetAttackSound() - { - return 0x75; - } + public override int GetAttackSound() => 0x75; public override void OnThink() { diff --git a/Projects/Scripts/Mobiles/Monsters/LBR/Meers/MeerEternal.cs b/Projects/Scripts/Mobiles/Monsters/LBR/Meers/MeerEternal.cs index 57f3ca6a8..817e1c4c9 100644 --- a/Projects/Scripts/Mobiles/Monsters/LBR/Meers/MeerEternal.cs +++ b/Projects/Scripts/Mobiles/Monsters/LBR/Meers/MeerEternal.cs @@ -66,20 +66,11 @@ namespace Server.Mobiles AddLoot(LootPack.HighScrolls, 2); } - public override int GetHurtSound() - { - return 0x167; - } + public override int GetHurtSound() => 0x167; - public override int GetDeathSound() - { - return 0xBC; - } + public override int GetDeathSound() => 0xBC; - public override int GetAttackSound() - { - return 0x28B; - } + public override int GetAttackSound() => 0x28B; private void DoAreaLeech() { diff --git a/Projects/Scripts/Mobiles/Monsters/LBR/Meers/MeerMage.cs b/Projects/Scripts/Mobiles/Monsters/LBR/Meers/MeerMage.cs index c1b84caff..587410cda 100644 --- a/Projects/Scripts/Mobiles/Monsters/LBR/Meers/MeerMage.cs +++ b/Projects/Scripts/Mobiles/Monsters/LBR/Meers/MeerMage.cs @@ -68,20 +68,11 @@ namespace Server.Mobiles // TODO: Daemon bone ... } - public override int GetHurtSound() - { - return 0x14D; - } + public override int GetHurtSound() => 0x14D; - public override int GetDeathSound() - { - return 0x314; - } + public override int GetDeathSound() => 0x314; - public override int GetAttackSound() - { - return 0x75; - } + public override int GetAttackSound() => 0x75; public override void OnThink() { @@ -157,10 +148,7 @@ namespace Server.Mobiles base.OnThink(); } - public static bool UnderEffect(Mobile m) - { - return m_Table.ContainsKey(m); - } + public static bool UnderEffect(Mobile m) => m_Table.ContainsKey(m); public static void StopEffect(Mobile m, bool message) { diff --git a/Projects/Scripts/Mobiles/Monsters/LBR/Meers/MeerWarrior.cs b/Projects/Scripts/Mobiles/Monsters/LBR/Meers/MeerWarrior.cs index e45c726f2..2d6c86662 100644 --- a/Projects/Scripts/Mobiles/Monsters/LBR/Meers/MeerWarrior.cs +++ b/Projects/Scripts/Mobiles/Monsters/LBR/Meers/MeerWarrior.cs @@ -65,15 +65,9 @@ namespace Server.Mobiles base.OnDamage(amount, from, willKill); } - public override int GetHurtSound() - { - return 0x156; - } + public override int GetHurtSound() => 0x156; - public override int GetDeathSound() - { - return 0x15C; - } + public override int GetDeathSound() => 0x15C; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/ML/Animal/CuSidhe.cs b/Projects/Scripts/Mobiles/Monsters/ML/Animal/CuSidhe.cs index df1e683ea..aee725509 100644 --- a/Projects/Scripts/Mobiles/Monsters/ML/Animal/CuSidhe.cs +++ b/Projects/Scripts/Mobiles/Monsters/ML/Animal/CuSidhe.cs @@ -99,35 +99,17 @@ namespace Server.Mobiles base.OnDoubleClick(from); } - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.BleedAttack; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.BleedAttack; - public override int GetIdleSound() - { - return 0x577; - } + public override int GetIdleSound() => 0x577; - public override int GetAttackSound() - { - return 0x576; - } + public override int GetAttackSound() => 0x576; - public override int GetAngerSound() - { - return 0x578; - } + public override int GetAngerSound() => 0x578; - public override int GetHurtSound() - { - return 0x576; - } + public override int GetHurtSound() => 0x576; - public override int GetDeathSound() - { - return 0x579; - } + public override int GetDeathSound() => 0x579; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/ML/Bedlam/LadyMarai.cs b/Projects/Scripts/Mobiles/Monsters/ML/Bedlam/LadyMarai.cs index 4f630e331..61ead8fad 100644 --- a/Projects/Scripts/Mobiles/Monsters/ML/Bedlam/LadyMarai.cs +++ b/Projects/Scripts/Mobiles/Monsters/ML/Bedlam/LadyMarai.cs @@ -66,10 +66,7 @@ namespace Server.Mobiles AddLoot(LootPack.UltraRich, 3); } - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.CrushingBlow; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.CrushingBlow; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/ML/Bedlam/MasterTheophilus.cs b/Projects/Scripts/Mobiles/Monsters/ML/Bedlam/MasterTheophilus.cs index 1aa1c96a2..2c536c337 100644 --- a/Projects/Scripts/Mobiles/Monsters/ML/Bedlam/MasterTheophilus.cs +++ b/Projects/Scripts/Mobiles/Monsters/ML/Bedlam/MasterTheophilus.cs @@ -70,10 +70,7 @@ namespace Server.Mobiles AddLoot(LootPack.UltraRich, 3); } - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.ParalyzingBlow; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.ParalyzingBlow; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/ML/Bedlam/RedDeath.cs b/Projects/Scripts/Mobiles/Monsters/ML/Bedlam/RedDeath.cs index a1fbb9756..96b975420 100644 --- a/Projects/Scripts/Mobiles/Monsters/ML/Bedlam/RedDeath.cs +++ b/Projects/Scripts/Mobiles/Monsters/ML/Bedlam/RedDeath.cs @@ -66,10 +66,7 @@ namespace Server.Mobiles AddLoot(LootPack.UltraRich, 3); } - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.WhirlwindAttack; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.WhirlwindAttack; public override void OnDeath(Container c) { diff --git a/Projects/Scripts/Mobiles/Monsters/ML/Blighted Grove/Coil.cs b/Projects/Scripts/Mobiles/Monsters/ML/Blighted Grove/Coil.cs index a6ab8c2db..fabe81d3e 100644 --- a/Projects/Scripts/Mobiles/Monsters/ML/Blighted Grove/Coil.cs +++ b/Projects/Scripts/Mobiles/Monsters/ML/Blighted Grove/Coil.cs @@ -61,10 +61,7 @@ namespace Server.Mobiles AddLoot(LootPack.UltraRich, 3); } - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.MortalStrike; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.MortalStrike; public override void OnDeath(Container c) { diff --git a/Projects/Scripts/Mobiles/Monsters/ML/Blighted Grove/Thrasher.cs b/Projects/Scripts/Mobiles/Monsters/ML/Blighted Grove/Thrasher.cs index ccd4eff03..50689d89a 100644 --- a/Projects/Scripts/Mobiles/Monsters/ML/Blighted Grove/Thrasher.cs +++ b/Projects/Scripts/Mobiles/Monsters/ML/Blighted Grove/Thrasher.cs @@ -51,10 +51,7 @@ namespace Server.Mobiles AddLoot(LootPack.FilthyRich, 4); } - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.ArmorIgnore; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.ArmorIgnore; public override void OnDeath(Container c) { diff --git a/Projects/Scripts/Mobiles/Monsters/ML/Humanoid/Magic/FetidEssence.cs b/Projects/Scripts/Mobiles/Monsters/ML/Humanoid/Magic/FetidEssence.cs index 7b91c4ec2..88d1134a6 100644 --- a/Projects/Scripts/Mobiles/Monsters/ML/Humanoid/Magic/FetidEssence.cs +++ b/Projects/Scripts/Mobiles/Monsters/ML/Humanoid/Magic/FetidEssence.cs @@ -52,30 +52,15 @@ namespace Server.Mobiles AddLoot(LootPack.FilthyRich); } - public override int GetAngerSound() - { - return 0x56d; - } + public override int GetAngerSound() => 0x56d; - public override int GetIdleSound() - { - return 0x56b; - } + public override int GetIdleSound() => 0x56b; - public override int GetAttackSound() - { - return 0x56c; - } + public override int GetAttackSound() => 0x56c; - public override int GetHurtSound() - { - return 0x56c; - } + public override int GetHurtSound() => 0x56c; - public override int GetDeathSound() - { - return 0x56e; - } + public override int GetDeathSound() => 0x56e; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/ML/Humanoid/Magic/InterredGrizzle .cs b/Projects/Scripts/Mobiles/Monsters/ML/Humanoid/Magic/InterredGrizzle .cs index 9cfd6064c..799dd89bb 100644 --- a/Projects/Scripts/Mobiles/Monsters/ML/Humanoid/Magic/InterredGrizzle .cs +++ b/Projects/Scripts/Mobiles/Monsters/ML/Humanoid/Magic/InterredGrizzle .cs @@ -68,30 +68,15 @@ namespace Server.Mobiles * Acid last 10 seconds */ - public override int GetAngerSound() - { - return 0x581; - } + public override int GetAngerSound() => 0x581; - public override int GetIdleSound() - { - return 0x582; - } + public override int GetIdleSound() => 0x582; - public override int GetAttackSound() - { - return 0x580; - } + public override int GetAttackSound() => 0x580; - public override int GetHurtSound() - { - return 0x583; - } + public override int GetHurtSound() => 0x583; - public override int GetDeathSound() - { - return 0x584; - } + public override int GetDeathSound() => 0x584; public override void OnDamage(int amount, Mobile from, bool willKill) { @@ -101,15 +86,9 @@ namespace Server.Mobiles base.OnDamage(amount, from, willKill); } - private int RandomPoint(int mid) - { - return mid + Utility.RandomMinMax(-2, 2); - } + private int RandomPoint(int mid) => mid + Utility.RandomMinMax(-2, 2); - public virtual Point3D GetSpawnPosition(int range) - { - return GetSpawnPosition(Location, Map, range); - } + public virtual Point3D GetSpawnPosition(int range) => GetSpawnPosition(Location, Map, range); public virtual Point3D GetSpawnPosition(Point3D from, Map map, int range) { diff --git a/Projects/Scripts/Mobiles/Monsters/ML/Humanoid/Magic/MLDryad.cs b/Projects/Scripts/Mobiles/Monsters/ML/Humanoid/Magic/MLDryad.cs index 404cacd4f..d8fa3cd45 100644 --- a/Projects/Scripts/Mobiles/Monsters/ML/Humanoid/Magic/MLDryad.cs +++ b/Projects/Scripts/Mobiles/Monsters/ML/Humanoid/Magic/MLDryad.cs @@ -114,11 +114,9 @@ namespace Server.Mobiles PlaySound(0x1D3); } - public bool IsValidTarget(PlayerMobile m) - { - return m?.PeacedUntil < DateTime.UtcNow && !m.Hidden && m.AccessLevel == AccessLevel.Player && - CanBeHarmful(m); - } + public bool IsValidTarget(PlayerMobile m) => + m?.PeacedUntil < DateTime.UtcNow && !m.Hidden && m.AccessLevel == AccessLevel.Player && + CanBeHarmful(m); #endregion diff --git a/Projects/Scripts/Mobiles/Monsters/ML/Humanoid/Melee/CorruptedSoul.cs b/Projects/Scripts/Mobiles/Monsters/ML/Humanoid/Melee/CorruptedSoul.cs index 2c15e24f3..fb9f7abae 100644 --- a/Projects/Scripts/Mobiles/Monsters/ML/Humanoid/Melee/CorruptedSoul.cs +++ b/Projects/Scripts/Mobiles/Monsters/ML/Humanoid/Melee/CorruptedSoul.cs @@ -59,10 +59,7 @@ namespace Server.Mobiles return 0x0; }*/ - public override int GetAttackSound() - { - return 0x233; - } + public override int GetAttackSound() => 0x233; // TODO: Proper OnDeath Effect diff --git a/Projects/Scripts/Mobiles/Monsters/ML/Humanoid/Melee/FerelTreefellow.cs b/Projects/Scripts/Mobiles/Monsters/ML/Humanoid/Melee/FerelTreefellow.cs index b873d1021..b7272e3b6 100644 --- a/Projects/Scripts/Mobiles/Monsters/ML/Humanoid/Melee/FerelTreefellow.cs +++ b/Projects/Scripts/Mobiles/Monsters/ML/Humanoid/Melee/FerelTreefellow.cs @@ -48,25 +48,13 @@ namespace Server.Mobiles public override bool BleedImmune => true; - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.Dismount; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.Dismount; - public override int GetIdleSound() - { - return 443; - } + public override int GetIdleSound() => 443; - public override int GetDeathSound() - { - return 31; - } + public override int GetDeathSound() => 31; - public override int GetAttackSound() - { - return 672; - } + public override int GetAttackSound() => 672; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Monsters/ML/Humanoid/Melee/Minotaur.cs b/Projects/Scripts/Mobiles/Monsters/ML/Humanoid/Melee/Minotaur.cs index 39bd2492e..de51cc662 100644 --- a/Projects/Scripts/Mobiles/Monsters/ML/Humanoid/Melee/Minotaur.cs +++ b/Projects/Scripts/Mobiles/Monsters/ML/Humanoid/Melee/Minotaur.cs @@ -48,10 +48,7 @@ namespace Server.Mobiles public override string DefaultName => "a minotaur"; - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.ParalyzingBlow; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.ParalyzingBlow; public override void GenerateLoot() { @@ -59,30 +56,15 @@ namespace Server.Mobiles } // Using Tormented Minotaur sounds - Need to veryfy - public override int GetAngerSound() - { - return 0x597; - } + public override int GetAngerSound() => 0x597; - public override int GetIdleSound() - { - return 0x596; - } + public override int GetIdleSound() => 0x596; - public override int GetAttackSound() - { - return 0x599; - } + public override int GetAttackSound() => 0x599; - public override int GetHurtSound() - { - return 0x59a; - } + public override int GetHurtSound() => 0x59a; - public override int GetDeathSound() - { - return 0x59c; - } + public override int GetDeathSound() => 0x59c; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/ML/Humanoid/Melee/MinotaurCaptain.cs b/Projects/Scripts/Mobiles/Monsters/ML/Humanoid/Melee/MinotaurCaptain.cs index 6cb075bc6..a299b4614 100644 --- a/Projects/Scripts/Mobiles/Monsters/ML/Humanoid/Melee/MinotaurCaptain.cs +++ b/Projects/Scripts/Mobiles/Monsters/ML/Humanoid/Melee/MinotaurCaptain.cs @@ -48,10 +48,7 @@ namespace Server.Mobiles public override string DefaultName => "a minotaur captain"; - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.ParalyzingBlow; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.ParalyzingBlow; public override void GenerateLoot() { @@ -59,30 +56,15 @@ namespace Server.Mobiles } // Using Tormented Minotaur sounds - Need to veryfy - public override int GetAngerSound() - { - return 0x597; - } + public override int GetAngerSound() => 0x597; - public override int GetIdleSound() - { - return 0x596; - } + public override int GetIdleSound() => 0x596; - public override int GetAttackSound() - { - return 0x599; - } + public override int GetAttackSound() => 0x599; - public override int GetHurtSound() - { - return 0x59a; - } + public override int GetHurtSound() => 0x59a; - public override int GetDeathSound() - { - return 0x59c; - } + public override int GetDeathSound() => 0x59c; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/ML/Humanoid/Melee/MinotaurScout.cs b/Projects/Scripts/Mobiles/Monsters/ML/Humanoid/Melee/MinotaurScout.cs index de318167c..3685a2938 100644 --- a/Projects/Scripts/Mobiles/Monsters/ML/Humanoid/Melee/MinotaurScout.cs +++ b/Projects/Scripts/Mobiles/Monsters/ML/Humanoid/Melee/MinotaurScout.cs @@ -48,10 +48,7 @@ namespace Server.Mobiles public override string DefaultName => "a minotaur scout"; - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.ParalyzingBlow; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.ParalyzingBlow; public override void GenerateLoot() { @@ -59,30 +56,15 @@ namespace Server.Mobiles } // Using Tormented Minotaur sounds - Need to veryfy - public override int GetAngerSound() - { - return 0x597; - } + public override int GetAngerSound() => 0x597; - public override int GetIdleSound() - { - return 0x596; - } + public override int GetIdleSound() => 0x596; - public override int GetAttackSound() - { - return 0x599; - } + public override int GetAttackSound() => 0x599; - public override int GetHurtSound() - { - return 0x59a; - } + public override int GetHurtSound() => 0x59a; - public override int GetDeathSound() - { - return 0x59c; - } + public override int GetDeathSound() => 0x59c; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/ML/Humanoid/Melee/Tormented Minotaur.cs b/Projects/Scripts/Mobiles/Monsters/ML/Humanoid/Melee/Tormented Minotaur.cs index 981fa0a16..287503658 100644 --- a/Projects/Scripts/Mobiles/Monsters/ML/Humanoid/Melee/Tormented Minotaur.cs +++ b/Projects/Scripts/Mobiles/Monsters/ML/Humanoid/Melee/Tormented Minotaur.cs @@ -45,40 +45,22 @@ namespace Server.Mobiles public override Poison PoisonImmune => Poison.Deadly; public override int TreasureMapLevel => 3; - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.Dismount; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.Dismount; public override void GenerateLoot() { AddLoot(LootPack.FilthyRich, 10); } - public override int GetDeathSound() - { - return 0x596; - } + public override int GetDeathSound() => 0x596; - public override int GetAttackSound() - { - return 0x597; - } + public override int GetAttackSound() => 0x597; - public override int GetIdleSound() - { - return 0x598; - } + public override int GetIdleSound() => 0x598; - public override int GetAngerSound() - { - return 0x599; - } + public override int GetAngerSound() => 0x599; - public override int GetHurtSound() - { - return 0x59A; - } + public override int GetHurtSound() => 0x59A; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/ML/Labyrinth/Miasma.cs b/Projects/Scripts/Mobiles/Monsters/ML/Labyrinth/Miasma.cs index 0236bd164..1d7c544df 100644 --- a/Projects/Scripts/Mobiles/Monsters/ML/Labyrinth/Miasma.cs +++ b/Projects/Scripts/Mobiles/Monsters/ML/Labyrinth/Miasma.cs @@ -91,10 +91,7 @@ namespace Server.Mobiles AddLoot(LootPack.UltraRich, 4); } - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.MortalStrike; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.MortalStrike; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/ML/Misc/Magic/GreaterDragon.cs b/Projects/Scripts/Mobiles/Monsters/ML/Misc/Magic/GreaterDragon.cs index c722410a4..2a82ddbd4 100644 --- a/Projects/Scripts/Mobiles/Monsters/ML/Misc/Magic/GreaterDragon.cs +++ b/Projects/Scripts/Mobiles/Monsters/ML/Misc/Magic/GreaterDragon.cs @@ -74,10 +74,7 @@ namespace Server.Mobiles AddLoot(LootPack.Gems, 8); } - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.BleedAttack; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.BleedAttack; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/ML/Misc/Melee/Reptalon.cs b/Projects/Scripts/Mobiles/Monsters/ML/Misc/Melee/Reptalon.cs index 704466ae5..69fd5f9de 100644 --- a/Projects/Scripts/Mobiles/Monsters/ML/Misc/Melee/Reptalon.cs +++ b/Projects/Scripts/Mobiles/Monsters/ML/Misc/Melee/Reptalon.cs @@ -57,10 +57,7 @@ namespace Server.Mobiles AddLoot(LootPack.AosUltraRich, 3); } - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.ParalyzingBlow; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.ParalyzingBlow; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/ML/Painted Caves/Lurg.cs b/Projects/Scripts/Mobiles/Monsters/ML/Painted Caves/Lurg.cs index af030fd84..176c966bf 100644 --- a/Projects/Scripts/Mobiles/Monsters/ML/Painted Caves/Lurg.cs +++ b/Projects/Scripts/Mobiles/Monsters/ML/Painted Caves/Lurg.cs @@ -55,10 +55,7 @@ namespace Server.Mobiles AddLoot(LootPack.UltraRich, 2); } - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.CrushingBlow; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.CrushingBlow; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/ML/Prism of Light/CrystalLatticeSeeker.cs b/Projects/Scripts/Mobiles/Monsters/ML/Prism of Light/CrystalLatticeSeeker.cs index 92698fcea..7a58f9521 100644 --- a/Projects/Scripts/Mobiles/Monsters/ML/Prism of Light/CrystalLatticeSeeker.cs +++ b/Projects/Scripts/Mobiles/Monsters/ML/Prism of Light/CrystalLatticeSeeker.cs @@ -127,30 +127,15 @@ namespace Server.Mobiles } } - public override int GetAttackSound() - { - return 0x2F6; - } + public override int GetAttackSound() => 0x2F6; - public override int GetDeathSound() - { - return 0x2F7; - } + public override int GetDeathSound() => 0x2F7; - public override int GetAngerSound() - { - return 0x2F8; - } + public override int GetAngerSound() => 0x2F8; - public override int GetHurtSound() - { - return 0x2F9; - } + public override int GetHurtSound() => 0x2F9; - public override int GetIdleSound() - { - return 0x2FA; - } + public override int GetIdleSound() => 0x2FA; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/ML/Prism of Light/CrystalVortex.cs b/Projects/Scripts/Mobiles/Monsters/ML/Prism of Light/CrystalVortex.cs index de833287c..ff607f401 100644 --- a/Projects/Scripts/Mobiles/Monsters/ML/Prism of Light/CrystalVortex.cs +++ b/Projects/Scripts/Mobiles/Monsters/ML/Prism of Light/CrystalVortex.cs @@ -68,15 +68,9 @@ namespace Server.Mobiles } */ - public override int GetAngerSound() - { - return 0x15; - } + public override int GetAngerSound() => 0x15; - public override int GetAttackSound() - { - return 0x28; - } + public override int GetAttackSound() => 0x28; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/ML/Special/Ilhenir.cs b/Projects/Scripts/Mobiles/Monsters/ML/Special/Ilhenir.cs index c30a17384..0d05094af 100644 --- a/Projects/Scripts/Mobiles/Monsters/ML/Special/Ilhenir.cs +++ b/Projects/Scripts/Mobiles/Monsters/ML/Special/Ilhenir.cs @@ -189,30 +189,15 @@ namespace Server.Mobiles base.OnDamage(amount, from, willKill); } - public override int GetAngerSound() - { - return 0x581; - } + public override int GetAngerSound() => 0x581; - public override int GetIdleSound() - { - return 0x582; - } + public override int GetIdleSound() => 0x582; - public override int GetAttackSound() - { - return 0x580; - } + public override int GetAttackSound() => 0x580; - public override int GetHurtSound() - { - return 0x583; - } + public override int GetHurtSound() => 0x583; - public override int GetDeathSound() - { - return 0x584; - } + public override int GetDeathSound() => 0x584; public override void Serialize(GenericWriter writer) { @@ -247,10 +232,7 @@ namespace Server.Mobiles from.Send(SpeedControl.Disable); } - public static bool UnderCacophonicAttack(Mobile from) - { - return m_Table.Contains(from); - } + public static bool UnderCacophonicAttack(Mobile from) => m_Table.Contains(from); public virtual void DropOoze() { @@ -282,15 +264,9 @@ namespace Server.Mobiles } } - private int RandomPoint(int mid) - { - return mid + Utility.RandomMinMax(-2, 2); - } + private int RandomPoint(int mid) => mid + Utility.RandomMinMax(-2, 2); - public virtual Point3D GetSpawnPosition(int range) - { - return GetSpawnPosition(Location, Map, range); - } + public virtual Point3D GetSpawnPosition(int range) => GetSpawnPosition(Location, Map, range); public virtual Point3D GetSpawnPosition(Point3D from, Map map, int range) { diff --git a/Projects/Scripts/Mobiles/Monsters/ML/Special/Meraktus.cs b/Projects/Scripts/Mobiles/Monsters/ML/Special/Meraktus.cs index a3bde8c16..8d0aef518 100644 --- a/Projects/Scripts/Mobiles/Monsters/ML/Special/Meraktus.cs +++ b/Projects/Scripts/Mobiles/Monsters/ML/Special/Meraktus.cs @@ -84,10 +84,7 @@ namespace Server.Mobiles public override bool Unprovokable => true; public override bool Uncalmable => true; - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.Dismount; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.Dismount; public virtual void PackResources(int amount) { @@ -158,30 +155,15 @@ namespace Server.Mobiles AddLoot(LootPack.AosSuperBoss, 5); // Need to verify } - public override int GetAngerSound() - { - return 0x597; - } + public override int GetAngerSound() => 0x597; - public override int GetIdleSound() - { - return 0x596; - } + public override int GetIdleSound() => 0x596; - public override int GetAttackSound() - { - return 0x599; - } + public override int GetAttackSound() => 0x599; - public override int GetHurtSound() - { - return 0x59a; - } + public override int GetHurtSound() => 0x59a; - public override int GetDeathSound() - { - return 0x59c; - } + public override int GetDeathSound() => 0x59c; public override void OnGaveMeleeAttack(Mobile defender) { diff --git a/Projects/Scripts/Mobiles/Monsters/ML/Twisted Weald/Changeling.cs b/Projects/Scripts/Mobiles/Monsters/ML/Twisted Weald/Changeling.cs index 30a8c0cec..f3b248427 100644 --- a/Projects/Scripts/Mobiles/Monsters/ML/Twisted Weald/Changeling.cs +++ b/Projects/Scripts/Mobiles/Monsters/ML/Twisted Weald/Changeling.cs @@ -110,30 +110,15 @@ namespace Server.Mobiles AddLoot(LootPack.AosRich, 3); } - public override int GetAngerSound() - { - return 0x46E; - } + public override int GetAngerSound() => 0x46E; - public override int GetIdleSound() - { - return 0x470; - } + public override int GetIdleSound() => 0x470; - public override int GetAttackSound() - { - return 0x46D; - } + public override int GetAttackSound() => 0x46D; - public override int GetHurtSound() - { - return 0x471; - } + public override int GetHurtSound() => 0x471; - public override int GetDeathSound() - { - return 0x46F; - } + public override int GetDeathSound() => 0x46F; public override void OnThink() { diff --git a/Projects/Scripts/Mobiles/Monsters/ML/Twisted Weald/LadyLissith.cs b/Projects/Scripts/Mobiles/Monsters/ML/Twisted Weald/LadyLissith.cs index 70a958d81..faf1a095f 100644 --- a/Projects/Scripts/Mobiles/Monsters/ML/Twisted Weald/LadyLissith.cs +++ b/Projects/Scripts/Mobiles/Monsters/ML/Twisted Weald/LadyLissith.cs @@ -70,10 +70,7 @@ namespace Server.Mobiles AddLoot(LootPack.UltraRich, 2); } - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.BleedAttack; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.BleedAttack; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/ML/Twisted Weald/LadySabrix.cs b/Projects/Scripts/Mobiles/Monsters/ML/Twisted Weald/LadySabrix.cs index b91f63fc6..b0c872527 100644 --- a/Projects/Scripts/Mobiles/Monsters/ML/Twisted Weald/LadySabrix.cs +++ b/Projects/Scripts/Mobiles/Monsters/ML/Twisted Weald/LadySabrix.cs @@ -76,10 +76,7 @@ namespace Server.Mobiles AddLoot(LootPack.UltraRich, 2); } - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.ArmorIgnore; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.ArmorIgnore; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/ML/Twisted Weald/Malefic.cs b/Projects/Scripts/Mobiles/Monsters/ML/Twisted Weald/Malefic.cs index a295b46a1..e030e0a61 100644 --- a/Projects/Scripts/Mobiles/Monsters/ML/Twisted Weald/Malefic.cs +++ b/Projects/Scripts/Mobiles/Monsters/ML/Twisted Weald/Malefic.cs @@ -61,10 +61,7 @@ namespace Server.Mobiles AddLoot(LootPack.UltraRich, 3); } - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.Dismount; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.Dismount; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/ML/Twisted Weald/Silk.cs b/Projects/Scripts/Mobiles/Monsters/ML/Twisted Weald/Silk.cs index 0f809fb6e..bcdd06ee3 100644 --- a/Projects/Scripts/Mobiles/Monsters/ML/Twisted Weald/Silk.cs +++ b/Projects/Scripts/Mobiles/Monsters/ML/Twisted Weald/Silk.cs @@ -53,10 +53,7 @@ namespace Server.Mobiles AddLoot(LootPack.UltraRich, 2); } - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.ParalyzingBlow; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.ParalyzingBlow; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/ML/Twisted Weald/Virulent.cs b/Projects/Scripts/Mobiles/Monsters/ML/Twisted Weald/Virulent.cs index e483a68cc..c56de74c1 100644 --- a/Projects/Scripts/Mobiles/Monsters/ML/Twisted Weald/Virulent.cs +++ b/Projects/Scripts/Mobiles/Monsters/ML/Twisted Weald/Virulent.cs @@ -75,10 +75,7 @@ namespace Server.Mobiles AddLoot(LootPack.UltraRich, 3); } - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.MortalStrike; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.MortalStrike; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/Mammal/Melee/VorpalBunny.cs b/Projects/Scripts/Mobiles/Monsters/Mammal/Melee/VorpalBunny.cs index 019c302b5..c7928f1b7 100644 --- a/Projects/Scripts/Mobiles/Monsters/Mammal/Melee/VorpalBunny.cs +++ b/Projects/Scripts/Mobiles/Monsters/Mammal/Melee/VorpalBunny.cs @@ -79,20 +79,11 @@ namespace Server.Mobiles Timer.DelayCall(TimeSpan.FromSeconds(5.0), Delete); } - public override int GetAttackSound() - { - return 0xC9; - } + public override int GetAttackSound() => 0xC9; - public override int GetHurtSound() - { - return 0xCA; - } + public override int GetHurtSound() => 0xCA; - public override int GetDeathSound() - { - return 0xCB; - } + public override int GetDeathSound() => 0xCB; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/Misc/Magic/EtherealWarrior.cs b/Projects/Scripts/Mobiles/Monsters/Misc/Magic/EtherealWarrior.cs index 2364c7f31..0b93d4bec 100644 --- a/Projects/Scripts/Mobiles/Monsters/Misc/Magic/EtherealWarrior.cs +++ b/Projects/Scripts/Mobiles/Monsters/Misc/Magic/EtherealWarrior.cs @@ -83,30 +83,15 @@ namespace Server.Mobiles } } - public override int GetAngerSound() - { - return 0x2F8; - } + public override int GetAngerSound() => 0x2F8; - public override int GetIdleSound() - { - return 0x2F8; - } + public override int GetIdleSound() => 0x2F8; - public override int GetAttackSound() - { - return Utility.Random(0x2F5, 2); - } + public override int GetAttackSound() => Utility.Random(0x2F5, 2); - public override int GetHurtSound() - { - return 0x2F9; - } + public override int GetHurtSound() => 0x2F9; - public override int GetDeathSound() - { - return 0x2F7; - } + public override int GetDeathSound() => 0x2F7; public override void OnGaveMeleeAttack(Mobile defender) { diff --git a/Projects/Scripts/Mobiles/Monsters/Misc/Melee/AnimatedWeapon.cs b/Projects/Scripts/Mobiles/Monsters/Misc/Melee/AnimatedWeapon.cs index 02acf0ba2..fbffe9677 100644 --- a/Projects/Scripts/Mobiles/Monsters/Misc/Melee/AnimatedWeapon.cs +++ b/Projects/Scripts/Mobiles/Monsters/Misc/Melee/AnimatedWeapon.cs @@ -1,111 +1,99 @@ -using System; - -namespace Server.Mobiles -{ - public class AnimatedWeapon : BaseCreature - { - [Constructible] - public AnimatedWeapon(Mobile caster, int level) - : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.3, 0.6) - { - Body = 692; - - SetStr(10 + level); - SetDex(10 + level); - SetInt(10); - - SetHits(20 + level * 3 / 2); - SetStam(10 + level); - SetMana(0); - - if (level >= 120) - SetDamage(14, 18); - else if (level >= 105) - SetDamage(13, 17); - else if (level >= 90) - SetDamage(12, 15); - else if (level >= 75) - SetDamage(11, 14); - else if (level >= 60) - SetDamage(10, 12); - else if (level >= 45) - SetDamage(9, 11); - else if (level >= 30) - SetDamage(8, 9); - else - SetDamage(7, 8); - - SetDamageType(ResistanceType.Physical, 60); - SetDamageType(ResistanceType.Poison, 20); - SetDamageType(ResistanceType.Energy, 20); - - SetResistance(ResistanceType.Physical, 40, 50); - SetResistance(ResistanceType.Fire, 30, 40); - SetResistance(ResistanceType.Cold, 30, 40); - SetResistance(ResistanceType.Poison, 100); - SetResistance(ResistanceType.Energy, 20, 30); - - SetSkill(SkillName.MagicResist, level); - SetSkill(SkillName.Wrestling, level); - SetSkill(SkillName.Anatomy, caster.Skills.Anatomy.Value / 2); - SetSkill(SkillName.Tactics, caster.Skills.Tactics.Value / 2); - - Fame = 0; - Karma = 0; - - ControlSlots = 4; - } - - public AnimatedWeapon(Serial serial) - : base(serial) - { - } - - public override string CorpseName => "an animated weapon corpse"; - public override bool DeleteCorpseOnDeath => true; - public override bool IsHouseSummonable => true; - - public override double DispelDifficulty => 0.0; - public override double DispelFocus => 20.0; - - public override string DefaultName => "an animated weapon"; - - public override bool BleedImmune => true; - public override Poison PoisonImmune => Poison.Lethal; - - public override double GetFightModeRanking(Mobile m, FightMode acqType, bool bPlayerOnly) - { - return m.Str / Math.Max(GetDistanceToSqrt(m), 1.0); - } - - public override int GetAngerSound() - { - return 0x23A; - } - - public override int GetAttackSound() - { - return 0x3B8; - } - - public override int GetHurtSound() - { - return 0x23A; - } - - public override void Serialize(GenericWriter writer) - { - base.Serialize(writer); - - writer.Write(0); // version - } - - public override void Deserialize(GenericReader reader) - { - base.Deserialize(reader); - - /*int version = */ - reader.ReadInt(); - } - } +using System; + +namespace Server.Mobiles +{ + public class AnimatedWeapon : BaseCreature + { + [Constructible] + public AnimatedWeapon(Mobile caster, int level) + : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.3, 0.6) + { + Body = 692; + + SetStr(10 + level); + SetDex(10 + level); + SetInt(10); + + SetHits(20 + level * 3 / 2); + SetStam(10 + level); + SetMana(0); + + if (level >= 120) + SetDamage(14, 18); + else if (level >= 105) + SetDamage(13, 17); + else if (level >= 90) + SetDamage(12, 15); + else if (level >= 75) + SetDamage(11, 14); + else if (level >= 60) + SetDamage(10, 12); + else if (level >= 45) + SetDamage(9, 11); + else if (level >= 30) + SetDamage(8, 9); + else + SetDamage(7, 8); + + SetDamageType(ResistanceType.Physical, 60); + SetDamageType(ResistanceType.Poison, 20); + SetDamageType(ResistanceType.Energy, 20); + + SetResistance(ResistanceType.Physical, 40, 50); + SetResistance(ResistanceType.Fire, 30, 40); + SetResistance(ResistanceType.Cold, 30, 40); + SetResistance(ResistanceType.Poison, 100); + SetResistance(ResistanceType.Energy, 20, 30); + + SetSkill(SkillName.MagicResist, level); + SetSkill(SkillName.Wrestling, level); + SetSkill(SkillName.Anatomy, caster.Skills.Anatomy.Value / 2); + SetSkill(SkillName.Tactics, caster.Skills.Tactics.Value / 2); + + Fame = 0; + Karma = 0; + + ControlSlots = 4; + } + + public AnimatedWeapon(Serial serial) + : base(serial) + { + } + + public override string CorpseName => "an animated weapon corpse"; + public override bool DeleteCorpseOnDeath => true; + public override bool IsHouseSummonable => true; + + public override double DispelDifficulty => 0.0; + public override double DispelFocus => 20.0; + + public override string DefaultName => "an animated weapon"; + + public override bool BleedImmune => true; + public override Poison PoisonImmune => Poison.Lethal; + + public override double GetFightModeRanking(Mobile m, FightMode acqType, bool bPlayerOnly) => m.Str / Math.Max(GetDistanceToSqrt(m), 1.0); + + public override int GetAngerSound() => 0x23A; + + public override int GetAttackSound() => 0x3B8; + + public override int GetHurtSound() => 0x23A; + + public override void Serialize(GenericWriter writer) + { + base.Serialize(writer); + + writer.Write(0); // version + } + + public override void Deserialize(GenericReader reader) + { + base.Deserialize(reader); + + /*int version = */ + reader.ReadInt(); + } + } } \ No newline at end of file diff --git a/Projects/Scripts/Mobiles/Monsters/Misc/Melee/BladeSpirits.cs b/Projects/Scripts/Mobiles/Monsters/Misc/Melee/BladeSpirits.cs index 3a1798d77..617ac6f30 100644 --- a/Projects/Scripts/Mobiles/Monsters/Misc/Melee/BladeSpirits.cs +++ b/Projects/Scripts/Mobiles/Monsters/Misc/Melee/BladeSpirits.cs @@ -59,25 +59,13 @@ namespace Server.Mobiles public override bool BleedImmune => true; public override Poison PoisonImmune => Poison.Lethal; - public override double GetFightModeRanking(Mobile m, FightMode acqType, bool bPlayerOnly) - { - return (m.Str + m.Skills.Tactics.Value) / Math.Max(GetDistanceToSqrt(m), 1.0); - } + public override double GetFightModeRanking(Mobile m, FightMode acqType, bool bPlayerOnly) => (m.Str + m.Skills.Tactics.Value) / Math.Max(GetDistanceToSqrt(m), 1.0); - public override int GetAngerSound() - { - return 0x23A; - } + public override int GetAngerSound() => 0x23A; - public override int GetAttackSound() - { - return 0x3B8; - } + public override int GetAttackSound() => 0x3B8; - public override int GetHurtSound() - { - return 0x23A; - } + public override int GetHurtSound() => 0x23A; public override void OnThink() { diff --git a/Projects/Scripts/Mobiles/Monsters/Misc/Melee/EnergyVortex.cs b/Projects/Scripts/Mobiles/Monsters/Misc/Melee/EnergyVortex.cs index 659521426..db0885128 100644 --- a/Projects/Scripts/Mobiles/Monsters/Misc/Melee/EnergyVortex.cs +++ b/Projects/Scripts/Mobiles/Monsters/Misc/Melee/EnergyVortex.cs @@ -69,20 +69,11 @@ namespace Server.Mobiles public override bool BleedImmune => true; public override Poison PoisonImmune => Poison.Lethal; - public override double GetFightModeRanking(Mobile m, FightMode acqType, bool bPlayerOnly) - { - return (m.Int + m.Skills.Magery.Value) / Math.Max(GetDistanceToSqrt(m), 1.0); - } + public override double GetFightModeRanking(Mobile m, FightMode acqType, bool bPlayerOnly) => (m.Int + m.Skills.Magery.Value) / Math.Max(GetDistanceToSqrt(m), 1.0); - public override int GetAngerSound() - { - return 0x15; - } + public override int GetAngerSound() => 0x15; - public override int GetAttackSound() - { - return 0x28; - } + public override int GetAttackSound() => 0x28; public override void OnThink() { diff --git a/Projects/Scripts/Mobiles/Monsters/Misc/Melee/Golem.cs b/Projects/Scripts/Mobiles/Monsters/Misc/Melee/Golem.cs index f8765d5d5..fd191c35f 100644 --- a/Projects/Scripts/Mobiles/Monsters/Misc/Melee/Golem.cs +++ b/Projects/Scripts/Mobiles/Monsters/Misc/Melee/Golem.cs @@ -118,10 +118,7 @@ namespace Server.Mobiles } } - public override int GetAngerSound() - { - return 541; - } + public override int GetAngerSound() => 541; public override int GetIdleSound() { @@ -139,10 +136,7 @@ namespace Server.Mobiles return base.GetDeathSound(); } - public override int GetAttackSound() - { - return 562; - } + public override int GetAttackSound() => 562; public override int GetHurtSound() { diff --git a/Projects/Scripts/Mobiles/Monsters/Misc/Melee/PlagueBeast.cs b/Projects/Scripts/Mobiles/Monsters/Misc/Melee/PlagueBeast.cs index 9acd29f7a..7c8201984 100644 --- a/Projects/Scripts/Mobiles/Monsters/Misc/Melee/PlagueBeast.cs +++ b/Projects/Scripts/Mobiles/Monsters/Misc/Melee/PlagueBeast.cs @@ -149,25 +149,13 @@ namespace Server.Mobiles base.OnGotMeleeAttack(attacker); } - public override int GetIdleSound() - { - return 0x1BF; - } + public override int GetIdleSound() => 0x1BF; - public override int GetAttackSound() - { - return 0x1C0; - } + public override int GetAttackSound() => 0x1C0; - public override int GetHurtSound() - { - return 0x1C1; - } + public override int GetHurtSound() => 0x1C1; - public override int GetDeathSound() - { - return 0x1C2; - } + public override int GetDeathSound() => 0x1C2; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/Misc/Melee/PlagueBeastLord.cs b/Projects/Scripts/Mobiles/Monsters/Misc/Melee/PlagueBeastLord.cs index 89c468515..848713e48 100644 --- a/Projects/Scripts/Mobiles/Monsters/Misc/Melee/PlagueBeastLord.cs +++ b/Projects/Scripts/Mobiles/Monsters/Misc/Melee/PlagueBeastLord.cs @@ -164,40 +164,19 @@ namespace Server.Mobiles Backpack.SendRemovePacket(); } - public override bool CheckNonlocalLift(Mobile from, Item item) - { - return true; - } + public override bool CheckNonlocalLift(Mobile from, Item item) => true; - public override bool CheckNonlocalDrop(Mobile from, Item item, Item target) - { - return true; - } + public override bool CheckNonlocalDrop(Mobile from, Item item, Item target) => true; - public override bool IsSnoop(Mobile from) - { - return false; - } + public override bool IsSnoop(Mobile from) => false; - public override int GetIdleSound() - { - return 0x1BF; - } + public override int GetIdleSound() => 0x1BF; - public override int GetAttackSound() - { - return 0x1C0; - } + public override int GetAttackSound() => 0x1C0; - public override int GetHurtSound() - { - return 0x1C1; - } + public override int GetHurtSound() => 0x1C1; - public override int GetDeathSound() - { - return 0x1C2; - } + public override int GetDeathSound() => 0x1C2; public virtual void OnParalyzed(Mobile from) { diff --git a/Projects/Scripts/Mobiles/Monsters/Plant/Melee/Quagmire.cs b/Projects/Scripts/Mobiles/Monsters/Plant/Melee/Quagmire.cs index 085174fe2..500eb4f02 100644 --- a/Projects/Scripts/Mobiles/Monsters/Plant/Melee/Quagmire.cs +++ b/Projects/Scripts/Mobiles/Monsters/Plant/Melee/Quagmire.cs @@ -51,10 +51,7 @@ namespace Server.Mobiles AddLoot(LootPack.Average); } - public override int GetAngerSound() - { - return 353; - } + public override int GetAngerSound() => 353; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/Reptile/Magic/AncientWyrm.cs b/Projects/Scripts/Mobiles/Monsters/Reptile/Magic/AncientWyrm.cs index c3d0e219f..3bd87298a 100644 --- a/Projects/Scripts/Mobiles/Monsters/Reptile/Magic/AncientWyrm.cs +++ b/Projects/Scripts/Mobiles/Monsters/Reptile/Magic/AncientWyrm.cs @@ -64,15 +64,9 @@ namespace Server.Mobiles AddLoot(LootPack.Gems, 5); } - public override int GetIdleSound() - { - return 0x2D3; - } + public override int GetIdleSound() => 0x2D3; - public override int GetHurtSound() - { - return 0x2D1; - } + public override int GetHurtSound() => 0x2D1; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/Reptile/Magic/SerpentineDragon.cs b/Projects/Scripts/Mobiles/Monsters/Reptile/Magic/SerpentineDragon.cs index e18bcd495..2d262abc6 100644 --- a/Projects/Scripts/Mobiles/Monsters/Reptile/Magic/SerpentineDragon.cs +++ b/Projects/Scripts/Mobiles/Monsters/Reptile/Magic/SerpentineDragon.cs @@ -68,30 +68,15 @@ namespace Server.Mobiles AddLoot(LootPack.Gems, 2); } - public override int GetIdleSound() - { - return 0x2C4; - } + public override int GetIdleSound() => 0x2C4; - public override int GetAttackSound() - { - return 0x2C0; - } + public override int GetAttackSound() => 0x2C0; - public override int GetDeathSound() - { - return 0x2C1; - } + public override int GetDeathSound() => 0x2C1; - public override int GetAngerSound() - { - return 0x2C4; - } + public override int GetAngerSound() => 0x2C4; - public override int GetHurtSound() - { - return 0x2C3; - } + public override int GetHurtSound() => 0x2C3; public override void OnGotMeleeAttack(Mobile attacker) { diff --git a/Projects/Scripts/Mobiles/Monsters/Reptile/Magic/ShadowWyrm.cs b/Projects/Scripts/Mobiles/Monsters/Reptile/Magic/ShadowWyrm.cs index 3c8dc365f..9ede10e7c 100644 --- a/Projects/Scripts/Mobiles/Monsters/Reptile/Magic/ShadowWyrm.cs +++ b/Projects/Scripts/Mobiles/Monsters/Reptile/Magic/ShadowWyrm.cs @@ -65,15 +65,9 @@ namespace Server.Mobiles AddLoot(LootPack.Gems, 5); } - public override int GetIdleSound() - { - return 0x2D5; - } + public override int GetIdleSound() => 0x2D5; - public override int GetHurtSound() - { - return 0x2D1; - } + public override int GetHurtSound() => 0x2D1; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/Reptile/Melee/Harpy.cs b/Projects/Scripts/Mobiles/Monsters/Reptile/Melee/Harpy.cs index fa0e4a7f1..a03c19aaf 100644 --- a/Projects/Scripts/Mobiles/Monsters/Reptile/Melee/Harpy.cs +++ b/Projects/Scripts/Mobiles/Monsters/Reptile/Melee/Harpy.cs @@ -52,30 +52,15 @@ namespace Server.Mobiles AddLoot(LootPack.Meager, 2); } - public override int GetAttackSound() - { - return 916; - } + public override int GetAttackSound() => 916; - public override int GetAngerSound() - { - return 916; - } + public override int GetAngerSound() => 916; - public override int GetDeathSound() - { - return 917; - } + public override int GetDeathSound() => 917; - public override int GetHurtSound() - { - return 919; - } + public override int GetHurtSound() => 919; - public override int GetIdleSound() - { - return 918; - } + public override int GetIdleSound() => 918; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/Reptile/Melee/StoneHarpy.cs b/Projects/Scripts/Mobiles/Monsters/Reptile/Melee/StoneHarpy.cs index 251182231..4ca8a273a 100644 --- a/Projects/Scripts/Mobiles/Monsters/Reptile/Melee/StoneHarpy.cs +++ b/Projects/Scripts/Mobiles/Monsters/Reptile/Melee/StoneHarpy.cs @@ -53,30 +53,15 @@ namespace Server.Mobiles AddLoot(LootPack.Gems, 2); } - public override int GetAttackSound() - { - return 916; - } + public override int GetAttackSound() => 916; - public override int GetAngerSound() - { - return 916; - } + public override int GetAngerSound() => 916; - public override int GetDeathSound() - { - return 917; - } + public override int GetDeathSound() => 917; - public override int GetHurtSound() - { - return 919; - } + public override int GetHurtSound() => 919; - public override int GetIdleSound() - { - return 918; - } + public override int GetIdleSound() => 918; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/Reptile/Melee/Wyvern.cs b/Projects/Scripts/Mobiles/Monsters/Reptile/Melee/Wyvern.cs index bbd88e358..2f6a90837 100644 --- a/Projects/Scripts/Mobiles/Monsters/Reptile/Melee/Wyvern.cs +++ b/Projects/Scripts/Mobiles/Monsters/Reptile/Melee/Wyvern.cs @@ -65,30 +65,15 @@ namespace Server.Mobiles AddLoot(LootPack.MedScrolls); } - public override int GetAttackSound() - { - return 713; - } + public override int GetAttackSound() => 713; - public override int GetAngerSound() - { - return 718; - } + public override int GetAngerSound() => 718; - public override int GetDeathSound() - { - return 716; - } + public override int GetDeathSound() => 716; - public override int GetHurtSound() - { - return 721; - } + public override int GetHurtSound() => 721; - public override int GetIdleSound() - { - return 725; - } + public override int GetIdleSound() => 725; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/SE/BakeKitsune.cs b/Projects/Scripts/Mobiles/Monsters/SE/BakeKitsune.cs index 43b4a76f6..2a3b84521 100644 --- a/Projects/Scripts/Mobiles/Monsters/SE/BakeKitsune.cs +++ b/Projects/Scripts/Mobiles/Monsters/SE/BakeKitsune.cs @@ -114,30 +114,15 @@ namespace Server.Mobiles m_Table[defender] = timer; } - public override int GetAngerSound() - { - return 0x4DE; - } + public override int GetAngerSound() => 0x4DE; - public override int GetIdleSound() - { - return 0x4DD; - } + public override int GetIdleSound() => 0x4DD; - public override int GetAttackSound() - { - return 0x4DC; - } + public override int GetAttackSound() => 0x4DC; - public override int GetHurtSound() - { - return 0x4DF; - } + public override int GetHurtSound() => 0x4DF; - public override int GetDeathSound() - { - return 0x4DB; - } + public override int GetDeathSound() => 0x4DB; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/SE/DeathWatchBeetle.cs b/Projects/Scripts/Mobiles/Monsters/SE/DeathWatchBeetle.cs index 21c2d9f30..72b4bb73e 100644 --- a/Projects/Scripts/Mobiles/Monsters/SE/DeathWatchBeetle.cs +++ b/Projects/Scripts/Mobiles/Monsters/SE/DeathWatchBeetle.cs @@ -76,35 +76,17 @@ namespace Server.Mobiles public override int Hides => 8; - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.CrushingBlow; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.CrushingBlow; - public override int GetAngerSound() - { - return 0x4F3; - } + public override int GetAngerSound() => 0x4F3; - public override int GetIdleSound() - { - return 0x4F2; - } + public override int GetIdleSound() => 0x4F2; - public override int GetAttackSound() - { - return 0x4F1; - } + public override int GetAttackSound() => 0x4F1; - public override int GetHurtSound() - { - return 0x4F4; - } + public override int GetHurtSound() => 0x4F4; - public override int GetDeathSound() - { - return 0x4F0; - } + public override int GetDeathSound() => 0x4F0; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Monsters/SE/DeathWatchBeetleHatchling.cs b/Projects/Scripts/Mobiles/Monsters/SE/DeathWatchBeetleHatchling.cs index 3f0d21201..179f8f9ab 100644 --- a/Projects/Scripts/Mobiles/Monsters/SE/DeathWatchBeetleHatchling.cs +++ b/Projects/Scripts/Mobiles/Monsters/SE/DeathWatchBeetleHatchling.cs @@ -75,30 +75,15 @@ namespace Server.Mobiles public override string DefaultName => "a deathwatch beetle hatchling"; public override int Hides => 8; - public override int GetAngerSound() - { - return 0x4F3; - } + public override int GetAngerSound() => 0x4F3; - public override int GetIdleSound() - { - return 0x4F2; - } + public override int GetIdleSound() => 0x4F2; - public override int GetAttackSound() - { - return 0x4F1; - } + public override int GetAttackSound() => 0x4F1; - public override int GetHurtSound() - { - return 0x4F4; - } + public override int GetHurtSound() => 0x4F4; - public override int GetDeathSound() - { - return 0x4F0; - } + public override int GetDeathSound() => 0x4F0; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Monsters/SE/FanDancer.cs b/Projects/Scripts/Mobiles/Monsters/SE/FanDancer.cs index 8791d86e1..998623e31 100644 --- a/Projects/Scripts/Mobiles/Monsters/SE/FanDancer.cs +++ b/Projects/Scripts/Mobiles/Monsters/SE/FanDancer.cs @@ -146,10 +146,7 @@ namespace Server.Mobiles } } - public bool IsFanned(Mobile m) - { - return m_Table.Contains(m); - } + public bool IsFanned(Mobile m) => m_Table.Contains(m); public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/SE/FireBeetle.cs b/Projects/Scripts/Mobiles/Monsters/SE/FireBeetle.cs index 56977f459..9cc28f69b 100644 --- a/Projects/Scripts/Mobiles/Monsters/SE/FireBeetle.cs +++ b/Projects/Scripts/Mobiles/Monsters/SE/FireBeetle.cs @@ -69,40 +69,19 @@ namespace Server.Mobiles CurrentSpeed = PassiveSpeed; } - public override bool OverrideBondingReqs() - { - return true; - } + public override bool OverrideBondingReqs() => true; - public override int GetAngerSound() - { - return 0x21D; - } + public override int GetAngerSound() => 0x21D; - public override int GetIdleSound() - { - return 0x21D; - } + public override int GetIdleSound() => 0x21D; - public override int GetAttackSound() - { - return 0x162; - } + public override int GetAttackSound() => 0x162; - public override int GetHurtSound() - { - return 0x163; - } + public override int GetHurtSound() => 0x163; - public override int GetDeathSound() - { - return 0x21D; - } + public override int GetDeathSound() => 0x21D; - public override double GetControlChance(Mobile m, bool useBaseSkill = false) - { - return 1.0; - } + public override double GetControlChance(Mobile m, bool useBaseSkill = false) => 1.0; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/SE/Kappa.cs b/Projects/Scripts/Mobiles/Monsters/SE/Kappa.cs index 32995363c..246e58d7d 100644 --- a/Projects/Scripts/Mobiles/Monsters/SE/Kappa.cs +++ b/Projects/Scripts/Mobiles/Monsters/SE/Kappa.cs @@ -70,30 +70,15 @@ namespace Server.Mobiles AddLoot(LootPack.Average); } - public override int GetAngerSound() - { - return 0x50B; - } + public override int GetAngerSound() => 0x50B; - public override int GetIdleSound() - { - return 0x50A; - } + public override int GetIdleSound() => 0x50A; - public override int GetAttackSound() - { - return 0x509; - } + public override int GetAttackSound() => 0x509; - public override int GetHurtSound() - { - return 0x50C; - } + public override int GetHurtSound() => 0x50C; - public override int GetDeathSound() - { - return 0x508; - } + public override int GetDeathSound() => 0x508; public override void OnGaveMeleeAttack(Mobile defender) { @@ -108,10 +93,7 @@ namespace Server.Mobiles } } - public static bool IsBeingDrained(Mobile m) - { - return m_Table.ContainsKey(m); - } + public static bool IsBeingDrained(Mobile m) => m_Table.ContainsKey(m); public static void BeginLifeDrain(Mobile m, Mobile from) { @@ -171,10 +153,7 @@ namespace Server.Mobiles base.OnDamage(amount, from, willKill); } - public override Item NewHarmfulItem() - { - return new AcidSlime(TimeSpan.FromSeconds(10), 5, 10); - } + public override Item NewHarmfulItem() => new AcidSlime(TimeSpan.FromSeconds(10), 5, 10); public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/SE/LadyOfTheSnow.cs b/Projects/Scripts/Mobiles/Monsters/SE/LadyOfTheSnow.cs index ed155c33d..0c792adcb 100644 --- a/Projects/Scripts/Mobiles/Monsters/SE/LadyOfTheSnow.cs +++ b/Projects/Scripts/Mobiles/Monsters/SE/LadyOfTheSnow.cs @@ -63,10 +63,7 @@ namespace Server.Mobiles public override bool CanRummageCorpses => true; public override int TreasureMapLevel => 4; - public override int GetDeathSound() - { - return 0x370; - } + public override int GetDeathSound() => 0x370; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Monsters/SE/Oni.cs b/Projects/Scripts/Mobiles/Monsters/SE/Oni.cs index ad992d08f..7628841a0 100644 --- a/Projects/Scripts/Mobiles/Monsters/SE/Oni.cs +++ b/Projects/Scripts/Mobiles/Monsters/SE/Oni.cs @@ -62,30 +62,15 @@ namespace Server.Mobiles public override bool CanRummageCorpses => true; public override int TreasureMapLevel => 4; - public override int GetAngerSound() - { - return 0x4E3; - } + public override int GetAngerSound() => 0x4E3; - public override int GetIdleSound() - { - return 0x4E2; - } + public override int GetIdleSound() => 0x4E2; - public override int GetAttackSound() - { - return 0x4E1; - } + public override int GetAttackSound() => 0x4E1; - public override int GetHurtSound() - { - return 0x4E4; - } + public override int GetHurtSound() => 0x4E4; - public override int GetDeathSound() - { - return 0x4E0; - } + public override int GetDeathSound() => 0x4E0; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Monsters/SE/RevenantLion.cs b/Projects/Scripts/Mobiles/Monsters/SE/RevenantLion.cs index e6c98cd2d..4a214a4d8 100644 --- a/Projects/Scripts/Mobiles/Monsters/SE/RevenantLion.cs +++ b/Projects/Scripts/Mobiles/Monsters/SE/RevenantLion.cs @@ -85,35 +85,17 @@ namespace Server.Mobiles public override Poison PoisonImmune => Poison.Greater; public override Poison HitPoison => Poison.Greater; - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.BleedAttack; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.BleedAttack; - public override int GetAngerSound() - { - return 0x518; - } + public override int GetAngerSound() => 0x518; - public override int GetIdleSound() - { - return 0x517; - } + public override int GetIdleSound() => 0x517; - public override int GetAttackSound() - { - return 0x516; - } + public override int GetAttackSound() => 0x516; - public override int GetHurtSound() - { - return 0x519; - } + public override int GetHurtSound() => 0x519; - public override int GetDeathSound() - { - return 0x515; - } + public override int GetDeathSound() => 0x515; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Monsters/SE/RuneBeetle.cs b/Projects/Scripts/Mobiles/Monsters/SE/RuneBeetle.cs index 87e738932..6017c3110 100644 --- a/Projects/Scripts/Mobiles/Monsters/SE/RuneBeetle.cs +++ b/Projects/Scripts/Mobiles/Monsters/SE/RuneBeetle.cs @@ -97,35 +97,17 @@ namespace Server.Mobiles public override FoodType FavoriteFood => FoodType.FruitsAndVegies | FoodType.GrainsAndHay; public override bool CanAngerOnTame => true; - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.BleedAttack; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.BleedAttack; - public override int GetAngerSound() - { - return 0x4E8; - } + public override int GetAngerSound() => 0x4E8; - public override int GetIdleSound() - { - return 0x4E7; - } + public override int GetIdleSound() => 0x4E7; - public override int GetAttackSound() - { - return 0x4E6; - } + public override int GetAttackSound() => 0x4E6; - public override int GetHurtSound() - { - return 0x4E9; - } + public override int GetHurtSound() => 0x4E9; - public override int GetDeathSound() - { - return 0x4E5; - } + public override int GetDeathSound() => 0x4E5; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Monsters/SE/TsukiWolf.cs b/Projects/Scripts/Mobiles/Monsters/SE/TsukiWolf.cs index 0b3deb7e0..9eeeb735d 100644 --- a/Projects/Scripts/Mobiles/Monsters/SE/TsukiWolf.cs +++ b/Projects/Scripts/Mobiles/Monsters/SE/TsukiWolf.cs @@ -142,30 +142,15 @@ namespace Server.Mobiles int version = reader.ReadInt(); } - public override int GetAngerSound() - { - return 0x52D; - } + public override int GetAngerSound() => 0x52D; - public override int GetIdleSound() - { - return 0x52C; - } + public override int GetIdleSound() => 0x52C; - public override int GetAttackSound() - { - return 0x52B; - } + public override int GetAttackSound() => 0x52B; - public override int GetHurtSound() - { - return 0x52E; - } + public override int GetHurtSound() => 0x52E; - public override int GetDeathSound() - { - return 0x52A; - } + public override int GetDeathSound() => 0x52A; private class ExpireTimer : Timer { diff --git a/Projects/Scripts/Mobiles/Monsters/SE/Yamandon.cs b/Projects/Scripts/Mobiles/Monsters/SE/Yamandon.cs index 07664587d..2e5183aa7 100644 --- a/Projects/Scripts/Mobiles/Monsters/SE/Yamandon.cs +++ b/Projects/Scripts/Mobiles/Monsters/SE/Yamandon.cs @@ -58,10 +58,7 @@ namespace Server.Mobiles public override int TreasureMapLevel => 5; public override int Hides => 20; - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.DoubleStrike; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.DoubleStrike; public override void GenerateLoot() { @@ -138,30 +135,15 @@ namespace Server.Mobiles } } - public override int GetAttackSound() - { - return 1260; - } + public override int GetAttackSound() => 1260; - public override int GetAngerSound() - { - return 1262; - } + public override int GetAngerSound() => 1262; - public override int GetDeathSound() - { - return 1259; //Other Death sound is 1258... One for Yamadon, one for Serado? - } + public override int GetDeathSound() => 1259; - public override int GetHurtSound() - { - return 1263; - } + public override int GetHurtSound() => 1263; - public override int GetIdleSound() - { - return 1261; - } + public override int GetIdleSound() => 1261; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Monsters/SE/YomotsuElder.cs b/Projects/Scripts/Mobiles/Monsters/SE/YomotsuElder.cs index 3dbaab27c..054ef98aa 100644 --- a/Projects/Scripts/Mobiles/Monsters/SE/YomotsuElder.cs +++ b/Projects/Scripts/Mobiles/Monsters/SE/YomotsuElder.cs @@ -84,10 +84,7 @@ namespace Server.Mobiles public override bool CanRummageCorpses => true; public override int TreasureMapLevel => 5; - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.DoubleStrike; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.DoubleStrike; public override void GenerateLoot() @@ -129,24 +126,12 @@ namespace Server.Mobiles int version = reader.ReadInt(); } - public override int GetIdleSound() - { - return 0x42A; - } + public override int GetIdleSound() => 0x42A; - public override int GetAttackSound() - { - return 0x435; - } + public override int GetAttackSound() => 0x435; - public override int GetHurtSound() - { - return 0x436; - } + public override int GetHurtSound() => 0x436; - public override int GetDeathSound() - { - return 0x43A; - } + public override int GetDeathSound() => 0x43A; } } \ No newline at end of file diff --git a/Projects/Scripts/Mobiles/Monsters/SE/YomotsuPriest.cs b/Projects/Scripts/Mobiles/Monsters/SE/YomotsuPriest.cs index 7fb52d56a..8c6ec5bdc 100644 --- a/Projects/Scripts/Mobiles/Monsters/SE/YomotsuPriest.cs +++ b/Projects/Scripts/Mobiles/Monsters/SE/YomotsuPriest.cs @@ -84,10 +84,7 @@ namespace Server.Mobiles public override bool CanRummageCorpses => true; - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.DoubleStrike; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.DoubleStrike; public override void GenerateLoot() @@ -130,24 +127,12 @@ namespace Server.Mobiles int version = reader.ReadInt(); } - public override int GetIdleSound() - { - return 0x42A; - } + public override int GetIdleSound() => 0x42A; - public override int GetAttackSound() - { - return 0x435; - } + public override int GetAttackSound() => 0x435; - public override int GetHurtSound() - { - return 0x436; - } + public override int GetHurtSound() => 0x436; - public override int GetDeathSound() - { - return 0x43A; - } + public override int GetDeathSound() => 0x43A; } } \ No newline at end of file diff --git a/Projects/Scripts/Mobiles/Monsters/SE/YomotsuWarrior.cs b/Projects/Scripts/Mobiles/Monsters/SE/YomotsuWarrior.cs index cc74a0eaa..3fa105ac9 100644 --- a/Projects/Scripts/Mobiles/Monsters/SE/YomotsuWarrior.cs +++ b/Projects/Scripts/Mobiles/Monsters/SE/YomotsuWarrior.cs @@ -79,10 +79,7 @@ namespace Server.Mobiles public override bool CanRummageCorpses => true; public override int TreasureMapLevel => 3; - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.DoubleStrike; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.DoubleStrike; public override void GenerateLoot() { @@ -123,24 +120,12 @@ namespace Server.Mobiles int version = reader.ReadInt(); } - public override int GetIdleSound() - { - return 0x42A; - } + public override int GetIdleSound() => 0x42A; - public override int GetAttackSound() - { - return 0x435; - } + public override int GetAttackSound() => 0x435; - public override int GetHurtSound() - { - return 0x436; - } + public override int GetHurtSound() => 0x436; - public override int GetDeathSound() - { - return 0x43A; - } + public override int GetDeathSound() => 0x43A; } } \ No newline at end of file diff --git a/Projects/Scripts/Mobiles/PlayerMobile.cs b/Projects/Scripts/Mobiles/PlayerMobile.cs index 12a8a58d5..ec94c8c9b 100644 --- a/Projects/Scripts/Mobiles/PlayerMobile.cs +++ b/Projects/Scripts/Mobiles/PlayerMobile.cs @@ -532,10 +532,7 @@ namespace Server.Mobiles return flags; } - public bool GetFlag(PlayerFlag flag) - { - return (Flags & flag) != 0; - } + public bool GetFlag(PlayerFlag flag) => (Flags & flag) != 0; public void SetFlag(PlayerFlag flag, bool value) { @@ -567,10 +564,7 @@ namespace Server.Mobiles pm.AutoStablePets(); /* autostable checks summons, et al: no need here */ } - private static bool CheckBlock(MountBlock block) - { - return block?.m_Timer.Running == true; - } + private static bool CheckBlock(MountBlock block) => block?.m_Timer.Running == true; public void SetMountBlock(BlockMountType type, TimeSpan duration, bool dismount) { @@ -1075,10 +1069,7 @@ namespace Server.Mobiles return base.CanBeBeneficial(target, message, allowDead); } - public override bool CheckContextMenuDisplay(IEntity target) - { - return DesignContext == null; - } + public override bool CheckContextMenuDisplay(IEntity target) => DesignContext == null; public override void OnItemAdded(Item item) { @@ -1719,11 +1710,9 @@ namespace Server.Mobiles Timer.DelayCall(TimeSpan.FromSeconds(10), RecoverAmmo); } - private bool FindItems_Callback(Item item) - { - return !item.Deleted && (item.LootType == LootType.Blessed || item.Insured) && - Backpack != item.Parent; - } + private bool FindItems_Callback(Item item) => + !item.Deleted && (item.LootType == LootType.Blessed || item.Insured) && + Backpack != item.Parent; public override bool OnBeforeDeath() { @@ -2633,10 +2622,7 @@ namespace Server.Mobiles base.Animate(action, frameCount, repeatCount, forward, repeat, delay); } - public override bool CanSee(Item item) - { - return DesignContext?.Foundation.IsHiddenToCustomizer(item) != true && base.CanSee(item); - } + public override bool CanSee(Item item) => DesignContext?.Foundation.IsHiddenToCustomizer(item) != true && base.CanSee(item); public override void OnAfterDelete() { @@ -2919,10 +2905,7 @@ namespace Server.Mobiles { } - public CallbackEntry(int number, int range, ContextCallback callback) : base(number, range) - { - m_Callback = callback; - } + public CallbackEntry(int number, int range, ContextCallback callback) : base(number, range) => m_Callback = callback; public override void OnClick() { @@ -3256,10 +3239,7 @@ namespace Server.Mobiles #region Insurance - private static int GetInsuranceCost(Item item) - { - return 600; // TODO - } + private static int GetInsuranceCost(Item item) => 600; private void ToggleItemInsurance() { @@ -3464,10 +3444,7 @@ namespace Server.Mobiles SendGump(new ItemInsuranceMenuGump(this, items.ToArray())); } - private bool DisplayInItemInsuranceGump(Item item) - { - return (item.Visible || AccessLevel >= AccessLevel.GameMaster) && (item.Insured || CanInsure(item)); - } + private bool DisplayInItemInsuranceGump(Item item) => (item.Visible || AccessLevel >= AccessLevel.GameMaster) && (item.Insured || CanInsure(item)); private class ItemInsuranceMenuGump : Gump { @@ -3572,10 +3549,7 @@ namespace Server.Mobiles } } - public ItemInsuranceMenuGump NewInstance() - { - return new ItemInsuranceMenuGump(m_From, m_Items, m_Insure, m_Page); - } + public ItemInsuranceMenuGump NewInstance() => new ItemInsuranceMenuGump(m_From, m_Items, m_Insure, m_Page); public override void OnResponse(NetState sender, RelayInfo info) { @@ -4463,10 +4437,7 @@ namespace Server.Mobiles [CommandProperty(AccessLevel.GameMaster)] public int Harrower{ get; set; } - public int GetValue(ChampionSpawnType type) - { - return GetValue((int)type); - } + public int GetValue(ChampionSpawnType type) => GetValue((int)type); public void SetValue(ChampionSpawnType type, int value) { @@ -4553,10 +4524,7 @@ namespace Server.Mobiles m_Values[index].LastDecay = DateTime.UtcNow; } - public override string ToString() - { - return "..."; - } + public override string ToString() => "..."; public static void Serialize(GenericWriter writer, ChampionTitleInfo titles) { @@ -4650,15 +4618,9 @@ namespace Server.Mobiles private Dictionary m_AcquiredRecipes; - public virtual bool HasRecipe(Recipe r) - { - return r != null && HasRecipe(r.ID); - } + public virtual bool HasRecipe(Recipe r) => r != null && HasRecipe(r.ID); - public virtual bool HasRecipe(int recipeID) - { - return m_AcquiredRecipes.TryGetValue(recipeID, out bool value) && value; - } + public virtual bool HasRecipe(int recipeID) => m_AcquiredRecipes.TryGetValue(recipeID, out bool value) && value; public virtual void AcquireRecipe(Recipe r) { diff --git a/Projects/Scripts/Mobiles/Special/CapturedHordeMinion.cs b/Projects/Scripts/Mobiles/Special/CapturedHordeMinion.cs index ac74633d9..fe5080b25 100644 --- a/Projects/Scripts/Mobiles/Special/CapturedHordeMinion.cs +++ b/Projects/Scripts/Mobiles/Special/CapturedHordeMinion.cs @@ -3,10 +3,7 @@ namespace Server.Mobiles public class CapturedHordeMinion : HordeMinion { [Constructible] - public CapturedHordeMinion() - { - FightMode = FightMode.None; - } + public CapturedHordeMinion() => FightMode = FightMode.None; public CapturedHordeMinion(Serial serial) : base(serial) { @@ -14,10 +11,7 @@ namespace Server.Mobiles public override bool InitialInnocent => true; - public override bool CanBeDamaged() - { - return false; - } + public override bool CanBeDamaged() => false; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Special/Harrower.cs b/Projects/Scripts/Mobiles/Special/Harrower.cs index f7e09dcb4..de420a786 100644 --- a/Projects/Scripts/Mobiles/Special/Harrower.cs +++ b/Projects/Scripts/Mobiles/Special/Harrower.cs @@ -444,11 +444,9 @@ namespace Server.Mobiles 1062317); // For your valor in combating the fallen beast, a special artifact has been bestowed on you. } - public bool IsEligible(Mobile m, Item Artifact) - { - return m.Player && m.Alive && m.InRange(Location, 32) && - m.Backpack?.CheckHold(m, Artifact, false) == true; - } + public bool IsEligible(Mobile m, Item Artifact) => + m.Player && m.Alive && m.InRange(Location, 32) && + m.Backpack?.CheckHold(m, Artifact, false) == true; public Item GetArtifact() { diff --git a/Projects/Scripts/Mobiles/Special/HarrowerTentacles.cs b/Projects/Scripts/Mobiles/Special/HarrowerTentacles.cs index b8d9fd978..388f3ff73 100644 --- a/Projects/Scripts/Mobiles/Special/HarrowerTentacles.cs +++ b/Projects/Scripts/Mobiles/Special/HarrowerTentacles.cs @@ -71,30 +71,15 @@ namespace Server.Mobiles reflect = true; } - public override int GetIdleSound() - { - return 0x101; - } + public override int GetIdleSound() => 0x101; - public override int GetAngerSound() - { - return 0x5E; - } + public override int GetAngerSound() => 0x5E; - public override int GetDeathSound() - { - return 0x1C2; - } + public override int GetDeathSound() => 0x1C2; - public override int GetAttackSound() - { - return -1; // unknown - } + public override int GetAttackSound() => -1; - public override int GetHurtSound() - { - return 0x289; - } + public override int GetHurtSound() => 0x289; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Special/LordOaks.cs b/Projects/Scripts/Mobiles/Special/LordOaks.cs index 39562f3f5..773e243d9 100644 --- a/Projects/Scripts/Mobiles/Special/LordOaks.cs +++ b/Projects/Scripts/Mobiles/Special/LordOaks.cs @@ -109,30 +109,15 @@ namespace Server.Mobiles } } - public override int GetAngerSound() - { - return 0x2F8; - } + public override int GetAngerSound() => 0x2F8; - public override int GetIdleSound() - { - return 0x2F8; - } + public override int GetIdleSound() => 0x2F8; - public override int GetAttackSound() - { - return Utility.Random(0x2F5, 2); - } + public override int GetAttackSound() => Utility.Random(0x2F5, 2); - public override int GetHurtSound() - { - return 0x2F9; - } + public override int GetHurtSound() => 0x2F9; - public override int GetDeathSound() - { - return 0x2F7; - } + public override int GetDeathSound() => 0x2F7; public void CheckQueen() { diff --git a/Projects/Scripts/Mobiles/Special/Neira.cs b/Projects/Scripts/Mobiles/Special/Neira.cs index b85f0c149..e9ec90718 100644 --- a/Projects/Scripts/Mobiles/Special/Neira.cs +++ b/Projects/Scripts/Mobiles/Special/Neira.cs @@ -209,10 +209,7 @@ namespace Server.Mobiles { private VirtualMountItem m_Item; - public VirtualMount(VirtualMountItem item) - { - m_Item = item; - } + public VirtualMount(VirtualMountItem item) => m_Item = item; Mobile IMount.Rider { @@ -241,10 +238,8 @@ namespace Server.Mobiles } public VirtualMountItem(Serial serial) - : base(serial) - { + : base(serial) => m_Mount = new VirtualMount(this); - } public Mobile Rider{ get; private set; } diff --git a/Projects/Scripts/Mobiles/Special/Paragon.cs b/Projects/Scripts/Mobiles/Special/Paragon.cs index 8fc894436..b06c0e316 100644 --- a/Projects/Scripts/Mobiles/Special/Paragon.cs +++ b/Projects/Scripts/Mobiles/Special/Paragon.cs @@ -136,10 +136,7 @@ namespace Server.Mobiles bc.Karma = (int)(bc.Karma / KarmaBuff); } - public static bool CheckConvert(BaseCreature bc) - { - return CheckConvert(bc, bc.Location, bc.Map); - } + public static bool CheckConvert(BaseCreature bc) => CheckConvert(bc, bc.Location, bc.Map); public static bool CheckConvert(BaseCreature bc, Point3D location, Map m) { diff --git a/Projects/Scripts/Mobiles/Special/Rikktor.cs b/Projects/Scripts/Mobiles/Special/Rikktor.cs index 3f3c3b4c8..6fcce27a4 100644 --- a/Projects/Scripts/Mobiles/Special/Rikktor.cs +++ b/Projects/Scripts/Mobiles/Special/Rikktor.cs @@ -124,30 +124,15 @@ namespace Server.Mobiles eable.Free(); } - public override int GetAngerSound() - { - return Utility.Random(0x2CE, 2); - } + public override int GetAngerSound() => Utility.Random(0x2CE, 2); - public override int GetIdleSound() - { - return 0x2D2; - } + public override int GetIdleSound() => 0x2D2; - public override int GetAttackSound() - { - return Utility.Random(0x2C7, 5); - } + public override int GetAttackSound() => Utility.Random(0x2C7, 5); - public override int GetHurtSound() - { - return 0x2D1; - } + public override int GetHurtSound() => 0x2D1; - public override int GetDeathSound() - { - return 0x2CC; - } + public override int GetDeathSound() => 0x2CC; public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Mobiles/Special/Serado.cs b/Projects/Scripts/Mobiles/Special/Serado.cs index dd824ad51..1bbc3dd8e 100644 --- a/Projects/Scripts/Mobiles/Special/Serado.cs +++ b/Projects/Scripts/Mobiles/Special/Serado.cs @@ -78,10 +78,7 @@ namespace Server.Mobiles public override bool ShowFameTitle => false; public override bool ClickTitle => false; - public override WeaponAbility GetWeaponAbility() - { - return WeaponAbility.DoubleStrike; - } + public override WeaponAbility GetWeaponAbility() => WeaponAbility.DoubleStrike; public override void GenerateLoot() { diff --git a/Projects/Scripts/Mobiles/Special/ServantOfSemidar.cs b/Projects/Scripts/Mobiles/Special/ServantOfSemidar.cs index 9170f6422..1bf9b3533 100644 --- a/Projects/Scripts/Mobiles/Special/ServantOfSemidar.cs +++ b/Projects/Scripts/Mobiles/Special/ServantOfSemidar.cs @@ -3,10 +3,7 @@ namespace Server.Mobiles public class ServantOfSemidar : BaseCreature { [Constructible] - public ServantOfSemidar() : base(AIType.AI_Melee, FightMode.None, 10, 1, 0.2, 0.4) - { - Body = 0x26; - } + public ServantOfSemidar() : base(AIType.AI_Melee, FightMode.None, 10, 1, 0.2, 0.4) => Body = 0x26; public ServantOfSemidar(Serial serial) : base(serial) { @@ -18,10 +15,7 @@ namespace Server.Mobiles public override bool InitialInnocent => true; - public override bool CanBeDamaged() - { - return false; - } + public override bool CanBeDamaged() => false; public override void AddNameProperties(ObjectPropertyList list) { diff --git a/Projects/Scripts/Mobiles/Special/Wanderer.cs b/Projects/Scripts/Mobiles/Special/Wanderer.cs index 2225dc19d..20fe48661 100644 --- a/Projects/Scripts/Mobiles/Special/Wanderer.cs +++ b/Projects/Scripts/Mobiles/Special/Wanderer.cs @@ -49,10 +49,7 @@ namespace Server.Mobiles private int m_Count; private Wanderer m_Owner; - public InternalTimer(Wanderer owner) : base(TimeSpan.FromSeconds(0.1), TimeSpan.FromSeconds(0.1)) - { - m_Owner = owner; - } + public InternalTimer(Wanderer owner) : base(TimeSpan.FromSeconds(0.1), TimeSpan.FromSeconds(0.1)) => m_Owner = owner; protected override void OnTick() { diff --git a/Projects/Scripts/Mobiles/Townfolk/BaseEscortable.cs b/Projects/Scripts/Mobiles/Townfolk/BaseEscortable.cs index 4616034ba..85130d56b 100644 --- a/Projects/Scripts/Mobiles/Townfolk/BaseEscortable.cs +++ b/Projects/Scripts/Mobiles/Townfolk/BaseEscortable.cs @@ -293,10 +293,7 @@ namespace Server.Mobiles return false; } - public override bool HandlesOnSpeech(Mobile from) - { - return !MLQuestSystem.Enabled && (from.InRange(Location, 3) || base.HandlesOnSpeech(from)); - } + public override bool HandlesOnSpeech(Mobile from) => !MLQuestSystem.Enabled && (from.InRange(Location, 3) || base.HandlesOnSpeech(from)); public override void OnSpeech(SpeechEventArgs e) { @@ -553,10 +550,7 @@ namespace Server.Mobiles } } - public override bool CanBeRenamedBy(Mobile from) - { - return from.AccessLevel >= AccessLevel.GameMaster; - } + public override bool CanBeRenamedBy(Mobile from) => from.AccessLevel >= AccessLevel.GameMaster; public override void AddCustomContextEntries(Mobile from, List list) { @@ -580,10 +574,7 @@ namespace Server.Mobiles base.AddCustomContextEntries(from, list); } - public virtual string[] GetPossibleDestinations() - { - return Core.ML ? m_MLTownNames : m_TownNames; - } + public virtual string[] GetPossibleDestinations() => Core.ML ? m_MLTownNames : m_TownNames; public virtual string PickRandomDestination() { @@ -655,10 +646,7 @@ namespace Server.Mobiles public Region Region{ get; } - public bool Contains(Point3D p) - { - return Region.Contains(p); - } + public bool Contains(Point3D p) => Region.Contains(p); public static void LoadTable() { @@ -730,10 +718,8 @@ namespace Server.Mobiles private BaseEscortable m_Mobile; public AbandonEscortEntry(BaseEscortable m) - : base(6102, 3) - { + : base(6102, 3) => m_Mobile = m; - } public override void OnClick() { diff --git a/Projects/Scripts/Mobiles/Townfolk/Messenger.cs b/Projects/Scripts/Mobiles/Townfolk/Messenger.cs index 0adc41431..24a8e11d5 100644 --- a/Projects/Scripts/Mobiles/Townfolk/Messenger.cs +++ b/Projects/Scripts/Mobiles/Townfolk/Messenger.cs @@ -5,10 +5,7 @@ namespace Server.Mobiles public class Messenger : BaseEscortable { [Constructible] - public Messenger() - { - Title = "the messenger"; - } + public Messenger() => Title = "the messenger"; public Messenger(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Mobiles/Townfolk/Minter.cs b/Projects/Scripts/Mobiles/Townfolk/Minter.cs index 88843054d..6b6a14a38 100644 --- a/Projects/Scripts/Mobiles/Townfolk/Minter.cs +++ b/Projects/Scripts/Mobiles/Townfolk/Minter.cs @@ -3,10 +3,7 @@ namespace Server.Mobiles public class Minter : Banker { [Constructible] - public Minter() - { - Title = "the minter"; - } + public Minter() => Title = "the minter"; public Minter(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Mobiles/Townfolk/Peasant.cs b/Projects/Scripts/Mobiles/Townfolk/Peasant.cs index 02aa17a87..705bacb12 100644 --- a/Projects/Scripts/Mobiles/Townfolk/Peasant.cs +++ b/Projects/Scripts/Mobiles/Townfolk/Peasant.cs @@ -5,10 +5,7 @@ namespace Server.Mobiles public class Peasant : BaseEscortable { [Constructible] - public Peasant() - { - Title = "the peasant"; - } + public Peasant() => Title = "the peasant"; public Peasant(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Mobiles/Townfolk/SeekerOfAdventure.cs b/Projects/Scripts/Mobiles/Townfolk/SeekerOfAdventure.cs index 31dc9214f..4a85a1a75 100644 --- a/Projects/Scripts/Mobiles/Townfolk/SeekerOfAdventure.cs +++ b/Projects/Scripts/Mobiles/Townfolk/SeekerOfAdventure.cs @@ -18,10 +18,7 @@ namespace Server.Mobiles }; [Constructible] - public SeekerOfAdventure() - { - Title = "the seeker of adventure"; - } + public SeekerOfAdventure() => Title = "the seeker of adventure"; public SeekerOfAdventure(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Mobiles/Townfolk/TownCrier.cs b/Projects/Scripts/Mobiles/Townfolk/TownCrier.cs index 7109790d7..6fd70da90 100644 --- a/Projects/Scripts/Mobiles/Townfolk/TownCrier.cs +++ b/Projects/Scripts/Mobiles/Townfolk/TownCrier.cs @@ -115,10 +115,7 @@ namespace Server.Mobiles { private ITownCrierEntryList m_Owner; - public TownCrierDurationPrompt(ITownCrierEntryList owner) - { - m_Owner = owner; - } + public TownCrierDurationPrompt(ITownCrierEntryList owner) => m_Owner = owner; public override void OnResponse(Mobile from, string text) { @@ -478,10 +475,7 @@ namespace Server.Mobiles base.OnDoubleClick(from); } - public override bool HandlesOnSpeech(Mobile from) - { - return m_NewsTimer == null && from.Alive && InRange(from, 12); - } + public override bool HandlesOnSpeech(Mobile from) => m_NewsTimer == null && from.Alive && InRange(from, 12); public override void OnSpeech(SpeechEventArgs e) { @@ -506,10 +500,7 @@ namespace Server.Mobiles } } - public override bool CanBeDamaged() - { - return false; - } + public override bool CanBeDamaged() => false; public override void OnDelete() { diff --git a/Projects/Scripts/Mobiles/Vendors/AnimalBuy.cs b/Projects/Scripts/Mobiles/Vendors/AnimalBuy.cs index 15dca90c1..9b51548b0 100644 --- a/Projects/Scripts/Mobiles/Vendors/AnimalBuy.cs +++ b/Projects/Scripts/Mobiles/Vendors/AnimalBuy.cs @@ -10,10 +10,8 @@ namespace Server.Mobiles } public AnimalBuyInfo(int controlSlots, string name, Type type, int price, int amount, int itemID, int hue) : base( - name, type, price, amount, itemID, hue) - { + name, type, price, amount, itemID, hue) => ControlSlots = controlSlots; - } public override int ControlSlots{ get; } } diff --git a/Projects/Scripts/Mobiles/Vendors/BaseVendor.cs b/Projects/Scripts/Mobiles/Vendors/BaseVendor.cs index 09c03a2de..3e7a09b82 100644 --- a/Projects/Scripts/Mobiles/Vendors/BaseVendor.cs +++ b/Projects/Scripts/Mobiles/Vendors/BaseVendor.cs @@ -448,25 +448,13 @@ namespace Server.Mobiles return true; } - public virtual bool IsValidBulkOrder(Item item) - { - return false; - } + public virtual bool IsValidBulkOrder(Item item) => false; - public virtual Item CreateBulkOrder(Mobile from, bool fromContextMenu) - { - return null; - } + public virtual Item CreateBulkOrder(Mobile from, bool fromContextMenu) => null; - public virtual bool SupportsBulkOrders(Mobile from) - { - return false; - } + public virtual bool SupportsBulkOrders(Mobile from) => false; - public virtual TimeSpan GetNextBulkOrder(Mobile from) - { - return TimeSpan.Zero; - } + public virtual TimeSpan GetNextBulkOrder(Mobile from) => TimeSpan.Zero; public virtual void OnSuccessfulBulkOrderReceive(Mobile from) { @@ -497,10 +485,7 @@ namespace Server.Mobiles } } - public virtual bool GetGender() - { - return Utility.RandomBool(); - } + public virtual bool GetGender() => Utility.RandomBool(); public virtual void InitBody() { @@ -534,10 +519,7 @@ namespace Server.Mobiles } } - public virtual int GetShoeHue() - { - return 0.1 > Utility.RandomDouble() ? 0 : Utility.RandomNeutralHue(); - } + public virtual int GetShoeHue() => 0.1 > Utility.RandomDouble() ? 0 : Utility.RandomNeutralHue(); public virtual void CheckMorph() { @@ -682,10 +664,7 @@ namespace Server.Mobiles Title = string.Join(" ", split); } - public virtual int GetHairHue() - { - return Race.RandomHairHue(); - } + public virtual int GetHairHue() => Race.RandomHairHue(); public virtual void InitOutfit() { @@ -1117,11 +1096,9 @@ namespace Server.Mobiles } } - public virtual bool CheckVendorAccess(Mobile from) - { - return Region.GetRegion()?.CheckVendorAccess(this, from) != false || - Region != from.Region && from.Region.GetRegion()?.CheckVendorAccess(this, from) != false; - } + public virtual bool CheckVendorAccess(Mobile from) => + Region.GetRegion()?.CheckVendorAccess(this, from) != false || + Region != from.Region && from.Region.GetRegion()?.CheckVendorAccess(this, from) != false; public override void Serialize(GenericWriter writer) { @@ -1268,15 +1245,9 @@ namespace Server.Mobiles base.AddCustomContextEntries(from, list); } - public virtual IShopSellInfo[] GetSellInfo() - { - return m_ArmorSellInfo.ToArray(); - } + public virtual IShopSellInfo[] GetSellInfo() => m_ArmorSellInfo.ToArray(); - public virtual IBuyItemInfo[] GetBuyInfo() - { - return m_ArmorBuyInfo.ToArray(); - } + public virtual IBuyItemInfo[] GetBuyInfo() => m_ArmorBuyInfo.ToArray(); private class BulkOrderInfoEntry : ContextMenuEntry { @@ -1334,10 +1305,7 @@ namespace Server.Mobiles #region Faction - public virtual int GetPriceScalar() - { - return 100 + Town.FromRegion(Region)?.Tax ?? 0; - } + public virtual int GetPriceScalar() => 100 + Town.FromRegion(Region)?.Tax ?? 0; public void UpdateBuyInfo() { diff --git a/Projects/Scripts/Mobiles/Vendors/BeverageBuy.cs b/Projects/Scripts/Mobiles/Vendors/BeverageBuy.cs index 6b808a213..be28c4b65 100644 --- a/Projects/Scripts/Mobiles/Vendors/BeverageBuy.cs +++ b/Projects/Scripts/Mobiles/Vendors/BeverageBuy.cs @@ -27,9 +27,6 @@ namespace Server.Mobiles public override bool CanCacheDisplay => false; - public override IEntity GetEntity() - { - return (IEntity)Activator.CreateInstance(Type, m_Content); - } + public override IEntity GetEntity() => (IEntity)Activator.CreateInstance(Type, m_Content); } } \ No newline at end of file diff --git a/Projects/Scripts/Mobiles/Vendors/GenericBuy.cs b/Projects/Scripts/Mobiles/Vendors/GenericBuy.cs index f79c5e251..60fa6d9b4 100644 --- a/Projects/Scripts/Mobiles/Vendors/GenericBuy.cs +++ b/Projects/Scripts/Mobiles/Vendors/GenericBuy.cs @@ -101,36 +101,7 @@ namespace Server.Mobiles } //Attempt to restock with item, (return true if restock successful) - public bool Restock(Item item, int amount) - { - return false; - /*if ( item.GetType() == m_Type ) - { - if ( item is BaseWeapon ) - { - BaseWeapon weapon = (BaseWeapon)item; - - if ( weapon.Quality == WeaponQuality.Low || weapon.Quality == WeaponQuality.Exceptional || (int)weapon.DurabilityLevel > 0 || (int)weapon.DamageLevel > 0 || (int)weapon.AccuracyLevel > 0 ) - return false; - } - - if ( item is BaseArmor ) - { - BaseArmor armor = (BaseArmor)item; - - if ( armor.Quality == ArmorQuality.Low || armor.Quality == ArmorQuality.Exceptional || (int)armor.Durability > 0 || (int)armor.ProtectionLevel > 0 ) - return false; - } - - m_Amount += amount; - - return true; - } - else - { - return false; - }*/ - } + public bool Restock(Item item, int amount) => false; public void OnRestock() { @@ -172,10 +143,7 @@ namespace Server.Mobiles m_Amount = MaxAmount; } - private bool IsDeleted(IEntity obj) - { - return obj.Deleted; - } + private bool IsDeleted(IEntity obj) => obj.Deleted; public void DeleteDisplayEntity() { diff --git a/Projects/Scripts/Mobiles/Vendors/GenericSell.cs b/Projects/Scripts/Mobiles/Vendors/GenericSell.cs index be9c6b504..0fca89cbb 100644 --- a/Projects/Scripts/Mobiles/Vendors/GenericSell.cs +++ b/Projects/Scripts/Mobiles/Vendors/GenericSell.cs @@ -4,117 +4,111 @@ using Server.Items; namespace Server.Mobiles { - public class GenericSellInfo : IShopSellInfo - { - private Dictionary m_Table = new Dictionary(); - private Type[] m_Types; + public class GenericSellInfo : IShopSellInfo + { + private Dictionary m_Table = new Dictionary(); + private Type[] m_Types; - public void Add( Type type, int price ) - { - m_Table[type] = price; - m_Types = null; - } + public void Add( Type type, int price ) + { + m_Table[type] = price; + m_Types = null; + } - public int GetSellPriceFor( Item item ) - { - m_Table.TryGetValue( item.GetType(), out int price ); + public int GetSellPriceFor( Item item ) + { + m_Table.TryGetValue( item.GetType(), out int price ); - if ( item is BaseArmor armor ) { - if ( armor.Quality == ArmorQuality.Low ) - price = (int)( price * 0.60 ); - else if ( armor.Quality == ArmorQuality.Exceptional ) - price = (int)( price * 1.25 ); + if ( item is BaseArmor armor ) { + if ( armor.Quality == ArmorQuality.Low ) + price = (int)( price * 0.60 ); + else if ( armor.Quality == ArmorQuality.Exceptional ) + price = (int)( price * 1.25 ); - price += 100 * (int)armor.Durability; + price += 100 * (int)armor.Durability; - price += 100 * (int)armor.ProtectionLevel; + price += 100 * (int)armor.ProtectionLevel; - if ( price < 1 ) - price = 1; - } - else if ( item is BaseWeapon weapon ) { - if ( weapon.Quality == WeaponQuality.Low ) - price = (int)( price * 0.60 ); - else if ( weapon.Quality == WeaponQuality.Exceptional ) - price = (int)( price * 1.25 ); + if ( price < 1 ) + price = 1; + } + else if ( item is BaseWeapon weapon ) { + if ( weapon.Quality == WeaponQuality.Low ) + price = (int)( price * 0.60 ); + else if ( weapon.Quality == WeaponQuality.Exceptional ) + price = (int)( price * 1.25 ); - price += 100 * (int)weapon.DurabilityLevel; + price += 100 * (int)weapon.DurabilityLevel; - price += 100 * (int)weapon.DamageLevel; + price += 100 * (int)weapon.DamageLevel; - if ( price < 1 ) - price = 1; - } - else if ( item is BaseBeverage bev ) { - int price1 = price, price2 = price; + if ( price < 1 ) + price = 1; + } + else if ( item is BaseBeverage bev ) { + int price1 = price, price2 = price; - if ( bev is Pitcher ) - { price1 = 3; price2 = 5; } - else if ( bev is BeverageBottle ) - { price1 = 3; price2 = 3; } - else if ( bev is Jug ) - { price1 = 6; price2 = 6; } + if ( bev is Pitcher ) + { price1 = 3; price2 = 5; } + else if ( bev is BeverageBottle ) + { price1 = 3; price2 = 3; } + else if ( bev is Jug ) + { price1 = 6; price2 = 6; } - if ( bev.IsEmpty || bev.Content == BeverageType.Milk ) - price = price1; - else - price = price2; - } + if ( bev.IsEmpty || bev.Content == BeverageType.Milk ) + price = price1; + else + price = price2; + } - return price; - } + return price; + } - public int GetBuyPriceFor( Item item ) - { - return (int)( 1.90 * GetSellPriceFor( item ) ); - } + public int GetBuyPriceFor( Item item ) => (int)( 1.90 * GetSellPriceFor( item ) ); - public Type[] Types - { - get - { - if ( m_Types == null ) - { - m_Types = new Type[m_Table.Keys.Count]; - m_Table.Keys.CopyTo( m_Types, 0 ); - } + public Type[] Types + { + get + { + if ( m_Types == null ) + { + m_Types = new Type[m_Table.Keys.Count]; + m_Table.Keys.CopyTo( m_Types, 0 ); + } - return m_Types; - } - } + return m_Types; + } + } - public string GetNameFor( Item item ) - { - if ( item.Name != null ) - return item.Name; - return item.LabelNumber.ToString(); - } + public string GetNameFor( Item item ) + { + if ( item.Name != null ) + return item.Name; + return item.LabelNumber.ToString(); + } - public bool IsSellable( Item item ) - { - if ( item.Nontransferable ) - return false; + public bool IsSellable( Item item ) + { + if ( item.Nontransferable ) + return false; - //if ( item.Hue != 0 ) - //return false; + //if ( item.Hue != 0 ) + //return false; - return IsInList( item.GetType() ); - } + return IsInList( item.GetType() ); + } - public bool IsResellable( Item item ) - { - if ( item.Nontransferable ) - return false; + public bool IsResellable( Item item ) + { + if ( item.Nontransferable ) + return false; - //if ( item.Hue != 0 ) - //return false; + //if ( item.Hue != 0 ) + //return false; - return IsInList( item.GetType() ); - } + return IsInList( item.GetType() ); + } - public bool IsInList( Type type ) - { - return m_Table.ContainsKey( type ); - } - } + public bool IsInList( Type type ) => m_Table.ContainsKey( type ); + } } diff --git a/Projects/Scripts/Mobiles/Vendors/NPC/AnimalTrainer.cs b/Projects/Scripts/Mobiles/Vendors/NPC/AnimalTrainer.cs index 7984c4740..58e105d52 100644 --- a/Projects/Scripts/Mobiles/Vendors/NPC/AnimalTrainer.cs +++ b/Projects/Scripts/Mobiles/Vendors/NPC/AnimalTrainer.cs @@ -32,10 +32,7 @@ namespace Server.Mobiles m_SBInfos.Add(new SBAnimalTrainer()); } - public override int GetShoeHue() - { - return 0; - } + public override int GetShoeHue() => 0; public override void InitOutfit() { @@ -301,10 +298,7 @@ namespace Server.Mobiles BeginClaimList(from); } - public bool CanClaim(Mobile from, BaseCreature pet) - { - return from.Followers + pet.ControlSlots <= from.FollowersMax; - } + public bool CanClaim(Mobile from, BaseCreature pet) => from.Followers + pet.ControlSlots <= from.FollowersMax; private void DoClaim(Mobile from, BaseCreature pet) { @@ -325,10 +319,7 @@ namespace Server.Mobiles pet.Loyalty = MaxLoyalty; // Wonderfully Happy } - public override bool HandlesOnSpeech(Mobile from) - { - return true; - } + public override bool HandlesOnSpeech(Mobile from) => true; public override void OnSpeech(SpeechEventArgs e) { @@ -452,10 +443,7 @@ namespace Server.Mobiles { private AnimalTrainer m_Trainer; - public StableTarget(AnimalTrainer trainer) : base(12, false, TargetFlags.None) - { - m_Trainer = trainer; - } + public StableTarget(AnimalTrainer trainer) : base(12, false, TargetFlags.None) => m_Trainer = trainer; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Mobiles/Vendors/NPC/Blacksmith.cs b/Projects/Scripts/Mobiles/Vendors/NPC/Blacksmith.cs index 4f45107a7..0da1cf580 100644 --- a/Projects/Scripts/Mobiles/Vendors/NPC/Blacksmith.cs +++ b/Projects/Scripts/Mobiles/Vendors/NPC/Blacksmith.cs @@ -117,15 +117,9 @@ namespace Server.Mobiles return null; } - public override bool IsValidBulkOrder(Item item) - { - return item is SmallSmithBOD || item is LargeSmithBOD; - } + public override bool IsValidBulkOrder(Item item) => item is SmallSmithBOD || item is LargeSmithBOD; - public override bool SupportsBulkOrders(Mobile from) - { - return from is PlayerMobile && from.Skills.Blacksmith.Base > 0; - } + public override bool SupportsBulkOrders(Mobile from) => from is PlayerMobile && from.Skills.Blacksmith.Base > 0; public override TimeSpan GetNextBulkOrder(Mobile from) { diff --git a/Projects/Scripts/Mobiles/Vendors/NPC/Bowyer.cs b/Projects/Scripts/Mobiles/Vendors/NPC/Bowyer.cs index 5dbda4233..9744a5bbb 100644 --- a/Projects/Scripts/Mobiles/Vendors/NPC/Bowyer.cs +++ b/Projects/Scripts/Mobiles/Vendors/NPC/Bowyer.cs @@ -23,10 +23,7 @@ namespace Server.Mobiles public override VendorShoeType ShoeType => Female ? VendorShoeType.ThighBoots : VendorShoeType.Boots; - public override int GetShoeHue() - { - return 0; - } + public override int GetShoeHue() => 0; public override void InitOutfit() { diff --git a/Projects/Scripts/Mobiles/Vendors/NPC/CustomHairstylist.cs b/Projects/Scripts/Mobiles/Vendors/NPC/CustomHairstylist.cs index 178a6003d..da2a09cc3 100644 --- a/Projects/Scripts/Mobiles/Vendors/NPC/CustomHairstylist.cs +++ b/Projects/Scripts/Mobiles/Vendors/NPC/CustomHairstylist.cs @@ -50,20 +50,14 @@ namespace Server.Mobiles public override VendorShoeType ShoeType => Utility.RandomBool() ? VendorShoeType.Shoes : VendorShoeType.Sandals; - public override bool OnBuyItems(Mobile buyer, List list) - { - return false; - } + public override bool OnBuyItems(Mobile buyer, List list) => false; public override void VendorBuy(Mobile from) { from.SendGump(new HairstylistBuyGump(from, this, m_SellList)); } - public override int GetHairHue() - { - return Utility.RandomBrightHue(); - } + public override int GetHairHue() => Utility.RandomBrightHue(); public override void InitOutfit() { diff --git a/Projects/Scripts/Mobiles/Vendors/NPC/Farmer.cs b/Projects/Scripts/Mobiles/Vendors/NPC/Farmer.cs index d77772850..ca6a4a44d 100644 --- a/Projects/Scripts/Mobiles/Vendors/NPC/Farmer.cs +++ b/Projects/Scripts/Mobiles/Vendors/NPC/Farmer.cs @@ -28,10 +28,7 @@ namespace Server.Mobiles m_SBInfos.Add(new SBFarmer()); } - public override int GetShoeHue() - { - return 0; - } + public override int GetShoeHue() => 0; public override void InitOutfit() { diff --git a/Projects/Scripts/Mobiles/Vendors/NPC/Guildmasters/BaseGuildmaster.cs b/Projects/Scripts/Mobiles/Vendors/NPC/Guildmasters/BaseGuildmaster.cs index 9a2d03aad..de015a30a 100644 --- a/Projects/Scripts/Mobiles/Vendors/NPC/Guildmasters/BaseGuildmaster.cs +++ b/Projects/Scripts/Mobiles/Vendors/NPC/Guildmasters/BaseGuildmaster.cs @@ -7,10 +7,7 @@ namespace Server.Mobiles { public abstract class BaseGuildmaster : BaseVendor { - public BaseGuildmaster(string title) : base(title) - { - Title = $"the {title} {(Female ? "guildmistress" : "guildmaster")}"; - } + public BaseGuildmaster(string title) : base(title) => Title = $"the {title} {(Female ? "guildmistress" : "guildmaster")}"; public BaseGuildmaster(Serial serial) : base(serial) { @@ -33,10 +30,7 @@ namespace Server.Mobiles { } - public virtual bool CheckCustomReqs(PlayerMobile pm) - { - return true; - } + public virtual bool CheckCustomReqs(PlayerMobile pm) => true; public virtual void SayGuildTo(Mobile m) { diff --git a/Projects/Scripts/Mobiles/Vendors/NPC/GypsyAnimalTrainer.cs b/Projects/Scripts/Mobiles/Vendors/NPC/GypsyAnimalTrainer.cs index d6f371eaa..89f8fd10e 100644 --- a/Projects/Scripts/Mobiles/Vendors/NPC/GypsyAnimalTrainer.cs +++ b/Projects/Scripts/Mobiles/Vendors/NPC/GypsyAnimalTrainer.cs @@ -17,10 +17,7 @@ namespace Server.Mobiles public override VendorShoeType ShoeType => Female ? VendorShoeType.ThighBoots : VendorShoeType.Boots; - public override int GetShoeHue() - { - return 0; - } + public override int GetShoeHue() => 0; public override void InitOutfit() { diff --git a/Projects/Scripts/Mobiles/Vendors/NPC/GypsyBanker.cs b/Projects/Scripts/Mobiles/Vendors/NPC/GypsyBanker.cs index a5a6c7f2d..a274a03ef 100644 --- a/Projects/Scripts/Mobiles/Vendors/NPC/GypsyBanker.cs +++ b/Projects/Scripts/Mobiles/Vendors/NPC/GypsyBanker.cs @@ -5,10 +5,7 @@ namespace Server.Mobiles public class GypsyBanker : Banker { [Constructible] - public GypsyBanker() - { - Title = "the gypsy banker"; - } + public GypsyBanker() => Title = "the gypsy banker"; public GypsyBanker(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Mobiles/Vendors/NPC/GypsyMaiden.cs b/Projects/Scripts/Mobiles/Vendors/NPC/GypsyMaiden.cs index 2ade6fa42..44bc4b2b7 100644 --- a/Projects/Scripts/Mobiles/Vendors/NPC/GypsyMaiden.cs +++ b/Projects/Scripts/Mobiles/Vendors/NPC/GypsyMaiden.cs @@ -18,10 +18,7 @@ namespace Server.Mobiles protected override List SBInfos => m_SBInfos; - public override bool GetGender() - { - return true; // always female - } + public override bool GetGender() => true; public override void InitSBInfo() { diff --git a/Projects/Scripts/Mobiles/Vendors/NPC/Scribe.cs b/Projects/Scripts/Mobiles/Vendors/NPC/Scribe.cs index 268164f84..2c603b545 100644 --- a/Projects/Scripts/Mobiles/Vendors/NPC/Scribe.cs +++ b/Projects/Scripts/Mobiles/Vendors/NPC/Scribe.cs @@ -41,10 +41,7 @@ namespace Server.Mobiles AddItem(new Robe(Utility.RandomNeutralHue())); } - public override bool HandlesOnSpeech(Mobile from) - { - return from.Player; - } + public override bool HandlesOnSpeech(Mobile from) => from.Player; public override void OnSpeech(SpeechEventArgs e) { diff --git a/Projects/Scripts/Mobiles/Vendors/NPC/Tailor.cs b/Projects/Scripts/Mobiles/Vendors/NPC/Tailor.cs index 31bf9db4b..d697c210d 100644 --- a/Projects/Scripts/Mobiles/Vendors/NPC/Tailor.cs +++ b/Projects/Scripts/Mobiles/Vendors/NPC/Tailor.cs @@ -67,15 +67,9 @@ namespace Server.Mobiles return null; } - public override bool IsValidBulkOrder(Item item) - { - return item is SmallTailorBOD || item is LargeTailorBOD; - } + public override bool IsValidBulkOrder(Item item) => item is SmallTailorBOD || item is LargeTailorBOD; - public override bool SupportsBulkOrders(Mobile from) - { - return from is PlayerMobile && from.Skills.Tailoring.Base > 0; - } + public override bool SupportsBulkOrders(Mobile from) => from is PlayerMobile && from.Skills.Tailoring.Base > 0; public override TimeSpan GetNextBulkOrder(Mobile from) { diff --git a/Projects/Scripts/Mobiles/Vendors/NPC/Weaponsmith.cs b/Projects/Scripts/Mobiles/Vendors/NPC/Weaponsmith.cs index 11dee008c..69726ff9b 100644 --- a/Projects/Scripts/Mobiles/Vendors/NPC/Weaponsmith.cs +++ b/Projects/Scripts/Mobiles/Vendors/NPC/Weaponsmith.cs @@ -36,10 +36,7 @@ namespace Server.Mobiles m_SBInfos.Add(new SBSEWeapons()); } - public override int GetShoeHue() - { - return 0; - } + public override int GetShoeHue() => 0; public override void InitOutfit() { @@ -86,15 +83,9 @@ namespace Server.Mobiles return null; } - public override bool IsValidBulkOrder(Item item) - { - return item is SmallSmithBOD || item is LargeSmithBOD; - } + public override bool IsValidBulkOrder(Item item) => item is SmallSmithBOD || item is LargeSmithBOD; - public override bool SupportsBulkOrders(Mobile from) - { - return from is PlayerMobile && Core.AOS && from.Skills.Blacksmith.Base > 0; - } + public override bool SupportsBulkOrders(Mobile from) => from is PlayerMobile && Core.AOS && from.Skills.Blacksmith.Base > 0; public override TimeSpan GetNextBulkOrder(Mobile from) { diff --git a/Projects/Scripts/Mobiles/Vendors/NPC/Weaver.cs b/Projects/Scripts/Mobiles/Vendors/NPC/Weaver.cs index 4fb4f4a1e..8b5ac120a 100644 --- a/Projects/Scripts/Mobiles/Vendors/NPC/Weaver.cs +++ b/Projects/Scripts/Mobiles/Vendors/NPC/Weaver.cs @@ -67,15 +67,9 @@ namespace Server.Mobiles return null; } - public override bool IsValidBulkOrder(Item item) - { - return item is SmallTailorBOD || item is LargeTailorBOD; - } + public override bool IsValidBulkOrder(Item item) => item is SmallTailorBOD || item is LargeTailorBOD; - public override bool SupportsBulkOrders(Mobile from) - { - return from is PlayerMobile && from.Skills.Tailoring.Base > 0; - } + public override bool SupportsBulkOrders(Mobile from) => from is PlayerMobile && from.Skills.Tailoring.Base > 0; public override TimeSpan GetNextBulkOrder(Mobile from) { diff --git a/Projects/Scripts/Mobiles/Vendors/PlayerBarkeeper.cs b/Projects/Scripts/Mobiles/Vendors/PlayerBarkeeper.cs index 430e14ddb..a11537460 100644 --- a/Projects/Scripts/Mobiles/Vendors/PlayerBarkeeper.cs +++ b/Projects/Scripts/Mobiles/Vendors/PlayerBarkeeper.cs @@ -63,10 +63,7 @@ namespace Server.Mobiles { private PlayerBarkeeper m_Barkeeper; - public ChangeTipMessagePrompt(PlayerBarkeeper barkeeper) - { - m_Barkeeper = barkeeper; - } + public ChangeTipMessagePrompt(PlayerBarkeeper barkeeper) => m_Barkeeper = barkeeper; public override void OnCancel(Mobile from) { @@ -185,10 +182,7 @@ namespace Server.Mobiles public override VendorShoeType ShoeType => Utility.RandomBool() ? VendorShoeType.ThighBoots : VendorShoeType.Boots; protected override List SBInfos => m_SBInfos; - public override bool GetGender() - { - return false; // always starts as male - } + public override bool GetGender() => false; public override void InitOutfit() { @@ -215,10 +209,7 @@ namespace Server.Mobiles pack?.Delete(); } - public override bool HandlesOnSpeech(Mobile from) - { - return InRange(from, 3) || base.HandlesOnSpeech(from); - } + public override bool HandlesOnSpeech(Mobile from) => InRange(from, 3) || base.HandlesOnSpeech(from); private void ShoutNews_Callback(TownCrierEntry tce, int index) { @@ -922,10 +913,7 @@ namespace Server.Mobiles AddItem(580, 46, 4030); } - private int GetButtonID(int type, int index) - { - return 1 + index * 6 + type; - } + private int GetButtonID(int type, int index) => 1 + index * 6 + type; private void RenderMessageManagement_Tip_AddOrChange() { diff --git a/Projects/Scripts/Mobiles/Vendors/PlayerVendor.cs b/Projects/Scripts/Mobiles/Vendors/PlayerVendor.cs index 521c5a94c..00ba672d5 100644 --- a/Projects/Scripts/Mobiles/Vendors/PlayerVendor.cs +++ b/Projects/Scripts/Mobiles/Vendors/PlayerVendor.cs @@ -114,10 +114,7 @@ namespace Server.Mobiles return true; } - public override bool IsAccessibleTo(Mobile m) - { - return true; - } + public override bool IsAccessibleTo(Mobile m) => true; public override bool CheckItemUse(Mobile from, Item item) { @@ -131,12 +128,10 @@ namespace Server.Mobiles return false; } - public override bool CheckTarget(Mobile from, Target targ, object targeted) - { - return base.CheckTarget(from, targ, targeted) && - (from.AccessLevel >= AccessLevel.GameMaster || - targ.GetType().IsDefined(typeof(PlayerVendorTargetAttribute), false)); - } + public override bool CheckTarget(Mobile from, Target targ, object targeted) => + base.CheckTarget(from, targ, targeted) && + (from.AccessLevel >= AccessLevel.GameMaster || + targ.GetType().IsDefined(typeof(PlayerVendorTargetAttribute), false)); public override void GetChildContextMenuEntries(Mobile from, List list, Item item) { @@ -222,10 +217,7 @@ namespace Server.Mobiles { private Item m_Item; - public BuyEntry(Item item) : base(6103) - { - m_Item = item; - } + public BuyEntry(Item item) : base(6103) => m_Item = item; public override bool NonLocalUse => true; @@ -682,10 +674,7 @@ namespace Server.Mobiles Placeholder?.Delete(); } - public override bool IsSnoop(Mobile from) - { - return false; - } + public override bool IsSnoop(Mobile from) => false; public override void GetProperties(ObjectPropertyList list) { @@ -700,10 +689,7 @@ namespace Server.Mobiles return v; } - private VendorItem SetVendorItem(Item item, int price, string description) - { - return SetVendorItem(item, price, description, DateTime.UtcNow); - } + private VendorItem SetVendorItem(Item item, int price, string description) => SetVendorItem(item, price, description, DateTime.UtcNow); private VendorItem SetVendorItem(Item item, int price, string description, DateTime created) { @@ -1107,15 +1093,9 @@ namespace Server.Mobiles base.GetContextMenuEntries(from, list); } - public override bool HandlesOnSpeech(Mobile from) - { - return from.Alive && from.GetDistanceToSqrt(this) <= 3; - } + public override bool HandlesOnSpeech(Mobile from) => from.Alive && from.GetDistanceToSqrt(this) <= 3; - public bool WasNamed(string speech) - { - return Name != null && Insensitive.StartsWith(speech, Name); - } + public bool WasNamed(string speech) => Name != null && Insensitive.StartsWith(speech, Name); public override void OnSpeech(SpeechEventArgs e) { @@ -1206,19 +1186,13 @@ namespace Server.Mobiles } } - public override bool CanBeDamaged() - { - return false; - } + public override bool CanBeDamaged() => false; private class ReturnVendorEntry : ContextMenuEntry { private PlayerVendor m_Vendor; - public ReturnVendorEntry(PlayerVendor vendor) : base(6214) - { - m_Vendor = vendor; - } + public ReturnVendorEntry(PlayerVendor vendor) : base(6214) => m_Vendor = vendor; public override void OnClick() { @@ -1292,10 +1266,7 @@ namespace Server.Mobiles [PlayerVendorTarget] private class PVBuyTarget : Target { - public PVBuyTarget() : base(3, false, TargetFlags.None) - { - AllowNonlocal = true; - } + public PVBuyTarget() : base(3, false, TargetFlags.None) => AllowNonlocal = true; protected override void OnTarget(Mobile from, object targeted) { @@ -1405,10 +1376,7 @@ namespace Server.Mobiles { private PlayerVendor m_Vendor; - public CollectGoldPrompt(PlayerVendor vendor) - { - m_Vendor = vendor; - } + public CollectGoldPrompt(PlayerVendor vendor) => m_Vendor = vendor; public override void OnResponse(Mobile from, string text) { @@ -1444,10 +1412,7 @@ namespace Server.Mobiles { private PlayerVendor m_Vendor; - public VendorNamePrompt(PlayerVendor vendor) - { - m_Vendor = vendor; - } + public VendorNamePrompt(PlayerVendor vendor) => m_Vendor = vendor; public override void OnResponse(Mobile from, string text) { @@ -1474,10 +1439,7 @@ namespace Server.Mobiles { private PlayerVendor m_Vendor; - public ShopNamePrompt(PlayerVendor vendor) - { - m_Vendor = vendor; - } + public ShopNamePrompt(PlayerVendor vendor) => m_Vendor = vendor; public override void OnResponse(Mobile from, string text) { diff --git a/Projects/Scripts/Mobiles/Vendors/PresetMapBuy.cs b/Projects/Scripts/Mobiles/Vendors/PresetMapBuy.cs index a43bf88ed..73db5a12f 100644 --- a/Projects/Scripts/Mobiles/Vendors/PresetMapBuy.cs +++ b/Projects/Scripts/Mobiles/Vendors/PresetMapBuy.cs @@ -7,16 +7,11 @@ namespace Server.Mobiles private PresetMapEntry m_Entry; public PresetMapBuyInfo(PresetMapEntry entry, int price, int amount) : base(entry.Name.ToString(), null, price, - amount, 0x14EC, 0) - { + amount, 0x14EC, 0) => m_Entry = entry; - } public override bool CanCacheDisplay => false; - public override IEntity GetEntity() - { - return new PresetMap(m_Entry); - } + public override IEntity GetEntity() => new PresetMap(m_Entry); } } \ No newline at end of file diff --git a/Projects/Scripts/Mobiles/Vendors/RentedVendor.cs b/Projects/Scripts/Mobiles/Vendors/RentedVendor.cs index 72a883dd0..c73252b8a 100644 --- a/Projects/Scripts/Mobiles/Vendors/RentedVendor.cs +++ b/Projects/Scripts/Mobiles/Vendors/RentedVendor.cs @@ -90,15 +90,9 @@ namespace Server.Mobiles [CommandProperty(AccessLevel.GameMaster)] public Mobile Landlord => House?.Owner; - public override bool IsOwner(Mobile m) - { - return m == Owner || m.AccessLevel >= AccessLevel.GameMaster || Core.ML && AccountHandler.CheckAccount(m, Owner); - } + public override bool IsOwner(Mobile m) => m == Owner || m.AccessLevel >= AccessLevel.GameMaster || Core.ML && AccountHandler.CheckAccount(m, Owner); - public bool IsLandlord(Mobile m) - { - return House?.IsOwner(m) == true; - } + public bool IsLandlord(Mobile m) => House?.IsOwner(m) == true; public void ComputeRentalExpireDelay(out int days, out int hours) { @@ -215,10 +209,7 @@ namespace Server.Mobiles { private RentedVendor m_Vendor; - public ContractOptionsEntry(RentedVendor vendor) : base(6209) - { - m_Vendor = vendor; - } + public ContractOptionsEntry(RentedVendor vendor) : base(6209) => m_Vendor = vendor; public override void OnClick() { @@ -248,10 +239,7 @@ namespace Server.Mobiles { private RentedVendor m_Vendor; - public CollectRentEntry(RentedVendor vendor) : base(6212) - { - m_Vendor = vendor; - } + public CollectRentEntry(RentedVendor vendor) : base(6212) => m_Vendor = vendor; public override void OnClick() { @@ -279,10 +267,7 @@ namespace Server.Mobiles { private RentedVendor m_Vendor; - public TerminateContractEntry(RentedVendor vendor) : base(6218) - { - m_Vendor = vendor; - } + public TerminateContractEntry(RentedVendor vendor) : base(6218) => m_Vendor = vendor; public override void OnClick() { @@ -301,10 +286,7 @@ namespace Server.Mobiles { private RentedVendor m_Vendor; - public RefundOfferPrompt(RentedVendor vendor) - { - m_Vendor = vendor; - } + public RefundOfferPrompt(RentedVendor vendor) => m_Vendor = vendor; public override void OnResponse(Mobile from, string text) { diff --git a/Projects/Scripts/Multis/BaseHouse.cs b/Projects/Scripts/Multis/BaseHouse.cs index cba02cda2..00be83754 100644 --- a/Projects/Scripts/Multis/BaseHouse.cs +++ b/Projects/Scripts/Multis/BaseHouse.cs @@ -526,10 +526,7 @@ namespace Server.Multis Delete(); } - public virtual HousePlacementEntry GetAosEntry() - { - return HousePlacementEntry.Find(this); - } + public virtual HousePlacementEntry GetAosEntry() => HousePlacementEntry.Find(this); public virtual int GetAosMaxSecures() { @@ -626,10 +623,7 @@ namespace Server.Multis return PlayerVendors.Count + VendorRentalContracts.Count < GetNewVendorSystemMaxVendors(); } - public virtual bool CanPlaceNewBarkeep() - { - return PlayerBarkeepers.Count < MaximumBarkeepCount; - } + public virtual bool CanPlaceNewBarkeep() => PlayerBarkeepers.Count < MaximumBarkeepCount; public static void IsThereVendor(Point3D location, Map map, out bool vendor, out bool rentalContract) { @@ -1038,16 +1032,11 @@ namespace Server.Multis return list; } - public virtual bool CheckAosLockdowns(int need) - { - return GetAosCurLockdowns() + need <= GetAosMaxLockdowns(); - } + public virtual bool CheckAosLockdowns(int need) => GetAosCurLockdowns() + need <= GetAosMaxLockdowns(); - public virtual bool CheckAosStorage(int need) - { - return GetAosCurSecures(out int fromSecures, out int fromVendors, out int fromLockdowns, out int fromMovingCrate) + need <= - GetAosMaxSecures(); - } + public virtual bool CheckAosStorage(int need) => + GetAosCurSecures(out int fromSecures, out int fromVendors, out int fromLockdowns, out int fromMovingCrate) + need <= + GetAosMaxSecures(); public static void Configure() { @@ -1072,15 +1061,9 @@ namespace Server.Multis return v; } - public static bool CheckLockedDown(Item item) - { - return FindHouseAt(item)?.HasLockedDownItem(item) == true; - } + public static bool CheckLockedDown(Item item) => FindHouseAt(item)?.HasLockedDownItem(item) == true; - public static bool CheckSecured(Item item) - { - return FindHouseAt(item)?.HasSecureItem(item) == true; - } + public static bool CheckSecured(Item item) => FindHouseAt(item)?.HasSecureItem(item) == true; public static bool CheckLockedDownOrSecured(Item item) { @@ -1159,11 +1142,9 @@ namespace Server.Multis return FindHouseAt(m.Location, m.Map, 16); } - public static BaseHouse FindHouseAt(Item item) - { - return item?.Deleted != false ? null : + public static BaseHouse FindHouseAt(Item item) => + item?.Deleted != false ? null : FindHouseAt(item.GetWorldLocation(), item.Map, item.ItemData.Height); - } public static BaseHouse FindHouseAt(Point3D loc, Map map, int height) { @@ -1181,15 +1162,9 @@ namespace Server.Multis return null; } - public bool IsInside(Mobile m) - { - return m?.Deleted == false && m.Map == Map && IsInside(m.Location, 16); - } + public bool IsInside(Mobile m) => m?.Deleted == false && m.Map == Map && IsInside(m.Location, 16); - public bool IsInside(Item item) - { - return item?.Deleted == false && item.Map == Map && IsInside(item.Location, item.ItemData.Height); - } + public bool IsInside(Item item) => item?.Deleted == false && item.Map == Map && IsInside(item.Location, item.ItemData.Height); public bool CheckAccessibility(Item item, Mobile from) { @@ -1367,10 +1342,7 @@ namespace Server.Multis } } - public BaseDoor AddEastDoor(int x, int y, int z) - { - return AddEastDoor(true, x, y, z); - } + public BaseDoor AddEastDoor(int x, int y, int z) => AddEastDoor(true, x, y, z); public BaseDoor AddEastDoor(bool wood, int x, int y, int z) { @@ -1381,10 +1353,7 @@ namespace Server.Multis return door; } - public BaseDoor AddSouthDoor(int x, int y, int z) - { - return AddSouthDoor(true, x, y, z); - } + public BaseDoor AddSouthDoor(int x, int y, int z) => AddSouthDoor(true, x, y, z); public BaseDoor AddSouthDoor(bool wood, int x, int y, int z) { @@ -1395,10 +1364,7 @@ namespace Server.Multis return door; } - public BaseDoor AddEastDoor(int x, int y, int z, uint k) - { - return AddEastDoor(true, x, y, z, k); - } + public BaseDoor AddEastDoor(int x, int y, int z, uint k) => AddEastDoor(true, x, y, z, k); public BaseDoor AddEastDoor(bool wood, int x, int y, int z, uint k) { @@ -1412,10 +1378,7 @@ namespace Server.Multis return door; } - public BaseDoor AddSouthDoor(int x, int y, int z, uint k) - { - return AddSouthDoor(true, x, y, z, k); - } + public BaseDoor AddSouthDoor(int x, int y, int z, uint k) => AddSouthDoor(true, x, y, z, k); public BaseDoor AddSouthDoor(bool wood, int x, int y, int z, uint k) { @@ -1429,10 +1392,7 @@ namespace Server.Multis return door; } - public BaseDoor[] AddSouthDoors(int x, int y, int z, uint k) - { - return AddSouthDoors(true, x, y, z, k); - } + public BaseDoor[] AddSouthDoors(int x, int y, int z, uint k) => AddSouthDoors(true, x, y, z, k); public BaseDoor[] AddSouthDoors(bool wood, int x, int y, int z, uint k) { @@ -1480,10 +1440,7 @@ namespace Server.Multis return value; } - public BaseDoor[] AddSouthDoors(int x, int y, int z) - { - return AddSouthDoors(true, x, y, z, false); - } + public BaseDoor[] AddSouthDoors(int x, int y, int z) => AddSouthDoors(true, x, y, z, false); public BaseDoor[] AddSouthDoors(bool wood, int x, int y, int z, bool inv) { @@ -1594,10 +1551,7 @@ namespace Server.Multis SetLockdown(c, locked, checkContains); } - public bool LockDown(Mobile m, Item item) - { - return LockDown(m, item, true); - } + public bool LockDown(Mobile m, Item item) => LockDown(m, item, true); public bool LockDown(Mobile m, Item item, bool checkIsInside) { @@ -2954,10 +2908,7 @@ namespace Server.Multis } } - public virtual HouseDeed GetDeed() - { - return null; - } + public virtual HouseDeed GetDeed() => null; public bool IsFriend(Mobile m) { @@ -3010,11 +2961,9 @@ namespace Server.Multis return m != null && (m.AccessLevel > AccessLevel.Player || IsFriend(m) || Access?.Contains(m) == true); } - public bool HasLockedDownItem(Item check) - { - return LockDowns?.Contains(check) == true || - check is VendorRentalContract contract && VendorRentalContracts.Contains(contract); - } + public bool HasLockedDownItem(Item check) => + LockDowns?.Contains(check) == true || + check is VendorRentalContract contract && VendorRentalContracts.Contains(contract); public bool HasSecureItem(Item item) { @@ -3667,9 +3616,6 @@ namespace Server.Multis Timer.DelayCall(house.RestrictedPlacingTime, Unregister); } - public override bool AllowHousing(Mobile from, Point3D p) - { - return from == m_RegionOwner || AccountHandler.CheckAccount(from, m_RegionOwner); - } + public override bool AllowHousing(Mobile from, Point3D p) => from == m_RegionOwner || AccountHandler.CheckAccount(from, m_RegionOwner); } } diff --git a/Projects/Scripts/Multis/Boats/BaseBoat.cs b/Projects/Scripts/Multis/Boats/BaseBoat.cs index 7e8189ce6..4138c1711 100644 --- a/Projects/Scripts/Multis/Boats/BaseBoat.cs +++ b/Projects/Scripts/Multis/Boats/BaseBoat.cs @@ -453,10 +453,7 @@ namespace Server.Multis SPlank.Map = Map; } - public bool CanCommand(Mobile m) - { - return true; - } + public bool CanCommand(Mobile m) => true; public Point3D GetMarkedLocation() { @@ -465,10 +462,7 @@ namespace Server.Multis return Rotate(p, (int)m_Facing / 2); } - public bool CheckKey(uint keyValue) - { - return SPlank?.KeyValue == keyValue || PPlank?.KeyValue == keyValue; - } + public bool CheckKey(uint keyValue) => SPlank?.KeyValue == keyValue || PPlank?.KeyValue == keyValue; public void Refresh() { @@ -1265,14 +1259,12 @@ namespace Server.Multis return new Point3D(Location.X + rx, Location.Y + ry, p.Z); } - public override bool Contains(int x, int y) - { - return base.Contains(x, y) || - TillerMan?.X == x && y == TillerMan.Y || - Hold?.X == x && Hold.Y == y || - PPlank?.X == x && PPlank.Y == y || - SPlank?.X == x && SPlank.Y == y; - } + public override bool Contains(int x, int y) => + base.Contains(x, y) || + TillerMan?.X == x && y == TillerMan.Y || + Hold?.X == x && Hold.Y == y || + PPlank?.X == x && PPlank.Y == y || + SPlank?.X == x && SPlank.Y == y; public static bool IsValidLocation(Point3D p, Map map) { @@ -1285,10 +1277,7 @@ namespace Server.Multis return false; } - public static Rectangle2D[] GetWrapFor(Map m) - { - return m == Map.Ilshenar ? m_IlshWrap : m == Map.Tokuno ? m_TokunoWrap : m_BritWrap; - } + public static Rectangle2D[] GetWrapFor(Map m) => m == Map.Ilshenar ? m_IlshWrap : m == Map.Tokuno ? m_TokunoWrap : m_BritWrap; public Direction GetMovementFor(int x, int y, out int maxSpeed) { diff --git a/Projects/Scripts/Multis/Boats/BaseBoatDeed.cs b/Projects/Scripts/Multis/Boats/BaseBoatDeed.cs index b0ff5946f..144ae7874 100644 --- a/Projects/Scripts/Multis/Boats/BaseBoatDeed.cs +++ b/Projects/Scripts/Multis/Boats/BaseBoatDeed.cs @@ -146,10 +146,7 @@ namespace Server.Multis { private BaseBoatDeed m_Deed; - public InternalTarget(BaseBoatDeed deed) : base(deed.MultiID, deed.Offset) - { - m_Deed = deed; - } + public InternalTarget(BaseBoatDeed deed) : base(deed.MultiID, deed.Offset) => m_Deed = deed; protected override void OnTarget(Mobile from, object o) { diff --git a/Projects/Scripts/Multis/Boats/BaseDockedBoat.cs b/Projects/Scripts/Multis/Boats/BaseDockedBoat.cs index 47203eb43..6530ebab5 100644 --- a/Projects/Scripts/Multis/Boats/BaseDockedBoat.cs +++ b/Projects/Scripts/Multis/Boats/BaseDockedBoat.cs @@ -165,10 +165,7 @@ namespace Server.Multis { private BaseDockedBoat m_Model; - public InternalTarget(BaseDockedBoat model) : base(model.MultiID, model.Offset) - { - m_Model = model; - } + public InternalTarget(BaseDockedBoat model) : base(model.MultiID, model.Offset) => m_Model = model; protected override void OnTarget(Mobile from, object o) { diff --git a/Projects/Scripts/Multis/Boats/RenameBoatPrompt.cs b/Projects/Scripts/Multis/Boats/RenameBoatPrompt.cs index 0eefb902e..4448bbed8 100644 --- a/Projects/Scripts/Multis/Boats/RenameBoatPrompt.cs +++ b/Projects/Scripts/Multis/Boats/RenameBoatPrompt.cs @@ -6,10 +6,7 @@ namespace Server.Multis { private BaseBoat m_Boat; - public RenameBoatPrompt(BaseBoat boat) - { - m_Boat = boat; - } + public RenameBoatPrompt(BaseBoat boat) => m_Boat = boat; public override void OnResponse(Mobile from, string text) { diff --git a/Projects/Scripts/Multis/Camps/BaseCamp.cs b/Projects/Scripts/Multis/Camps/BaseCamp.cs index 84963f3e6..006bc47e3 100644 --- a/Projects/Scripts/Multis/Camps/BaseCamp.cs +++ b/Projects/Scripts/Multis/Camps/BaseCamp.cs @@ -171,10 +171,7 @@ namespace Server.Multis public class LockableBarrel : LockableContainer { [Constructible] - public LockableBarrel() : base(0xE77) - { - Weight = 1.0; - } + public LockableBarrel() : base(0xE77) => Weight = 1.0; public LockableBarrel(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Multis/ComponentVerification.cs b/Projects/Scripts/Multis/ComponentVerification.cs index 6a3c9934d..f49f7094d 100644 --- a/Projects/Scripts/Multis/ComponentVerification.cs +++ b/Projects/Scripts/Multis/ComponentVerification.cs @@ -32,20 +32,11 @@ namespace Server.Multis LoadMultis("Data/Components/stairs.txt", "MultiNorth", "MultiEast", "MultiSouth", "MultiWest"); } - public bool IsItemValid(int itemID) - { - return itemID > 0 && itemID < m_ItemTable.Length && CheckValidity(m_ItemTable[itemID]); - } + public bool IsItemValid(int itemID) => itemID > 0 && itemID < m_ItemTable.Length && CheckValidity(m_ItemTable[itemID]); - public bool IsMultiValid(int multiID) - { - return multiID > 0 && multiID < m_MultiTable.Length && CheckValidity(m_MultiTable[multiID]); - } + public bool IsMultiValid(int multiID) => multiID > 0 && multiID < m_MultiTable.Length && CheckValidity(m_MultiTable[multiID]); - public bool CheckValidity(int val) - { - return val != -1 && (val == 0 || ((int)ExpansionInfo.CoreExpansion.CustomHousingFlag & val) != 0); - } + public bool CheckValidity(int val) => val != -1 && (val == 0 || ((int)ExpansionInfo.CoreExpansion.CustomHousingFlag & val) != 0); private int[] CreateTable(int length) { @@ -103,48 +94,46 @@ namespace Server.Multis public Spreadsheet(string path) { - using (StreamReader ip = new StreamReader(path)) - { - string[] types = ReadLine(ip); - string[] names = ReadLine(ip); + using StreamReader ip = new StreamReader(path); + string[] types = ReadLine(ip); + string[] names = ReadLine(ip); - m_Columns = new ColumnInfo[types.Length]; + m_Columns = new ColumnInfo[types.Length]; + + for (int i = 0; i < m_Columns.Length; ++i) + m_Columns[i] = new ColumnInfo(i, types[i], names[i]); + + List records = new List(); + + string[] values; + + while ((values = ReadLine(ip)) != null) + { + object[] data = new object[m_Columns.Length]; for (int i = 0; i < m_Columns.Length; ++i) - m_Columns[i] = new ColumnInfo(i, types[i], names[i]); - - List records = new List(); - - string[] values; - - while ((values = ReadLine(ip)) != null) { - object[] data = new object[m_Columns.Length]; + ColumnInfo ci = m_Columns[i]; - for (int i = 0; i < m_Columns.Length; ++i) + switch (ci.m_Type) { - ColumnInfo ci = m_Columns[i]; - - switch (ci.m_Type) + case "int": { - case "int": - { - data[i] = Utility.ToInt32(values[ci.m_DataIndex]); - break; - } - case "string": - { - data[i] = values[ci.m_DataIndex]; - break; - } + data[i] = Utility.ToInt32(values[ci.m_DataIndex]); + break; + } + case "string": + { + data[i] = values[ci.m_DataIndex]; + break; } } - - records.Add(new DataRecord(this, data)); } - Records = records.ToArray(); + records.Add(new DataRecord(this, data)); } + + Records = records.ToArray(); } public DataRecord[] Records{ get; } @@ -204,24 +193,12 @@ namespace Server.Multis public object this[int id] => id < 0 ? null : Data[id]; - public int GetInt32(string name) - { - return GetInt32(this[name]); - } + public int GetInt32(string name) => GetInt32(this[name]); - public int GetInt32(int id) - { - return GetInt32(this[id]); - } + public int GetInt32(int id) => GetInt32(this[id]); - public int GetInt32(object obj) - { - return Convert.ToInt32(obj); - } + public int GetInt32(object obj) => Convert.ToInt32(obj); - public string GetString(string name) - { - return this[name] as string; - } + public string GetString(string name) => this[name] as string; } } diff --git a/Projects/Scripts/Multis/Deeds.cs b/Projects/Scripts/Multis/Deeds.cs index 1b25f320a..81769384a 100644 --- a/Projects/Scripts/Multis/Deeds.cs +++ b/Projects/Scripts/Multis/Deeds.cs @@ -8,10 +8,7 @@ namespace Server.Multis.Deeds { private HouseDeed m_Deed; - public HousePlacementTarget(HouseDeed deed) : base(deed.MultiID, deed.Offset) - { - m_Deed = deed; - } + public HousePlacementTarget(HouseDeed deed) : base(deed.MultiID, deed.Offset) => m_Deed = deed; protected override void OnTarget(Mobile from, object o) { @@ -211,10 +208,7 @@ namespace Server.Multis.Deeds public override int LabelNumber => 1041211; public override Rectangle2D[] Area => SmallOldHouse.AreaArray; - public override BaseHouse GetHouse(Mobile owner) - { - return new SmallOldHouse(owner, 0x64); - } + public override BaseHouse GetHouse(Mobile owner) => new SmallOldHouse(owner, 0x64); public override void Serialize(GenericWriter writer) { @@ -245,10 +239,7 @@ namespace Server.Multis.Deeds public override int LabelNumber => 1041212; public override Rectangle2D[] Area => SmallOldHouse.AreaArray; - public override BaseHouse GetHouse(Mobile owner) - { - return new SmallOldHouse(owner, 0x66); - } + public override BaseHouse GetHouse(Mobile owner) => new SmallOldHouse(owner, 0x66); public override void Serialize(GenericWriter writer) { @@ -279,10 +270,7 @@ namespace Server.Multis.Deeds public override int LabelNumber => 1041213; public override Rectangle2D[] Area => SmallOldHouse.AreaArray; - public override BaseHouse GetHouse(Mobile owner) - { - return new SmallOldHouse(owner, 0x68); - } + public override BaseHouse GetHouse(Mobile owner) => new SmallOldHouse(owner, 0x68); public override void Serialize(GenericWriter writer) { @@ -313,10 +301,7 @@ namespace Server.Multis.Deeds public override int LabelNumber => 1041214; public override Rectangle2D[] Area => SmallOldHouse.AreaArray; - public override BaseHouse GetHouse(Mobile owner) - { - return new SmallOldHouse(owner, 0x6A); - } + public override BaseHouse GetHouse(Mobile owner) => new SmallOldHouse(owner, 0x6A); public override void Serialize(GenericWriter writer) { @@ -347,10 +332,7 @@ namespace Server.Multis.Deeds public override int LabelNumber => 1041215; public override Rectangle2D[] Area => SmallOldHouse.AreaArray; - public override BaseHouse GetHouse(Mobile owner) - { - return new SmallOldHouse(owner, 0x6C); - } + public override BaseHouse GetHouse(Mobile owner) => new SmallOldHouse(owner, 0x6C); public override void Serialize(GenericWriter writer) { @@ -381,10 +363,7 @@ namespace Server.Multis.Deeds public override int LabelNumber => 1041216; public override Rectangle2D[] Area => SmallOldHouse.AreaArray; - public override BaseHouse GetHouse(Mobile owner) - { - return new SmallOldHouse(owner, 0x6E); - } + public override BaseHouse GetHouse(Mobile owner) => new SmallOldHouse(owner, 0x6E); public override void Serialize(GenericWriter writer) { @@ -415,10 +394,7 @@ namespace Server.Multis.Deeds public override int LabelNumber => 1041219; public override Rectangle2D[] Area => GuildHouse.AreaArray; - public override BaseHouse GetHouse(Mobile owner) - { - return new GuildHouse(owner); - } + public override BaseHouse GetHouse(Mobile owner) => new GuildHouse(owner); public override void Serialize(GenericWriter writer) { @@ -449,10 +425,7 @@ namespace Server.Multis.Deeds public override int LabelNumber => 1041220; public override Rectangle2D[] Area => TwoStoryHouse.AreaArray; - public override BaseHouse GetHouse(Mobile owner) - { - return new TwoStoryHouse(owner, 0x76); - } + public override BaseHouse GetHouse(Mobile owner) => new TwoStoryHouse(owner, 0x76); public override void Serialize(GenericWriter writer) { @@ -483,10 +456,7 @@ namespace Server.Multis.Deeds public override int LabelNumber => 1041221; public override Rectangle2D[] Area => TwoStoryHouse.AreaArray; - public override BaseHouse GetHouse(Mobile owner) - { - return new TwoStoryHouse(owner, 0x78); - } + public override BaseHouse GetHouse(Mobile owner) => new TwoStoryHouse(owner, 0x78); public override void Serialize(GenericWriter writer) { @@ -517,10 +487,7 @@ namespace Server.Multis.Deeds public override int LabelNumber => 1041222; public override Rectangle2D[] Area => Tower.AreaArray; - public override BaseHouse GetHouse(Mobile owner) - { - return new Tower(owner); - } + public override BaseHouse GetHouse(Mobile owner) => new Tower(owner); public override void Serialize(GenericWriter writer) { @@ -551,10 +518,7 @@ namespace Server.Multis.Deeds public override int LabelNumber => 1041223; public override Rectangle2D[] Area => Keep.AreaArray; - public override BaseHouse GetHouse(Mobile owner) - { - return new Keep(owner); - } + public override BaseHouse GetHouse(Mobile owner) => new Keep(owner); public override void Serialize(GenericWriter writer) { @@ -585,10 +549,7 @@ namespace Server.Multis.Deeds public override int LabelNumber => 1041224; public override Rectangle2D[] Area => Castle.AreaArray; - public override BaseHouse GetHouse(Mobile owner) - { - return new Castle(owner); - } + public override BaseHouse GetHouse(Mobile owner) => new Castle(owner); public override void Serialize(GenericWriter writer) { @@ -619,10 +580,7 @@ namespace Server.Multis.Deeds public override int LabelNumber => 1041231; public override Rectangle2D[] Area => LargePatioHouse.AreaArray; - public override BaseHouse GetHouse(Mobile owner) - { - return new LargePatioHouse(owner); - } + public override BaseHouse GetHouse(Mobile owner) => new LargePatioHouse(owner); public override void Serialize(GenericWriter writer) { @@ -653,10 +611,7 @@ namespace Server.Multis.Deeds public override int LabelNumber => 1041236; public override Rectangle2D[] Area => LargeMarbleHouse.AreaArray; - public override BaseHouse GetHouse(Mobile owner) - { - return new LargeMarbleHouse(owner); - } + public override BaseHouse GetHouse(Mobile owner) => new LargeMarbleHouse(owner); public override void Serialize(GenericWriter writer) { @@ -687,10 +642,7 @@ namespace Server.Multis.Deeds public override int LabelNumber => 1041237; public override Rectangle2D[] Area => SmallTower.AreaArray; - public override BaseHouse GetHouse(Mobile owner) - { - return new SmallTower(owner); - } + public override BaseHouse GetHouse(Mobile owner) => new SmallTower(owner); public override void Serialize(GenericWriter writer) { @@ -721,10 +673,7 @@ namespace Server.Multis.Deeds public override int LabelNumber => 1041238; public override Rectangle2D[] Area => LogCabin.AreaArray; - public override BaseHouse GetHouse(Mobile owner) - { - return new LogCabin(owner); - } + public override BaseHouse GetHouse(Mobile owner) => new LogCabin(owner); public override void Serialize(GenericWriter writer) { @@ -755,10 +704,7 @@ namespace Server.Multis.Deeds public override int LabelNumber => 1041239; public override Rectangle2D[] Area => SandStonePatio.AreaArray; - public override BaseHouse GetHouse(Mobile owner) - { - return new SandStonePatio(owner); - } + public override BaseHouse GetHouse(Mobile owner) => new SandStonePatio(owner); public override void Serialize(GenericWriter writer) { @@ -789,10 +735,7 @@ namespace Server.Multis.Deeds public override int LabelNumber => 1041240; public override Rectangle2D[] Area => TwoStoryVilla.AreaArray; - public override BaseHouse GetHouse(Mobile owner) - { - return new TwoStoryVilla(owner); - } + public override BaseHouse GetHouse(Mobile owner) => new TwoStoryVilla(owner); public override void Serialize(GenericWriter writer) { @@ -823,10 +766,7 @@ namespace Server.Multis.Deeds public override int LabelNumber => 1041241; public override Rectangle2D[] Area => SmallShop.AreaArray2; - public override BaseHouse GetHouse(Mobile owner) - { - return new SmallShop(owner, 0xA0); - } + public override BaseHouse GetHouse(Mobile owner) => new SmallShop(owner, 0xA0); public override void Serialize(GenericWriter writer) { @@ -857,10 +797,7 @@ namespace Server.Multis.Deeds public override int LabelNumber => 1041242; public override Rectangle2D[] Area => SmallShop.AreaArray1; - public override BaseHouse GetHouse(Mobile owner) - { - return new SmallShop(owner, 0xA2); - } + public override BaseHouse GetHouse(Mobile owner) => new SmallShop(owner, 0xA2); public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Multis/DynamicDecay.cs b/Projects/Scripts/Multis/DynamicDecay.cs index 031a774d7..8976f294a 100644 --- a/Projects/Scripts/Multis/DynamicDecay.cs +++ b/Projects/Scripts/Multis/DynamicDecay.cs @@ -26,10 +26,7 @@ namespace Server.Multis m_Stages[level] = new DecayStageInfo(min, max); } - public static bool Decays(DecayLevel level) - { - return m_Stages.ContainsKey(level); - } + public static bool Decays(DecayLevel level) => m_Stages.ContainsKey(level); public static TimeSpan GetRandomDuration(DecayLevel level) { diff --git a/Projects/Scripts/Multis/HouseFoundation.cs b/Projects/Scripts/Multis/HouseFoundation.cs index 186b9faed..9dae30521 100644 --- a/Projects/Scripts/Multis/HouseFoundation.cs +++ b/Projects/Scripts/Multis/HouseFoundation.cs @@ -190,15 +190,9 @@ namespace Server.Multis public static ComponentVerification Verification => m_Verification ?? (m_Verification = new ComponentVerification()); - public bool IsFixture(Item item) - { - return Fixtures.Contains(item); - } + public bool IsFixture(Item item) => Fixtures.Contains(item); - public override int GetMaxUpdateRange() - { - return 24; - } + public override int GetMaxUpdateRange() => 24; public override int GetUpdateRange(Mobile m) { @@ -633,13 +627,7 @@ namespace Server.Multis } } - private static DoorFacing GetSADoorFacing(int offset) - { - /* Offset 0 2 4 6 - * DoorFacing 2 3 6 7 - */ - return (DoorFacing)((offset / 2 + 2 * (1 + offset / 4)) % 8); - } + private static DoorFacing GetSADoorFacing(int offset) => (DoorFacing)((offset / 2 + 2 * (1 + offset / 4)) % 8); public void AddFixture(Item item, MultiTileEntry mte) { @@ -932,10 +920,7 @@ namespace Server.Multis base.Deserialize(reader); } - public bool IsHiddenToCustomizer(Item item) - { - return item == Signpost || item == SignHanger || item == Sign || IsFixture(item); - } + public bool IsHiddenToCustomizer(Item item) => item == Signpost || item == SignHanger || item == Sign || IsFixture(item); public static void Initialize() { @@ -1525,10 +1510,8 @@ namespace Server.Multis { try { - using (StreamWriter op = new StreamWriter("comp_val.log", true)) - { - op.WriteLine("{0}\t{1}\tInvalid ItemID 0x{2:X4}", state, state.Mobile, itemID); - } + using StreamWriter op = new StreamWriter("comp_val.log", true); + op.WriteLine("{0}\t{1}\tInvalid ItemID 0x{2:X4}", state, state.Mobile, itemID); } catch { @@ -2519,10 +2502,8 @@ namespace Server.Multis try { - using (StreamWriter op = new StreamWriter("dsd_exceptions.txt", true)) - { - op.WriteLine(e); - } + using StreamWriter op = new StreamWriter("dsd_exceptions.txt", true); + op.WriteLine(e); } catch { diff --git a/Projects/Scripts/Multis/HouseSign.cs b/Projects/Scripts/Multis/HouseSign.cs index 54d043419..6e43daa9c 100644 --- a/Projects/Scripts/Multis/HouseSign.cs +++ b/Projects/Scripts/Multis/HouseSign.cs @@ -38,10 +38,7 @@ namespace Server.Multis public bool GettingProperties{ get; private set; } - public string GetName() - { - return Name ?? "An Unnamed House"; - } + public string GetName() => Name ?? "An Unnamed House"; public override void OnAfterDelete() { @@ -228,10 +225,7 @@ namespace Server.Multis { private HouseSign m_Sign; - public VendorsEntry(HouseSign sign) : base(6211) - { - m_Sign = sign; - } + public VendorsEntry(HouseSign sign) : base(6211) => m_Sign = sign; public override void OnClick() { @@ -253,10 +247,7 @@ namespace Server.Multis { private HouseSign m_Sign; - public ReclaimVendorInventoryEntry(HouseSign sign) : base(6213) - { - m_Sign = sign; - } + public ReclaimVendorInventoryEntry(HouseSign sign) : base(6213) => m_Sign = sign; public override void OnClick() { diff --git a/Projects/Scripts/Multis/Houses.cs b/Projects/Scripts/Multis/Houses.cs index 1e5556a81..a4c20813a 100644 --- a/Projects/Scripts/Multis/Houses.cs +++ b/Projects/Scripts/Multis/Houses.cs @@ -83,10 +83,7 @@ namespace Server.Multis public override Rectangle2D[] Area => AreaArray; public override Point3D BaseBanLocation => new Point3D(4, 8, 0); - public override HouseDeed GetDeed() - { - return new BrickHouseDeed(); - } + public override HouseDeed GetDeed() => new BrickHouseDeed(); public override void Serialize(GenericWriter writer) { @@ -183,10 +180,7 @@ namespace Server.Multis public override Rectangle2D[] Area => AreaArray; public override Point3D BaseBanLocation => new Point3D(5, 8, 0); - public override HouseDeed GetDeed() - { - return new TowerDeed(); - } + public override HouseDeed GetDeed() => new TowerDeed(); public override void Serialize(GenericWriter writer) { @@ -228,10 +222,7 @@ namespace Server.Multis public override Rectangle2D[] Area => AreaArray; public override Point3D BaseBanLocation => new Point3D(5, 13, 0); - public override HouseDeed GetDeed() - { - return new KeepDeed(); - } + public override HouseDeed GetDeed() => new KeepDeed(); public override void Serialize(GenericWriter writer) { @@ -272,10 +263,7 @@ namespace Server.Multis public override Rectangle2D[] Area => AreaArray; public override Point3D BaseBanLocation => new Point3D(5, 17, 0); - public override HouseDeed GetDeed() - { - return new CastleDeed(); - } + public override HouseDeed GetDeed() => new CastleDeed(); public override void Serialize(GenericWriter writer) { @@ -319,10 +307,7 @@ namespace Server.Multis public override Rectangle2D[] Area => AreaArray; public override Point3D BaseBanLocation => new Point3D(1, 8, 0); - public override HouseDeed GetDeed() - { - return new LargePatioDeed(); - } + public override HouseDeed GetDeed() => new LargePatioDeed(); public override void Serialize(GenericWriter writer) { @@ -362,10 +347,7 @@ namespace Server.Multis public override Rectangle2D[] Area => AreaArray; public override Point3D BaseBanLocation => new Point3D(1, 8, 0); - public override HouseDeed GetDeed() - { - return new LargeMarbleDeed(); - } + public override HouseDeed GetDeed() => new LargeMarbleDeed(); public override void Serialize(GenericWriter writer) { @@ -404,10 +386,7 @@ namespace Server.Multis public override Rectangle2D[] Area => AreaArray; public override Point3D BaseBanLocation => new Point3D(1, 4, 0); - public override HouseDeed GetDeed() - { - return new SmallTowerDeed(); - } + public override HouseDeed GetDeed() => new SmallTowerDeed(); public override void Serialize(GenericWriter writer) { @@ -448,10 +427,7 @@ namespace Server.Multis public override Rectangle2D[] Area => AreaArray; public override Point3D BaseBanLocation => new Point3D(5, 8, 0); - public override HouseDeed GetDeed() - { - return new LogCabinDeed(); - } + public override HouseDeed GetDeed() => new LogCabinDeed(); public override void Serialize(GenericWriter writer) { @@ -491,10 +467,7 @@ namespace Server.Multis public override Rectangle2D[] Area => AreaArray; public override Point3D BaseBanLocation => new Point3D(4, 6, 0); - public override HouseDeed GetDeed() - { - return new SandstonePatioDeed(); - } + public override HouseDeed GetDeed() => new SandstonePatioDeed(); public override void Serialize(GenericWriter writer) { @@ -536,10 +509,7 @@ namespace Server.Multis public override Rectangle2D[] Area => AreaArray; public override Point3D BaseBanLocation => new Point3D(3, 8, 0); - public override HouseDeed GetDeed() - { - return new VillaDeed(); - } + public override HouseDeed GetDeed() => new VillaDeed(); public override void Serialize(GenericWriter writer) { diff --git a/Projects/Scripts/Multis/MovingCrate.cs b/Projects/Scripts/Multis/MovingCrate.cs index 1dd344de8..a29857e71 100644 --- a/Projects/Scripts/Multis/MovingCrate.cs +++ b/Projects/Scripts/Multis/MovingCrate.cs @@ -139,15 +139,9 @@ namespace Server.Multis return base.CheckHold(m, item, message, checkItems, plusItems, plusWeight); } - public override bool CheckLift(Mobile from, Item item, ref LRReason reject) - { - return House?.Deleted == false && base.CheckLift(from, item, ref reject) && House.IsOwner(from); - } + public override bool CheckLift(Mobile from, Item item, ref LRReason reject) => House?.Deleted == false && base.CheckLift(from, item, ref reject) && House.IsOwner(from); - public override bool CheckItemUse(Mobile from, Item item) - { - return House?.Deleted == false && base.CheckItemUse(from, item) && House.IsOwner(from); - } + public override bool CheckItemUse(Mobile from, Item item) => House?.Deleted == false && base.CheckItemUse(from, item) && House.IsOwner(from); public override void OnItemRemoved(Item item) { @@ -254,10 +248,7 @@ namespace Server.Multis public class PackingBox : BaseContainer { - public PackingBox() : base(0x9A8) - { - Movable = false; - } + public PackingBox() : base(0x9A8) => Movable = false; public PackingBox(Serial serial) : base(serial) { diff --git a/Projects/Scripts/Regions/DungeonRegion.cs b/Projects/Scripts/Regions/DungeonRegion.cs index e1730cb0e..9cc8fc508 100644 --- a/Projects/Scripts/Regions/DungeonRegion.cs +++ b/Projects/Scripts/Regions/DungeonRegion.cs @@ -27,10 +27,7 @@ namespace Server.Regions public Map EntranceMap{ get; set; } - public override bool AllowHousing(Mobile from, Point3D p) - { - return false; - } + public override bool AllowHousing(Mobile from, Point3D p) => false; public override void AlterLightLevel(Mobile m, ref int global, ref int personal) { diff --git a/Projects/Scripts/Regions/GuardedRegion.cs b/Projects/Scripts/Regions/GuardedRegion.cs index 7d7f830e8..70f636be9 100644 --- a/Projects/Scripts/Regions/GuardedRegion.cs +++ b/Projects/Scripts/Regions/GuardedRegion.cs @@ -14,16 +14,11 @@ namespace Server.Regions private Dictionary m_GuardCandidates = new Dictionary(); private Type m_GuardType; - public GuardedRegion(string name, Map map, int priority, params Rectangle3D[] area) : base(name, map, priority, area) - { - m_GuardType = DefaultGuardType; - } + public GuardedRegion(string name, Map map, int priority, params Rectangle3D[] area) : base(name, map, priority, area) => m_GuardType = DefaultGuardType; public GuardedRegion(string name, Map map, int priority, params Rectangle2D[] area) - : base(name, map, priority, area) - { + : base(name, map, priority, area) => m_GuardType = DefaultGuardType; - } public GuardedRegion(XmlElement xml, Map map, Region parent) : base(xml, map, parent) { @@ -61,10 +56,7 @@ namespace Server.Regions } } - public virtual bool IsDisabled() - { - return Disabled; - } + public virtual bool IsDisabled() => Disabled; public static void Initialize() { @@ -165,10 +157,7 @@ namespace Server.Regions return base.OnBeginSpellCast(m, s); } - public override bool AllowHousing(Mobile from, Point3D p) - { - return false; - } + public override bool AllowHousing(Mobile from, Point3D p) => false; public override void MakeGuard(Mobile focus) { diff --git a/Projects/Scripts/Regions/HouseRegion.cs b/Projects/Scripts/Regions/HouseRegion.cs index c2e61787d..46a4d99b9 100644 --- a/Projects/Scripts/Regions/HouseRegion.cs +++ b/Projects/Scripts/Regions/HouseRegion.cs @@ -38,10 +38,7 @@ namespace Server.Regions e.Mobile.Location = house.BanLocation; } - public override bool AllowHousing(Mobile from, Point3D p) - { - return false; - } + public override bool AllowHousing(Mobile from, Point3D p) => false; private static Rectangle3D[] GetArea(BaseHouse house) { @@ -71,10 +68,7 @@ namespace Server.Regions return true; } - public override bool CheckAccessibility(Item item, Mobile from) - { - return House.CheckAccessibility(item, from); - } + public override bool CheckAccessibility(Item item, Mobile from) => House.CheckAccessibility(item, from); // Use OnLocationChanged instead of OnEnter because it can be that we enter a house region even though we're not actually inside the house public override void OnLocationChanged(Mobile m, Point3D oldLocation) diff --git a/Projects/Scripts/Regions/Jail.cs b/Projects/Scripts/Regions/Jail.cs index 6cf3a33c3..a426db3af 100644 --- a/Projects/Scripts/Regions/Jail.cs +++ b/Projects/Scripts/Regions/Jail.cs @@ -24,10 +24,7 @@ namespace Server.Regions return from.AccessLevel > AccessLevel.Player; } - public override bool AllowHousing(Mobile from, Point3D p) - { - return false; - } + public override bool AllowHousing(Mobile from, Point3D p) => false; public override void AlterLightLevel(Mobile m, ref int global, ref int personal) { @@ -50,9 +47,6 @@ namespace Server.Regions return from.AccessLevel > AccessLevel.Player; } - public override bool OnCombatantChange(Mobile from, Mobile Old, Mobile New) - { - return from.AccessLevel > AccessLevel.Player; - } + public override bool OnCombatantChange(Mobile from, Mobile Old, Mobile New) => from.AccessLevel > AccessLevel.Player; } } \ No newline at end of file diff --git a/Projects/Scripts/Regions/NoHousingRegion.cs b/Projects/Scripts/Regions/NoHousingRegion.cs index 9c12903a3..4a009645b 100644 --- a/Projects/Scripts/Regions/NoHousingRegion.cs +++ b/Projects/Scripts/Regions/NoHousingRegion.cs @@ -16,9 +16,6 @@ namespace Server.Regions public bool SmartChecking => m_SmartChecking; - public override bool AllowHousing(Mobile from, Point3D p) - { - return m_SmartChecking; - } + public override bool AllowHousing(Mobile from, Point3D p) => m_SmartChecking; } } \ No newline at end of file diff --git a/Projects/Scripts/Regions/Spawning/SpawnDefinition.cs b/Projects/Scripts/Regions/Spawning/SpawnDefinition.cs index f25556d41..90ff46960 100644 --- a/Projects/Scripts/Regions/Spawning/SpawnDefinition.cs +++ b/Projects/Scripts/Regions/Spawning/SpawnDefinition.cs @@ -186,10 +186,7 @@ namespace Server.Regions return mobile; } - protected virtual Mobile CreateMobile() - { - return (Mobile)Activator.CreateInstance(Type); - } + protected virtual Mobile CreateMobile() => (Mobile)Activator.CreateInstance(Type); } public class SpawnItem : SpawnType @@ -242,10 +239,7 @@ namespace Server.Regions return item; } - protected virtual Item CreateItem() - { - return (Item)Activator.CreateInstance(Type); - } + protected virtual Item CreateItem() => (Item)Activator.CreateInstance(Type); } public class SpawnTreasureChest : SpawnItem @@ -265,10 +259,7 @@ namespace Server.Regions m_Height = TileData.ItemTable[ItemID & TileData.MaxItemValue].Height; } - protected override Item CreateItem() - { - return new BaseTreasureChest(ItemID, Level); - } + protected override Item CreateItem() => new BaseTreasureChest(ItemID, Level); } public class SpawnGroupElement diff --git a/Projects/Scripts/Regions/Spawning/SpawnEntry.cs b/Projects/Scripts/Regions/Spawning/SpawnEntry.cs index 5c1d06729..9890ebb27 100644 --- a/Projects/Scripts/Regions/Spawning/SpawnEntry.cs +++ b/Projects/Scripts/Regions/Spawning/SpawnEntry.cs @@ -84,10 +84,7 @@ namespace Server.Regions CheckTimer(); } - public Point3D RandomSpawnLocation(int spawnHeight, bool land, bool water) - { - return Region.RandomSpawnLocation(spawnHeight, land, water, HomeLocation, HomeRange); - } + public Point3D RandomSpawnLocation(int spawnHeight, bool land, bool water) => Region.RandomSpawnLocation(spawnHeight, land, water, HomeLocation, HomeRange); public void Start() { diff --git a/Projects/Scripts/Regions/Spawning/SpawnPersistence.cs b/Projects/Scripts/Regions/Spawning/SpawnPersistence.cs index ab85b19ba..e4c827e68 100644 --- a/Projects/Scripts/Regions/Spawning/SpawnPersistence.cs +++ b/Projects/Scripts/Regions/Spawning/SpawnPersistence.cs @@ -5,15 +5,9 @@ namespace Server.Regions { private static SpawnPersistence m_Instance; - private SpawnPersistence() : base(1) - { - Movable = false; - } + private SpawnPersistence() : base(1) => Movable = false; - public SpawnPersistence(Serial serial) : base(serial) - { - m_Instance = this; - } + public SpawnPersistence(Serial serial) : base(serial) => m_Instance = this; public SpawnPersistence Instance => m_Instance; diff --git a/Projects/Scripts/Skills/AnimalTaming.cs b/Projects/Scripts/Skills/AnimalTaming.cs index 85b3e9799..a24a80936 100644 --- a/Projects/Scripts/Skills/AnimalTaming.cs +++ b/Projects/Scripts/Skills/AnimalTaming.cs @@ -34,18 +34,13 @@ namespace Server.SkillHandlers return TimeSpan.FromHours(6.0); } - public static bool CheckMastery(Mobile tamer, BaseCreature creature) - { - return SummonFamiliarSpell.Table.TryGetValue(tamer, out BaseCreature bc) && bc is DarkWolfFamiliar familiar && - !familiar.Deleted && (creature is DireWolf || creature is GreyWolf || creature is TimberWolf || - creature is WhiteWolf || - creature is BakeKitsune); - } + public static bool CheckMastery(Mobile tamer, BaseCreature creature) => + SummonFamiliarSpell.Table.TryGetValue(tamer, out BaseCreature bc) && bc is DarkWolfFamiliar familiar && + !familiar.Deleted && (creature is DireWolf || creature is GreyWolf || creature is TimberWolf || + creature is WhiteWolf || + creature is BakeKitsune); - public static bool MustBeSubdued(BaseCreature bc) - { - return bc.Owners.Count <= 0 && bc.SubdueBeforeTame && bc.Hits > bc.HitsMax / 10; - } + public static bool MustBeSubdued(BaseCreature bc) => bc.Owners.Count <= 0 && bc.SubdueBeforeTame && bc.Hits > bc.HitsMax / 10; public static void ScaleStats(BaseCreature bc, double scalar) { diff --git a/Projects/Scripts/Skills/ArmsLore.cs b/Projects/Scripts/Skills/ArmsLore.cs index eb5401a9e..2800ecd08 100644 --- a/Projects/Scripts/Skills/ArmsLore.cs +++ b/Projects/Scripts/Skills/ArmsLore.cs @@ -25,10 +25,7 @@ namespace Server.SkillHandlers [PlayerVendorTarget] private class InternalTarget : Target { - public InternalTarget() : base(2, false, TargetFlags.None) - { - AllowNonlocal = true; - } + public InternalTarget() : base(2, false, TargetFlags.None) => AllowNonlocal = true; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Skills/Discordance.cs b/Projects/Scripts/Skills/Discordance.cs index 3ace537e9..25ea05e79 100644 --- a/Projects/Scripts/Skills/Discordance.cs +++ b/Projects/Scripts/Skills/Discordance.cs @@ -144,10 +144,8 @@ namespace Server.SkillHandlers private BaseInstrument m_Instrument; public DiscordanceTarget(Mobile from, BaseInstrument inst) : base( - BaseInstrument.GetBardRange(from, SkillName.Discordance), false, TargetFlags.None) - { + BaseInstrument.GetBardRange(from, SkillName.Discordance), false, TargetFlags.None) => m_Instrument = inst; - } protected override void OnTarget(Mobile from, object target) { diff --git a/Projects/Scripts/Skills/Inscribe.cs b/Projects/Scripts/Skills/Inscribe.cs index 66d628b44..cbd877a32 100644 --- a/Projects/Scripts/Skills/Inscribe.cs +++ b/Projects/Scripts/Skills/Inscribe.cs @@ -108,10 +108,7 @@ namespace Server.SkillHandlers { private BaseBook m_BookSrc; - public InternalTargetDst(BaseBook bookSrc) : base(3, false, TargetFlags.None) - { - m_BookSrc = bookSrc; - } + public InternalTargetDst(BaseBook bookSrc) : base(3, false, TargetFlags.None) => m_BookSrc = bookSrc; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Skills/ItemIdentification.cs b/Projects/Scripts/Skills/ItemIdentification.cs index 6fbda080b..e3a168a19 100644 --- a/Projects/Scripts/Skills/ItemIdentification.cs +++ b/Projects/Scripts/Skills/ItemIdentification.cs @@ -22,10 +22,7 @@ namespace Server.Items [PlayerVendorTarget] private class InternalTarget : Target { - public InternalTarget() : base(8, false, TargetFlags.None) - { - AllowNonlocal = true; - } + public InternalTarget() : base(8, false, TargetFlags.None) => AllowNonlocal = true; protected override void OnTarget(Mobile from, object o) { diff --git a/Projects/Scripts/Skills/Peacemaking.cs b/Projects/Scripts/Skills/Peacemaking.cs index 43358fe3d..7396a0202 100644 --- a/Projects/Scripts/Skills/Peacemaking.cs +++ b/Projects/Scripts/Skills/Peacemaking.cs @@ -36,10 +36,8 @@ namespace Server.SkillHandlers private bool m_SetSkillTime = true; public InternalTarget(Mobile from, BaseInstrument instrument) : base( - BaseInstrument.GetBardRange(from, SkillName.Peacemaking), false, TargetFlags.None) - { + BaseInstrument.GetBardRange(from, SkillName.Peacemaking), false, TargetFlags.None) => m_Instrument = instrument; - } protected override void OnTargetFinish(Mobile from) { diff --git a/Projects/Scripts/Skills/Poisoning.cs b/Projects/Scripts/Skills/Poisoning.cs index 02776fcaa..31d7940e7 100644 --- a/Projects/Scripts/Skills/Poisoning.cs +++ b/Projects/Scripts/Skills/Poisoning.cs @@ -45,10 +45,7 @@ namespace Server.SkillHandlers { private BasePoisonPotion m_Potion; - public InternalTarget(BasePoisonPotion potion) : base(2, false, TargetFlags.None) - { - m_Potion = potion; - } + public InternalTarget(BasePoisonPotion potion) : base(2, false, TargetFlags.None) => m_Potion = potion; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Skills/Provocation.cs b/Projects/Scripts/Skills/Provocation.cs index a2aa3e567..0d2652e61 100644 --- a/Projects/Scripts/Skills/Provocation.cs +++ b/Projects/Scripts/Skills/Provocation.cs @@ -33,10 +33,8 @@ namespace Server.SkillHandlers private BaseInstrument m_Instrument; public InternalFirstTarget(Mobile from, BaseInstrument instrument) : base( - BaseInstrument.GetBardRange(from, SkillName.Provocation), false, TargetFlags.None) - { + BaseInstrument.GetBardRange(from, SkillName.Provocation), false, TargetFlags.None) => m_Instrument = instrument; - } protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Skills/SpiritSpeak.cs b/Projects/Scripts/Skills/SpiritSpeak.cs index 972825d29..d24077635 100644 --- a/Projects/Scripts/Skills/SpiritSpeak.cs +++ b/Projects/Scripts/Skills/SpiritSpeak.cs @@ -90,10 +90,7 @@ namespace Server.SkillHandlers public override bool CheckNextSpellTime => false; - public override int GetMana() - { - return 0; - } + public override int GetMana() => 0; public override void OnCasterHurt() { @@ -101,15 +98,9 @@ namespace Server.SkillHandlers Disturb(DisturbType.Hurt, false, true); } - public override bool ConsumeReagents() - { - return true; - } + public override bool ConsumeReagents() => true; - public override bool CheckFizzle() - { - return true; - } + public override bool CheckFizzle() => true; public override void OnDisturb(DisturbType type, bool message) { diff --git a/Projects/Scripts/Skills/Stealing.cs b/Projects/Scripts/Skills/Stealing.cs index 3d39f614c..398636912 100644 --- a/Projects/Scripts/Skills/Stealing.cs +++ b/Projects/Scripts/Skills/Stealing.cs @@ -23,15 +23,9 @@ namespace Server.SkillHandlers SkillInfo.Table[33].Callback = OnUse; } - public static bool IsInGuild(Mobile m) - { - return m is PlayerMobile mobile && mobile.NpcGuild == NpcGuild.ThievesGuild; - } + public static bool IsInGuild(Mobile m) => m is PlayerMobile mobile && mobile.NpcGuild == NpcGuild.ThievesGuild; - public static bool IsInnocentTo(Mobile from, Mobile to) - { - return Notoriety.Compute(from, to) == Notoriety.Innocent; - } + public static bool IsInnocentTo(Mobile from, Mobile to) => Notoriety.Compute(from, to) == Notoriety.Innocent; public static bool IsEmptyHanded(Mobile from) { diff --git a/Projects/Scripts/Skills/TasteID.cs b/Projects/Scripts/Skills/TasteID.cs index 654b54924..70b3d9ad5 100644 --- a/Projects/Scripts/Skills/TasteID.cs +++ b/Projects/Scripts/Skills/TasteID.cs @@ -24,10 +24,7 @@ namespace Server.SkillHandlers [PlayerVendorTarget] private class InternalTarget : Target { - public InternalTarget() : base(2, false, TargetFlags.None) - { - AllowNonlocal = true; - } + public InternalTarget() : base(2, false, TargetFlags.None) => AllowNonlocal = true; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Skills/Tracking.cs b/Projects/Scripts/Skills/Tracking.cs index f09cb55e5..c0bb11565 100644 --- a/Projects/Scripts/Skills/Tracking.cs +++ b/Projects/Scripts/Skills/Tracking.cs @@ -255,25 +255,13 @@ namespace Server.SkillHandlers return chance > Utility.Random(100); } - private static bool IsAnimal(Mobile m) - { - return !m.Player && m.Body.IsAnimal; - } + private static bool IsAnimal(Mobile m) => !m.Player && m.Body.IsAnimal; - private static bool IsMonster(Mobile m) - { - return !m.Player && m.Body.IsMonster; - } + private static bool IsMonster(Mobile m) => !m.Player && m.Body.IsMonster; - private static bool IsHumanNPC(Mobile m) - { - return !m.Player && m.Body.IsHuman; - } + private static bool IsHumanNPC(Mobile m) => !m.Player && m.Body.IsHuman; - private static bool IsPlayer(Mobile m) - { - return m.Player; - } + private static bool IsPlayer(Mobile m) => m.Player; public override void OnResponse(NetState state, RelayInfo info) { @@ -294,10 +282,7 @@ namespace Server.SkillHandlers { private Mobile m_From; - public InternalSorter(Mobile from) - { - m_From = from; - } + public InternalSorter(Mobile from) => m_From = from; public int Compare(Mobile x, Mobile y) { diff --git a/Projects/Scripts/SpecialSystems/Engines/PreventInaccess.cs b/Projects/Scripts/SpecialSystems/Engines/PreventInaccess.cs index 4c0dc2bf1..8d81d45fb 100644 --- a/Projects/Scripts/SpecialSystems/Engines/PreventInaccess.cs +++ b/Projects/Scripts/SpecialSystems/Engines/PreventInaccess.cs @@ -63,15 +63,9 @@ namespace Server.Misc } } - private static bool HasDisconnected(Mobile m) - { - return m.NetState?.Socket == null; - } + private static bool HasDisconnected(Mobile m) => m.NetState?.Socket == null; - private static LocationInfo GetRandomDestination() - { - return m_Destinations[Utility.Random(m_Destinations.Length)]; - } + private static LocationInfo GetRandomDestination() => m_Destinations[Utility.Random(m_Destinations.Length)]; private class LocationInfo { diff --git a/Projects/Scripts/Spells/Base/MagerySpell.cs b/Projects/Scripts/Spells/Base/MagerySpell.cs index 5fa66c2c3..bd546a641 100644 --- a/Projects/Scripts/Spells/Base/MagerySpell.cs +++ b/Projects/Scripts/Spells/Base/MagerySpell.cs @@ -18,10 +18,7 @@ namespace Server.Spells public override TimeSpan CastDelayBase => TimeSpan.FromSeconds((3 + (int)Circle) * CastDelaySecondsPerTick); - public override bool ConsumeReagents() - { - return base.ConsumeReagents() || ArcaneGem.ConsumeCharges(Caster, Core.SE ? 1 : 1 + (int)Circle); - } + public override bool ConsumeReagents() => base.ConsumeReagents() || ArcaneGem.ConsumeCharges(Caster, Core.SE ? 1 : 1 + (int)Circle); public override void GetCastSkills(out double min, out double max) { @@ -36,10 +33,7 @@ namespace Server.Spells max = avg + ChanceOffset; } - public override int GetMana() - { - return Scroll is BaseWand ? 0 : m_ManaTable[(int)Circle]; - } + public override int GetMana() => Scroll is BaseWand ? 0 : m_ManaTable[(int)Circle]; public override double GetResistSkill(Mobile m) { @@ -83,10 +77,7 @@ namespace Server.Spells 2.0; // Seems should be about half of what stratics says. } - public virtual double GetResistPercent(Mobile target) - { - return GetResistPercentForCircle(target, Circle); - } + public virtual double GetResistPercent(Mobile target) => GetResistPercentForCircle(target, Circle); public override TimeSpan GetCastDelay() { diff --git a/Projects/Scripts/Spells/Base/SpecialMove.cs b/Projects/Scripts/Spells/Base/SpecialMove.cs index 6a8a5192d..c8fc50e44 100644 --- a/Projects/Scripts/Spells/Base/SpecialMove.cs +++ b/Projects/Scripts/Spells/Base/SpecialMove.cs @@ -27,27 +27,15 @@ namespace Server.Spells public virtual bool ValidatesDuringHit => true; - public virtual int GetAccuracyBonus(Mobile attacker) - { - return 0; - } + public virtual int GetAccuracyBonus(Mobile attacker) => 0; - public virtual double GetDamageScalar(Mobile attacker, Mobile defender) - { - return 1.0; - } + public virtual double GetDamageScalar(Mobile attacker, Mobile defender) => 1.0; // Called before swinging, to make sure the accuracy scalar is to be computed. - public virtual bool OnBeforeSwing(Mobile attacker, Mobile defender) - { - return true; - } + public virtual bool OnBeforeSwing(Mobile attacker, Mobile defender) => true; // Called when a hit connects, but before damage is calculated. - public virtual bool OnBeforeDamage(Mobile attacker, Mobile defender) - { - return true; - } + public virtual bool OnBeforeDamage(Mobile attacker, Mobile defender) => true; // Called as soon as the ability is used. public virtual void OnUse(Mobile from) @@ -69,15 +57,9 @@ namespace Server.Spells { } - public virtual bool IgnoreArmor(Mobile attacker) - { - return false; - } + public virtual bool IgnoreArmor(Mobile attacker) => false; - public virtual double GetPropertyBonus(Mobile attacker) - { - return 1.0; - } + public virtual double GetPropertyBonus(Mobile attacker) => 1.0; public virtual bool CheckSkills(Mobile m) { @@ -302,10 +284,7 @@ namespace Server.Spells } } - private static SpecialMoveContext GetContext(Mobile m) - { - return m_PlayersTable.TryGetValue(m, out SpecialMoveContext context) ? context : null; - } + private static SpecialMoveContext GetContext(Mobile m) => m_PlayersTable.TryGetValue(m, out SpecialMoveContext context) ? context : null; private class SpecialMoveTimer : Timer { diff --git a/Projects/Scripts/Spells/Base/Spell.cs b/Projects/Scripts/Spells/Base/Spell.cs index d6259fb06..d4fff8519 100644 --- a/Projects/Scripts/Spells/Base/Spell.cs +++ b/Projects/Scripts/Spells/Base/Spell.cs @@ -126,10 +126,7 @@ namespace Server.Spells return true; } - public virtual bool OnCastInTown(Region r) - { - return Info.AllowTown; - } + public virtual bool OnCastInTown(Region r) => Info.AllowTown; public void StartDelayedDamageContext(Mobile m, Timer t) { @@ -162,10 +159,7 @@ namespace Server.Spells return GetNewAosDamage(bonus, dice, sides, false); } - public virtual int GetNewAosDamage(int bonus, int dice, int sides, bool playerVsPlayer) - { - return GetNewAosDamage(bonus, dice, sides, playerVsPlayer, 1.0); - } + public virtual int GetNewAosDamage(int bonus, int dice, int sides, bool playerVsPlayer) => GetNewAosDamage(bonus, dice, sides, playerVsPlayer, 1.0); public virtual int GetNewAosDamage(int bonus, int dice, int sides, bool playerVsPlayer, double scalar) { @@ -225,40 +219,15 @@ namespace Server.Spells return false; } - public virtual double GetInscribeSkill(Mobile m) - { - // There is no chance to gain - // m.CheckSkill( SkillName.Inscribe, 0.0, 120.0 ); + public virtual double GetInscribeSkill(Mobile m) => m.Skills.Inscribe.Value; - return m.Skills.Inscribe.Value; - } + public virtual int GetInscribeFixed(Mobile m) => m.Skills.Inscribe.Fixed; - public virtual int GetInscribeFixed(Mobile m) - { - // There is no chance to gain - // m.CheckSkill( SkillName.Inscribe, 0.0, 120.0 ); + public virtual int GetDamageFixed(Mobile m) => m.Skills[DamageSkill].Fixed; - return m.Skills.Inscribe.Fixed; - } + public virtual double GetDamageSkill(Mobile m) => m.Skills[DamageSkill].Value; - public virtual int GetDamageFixed(Mobile m) - { - //m.CheckSkill( DamageSkill, 0.0, m.Skills[DamageSkill].Cap ); - - return m.Skills[DamageSkill].Fixed; - } - - public virtual double GetDamageSkill(Mobile m) - { - //m.CheckSkill( DamageSkill, 0.0, m.Skills[DamageSkill].Cap ); - - return m.Skills[DamageSkill].Value; - } - - public virtual double GetResistSkill(Mobile m) - { - return m.Skills.MagicResist.Value; - } + public virtual double GetResistSkill(Mobile m) => m.Skills.MagicResist.Value; public virtual double GetDamageScalar(Mobile target) { @@ -359,10 +328,7 @@ namespace Server.Spells } } - public virtual bool CheckDisturb(DisturbType type, bool firstCircle, bool resistable) - { - return !(resistable && Scroll is BaseWand); - } + public virtual bool CheckDisturb(DisturbType type, bool firstCircle, bool resistable) => !(resistable && Scroll is BaseWand); public void Disturb(DisturbType type, bool firstCircle = true, bool resistable = false) { @@ -417,10 +383,7 @@ namespace Server.Spells Caster.SendLocalizedMessage(500641); // Your concentration is disturbed, thus ruining thy spell. } - public virtual bool CheckCast() - { - return true; - } + public virtual bool CheckCast() => true; public virtual void SayMantra() { @@ -665,10 +628,7 @@ namespace Server.Spells Caster.Spell = null; } - public virtual int ComputeKarmaAward() - { - return 0; - } + public virtual int ComputeKarmaAward() => 0; public virtual bool CheckSequence() { @@ -762,10 +722,7 @@ namespace Server.Spells return false; } - public bool CheckBSequence(Mobile target) - { - return CheckBSequence(target, false); - } + public bool CheckBSequence(Mobile target) => CheckBSequence(target, false); public bool CheckBSequence(Mobile target, bool allowDead) { diff --git a/Projects/Scripts/Spells/Base/SpellHelper.cs b/Projects/Scripts/Spells/Base/SpellHelper.cs index 87c0175d4..d2beaed4d 100644 --- a/Projects/Scripts/Spells/Base/SpellHelper.cs +++ b/Projects/Scripts/Spells/Base/SpellHelper.cs @@ -241,11 +241,7 @@ namespace Server.Spells return false; } - public static bool CanRevealCaster(Mobile m) - { - - return m is BaseCreature c && !c.Controlled; - } + public static bool CanRevealCaster(Mobile m) => m is BaseCreature c && !c.Controlled; public static void GetSurfaceTop(ref IPoint3D p) { @@ -274,10 +270,7 @@ namespace Server.Spells return true; } - public static bool AddStatBonus(Mobile caster, Mobile target, StatType type) - { - return AddStatBonus(caster, target, type, GetOffset(caster, target, type, false), GetDuration(caster, target)); - } + public static bool AddStatBonus(Mobile caster, Mobile target, StatType type) => AddStatBonus(caster, target, type, GetOffset(caster, target, type, false), GetDuration(caster, target)); public static bool AddStatBonus(Mobile caster, Mobile target, StatType type, int bonus, TimeSpan duration) { @@ -301,10 +294,7 @@ namespace Server.Spells return false; } - public static bool AddStatCurse(Mobile caster, Mobile target, StatType type) - { - return AddStatCurse(caster, target, type, GetOffset(caster, target, type, true), GetDuration(caster, target)); - } + public static bool AddStatCurse(Mobile caster, Mobile target, StatType type) => AddStatCurse(caster, target, type, GetOffset(caster, target, type, true), GetDuration(caster, target)); public static bool AddStatCurse(Mobile caster, Mobile target, StatType type, int curse, TimeSpan duration) { @@ -592,15 +582,9 @@ namespace Server.Spells caster.SendLocalizedMessage(501802); // Thy spell doth not appear to work... } - public static bool CheckTravel(Mobile caster, TravelCheckType type) - { - return CheckTravel(caster, caster.Map, caster.Location, type); - } + public static bool CheckTravel(Mobile caster, TravelCheckType type) => CheckTravel(caster, caster.Map, caster.Location, type); - public static bool CheckTravel(Map map, Point3D loc, TravelCheckType type) - { - return CheckTravel(null, map, loc, type); - } + public static bool CheckTravel(Map map, Point3D loc, TravelCheckType type) => CheckTravel(null, map, loc, type); public static bool CheckTravel(Mobile caster, Map map, Point3D loc, TravelCheckType type) { @@ -644,20 +628,11 @@ namespace Server.Spells return x >= 5120 && y >= 0 && x < 5376 && y < 256; } - public static bool IsFeluccaWind(Map map, Point3D loc) - { - return map == Map.Felucca && IsWindLoc(loc); - } + public static bool IsFeluccaWind(Map map, Point3D loc) => map == Map.Felucca && IsWindLoc(loc); - public static bool IsTrammelWind(Map map, Point3D loc) - { - return map == Map.Trammel && IsWindLoc(loc); - } + public static bool IsTrammelWind(Map map, Point3D loc) => map == Map.Trammel && IsWindLoc(loc); - public static bool IsIlshenar(Map map, Point3D loc) - { - return map == Map.Ilshenar; - } + public static bool IsIlshenar(Map map, Point3D loc) => map == Map.Ilshenar; public static bool IsSolenHiveLoc(Point3D loc) { @@ -666,15 +641,9 @@ namespace Server.Spells return x >= 5640 && y >= 1776 && x < 5935 && y < 2039; } - public static bool IsTrammelSolenHive(Map map, Point3D loc) - { - return map == Map.Trammel && IsSolenHiveLoc(loc); - } + public static bool IsTrammelSolenHive(Map map, Point3D loc) => map == Map.Trammel && IsSolenHiveLoc(loc); - public static bool IsFeluccaSolenHive(Map map, Point3D loc) - { - return map == Map.Felucca && IsSolenHiveLoc(loc); - } + public static bool IsFeluccaSolenHive(Map map, Point3D loc) => map == Map.Felucca && IsSolenHiveLoc(loc); public static bool IsFeluccaT2A(Map map, Point3D loc) { @@ -696,10 +665,7 @@ namespace Server.Spells return region.IsPartOf() && region.Map == Map.Felucca; } - public static bool IsKhaldun(Map map, Point3D loc) - { - return Region.Find(loc, map).Name == "Khaldun"; - } + public static bool IsKhaldun(Map map, Point3D loc) => Region.Find(loc, map).Name == "Khaldun"; public static bool IsCrystalCave(Map map, Point3D loc) { @@ -728,22 +694,9 @@ namespace Server.Spells return false; } - public static bool IsFactionStronghold(Map map, Point3D loc) - { - /*// Teleporting is allowed, but only for faction members - if ( !Core.AOS && m_TravelCaster != null && (m_TravelType == TravelCheckType.TeleportTo || m_TravelType == TravelCheckType.TeleportFrom) ) - { - if ( Factions.Faction.Find( m_TravelCaster, true, true ) != null ) - return false; - }*/ + public static bool IsFactionStronghold(Map map, Point3D loc) => Region.Find(loc, map).IsPartOf(); - return Region.Find(loc, map).IsPartOf(); - } - - public static bool IsChampionSpawn(Map map, Point3D loc) - { - return Region.Find(loc, map).IsPartOf(); - } + public static bool IsChampionSpawn(Map map, Point3D loc) => Region.Find(loc, map).IsPartOf(); public static bool IsDoomFerry(Map map, Point3D loc) { @@ -812,10 +765,7 @@ namespace Server.Spells return (map == Map.Trammel || map == Map.Felucca) && x >= 6911 && y >= 254 && x < 7167 && y < 511; } - public static bool IsMLDungeon(Map map, Point3D loc) - { - return MondainsLegacy.IsMLRegion(Region.Find(loc, map)); - } + public static bool IsMLDungeon(Map map, Point3D loc) => MondainsLegacy.IsMLRegion(Region.Find(loc, map)); public static bool IsInvalid(Map map, Point3D loc) { @@ -1307,15 +1257,9 @@ namespace Server.Spells return context; } - public static bool UnderTransformation(Mobile m) - { - return GetContext(m) != null; - } + public static bool UnderTransformation(Mobile m) => GetContext(m) != null; - public static bool UnderTransformation(Mobile m, Type type) - { - return GetContext(m)?.Type == type; - } + public static bool UnderTransformation(Mobile m, Type type) => GetContext(m)?.Type == type; #endregion } diff --git a/Projects/Scripts/Spells/Base/SpellRegistry.cs b/Projects/Scripts/Spells/Base/SpellRegistry.cs index d147db96d..882ab62f4 100644 --- a/Projects/Scripts/Spells/Base/SpellRegistry.cs +++ b/Projects/Scripts/Spells/Base/SpellRegistry.cs @@ -58,20 +58,11 @@ namespace Server.Spells public static Dictionary SpecialMoves{ get; } = new Dictionary(); - public static int GetRegistryNumber(ISpell s) - { - return GetRegistryNumber(s.GetType()); - } + public static int GetRegistryNumber(ISpell s) => GetRegistryNumber(s.GetType()); - public static int GetRegistryNumber(SpecialMove s) - { - return GetRegistryNumber(s.GetType()); - } + public static int GetRegistryNumber(SpecialMove s) => GetRegistryNumber(s.GetType()); - public static int GetRegistryNumber(Type type) - { - return m_IDsFromTypes.TryGetValue(type, out int value) ? value : -1; - } + public static int GetRegistryNumber(Type type) => m_IDsFromTypes.TryGetValue(type, out int value) ? value : -1; public static void Register(int spellID, Type type) { diff --git a/Projects/Scripts/Spells/Bushido/Confidence.cs b/Projects/Scripts/Spells/Bushido/Confidence.cs index b0e71d13d..44cf819ad 100644 --- a/Projects/Scripts/Spells/Bushido/Confidence.cs +++ b/Projects/Scripts/Spells/Bushido/Confidence.cs @@ -48,10 +48,7 @@ namespace Server.Spells.Bushido FinishSequence(); } - public static bool IsConfident(Mobile m) - { - return m_Table.ContainsKey(m); - } + public static bool IsConfident(Mobile m) => m_Table.ContainsKey(m); public static void BeginConfidence(Mobile m) { @@ -73,10 +70,7 @@ namespace Server.Spells.Bushido OnEffectEnd(m, typeof(Confidence)); } - public static bool IsRegenerating(Mobile m) - { - return m_RegenTable.ContainsKey(m); - } + public static bool IsRegenerating(Mobile m) => m_RegenTable.ContainsKey(m); public static void BeginRegenerating(Mobile m) { diff --git a/Projects/Scripts/Spells/Bushido/CounterAttack.cs b/Projects/Scripts/Spells/Bushido/CounterAttack.cs index 2b15d2482..ef394ce6e 100644 --- a/Projects/Scripts/Spells/Bushido/CounterAttack.cs +++ b/Projects/Scripts/Spells/Bushido/CounterAttack.cs @@ -62,10 +62,7 @@ namespace Server.Spells.Bushido FinishSequence(); } - public static bool IsCountering(Mobile m) - { - return m_Table.ContainsKey(m); - } + public static bool IsCountering(Mobile m) => m_Table.ContainsKey(m); public static void StartCountering(Mobile m) { diff --git a/Projects/Scripts/Spells/Bushido/Evasion.cs b/Projects/Scripts/Spells/Bushido/Evasion.cs index 5928c95ec..0c83a3877 100644 --- a/Projects/Scripts/Spells/Bushido/Evasion.cs +++ b/Projects/Scripts/Spells/Bushido/Evasion.cs @@ -24,10 +24,7 @@ namespace Server.Spells.Bushido public override double RequiredSkill => 60.0; public override int RequiredMana => 10; - public override bool CheckCast() - { - return VerifyCast(Caster, true) && base.CheckCast(); - } + public override bool CheckCast() => VerifyCast(Caster, true) && base.CheckCast(); public static bool VerifyCast(Mobile Caster, bool messages) { @@ -118,10 +115,7 @@ namespace Server.Spells.Bushido FinishSequence(); } - public static bool IsEvading(Mobile m) - { - return m_Table.ContainsKey(m); - } + public static bool IsEvading(Mobile m) => m_Table.ContainsKey(m); public static TimeSpan GetEvadeDuration(Mobile m) { diff --git a/Projects/Scripts/Spells/Bushido/HonorableExecution.cs b/Projects/Scripts/Spells/Bushido/HonorableExecution.cs index 44ba99710..b5cdb306d 100644 --- a/Projects/Scripts/Spells/Bushido/HonorableExecution.cs +++ b/Projects/Scripts/Spells/Bushido/HonorableExecution.cs @@ -74,15 +74,9 @@ namespace Server.Spells.Bushido CheckGain(attacker); } - public static int GetSwingBonus(Mobile target) - { - return m_Table.TryGetValue(target, out HonorableExecutionInfo info) ? info.m_SwingBonus : 0; - } + public static int GetSwingBonus(Mobile target) => m_Table.TryGetValue(target, out HonorableExecutionInfo info) ? info.m_SwingBonus : 0; - public static bool IsUnderPenalty(Mobile target) - { - return m_Table.TryGetValue(target, out HonorableExecutionInfo info) && info.m_Penalty; - } + public static bool IsUnderPenalty(Mobile target) => m_Table.TryGetValue(target, out HonorableExecutionInfo info) && info.m_Penalty; public static void RemovePenalty(Mobile target) { diff --git a/Projects/Scripts/Spells/Bushido/LightningStrike.cs b/Projects/Scripts/Spells/Bushido/LightningStrike.cs index 8ee5ed951..bc52eb2c4 100644 --- a/Projects/Scripts/Spells/Bushido/LightningStrike.cs +++ b/Projects/Scripts/Spells/Bushido/LightningStrike.cs @@ -13,10 +13,7 @@ namespace Server.Spells.Bushido public override bool ValidatesDuringHit => false; - public override int GetAccuracyBonus(Mobile attacker) - { - return 50; - } + public override int GetAccuracyBonus(Mobile attacker) => 50; public override bool Validate(Mobile from) { diff --git a/Projects/Scripts/Spells/Bushido/SamuraiSpell.cs b/Projects/Scripts/Spells/Bushido/SamuraiSpell.cs index b16a512fe..4af7c7ca7 100644 --- a/Projects/Scripts/Spells/Bushido/SamuraiSpell.cs +++ b/Projects/Scripts/Spells/Bushido/SamuraiSpell.cs @@ -25,10 +25,7 @@ namespace Server.Spells.Bushido public override int CastRecoveryBase => 7; - public static bool CheckExpansion(Mobile from) - { - return (from as PlayerMobile)?.NetState?.SupportsExpansion(Expansion.SE) == true; - } + public static bool CheckExpansion(Mobile from) => (from as PlayerMobile)?.NetState?.SupportsExpansion(Expansion.SE) == true; public override bool CheckCast() { @@ -93,10 +90,7 @@ namespace Server.Spells.Bushido max = RequiredSkill + 37.5; } - public override int GetMana() - { - return 0; - } + public override int GetMana() => 0; public virtual void OnCastSuccessful(Mobile caster) { diff --git a/Projects/Scripts/Spells/Chivalry/DivineFury.cs b/Projects/Scripts/Spells/Chivalry/DivineFury.cs index d3f7439bf..f3d8163d8 100644 --- a/Projects/Scripts/Spells/Chivalry/DivineFury.cs +++ b/Projects/Scripts/Spells/Chivalry/DivineFury.cs @@ -57,10 +57,7 @@ namespace Server.Spells.Chivalry FinishSequence(); } - public static bool UnderEffect(Mobile m) - { - return m_Table.ContainsKey(m); - } + public static bool UnderEffect(Mobile m) => m_Table.ContainsKey(m); private static void Expire_Callback(Mobile m) { diff --git a/Projects/Scripts/Spells/Chivalry/PaladinSpell.cs b/Projects/Scripts/Spells/Chivalry/PaladinSpell.cs index 14d845f27..25ed680b3 100644 --- a/Projects/Scripts/Spells/Chivalry/PaladinSpell.cs +++ b/Projects/Scripts/Spells/Chivalry/PaladinSpell.cs @@ -124,15 +124,9 @@ namespace Server.Spells.Chivalry max = RequiredSkill + 50.0; } - public override int GetMana() - { - return 0; - } + public override int GetMana() => 0; - public int ComputePowerValue(int div) - { - return ComputePowerValue(Caster, div); - } + public int ComputePowerValue(int div) => ComputePowerValue(Caster, div); public static int ComputePowerValue(Mobile from, int div) { diff --git a/Projects/Scripts/Spells/Fifth/MindBlast.cs b/Projects/Scripts/Spells/Fifth/MindBlast.cs index f94f990bb..720a02a14 100644 --- a/Projects/Scripts/Spells/Fifth/MindBlast.cs +++ b/Projects/Scripts/Spells/Fifth/MindBlast.cs @@ -119,9 +119,6 @@ namespace Server.Spells.Fifth FinishSequence(); } - public override double GetSlayerDamageScalar(Mobile target) - { - return 1.0; //This spell isn't affected by slayer spellbooks - } + public override double GetSlayerDamageScalar(Mobile target) => 1.0; } } diff --git a/Projects/Scripts/Spells/First/NightSight.cs b/Projects/Scripts/Spells/First/NightSight.cs index c345af69d..7de4cf18f 100644 --- a/Projects/Scripts/Spells/First/NightSight.cs +++ b/Projects/Scripts/Spells/First/NightSight.cs @@ -27,10 +27,7 @@ namespace Server.Spells.First { private Spell m_Spell; - public NightSightTarget(Spell spell) : base(12, false, TargetFlags.Beneficial) - { - m_Spell = spell; - } + public NightSightTarget(Spell spell) : base(12, false, TargetFlags.Beneficial) => m_Spell = spell; protected override void OnTarget(Mobile from, object targeted) { diff --git a/Projects/Scripts/Spells/Fourth/ArchCure.cs b/Projects/Scripts/Spells/Fourth/ArchCure.cs index 827a356b8..7f9f0d27e 100644 --- a/Projects/Scripts/Spells/Fourth/ArchCure.cs +++ b/Projects/Scripts/Spells/Fourth/ArchCure.cs @@ -142,14 +142,8 @@ namespace Server.Spells.Fourth return false; } - private static bool IsInnocentTo(Mobile from, Mobile to) - { - return Notoriety.Compute(from, to) == Notoriety.Innocent; - } + private static bool IsInnocentTo(Mobile from, Mobile to) => Notoriety.Compute(from, to) == Notoriety.Innocent; - private static bool IsAllyTo(Mobile from, Mobile to) - { - return Notoriety.Compute(from, to) == Notoriety.Ally; - } + private static bool IsAllyTo(Mobile from, Mobile to) => Notoriety.Compute(from, to) == Notoriety.Ally; } } diff --git a/Projects/Scripts/Spells/Fourth/Curse.cs b/Projects/Scripts/Spells/Fourth/Curse.cs index 4b82c39c4..59e66a42a 100644 --- a/Projects/Scripts/Spells/Fourth/Curse.cs +++ b/Projects/Scripts/Spells/Fourth/Curse.cs @@ -35,10 +35,7 @@ namespace Server.Spells.Fourth m.UpdateResistances(); } - public static bool UnderEffect(Mobile m) - { - return m_UnderEffect.Contains(m); - } + public static bool UnderEffect(Mobile m) => m_UnderEffect.Contains(m); public void Target(Mobile m) { diff --git a/Projects/Scripts/Spells/Fourth/ManaDrain.cs b/Projects/Scripts/Spells/Fourth/ManaDrain.cs index 93d953758..10765b7f0 100644 --- a/Projects/Scripts/Spells/Fourth/ManaDrain.cs +++ b/Projects/Scripts/Spells/Fourth/ManaDrain.cs @@ -100,9 +100,6 @@ namespace Server.Spells.Fourth FinishSequence(); } - public override double GetResistPercent(Mobile target) - { - return 99.0; - } + public override double GetResistPercent(Mobile target) => 99.0; } } diff --git a/Projects/Scripts/Spells/Gargoyle/SpellDefinitions/FlySpell.cs b/Projects/Scripts/Spells/Gargoyle/SpellDefinitions/FlySpell.cs index 1fc81594a..910b46cba 100644 --- a/Projects/Scripts/Spells/Gargoyle/SpellDefinitions/FlySpell.cs +++ b/Projects/Scripts/Spells/Gargoyle/SpellDefinitions/FlySpell.cs @@ -1,82 +1,70 @@ -using System; - -namespace Server.Spells -{ - public class FlySpell : Spell - { - private static readonly SpellInfo m_Info = new SpellInfo("Gargoyle Flight", null, -1, 9002); - private bool m_Stop; - - public FlySpell(Mobile caster) - : base(caster, null, m_Info) - { - } - - public override bool ClearHandsOnCast => false; - - public override bool RevealOnCast => false; - - public override double CastDelayFastScalar => 0; - - public override TimeSpan CastDelayBase => TimeSpan.FromSeconds(.25); - - public override TimeSpan GetCastRecovery() - { - return TimeSpan.Zero; - } - - public override int GetMana() - { - return 0; - } - - public override bool ConsumeReagents() - { - return true; - } - - public override bool CheckFizzle() - { - return true; - } - - public void Stop() - { - m_Stop = true; - Disturb(DisturbType.Hurt, false); - } - - public override bool CheckDisturb(DisturbType type, bool checkFirst, bool resistable) - { - if (type == DisturbType.EquipRequest || type == DisturbType.UseRequest /* || type == DisturbType.Hurt*/) - return false; - - return true; - } - - public override void DoHurtFizzle() - { - } - - public override void DoFizzle() - { - } - - public override void OnDisturb(DisturbType type, bool message) - { - if (message && !m_Stop) - Caster.SendLocalizedMessage(1113192); // You have been disrupted while attempting to fly! - } - - public override void OnCast() - { - Caster.Flying = false; - BuffInfo.RemoveBuff(Caster, BuffIcon.Fly); - Caster.Animate(60, 10, 1, true, false, 0); - Caster.SendLocalizedMessage(1112567); // You are flying. - Caster.Flying = true; - BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.Fly, 1112567)); - FinishSequence(); - } - } +using System; + +namespace Server.Spells +{ + public class FlySpell : Spell + { + private static readonly SpellInfo m_Info = new SpellInfo("Gargoyle Flight", null, -1, 9002); + private bool m_Stop; + + public FlySpell(Mobile caster) + : base(caster, null, m_Info) + { + } + + public override bool ClearHandsOnCast => false; + + public override bool RevealOnCast => false; + + public override double CastDelayFastScalar => 0; + + public override TimeSpan CastDelayBase => TimeSpan.FromSeconds(.25); + + public override TimeSpan GetCastRecovery() => TimeSpan.Zero; + + public override int GetMana() => 0; + + public override bool ConsumeReagents() => true; + + public override bool CheckFizzle() => true; + + public void Stop() + { + m_Stop = true; + Disturb(DisturbType.Hurt, false); + } + + public override bool CheckDisturb(DisturbType type, bool checkFirst, bool resistable) + { + if (type == DisturbType.EquipRequest || type == DisturbType.UseRequest /* || type == DisturbType.Hurt*/) + return false; + + return true; + } + + public override void DoHurtFizzle() + { + } + + public override void DoFizzle() + { + } + + public override void OnDisturb(DisturbType type, bool message) + { + if (message && !m_Stop) + Caster.SendLocalizedMessage(1113192); // You have been disrupted while attempting to fly! + } + + public override void OnCast() + { + Caster.Flying = false; + BuffInfo.RemoveBuff(Caster, BuffIcon.Fly); + Caster.Animate(60, 10, 1, true, false, 0); + Caster.SendLocalizedMessage(1112567); // You are flying. + Caster.Flying = true; + BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.Fly, 1112567)); + FinishSequence(); + } + } } \ No newline at end of file diff --git a/Projects/Scripts/Spells/Mysticism/MysticSpell.cs b/Projects/Scripts/Spells/Mysticism/MysticSpell.cs index 5cfb41eec..81ee230d3 100644 --- a/Projects/Scripts/Spells/Mysticism/MysticSpell.cs +++ b/Projects/Scripts/Spells/Mysticism/MysticSpell.cs @@ -1,93 +1,78 @@ -using System; - -namespace Server.Spells.Mysticism -{ - public abstract class MysticSpell : Spell - { - public MysticSpell(Mobile caster, Item scroll, SpellInfo info) - : base(caster, scroll, info) - { - } - - public abstract double RequiredSkill{ get; } - public abstract int RequiredMana{ get; } - - public override SkillName CastSkill => SkillName.Mysticism; - - /* - * As per OSI Publish 64: - * Imbuing is not the only skill associated with Mysticism now. - * Players can use EITHER their Focus skill or Imbuing skill. - * Evaluate Intelligence no longer has any effect on a Mystic’s spell power. - */ - public override double GetDamageSkill(Mobile m) - { - return Math.Max(m.Skills.Imbuing.Value, m.Skills.Focus.Value); - } - - public override int GetDamageFixed(Mobile m) - { - return Math.Max(m.Skills.Imbuing.Fixed, m.Skills.Focus.Fixed); - } - - public override void GetCastSkills(out double min, out double max) - { - // As per Mysticism page at the UO Herald Playguide - // This means that we have 25% success chance at min Required Skill - - min = RequiredSkill - 12.5; - max = RequiredSkill + 37.5; - } - - public override int GetMana() - { - return RequiredMana; - } - - public override bool CheckCast() - { - if (!base.CheckCast()) - return false; - - int mana = ScaleMana(RequiredMana); - - if (Caster.Mana < mana) - { - Caster.SendLocalizedMessage(1060174, - mana.ToString()); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability. - return false; - } - - if (Caster.Skills[CastSkill].Value < RequiredSkill) - { - Caster.SendLocalizedMessage(1063013, - $"{RequiredSkill.ToString("F1")}\t{CastSkill.ToString()}\t "); // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability. - return false; - } - - return true; - } - - public override void OnBeginCast() - { - base.OnBeginCast(); - - SendCastEffect(); - } - - public virtual void SendCastEffect() - { - Caster.FixedEffect(0x37C4, 10, (int)(GetCastDelay().TotalSeconds * 28), 0x66C, 3); - } - - public static double GetBaseSkill(Mobile m) - { - return m.Skills.Mysticism.Value; - } - - public static double GetBoostSkill(Mobile m) - { - return Math.Max(m.Skills.Imbuing.Value, m.Skills.Focus.Value); - } - } +using System; + +namespace Server.Spells.Mysticism +{ + public abstract class MysticSpell : Spell + { + public MysticSpell(Mobile caster, Item scroll, SpellInfo info) + : base(caster, scroll, info) + { + } + + public abstract double RequiredSkill{ get; } + public abstract int RequiredMana{ get; } + + public override SkillName CastSkill => SkillName.Mysticism; + + /* + * As per OSI Publish 64: + * Imbuing is not the only skill associated with Mysticism now. + * Players can use EITHER their Focus skill or Imbuing skill. + * Evaluate Intelligence no longer has any effect on a Mystic’s spell power. + */ + public override double GetDamageSkill(Mobile m) => Math.Max(m.Skills.Imbuing.Value, m.Skills.Focus.Value); + + public override int GetDamageFixed(Mobile m) => Math.Max(m.Skills.Imbuing.Fixed, m.Skills.Focus.Fixed); + + public override void GetCastSkills(out double min, out double max) + { + // As per Mysticism page at the UO Herald Playguide + // This means that we have 25% success chance at min Required Skill + + min = RequiredSkill - 12.5; + max = RequiredSkill + 37.5; + } + + public override int GetMana() => RequiredMana; + + public override bool CheckCast() + { + if (!base.CheckCast()) + return false; + + int mana = ScaleMana(RequiredMana); + + if (Caster.Mana < mana) + { + Caster.SendLocalizedMessage(1060174, + mana.ToString()); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability. + return false; + } + + if (Caster.Skills[CastSkill].Value < RequiredSkill) + { + Caster.SendLocalizedMessage(1063013, + $"{RequiredSkill.ToString("F1")}\t{CastSkill.ToString()}\t "); // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability. + return false; + } + + return true; + } + + public override void OnBeginCast() + { + base.OnBeginCast(); + + SendCastEffect(); + } + + public virtual void SendCastEffect() + { + Caster.FixedEffect(0x37C4, 10, (int)(GetCastDelay().TotalSeconds * 28), 0x66C, 3); + } + + public static double GetBaseSkill(Mobile m) => m.Skills.Mysticism.Value; + + public static double GetBoostSkill(Mobile m) => Math.Max(m.Skills.Imbuing.Value, m.Skills.Focus.Value); + } } \ No newline at end of file diff --git a/Projects/Scripts/Spells/Mysticism/SpellPlagueSpell.cs b/Projects/Scripts/Spells/Mysticism/SpellPlagueSpell.cs index 5246733e3..dc938ac55 100644 --- a/Projects/Scripts/Spells/Mysticism/SpellPlagueSpell.cs +++ b/Projects/Scripts/Spells/Mysticism/SpellPlagueSpell.cs @@ -79,10 +79,7 @@ namespace Server.Spells.Mysticism FinishSequence(); } - public static bool UnderEffect(Mobile m) - { - return m_Table.ContainsKey(m); - } + public static bool UnderEffect(Mobile m) => m_Table.ContainsKey(m); public static void RemoveEffect(Mobile m) { @@ -197,10 +194,8 @@ namespace Server.Spells.Mysticism private SpellPlagueSpell m_Owner; public InternalTarget(SpellPlagueSpell owner) - : base(12, false, TargetFlags.Harmful) - { + : base(12, false, TargetFlags.Harmful) => m_Owner = owner; - } protected override void OnTarget(Mobile from, object o) { diff --git a/Projects/Scripts/Spells/Mysticism/StoneFormSpell.cs b/Projects/Scripts/Spells/Mysticism/StoneFormSpell.cs index 4e6052adc..d3ede2835 100644 --- a/Projects/Scripts/Spells/Mysticism/StoneFormSpell.cs +++ b/Projects/Scripts/Spells/Mysticism/StoneFormSpell.cs @@ -36,10 +36,7 @@ namespace Server.Spells.Mysticism EventSink.PlayerDeath += OnPlayerDeath; } - public static bool UnderEffect(Mobile m) - { - return m_Table.ContainsKey(m); - } + public static bool UnderEffect(Mobile m) => m_Table.ContainsKey(m); public override bool CheckCast() { @@ -129,15 +126,9 @@ namespace Server.Spells.Mysticism FinishSequence(); } - public static int GetDIBonus(Mobile m) - { - return (int)((GetBaseSkill(m) + GetBoostSkill(m)) / 12.0); - } + public static int GetDIBonus(Mobile m) => (int)((GetBaseSkill(m) + GetBoostSkill(m)) / 12.0); - public static int GetResistCapBonus(Mobile m) - { - return (int)((GetBaseSkill(m) + GetBoostSkill(m)) / 48.0); - } + public static int GetResistCapBonus(Mobile m) => (int)((GetBaseSkill(m) + GetBoostSkill(m)) / 48.0); public static void RemoveEffects(Mobile m) { diff --git a/Projects/Scripts/Spells/Necromancy/BloodOathSpell.cs b/Projects/Scripts/Spells/Necromancy/BloodOathSpell.cs index 080327e0d..d30a5b2f6 100644 --- a/Projects/Scripts/Spells/Necromancy/BloodOathSpell.cs +++ b/Projects/Scripts/Spells/Necromancy/BloodOathSpell.cs @@ -97,10 +97,7 @@ namespace Server.Spells.Necromancy t?.DoExpire(); } - public static Mobile GetBloodOath(Mobile m) - { - return m == null || m_OathTable.TryGetValue(m, out Mobile oath) && oath == m ? null : oath; - } + public static Mobile GetBloodOath(Mobile m) => m == null || m_OathTable.TryGetValue(m, out Mobile oath) && oath == m ? null : oath; private class ExpireTimer : Timer { diff --git a/Projects/Scripts/Spells/Necromancy/Exorcism.cs b/Projects/Scripts/Spells/Necromancy/Exorcism.cs index 49add1dd7..00deeb14e 100644 --- a/Projects/Scripts/Spells/Necromancy/Exorcism.cs +++ b/Projects/Scripts/Spells/Necromancy/Exorcism.cs @@ -81,10 +81,7 @@ namespace Server.Spells.Necromancy return base.CheckCast(); } - public override int ComputeKarmaAward() - { - return 0; //no karma lost from this spell! - } + public override int ComputeKarmaAward() => 0; public override void OnCast() { diff --git a/Projects/Scripts/Spells/Necromancy/MindRot.cs b/Projects/Scripts/Spells/Necromancy/MindRot.cs index 2e35f5691..7e5b282f9 100644 --- a/Projects/Scripts/Spells/Necromancy/MindRot.cs +++ b/Projects/Scripts/Spells/Necromancy/MindRot.cs @@ -76,10 +76,7 @@ namespace Server.Spells.Necromancy m.SendLocalizedMessage(1060872); // Your mind feels normal again. } - public static bool HasMindRotScalar(Mobile m) - { - return m_Table.ContainsKey(m); - } + public static bool HasMindRotScalar(Mobile m) => m_Table.ContainsKey(m); public static bool GetMindRotScalar(Mobile m, ref double scalar) { diff --git a/Projects/Scripts/Spells/Necromancy/NecromancerSpell.cs b/Projects/Scripts/Spells/Necromancy/NecromancerSpell.cs index a8e70ac97..0ff7ccb7f 100644 --- a/Projects/Scripts/Spells/Necromancy/NecromancerSpell.cs +++ b/Projects/Scripts/Spells/Necromancy/NecromancerSpell.cs @@ -53,9 +53,6 @@ namespace Server.Spells.Necromancy return false; } - public override int GetMana() - { - return RequiredMana; - } + public override int GetMana() => RequiredMana; } } \ No newline at end of file diff --git a/Projects/Scripts/Spells/Ninjitsu/AnimalForm.cs b/Projects/Scripts/Spells/Ninjitsu/AnimalForm.cs index d10a9e8cd..96711d893 100644 --- a/Projects/Scripts/Spells/Ninjitsu/AnimalForm.cs +++ b/Projects/Scripts/Spells/Ninjitsu/AnimalForm.cs @@ -96,15 +96,9 @@ namespace Server.Spells.Ninjitsu return base.CheckCast(); } - public override bool CheckDisturb(DisturbType type, bool firstCircle, bool resistable) - { - return false; - } + public override bool CheckDisturb(DisturbType type, bool firstCircle, bool resistable) => false; - private bool CasterIsMoving() - { - return Core.TickCount - Caster.LastMoveTime <= Caster.ComputeMovementSpeed(Caster.Direction); - } + private bool CasterIsMoving() => Core.TickCount - Caster.LastMoveTime <= Caster.ComputeMovementSpeed(Caster.Direction); public override void OnBeginCast() { @@ -114,11 +108,7 @@ namespace Server.Spells.Ninjitsu m_WasMoving = CasterIsMoving(); } - public override bool CheckFizzle() - { - // Spell is initially always successful, and with no skill gain. - return true; - } + public override bool CheckFizzle() => true; public override void OnCast() { @@ -188,10 +178,7 @@ namespace Server.Spells.Ninjitsu FinishSequence(); } - public int GetLastAnimalForm(Mobile m) - { - return m_LastAnimalForms.TryGetValue(m, out int value) ? value : -1; - } + public int GetLastAnimalForm(Mobile m) => m_LastAnimalForms.TryGetValue(m, out int value) ? value : -1; public static MorphResult Morph(Mobile m, int entryID) { @@ -311,20 +298,11 @@ namespace Server.Spells.Ninjitsu context.Timer.Stop(); } - public static AnimalFormContext GetContext(Mobile m) - { - return m_Table.TryGetValue(m, out AnimalFormContext context) ? context : null; - } + public static AnimalFormContext GetContext(Mobile m) => m_Table.TryGetValue(m, out AnimalFormContext context) ? context : null; - public static bool UnderTransformation(Mobile m) - { - return m_Table.ContainsKey(m); - } + public static bool UnderTransformation(Mobile m) => m_Table.ContainsKey(m); - public static bool UnderTransformation(Mobile m, Type type) - { - return GetContext(m)?.Type == type; - } + public static bool UnderTransformation(Mobile m, Type type) => GetContext(m)?.Type == type; /* private delegate void AnimalFormCallback( Mobile from ); diff --git a/Projects/Scripts/Spells/Ninjitsu/DeathStrike.cs b/Projects/Scripts/Spells/Ninjitsu/DeathStrike.cs index 84fb31fa2..1253e4821 100644 --- a/Projects/Scripts/Spells/Ninjitsu/DeathStrike.cs +++ b/Projects/Scripts/Spells/Ninjitsu/DeathStrike.cs @@ -15,10 +15,7 @@ namespace Server.Spells.Ninjitsu public override TextDefinition AbilityMessage => new TextDefinition(1063091); // You prepare to hit your opponent with a Death Strike. - public override double GetDamageScalar(Mobile attacker, Mobile defender) - { - return 0.5; - } + public override double GetDamageScalar(Mobile attacker, Mobile defender) => 0.5; public override void OnHit(Mobile attacker, Mobile defender, int damage) { diff --git a/Projects/Scripts/Spells/Ninjitsu/FocusAttack.cs b/Projects/Scripts/Spells/Ninjitsu/FocusAttack.cs index c4451c3e4..fd64ac436 100644 --- a/Projects/Scripts/Spells/Ninjitsu/FocusAttack.cs +++ b/Projects/Scripts/Spells/Ninjitsu/FocusAttack.cs @@ -48,10 +48,7 @@ namespace Server.Spells.Ninjitsu return 1.0 + (bonus * 3 + 0.01); } - public override bool OnBeforeDamage(Mobile attacker, Mobile defender) - { - return Validate(attacker) && CheckMana(attacker, true); - } + public override bool OnBeforeDamage(Mobile attacker, Mobile defender) => Validate(attacker) && CheckMana(attacker, true); public override void OnHit(Mobile attacker, Mobile defender, int damage) { diff --git a/Projects/Scripts/Spells/Ninjitsu/MirrorImage.cs b/Projects/Scripts/Spells/Ninjitsu/MirrorImage.cs index 437117399..c85570e0c 100644 --- a/Projects/Scripts/Spells/Ninjitsu/MirrorImage.cs +++ b/Projects/Scripts/Spells/Ninjitsu/MirrorImage.cs @@ -29,10 +29,7 @@ namespace Server.Spells.Ninjitsu public override bool BlockedByAnimalForm => false; - public static bool HasClone(Mobile m) - { - return m_CloneCount.ContainsKey(m); - } + public static bool HasClone(Mobile m) => m_CloneCount.ContainsKey(m); public static void AddClone(Mobile m) { @@ -77,10 +74,7 @@ namespace Server.Spells.Ninjitsu return base.CheckCast(); } - public override bool CheckDisturb(DisturbType type, bool firstCircle, bool resistable) - { - return false; - } + public override bool CheckDisturb(DisturbType type, bool firstCircle, bool resistable) => false; public override void OnBeginCast() { @@ -179,10 +173,7 @@ namespace Server.Mobiles public override bool IsDispellable => false; public override bool Commandable => false; - public override bool IsHumanInTown() - { - return false; - } + public override bool IsHumanInTown() => false; private Item CloneItem(Item item) { @@ -239,10 +230,7 @@ namespace Server.Mobiles { public class CloneAI : BaseAI { - public CloneAI(Clone m) : base(m) - { - m.CurrentSpeed = m.ActiveSpeed; - } + public CloneAI(Clone m) : base(m) => m.CurrentSpeed = m.ActiveSpeed; public override bool CanDetectHidden => false; diff --git a/Projects/Scripts/Spells/Ninjitsu/NinjaSpell.cs b/Projects/Scripts/Spells/Ninjitsu/NinjaSpell.cs index 52fbe9006..33e7fa06f 100644 --- a/Projects/Scripts/Spells/Ninjitsu/NinjaSpell.cs +++ b/Projects/Scripts/Spells/Ninjitsu/NinjaSpell.cs @@ -24,10 +24,7 @@ namespace Server.Spells.Ninjitsu public override int CastRecoveryBase => 7; - public static bool CheckExpansion(Mobile from) - { - return (from as PlayerMobile)?.NetState?.SupportsExpansion(Expansion.SE) == true; - } + public static bool CheckExpansion(Mobile from) => (from as PlayerMobile)?.NetState?.SupportsExpansion(Expansion.SE) == true; public override bool CheckCast() { @@ -92,9 +89,6 @@ namespace Server.Spells.Ninjitsu max = RequiredSkill + 37.5; } - public override int GetMana() - { - return 0; - } + public override int GetMana() => 0; } } diff --git a/Projects/Scripts/Spells/Ninjitsu/ShadowJump.cs b/Projects/Scripts/Spells/Ninjitsu/ShadowJump.cs index 22f025093..2e978966d 100644 --- a/Projects/Scripts/Spells/Ninjitsu/ShadowJump.cs +++ b/Projects/Scripts/Spells/Ninjitsu/ShadowJump.cs @@ -40,10 +40,7 @@ namespace Server.Spells.Ninjitsu return base.CheckCast(); } - public override bool CheckDisturb(DisturbType type, bool firstCircle, bool resistable) - { - return false; - } + public override bool CheckDisturb(DisturbType type, bool firstCircle, bool resistable) => false; public override void OnCast() { diff --git a/Projects/Scripts/Spells/Second/Harm.cs b/Projects/Scripts/Spells/Second/Harm.cs index 703fde5f0..714022933 100644 --- a/Projects/Scripts/Spells/Second/Harm.cs +++ b/Projects/Scripts/Spells/Second/Harm.cs @@ -25,10 +25,7 @@ namespace Server.Spells.Second Caster.Target = new SpellTargetMobile(this, TargetFlags.Harmful, Core.ML ? 10 : 12); } - public override double GetSlayerDamageScalar(Mobile target) - { - return 1.0; //This spell isn't affected by slayer spellbooks - } + public override double GetSlayerDamageScalar(Mobile target) => 1.0; public void Target(Mobile m) { diff --git a/Projects/Scripts/Spells/Seventh/GateTravel.cs b/Projects/Scripts/Spells/Seventh/GateTravel.cs index ba9728b79..bca60d29c 100644 --- a/Projects/Scripts/Spells/Seventh/GateTravel.cs +++ b/Projects/Scripts/Spells/Seventh/GateTravel.cs @@ -20,10 +20,7 @@ namespace Server.Spells.Seventh private RunebookEntry m_Entry; - public GateTravelSpell(Mobile caster, RunebookEntry entry = null, Item scroll = null) : base(caster, scroll, m_Info) - { - m_Entry = entry; - } + public GateTravelSpell(Mobile caster, RunebookEntry entry = null, Item scroll = null) : base(caster, scroll, m_Info) => m_Entry = entry; public override SpellCircle Circle => SpellCircle.Seventh; diff --git a/Projects/Scripts/Spells/Seventh/ManaVampire.cs b/Projects/Scripts/Spells/Seventh/ManaVampire.cs index 32bde4d4f..70b0792bd 100644 --- a/Projects/Scripts/Spells/Seventh/ManaVampire.cs +++ b/Projects/Scripts/Spells/Seventh/ManaVampire.cs @@ -89,9 +89,6 @@ namespace Server.Spells.Seventh FinishSequence(); } - public override double GetResistPercent(Mobile target) - { - return 98.0; - } + public override double GetResistPercent(Mobile target) => 98.0; } } diff --git a/Projects/Scripts/Spells/Seventh/Polymorph.cs b/Projects/Scripts/Spells/Seventh/Polymorph.cs index 87ea5e111..b1842fbb2 100644 --- a/Projects/Scripts/Spells/Seventh/Polymorph.cs +++ b/Projects/Scripts/Spells/Seventh/Polymorph.cs @@ -23,10 +23,7 @@ namespace Server.Spells.Seventh private int m_NewBody; - public PolymorphSpell(Mobile caster, Item scroll, int body = 0) : base(caster, scroll, m_Info) - { - m_NewBody = body; - } + public PolymorphSpell(Mobile caster, Item scroll, int body = 0) : base(caster, scroll, m_Info) => m_NewBody = body; public override SpellCircle Circle => SpellCircle.Seventh; diff --git a/Projects/Scripts/Spells/Sixth/Invisibility.cs b/Projects/Scripts/Spells/Sixth/Invisibility.cs index 2bd6accb3..e68fb01d2 100644 --- a/Projects/Scripts/Spells/Sixth/Invisibility.cs +++ b/Projects/Scripts/Spells/Sixth/Invisibility.cs @@ -84,10 +84,7 @@ namespace Server.Spells.Sixth FinishSequence(); } - public static bool HasTimer(Mobile m) - { - return m_Table.ContainsKey(m); - } + public static bool HasTimer(Mobile m) => m_Table.ContainsKey(m); public static void RemoveTimer(Mobile m) { diff --git a/Projects/Scripts/Spells/Sixth/Mark.cs b/Projects/Scripts/Spells/Sixth/Mark.cs index 2f708855c..336e25172 100644 --- a/Projects/Scripts/Spells/Sixth/Mark.cs +++ b/Projects/Scripts/Spells/Sixth/Mark.cs @@ -26,10 +26,7 @@ namespace Server.Spells.Sixth Caster.Target = new SpellTargetItem(this, TargetFlags.None, Core.ML ? 10 : 12); } - public override bool CheckCast() - { - return base.CheckCast() && SpellHelper.CheckTravel(Caster, TravelCheckType.Mark); - } + public override bool CheckCast() => base.CheckCast() && SpellHelper.CheckTravel(Caster, TravelCheckType.Mark); public void Target(Item item) { diff --git a/Projects/Scripts/Spells/Spellweaving/ArcaneCircle.cs b/Projects/Scripts/Spells/Spellweaving/ArcaneCircle.cs index 2ff71c495..c42b706c7 100644 --- a/Projects/Scripts/Spells/Spellweaving/ArcaneCircle.cs +++ b/Projects/Scripts/Spells/Spellweaving/ArcaneCircle.cs @@ -65,10 +65,7 @@ namespace Server.Spells.Spellweaving FinishSequence(); } - private static bool IsSanctuary(Point3D p, Map m) - { - return (m == Map.Trammel || m == Map.Felucca) && p.X == 6267 && p.Y == 131; - } + private static bool IsSanctuary(Point3D p, Map m) => (m == Map.Trammel || m == Map.Felucca) && p.X == 6267 && p.Y == 131; private static bool IsValidLocation(Point3D location, Map map) { @@ -102,13 +99,10 @@ namespace Server.Spells.Spellweaving return found; } - public static bool IsValidTile(int itemID) - { - //Per OSI, Center tile only - return itemID == 0xFEA || itemID == 0x1216 || itemID == 0x307F || itemID == 0x1D10 || itemID == 0x1D0F || - itemID == 0x1D1F || - itemID == 0x1D12; // Pentagram center, Abbatoir center, Arcane Circle Center, Bloody Pentagram has 4 tiles at center - } + public static bool IsValidTile(int itemID) => + itemID == 0xFEA || itemID == 0x1216 || itemID == 0x307F || itemID == 0x1D10 || itemID == 0x1D0F || + itemID == 0x1D1F || + itemID == 0x1D12; private List GetArcanists() { diff --git a/Projects/Scripts/Spells/Spellweaving/ArcanistSpell.cs b/Projects/Scripts/Spells/Spellweaving/ArcanistSpell.cs index 9caa61ea0..83f88f12b 100644 --- a/Projects/Scripts/Spells/Spellweaving/ArcanistSpell.cs +++ b/Projects/Scripts/Spells/Spellweaving/ArcanistSpell.cs @@ -30,15 +30,9 @@ namespace Server.Spells.Spellweaving return focus?.Deleted != false ? 0 : focus.StrengthBonus; } - public static ArcaneFocus FindArcaneFocus(Mobile from) - { - return from.Holding as ArcaneFocus ?? from.Backpack?.FindItemByType(); - } + public static ArcaneFocus FindArcaneFocus(Mobile from) => from.Holding as ArcaneFocus ?? from.Backpack?.FindItemByType(); - public static bool CheckExpansion(Mobile from) - { - return !(from is PlayerMobile) || from.NetState?.SupportsExpansion(Expansion.ML) == true; - } + public static bool CheckExpansion(Mobile from) => !(from is PlayerMobile) || from.NetState?.SupportsExpansion(Expansion.ML) == true; public override bool CheckCast() { @@ -91,10 +85,7 @@ namespace Server.Spells.Spellweaving max = RequiredSkill + 37.5; } - public override int GetMana() - { - return RequiredMana; - } + public override int GetMana() => RequiredMana; public override void DoFizzle() { diff --git a/Projects/Scripts/Spells/Spellweaving/AttuneWeapon.cs b/Projects/Scripts/Spells/Spellweaving/AttuneWeapon.cs index 9cbb17fdf..938cfdc44 100644 --- a/Projects/Scripts/Spells/Spellweaving/AttuneWeapon.cs +++ b/Projects/Scripts/Spells/Spellweaving/AttuneWeapon.cs @@ -84,10 +84,7 @@ namespace Server.Spells.Spellweaving StopAbsorbing(defender, true); } - public static bool IsAbsorbing(Mobile m) - { - return m_Table.ContainsKey(m); - } + public static bool IsAbsorbing(Mobile m) => m_Table.ContainsKey(m); public static void StopAbsorbing(Mobile m, bool message) { @@ -100,10 +97,8 @@ namespace Server.Spells.Spellweaving private Mobile m_Mobile; public ExpireTimer(Mobile m, TimeSpan delay) - : base(delay) - { + : base(delay) => m_Mobile = m; - } protected override void OnTick() { diff --git a/Projects/Scripts/Spells/Spellweaving/EssenceOfWind.cs b/Projects/Scripts/Spells/Spellweaving/EssenceOfWind.cs index de358013f..11fc81d31 100644 --- a/Projects/Scripts/Spells/Spellweaving/EssenceOfWind.cs +++ b/Projects/Scripts/Spells/Spellweaving/EssenceOfWind.cs @@ -61,20 +61,11 @@ namespace Server.Spells.Spellweaving FinishSequence(); } - public static int GetFCMalus(Mobile m) - { - return m_Table.TryGetValue(m, out EssenceOfWindInfo info) ? info.FCMalus : 0; - } + public static int GetFCMalus(Mobile m) => m_Table.TryGetValue(m, out EssenceOfWindInfo info) ? info.FCMalus : 0; - public static int GetSSIMalus(Mobile m) - { - return m_Table.TryGetValue(m, out EssenceOfWindInfo info) ? info.SSIMalus : 0; - } + public static int GetSSIMalus(Mobile m) => m_Table.TryGetValue(m, out EssenceOfWindInfo info) ? info.SSIMalus : 0; - public static bool IsDebuffed(Mobile m) - { - return m_Table.ContainsKey(m); - } + public static bool IsDebuffed(Mobile m) => m_Table.ContainsKey(m); public static void StopDebuffing(Mobile m, bool message) { @@ -107,10 +98,7 @@ namespace Server.Spells.Spellweaving { private Mobile m_Mobile; - public ExpireTimer(Mobile m, TimeSpan delay) : base(delay) - { - m_Mobile = m; - } + public ExpireTimer(Mobile m, TimeSpan delay) : base(delay) => m_Mobile = m; protected override void OnTick() { diff --git a/Projects/Scripts/Spells/Spellweaving/GiftOfRenewal.cs b/Projects/Scripts/Spells/Spellweaving/GiftOfRenewal.cs index 1ded88fcb..b1734b3dd 100644 --- a/Projects/Scripts/Spells/Spellweaving/GiftOfRenewal.cs +++ b/Projects/Scripts/Spells/Spellweaving/GiftOfRenewal.cs @@ -120,10 +120,8 @@ namespace Server.Spells.Spellweaving private GiftOfRenewalInfo m_GiftInfo; public InternalTimer(GiftOfRenewalInfo info) - : base(TimeSpan.FromSeconds(2.0), TimeSpan.FromSeconds(2.0)) - { + : base(TimeSpan.FromSeconds(2.0), TimeSpan.FromSeconds(2.0)) => m_GiftInfo = info; - } protected override void OnTick() { diff --git a/Projects/Scripts/Spells/Spellweaving/ImmolatingWeapon.cs b/Projects/Scripts/Spells/Spellweaving/ImmolatingWeapon.cs index b917f3ff3..2bb95d1ed 100644 --- a/Projects/Scripts/Spells/Spellweaving/ImmolatingWeapon.cs +++ b/Projects/Scripts/Spells/Spellweaving/ImmolatingWeapon.cs @@ -63,15 +63,9 @@ namespace Server.Spells.Spellweaving FinishSequence(); } - public static bool IsImmolating(BaseWeapon weapon) - { - return m_WeaponDamageTable.ContainsKey(weapon); - } + public static bool IsImmolating(BaseWeapon weapon) => m_WeaponDamageTable.ContainsKey(weapon); - public static int GetImmolatingDamage(BaseWeapon weapon) - { - return m_WeaponDamageTable.TryGetValue(weapon, out ImmolatingWeaponEntry entry) ? entry.m_Damage : 0; - } + public static int GetImmolatingDamage(BaseWeapon weapon) => m_WeaponDamageTable.TryGetValue(weapon, out ImmolatingWeaponEntry entry) ? entry.m_Damage : 0; public static void DoEffect(BaseWeapon weapon, Mobile target) { diff --git a/Projects/Scripts/Spells/Spellweaving/NatureFury.cs b/Projects/Scripts/Spells/Spellweaving/NatureFury.cs index 539bbd1ee..7e93ff453 100644 --- a/Projects/Scripts/Spells/Spellweaving/NatureFury.cs +++ b/Projects/Scripts/Spells/Spellweaving/NatureFury.cs @@ -75,10 +75,8 @@ namespace Server.Spells.Spellweaving private NatureFury m_NatureFury; public InternalTimer(NatureFury nf) - : base(TimeSpan.FromSeconds(5.0), TimeSpan.FromSeconds(5.0)) - { + : base(TimeSpan.FromSeconds(5.0), TimeSpan.FromSeconds(5.0)) => m_NatureFury = nf; - } protected override void OnTick() { diff --git a/Projects/Scripts/Spells/Spellweaving/Thunderstorm.cs b/Projects/Scripts/Spells/Spellweaving/Thunderstorm.cs index b41a9ef8a..f4d2c558c 100644 --- a/Projects/Scripts/Spells/Spellweaving/Thunderstorm.cs +++ b/Projects/Scripts/Spells/Spellweaving/Thunderstorm.cs @@ -75,10 +75,7 @@ namespace Server.Spells.Spellweaving FinishSequence(); } - public static int GetCastRecoveryMalus(Mobile m) - { - return m_Table.ContainsKey(m) ? 6 : 0; - } + public static int GetCastRecoveryMalus(Mobile m) => m_Table.ContainsKey(m) ? 6 : 0; public static void DoExpire(Mobile m) { diff --git a/Projects/Scripts/Spells/Targeting/SpellTargetItem.cs b/Projects/Scripts/Spells/Targeting/SpellTargetItem.cs index 880222450..dd7fa7144 100644 --- a/Projects/Scripts/Spells/Targeting/SpellTargetItem.cs +++ b/Projects/Scripts/Spells/Targeting/SpellTargetItem.cs @@ -12,10 +12,7 @@ namespace Server.Spells private ISpellTargetingItem m_Spell; public ISpell Spell => m_Spell; - public SpellTargetItem(ISpellTargetingItem spell, TargetFlags flags, int range = 12) : base(range, false, flags) - { - m_Spell = spell; - } + public SpellTargetItem(ISpellTargetingItem spell, TargetFlags flags, int range = 12) : base(range, false, flags) => m_Spell = spell; protected override void OnTarget(Mobile from, object o) { diff --git a/Projects/Scripts/Spells/Targeting/SpellTargetMobile.cs b/Projects/Scripts/Spells/Targeting/SpellTargetMobile.cs index ce07c85bd..54a1feed6 100644 --- a/Projects/Scripts/Spells/Targeting/SpellTargetMobile.cs +++ b/Projects/Scripts/Spells/Targeting/SpellTargetMobile.cs @@ -12,10 +12,7 @@ namespace Server.Spells private ISpellTargetingMobile m_Spell; public ISpell Spell => m_Spell; - public SpellTargetMobile(ISpellTargetingMobile spell, TargetFlags flags, int range = 12) : base(range, false, flags) - { - m_Spell = spell; - } + public SpellTargetMobile(ISpellTargetingMobile spell, TargetFlags flags, int range = 12) : base(range, false, flags) => m_Spell = spell; protected override void OnTarget(Mobile from, object o) { diff --git a/Projects/Scripts/Targets/BladedItemTarget.cs b/Projects/Scripts/Targets/BladedItemTarget.cs index 8ba51032a..fb9cf82c8 100644 --- a/Projects/Scripts/Targets/BladedItemTarget.cs +++ b/Projects/Scripts/Targets/BladedItemTarget.cs @@ -11,10 +11,7 @@ namespace Server.Targets { private Item m_Item; - public BladedItemTarget(Item item) : base(2, false, TargetFlags.None) - { - m_Item = item; - } + public BladedItemTarget(Item item) : base(2, false, TargetFlags.None) => m_Item = item; protected override void OnTargetOutOfRange(Mobile from, object targeted) { diff --git a/Projects/Scripts/Targets/MoveTarget.cs b/Projects/Scripts/Targets/MoveTarget.cs index 1f6746e0f..9462c3c9d 100644 --- a/Projects/Scripts/Targets/MoveTarget.cs +++ b/Projects/Scripts/Targets/MoveTarget.cs @@ -8,10 +8,7 @@ namespace Server.Targets { private object m_Object; - public MoveTarget(object o) : base(-1, true, TargetFlags.None) - { - m_Object = o; - } + public MoveTarget(object o) : base(-1, true, TargetFlags.None) => m_Object = o; protected override void OnTarget(Mobile from, object o) { diff --git a/Projects/Server/AggressorInfo.cs b/Projects/Server/AggressorInfo.cs index 7adaf6eee..a8706ca85 100644 --- a/Projects/Server/AggressorInfo.cs +++ b/Projects/Server/AggressorInfo.cs @@ -184,13 +184,11 @@ namespace Server public static void DumpAccess() { - using (StreamWriter op = new StreamWriter("warnings.log", true)) - { - op.WriteLine("Warning: Access to queued AggressorInfo:"); - op.WriteLine(new StackTrace()); - op.WriteLine(); - op.WriteLine(); - } + using StreamWriter op = new StreamWriter("warnings.log", true); + op.WriteLine("Warning: Access to queued AggressorInfo:"); + op.WriteLine(new StackTrace()); + op.WriteLine(); + op.WriteLine(); } public void Refresh() diff --git a/Projects/Server/Attributes.cs b/Projects/Server/Attributes.cs index 0aa691314..5cfdc3074 100644 --- a/Projects/Server/Attributes.cs +++ b/Projects/Server/Attributes.cs @@ -47,10 +47,7 @@ namespace Server [AttributeUsage(AttributeTargets.Method)] public class CallPriorityAttribute : Attribute { - public CallPriorityAttribute(int priority) - { - Priority = priority; - } + public CallPriorityAttribute(int priority) => Priority = priority; public int Priority{ get; set; } } @@ -97,10 +94,7 @@ namespace Server [AttributeUsage(AttributeTargets.Class)] public class TypeAliasAttribute : Attribute { - public TypeAliasAttribute(params string[] aliases) - { - Aliases = aliases; - } + public TypeAliasAttribute(params string[] aliases) => Aliases = aliases; public string[] Aliases{ get; } } @@ -113,10 +107,7 @@ namespace Server [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum)] public class CustomEnumAttribute : Attribute { - public CustomEnumAttribute(string[] names) - { - Names = names; - } + public CustomEnumAttribute(string[] names) => Names = names; public string[] Names{ get; } } @@ -129,10 +120,7 @@ namespace Server { } - public ConstructibleAttribute(AccessLevel accessLevel) - { - AccessLevel = accessLevel; - } + public ConstructibleAttribute(AccessLevel accessLevel) => AccessLevel = accessLevel; public AccessLevel AccessLevel{ get; set; } } diff --git a/Projects/Server/Body.cs b/Projects/Server/Body.cs index 314ccc228..998378129 100644 --- a/Projects/Server/Body.cs +++ b/Projects/Server/Body.cs @@ -41,29 +41,27 @@ namespace Server { if (File.Exists("Data/bodyTable.cfg")) { - using (StreamReader ip = new StreamReader("Data/bodyTable.cfg")) + using StreamReader ip = new StreamReader("Data/bodyTable.cfg"); + m_Types = new BodyType[0x1000]; + + string line; + + while ((line = ip.ReadLine()) != null) { - m_Types = new BodyType[0x1000]; + if (line.Length == 0 || line.StartsWith("#")) + continue; - string line; + string[] split = line.Split('\t'); - while ((line = ip.ReadLine()) != null) + if (int.TryParse(split[0], out int bodyID) && Enum.TryParse(split[1], true, out BodyType type) && bodyID >= 0 && + bodyID < m_Types.Length) { - if (line.Length == 0 || line.StartsWith("#")) - continue; - - string[] split = line.Split('\t'); - - if (int.TryParse(split[0], out int bodyID) && Enum.TryParse(split[1], true, out BodyType type) && bodyID >= 0 && - bodyID < m_Types.Length) - { - m_Types[bodyID] = type; - } - else - { - Console.WriteLine("Warning: Invalid bodyTable entry:"); - Console.WriteLine(line); - } + m_Types[bodyID] = type; + } + else + { + Console.WriteLine("Warning: Invalid bodyTable entry:"); + Console.WriteLine(line); } } } @@ -75,10 +73,7 @@ namespace Server } } - public Body(int bodyID) - { - BodyID = bodyID; - } + public Body(int bodyID) => BodyID = bodyID; public BodyType Type => BodyID >= 0 && BodyID < m_Types.Length ? m_Types[BodyID] : BodyType.Empty; @@ -148,59 +143,26 @@ namespace Server public int BodyID{ get; } - public static implicit operator int(Body a) - { - return a.BodyID; - } + public static implicit operator int(Body a) => a.BodyID; - public static implicit operator Body(int a) - { - return new Body(a); - } + public static implicit operator Body(int a) => new Body(a); - public override string ToString() - { - return $"0x{BodyID:X}"; - } + public override string ToString() => $"0x{BodyID:X}"; - public override int GetHashCode() - { - return BodyID.GetHashCode(); - } + public override int GetHashCode() => BodyID.GetHashCode(); - public override bool Equals(object o) - { - return o is Body b && b.BodyID == BodyID; - } + public override bool Equals(object o) => o is Body b && b.BodyID == BodyID; - public static bool operator ==(Body l, Body r) - { - return l.BodyID == r.BodyID; - } + public static bool operator ==(Body l, Body r) => l.BodyID == r.BodyID; - public static bool operator !=(Body l, Body r) - { - return l.BodyID != r.BodyID; - } + public static bool operator !=(Body l, Body r) => l.BodyID != r.BodyID; - public static bool operator >(Body l, Body r) - { - return l.BodyID > r.BodyID; - } + public static bool operator >(Body l, Body r) => l.BodyID > r.BodyID; - public static bool operator >=(Body l, Body r) - { - return l.BodyID >= r.BodyID; - } + public static bool operator >=(Body l, Body r) => l.BodyID >= r.BodyID; - public static bool operator <(Body l, Body r) - { - return l.BodyID < r.BodyID; - } + public static bool operator <(Body l, Body r) => l.BodyID < r.BodyID; - public static bool operator <=(Body l, Body r) - { - return l.BodyID <= r.BodyID; - } + public static bool operator <=(Body l, Body r) => l.BodyID <= r.BodyID; } } diff --git a/Projects/Server/ClientVersion.cs b/Projects/Server/ClientVersion.cs index 738a4b502..fd605b472 100644 --- a/Projects/Server/ClientVersion.cs +++ b/Projects/Server/ClientVersion.cs @@ -131,45 +131,21 @@ namespace Server return 0; } - public static bool operator ==(ClientVersion l, ClientVersion r) - { - return Compare(l, r) == 0; - } + public static bool operator ==(ClientVersion l, ClientVersion r) => Compare(l, r) == 0; - public static bool operator !=(ClientVersion l, ClientVersion r) - { - return Compare(l, r) != 0; - } + public static bool operator !=(ClientVersion l, ClientVersion r) => Compare(l, r) != 0; - public static bool operator >=(ClientVersion l, ClientVersion r) - { - return Compare(l, r) >= 0; - } + public static bool operator >=(ClientVersion l, ClientVersion r) => Compare(l, r) >= 0; - public static bool operator >(ClientVersion l, ClientVersion r) - { - return Compare(l, r) > 0; - } + public static bool operator >(ClientVersion l, ClientVersion r) => Compare(l, r) > 0; - public static bool operator <=(ClientVersion l, ClientVersion r) - { - return Compare(l, r) <= 0; - } + public static bool operator <=(ClientVersion l, ClientVersion r) => Compare(l, r) <= 0; - public static bool operator <(ClientVersion l, ClientVersion r) - { - return Compare(l, r) < 0; - } + public static bool operator <(ClientVersion l, ClientVersion r) => Compare(l, r) < 0; - public override int GetHashCode() - { - return Major ^ Minor ^ Revision ^ Patch ^ (int)Type; - } + public override int GetHashCode() => Major ^ Minor ^ Revision ^ Patch ^ (int)Type; - int IComparer.Compare(ClientVersion x, ClientVersion y) - { - return Compare(x, y); - } + int IComparer.Compare(ClientVersion x, ClientVersion y) => Compare(x, y); public override bool Equals(object obj) { @@ -212,15 +188,9 @@ namespace Server return builder.ToString(); } - public override string ToString() - { - return _ToStringImpl(); - } + public override string ToString() => _ToStringImpl(); - public static bool IsNull(object x) - { - return ReferenceEquals(x, null); - } + public static bool IsNull(object x) => ReferenceEquals(x, null); public static int Compare(ClientVersion a, ClientVersion b) { diff --git a/Projects/Server/Commands.cs b/Projects/Server/Commands.cs index bc51f8e28..ec06e49c8 100644 --- a/Projects/Server/Commands.cs +++ b/Projects/Server/Commands.cs @@ -110,10 +110,7 @@ namespace Server public AccessLevel AccessLevel{ get; } - public int CompareTo(CommandEntry e) - { - return e == null ? 1 : Command.CompareTo(e.Command); - } + public int CompareTo(CommandEntry e) => e == null ? 1 : Command.CompareTo(e.Command); } public static class CommandSystem diff --git a/Projects/Server/ContextMenus/ContextMenu.cs b/Projects/Server/ContextMenus/ContextMenu.cs index 2918ae94f..04ef03911 100644 --- a/Projects/Server/ContextMenus/ContextMenu.cs +++ b/Projects/Server/ContextMenus/ContextMenu.cs @@ -22,25 +22,25 @@ using System.Collections.Generic; namespace Server.ContextMenus { - /// - /// Represents the state of an active context menu. This includes who opened the menu, the menu's focus object, and a list of - /// entries that the menu is composed of. - /// - /// - public class ContextMenu + /// + /// Represents the state of an active context menu. This includes who opened the menu, the menu's focus object, and a list of + /// entries that the menu is composed of. + /// + /// + public class ContextMenu { - /// - /// Instantiates a new ContextMenu instance. - /// - /// - /// The who opened this ContextMenu. - /// - /// - /// - /// The or for which this ContextMenu is on. - /// - /// - public ContextMenu(Mobile from, object target) + /// + /// Instantiates a new ContextMenu instance. + /// + /// + /// The who opened this ContextMenu. + /// + /// + /// + /// The or for which this ContextMenu is on. + /// + /// + public ContextMenu(Mobile from, object target) { From = from; Target = target; diff --git a/Projects/Server/ContextMenus/ContextMenuEntry.cs b/Projects/Server/ContextMenus/ContextMenuEntry.cs index e482f98f9..1a60e82ce 100644 --- a/Projects/Server/ContextMenus/ContextMenuEntry.cs +++ b/Projects/Server/ContextMenus/ContextMenuEntry.cs @@ -22,25 +22,25 @@ using Server.Network; namespace Server.ContextMenus { - /// - /// Represents a single entry of a context menu. - /// - /// - public class ContextMenuEntry + /// + /// Represents a single entry of a context menu. + /// + /// + public class ContextMenuEntry { - /// - /// Instantiates a new ContextMenuEntry with a given localization number () - /// and maximum range (). - /// - /// - /// The localization number containing the name of this entry. - /// - /// - /// - /// The maximum range at which this entry can be used. - /// - /// - public ContextMenuEntry(int number, int range = -1) + /// + /// Instantiates a new ContextMenuEntry with a given localization number () + /// and maximum range (). + /// + /// + /// The localization number containing the name of this entry. + /// + /// + /// + /// The maximum range at which this entry can be used. + /// + /// + public ContextMenuEntry(int number, int range = -1) { if (number <= 0x7FFF) // Legacy code support Number = 3000000 + number; @@ -77,11 +77,11 @@ namespace Server.ContextMenus /// public int Color{ get; set; } - /// - /// Gets or sets whether this entry is enabled. When false, the entry will appear in a gray hue and - /// will never be invoked. - /// - public bool Enabled{ get; set; } + /// + /// Gets or sets whether this entry is enabled. When false, the entry will appear in a gray hue and + /// will never be invoked. + /// + public bool Enabled{ get; set; } /// /// Gets a value indicating if non local use of this entry is permitted. @@ -95,4 +95,4 @@ namespace Server.ContextMenus { } } -} \ No newline at end of file +} diff --git a/Projects/Server/ContextMenus/OpenBackpackEntry.cs b/Projects/Server/ContextMenus/OpenBackpackEntry.cs index 81d4b2399..547fabff8 100644 --- a/Projects/Server/ContextMenus/OpenBackpackEntry.cs +++ b/Projects/Server/ContextMenus/OpenBackpackEntry.cs @@ -24,10 +24,7 @@ namespace Server.ContextMenus { private Mobile m_Mobile; - public OpenBackpackEntry(Mobile m) : base(6145) - { - m_Mobile = m; - } + public OpenBackpackEntry(Mobile m) : base(6145) => m_Mobile = m; public override void OnClick() { diff --git a/Projects/Server/ContextMenus/PaperdollEntry.cs b/Projects/Server/ContextMenus/PaperdollEntry.cs index cd402f4e6..12aee25ab 100644 --- a/Projects/Server/ContextMenus/PaperdollEntry.cs +++ b/Projects/Server/ContextMenus/PaperdollEntry.cs @@ -24,10 +24,7 @@ namespace Server.ContextMenus { private Mobile m_Mobile; - public PaperdollEntry(Mobile m) : base(6123, 18) - { - m_Mobile = m; - } + public PaperdollEntry(Mobile m) : base(6123, 18) => m_Mobile = m; public override void OnClick() { diff --git a/Projects/Server/Effects.cs b/Projects/Server/Effects.cs index 70260ed45..ead626d02 100644 --- a/Projects/Server/Effects.cs +++ b/Projects/Server/Effects.cs @@ -44,11 +44,9 @@ namespace Server { public static ParticleSupportType ParticleSupportType{ get; set; } = ParticleSupportType.Detect; - public static bool SendParticlesTo(NetState state) - { - return ParticleSupportType == ParticleSupportType.Full || - ParticleSupportType == ParticleSupportType.Detect && state.IsUOTDClient; - } + public static bool SendParticlesTo(NetState state) => + ParticleSupportType == ParticleSupportType.Full || + ParticleSupportType == ParticleSupportType.Detect && state.IsUOTDClient; public static void PlaySound(IPoint3D p, Map map, int soundID) { diff --git a/Projects/Server/EventSink.cs b/Projects/Server/EventSink.cs index 15d021dfc..0d12f3433 100644 --- a/Projects/Server/EventSink.cs +++ b/Projects/Server/EventSink.cs @@ -127,10 +127,7 @@ namespace Server public class CreateGuildEventArgs : EventArgs { - public CreateGuildEventArgs(uint id) - { - Id = id; - } + public CreateGuildEventArgs(uint id) => Id = id; public uint Id{ get; set; } @@ -139,20 +136,14 @@ namespace Server public class GuildGumpRequestArgs : EventArgs { - public GuildGumpRequestArgs(Mobile mobile) - { - Mobile = mobile; - } + public GuildGumpRequestArgs(Mobile mobile) => Mobile = mobile; public Mobile Mobile{ get; } } public class QuestGumpRequestArgs : EventArgs { - public QuestGumpRequestArgs(Mobile mobile) - { - Mobile = mobile; - } + public QuestGumpRequestArgs(Mobile mobile) => Mobile = mobile; public Mobile Mobile{ get; } } @@ -352,20 +343,14 @@ namespace Server public class ChatRequestEventArgs : EventArgs { - public ChatRequestEventArgs(Mobile mobile) - { - Mobile = mobile; - } + public ChatRequestEventArgs(Mobile mobile) => Mobile = mobile; public Mobile Mobile{ get; } } public class PlayerDeathEventArgs : EventArgs { - public PlayerDeathEventArgs(Mobile mobile) - { - Mobile = mobile; - } + public PlayerDeathEventArgs(Mobile mobile) => Mobile = mobile; public Mobile Mobile{ get; } } @@ -388,10 +373,7 @@ namespace Server public class LogoutEventArgs : EventArgs { - public LogoutEventArgs(Mobile m) - { - Mobile = m; - } + public LogoutEventArgs(Mobile m) => Mobile = m; public Mobile Mobile{ get; } } @@ -411,20 +393,14 @@ namespace Server public class ConnectedEventArgs : EventArgs { - public ConnectedEventArgs(Mobile m) - { - Mobile = m; - } + public ConnectedEventArgs(Mobile m) => Mobile = m; public Mobile Mobile{ get; } } public class DisconnectedEventArgs : EventArgs { - public DisconnectedEventArgs(Mobile m) - { - Mobile = m; - } + public DisconnectedEventArgs(Mobile m) => Mobile = m; public Mobile Mobile{ get; } } @@ -489,30 +465,21 @@ namespace Server public class StunRequestEventArgs : EventArgs { - public StunRequestEventArgs(Mobile m) - { - Mobile = m; - } + public StunRequestEventArgs(Mobile m) => Mobile = m; public Mobile Mobile{ get; } } public class DisarmRequestEventArgs : EventArgs { - public DisarmRequestEventArgs(Mobile m) - { - Mobile = m; - } + public DisarmRequestEventArgs(Mobile m) => Mobile = m; public Mobile Mobile{ get; } } public class HelpRequestEventArgs : EventArgs { - public HelpRequestEventArgs(Mobile m) - { - Mobile = m; - } + public HelpRequestEventArgs(Mobile m) => Mobile = m; public Mobile Mobile{ get; } } @@ -523,10 +490,7 @@ namespace Server public class CrashedEventArgs : EventArgs { - public CrashedEventArgs(Exception e) - { - Exception = e; - } + public CrashedEventArgs(Exception e) => Exception = e; public Exception Exception{ get; } @@ -696,10 +660,7 @@ namespace Server public class OpenDoorMacroEventArgs : EventArgs { - public OpenDoorMacroEventArgs(Mobile mobile) - { - Mobile = mobile; - } + public OpenDoorMacroEventArgs(Mobile mobile) => Mobile = mobile; public Mobile Mobile{ get; } } @@ -741,20 +702,14 @@ namespace Server public class LoginEventArgs : EventArgs { - public LoginEventArgs(Mobile mobile) - { - Mobile = mobile; - } + public LoginEventArgs(Mobile mobile) => Mobile = mobile; public Mobile Mobile{ get; } } public class WorldSaveEventArgs : EventArgs { - public WorldSaveEventArgs(bool msg) - { - Message = msg; - } + public WorldSaveEventArgs(bool msg) => Message = msg; public bool Message{ get; } } diff --git a/Projects/Server/ExpansionInfo.cs b/Projects/Server/ExpansionInfo.cs index 66ab87894..4a089ba31 100644 --- a/Projects/Server/ExpansionInfo.cs +++ b/Projects/Server/ExpansionInfo.cs @@ -244,10 +244,8 @@ namespace Server FeatureFlags supportedFeatures, CharacterListFlags charListFlags, HousingFlags customHousingFlag) - : this(id, name, supportedFeatures, charListFlags, customHousingFlag) - { + : this(id, name, supportedFeatures, charListFlags, customHousingFlag) => ClientFlags = clientFlags; - } public ExpansionInfo( int id, @@ -256,10 +254,8 @@ namespace Server FeatureFlags supportedFeatures, CharacterListFlags charListFlags, HousingFlags customHousingFlag) - : this(id, name, supportedFeatures, charListFlags, customHousingFlag) - { + : this(id, name, supportedFeatures, charListFlags, customHousingFlag) => RequiredClient = requiredClient; - } private ExpansionInfo( int id, @@ -324,10 +320,7 @@ namespace Server return FeatureFlags.ExpansionNone; } - public static ExpansionInfo GetInfo(Expansion ex) - { - return GetInfo((int)ex); - } + public static ExpansionInfo GetInfo(Expansion ex) => GetInfo((int)ex); public static ExpansionInfo GetInfo(int ex) { @@ -338,9 +331,6 @@ namespace Server return Table[v]; } - public override string ToString() - { - return Name; - } + public override string ToString() => Name; } } \ No newline at end of file diff --git a/Projects/Server/Geometry.cs b/Projects/Server/Geometry.cs index 286ad4b74..a86248fff 100644 --- a/Projects/Server/Geometry.cs +++ b/Projects/Server/Geometry.cs @@ -54,10 +54,7 @@ namespace Server set => m_Y = value; } - public override string ToString() - { - return $"({m_X}, {m_Y})"; - } + public override string ToString() => $"({m_X}, {m_Y})"; public static Point2D Parse(string value) { @@ -84,95 +81,41 @@ namespace Server return v; } - public override bool Equals(object o) - { - return o is IPoint2D p && m_X == p.X && m_Y == p.Y; - } + public override bool Equals(object o) => o is IPoint2D p && m_X == p.X && m_Y == p.Y; - public override int GetHashCode() - { - return m_X ^ m_Y; - } + public override int GetHashCode() => m_X ^ m_Y; - public static bool operator ==(Point2D l, Point2D r) - { - return l.m_X == r.m_X && l.m_Y == r.m_Y; - } + public static bool operator ==(Point2D l, Point2D r) => l.m_X == r.m_X && l.m_Y == r.m_Y; - public static bool operator !=(Point2D l, Point2D r) - { - return l.m_X != r.m_X || l.m_Y != r.m_Y; - } + public static bool operator !=(Point2D l, Point2D r) => l.m_X != r.m_X || l.m_Y != r.m_Y; - public static bool operator ==(Point2D l, IPoint2D r) - { - return !ReferenceEquals(r, null) && l.m_X == r.X && l.m_Y == r.Y; - } + public static bool operator ==(Point2D l, IPoint2D r) => !ReferenceEquals(r, null) && l.m_X == r.X && l.m_Y == r.Y; - public static bool operator !=(Point2D l, IPoint2D r) - { - return !ReferenceEquals(r, null) && (l.m_X != r.X || l.m_Y != r.Y); - } + public static bool operator !=(Point2D l, IPoint2D r) => !ReferenceEquals(r, null) && (l.m_X != r.X || l.m_Y != r.Y); - public static bool operator >(Point2D l, Point2D r) - { - return l.m_X > r.m_X && l.m_Y > r.m_Y; - } + public static bool operator >(Point2D l, Point2D r) => l.m_X > r.m_X && l.m_Y > r.m_Y; - public static bool operator >(Point2D l, Point3D r) - { - return l.m_X > r.m_X && l.m_Y > r.m_Y; - } + public static bool operator >(Point2D l, Point3D r) => l.m_X > r.m_X && l.m_Y > r.m_Y; - public static bool operator >(Point2D l, IPoint2D r) - { - return !ReferenceEquals(r, null) && l.m_X > r.X && l.m_Y > r.Y; - } + public static bool operator >(Point2D l, IPoint2D r) => !ReferenceEquals(r, null) && l.m_X > r.X && l.m_Y > r.Y; - public static bool operator <(Point2D l, Point2D r) - { - return l.m_X < r.m_X && l.m_Y < r.m_Y; - } + public static bool operator <(Point2D l, Point2D r) => l.m_X < r.m_X && l.m_Y < r.m_Y; - public static bool operator <(Point2D l, Point3D r) - { - return l.m_X < r.m_X && l.m_Y < r.m_Y; - } + public static bool operator <(Point2D l, Point3D r) => l.m_X < r.m_X && l.m_Y < r.m_Y; - public static bool operator <(Point2D l, IPoint2D r) - { - return !ReferenceEquals(r, null) && l.m_X < r.X && l.m_Y < r.Y; - } + public static bool operator <(Point2D l, IPoint2D r) => !ReferenceEquals(r, null) && l.m_X < r.X && l.m_Y < r.Y; - public static bool operator >=(Point2D l, Point2D r) - { - return l.m_X >= r.m_X && l.m_Y >= r.m_Y; - } + public static bool operator >=(Point2D l, Point2D r) => l.m_X >= r.m_X && l.m_Y >= r.m_Y; - public static bool operator >=(Point2D l, Point3D r) - { - return l.m_X >= r.m_X && l.m_Y >= r.m_Y; - } + public static bool operator >=(Point2D l, Point3D r) => l.m_X >= r.m_X && l.m_Y >= r.m_Y; - public static bool operator >=(Point2D l, IPoint2D r) - { - return !ReferenceEquals(r, null) && l.m_X >= r.X && l.m_Y >= r.Y; - } + public static bool operator >=(Point2D l, IPoint2D r) => !ReferenceEquals(r, null) && l.m_X >= r.X && l.m_Y >= r.Y; - public static bool operator <=(Point2D l, Point2D r) - { - return l.m_X <= r.m_X && l.m_Y <= r.m_Y; - } + public static bool operator <=(Point2D l, Point2D r) => l.m_X <= r.m_X && l.m_Y <= r.m_Y; - public static bool operator <=(Point2D l, Point3D r) - { - return l.m_X <= r.m_X && l.m_Y <= r.m_Y; - } + public static bool operator <=(Point2D l, Point3D r) => l.m_X <= r.m_X && l.m_Y <= r.m_Y; - public static bool operator <=(Point2D l, IPoint2D r) - { - return !ReferenceEquals(r, null) && l.m_X <= r.X && l.m_Y <= r.Y; - } + public static bool operator <=(Point2D l, IPoint2D r) => !ReferenceEquals(r, null) && l.m_X <= r.X && l.m_Y <= r.Y; } [Parsable] @@ -222,20 +165,11 @@ namespace Server set => m_Z = value; } - public override string ToString() - { - return $"({m_X}, {m_Y}, {m_Z})"; - } + public override string ToString() => $"({m_X}, {m_Y}, {m_Z})"; - public override bool Equals(object o) - { - return o is IPoint3D p && m_X == p.X && m_Y == p.Y && m_Z == p.Z; - } + public override bool Equals(object o) => o is IPoint3D p && m_X == p.X && m_Y == p.Y && m_Z == p.Z; - public override int GetHashCode() - { - return m_X ^ m_Y ^ m_Z; - } + public override int GetHashCode() => m_X ^ m_Y ^ m_Z; public static Point3D Parse(string value) { @@ -257,25 +191,13 @@ namespace Server return new Point3D(Convert.ToInt32(param1), Convert.ToInt32(param2), Convert.ToInt32(param3)); } - public static bool operator ==(Point3D l, Point3D r) - { - return l.m_X == r.m_X && l.m_Y == r.m_Y && l.m_Z == r.m_Z; - } + public static bool operator ==(Point3D l, Point3D r) => l.m_X == r.m_X && l.m_Y == r.m_Y && l.m_Z == r.m_Z; - public static bool operator !=(Point3D l, Point3D r) - { - return l.m_X != r.m_X || l.m_Y != r.m_Y || l.m_Z != r.m_Z; - } + public static bool operator !=(Point3D l, Point3D r) => l.m_X != r.m_X || l.m_Y != r.m_Y || l.m_Z != r.m_Z; - public static bool operator ==(Point3D l, IPoint3D r) - { - return !ReferenceEquals(r, null) && l.m_X == r.X && l.m_Y == r.Y && l.m_Z == r.Z; - } + public static bool operator ==(Point3D l, IPoint3D r) => !ReferenceEquals(r, null) && l.m_X == r.X && l.m_Y == r.Y && l.m_Z == r.Z; - public static bool operator !=(Point3D l, IPoint3D r) - { - return !ReferenceEquals(r, null) && (l.m_X != r.X || l.m_Y != r.Y || l.m_Z != r.Z); - } + public static bool operator !=(Point3D l, IPoint3D r) => !ReferenceEquals(r, null) && (l.m_X != r.X || l.m_Y != r.Y || l.m_Z != r.Z); public int CompareTo(Point3D other) { @@ -402,27 +324,13 @@ namespace Server m_End.m_Y = r.m_End.m_Y; } - public bool Contains(Point3D p) - { - return m_Start.m_X <= p.m_X && m_Start.m_Y <= p.m_Y && m_End.m_X > p.m_X && m_End.m_Y > p.m_Y; - //return ( m_Start <= p && m_End > p ); - } + public bool Contains(Point3D p) => m_Start.m_X <= p.m_X && m_Start.m_Y <= p.m_Y && m_End.m_X > p.m_X && m_End.m_Y > p.m_Y; - public bool Contains(Point2D p) - { - return m_Start.m_X <= p.m_X && m_Start.m_Y <= p.m_Y && m_End.m_X > p.m_X && m_End.m_Y > p.m_Y; - //return ( m_Start <= p && m_End > p ); - } + public bool Contains(Point2D p) => m_Start.m_X <= p.m_X && m_Start.m_Y <= p.m_Y && m_End.m_X > p.m_X && m_End.m_Y > p.m_Y; - public bool Contains(IPoint2D p) - { - return m_Start <= p && m_End > p; - } + public bool Contains(IPoint2D p) => m_Start <= p && m_End > p; - public override string ToString() - { - return $"({X}, {Y})+({Width}, {Height})"; - } + public override string ToString() => $"({X}, {Y})+({Width}, {Height})"; } [NoSort] @@ -456,24 +364,20 @@ namespace Server [CommandProperty(AccessLevel.Counselor)] public int Depth => End.Z - Start.Z; - public bool Contains(Point3D p) - { - return p.m_X >= Start.m_X - && p.m_X < End.m_X - && p.m_Y >= Start.m_Y - && p.m_Y < End.m_Y - && p.m_Z >= Start.m_Z - && p.m_Z < End.m_Z; - } + public bool Contains(Point3D p) => + p.m_X >= Start.m_X + && p.m_X < End.m_X + && p.m_Y >= Start.m_Y + && p.m_Y < End.m_Y + && p.m_Z >= Start.m_Z + && p.m_Z < End.m_Z; - public bool Contains(IPoint3D p) - { - return p.X >= Start.m_X - && p.X < End.m_X - && p.Y >= Start.m_Y - && p.Y < End.m_Y - && p.Z >= Start.m_Z - && p.Z < End.m_Z; - } + public bool Contains(IPoint3D p) => + p.X >= Start.m_X + && p.X < End.m_X + && p.Y >= Start.m_Y + && p.Y < End.m_Y + && p.Z >= Start.m_Z + && p.Z < End.m_Z; } } diff --git a/Projects/Server/Guild.cs b/Projects/Server/Guild.cs index ad939f883..76f892474 100644 --- a/Projects/Server/Guild.cs +++ b/Projects/Server/Guild.cs @@ -113,9 +113,6 @@ namespace Server.Guilds return results; } - public override string ToString() - { - return $"0x{Id:X} \"{Name} [{Abbreviation}]\""; - } + public override string ToString() => $"0x{Id:X} \"{Name} [{Abbreviation}]\""; } -} \ No newline at end of file +} diff --git a/Projects/Server/Gumps/Gump.cs b/Projects/Server/Gumps/Gump.cs index 5b04c891c..0d5cc707a 100644 --- a/Projects/Server/Gumps/Gump.cs +++ b/Projects/Server/Gumps/Gump.cs @@ -159,10 +159,7 @@ namespace Server.Gumps } } - public static int GetTypeID(Type type) - { - return type?.FullName?.GetHashCode() ?? -1; - } + public static int GetTypeID(Type type) => type?.FullName?.GetHashCode() ?? -1; public void Invalidate() { @@ -315,10 +312,7 @@ namespace Server.Gumps state.Send(Compile(state)); } - public static byte[] StringToBuffer(string str) - { - return Encoding.ASCII.GetBytes(str); - } + public static byte[] StringToBuffer(string str) => Encoding.ASCII.GetBytes(str); private Packet Compile(NetState ns = null) { diff --git a/Projects/Server/Gumps/GumpAlphaRegion.cs b/Projects/Server/Gumps/GumpAlphaRegion.cs index 048fae5a9..20cfefe0d 100644 --- a/Projects/Server/Gumps/GumpAlphaRegion.cs +++ b/Projects/Server/Gumps/GumpAlphaRegion.cs @@ -60,10 +60,7 @@ namespace Server.Gumps set => Delta(ref m_Height, value); } - public override string Compile(NetState ns) - { - return $"{{ checkertrans {m_X} {m_Y} {m_Width} {m_Height} }}"; - } + public override string Compile(NetState ns) => $"{{ checkertrans {m_X} {m_Y} {m_Width} {m_Height} }}"; public override void AppendTo(NetState ns, IGumpWriter disp) { diff --git a/Projects/Server/Gumps/GumpBackground.cs b/Projects/Server/Gumps/GumpBackground.cs index 8b49f6b85..8016cfe1b 100644 --- a/Projects/Server/Gumps/GumpBackground.cs +++ b/Projects/Server/Gumps/GumpBackground.cs @@ -68,10 +68,7 @@ namespace Server.Gumps set => Delta(ref m_GumpID, value); } - public override string Compile(NetState ns) - { - return $"{{ resizepic {m_X} {m_Y} {m_GumpID} {m_Width} {m_Height} }}"; - } + public override string Compile(NetState ns) => $"{{ resizepic {m_X} {m_Y} {m_GumpID} {m_Width} {m_Height} }}"; public override void AppendTo(NetState ns, IGumpWriter disp) { diff --git a/Projects/Server/Gumps/GumpButton.cs b/Projects/Server/Gumps/GumpButton.cs index 5ae85d512..9186b8e37 100644 --- a/Projects/Server/Gumps/GumpButton.cs +++ b/Projects/Server/Gumps/GumpButton.cs @@ -101,10 +101,7 @@ namespace Server.Gumps set => Delta(ref m_Param, value); } - public override string Compile(NetState ns) - { - return $"{{ button {m_X} {m_Y} {m_ID1} {m_ID2} {(int)m_Type} {m_Param} {m_ButtonID} }}"; - } + public override string Compile(NetState ns) => $"{{ button {m_X} {m_Y} {m_ID1} {m_ID2} {(int)m_Type} {m_Param} {m_ButtonID} }}"; public override void AppendTo(NetState ns, IGumpWriter disp) { diff --git a/Projects/Server/Gumps/GumpCheck.cs b/Projects/Server/Gumps/GumpCheck.cs index a0e638443..afc3a54d0 100644 --- a/Projects/Server/Gumps/GumpCheck.cs +++ b/Projects/Server/Gumps/GumpCheck.cs @@ -76,10 +76,7 @@ namespace Server.Gumps set => Delta(ref m_SwitchID, value); } - public override string Compile(NetState ns) - { - return $"{{ checkbox {m_X} {m_Y} {m_ID1} {m_ID2} {(m_InitialState ? 1 : 0)} {m_SwitchID} }}"; - } + public override string Compile(NetState ns) => $"{{ checkbox {m_X} {m_Y} {m_ID1} {m_ID2} {(m_InitialState ? 1 : 0)} {m_SwitchID} }}"; public override void AppendTo(NetState ns, IGumpWriter disp) { diff --git a/Projects/Server/Gumps/GumpGroup.cs b/Projects/Server/Gumps/GumpGroup.cs index 901e30a09..93418d837 100644 --- a/Projects/Server/Gumps/GumpGroup.cs +++ b/Projects/Server/Gumps/GumpGroup.cs @@ -27,10 +27,7 @@ namespace Server.Gumps private static byte[] m_LayoutName = Gump.StringToBuffer("group"); private int m_Group; - public GumpGroup(int group) - { - m_Group = group; - } + public GumpGroup(int group) => m_Group = group; public int Group { @@ -38,10 +35,7 @@ namespace Server.Gumps set => Delta(ref m_Group, value); } - public override string Compile(NetState ns) - { - return $"{{ group {m_Group} }}"; - } + public override string Compile(NetState ns) => $"{{ group {m_Group} }}"; public override void AppendTo(NetState ns, IGumpWriter disp) { diff --git a/Projects/Server/Gumps/GumpHtml.cs b/Projects/Server/Gumps/GumpHtml.cs index 9b4d5fab3..12cd813e4 100644 --- a/Projects/Server/Gumps/GumpHtml.cs +++ b/Projects/Server/Gumps/GumpHtml.cs @@ -83,11 +83,7 @@ namespace Server.Gumps set => Delta(ref m_Scrollbar, value); } - public override string Compile(NetState ns) - { - return - $"{{ htmlgump {m_X} {m_Y} {m_Width} {m_Height} {Parent.Intern(m_Text)} {(m_Background ? 1 : 0)} {(m_Scrollbar ? 1 : 0)} }}"; - } + public override string Compile(NetState ns) => $"{{ htmlgump {m_X} {m_Y} {m_Width} {m_Height} {Parent.Intern(m_Text)} {(m_Background ? 1 : 0)} {(m_Scrollbar ? 1 : 0)} }}"; public override void AppendTo(NetState ns, IGumpWriter disp) { diff --git a/Projects/Server/Gumps/GumpImage.cs b/Projects/Server/Gumps/GumpImage.cs index 26c70cfb9..26d013222 100644 --- a/Projects/Server/Gumps/GumpImage.cs +++ b/Projects/Server/Gumps/GumpImage.cs @@ -62,11 +62,9 @@ namespace Server.Gumps set => Delta(ref m_Hue, value); } - public override string Compile(NetState ns) - { - return m_Hue == 0 ? $"{{ gumppic {m_X} {m_Y} {m_GumpID} }}" : + public override string Compile(NetState ns) => + m_Hue == 0 ? $"{{ gumppic {m_X} {m_Y} {m_GumpID} }}" : $"{{ gumppic {m_X} {m_Y} {m_GumpID} hue={m_Hue} }}"; - } public override void AppendTo(NetState ns, IGumpWriter disp) { diff --git a/Projects/Server/Gumps/GumpImageTiled.cs b/Projects/Server/Gumps/GumpImageTiled.cs index 1ad2a07a6..e090bdf3a 100644 --- a/Projects/Server/Gumps/GumpImageTiled.cs +++ b/Projects/Server/Gumps/GumpImageTiled.cs @@ -68,10 +68,7 @@ namespace Server.Gumps set => Delta(ref m_GumpID, value); } - public override string Compile(NetState ns) - { - return $"{{ gumppictiled {m_X} {m_Y} {m_Width} {m_Height} {m_GumpID} }}"; - } + public override string Compile(NetState ns) => $"{{ gumppictiled {m_X} {m_Y} {m_Width} {m_Height} {m_GumpID} }}"; public override void AppendTo(NetState ns, IGumpWriter disp) { diff --git a/Projects/Server/Gumps/GumpItem.cs b/Projects/Server/Gumps/GumpItem.cs index 05c4f32d4..8420886ea 100644 --- a/Projects/Server/Gumps/GumpItem.cs +++ b/Projects/Server/Gumps/GumpItem.cs @@ -62,11 +62,9 @@ namespace Server.Gumps set => Delta(ref m_Hue, value); } - public override string Compile(NetState ns) - { - return m_Hue == 0 ? $"{{ tilepic {m_X} {m_Y} {m_ItemID} }}" : + public override string Compile(NetState ns) => + m_Hue == 0 ? $"{{ tilepic {m_X} {m_Y} {m_ItemID} }}" : $"{{ tilepichue {m_X} {m_Y} {m_ItemID} {m_Hue} }}"; - } public override void AppendTo(NetState ns, IGumpWriter disp) { diff --git a/Projects/Server/Gumps/GumpItemProperty.cs b/Projects/Server/Gumps/GumpItemProperty.cs index c06e6f78f..5ce65e19e 100644 --- a/Projects/Server/Gumps/GumpItemProperty.cs +++ b/Projects/Server/Gumps/GumpItemProperty.cs @@ -27,10 +27,7 @@ namespace Server.Gumps private static byte[] m_LayoutName = Gump.StringToBuffer("itemproperty"); private uint m_Serial; - public GumpItemProperty(uint serial) - { - m_Serial = serial; - } + public GumpItemProperty(uint serial) => m_Serial = serial; public uint Serial { @@ -38,10 +35,7 @@ namespace Server.Gumps set => Delta(ref m_Serial, value); } - public override string Compile(NetState ns) - { - return $"{{ itemproperty {m_Serial} }}"; - } + public override string Compile(NetState ns) => $"{{ itemproperty {m_Serial} }}"; public override void AppendTo(NetState ns, IGumpWriter disp) { diff --git a/Projects/Server/Gumps/GumpLabel.cs b/Projects/Server/Gumps/GumpLabel.cs index c92ac700c..d8a0c3389 100644 --- a/Projects/Server/Gumps/GumpLabel.cs +++ b/Projects/Server/Gumps/GumpLabel.cs @@ -61,10 +61,7 @@ namespace Server.Gumps set => Delta(ref m_Text, value); } - public override string Compile(NetState ns) - { - return $"{{ text {m_X} {m_Y} {m_Hue} {Parent.Intern(m_Text)} }}"; - } + public override string Compile(NetState ns) => $"{{ text {m_X} {m_Y} {m_Hue} {Parent.Intern(m_Text)} }}"; public override void AppendTo(NetState ns, IGumpWriter disp) { diff --git a/Projects/Server/Gumps/GumpLabelCropped.cs b/Projects/Server/Gumps/GumpLabelCropped.cs index d8aec978f..462968311 100644 --- a/Projects/Server/Gumps/GumpLabelCropped.cs +++ b/Projects/Server/Gumps/GumpLabelCropped.cs @@ -76,10 +76,7 @@ namespace Server.Gumps set => Delta(ref m_Text, value); } - public override string Compile(NetState ns) - { - return $"{{ croppedtext {m_X} {m_Y} {m_Width} {m_Height} {m_Hue} {Parent.Intern(m_Text)} }}"; - } + public override string Compile(NetState ns) => $"{{ croppedtext {m_X} {m_Y} {m_Width} {m_Height} {m_Hue} {Parent.Intern(m_Text)} }}"; public override void AppendTo(NetState ns, IGumpWriter disp) { diff --git a/Projects/Server/Gumps/GumpPage.cs b/Projects/Server/Gumps/GumpPage.cs index 1fb7bde92..8b5479512 100644 --- a/Projects/Server/Gumps/GumpPage.cs +++ b/Projects/Server/Gumps/GumpPage.cs @@ -27,10 +27,7 @@ namespace Server.Gumps private static byte[] m_LayoutName = Gump.StringToBuffer("page"); private int m_Page; - public GumpPage(int page) - { - m_Page = page; - } + public GumpPage(int page) => m_Page = page; public int Page { @@ -38,10 +35,7 @@ namespace Server.Gumps set => Delta(ref m_Page, value); } - public override string Compile(NetState ns) - { - return $"{{ page {m_Page} }}"; - } + public override string Compile(NetState ns) => $"{{ page {m_Page} }}"; public override void AppendTo(NetState ns, IGumpWriter disp) { diff --git a/Projects/Server/Gumps/GumpRadio.cs b/Projects/Server/Gumps/GumpRadio.cs index 5b27e74ef..740c3d9b1 100644 --- a/Projects/Server/Gumps/GumpRadio.cs +++ b/Projects/Server/Gumps/GumpRadio.cs @@ -76,10 +76,7 @@ namespace Server.Gumps set => Delta(ref m_SwitchID, value); } - public override string Compile(NetState ns) - { - return $"{{ radio {m_X} {m_Y} {m_ID1} {m_ID2} {(m_InitialState ? 1 : 0)} {m_SwitchID} }}"; - } + public override string Compile(NetState ns) => $"{{ radio {m_X} {m_Y} {m_ID1} {m_ID2} {(m_InitialState ? 1 : 0)} {m_SwitchID} }}"; public override void AppendTo(NetState ns, IGumpWriter disp) { diff --git a/Projects/Server/Gumps/GumpTextEntry.cs b/Projects/Server/Gumps/GumpTextEntry.cs index b91cb1b5b..8ebd49f83 100644 --- a/Projects/Server/Gumps/GumpTextEntry.cs +++ b/Projects/Server/Gumps/GumpTextEntry.cs @@ -84,11 +84,7 @@ namespace Server.Gumps set => Delta(ref m_InitialText, value); } - public override string Compile(NetState ns) - { - return - $"{{ textentry {m_X} {m_Y} {m_Width} {m_Height} {m_Hue} {m_EntryID} {Parent.Intern(m_InitialText)} }}"; - } + public override string Compile(NetState ns) => $"{{ textentry {m_X} {m_Y} {m_Width} {m_Height} {m_Hue} {m_EntryID} {Parent.Intern(m_InitialText)} }}"; public override void AppendTo(NetState ns, IGumpWriter disp) { diff --git a/Projects/Server/Gumps/GumpTextEntryLimited.cs b/Projects/Server/Gumps/GumpTextEntryLimited.cs index 5fc346b41..2b4d983aa 100644 --- a/Projects/Server/Gumps/GumpTextEntryLimited.cs +++ b/Projects/Server/Gumps/GumpTextEntryLimited.cs @@ -92,11 +92,7 @@ namespace Server.Gumps set => Delta(ref m_Size, value); } - public override string Compile(NetState ns) - { - return - $"{{ textentrylimited {m_X} {m_Y} {m_Width} {m_Height} {m_Hue} {m_EntryID} {Parent.Intern(m_InitialText)} {m_Size} }}"; - } + public override string Compile(NetState ns) => $"{{ textentrylimited {m_X} {m_Y} {m_Width} {m_Height} {m_Hue} {m_EntryID} {Parent.Intern(m_InitialText)} {m_Size} }}"; public override void AppendTo(NetState ns, IGumpWriter disp) { diff --git a/Projects/Server/Gumps/GumpTooltip.cs b/Projects/Server/Gumps/GumpTooltip.cs index 3e7ebcbc7..2982ebecc 100644 --- a/Projects/Server/Gumps/GumpTooltip.cs +++ b/Projects/Server/Gumps/GumpTooltip.cs @@ -27,10 +27,7 @@ namespace Server.Gumps private static byte[] m_LayoutName = Gump.StringToBuffer("tooltip"); private int m_Number; - public GumpTooltip(int number) - { - m_Number = number; - } + public GumpTooltip(int number) => m_Number = number; public int Number { @@ -38,10 +35,7 @@ namespace Server.Gumps set => Delta(ref m_Number, value); } - public override string Compile(NetState ns) - { - return $"{{ tooltip {m_Number} }}"; - } + public override string Compile(NetState ns) => $"{{ tooltip {m_Number} }}"; public override void AppendTo(NetState ns, IGumpWriter disp) { diff --git a/Projects/Server/IEntity.cs b/Projects/Server/IEntity.cs index 09f807249..7900dae1d 100644 --- a/Projects/Server/IEntity.cs +++ b/Projects/Server/IEntity.cs @@ -44,15 +44,9 @@ namespace Server Deleted = false; } - public int CompareTo(Entity other) - { - return CompareTo((IEntity)other); - } + public int CompareTo(Entity other) => CompareTo((IEntity)other); - public int CompareTo(IEntity other) - { - return other == null ? -1 : Serial.CompareTo(other.Serial); - } + public int CompareTo(IEntity other) => other == null ? -1 : Serial.CompareTo(other.Serial); public Serial Serial{ get; } diff --git a/Projects/Server/Insensitive.cs b/Projects/Server/Insensitive.cs index affe68f78..c46c0a6e4 100644 --- a/Projects/Server/Insensitive.cs +++ b/Projects/Server/Insensitive.cs @@ -27,10 +27,7 @@ namespace Server { public static IComparer Comparer{ get; } = StringComparer.OrdinalIgnoreCase; - public static int Compare(string a, string b) - { - return Comparer.Compare(a, b); - } + public static int Compare(string a, string b) => Comparer.Compare(a, b); public static bool Equals(string a, string b) { diff --git a/Projects/Server/Item.cs b/Projects/Server/Item.cs index 48a0b7412..a89fac86e 100644 --- a/Projects/Server/Item.cs +++ b/Projects/Server/Item.cs @@ -759,15 +759,9 @@ namespace Server } } - int IComparable.CompareTo(IEntity other) - { - return other == null ? -1 : Serial.CompareTo(other.Serial); - } + int IComparable.CompareTo(IEntity other) => other == null ? -1 : Serial.CompareTo(other.Serial); - public int CompareTo(Item other) - { - return other == null ? -1 : Serial.CompareTo(other.Serial); - } + public int CompareTo(Item other) => other == null ? -1 : Serial.CompareTo(other.Serial); /// /// Moves the Item to a given and . @@ -1408,15 +1402,9 @@ namespace Server return flags; } - private CompactInfo LookupCompactInfo() - { - return m_CompactInfo; - } + private CompactInfo LookupCompactInfo() => m_CompactInfo; - private CompactInfo AcquireCompactInfo() - { - return m_CompactInfo ?? (m_CompactInfo = new CompactInfo()); - } + private CompactInfo AcquireCompactInfo() => m_CompactInfo ?? (m_CompactInfo = new CompactInfo()); private void ReleaseCompactInfo() { @@ -1469,15 +1457,9 @@ namespace Server m_Flags &= ~flag; } - private bool GetFlag(ImplFlag flag) - { - return (m_Flags & flag) != 0; - } + private bool GetFlag(ImplFlag flag) => (m_Flags & flag) != 0; - public BounceInfo GetBounce() - { - return LookupCompactInfo()?.m_Bounce; - } + public BounceInfo GetBounce() => LookupCompactInfo()?.m_Bounce; public void RecordBounce() { @@ -1521,10 +1503,7 @@ namespace Server /// Overridable. Method checked to see if the item can be traded. /// /// True if the trade is allowed, false if not. - public virtual bool AllowSecureTrade(Mobile from, Mobile to, Mobile newOwner, bool accepted) - { - return true; - } + public virtual bool AllowSecureTrade(Mobile from, Mobile to, Mobile newOwner, bool accepted) => true; /// /// Overridable. Virtual event invoked when a trade has completed, either successfully or not. @@ -1552,10 +1531,7 @@ namespace Server /// /// /// - public virtual bool CheckPropertyConfliction(Mobile m) - { - return false; - } + public virtual bool CheckPropertyConfliction(Mobile m) => false; /// /// Overridable. Sends the object property list to . @@ -1647,12 +1623,12 @@ namespace Server list.Add(1072789, weight.ToString()); //Weight: ~1_WEIGHT~ stones } - /// - /// Overridable. Adds header properties. By default, this invokes , - /// (if applicable), and (if - /// ). - /// - public virtual void AddNameProperties(ObjectPropertyList list) + /// + /// Overridable. Adds header properties. By default, this invokes , + /// (if applicable), and (if + /// ). + /// + public virtual void AddNameProperties(ObjectPropertyList list) { AddNameProperty(list); @@ -1748,10 +1724,7 @@ namespace Server parentMobile.GetChildNameProperties(list, item); } - public virtual bool IsChildVisibleTo(Mobile m, Item child) - { - return true; - } + public virtual bool IsChildVisibleTo(Mobile m, Item child) => true; public void Bounce(Mobile from) { @@ -1822,20 +1795,11 @@ namespace Server /// When placed in an Item script, the item may be cast when equipped if the has 100 or more /// intelligence. Otherwise, it will drop to their backpack. /// - public virtual bool AllowEquippedCast(Mobile from) - { - return false; - } + public virtual bool AllowEquippedCast(Mobile from) => false; - public virtual bool CheckConflictingLayer(Mobile m, Item item, Layer layer) - { - return m_Layer == layer; - } + public virtual bool CheckConflictingLayer(Mobile m, Item item, Layer layer) => m_Layer == layer; - public virtual bool CanEquip(Mobile m) - { - return m_Layer != Layer.Invalid && m.FindItemOnLayer(m_Layer) == null; - } + public virtual bool CanEquip(Mobile m) => m_Layer != Layer.Invalid && m.FindItemOnLayer(m_Layer) == null; public virtual void GetChildContextMenuEntries(Mobile from, List list, Item item) { @@ -1853,10 +1817,7 @@ namespace Server mobile.GetChildContextMenuEntries(from, list, this); } - public virtual bool VerifyMove(Mobile from) - { - return Movable; - } + public virtual bool VerifyMove(Mobile from) => Movable; public virtual DeathMoveResult OnParentDeath(Mobile parent) { @@ -1936,36 +1897,22 @@ namespace Server LabelTo(to, "(cursed)"); } - public bool AtWorldPoint(int x, int y) - { - return m_Parent == null && m_Location.m_X == x && m_Location.m_Y == y; - } + public bool AtWorldPoint(int x, int y) => m_Parent == null && m_Location.m_X == x && m_Location.m_Y == y; - public bool AtPoint(int x, int y) - { - return m_Location.m_X == x && m_Location.m_Y == y; - } + public bool AtPoint(int x, int y) => m_Location.m_X == x && m_Location.m_Y == y; - public virtual bool OnDecay() - { - return Decays && Parent == null && Map != Map.Internal && Region.Find(Location, Map).OnDecay(this); - } + public virtual bool OnDecay() => Decays && Parent == null && Map != Map.Internal && Region.Find(Location, Map).OnDecay(this); public void SetLastMoved() { LastMoved = DateTime.UtcNow; } - public virtual bool CanStackWith(Item dropped) - { - return dropped.Stackable && Stackable && dropped.GetType() == GetType() && dropped.ItemID == ItemID && - dropped.Hue == Hue && dropped.Name == Name && dropped.Amount + Amount <= 60000 && dropped != this; - } + public virtual bool CanStackWith(Item dropped) => + dropped.Stackable && Stackable && dropped.GetType() == GetType() && dropped.ItemID == ItemID && + dropped.Hue == Hue && dropped.Name == Name && dropped.Amount + Amount <= 60000 && dropped != this; - public bool StackWith(Mobile from, Item dropped) - { - return StackWith(from, dropped, true); - } + public bool StackWith(Mobile from, Item dropped) => StackWith(from, dropped, true); public virtual bool StackWith(Mobile from, Item dropped, bool playSound) { @@ -2096,15 +2043,9 @@ namespace Server return flags; } - public virtual bool OnMoveOff(Mobile m) - { - return true; - } + public virtual bool OnMoveOff(Mobile m) => true; - public virtual bool OnMoveOver(Mobile m) - { - return true; - } + public virtual bool OnMoveOver(Mobile m) => true; public virtual void OnMovement(Mobile m, Point3D oldLocation) { @@ -2133,10 +2074,7 @@ namespace Server flags |= toSet; } - private static bool GetSaveFlag(SaveFlag flags, SaveFlag toGet) - { - return (flags & toGet) != 0; - } + private static bool GetSaveFlag(SaveFlag flags, SaveFlag toGet) => (flags & toGet) != 0; public IPooledEnumerable GetObjectsInRange(int range) { @@ -2190,10 +2128,7 @@ namespace Server return map.GetClientsInRange(GetWorldLocation(), range); } - public bool GetTempFlag(int flag) - { - return ((LookupCompactInfo()?.m_TempFlags ?? 0) & flag) != 0; - } + public bool GetTempFlag(int flag) => ((LookupCompactInfo()?.m_TempFlags ?? 0) & flag) != 0; public void SetTempFlag(int flag, bool value) { @@ -2208,10 +2143,7 @@ namespace Server VerifyCompactInfo(); } - public bool GetSavedFlag(int flag) - { - return ((LookupCompactInfo()?.m_SavedFlags ?? 0) & flag) != 0; - } + public bool GetSavedFlag(int flag) => ((LookupCompactInfo()?.m_SavedFlags ?? 0) & flag) != 0; public void SetSavedFlag(int flag, bool value) { @@ -2618,15 +2550,9 @@ namespace Server } } - public virtual int GetMaxUpdateRange() - { - return 18; - } + public virtual int GetMaxUpdateRange() => 18; - public virtual int GetUpdateRange(Mobile m) - { - return 18; - } + public virtual int GetUpdateRange(Mobile m) => 18; public void SendInfoTo(NetState state) { @@ -2649,10 +2575,7 @@ namespace Server return WorldPacket; } - public virtual int GetTotal(TotalType type) - { - return 0; - } + public virtual int GetTotal(TotalType type) => 0; public virtual void UpdateTotal(Item sender, TotalType type, int delta) { @@ -2757,12 +2680,10 @@ namespace Server if (_processing) try { - using (StreamWriter op = new StreamWriter("delta-recursion.log", true)) - { - op.WriteLine("# {0}", DateTime.UtcNow); - op.WriteLine(new StackTrace()); - op.WriteLine(); - } + using StreamWriter op = new StreamWriter("delta-recursion.log", true); + op.WriteLine("# {0}", DateTime.UtcNow); + op.WriteLine(new StackTrace()); + op.WriteLine(); } catch { @@ -2786,12 +2707,10 @@ namespace Server if (_processing) try { - using (StreamWriter op = new StreamWriter("delta-recursion.log", true)) - { - op.WriteLine("# {0}", DateTime.UtcNow); - op.WriteLine(new StackTrace()); - op.WriteLine(); - } + using StreamWriter op = new StreamWriter("delta-recursion.log", true); + op.WriteLine("# {0}", DateTime.UtcNow); + op.WriteLine(new StackTrace()); + op.WriteLine(); } catch { @@ -2939,15 +2858,9 @@ namespace Server { } - public virtual bool OnDragLift(Mobile from) - { - return true; - } + public virtual bool OnDragLift(Mobile from) => true; - public virtual bool OnEquip(Mobile from) - { - return true; - } + public virtual bool OnEquip(Mobile from) => true; protected virtual void OnAmountChange(int oldValue) { @@ -2968,13 +2881,11 @@ namespace Server return true; } - public virtual bool DropToMobile(Mobile from, Mobile target, Point3D p) - { - return !(Deleted || from.Deleted || target.Deleted) && from.Map == target.Map && from.Map != null && - target.Map != null && (from.AccessLevel >= AccessLevel.GameMaster || from.InRange(target.Location, 2)) && - from.CanSee(target) && from.InLOS(target) && from.OnDroppedItemToMobile(this, target) && - OnDroppedToMobile(from, target) && target.OnDragDrop(from, this); - } + public virtual bool DropToMobile(Mobile from, Mobile target, Point3D p) => + !(Deleted || from.Deleted || target.Deleted) && from.Map == target.Map && from.Map != null && + target.Map != null && (from.AccessLevel >= AccessLevel.GameMaster || from.InRange(target.Location, 2)) && + from.CanSee(target) && from.InLOS(target) && from.OnDroppedItemToMobile(this, target) && + OnDroppedToMobile(from, target) && target.OnDragDrop(from, this); public virtual bool OnDroppedInto(Mobile from, Container target, Point3D p) { @@ -3045,10 +2956,7 @@ namespace Server return true; } - public virtual int GetLiftSound(Mobile from) - { - return 0x57; - } + public virtual int GetLiftSound(Mobile from) => 0x57; public virtual bool DropToWorld(Mobile from, Point3D p) { @@ -3285,10 +3193,7 @@ namespace Server eable.Free(); } - public virtual int GetDropSound() - { - return -1; - } + public virtual int GetDropSound() => -1; public Point3D GetWorldLocation() { @@ -3312,10 +3217,7 @@ namespace Server return root.Location; } - public Point3D GetWorldTop() - { - return RootParent?.Location ?? new Point3D(m_Location.m_X, m_Location.m_Y, m_Location.m_Z + ItemData.CalcHeight); - } + public Point3D GetWorldTop() => RootParent?.Location ?? new Point3D(m_Location.m_X, m_Location.m_Y, m_Location.m_Z + ItemData.CalcHeight); public void SendLocalizedMessageTo(Mobile to, int number) { @@ -3436,10 +3338,7 @@ namespace Server return true;*/ } - public bool IsChildOf(IEntity o) - { - return IsChildOf(o, false); - } + public bool IsChildOf(IEntity o) => IsChildOf(o, false); public bool IsChildOf(IEntity o, bool allowNull) { @@ -3473,10 +3372,7 @@ namespace Server parentMobile.OnItemUsed(from, item); } - public bool CheckItemUse(Mobile from) - { - return CheckItemUse(from, this); - } + public bool CheckItemUse(Mobile from) => CheckItemUse(from, this); public virtual bool CheckItemUse(Mobile from, Item item) { @@ -3628,10 +3524,7 @@ namespace Server return m != null && m == BlessedFor; } - public virtual bool CheckNewbied() - { - return m_LootType == LootType.Newbied; - } + public virtual bool CheckNewbied() => m_LootType == LootType.Newbied; public virtual bool IsStandardLoot() { @@ -3644,10 +3537,7 @@ namespace Server return m_LootType == LootType.Regular; } - public override string ToString() - { - return $"0x{Serial.Value:X} \"{GetType().Name}\""; - } + public override string ToString() => $"0x{Serial.Value:X} \"{GetType().Name}\""; public virtual void OnSectorActivate() { diff --git a/Projects/Server/ItemBounds.cs b/Projects/Server/ItemBounds.cs index 422220a42..de406fa6a 100644 --- a/Projects/Server/ItemBounds.cs +++ b/Projects/Server/ItemBounds.cs @@ -30,25 +30,25 @@ namespace Server Table = new Rectangle2D[TileData.ItemTable.Length]; if (File.Exists("Data/Binary/Bounds.bin")) - using (FileStream fs = new FileStream("Data/Binary/Bounds.bin", FileMode.Open, FileAccess.Read, - FileShare.Read)) + { + using FileStream fs = new FileStream("Data/Binary/Bounds.bin", FileMode.Open, FileAccess.Read, + FileShare.Read); + BinaryReader bin = new BinaryReader(fs); + + int count = Math.Min(Table.Length, (int)(fs.Length / 8)); + + for (int i = 0; i < count; ++i) { - BinaryReader bin = new BinaryReader(fs); + int xMin = bin.ReadInt16(); + int yMin = bin.ReadInt16(); + int xMax = bin.ReadInt16(); + int yMax = bin.ReadInt16(); - int count = Math.Min(Table.Length, (int)(fs.Length / 8)); - - for (int i = 0; i < count; ++i) - { - int xMin = bin.ReadInt16(); - int yMin = bin.ReadInt16(); - int xMax = bin.ReadInt16(); - int yMax = bin.ReadInt16(); - - Table[i].Set(xMin, yMin, xMax - xMin + 1, yMax - yMin + 1); - } - - bin.Close(); + Table[i].Set(xMin, yMin, xMax - xMin + 1, yMax - yMin + 1); } + + bin.Close(); + } else Console.WriteLine("Warning: Data/Binary/Bounds.bin does not exist"); } diff --git a/Projects/Server/Items/BaseMulti.cs b/Projects/Server/Items/BaseMulti.cs index 98bc6bd24..94a7bfff1 100644 --- a/Projects/Server/Items/BaseMulti.cs +++ b/Projects/Server/Items/BaseMulti.cs @@ -24,10 +24,7 @@ namespace Server.Items { public abstract class BaseMulti : Item { - public BaseMulti(int itemID) : base(itemID) - { - Movable = false; - } + public BaseMulti(int itemID) : base(itemID) => Movable = false; public BaseMulti(Serial serial) : base(serial) { @@ -90,30 +87,15 @@ namespace Server.Items } } - public override int GetMaxUpdateRange() - { - return 22; - } + public override int GetMaxUpdateRange() => 22; - public override int GetUpdateRange(Mobile m) - { - return 22; - } + public override int GetUpdateRange(Mobile m) => 22; - public virtual bool Contains(Point2D p) - { - return Contains(p.m_X, p.m_Y); - } + public virtual bool Contains(Point2D p) => Contains(p.m_X, p.m_Y); - public virtual bool Contains(Point3D p) - { - return Contains(p.m_X, p.m_Y); - } + public virtual bool Contains(Point3D p) => Contains(p.m_X, p.m_Y); - public virtual bool Contains(IPoint3D p) - { - return Contains(p.X, p.Y); - } + public virtual bool Contains(IPoint3D p) => Contains(p.X, p.Y); public virtual bool Contains(int x, int y) { diff --git a/Projects/Server/Items/Container.cs b/Projects/Server/Items/Container.cs index b61228f05..142f848dd 100644 --- a/Projects/Server/Items/Container.cs +++ b/Projects/Server/Items/Container.cs @@ -190,15 +190,9 @@ namespace Server.Items return base.CheckItemUse(from, item); } - public bool CheckHold(Mobile m, Item item, bool message) - { - return CheckHold(m, item, message, true, 0, 0); - } + public bool CheckHold(Mobile m, Item item, bool message) => CheckHold(m, item, message, true, 0, 0); - public bool CheckHold(Mobile m, Item item, bool message, bool checkItems) - { - return CheckHold(m, item, message, checkItems, 0, 0); - } + public bool CheckHold(Mobile m, Item item, bool message, bool checkItems) => CheckHold(m, item, message, checkItems, 0, 0); public virtual bool CheckHold(Mobile m, Item item, bool message, bool checkItems, int plusItems, int plusWeight) { @@ -294,10 +288,7 @@ namespace Server.Items flags |= toSet; } - private static bool GetSaveFlag(SaveFlag flags, SaveFlag toGet) - { - return (flags & toGet) != 0; - } + private static bool GetSaveFlag(SaveFlag flags, SaveFlag toGet) => (flags & toGet) != 0; public override void Serialize(GenericWriter writer) { @@ -454,10 +445,7 @@ namespace Server.Items } } - public virtual bool OnStackAttempt(Mobile from, Item stack, Item dropped) - { - return CheckHold(from, dropped, true, false) && stack.StackWith(from, dropped); - } + public virtual bool OnStackAttempt(Mobile from, Item stack, Item dropped) => CheckHold(from, dropped, true, false) && stack.StackWith(from, dropped); public override bool OnDragDrop(Mobile from, Item dropped) { @@ -471,10 +459,7 @@ namespace Server.Items return false; } - public virtual bool TryDropItem(Mobile from, Item dropped, bool sendFullMessage) - { - return TryDropItem(from, dropped, sendFullMessage, false); - } + public virtual bool TryDropItem(Mobile from, Item dropped, bool sendFullMessage) => TryDropItem(from, dropped, sendFullMessage, false); public virtual bool TryDropItem(Mobile from, Item dropped, bool sendFullMessage, bool playSound) { @@ -622,12 +607,10 @@ namespace Server.Items } } - public virtual bool CheckContentDisplay(Mobile from) - { - return DisplaysContent && RootParent == null || - RootParent is Item || RootParent == from || - from.AccessLevel > AccessLevel.Player; - } + public virtual bool CheckContentDisplay(Mobile from) => + DisplaysContent && RootParent == null || + RootParent is Item || RootParent == from || + from.AccessLevel > AccessLevel.Player; public override void OnSingleClick(Mobile from) { @@ -757,15 +740,9 @@ namespace Server.Items { private CheckItemGroup m_Grouper; - public GroupComparer(CheckItemGroup grouper) - { - m_Grouper = grouper; - } + public GroupComparer(CheckItemGroup grouper) => m_Grouper = grouper; - public int Compare(Item a, Item b) - { - return m_Grouper(a, b); - } + public int Compare(Item a, Item b) => m_Grouper(a, b); } [Flags] @@ -1503,10 +1480,7 @@ namespace Server.Items } } - public Item FindItemByType(Type type, bool recurse = true) - { - return RecurseFindItemByType(this, type, recurse); - } + public Item FindItemByType(Type type, bool recurse = true) => RecurseFindItemByType(this, type, recurse); private static Item RecurseFindItemByType(Item current, Type type, bool recurse) { @@ -1534,10 +1508,7 @@ namespace Server.Items return null; } - public Item FindItemByType(Type[] types, bool recurse = true) - { - return RecurseFindItemByType(this, types, recurse); - } + public Item FindItemByType(Type[] types, bool recurse = true) => RecurseFindItemByType(this, types, recurse); private static Item RecurseFindItemByType(Item current, Type[] types, bool recurse) { @@ -1568,10 +1539,7 @@ namespace Server.Items #region Generic FindItem[s] by Type - public List FindItemsByType(Predicate predicate) where T : Item - { - return FindItemsByType(true, predicate); - } + public List FindItemsByType(Predicate predicate) where T : Item => FindItemsByType(true, predicate); public List FindItemsByType(bool recurse = true, Predicate predicate = null) where T : Item { @@ -1604,10 +1572,7 @@ namespace Server.Items } } - public T FindItemByType(bool recurse = true) where T : Item - { - return RecurseFindItemByType(this, recurse); - } + public T FindItemByType(bool recurse = true) where T : Item => RecurseFindItemByType(this, recurse); private static T RecurseFindItemByType(Item current, bool recurse = true, Predicate predicate = null) where T : Item { diff --git a/Projects/Server/Items/Containers.cs b/Projects/Server/Items/Containers.cs index 5929bc03e..181481652 100644 --- a/Projects/Server/Items/Containers.cs +++ b/Projects/Server/Items/Containers.cs @@ -109,26 +109,15 @@ namespace Server.Items { } - public override DeathMoveResult OnParentDeath(Mobile parent) - { - return DeathMoveResult.RemainEquipped; - } + public override DeathMoveResult OnParentDeath(Mobile parent) => DeathMoveResult.RemainEquipped; - public override bool IsAccessibleTo(Mobile check) - { - return (check == Owner && Opened || check.AccessLevel >= AccessLevel.GameMaster) && base.IsAccessibleTo(check); - } + public override bool IsAccessibleTo(Mobile check) => (check == Owner && Opened || check.AccessLevel >= AccessLevel.GameMaster) && base.IsAccessibleTo(check); - public override bool OnDragDrop(Mobile from, Item dropped) - { - return (from == Owner && Opened || from.AccessLevel >= AccessLevel.GameMaster) && base.OnDragDrop(from, dropped); - } + public override bool OnDragDrop(Mobile from, Item dropped) => (from == Owner && Opened || from.AccessLevel >= AccessLevel.GameMaster) && base.OnDragDrop(from, dropped); - public override bool OnDragDropInto(Mobile from, Item item, Point3D p) - { - return (from == Owner && Opened || from.AccessLevel >= AccessLevel.GameMaster) && - base.OnDragDropInto(from, item, p); - } + public override bool OnDragDropInto(Mobile from, Item item, Point3D p) => + (from == Owner && Opened || from.AccessLevel >= AccessLevel.GameMaster) && + base.OnDragDropInto(from, item, p); public override int GetTotal(TotalType type) { diff --git a/Projects/Server/Items/SecureTradeContainer.cs b/Projects/Server/Items/SecureTradeContainer.cs index aa492ae6b..e759a29a0 100644 --- a/Projects/Server/Items/SecureTradeContainer.cs +++ b/Projects/Server/Items/SecureTradeContainer.cs @@ -53,10 +53,7 @@ namespace Server.Items return false; } - public override bool IsAccessibleTo(Mobile check) - { - return IsChildOf(check) && Trade?.Valid == true && base.IsAccessibleTo(check); - } + public override bool IsAccessibleTo(Mobile check) => IsChildOf(check) && Trade?.Valid == true && base.IsAccessibleTo(check); public override void OnItemAdded(Item item) { @@ -96,12 +93,10 @@ namespace Server.Items Trade.Update(); } - public override bool IsChildVisibleTo(Mobile m, Item child) - { - return child is VirtualCheck + public override bool IsChildVisibleTo(Mobile m, Item child) => + child is VirtualCheck ? AccountGold.Enabled && m.NetState?.NewSecureTrading != true : base.IsChildVisibleTo(m, child); - } public override void Serialize(GenericWriter writer) { diff --git a/Projects/Server/Items/VirtualHair.cs b/Projects/Server/Items/VirtualHair.cs index 315f607bb..db38e9743 100644 --- a/Projects/Server/Items/VirtualHair.cs +++ b/Projects/Server/Items/VirtualHair.cs @@ -77,10 +77,7 @@ namespace Server } // TOOD: Can we make this higher for newer clients? - public static uint FakeSerial(Mobile parent) - { - return 0x7FFFFFFF - 0x400 - parent.Serial * 4; - } + public static uint FakeSerial(Mobile parent) => 0x7FFFFFFF - 0x400 - parent.Serial * 4; } public class FacialHairInfo : BaseHairInfo @@ -101,10 +98,7 @@ namespace Server } // TOOD: Can we make this higher for newer clients? - public static uint FakeSerial(Mobile parent) - { - return 0x7FFFFFFF - 0x400 - 1 - parent.Serial * 4; - } + public static uint FakeSerial(Mobile parent) => 0x7FFFFFFF - 0x400 - 1 - parent.Serial * 4; } public sealed class HairEquipUpdate : Packet diff --git a/Projects/Server/Main.cs b/Projects/Server/Main.cs index d178f016f..7ebdac328 100644 --- a/Projects/Server/Main.cs +++ b/Projects/Server/Main.cs @@ -292,12 +292,7 @@ namespace Server HandleClosed(); } - public static void Kill() - { - Kill(false); - } - - public static void Kill(bool restart) + public static void Kill(bool restart = false) { HandleClosed(); @@ -386,12 +381,7 @@ namespace Server // Added to help future code support on forums, as a 'check' people can ask for to it see if they recompiled core or not Console.WriteLine("ModernUO - [https://github.com/kamronbatman/ModernUO] Version {0}.{1}.{2}.{3}", ver.Major, ver.Minor, ver.Build, ver.Revision); -#if NETCORE Console.WriteLine("Core: Running on {0}", RuntimeInformation.FrameworkDescription); -#else - Console.WriteLine("Core: Running on .NET Framework Version {0}.{1}.{2}", Environment.Version.Major, - Environment.Version.Minor, Environment.Version.Build); -#endif Console.ResetColor(); Console.WriteLine(); @@ -651,44 +641,38 @@ namespace Server public override void Write(char ch) { - using (StreamWriter writer = - new StreamWriter(new FileStream(FileName, FileMode.Append, FileAccess.Write, FileShare.Read))) + using StreamWriter writer = + new StreamWriter(new FileStream(FileName, FileMode.Append, FileAccess.Write, FileShare.Read)); + if (_NewLine) { - if (_NewLine) - { - writer.Write(DateTime.UtcNow.ToString(DateFormat)); - _NewLine = false; - } - - writer.Write(ch); + writer.Write(DateTime.UtcNow.ToString(DateFormat)); + _NewLine = false; } + + writer.Write(ch); } public override void Write(string str) { - using (StreamWriter writer = - new StreamWriter(new FileStream(FileName, FileMode.Append, FileAccess.Write, FileShare.Read))) + using StreamWriter writer = + new StreamWriter(new FileStream(FileName, FileMode.Append, FileAccess.Write, FileShare.Read)); + if (_NewLine) { - if (_NewLine) - { - writer.Write(DateTime.UtcNow.ToString(DateFormat)); - _NewLine = false; - } - - writer.Write(str); + writer.Write(DateTime.UtcNow.ToString(DateFormat)); + _NewLine = false; } + + writer.Write(str); } public override void WriteLine(string line) { - using (StreamWriter writer = - new StreamWriter(new FileStream(FileName, FileMode.Append, FileAccess.Write, FileShare.Read))) - { - if (_NewLine) writer.Write(DateTime.UtcNow.ToString(DateFormat)); + using StreamWriter writer = + new StreamWriter(new FileStream(FileName, FileMode.Append, FileAccess.Write, FileShare.Read)); + if (_NewLine) writer.Write(DateTime.UtcNow.ToString(DateFormat)); - writer.WriteLine(line); - _NewLine = true; - } + writer.WriteLine(line); + _NewLine = true; } } diff --git a/Projects/Server/Map.cs b/Projects/Server/Map.cs index 612253fb5..9f7235197 100644 --- a/Projects/Server/Map.cs +++ b/Projects/Server/Map.cs @@ -75,10 +75,7 @@ namespace Server return s.Clients.Where(o => o?.Mobile?.Deleted == false && bounds.Contains(o.Mobile)); } - public static IEnumerable SelectEntities(Sector s, Rectangle2D bounds) - { - return SelectEntities(s, true, true, bounds); - } + public static IEnumerable SelectEntities(Sector s, Rectangle2D bounds) => SelectEntities(s, true, true, bounds); public static IEnumerable SelectEntities(Sector s, bool items, bool mobiles, Rectangle2D bounds) { @@ -146,40 +143,19 @@ namespace Server } } - public static Map.PooledEnumerable GetClients(Map map, Rectangle2D bounds) - { - return Map.PooledEnumerable.Instantiate(map, bounds, ClientSelector ?? SelectClients); - } + public static Map.PooledEnumerable GetClients(Map map, Rectangle2D bounds) => Map.PooledEnumerable.Instantiate(map, bounds, ClientSelector ?? SelectClients); - public static Map.PooledEnumerable GetEntities(Map map, Rectangle2D bounds, bool items = true, bool mobiles = true) - { - return Map.PooledEnumerable.Instantiate(map, bounds, EntitySelector ?? SelectEntities); - } + public static Map.PooledEnumerable GetEntities(Map map, Rectangle2D bounds, bool items = true, bool mobiles = true) => Map.PooledEnumerable.Instantiate(map, bounds, EntitySelector ?? SelectEntities); - public static Map.PooledEnumerable GetMobiles(Map map, Rectangle2D bounds) - { - return GetMobiles(map, bounds); - } + public static Map.PooledEnumerable GetMobiles(Map map, Rectangle2D bounds) => GetMobiles(map, bounds); - public static Map.PooledEnumerable GetMobiles(Map map, Rectangle2D bounds) where T : Mobile - { - return Map.PooledEnumerable.Instantiate(map, bounds, SelectMobiles); - } + public static Map.PooledEnumerable GetMobiles(Map map, Rectangle2D bounds) where T : Mobile => Map.PooledEnumerable.Instantiate(map, bounds, SelectMobiles); - public static Map.PooledEnumerable GetItems(Map map, Rectangle2D bounds) where T : Item - { - return Map.PooledEnumerable.Instantiate(map, bounds, SelectItems); - } + public static Map.PooledEnumerable GetItems(Map map, Rectangle2D bounds) where T : Item => Map.PooledEnumerable.Instantiate(map, bounds, SelectItems); - public static Map.PooledEnumerable GetMultis(Map map, Rectangle2D bounds) - { - return Map.PooledEnumerable.Instantiate(map, bounds, MultiSelector ?? SelectMultis); - } + public static Map.PooledEnumerable GetMultis(Map map, Rectangle2D bounds) => Map.PooledEnumerable.Instantiate(map, bounds, MultiSelector ?? SelectMultis); - public static Map.PooledEnumerable GetMultiTiles(Map map, Rectangle2D bounds) - { - return Map.PooledEnumerable.Instantiate(map, bounds, MultiTileSelector ?? SelectMultiTiles); - } + public static Map.PooledEnumerable GetMultiTiles(Map map, Rectangle2D bounds) => Map.PooledEnumerable.Instantiate(map, bounds, MultiTileSelector ?? SelectMultiTiles); public static IEnumerable EnumerateSectors(Map map, Rectangle2D bounds) { @@ -391,10 +367,7 @@ namespace Server public static int[] InvalidLandTiles{ get; set; } = { 0x244 }; - public int CompareTo(Map other) - { - return other == null ? -1 : MapID.CompareTo(other.MapID); - } + public int CompareTo(Map other) => other == null ? -1 : MapID.CompareTo(other.MapID); public static string[] GetMapNames() { @@ -420,10 +393,7 @@ namespace Server return index == 127 ? Internal : Maps.FirstOrDefault(m => m?.MapIndex == index); } - public override string ToString() - { - return Name; - } + public override string ToString() => Name; public int GetAverageZ(int x, int y) { @@ -471,10 +441,7 @@ namespace Server return v / 2; } - public IPooledEnumerable GetMultiTilesAt(int x, int y) - { - return PooledEnumeration.GetMultiTiles(this, new Rectangle2D(x, y, 1, 1)); - } + public IPooledEnumerable GetMultiTilesAt(int x, int y) => PooledEnumeration.GetMultiTiles(this, new Rectangle2D(x, y, 1, 1)); private static List AcquireFixItems(Map map, int x, int y) { @@ -832,15 +799,9 @@ namespace Server InternalGetSector(x, y).OnMultiEnter(m); } - public Sector GetMultiMinSector(Point3D loc, MultiComponentList mcl) - { - return GetSector(Bound(new Point2D(loc.m_X + mcl.Min.m_X, loc.m_Y + mcl.Min.m_Y))); - } + public Sector GetMultiMinSector(Point3D loc, MultiComponentList mcl) => GetSector(Bound(new Point2D(loc.m_X + mcl.Min.m_X, loc.m_Y + mcl.Min.m_Y))); - public Sector GetMultiMaxSector(Point3D loc, MultiComponentList mcl) - { - return GetSector(Bound(new Point2D(loc.m_X + mcl.Max.m_X, loc.m_Y + mcl.Max.m_Y))); - } + public Sector GetMultiMaxSector(Point3D loc, MultiComponentList mcl) => GetSector(Bound(new Point2D(loc.m_X + mcl.Max.m_X, loc.m_Y + mcl.Max.m_Y))); public void OnMove(Point3D oldLocation, Mobile m) { @@ -962,20 +923,11 @@ namespace Server private readonly IEnumerable _Empty; - private NullEnumerable() - { - _Empty = Enumerable.Empty(); - } + private NullEnumerable() => _Empty = Enumerable.Empty(); - IEnumerator IEnumerable.GetEnumerator() - { - return _Empty.GetEnumerator(); - } + IEnumerator IEnumerable.GetEnumerator() => _Empty.GetEnumerator(); - public IEnumerator GetEnumerator() - { - return _Empty.GetEnumerator(); - } + public IEnumerator GetEnumerator() => _Empty.GetEnumerator(); public void Free() { @@ -1004,15 +956,9 @@ namespace Server _Pool = null; } - IEnumerator IEnumerable.GetEnumerator() - { - return _Pool.GetEnumerator(); - } + IEnumerator IEnumerable.GetEnumerator() => _Pool.GetEnumerator(); - public IEnumerator GetEnumerator() - { - return _Pool.GetEnumerator(); - } + public IEnumerator GetEnumerator() => _Pool.GetEnumerator(); public void Free() { @@ -1051,102 +997,51 @@ namespace Server #region Get*InRange/Bounds - public IPooledEnumerable GetObjectsInRange(Point3D p) - { - return GetObjectsInRange(p, Core.GlobalMaxUpdateRange); - } + public IPooledEnumerable GetObjectsInRange(Point3D p) => GetObjectsInRange(p, Core.GlobalMaxUpdateRange); - public IPooledEnumerable GetObjectsInRange(Point3D p, int range, bool items = true, bool mobiles = true) - { - return GetObjectsInBounds(new Rectangle2D(p.m_X - range, p.m_Y - range, range * 2 + 1, range * 2 + 1), items, + public IPooledEnumerable GetObjectsInRange(Point3D p, int range, bool items = true, bool mobiles = true) => + GetObjectsInBounds(new Rectangle2D(p.m_X - range, p.m_Y - range, range * 2 + 1, range * 2 + 1), items, mobiles); - } - public IPooledEnumerable GetObjectsInBounds(Rectangle2D bounds, bool items = true, bool mobiles = true) - { - return PooledEnumeration.GetEntities(this, bounds, items, mobiles); - } + public IPooledEnumerable GetObjectsInBounds(Rectangle2D bounds, bool items = true, bool mobiles = true) => PooledEnumeration.GetEntities(this, bounds, items, mobiles); - public IPooledEnumerable GetClientsInRange(Point3D p) - { - return GetClientsInRange(p, Core.GlobalMaxUpdateRange); - } + public IPooledEnumerable GetClientsInRange(Point3D p) => GetClientsInRange(p, Core.GlobalMaxUpdateRange); - public IPooledEnumerable GetClientsInRange(Point3D p, int range) - { - return GetClientsInBounds(new Rectangle2D(p.m_X - range, p.m_Y - range, range * 2 + 1, range * 2 + 1)); - } + public IPooledEnumerable GetClientsInRange(Point3D p, int range) => GetClientsInBounds(new Rectangle2D(p.m_X - range, p.m_Y - range, range * 2 + 1, range * 2 + 1)); - public IPooledEnumerable GetClientsInBounds(Rectangle2D bounds) - { - return PooledEnumeration.GetClients(this, bounds); - } + public IPooledEnumerable GetClientsInBounds(Rectangle2D bounds) => PooledEnumeration.GetClients(this, bounds); - public IPooledEnumerable GetItemsInRange(Point3D p) - { - return GetItemsInRange(p, Core.GlobalMaxUpdateRange); - } + public IPooledEnumerable GetItemsInRange(Point3D p) => GetItemsInRange(p, Core.GlobalMaxUpdateRange); - public IPooledEnumerable GetItemsInRange(Point3D p, int range) - { - return GetItemsInRange(p, range); - } + public IPooledEnumerable GetItemsInRange(Point3D p, int range) => GetItemsInRange(p, range); - public IPooledEnumerable GetItemsInRange(Point3D p, int range) where T : Item - { - return GetItemsInBounds(new Rectangle2D(p.m_X - range, p.m_Y - range, range * 2 + 1, range * 2 + 1)); - } + public IPooledEnumerable GetItemsInRange(Point3D p, int range) where T : Item => GetItemsInBounds(new Rectangle2D(p.m_X - range, p.m_Y - range, range * 2 + 1, range * 2 + 1)); - public IPooledEnumerable GetItemsInBounds(Rectangle2D bounds) - { - return GetItemsInBounds(bounds); - } + public IPooledEnumerable GetItemsInBounds(Rectangle2D bounds) => GetItemsInBounds(bounds); - public IPooledEnumerable GetItemsInBounds(Rectangle2D bounds) where T : Item - { - return PooledEnumeration.GetItems(this, bounds); - } + public IPooledEnumerable GetItemsInBounds(Rectangle2D bounds) where T : Item => PooledEnumeration.GetItems(this, bounds); - public IPooledEnumerable GetMobilesInRange(Point3D p) - { - return GetMobilesInRange(p, Core.GlobalMaxUpdateRange); - } + public IPooledEnumerable GetMobilesInRange(Point3D p) => GetMobilesInRange(p, Core.GlobalMaxUpdateRange); - public IPooledEnumerable GetMobilesInRange(Point3D p, int range) - { - return GetMobilesInRange(p, range); - } + public IPooledEnumerable GetMobilesInRange(Point3D p, int range) => GetMobilesInRange(p, range); - public IPooledEnumerable GetMobilesInRange(Point3D p, int range) where T : Mobile - { - return GetMobilesInBounds(new Rectangle2D(p.m_X - range, p.m_Y - range, range * 2 + 1, range * 2 + 1)); - } + public IPooledEnumerable GetMobilesInRange(Point3D p, int range) where T : Mobile => GetMobilesInBounds(new Rectangle2D(p.m_X - range, p.m_Y - range, range * 2 + 1, range * 2 + 1)); - public IPooledEnumerable GetMobilesInBounds(Rectangle2D bounds) - { - return GetMobilesInBounds(bounds); - } + public IPooledEnumerable GetMobilesInBounds(Rectangle2D bounds) => GetMobilesInBounds(bounds); - public IPooledEnumerable GetMobilesInBounds(Rectangle2D bounds) where T : Mobile - { - return PooledEnumeration.GetMobiles(this, bounds); - } + public IPooledEnumerable GetMobilesInBounds(Rectangle2D bounds) where T : Mobile => PooledEnumeration.GetMobiles(this, bounds); #endregion #region CanFit public bool CanFit(Point3D p, int height, bool checkBlocksFit = false, bool checkMobiles = true, - bool requireSurface = true) - { - return CanFit(p.m_X, p.m_Y, p.m_Z, height, checkBlocksFit, checkMobiles, requireSurface); - } + bool requireSurface = true) => + CanFit(p.m_X, p.m_Y, p.m_Z, height, checkBlocksFit, checkMobiles, requireSurface); public bool CanFit(Point2D p, int z, int height, bool checkBlocksFit = false, bool checkMobiles = true, - bool requireSurface = true) - { - return CanFit(p.m_X, p.m_Y, z, height, checkBlocksFit, checkMobiles, requireSurface); - } + bool requireSurface = true) => + CanFit(p.m_X, p.m_Y, z, height, checkBlocksFit, checkMobiles, requireSurface); public bool CanFit(int x, int y, int z, int height, bool checkBlocksFit = false, bool checkMobiles = true, bool requireSurface = true) @@ -1228,15 +1123,9 @@ namespace Server #region CanSpawnMobile - public bool CanSpawnMobile(Point3D p) - { - return CanSpawnMobile(p.m_X, p.m_Y, p.m_Z); - } + public bool CanSpawnMobile(Point3D p) => CanSpawnMobile(p.m_X, p.m_Y, p.m_Z); - public bool CanSpawnMobile(Point2D p, int z) - { - return CanSpawnMobile(p.m_X, p.m_Y, z); - } + public bool CanSpawnMobile(Point2D p, int z) => CanSpawnMobile(p.m_X, p.m_Y, z); public bool CanSpawnMobile(int x, int y, int z) { @@ -1250,30 +1139,15 @@ namespace Server #region GetSector - public Sector GetSector(Point3D p) - { - return InternalGetSector(p.m_X >> SectorShift, p.m_Y >> SectorShift); - } + public Sector GetSector(Point3D p) => InternalGetSector(p.m_X >> SectorShift, p.m_Y >> SectorShift); - public Sector GetSector(Point2D p) - { - return InternalGetSector(p.m_X >> SectorShift, p.m_Y >> SectorShift); - } + public Sector GetSector(Point2D p) => InternalGetSector(p.m_X >> SectorShift, p.m_Y >> SectorShift); - public Sector GetSector(IPoint2D p) - { - return InternalGetSector(p.X >> SectorShift, p.Y >> SectorShift); - } + public Sector GetSector(IPoint2D p) => InternalGetSector(p.X >> SectorShift, p.Y >> SectorShift); - public Sector GetSector(int x, int y) - { - return InternalGetSector(x >> SectorShift, y >> SectorShift); - } + public Sector GetSector(int x, int y) => InternalGetSector(x >> SectorShift, y >> SectorShift); - public Sector GetRealSector(int x, int y) - { - return InternalGetSector(x, y); - } + public Sector GetRealSector(int x, int y) => InternalGetSector(x, y); private Sector InternalGetSector(int x, int y) { @@ -1507,11 +1381,9 @@ namespace Server return true; } - public bool LineOfSight(object from, object dest) - { - return from == dest || (from as Mobile)?.AccessLevel > AccessLevel.Player || - (dest as Item)?.RootParent == from || LineOfSight(GetPoint(from, true), GetPoint(dest, false)); - } + public bool LineOfSight(object from, object dest) => + from == dest || (from as Mobile)?.AccessLevel > AccessLevel.Player || + (dest as Item)?.RootParent == from || LineOfSight(GetPoint(from, true), GetPoint(dest, false)); public bool LineOfSight(Mobile from, Point3D target) { diff --git a/Projects/Server/MultiData.cs b/Projects/Server/MultiData.cs index 6015f8813..69039a781 100644 --- a/Projects/Server/MultiData.cs +++ b/Projects/Server/MultiData.cs @@ -48,32 +48,32 @@ namespace Server string vdPath = Core.FindDataFile("verdata.mul"); if (File.Exists(vdPath)) - using (FileStream fs = new FileStream(vdPath, FileMode.Open, FileAccess.Read, FileShare.Read)) + { + using FileStream fs = new FileStream(vdPath, FileMode.Open, FileAccess.Read, FileShare.Read); + BinaryReader bin = new BinaryReader(fs); + + int count = bin.ReadInt32(); + + for (int i = 0; i < count; ++i) { - BinaryReader bin = new BinaryReader(fs); + int file = bin.ReadInt32(); + int index = bin.ReadInt32(); + int lookup = bin.ReadInt32(); + int length = bin.ReadInt32(); + int extra = bin.ReadInt32(); - int count = bin.ReadInt32(); - - for (int i = 0; i < count; ++i) + if (file == 14 && index >= 0 && index < m_Components.Length && lookup >= 0 && length > 0) { - int file = bin.ReadInt32(); - int index = bin.ReadInt32(); - int lookup = bin.ReadInt32(); - int length = bin.ReadInt32(); - int extra = bin.ReadInt32(); + bin.BaseStream.Seek(lookup, SeekOrigin.Begin); - if (file == 14 && index >= 0 && index < m_Components.Length && lookup >= 0 && length > 0) - { - bin.BaseStream.Seek(lookup, SeekOrigin.Begin); + m_Components[index] = new MultiComponentList(bin, length / 12); - m_Components[index] = new MultiComponentList(bin, length / 12); - - bin.BaseStream.Seek(24 + i * 20, SeekOrigin.Begin); - } + bin.BaseStream.Seek(24 + i * 20, SeekOrigin.Begin); } - - bin.Close(); } + + bin.Close(); + } } else { diff --git a/Projects/Server/Network/EncodedReader.cs b/Projects/Server/Network/EncodedReader.cs index cbca5ea66..8fb8d6ead 100644 --- a/Projects/Server/Network/EncodedReader.cs +++ b/Projects/Server/Network/EncodedReader.cs @@ -24,10 +24,7 @@ namespace Server.Network { private PacketReader m_Reader; - public EncodedReader(PacketReader reader) - { - m_Reader = reader; - } + public EncodedReader(PacketReader reader) => m_Reader = reader; public void Trace(NetState state) { diff --git a/Projects/Server/Network/NetState.cs b/Projects/Server/Network/NetState.cs index 51f4cbf8f..e1aa25b06 100644 --- a/Projects/Server/Network/NetState.cs +++ b/Projects/Server/Network/NetState.cs @@ -86,10 +86,7 @@ namespace Server.Network public class AsyncState { public bool Paused { get; set; } - public AsyncState(bool paused) - { - Paused = paused; - } + public AsyncState(bool paused) => Paused = paused; } public class NetState : IComparable @@ -402,10 +399,7 @@ namespace Server.Network public IAccount Account { get; set; } - public override string ToString() - { - return m_ToString; - } + public override string ToString() => m_ToString; public static List Instances { get; } = new List(); @@ -595,11 +589,9 @@ namespace Server.Network pr.Complete(); } - public PacketHandler GetHandler(int packetID) - { - return ContainerGridLines ? PacketHandlers.Get6017Handler(packetID) : + public PacketHandler GetHandler(int packetID) => + ContainerGridLines ? PacketHandlers.Get6017Handler(packetID) : PacketHandlers.GetHandler(packetID); - } private long m_NextCheckActivity; @@ -619,15 +611,13 @@ namespace Server.Network try { - using (StreamWriter op = new StreamWriter("network-errors.log", true)) - { - op.WriteLine("# {0}", DateTime.UtcNow); + using StreamWriter op = new StreamWriter("network-errors.log", true); + op.WriteLine("# {0}", DateTime.UtcNow); - op.WriteLine(ex); + op.WriteLine(ex); - op.WriteLine(); - op.WriteLine(); - } + op.WriteLine(); + op.WriteLine(); } catch { @@ -639,7 +629,9 @@ namespace Server.Network private int m_Disposing; - public bool IsDisposing { get { return m_Disposing != 0; } private set { m_Disposing = value ? 1 : 0; } } + public bool IsDisposing { get => m_Disposing != 0; + private set => m_Disposing = value ? 1 : 0; + } public virtual void Dispose() { @@ -751,14 +743,8 @@ namespace Server.Network return info.RequiredClient != null ? Version >= info.RequiredClient : (Flags & info.ClientFlags) != 0; } - public bool SupportsExpansion(Expansion ex, bool checkCoreExpansion = true) - { - return SupportsExpansion(ExpansionInfo.GetInfo(ex), checkCoreExpansion); - } + public bool SupportsExpansion(Expansion ex, bool checkCoreExpansion = true) => SupportsExpansion(ExpansionInfo.GetInfo(ex), checkCoreExpansion); - public int CompareTo(NetState other) - { - return other == null ? 1 : m_ToString.CompareTo(other.m_ToString); - } + public int CompareTo(NetState other) => other == null ? 1 : m_ToString.CompareTo(other.m_ToString); } } diff --git a/Projects/Server/Network/Packet.cs b/Projects/Server/Network/Packet.cs index fab9f6d6b..8cb7bfd43 100644 --- a/Projects/Server/Network/Packet.cs +++ b/Projects/Server/Network/Packet.cs @@ -156,11 +156,9 @@ namespace Server.Network try { - using (StreamWriter op = new StreamWriter("net_opt.log", true)) - { - op.WriteLine("Redundant compile for packet {0}, use Acquire() and Release()", GetType()); - op.WriteLine(new StackTrace()); - } + using StreamWriter op = new StreamWriter("net_opt.log", true); + op.WriteLine("Redundant compile for packet {0}, use Acquire() and Release()", GetType()); + op.WriteLine(new StackTrace()); } catch { @@ -215,12 +213,10 @@ namespace Server.Network { Console.WriteLine("Warning: Compression buffer overflowed on packet 0x{0:X2} ('{1}') (length={2})", PacketID, GetType().Name, length); - using (StreamWriter op = new StreamWriter("compression_overflow.log", true)) - { - op.WriteLine("{0} Warning: Compression buffer overflowed on packet 0x{1:X2} ('{2}') (length={3})", - DateTime.UtcNow, PacketID, GetType().Name, length); - op.WriteLine(new StackTrace()); - } + using StreamWriter op = new StreamWriter("compression_overflow.log", true); + op.WriteLine("{0} Warning: Compression buffer overflowed on packet 0x{1:X2} ('{2}') (length={3})", + DateTime.UtcNow, PacketID, GetType().Name, length); + op.WriteLine(new StackTrace()); } else { diff --git a/Projects/Server/Network/PacketHandlers.cs b/Projects/Server/Network/PacketHandlers.cs index b7acefa3e..69d42a961 100644 --- a/Projects/Server/Network/PacketHandlers.cs +++ b/Projects/Server/Network/PacketHandlers.cs @@ -228,20 +228,14 @@ namespace Server.Network m_6017Handlers[packetID] = new PacketHandler(packetID, length, ingame, onReceive); } - public static PacketHandler GetHandler(int packetID) - { - return Handlers[packetID]; - } + public static PacketHandler GetHandler(int packetID) => Handlers[packetID]; public static void Register6017(int packetID, int length, bool ingame, OnPacketReceive onReceive) { m_6017Handlers[packetID] = new PacketHandler(packetID, length, ingame, onReceive); } - public static PacketHandler Get6017Handler(int packetID) - { - return m_6017Handlers[packetID]; - } + public static PacketHandler Get6017Handler(int packetID) => m_6017Handlers[packetID]; public static void RegisterExtended(int packetID, bool ingame, OnPacketReceive onReceive) { diff --git a/Projects/Server/Network/PacketReader.cs b/Projects/Server/Network/PacketReader.cs index d5facc4ef..4be643ca8 100644 --- a/Projects/Server/Network/PacketReader.cs +++ b/Projects/Server/Network/PacketReader.cs @@ -35,10 +35,7 @@ namespace Server.Network public long Consumed => m_Reader.Consumed; public long Remaining => m_Reader.Remaining; - public PacketReader(ReadOnlySequence seq) - { - m_Reader = new SequenceReader(seq); - } + public PacketReader(ReadOnlySequence seq) => m_Reader = new SequenceReader(seq); public byte Peek() => m_Reader.TryPeek(out byte value) ? value : (byte)0; @@ -46,21 +43,19 @@ namespace Server.Network { try { - using (StreamWriter sw = new StreamWriter("Packets.log", true)) + using StreamWriter sw = new StreamWriter("Packets.log", true); + byte[] buffer = m_Reader.Sequence.ToArray(); + + if (buffer.Length > 0) + sw.WriteLine("Client: {0}: Unhandled packet 0x{1:X2}", state, buffer[0]); + + using (MemoryStream ms = new MemoryStream(buffer)) { - byte[] buffer = m_Reader.Sequence.ToArray(); - - if (buffer.Length > 0) - sw.WriteLine("Client: {0}: Unhandled packet 0x{1:X2}", state, buffer[0]); - - using (MemoryStream ms = new MemoryStream(buffer)) - { - Utility.FormatBuffer(sw, ms, buffer.Length); - } - - sw.WriteLine(); - sw.WriteLine(); + Utility.FormatBuffer(sw, ms, buffer.Length); } + + sw.WriteLine(); + sw.WriteLine(); } catch { @@ -181,10 +176,7 @@ namespace Server.Network return sb.ToString(); } - public bool IsSafeChar(int c) - { - return c >= 0x20 && c < 0xFFFE; - } + public bool IsSafeChar(int c) => c >= 0x20 && c < 0xFFFE; public string ReadUTF8StringSafe(int fixedLength) { @@ -229,13 +221,11 @@ namespace Server.Network return sb.ToString(); } - public string ReadUTF8String() - { - return Utility.UTF8.GetString( + public string ReadUTF8String() => + Utility.UTF8.GetString( m_Reader.TryReadTo(out ReadOnlySpan span, (byte)'\0', true) ? span : - m_Reader.Sequence.Slice(m_Reader.Position, m_Reader.Remaining).ToArray() + m_Reader.Sequence.Slice(m_Reader.Position, m_Reader.Remaining).ToArray() ); - } public string ReadString() { diff --git a/Projects/Server/Network/Packets.cs b/Projects/Server/Network/Packets.cs index ed6be7279..8c9281e07 100644 --- a/Projects/Server/Network/Packets.cs +++ b/Projects/Server/Network/Packets.cs @@ -665,10 +665,7 @@ namespace Server.Network m_Stream.Write((byte)(dead ? 0 : 2)); } - public static Packet Instantiate(bool dead) - { - return dead ? Dead : Alive; - } + public static Packet Instantiate(bool dead) => dead ? Dead : Alive; } public sealed class SpeedControl : Packet @@ -1988,10 +1985,7 @@ namespace Server.Network //m_Stream.Fill(); } - public static Packet Instantiate(bool mode) - { - return mode ? InWarMode : InPeaceMode; - } + public static Packet Instantiate(bool mode) => mode ? InWarMode : InPeaceMode; } public sealed class Swing : Packet @@ -2352,10 +2346,7 @@ namespace Server.Network private int m_StringCount; private PacketWriter m_Strings; - static DisplayGumpPacked() - { - m_Buffer[0] = (byte)' '; - } + static DisplayGumpPacked() => m_Buffer[0] = (byte)' '; public DisplayGumpPacked(Gump gump) : base(0xDD) @@ -2737,10 +2728,7 @@ namespace Server.Network m_Stream.Write(playSound); } - public static SeasonChange Instantiate(int season) - { - return Instantiate(season, true); - } + public static SeasonChange Instantiate(int season) => Instantiate(season, true); public static SeasonChange Instantiate(int season, bool playSound) { @@ -2790,10 +2778,7 @@ namespace Server.Network public static FeatureFlags Value{ get; set; } - public static SupportedFeatures Instantiate(NetState ns) - { - return new SupportedFeatures(ns); - } + public static SupportedFeatures Instantiate(NetState ns) => new SupportedFeatures(ns); } public static class AttributeNormalizer diff --git a/Projects/Server/Network/SendQueue.cs b/Projects/Server/Network/SendQueue.cs index 2b0364e0e..41d28b70e 100644 --- a/Projects/Server/Network/SendQueue.cs +++ b/Projects/Server/Network/SendQueue.cs @@ -43,9 +43,6 @@ namespace Server.Network return taskCompletion.Task; } - public T Dequeue() - { - return m_Queue.Take(); - } + public T Dequeue() => m_Queue.Take(); } } diff --git a/Projects/Server/Network/SocketExtensions.cs b/Projects/Server/Network/SocketExtensions.cs index 4eaf373d6..e03a79243 100644 --- a/Projects/Server/Network/SocketExtensions.cs +++ b/Projects/Server/Network/SocketExtensions.cs @@ -28,15 +28,9 @@ namespace Server.Network { public static class SocketExtensions { - public static Task ReceiveAsync(this Socket socket, Memory memory, SocketFlags socketFlags) - { - return SocketTaskExtensions.ReceiveAsync(socket, GetArray(memory), socketFlags); - } + public static Task ReceiveAsync(this Socket socket, Memory memory, SocketFlags socketFlags) => SocketTaskExtensions.ReceiveAsync(socket, GetArray(memory), socketFlags); - public static ArraySegment GetArray(this Memory memory) - { - return ((ReadOnlyMemory)memory).GetArray(); - } + public static ArraySegment GetArray(this Memory memory) => ((ReadOnlyMemory)memory).GetArray(); public static ArraySegment GetArray(this ReadOnlyMemory memory) { diff --git a/Projects/Server/Notoriety.cs b/Projects/Server/Notoriety.cs index 33ece5b9f..60dd4e3b6 100644 --- a/Projects/Server/Notoriety.cs +++ b/Projects/Server/Notoriety.cs @@ -54,9 +54,6 @@ namespace Server return Hues[noto]; } - public static int Compute(Mobile source, Mobile target) - { - return Handler?.Invoke(source, target) ?? CanBeAttacked; - } + public static int Compute(Mobile source, Mobile target) => Handler?.Invoke(source, target) ?? CanBeAttacked; } } \ No newline at end of file diff --git a/Projects/Server/ObjectPropertyList.cs b/Projects/Server/ObjectPropertyList.cs index b56e1c1da..fe46fb5b4 100644 --- a/Projects/Server/ObjectPropertyList.cs +++ b/Projects/Server/ObjectPropertyList.cs @@ -151,10 +151,7 @@ namespace Server Add(number, string.Format(format, args)); } - private int GetStringNumber() - { - return m_StringNumbers[m_Strings++ % m_StringNumbers.Length]; - } + private int GetStringNumber() => m_StringNumbers[m_Strings++ % m_StringNumbers.Length]; public void Add(string text) { diff --git a/Projects/Server/Persistence/BinaryMemoryWriter.cs b/Projects/Server/Persistence/BinaryMemoryWriter.cs index 27a82ab92..266cc76cf 100644 --- a/Projects/Server/Persistence/BinaryMemoryWriter.cs +++ b/Projects/Server/Persistence/BinaryMemoryWriter.cs @@ -28,10 +28,8 @@ namespace Server private MemoryStream stream; public BinaryMemoryWriter() - : base(new MemoryStream(512), true) - { + : base(new MemoryStream(512), true) => stream = UnderlyingStream as MemoryStream; - } protected override int BufferSize => 512; diff --git a/Projects/Server/Persistence/FileOperations.cs b/Projects/Server/Persistence/FileOperations.cs index 774d91503..3939c9e48 100644 --- a/Projects/Server/Persistence/FileOperations.cs +++ b/Projects/Server/Persistence/FileOperations.cs @@ -52,7 +52,7 @@ namespace Server options |= FileOptions.Asynchronous; #if MONO - return new FileStream( path, mode, access, share, BufferSize, options ); + return new FileStream( path, mode, access, share, BufferSize, options ); #else if (Unbuffered) options |= NoBuffering; @@ -74,10 +74,8 @@ namespace Server private SafeFileHandle fileHandle; public UnbufferedFileStream(SafeFileHandle fileHandle, FileAccess access, int bufferSize, bool isAsync) - : base(fileHandle, access, bufferSize, isAsync) - { + : base(fileHandle, access, bufferSize, isAsync) => this.fileHandle = fileHandle; - } public override void Write(byte[] array, int offset, int count) { @@ -85,10 +83,8 @@ namespace Server } public override IAsyncResult BeginWrite(byte[] array, int offset, int numBytes, AsyncCallback userCallback, - object stateObject) - { - return base.BeginWrite(array, offset, BufferSize, userCallback, stateObject); - } + object stateObject) => + base.BeginWrite(array, offset, BufferSize, userCallback, stateObject); protected override void Dispose(bool disposing) { diff --git a/Projects/Server/Persistence/FileQueue.cs b/Projects/Server/Persistence/FileQueue.cs index 52e670cf4..082c11ded 100644 --- a/Projects/Server/Persistence/FileQueue.cs +++ b/Projects/Server/Persistence/FileQueue.cs @@ -43,10 +43,7 @@ namespace Server private object syncRoot; - static FileQueue() - { - bufferSize = FileOperations.BufferSize; - } + static FileQueue() => bufferSize = FileOperations.BufferSize; public FileQueue(int concurrentWrites, FileCommitCallback callback) { diff --git a/Projects/Server/Persistence/ParallelSaveStrategy.cs b/Projects/Server/Persistence/ParallelSaveStrategy.cs index 0e47fd454..80614bc3c 100644 --- a/Projects/Server/Persistence/ParallelSaveStrategy.cs +++ b/Projects/Server/Persistence/ParallelSaveStrategy.cs @@ -51,10 +51,7 @@ namespace Server public override string Name => "Parallel"; - private int GetThreadCount() - { - return processorCount - 1; - } + private int GetThreadCount() => processorCount - 1; public override void Save(bool permitBackgroundWrite) { @@ -249,10 +246,7 @@ namespace Server foreach (BaseGuild guild in guilds) yield return guild; } - IEnumerator IEnumerable.GetEnumerator() - { - throw new NotImplementedException(); - } + IEnumerator IEnumerable.GetEnumerator() => throw new NotImplementedException(); } private struct ConsumableEntry diff --git a/Projects/Server/Persistence/Persistence.cs b/Projects/Server/Persistence/Persistence.cs index 921206a71..61c3dc9c7 100644 --- a/Projects/Server/Persistence/Persistence.cs +++ b/Projects/Server/Persistence/Persistence.cs @@ -25,19 +25,17 @@ namespace Server file.Refresh(); - using (FileStream fs = file.OpenWrite()) - { - BinaryFileWriter writer = new BinaryFileWriter(fs, true); + using FileStream fs = file.OpenWrite(); + BinaryFileWriter writer = new BinaryFileWriter(fs, true); - try - { - serializer(writer); - } - finally - { - writer.Flush(); - writer.Close(); - } + try + { + serializer(writer); + } + finally + { + writer.Flush(); + writer.Close(); } } @@ -81,26 +79,24 @@ namespace Server file.Refresh(); - using (FileStream fs = file.OpenRead()) - { - BinaryFileReader reader = new BinaryFileReader(new BinaryReader(fs)); + using FileStream fs = file.OpenRead(); + BinaryFileReader reader = new BinaryFileReader(new BinaryReader(fs)); - try - { - deserializer(reader); - } - catch (EndOfStreamException eos) - { - if (file.Length > 0) Console.WriteLine("[Persistence]: {0}", eos); - } - catch (Exception e) - { - Console.WriteLine("[Persistence]: {0}", e); - } - finally - { - reader.Close(); - } + try + { + deserializer(reader); + } + catch (EndOfStreamException eos) + { + if (file.Length > 0) Console.WriteLine("[Persistence]: {0}", eos); + } + catch (Exception e) + { + Console.WriteLine("[Persistence]: {0}", e); + } + finally + { + reader.Close(); } } } diff --git a/Projects/Server/Persistence/QueuedMemoryWriter.cs b/Projects/Server/Persistence/QueuedMemoryWriter.cs index ede3556a2..1bcd67982 100644 --- a/Projects/Server/Persistence/QueuedMemoryWriter.cs +++ b/Projects/Server/Persistence/QueuedMemoryWriter.cs @@ -29,10 +29,8 @@ namespace Server private List _orderedIndexInfo = new List(); public QueuedMemoryWriter() - : base(new MemoryStream(1024 * 1024), true) - { + : base(new MemoryStream(1024 * 1024), true) => _memStream = UnderlyingStream as MemoryStream; - } protected override int BufferSize => 512; diff --git a/Projects/Server/Persistence/SequentialFileWriter.cs b/Projects/Server/Persistence/SequentialFileWriter.cs index 24af4c618..9b1d327b6 100644 --- a/Projects/Server/Persistence/SequentialFileWriter.cs +++ b/Projects/Server/Persistence/SequentialFileWriter.cs @@ -108,15 +108,9 @@ namespace Server base.Dispose(disposing); } - public override int Read(byte[] buffer, int offset, int count) - { - throw new InvalidOperationException(); - } + public override int Read(byte[] buffer, int offset, int count) => throw new InvalidOperationException(); - public override long Seek(long offset, SeekOrigin origin) - { - throw new InvalidOperationException(); - } + public override long Seek(long offset, SeekOrigin origin) => throw new InvalidOperationException(); public override void SetLength(long value) { diff --git a/Projects/Server/Persistence/StandardSaveStrategy.cs b/Projects/Server/Persistence/StandardSaveStrategy.cs index 14df9b994..8b32c1cd0 100644 --- a/Projects/Server/Persistence/StandardSaveStrategy.cs +++ b/Projects/Server/Persistence/StandardSaveStrategy.cs @@ -36,10 +36,7 @@ namespace Server private Queue _decayQueue; - public StandardSaveStrategy() - { - _decayQueue = new Queue(); - } + public StandardSaveStrategy() => _decayQueue = new Queue(); public override string Name => "Standard"; diff --git a/Projects/Server/Poison.cs b/Projects/Server/Poison.cs index 558be8eac..4fa3c4142 100644 --- a/Projects/Server/Poison.cs +++ b/Projects/Server/Poison.cs @@ -42,10 +42,7 @@ namespace Server public abstract Timer ConstructTimer(Mobile m); /*public abstract void OnDamage( Mobile m, ref object state );*/ - public override string ToString() - { - return Name; - } + public override string ToString() => Name; public static void Register(Poison reg) @@ -63,10 +60,7 @@ namespace Server Poisons.Add(reg); } - public static Poison Parse(string value) - { - return (int.TryParse(value, out int plevel) ? GetPoison(plevel) : null) ?? GetPoison(value); - } + public static Poison Parse(string value) => (int.TryParse(value, out int plevel) ? GetPoison(plevel) : null) ?? GetPoison(value); public static Poison GetPoison(int level) { diff --git a/Projects/Server/Race.cs b/Projects/Server/Race.cs index 724bf1084..1495b067c 100644 --- a/Projects/Server/Race.cs +++ b/Projects/Server/Race.cs @@ -118,36 +118,21 @@ namespace Server } } - public override string ToString() - { - return Name; - } + public override string ToString() => Name; - public virtual bool ValidateHair(Mobile m, int itemID) - { - return ValidateHair(m.Female, itemID); - } + public virtual bool ValidateHair(Mobile m, int itemID) => ValidateHair(m.Female, itemID); public abstract bool ValidateHair(bool female, int itemID); - public virtual int RandomHair(Mobile m) - { - return RandomHair(m.Female); - } + public virtual int RandomHair(Mobile m) => RandomHair(m.Female); public abstract int RandomHair(bool female); - public virtual bool ValidateFacialHair(Mobile m, int itemID) - { - return ValidateFacialHair(m.Female, itemID); - } + public virtual bool ValidateFacialHair(Mobile m, int itemID) => ValidateFacialHair(m.Female, itemID); public abstract bool ValidateFacialHair(bool female, int itemID); - public virtual int RandomFacialHair(Mobile m) - { - return RandomFacialHair(m.Female); - } + public virtual int RandomFacialHair(Mobile m) => RandomFacialHair(m.Female); public abstract int RandomFacialHair(bool female); //For the *ahem* bearded ladies @@ -157,29 +142,14 @@ namespace Server public abstract int ClipHairHue(int hue); public abstract int RandomHairHue(); - public virtual int Body(Mobile m) - { - return m.Alive ? AliveBody(m.Female) : GhostBody(m.Female); - } + public virtual int Body(Mobile m) => m.Alive ? AliveBody(m.Female) : GhostBody(m.Female); - public virtual int AliveBody(Mobile m) - { - return AliveBody(m.Female); - } + public virtual int AliveBody(Mobile m) => AliveBody(m.Female); - public virtual int AliveBody(bool female) - { - return female ? FemaleBody : MaleBody; - } + public virtual int AliveBody(bool female) => female ? FemaleBody : MaleBody; - public virtual int GhostBody(Mobile m) - { - return GhostBody(m.Female); - } + public virtual int GhostBody(Mobile m) => GhostBody(m.Female); - public virtual int GhostBody(bool female) - { - return female ? FemaleGhostBody : MaleGhostBody; - } + public virtual int GhostBody(bool female) => female ? FemaleGhostBody : MaleGhostBody; } } diff --git a/Projects/Server/Region.cs b/Projects/Server/Region.cs index 63fb77949..572d4750a 100644 --- a/Projects/Server/Region.cs +++ b/Projects/Server/Region.cs @@ -117,10 +117,7 @@ namespace Server { } - public Region(string name, Map map, int priority, params Rectangle3D[] area) : this(name, map, null, area) - { - m_Priority = priority; - } + public Region(string name, Map map, int priority, params Rectangle3D[] area) : this(name, map, null, area) => m_Priority = priority; public Region(string name, Map map, Region parent, params Rectangle2D[] area) : this(name, map, parent, ConvertTo3D(area)) @@ -293,10 +290,7 @@ namespace Server return map.DefaultRegion; } - public static Rectangle3D ConvertTo3D(Rectangle2D rect) - { - return new Rectangle3D(new Point3D(rect.Start, MinZ), new Point3D(rect.End, MaxZ)); - } + public static Rectangle3D ConvertTo3D(Rectangle2D rect) => new Rectangle3D(new Point3D(rect.Start, MinZ), new Point3D(rect.End, MaxZ)); public static Rectangle3D[] ConvertTo3D(Rectangle2D[] rects) { @@ -466,25 +460,13 @@ namespace Server return null; } - public bool IsPartOf() where T : Region - { - return GetRegion() != null; - } + public bool IsPartOf() where T : Region => GetRegion() != null; - public bool IsPartOf(Region region) - { - return this == region || IsChildOf(region); - } + public bool IsPartOf(Region region) => this == region || IsChildOf(region); - public bool IsPartOf(string regionName) - { - return GetRegion(regionName) != null; - } + public bool IsPartOf(string regionName) => GetRegion(regionName) != null; - public virtual bool AcceptsSpawnsFrom(Region region) - { - return AllowSpawn() && (region == this || Parent?.AcceptsSpawnsFrom(region) == true); - } + public virtual bool AcceptsSpawnsFrom(Region region) => AllowSpawn() && (region == this || Parent?.AcceptsSpawnsFrom(region) == true); public List GetPlayers() { @@ -548,10 +530,7 @@ namespace Server return count; } - public override string ToString() - { - return m_Name ?? GetType().Name; - } + public override string ToString() => m_Name ?? GetType().Name; public virtual void OnRegister() @@ -570,10 +549,7 @@ namespace Server { } - public virtual bool OnMoveInto(Mobile m, Direction d, Point3D newLocation, Point3D oldLocation) - { - return m.WalkRegion == null || AcceptsSpawnsFrom(m.WalkRegion); - } + public virtual bool OnMoveInto(Mobile m, Direction d, Point3D newLocation, Point3D oldLocation) => m.WalkRegion == null || AcceptsSpawnsFrom(m.WalkRegion); public virtual void OnEnter(Mobile m) { @@ -588,15 +564,9 @@ namespace Server Parent?.MakeGuard(focus); } - public virtual Type GetResource(Type type) - { - return Parent?.GetResource(type) ?? type; - } + public virtual Type GetResource(Type type) => Parent?.GetResource(type) ?? type; - public virtual bool CanUseStuckMenu(Mobile m) - { - return Parent?.CanUseStuckMenu(m) != false; - } + public virtual bool CanUseStuckMenu(Mobile m) => Parent?.CanUseStuckMenu(m) != false; public virtual void OnAggressed(Mobile aggressor, Mobile aggressed, bool criminal) { @@ -618,40 +588,19 @@ namespace Server Parent?.OnLocationChanged(m, oldLocation); } - public virtual bool OnTarget(Mobile m, Target t, object o) - { - return Parent?.OnTarget(m, t, o) != false; - } + public virtual bool OnTarget(Mobile m, Target t, object o) => Parent?.OnTarget(m, t, o) != false; - public virtual bool OnCombatantChange(Mobile m, Mobile Old, Mobile New) - { - return Parent?.OnCombatantChange(m, Old, New) != false; - } + public virtual bool OnCombatantChange(Mobile m, Mobile Old, Mobile New) => Parent?.OnCombatantChange(m, Old, New) != false; - public virtual bool AllowHousing(Mobile from, Point3D p) - { - return Parent?.AllowHousing(from, p) != false; - } + public virtual bool AllowHousing(Mobile from, Point3D p) => Parent?.AllowHousing(from, p) != false; - public virtual bool SendInaccessibleMessage(Item item, Mobile from) - { - return Parent?.SendInaccessibleMessage(item, from) == true; - } + public virtual bool SendInaccessibleMessage(Item item, Mobile from) => Parent?.SendInaccessibleMessage(item, from) == true; - public virtual bool CheckAccessibility(Item item, Mobile from) - { - return Parent?.CheckAccessibility(item, from) != false; - } + public virtual bool CheckAccessibility(Item item, Mobile from) => Parent?.CheckAccessibility(item, from) != false; - public virtual bool OnDecay(Item item) - { - return Parent?.OnDecay(item) != false; - } + public virtual bool OnDecay(Item item) => Parent?.OnDecay(item) != false; - public virtual bool AllowHarmful(Mobile from, Mobile target) - { - return Parent?.AllowHarmful(from, target) ?? Mobile.AllowHarmfulHandler?.Invoke(from, target) ?? true; - } + public virtual bool AllowHarmful(Mobile from, Mobile target) => Parent?.AllowHarmful(from, target) ?? Mobile.AllowHarmfulHandler?.Invoke(from, target) ?? true; public virtual void OnCriminalAction(Mobile m, bool message) { @@ -661,11 +610,9 @@ namespace Server m.SendLocalizedMessage(1005040); // You've committed a criminal act!! } - public virtual bool AllowBeneficial(Mobile from, Mobile target) - { - return Parent?.AllowBeneficial(from, target) ?? - Mobile.AllowBeneficialHandler?.Invoke(from, target) ?? true; - } + public virtual bool AllowBeneficial(Mobile from, Mobile target) => + Parent?.AllowBeneficial(from, target) ?? + Mobile.AllowBeneficialHandler?.Invoke(from, target) ?? true; public virtual void OnBeneficialAction(Mobile helper, Mobile target) { @@ -687,60 +634,33 @@ namespace Server Parent?.OnSpeech(args); } - public virtual bool OnSkillUse(Mobile m, int Skill) - { - return Parent?.OnSkillUse(m, Skill) != false; - } + public virtual bool OnSkillUse(Mobile m, int Skill) => Parent?.OnSkillUse(m, Skill) != false; - public virtual bool OnBeginSpellCast(Mobile m, ISpell s) - { - return Parent?.OnBeginSpellCast(m, s) != false; - } + public virtual bool OnBeginSpellCast(Mobile m, ISpell s) => Parent?.OnBeginSpellCast(m, s) != false; public virtual void OnSpellCast(Mobile m, ISpell s) { Parent?.OnSpellCast(m, s); } - public virtual bool OnResurrect(Mobile m) - { - return Parent?.OnResurrect(m) != false; - } + public virtual bool OnResurrect(Mobile m) => Parent?.OnResurrect(m) != false; - public virtual bool OnBeforeDeath(Mobile m) - { - return Parent?.OnBeforeDeath(m) != false; - } + public virtual bool OnBeforeDeath(Mobile m) => Parent?.OnBeforeDeath(m) != false; public virtual void OnDeath(Mobile m) { Parent?.OnDeath(m); } - public virtual bool OnDamage(Mobile m, ref int Damage) - { - return Parent?.OnDamage(m, ref Damage) != false; - } + public virtual bool OnDamage(Mobile m, ref int Damage) => Parent?.OnDamage(m, ref Damage) != false; - public virtual bool OnHeal(Mobile m, ref int Heal) - { - return Parent?.OnHeal(m, ref Heal) != false; - } + public virtual bool OnHeal(Mobile m, ref int Heal) => Parent?.OnHeal(m, ref Heal) != false; - public virtual bool OnDoubleClick(Mobile m, object o) - { - return Parent?.OnDoubleClick(m, o) != false; - } + public virtual bool OnDoubleClick(Mobile m, object o) => Parent?.OnDoubleClick(m, o) != false; - public virtual bool OnSingleClick(Mobile m, object o) - { - return Parent?.OnSingleClick(m, o) != false; - } + public virtual bool OnSingleClick(Mobile m, object o) => Parent?.OnSingleClick(m, o) != false; - public virtual bool AllowSpawn() - { - return Parent?.AllowSpawn() != false; - } + public virtual bool AllowSpawn() => Parent?.AllowSpawn() != false; public virtual void AlterLightLevel(Mobile m, ref int global, ref int personal) { @@ -891,10 +811,7 @@ namespace Server return null; } - public static bool ReadString(XmlElement xml, string attribute, ref string value) - { - return ReadString(xml, attribute, ref value, true); - } + public static bool ReadString(XmlElement xml, string attribute, ref string value) => ReadString(xml, attribute, ref value, true); public static bool ReadString(XmlElement xml, string attribute, ref string value, bool mandatory) { @@ -907,10 +824,7 @@ namespace Server return true; } - public static bool ReadInt32(XmlElement xml, string attribute, ref int value) - { - return ReadInt32(xml, attribute, ref value, true); - } + public static bool ReadInt32(XmlElement xml, string attribute, ref int value) => ReadInt32(xml, attribute, ref value, true); public static bool ReadInt32(XmlElement xml, string attribute, ref int value, bool mandatory) { @@ -932,10 +846,7 @@ namespace Server return true; } - public static bool ReadBoolean(XmlElement xml, string attribute, ref bool value) - { - return ReadBoolean(xml, attribute, ref value, true); - } + public static bool ReadBoolean(XmlElement xml, string attribute, ref bool value) => ReadBoolean(xml, attribute, ref value, true); public static bool ReadBoolean(XmlElement xml, string attribute, ref bool value, bool mandatory) { @@ -957,10 +868,7 @@ namespace Server return true; } - public static bool ReadDateTime(XmlElement xml, string attribute, ref DateTime value) - { - return ReadDateTime(xml, attribute, ref value, true); - } + public static bool ReadDateTime(XmlElement xml, string attribute, ref DateTime value) => ReadDateTime(xml, attribute, ref value, true); public static bool ReadDateTime(XmlElement xml, string attribute, ref DateTime value, bool mandatory) { @@ -982,10 +890,7 @@ namespace Server return true; } - public static bool ReadTimeSpan(XmlElement xml, string attribute, ref TimeSpan value) - { - return ReadTimeSpan(xml, attribute, ref value, true); - } + public static bool ReadTimeSpan(XmlElement xml, string attribute, ref TimeSpan value) => ReadTimeSpan(xml, attribute, ref value, true); public static bool ReadTimeSpan(XmlElement xml, string attribute, ref TimeSpan value, bool mandatory) { @@ -1007,10 +912,7 @@ namespace Server return true; } - public static bool ReadEnum(XmlElement xml, string attribute, ref T value) where T : struct - { - return ReadEnum(xml, attribute, ref value, true); - } + public static bool ReadEnum(XmlElement xml, string attribute, ref T value) where T : struct => ReadEnum(xml, attribute, ref value, true); public static bool ReadEnum(XmlElement xml, string attribute, ref T value, bool mandatory) where T : struct // We can't limit the where clause to Enums only @@ -1032,10 +934,7 @@ namespace Server return false; } - public static bool ReadMap(XmlElement xml, string attribute, ref Map value) - { - return ReadMap(xml, attribute, ref value, true); - } + public static bool ReadMap(XmlElement xml, string attribute, ref Map value) => ReadMap(xml, attribute, ref value, true); public static bool ReadMap(XmlElement xml, string attribute, ref Map value, bool mandatory) { @@ -1057,10 +956,7 @@ namespace Server return true; } - public static bool ReadType(XmlElement xml, string attribute, ref Type value) - { - return ReadType(xml, attribute, ref value, true); - } + public static bool ReadType(XmlElement xml, string attribute, ref Type value) => ReadType(xml, attribute, ref value, true); public static bool ReadType(XmlElement xml, string attribute, ref Type value, bool mandatory) { @@ -1090,10 +986,7 @@ namespace Server return true; } - public static bool ReadPoint3D(XmlElement xml, Map map, ref Point3D value) - { - return ReadPoint3D(xml, map, ref value, true); - } + public static bool ReadPoint3D(XmlElement xml, Map map, ref Point3D value) => ReadPoint3D(xml, map, ref value, true); public static bool ReadPoint3D(XmlElement xml, Map map, ref Point3D value, bool mandatory) { @@ -1114,10 +1007,7 @@ namespace Server return false; } - public static bool ReadRectangle3D(XmlElement xml, int defaultMinZ, int defaultMaxZ, ref Rectangle3D value) - { - return ReadRectangle3D(xml, defaultMinZ, defaultMaxZ, ref value, true); - } + public static bool ReadRectangle3D(XmlElement xml, int defaultMinZ, int defaultMaxZ, ref Rectangle3D value) => ReadRectangle3D(xml, defaultMinZ, defaultMaxZ, ref value, true); public static bool ReadRectangle3D(XmlElement xml, int defaultMinZ, int defaultMaxZ, ref Rectangle3D value, bool mandatory) diff --git a/Projects/Server/Sector.cs b/Projects/Server/Sector.cs index 9e9ad639d..32d9810cf 100644 --- a/Projects/Server/Sector.cs +++ b/Projects/Server/Sector.cs @@ -39,15 +39,9 @@ namespace Server public Rectangle3D Rect => m_Rect; - public int CompareTo(RegionRect regRect) - { - return regRect == null ? 1 : Region.CompareTo(regRect.Region); - } + public int CompareTo(RegionRect regRect) => regRect == null ? 1 : Region.CompareTo(regRect.Region); - public bool Contains(Point3D loc) - { - return m_Rect.Contains(loc); - } + public bool Contains(Point3D loc) => m_Rect.Contains(loc); } diff --git a/Projects/Server/Serial.cs b/Projects/Server/Serial.cs index bbf06ed1d..df8996043 100644 --- a/Projects/Server/Serial.cs +++ b/Projects/Server/Serial.cs @@ -55,10 +55,7 @@ namespace Server } } - private Serial(uint serial) - { - Value = serial; - } + private Serial(uint serial) => Value = serial; public uint Value{ get; } @@ -68,20 +65,11 @@ namespace Server public bool IsValid => Value > 0; - public override int GetHashCode() - { - return Value.GetHashCode(); - } + public override int GetHashCode() => Value.GetHashCode(); - public int CompareTo(Serial other) - { - return Value.CompareTo(other.Value); - } + public int CompareTo(Serial other) => Value.CompareTo(other.Value); - public int CompareTo(uint other) - { - return Value.CompareTo(other); - } + public int CompareTo(uint other) => Value.CompareTo(other); public override bool Equals(object obj) { @@ -98,49 +86,22 @@ namespace Server return false; } - public static bool operator ==(Serial l, Serial r) - { - return l.Value == r.Value; - } + public static bool operator ==(Serial l, Serial r) => l.Value == r.Value; - public static bool operator !=(Serial l, Serial r) - { - return l.Value != r.Value; - } + public static bool operator !=(Serial l, Serial r) => l.Value != r.Value; - public static bool operator >(Serial l, Serial r) - { - return l.Value > r.Value; - } + public static bool operator >(Serial l, Serial r) => l.Value > r.Value; - public static bool operator <(Serial l, Serial r) - { - return l.Value < r.Value; - } + public static bool operator <(Serial l, Serial r) => l.Value < r.Value; - public static bool operator >=(Serial l, Serial r) - { - return l.Value >= r.Value; - } + public static bool operator >=(Serial l, Serial r) => l.Value >= r.Value; - public static bool operator <=(Serial l, Serial r) - { - return l.Value <= r.Value; - } + public static bool operator <=(Serial l, Serial r) => l.Value <= r.Value; - public override string ToString() - { - return $"0x{Value:X8}"; - } + public override string ToString() => $"0x{Value:X8}"; - public static implicit operator uint(Serial a) - { - return a.Value; - } + public static implicit operator uint(Serial a) => a.Value; - public static implicit operator Serial(uint a) - { - return new Serial(a); - } + public static implicit operator Serial(uint a) => new Serial(a); } } diff --git a/Projects/Server/Serialization.cs b/Projects/Server/Serialization.cs index 4018e359e..106e9c731 100644 --- a/Projects/Server/Serialization.cs +++ b/Projects/Server/Serialization.cs @@ -814,10 +814,7 @@ namespace Server { private BinaryReader m_File; - public BinaryFileReader(BinaryReader br) - { - m_File = br; - } + public BinaryFileReader(BinaryReader br) => m_File = br; public long Position => m_File.BaseStream.Position; @@ -826,15 +823,9 @@ namespace Server m_File.Close(); } - public long Seek(long offset, SeekOrigin origin) - { - return m_File.BaseStream.Seek(offset, origin); - } + public long Seek(long offset, SeekOrigin origin) => m_File.BaseStream.Seek(offset, origin); - public override string ReadString() - { - return ReadByte() != 0 ? m_File.ReadString() : null; - } + public override string ReadString() => ReadByte() != 0 ? m_File.ReadString() : null; public override DateTime ReadDeltaTime() { @@ -857,10 +848,7 @@ namespace Server } } - public override IPAddress ReadIPAddress() - { - return new IPAddress(m_File.ReadInt64()); - } + public override IPAddress ReadIPAddress() => new IPAddress(m_File.ReadInt64()); public override int ReadEncodedInt() { @@ -877,10 +865,7 @@ namespace Server return v; } - public override DateTime ReadDateTime() - { - return new DateTime(m_File.ReadInt64()); - } + public override DateTime ReadDateTime() => new DateTime(m_File.ReadInt64()); public override DateTimeOffset ReadDateTimeOffset() { @@ -890,100 +875,43 @@ namespace Server return new DateTimeOffset(ticks, offset); } - public override TimeSpan ReadTimeSpan() - { - return new TimeSpan(m_File.ReadInt64()); - } + public override TimeSpan ReadTimeSpan() => new TimeSpan(m_File.ReadInt64()); - public override decimal ReadDecimal() - { - return m_File.ReadDecimal(); - } + public override decimal ReadDecimal() => m_File.ReadDecimal(); - public override long ReadLong() - { - return m_File.ReadInt64(); - } + public override long ReadLong() => m_File.ReadInt64(); - public override ulong ReadULong() - { - return m_File.ReadUInt64(); - } + public override ulong ReadULong() => m_File.ReadUInt64(); - public override int ReadInt() - { - return m_File.ReadInt32(); - } + public override int ReadInt() => m_File.ReadInt32(); - public override uint ReadUInt() - { - return m_File.ReadUInt32(); - } + public override uint ReadUInt() => m_File.ReadUInt32(); - public override short ReadShort() - { - return m_File.ReadInt16(); - } + public override short ReadShort() => m_File.ReadInt16(); - public override ushort ReadUShort() - { - return m_File.ReadUInt16(); - } + public override ushort ReadUShort() => m_File.ReadUInt16(); - public override double ReadDouble() - { - return m_File.ReadDouble(); - } + public override double ReadDouble() => m_File.ReadDouble(); - public override float ReadFloat() - { - return m_File.ReadSingle(); - } + public override float ReadFloat() => m_File.ReadSingle(); - public override char ReadChar() - { - return m_File.ReadChar(); - } + public override char ReadChar() => m_File.ReadChar(); - public override byte ReadByte() - { - return m_File.ReadByte(); - } + public override byte ReadByte() => m_File.ReadByte(); - public override sbyte ReadSByte() - { - return m_File.ReadSByte(); - } + public override sbyte ReadSByte() => m_File.ReadSByte(); - public override bool ReadBool() - { - return m_File.ReadBoolean(); - } + public override bool ReadBool() => m_File.ReadBoolean(); - public override Point3D ReadPoint3D() - { - return new Point3D(ReadInt(), ReadInt(), ReadInt()); - } + public override Point3D ReadPoint3D() => new Point3D(ReadInt(), ReadInt(), ReadInt()); - public override Point2D ReadPoint2D() - { - return new Point2D(ReadInt(), ReadInt()); - } + public override Point2D ReadPoint2D() => new Point2D(ReadInt(), ReadInt()); - public override Rectangle2D ReadRect2D() - { - return new Rectangle2D(ReadPoint2D(), ReadPoint2D()); - } + public override Rectangle2D ReadRect2D() => new Rectangle2D(ReadPoint2D(), ReadPoint2D()); - public override Rectangle3D ReadRect3D() - { - return new Rectangle3D(ReadPoint3D(), ReadPoint3D()); - } + public override Rectangle3D ReadRect3D() => new Rectangle3D(ReadPoint3D(), ReadPoint3D()); - public override Map ReadMap() - { - return Map.Maps[ReadByte()]; - } + public override Map ReadMap() => Map.Maps[ReadByte()]; public override IEntity ReadEntity() { @@ -994,40 +922,19 @@ namespace Server return entity; } - public override Item ReadItem() - { - return World.FindItem(ReadUInt()); - } + public override Item ReadItem() => World.FindItem(ReadUInt()); - public override Mobile ReadMobile() - { - return World.FindMobile(ReadUInt()); - } + public override Mobile ReadMobile() => World.FindMobile(ReadUInt()); - public override BaseGuild ReadGuild() - { - return BaseGuild.Find(ReadUInt()); - } + public override BaseGuild ReadGuild() => BaseGuild.Find(ReadUInt()); - public override T ReadItem() - { - return ReadItem() as T; - } + public override T ReadItem() => ReadItem() as T; - public override T ReadMobile() - { - return ReadMobile() as T; - } + public override T ReadMobile() => ReadMobile() as T; - public override T ReadGuild() - { - return ReadGuild() as T; - } + public override T ReadGuild() => ReadGuild() as T; - public override List ReadStrongItemList() - { - return ReadStrongItemList(); - } + public override List ReadStrongItemList() => ReadStrongItemList(); public override List ReadStrongItemList() { @@ -1047,10 +954,7 @@ namespace Server return new List(); } - public override HashSet ReadItemSet() - { - return ReadItemSet(); - } + public override HashSet ReadItemSet() => ReadItemSet(); public override HashSet ReadItemSet() { @@ -1070,10 +974,7 @@ namespace Server return new HashSet(); } - public override List ReadStrongMobileList() - { - return ReadStrongMobileList(); - } + public override List ReadStrongMobileList() => ReadStrongMobileList(); public override List ReadStrongMobileList() { @@ -1093,10 +994,7 @@ namespace Server return new List(); } - public override HashSet ReadMobileSet() - { - return ReadMobileSet(); - } + public override HashSet ReadMobileSet() => ReadMobileSet(); public override HashSet ReadMobileSet() { @@ -1116,10 +1014,7 @@ namespace Server return new HashSet(); } - public override List ReadStrongGuildList() - { - return ReadStrongGuildList(); - } + public override List ReadStrongGuildList() => ReadStrongGuildList(); public override List ReadStrongGuildList() { @@ -1139,10 +1034,7 @@ namespace Server return new List(); } - public override HashSet ReadGuildSet() - { - return ReadGuildSet(); - } + public override HashSet ReadGuildSet() => ReadGuildSet(); public override HashSet ReadGuildSet() { @@ -1162,15 +1054,9 @@ namespace Server return new HashSet(); } - public override Race ReadRace() - { - return Race.Races[ReadByte()]; - } + public override Race ReadRace() => Race.Races[ReadByte()]; - public override bool End() - { - return m_File.PeekChar() == -1; - } + public override bool End() => m_File.PeekChar() == -1; } public sealed class AsyncWriter : GenericWriter @@ -1713,10 +1599,7 @@ namespace Server { private AsyncWriter m_Owner; - public WorkerThread(AsyncWriter owner) - { - m_Owner = owner; - } + public WorkerThread(AsyncWriter owner) => m_Owner = owner; public void Worker() { diff --git a/Projects/Server/Skills.cs b/Projects/Server/Skills.cs index 56a8a4f29..46eea944d 100644 --- a/Projects/Server/Skills.cs +++ b/Projects/Server/Skills.cs @@ -329,10 +329,7 @@ namespace Server } } - public override string ToString() - { - return $"[{Name}: {Base}]"; - } + public override string ToString() => $"[{Name}: {Base}]"; public void SetLockNoRelay(SkillLock skillLock) { @@ -632,15 +629,9 @@ namespace Server return m_Skills.Where(s => s != null).GetEnumerator(); } - public override string ToString() - { - return "..."; - } + public override string ToString() => "..."; - public static bool UseSkill(Mobile from, SkillName name) - { - return UseSkill(from, (int)name); - } + public static bool UseSkill(Mobile from, SkillName name) => UseSkill(from, (int)name); public static bool UseSkill(Mobile from, int skillID) { diff --git a/Projects/Server/Targeting/Target.cs b/Projects/Server/Targeting/Target.cs index 64c209ada..72f595a95 100644 --- a/Projects/Server/Targeting/Target.cs +++ b/Projects/Server/Targeting/Target.cs @@ -88,10 +88,7 @@ namespace Server.Targeting OnTargetFinish(from); } - public virtual Packet GetPacketFor(NetState ns) - { - return new TargetReq(this); - } + public virtual Packet GetPacketFor(NetState ns) => new TargetReq(this); public void Cancel(Mobile from, TargetCancelType type) { diff --git a/Projects/Server/TileMatrix.cs b/Projects/Server/TileMatrix.cs index e9e0a5a35..08bf4ed47 100644 --- a/Projects/Server/TileMatrix.cs +++ b/Projects/Server/TileMatrix.cs @@ -342,10 +342,7 @@ namespace Server return m_LandTiles[x][y] = tiles ?? ReadLandBlock(x, y); } - public LandTile GetLandTile(int x, int y) - { - return GetLandBlock(x >> 3, y >> 3)[((y & 0x7) << 3) + (x & 0x7)]; - } + public LandTile GetLandTile(int x, int y) => GetLandBlock(x >> 3, y >> 3)[((y & 0x7) << 3) + (x & 0x7)]; [MethodImpl(MethodImplOptions.Synchronized)] private unsafe StaticTile[][][] ReadStaticBlock(int x, int y) @@ -676,10 +673,7 @@ namespace Server m_Order = 0; } - public int CompareTo(UOPEntry other) - { - return m_Order.CompareTo(other.m_Order); - } + public int CompareTo(UOPEntry other) => m_Order.CompareTo(other.m_Order); } private class OffsetComparer : IComparer diff --git a/Projects/Server/TileMatrixPatch.cs b/Projects/Server/TileMatrixPatch.cs index aeea0e751..e515fee8a 100644 --- a/Projects/Server/TileMatrixPatch.cs +++ b/Projects/Server/TileMatrixPatch.cs @@ -75,120 +75,110 @@ namespace Server [MethodImpl(MethodImplOptions.Synchronized)] private unsafe int PatchLand(TileMatrix matrix, string dataPath, string indexPath) { - using (FileStream fsData = new FileStream(dataPath, FileMode.Open, FileAccess.Read, FileShare.Read)) + using FileStream fsData = new FileStream(dataPath, FileMode.Open, FileAccess.Read, FileShare.Read); + using FileStream fsIndex = new FileStream(indexPath, FileMode.Open, FileAccess.Read, FileShare.Read); + BinaryReader indexReader = new BinaryReader(fsIndex); + + int count = (int)(indexReader.BaseStream.Length / 4); + + for (int i = 0; i < count; ++i) { - using (FileStream fsIndex = new FileStream(indexPath, FileMode.Open, FileAccess.Read, FileShare.Read)) + int blockID = indexReader.ReadInt32(); + int x = blockID / matrix.BlockHeight; + int y = blockID % matrix.BlockHeight; + + fsData.Seek(4, SeekOrigin.Current); + + LandTile[] tiles = new LandTile[64]; + + fixed (LandTile* pTiles = tiles) { - BinaryReader indexReader = new BinaryReader(fsIndex); - - int count = (int)(indexReader.BaseStream.Length / 4); - - for (int i = 0; i < count; ++i) - { - int blockID = indexReader.ReadInt32(); - int x = blockID / matrix.BlockHeight; - int y = blockID % matrix.BlockHeight; - - fsData.Seek(4, SeekOrigin.Current); - - LandTile[] tiles = new LandTile[64]; - - fixed (LandTile* pTiles = tiles) - { - NativeReader.Read(fsData.SafeFileHandle.DangerousGetHandle(), pTiles, 192); - } - - matrix.SetLandBlock(x, y, tiles); - } - - indexReader.Close(); - - return count; + NativeReader.Read(fsData.SafeFileHandle.DangerousGetHandle(), pTiles, 192); } + + matrix.SetLandBlock(x, y, tiles); } + + indexReader.Close(); + + return count; } [MethodImpl(MethodImplOptions.Synchronized)] private unsafe int PatchStatics(TileMatrix matrix, string dataPath, string indexPath, string lookupPath) { - using (FileStream fsData = new FileStream(dataPath, FileMode.Open, FileAccess.Read, FileShare.Read)) + using FileStream fsData = new FileStream(dataPath, FileMode.Open, FileAccess.Read, FileShare.Read); + using FileStream fsIndex = new FileStream(indexPath, FileMode.Open, FileAccess.Read, FileShare.Read); + using FileStream fsLookup = new FileStream(lookupPath, FileMode.Open, FileAccess.Read, FileShare.Read); + BinaryReader indexReader = new BinaryReader(fsIndex); + BinaryReader lookupReader = new BinaryReader(fsLookup); + + int count = (int)(indexReader.BaseStream.Length / 4); + + TileList[][] lists = new TileList[8][]; + + for (int x = 0; x < 8; ++x) { - using (FileStream fsIndex = new FileStream(indexPath, FileMode.Open, FileAccess.Read, FileShare.Read)) + lists[x] = new TileList[8]; + + for (int y = 0; y < 8; ++y) + lists[x][y] = new TileList(); + } + + for (int i = 0; i < count; ++i) + { + int blockID = indexReader.ReadInt32(); + int blockX = blockID / matrix.BlockHeight; + int blockY = blockID % matrix.BlockHeight; + + int offset = lookupReader.ReadInt32(); + int length = lookupReader.ReadInt32(); + lookupReader.ReadInt32(); // Extra + + if (offset < 0 || length <= 0) { - using (FileStream fsLookup = new FileStream(lookupPath, FileMode.Open, FileAccess.Read, FileShare.Read)) + matrix.SetStaticBlock(blockX, blockY, matrix.EmptyStaticBlock); + continue; + } + + fsData.Seek(offset, SeekOrigin.Begin); + + int tileCount = length / 7; + + if (m_TileBuffer.Length < tileCount) + m_TileBuffer = new StaticTile[tileCount]; + + StaticTile[] staTiles = m_TileBuffer; + + fixed (StaticTile* pTiles = staTiles) + { + NativeReader.Read(fsData.SafeFileHandle.DangerousGetHandle(), pTiles, length); + StaticTile* pCur = pTiles, pEnd = pTiles + tileCount; + + while (pCur < pEnd) { - BinaryReader indexReader = new BinaryReader(fsIndex); - BinaryReader lookupReader = new BinaryReader(fsLookup); - - int count = (int)(indexReader.BaseStream.Length / 4); - - TileList[][] lists = new TileList[8][]; - - for (int x = 0; x < 8; ++x) - { - lists[x] = new TileList[8]; - - for (int y = 0; y < 8; ++y) - lists[x][y] = new TileList(); - } - - for (int i = 0; i < count; ++i) - { - int blockID = indexReader.ReadInt32(); - int blockX = blockID / matrix.BlockHeight; - int blockY = blockID % matrix.BlockHeight; - - int offset = lookupReader.ReadInt32(); - int length = lookupReader.ReadInt32(); - lookupReader.ReadInt32(); // Extra - - if (offset < 0 || length <= 0) - { - matrix.SetStaticBlock(blockX, blockY, matrix.EmptyStaticBlock); - continue; - } - - fsData.Seek(offset, SeekOrigin.Begin); - - int tileCount = length / 7; - - if (m_TileBuffer.Length < tileCount) - m_TileBuffer = new StaticTile[tileCount]; - - StaticTile[] staTiles = m_TileBuffer; - - fixed (StaticTile* pTiles = staTiles) - { - NativeReader.Read(fsData.SafeFileHandle.DangerousGetHandle(), pTiles, length); - StaticTile* pCur = pTiles, pEnd = pTiles + tileCount; - - while (pCur < pEnd) - { - lists[pCur->m_X & 0x7][pCur->m_Y & 0x7].Add(pCur->m_ID, pCur->m_Z); - pCur = pCur + 1; - } - - StaticTile[][][] tiles = new StaticTile[8][][]; - - for (int x = 0; x < 8; ++x) - { - tiles[x] = new StaticTile[8][]; - - for (int y = 0; y < 8; ++y) - tiles[x][y] = lists[x][y].ToArray(); - } - - matrix.SetStaticBlock(blockX, blockY, tiles); - } - } - - indexReader.Close(); - lookupReader.Close(); - - return count; + lists[pCur->m_X & 0x7][pCur->m_Y & 0x7].Add(pCur->m_ID, pCur->m_Z); + pCur = pCur + 1; } + + StaticTile[][][] tiles = new StaticTile[8][][]; + + for (int x = 0; x < 8; ++x) + { + tiles[x] = new StaticTile[8][]; + + for (int y = 0; y < 8; ++y) + tiles[x][y] = lists[x][y].ToArray(); + } + + matrix.SetStaticBlock(blockX, blockY, tiles); } } + + indexReader.Close(); + lookupReader.Close(); + + return count; } } } diff --git a/Projects/Server/Timer.cs b/Projects/Server/Timer.cs index 510d2200c..f34c1952e 100644 --- a/Projects/Server/Timer.cs +++ b/Projects/Server/Timer.cs @@ -183,10 +183,7 @@ namespace Server if (prof != null) prof.Created++; } - public override string ToString() - { - return GetType().FullName; - } + public override string ToString() => GetType().FullName; public static TimerPriority ComputePriority(TimeSpan ts) { @@ -475,20 +472,11 @@ namespace Server #region DelayCall(..) - public static Timer DelayCall(TimerCallback callback) - { - return DelayCall(TimeSpan.Zero, TimeSpan.Zero, 1, callback); - } + public static Timer DelayCall(TimerCallback callback) => DelayCall(TimeSpan.Zero, TimeSpan.Zero, 1, callback); - public static Timer DelayCall(TimeSpan delay, TimerCallback callback) - { - return DelayCall(delay, TimeSpan.Zero, 1, callback); - } + public static Timer DelayCall(TimeSpan delay, TimerCallback callback) => DelayCall(delay, TimeSpan.Zero, 1, callback); - public static Timer DelayCall(TimeSpan delay, TimeSpan interval, TimerCallback callback) - { - return DelayCall(delay, interval, 0, callback); - } + public static Timer DelayCall(TimeSpan delay, TimeSpan interval, TimerCallback callback) => DelayCall(delay, interval, 0, callback); public static Timer DelayCall(TimeSpan delay, TimeSpan interval, int count, TimerCallback callback) { @@ -504,20 +492,11 @@ namespace Server #region DelayCall(..) - public static Timer DelayCall(TimerStateCallback callback, T state) - { - return DelayCall(TimeSpan.Zero, TimeSpan.Zero, 1, callback, state); - } + public static Timer DelayCall(TimerStateCallback callback, T state) => DelayCall(TimeSpan.Zero, TimeSpan.Zero, 1, callback, state); - public static Timer DelayCall(TimeSpan delay, TimerStateCallback callback, T state) - { - return DelayCall(delay, TimeSpan.Zero, 1, callback, state); - } + public static Timer DelayCall(TimeSpan delay, TimerStateCallback callback, T state) => DelayCall(delay, TimeSpan.Zero, 1, callback, state); - public static Timer DelayCall(TimeSpan delay, TimeSpan interval, TimerStateCallback callback, T state) - { - return DelayCall(delay, interval, 0, callback, state); - } + public static Timer DelayCall(TimeSpan delay, TimeSpan interval, TimerStateCallback callback, T state) => DelayCall(delay, interval, 0, callback, state); public static Timer DelayCall(TimeSpan delay, TimeSpan interval, int count, TimerStateCallback callback, T state) @@ -553,10 +532,7 @@ namespace Server Callback?.Invoke(); } - public override string ToString() - { - return $"DelayCallTimer[{FormatDelegate(Callback)}]"; - } + public override string ToString() => $"DelayCallTimer[{FormatDelegate(Callback)}]"; } private class DelayStateCallTimer : Timer @@ -581,10 +557,7 @@ namespace Server Callback?.Invoke(m_State); } - public override string ToString() - { - return $"DelayStateCall[{FormatDelegate(Callback)}]"; - } + public override string ToString() => $"DelayStateCall[{FormatDelegate(Callback)}]"; } #endregion @@ -593,12 +566,9 @@ namespace Server { private TaskCompletionSource m_TaskCompleter; - public Task Task { get { return m_TaskCompleter.Task; } } + public Task Task => m_TaskCompleter.Task; - public DelayTaskTimer(TimeSpan delay) : base(delay) - { - m_TaskCompleter = new TaskCompletionSource(); - } + public DelayTaskTimer(TimeSpan delay) : base(delay) => m_TaskCompleter = new TaskCompletionSource(); protected override void OnTick() { diff --git a/Projects/Server/Utility.cs b/Projects/Server/Utility.cs index 7e1abf6bf..4cc7ad8ca 100644 --- a/Projects/Server/Utility.cs +++ b/Projects/Server/Utility.cs @@ -129,10 +129,7 @@ namespace Server sb.Append(value); } - public static string Intern(string str) - { - return str == null ? null : str.Length == 0 ? string.Empty : string.Intern(str); - } + public static string Intern(string str) => str == null ? null : str.Length == 0 ? string.Empty : string.Intern(str); public static void Intern(ref string str) { @@ -165,10 +162,7 @@ namespace Server return valid; } - public static bool IPMatch(string val, IPAddress ip) - { - return IPMatch(val, ip, out _); - } + public static bool IPMatch(string val, IPAddress ip) => IPMatch(val, ip, out _); public static string FixHtml(string str) { @@ -364,13 +358,11 @@ namespace Server return (uint)((bytes[0] << 0x18) | (bytes[1] << 0x10) | (bytes[2] << 8) | bytes[3]) & 0xffffffff; } - private static uint SwapUnsignedInt(uint source) - { - return ((source & 0x000000FF) << 0x18) - | ((source & 0x0000FF00) << 8) - | ((source & 0x00FF0000) >> 8) - | ((source & 0xFF000000) >> 0x18); - } + private static uint SwapUnsignedInt(uint source) => + ((source & 0x000000FF) << 0x18) + | ((source & 0x0000FF00) << 8) + | ((source & 0x00FF0000) >> 8) + | ((source & 0xFF000000) >> 0x18); public static bool TryConvertIPv6toIPv4(ref IPAddress address) { @@ -512,20 +504,11 @@ namespace Server return true; } - public static bool IPMatchClassC(IPAddress ip1, IPAddress ip2) - { - return (GetAddressValue(ip1) & 0xFFFFFF) == (GetAddressValue(ip2) & 0xFFFFFF); - } + public static bool IPMatchClassC(IPAddress ip1, IPAddress ip2) => (GetAddressValue(ip1) & 0xFFFFFF) == (GetAddressValue(ip2) & 0xFFFFFF); - public static int InsensitiveCompare(string first, string second) - { - return Insensitive.Compare(first, second); - } + public static int InsensitiveCompare(string first, string second) => Insensitive.Compare(first, second); - public static bool InsensitiveStartsWith(string first, string second) - { - return Insensitive.StartsWith(first, second); - } + public static bool InsensitiveStartsWith(string first, string second) => Insensitive.StartsWith(first, second); public static Direction GetDirection(IPoint2D from, IPoint2D to) { @@ -622,20 +605,11 @@ namespace Server return emptyValue; } - public static SkillName RandomSkill() - { - return m_AllSkills[Random(m_AllSkills.Length - (Core.ML ? 0 : Core.SE ? 1 : Core.AOS ? 3 : 6))]; - } + public static SkillName RandomSkill() => m_AllSkills[Random(m_AllSkills.Length - (Core.ML ? 0 : Core.SE ? 1 : Core.AOS ? 3 : 6))]; - public static SkillName RandomCombatSkill() - { - return m_CombatSkills[Random(m_CombatSkills.Length)]; - } + public static SkillName RandomCombatSkill() => m_CombatSkills[Random(m_CombatSkills.Length)]; - public static SkillName RandomCraftSkill() - { - return m_CraftSkills[Random(m_CraftSkills.Length)]; - } + public static SkillName RandomCraftSkill() => m_CraftSkills[Random(m_CraftSkills.Length)]; public static void FixPoints(ref Point3D top, ref Point3D bottom) { @@ -661,13 +635,11 @@ namespace Server } } - public static bool RangeCheck(IPoint2D p1, IPoint2D p2, int range) - { - return p1.X >= p2.X - range - && p1.X <= p2.X + range - && p1.Y >= p2.Y - range - && p2.Y <= p2.Y + range; - } + public static bool RangeCheck(IPoint2D p1, IPoint2D p2, int range) => + p1.X >= p2.X - range + && p1.X <= p2.X + range + && p1.Y >= p2.Y - range + && p2.Y <= p2.Y + range; public static void FormatBuffer(TextWriter output, Stream input, int length) { @@ -956,61 +928,41 @@ namespace Server } } - public static string GetAttribute(XmlElement node, string attributeName, string defaultValue = null) - { - return node?.Attributes[attributeName]?.Value ?? defaultValue; - } + public static string GetAttribute(XmlElement node, string attributeName, string defaultValue = null) => node?.Attributes[attributeName]?.Value ?? defaultValue; - public static string GetText(XmlElement node, string defaultValue) - { - return node == null ? defaultValue : node.InnerText; - } + public static string GetText(XmlElement node, string defaultValue) => node == null ? defaultValue : node.InnerText; - public static int GetAddressValue(IPAddress address) - { - return BitConverter.ToInt32(address.GetAddressBytes(), 0); - } + public static int GetAddressValue(IPAddress address) => BitConverter.ToInt32(address.GetAddressBytes(), 0); - public static long GetLongAddressValue(IPAddress address) - { - return BitConverter.ToInt64(address.GetAddressBytes(), 0); - } + public static long GetLongAddressValue(IPAddress address) => BitConverter.ToInt64(address.GetAddressBytes(), 0); #endregion #region In[...]Range - public static bool InRange(Point3D p1, Point3D p2, int range) - { - return p1.m_X >= p2.m_X - range - && p1.m_X <= p2.m_X + range - && p1.m_Y >= p2.m_Y - range - && p1.m_Y <= p2.m_Y + range; - } + public static bool InRange(Point3D p1, Point3D p2, int range) => + p1.m_X >= p2.m_X - range + && p1.m_X <= p2.m_X + range + && p1.m_Y >= p2.m_Y - range + && p1.m_Y <= p2.m_Y + range; - public static bool InUpdateRange(Point3D p1, Point3D p2) - { - return p1.m_X >= p2.m_X - 18 - && p1.m_X <= p2.m_X + 18 - && p1.m_Y >= p2.m_Y - 18 - && p1.m_Y <= p2.m_Y + 18; - } + public static bool InUpdateRange(Point3D p1, Point3D p2) => + p1.m_X >= p2.m_X - 18 + && p1.m_X <= p2.m_X + 18 + && p1.m_Y >= p2.m_Y - 18 + && p1.m_Y <= p2.m_Y + 18; - public static bool InUpdateRange(Point2D p1, Point2D p2) - { - return p1.m_X >= p2.m_X - 18 - && p1.m_X <= p2.m_X + 18 - && p1.m_Y >= p2.m_Y - 18 - && p1.m_Y <= p2.m_Y + 18; - } + public static bool InUpdateRange(Point2D p1, Point2D p2) => + p1.m_X >= p2.m_X - 18 + && p1.m_X <= p2.m_X + 18 + && p1.m_Y >= p2.m_Y - 18 + && p1.m_Y <= p2.m_Y + 18; - public static bool InUpdateRange(IPoint2D p1, IPoint2D p2) - { - return p1.X >= p2.X - 18 - && p1.X <= p2.X + 18 - && p1.Y >= p2.Y - 18 - && p1.Y <= p2.Y + 18; - } + public static bool InUpdateRange(IPoint2D p1, IPoint2D p2) => + p1.X >= p2.X - 18 + && p1.X <= p2.X + 18 + && p1.Y >= p2.Y - 18 + && p1.Y <= p2.Y + 18; #endregion @@ -1070,20 +1022,14 @@ namespace Server return from - RandomImpl.Next(-count); } - public static int Random(int count) - { - return RandomImpl.Next(count); - } + public static int Random(int count) => RandomImpl.Next(count); public static void RandomBytes(byte[] buffer) { RandomImpl.NextBytes(buffer); } - public static double RandomDouble() - { - return RandomImpl.NextDouble(); - } + public static double RandomDouble() => RandomImpl.NextDouble(); #endregion @@ -1110,98 +1056,62 @@ namespace Server /// /// Random hue in the range 1201-1254 /// - public static int RandomPinkHue() - { - return Random(1201, 54); - } + public static int RandomPinkHue() => Random(1201, 54); /// /// Random hue in the range 1301-1354 /// - public static int RandomBlueHue() - { - return Random(1301, 54); - } + public static int RandomBlueHue() => Random(1301, 54); /// /// Random hue in the range 1401-1454 /// - public static int RandomGreenHue() - { - return Random(1401, 54); - } + public static int RandomGreenHue() => Random(1401, 54); /// /// Random hue in the range 1501-1554 /// - public static int RandomOrangeHue() - { - return Random(1501, 54); - } + public static int RandomOrangeHue() => Random(1501, 54); /// /// Random hue in the range 1601-1654 /// - public static int RandomRedHue() - { - return Random(1601, 54); - } + public static int RandomRedHue() => Random(1601, 54); /// /// Random hue in the range 1701-1754 /// - public static int RandomYellowHue() - { - return Random(1701, 54); - } + public static int RandomYellowHue() => Random(1701, 54); /// /// Random hue in the range 1801-1908 /// - public static int RandomNeutralHue() - { - return Random(1801, 108); - } + public static int RandomNeutralHue() => Random(1801, 108); /// /// Random hue in the range 2001-2018 /// - public static int RandomSnakeHue() - { - return Random(2001, 18); - } + public static int RandomSnakeHue() => Random(2001, 18); /// /// Random hue in the range 2101-2130 /// - public static int RandomBirdHue() - { - return Random(2101, 30); - } + public static int RandomBirdHue() => Random(2101, 30); /// /// Random hue in the range 2201-2224 /// - public static int RandomSlimeHue() - { - return Random(2201, 24); - } + public static int RandomSlimeHue() => Random(2201, 24); /// /// Random hue in the range 2301-2318 /// - public static int RandomAnimalHue() - { - return Random(2301, 18); - } + public static int RandomAnimalHue() => Random(2301, 18); /// /// Random hue in the range 2401-2430 /// - public static int RandomMetalHue() - { - return Random(2401, 30); - } + public static int RandomMetalHue() => Random(2401, 30); public static int ClipDyedHue(int hue) { @@ -1214,19 +1124,14 @@ namespace Server /// /// Random hue in the range 2-1001 /// - public static int RandomDyedHue() - { - return Random(2, 1000); - } + public static int RandomDyedHue() => Random(2, 1000); /// /// Random hue from 0x62, 0x71, 0x03, 0x0D, 0x13, 0x1C, 0x21, 0x30, 0x37, 0x3A, 0x44, 0x59 /// - public static int RandomBrightHue() - { - return RandomDouble() < 0.1 ? RandomList(0x62, 0x71) : + public static int RandomBrightHue() => + RandomDouble() < 0.1 ? RandomList(0x62, 0x71) : RandomList(0x03, 0x0D, 0x13, 0x1C, 0x21, 0x30, 0x37, 0x3A, 0x44, 0x59); - } #endregion } diff --git a/Projects/Server/VirtueInfo.cs b/Projects/Server/VirtueInfo.cs index 2a0281e9b..5596a1636 100644 --- a/Projects/Server/VirtueInfo.cs +++ b/Projects/Server/VirtueInfo.cs @@ -136,10 +136,7 @@ namespace Server Values[index] = value; } - public override string ToString() - { - return "..."; - } + public override string ToString() => "..."; public static void Serialize(GenericWriter writer, VirtueInfo info) { diff --git a/Projects/Server/World.cs b/Projects/Server/World.cs index ebdf4acf6..f3f663346 100644 --- a/Projects/Server/World.cs +++ b/Projects/Server/World.cs @@ -188,142 +188,142 @@ namespace Server List guilds = new List(); if (File.Exists(MobileIndexPath) && File.Exists(MobileTypesPath)) - using (FileStream idx = new FileStream(MobileIndexPath, FileMode.Open, FileAccess.Read, FileShare.Read)) + { + using FileStream idx = new FileStream(MobileIndexPath, FileMode.Open, FileAccess.Read, FileShare.Read); + BinaryReader idxReader = new BinaryReader(idx); + + using (FileStream tdb = new FileStream(MobileTypesPath, FileMode.Open, FileAccess.Read, FileShare.Read)) { - BinaryReader idxReader = new BinaryReader(idx); + BinaryReader tdbReader = new BinaryReader(tdb); - using (FileStream tdb = new FileStream(MobileTypesPath, FileMode.Open, FileAccess.Read, FileShare.Read)) + List> types = ReadTypes(tdbReader); + + mobileCount = idxReader.ReadInt32(); + + Mobiles = new Dictionary(mobileCount); + + for (int i = 0; i < mobileCount; ++i) { - BinaryReader tdbReader = new BinaryReader(tdb); + int typeID = idxReader.ReadInt32(); + uint serial = idxReader.ReadUInt32(); + long pos = idxReader.ReadInt64(); + int length = idxReader.ReadInt32(); - List> types = ReadTypes(tdbReader); + Tuple objs = types[typeID]; - mobileCount = idxReader.ReadInt32(); + if (objs == null) + continue; - Mobiles = new Dictionary(mobileCount); + Mobile m = null; + ConstructorInfo ctor = objs.Item1; + string typeName = objs.Item2; - for (int i = 0; i < mobileCount; ++i) + try { - int typeID = idxReader.ReadInt32(); - uint serial = idxReader.ReadUInt32(); - long pos = idxReader.ReadInt64(); - int length = idxReader.ReadInt32(); - - Tuple objs = types[typeID]; - - if (objs == null) - continue; - - Mobile m = null; - ConstructorInfo ctor = objs.Item1; - string typeName = objs.Item2; - - try - { - ctorArgs[0] = (Serial)serial; - m = (Mobile)ctor.Invoke(ctorArgs); - } - catch - { - // ignored - } - - if (m != null) - { - mobiles.Add(new MobileEntry(m, typeID, typeName, pos, length)); - AddMobile(m); - } + ctorArgs[0] = (Serial)serial; + m = (Mobile)ctor.Invoke(ctorArgs); + } + catch + { + // ignored } - tdbReader.Close(); + if (m != null) + { + mobiles.Add(new MobileEntry(m, typeID, typeName, pos, length)); + AddMobile(m); + } } - idxReader.Close(); + tdbReader.Close(); } + + idxReader.Close(); + } else Mobiles = new Dictionary(); if (File.Exists(ItemIndexPath) && File.Exists(ItemTypesPath)) - using (FileStream idx = new FileStream(ItemIndexPath, FileMode.Open, FileAccess.Read, FileShare.Read)) + { + using FileStream idx = new FileStream(ItemIndexPath, FileMode.Open, FileAccess.Read, FileShare.Read); + BinaryReader idxReader = new BinaryReader(idx); + + using (FileStream tdb = new FileStream(ItemTypesPath, FileMode.Open, FileAccess.Read, FileShare.Read)) { - BinaryReader idxReader = new BinaryReader(idx); + BinaryReader tdbReader = new BinaryReader(tdb); - using (FileStream tdb = new FileStream(ItemTypesPath, FileMode.Open, FileAccess.Read, FileShare.Read)) + List> types = ReadTypes(tdbReader); + + itemCount = idxReader.ReadInt32(); + + Items = new Dictionary(itemCount); + + for (int i = 0; i < itemCount; ++i) { - BinaryReader tdbReader = new BinaryReader(tdb); + int typeID = idxReader.ReadInt32(); + uint serial = idxReader.ReadUInt32(); + long pos = idxReader.ReadInt64(); + int length = idxReader.ReadInt32(); - List> types = ReadTypes(tdbReader); + Tuple objs = types[typeID]; - itemCount = idxReader.ReadInt32(); + if (objs == null) + continue; - Items = new Dictionary(itemCount); + Item item = null; + ConstructorInfo ctor = objs.Item1; + string typeName = objs.Item2; - for (int i = 0; i < itemCount; ++i) + try { - int typeID = idxReader.ReadInt32(); - uint serial = idxReader.ReadUInt32(); - long pos = idxReader.ReadInt64(); - int length = idxReader.ReadInt32(); - - Tuple objs = types[typeID]; - - if (objs == null) - continue; - - Item item = null; - ConstructorInfo ctor = objs.Item1; - string typeName = objs.Item2; - - try - { - ctorArgs[0] = (Serial)serial; - item = (Item)ctor.Invoke(ctorArgs); - } - catch - { - // ignored - } - - if (item != null) - { - items.Add(new ItemEntry(item, typeID, typeName, pos, length)); - AddItem(item); - } + ctorArgs[0] = (Serial)serial; + item = (Item)ctor.Invoke(ctorArgs); + } + catch + { + // ignored } - tdbReader.Close(); + if (item != null) + { + items.Add(new ItemEntry(item, typeID, typeName, pos, length)); + AddItem(item); + } } - idxReader.Close(); + tdbReader.Close(); } + + idxReader.Close(); + } else Items = new Dictionary(); if (File.Exists(GuildIndexPath)) - using (FileStream idx = new FileStream(GuildIndexPath, FileMode.Open, FileAccess.Read, FileShare.Read)) + { + using FileStream idx = new FileStream(GuildIndexPath, FileMode.Open, FileAccess.Read, FileShare.Read); + BinaryReader idxReader = new BinaryReader(idx); + + guildCount = idxReader.ReadInt32(); + + CreateGuildEventArgs createEventArgs = new CreateGuildEventArgs(0xFFFFFFFF); + for (int i = 0; i < guildCount; ++i) { - BinaryReader idxReader = new BinaryReader(idx); + idxReader.ReadInt32(); //no typeid for guilds + uint id = idxReader.ReadUInt32(); + long pos = idxReader.ReadInt64(); + int length = idxReader.ReadInt32(); - guildCount = idxReader.ReadInt32(); - - CreateGuildEventArgs createEventArgs = new CreateGuildEventArgs(0xFFFFFFFF); - for (int i = 0; i < guildCount; ++i) - { - idxReader.ReadInt32(); //no typeid for guilds - uint id = idxReader.ReadUInt32(); - long pos = idxReader.ReadInt64(); - int length = idxReader.ReadInt32(); - - createEventArgs.Id = id; - EventSink.InvokeCreateGuild(createEventArgs); - BaseGuild guild = createEventArgs.Guild; - if (guild != null) - guilds.Add(new GuildEntry(guild, pos, length)); - } - - idxReader.Close(); + createEventArgs.Id = id; + EventSink.InvokeCreateGuild(createEventArgs); + BaseGuild guild = createEventArgs.Guild; + if (guild != null) + guilds.Add(new GuildEntry(guild, pos, length)); } + idxReader.Close(); + } + bool failedMobiles = false, failedItems = false, failedGuilds = false; Type failedType = null; Serial failedSerial = Serial.Zero; @@ -331,126 +331,126 @@ namespace Server int failedTypeID = 0; if (File.Exists(MobileDataPath)) - using (FileStream bin = new FileStream(MobileDataPath, FileMode.Open, FileAccess.Read, FileShare.Read)) + { + using FileStream bin = new FileStream(MobileDataPath, FileMode.Open, FileAccess.Read, FileShare.Read); + BinaryFileReader reader = new BinaryFileReader(new BinaryReader(bin)); + + for (int i = 0; i < mobiles.Count; ++i) { - BinaryFileReader reader = new BinaryFileReader(new BinaryReader(bin)); + MobileEntry entry = mobiles[i]; + Mobile m = entry.Mobile; - for (int i = 0; i < mobiles.Count; ++i) + if (m != null) { - MobileEntry entry = mobiles[i]; - Mobile m = entry.Mobile; + reader.Seek(entry.Position, SeekOrigin.Begin); - if (m != null) + try { - reader.Seek(entry.Position, SeekOrigin.Begin); + LoadingType = entry.TypeName; + m.Deserialize(reader); - try - { - LoadingType = entry.TypeName; - m.Deserialize(reader); + if (reader.Position != entry.Position + entry.Length) + throw new Exception($"***** Bad serialize on {m.GetType()} *****"); + } + catch (Exception e) + { + mobiles.RemoveAt(i); - if (reader.Position != entry.Position + entry.Length) - throw new Exception($"***** Bad serialize on {m.GetType()} *****"); - } - catch (Exception e) - { - mobiles.RemoveAt(i); + failed = e; + failedMobiles = true; + failedType = m.GetType(); + failedTypeID = entry.TypeID; + failedSerial = m.Serial; - failed = e; - failedMobiles = true; - failedType = m.GetType(); - failedTypeID = entry.TypeID; - failedSerial = m.Serial; - - break; - } + break; } } - - reader.Close(); } + reader.Close(); + } + if (!failedMobiles && File.Exists(ItemDataPath)) - using (FileStream bin = new FileStream(ItemDataPath, FileMode.Open, FileAccess.Read, FileShare.Read)) + { + using FileStream bin = new FileStream(ItemDataPath, FileMode.Open, FileAccess.Read, FileShare.Read); + BinaryFileReader reader = new BinaryFileReader(new BinaryReader(bin)); + + for (int i = 0; i < items.Count; ++i) { - BinaryFileReader reader = new BinaryFileReader(new BinaryReader(bin)); + ItemEntry entry = items[i]; + Item item = entry.Item; - for (int i = 0; i < items.Count; ++i) + if (item != null) { - ItemEntry entry = items[i]; - Item item = entry.Item; + reader.Seek(entry.Position, SeekOrigin.Begin); - if (item != null) + try { - reader.Seek(entry.Position, SeekOrigin.Begin); + LoadingType = entry.TypeName; + item.Deserialize(reader); - try - { - LoadingType = entry.TypeName; - item.Deserialize(reader); + if (reader.Position != entry.Position + entry.Length) + throw new Exception($"***** Bad serialize on {item.GetType()} *****"); + } + catch (Exception e) + { + items.RemoveAt(i); - if (reader.Position != entry.Position + entry.Length) - throw new Exception($"***** Bad serialize on {item.GetType()} *****"); - } - catch (Exception e) - { - items.RemoveAt(i); + failed = e; + failedItems = true; + failedType = item.GetType(); + failedTypeID = entry.TypeID; + failedSerial = item.Serial; - failed = e; - failedItems = true; - failedType = item.GetType(); - failedTypeID = entry.TypeID; - failedSerial = item.Serial; - - break; - } + break; } } - - reader.Close(); } + reader.Close(); + } + LoadingType = null; if (!failedMobiles && !failedItems && File.Exists(GuildDataPath)) - using (FileStream bin = new FileStream(GuildDataPath, FileMode.Open, FileAccess.Read, FileShare.Read)) + { + using FileStream bin = new FileStream(GuildDataPath, FileMode.Open, FileAccess.Read, FileShare.Read); + BinaryFileReader reader = new BinaryFileReader(new BinaryReader(bin)); + + for (int i = 0; i < guilds.Count; ++i) { - BinaryFileReader reader = new BinaryFileReader(new BinaryReader(bin)); + GuildEntry entry = guilds[i]; + BaseGuild g = entry.Guild; - for (int i = 0; i < guilds.Count; ++i) + if (g != null) { - GuildEntry entry = guilds[i]; - BaseGuild g = entry.Guild; + reader.Seek(entry.Position, SeekOrigin.Begin); - if (g != null) + try { - reader.Seek(entry.Position, SeekOrigin.Begin); + g.Deserialize(reader); - try - { - g.Deserialize(reader); + if (reader.Position != entry.Position + entry.Length) + throw new Exception($"***** Bad serialize on Guild {g.Id} *****"); + } + catch (Exception e) + { + guilds.RemoveAt(i); - if (reader.Position != entry.Position + entry.Length) - throw new Exception($"***** Bad serialize on Guild {g.Id} *****"); - } - catch (Exception e) - { - guilds.RemoveAt(i); + failed = e; + failedGuilds = true; + failedType = typeof(BaseGuild); + failedTypeID = (int)g.Id; + failedSerial = g.Id; - failed = e; - failedGuilds = true; - failedType = typeof(BaseGuild); - failedTypeID = (int)g.Id; - failedSerial = g.Id; - - break; - } + break; } } - - reader.Close(); } + reader.Close(); + } + if (failedItems || failedMobiles || failedGuilds) { Console.WriteLine("An error was encountered while loading a saved object"); @@ -564,12 +564,10 @@ namespace Server try { - using (StreamWriter op = new StreamWriter("world-save-errors.log", true)) - { - op.WriteLine("{0}\t{1}", DateTime.UtcNow, message); - op.WriteLine(new StackTrace(2).ToString()); - op.WriteLine(); - } + using StreamWriter op = new StreamWriter("world-save-errors.log", true); + op.WriteLine("{0}\t{1}", DateTime.UtcNow, message); + op.WriteLine(new StackTrace(2).ToString()); + op.WriteLine(); } catch { @@ -588,24 +586,22 @@ namespace Server if (!Directory.Exists("Saves/Guilds/")) Directory.CreateDirectory("Saves/Guilds/"); - using (FileStream idx = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.None)) + using FileStream idx = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.None); + BinaryWriter idxWriter = new BinaryWriter(idx); + + idxWriter.Write(list.Count); + + for (int i = 0; i < list.Count; ++i) { - BinaryWriter idxWriter = new BinaryWriter(idx); + T e = list[i]; - idxWriter.Write(list.Count); - - for (int i = 0; i < list.Count; ++i) - { - T e = list[i]; - - idxWriter.Write(e.TypeID); - idxWriter.Write(e.Serial); - idxWriter.Write(e.Position); - idxWriter.Write(e.Length); - } - - idxWriter.Close(); + idxWriter.Write(e.TypeID); + idxWriter.Write(e.Serial); + idxWriter.Write(e.Position); + idxWriter.Write(e.Length); } + + idxWriter.Close(); } public static void Save()