diff --git a/Scripts/Accounting/AccessRestrictions.cs b/Scripts/Accounting/AccessRestrictions.cs
index 98cbd927e..e4cc9387e 100644
--- a/Scripts/Accounting/AccessRestrictions.cs
+++ b/Scripts/Accounting/AccessRestrictions.cs
@@ -24,7 +24,8 @@ namespace Server
e.AllowConnection = false;
return;
}
- else if ( IPLimiter.SocketBlock && !IPLimiter.Verify( ip ) )
+
+ if ( IPLimiter.SocketBlock && !IPLimiter.Verify( ip ) )
{
Console.WriteLine( "Client: {0}: Past IP limit threshold", ip );
diff --git a/Scripts/Accounting/AccountHandler.cs b/Scripts/Accounting/AccountHandler.cs
index 4782fed3d..4f0a5db72 100644
--- a/Scripts/Accounting/AccountHandler.cs
+++ b/Scripts/Accounting/AccountHandler.cs
@@ -316,7 +316,7 @@ namespace Server.Misc
if ( AutoAccountCreation && un.Trim().Length > 0 ) // To prevent someone from making an account of just '' or a bunch of meaningless spaces
{
e.State.Account = acct = CreateAccount( e.State, un, pw );
- e.Accepted = acct == null ? false : acct.CheckAccess( e.State );
+ e.Accepted = acct?.CheckAccess( e.State ) ?? false;
if ( !e.Accepted )
e.RejectReason = ALRReason.BadComm;
diff --git a/Scripts/Commands/Add.cs b/Scripts/Commands/Add.cs
index a62cc65aa..eca95cc0e 100644
--- a/Scripts/Commands/Add.cs
+++ b/Scripts/Commands/Add.cs
@@ -219,33 +219,30 @@ namespace Server.Commands
{
return Enum.Parse( type, value, true );
}
- else if ( IsType( type ) )
+
+ if ( IsType( type ) )
{
return ScriptCompiler.FindTypeByName( value );
}
- else if ( IsParsable( type ) )
+ if ( IsParsable( type ) )
{
return ParseParsable( type, value );
}
- else
+ object obj = value;
+
+ if ( value != null && value.StartsWith( "0x" ) )
{
- object obj = value;
+ if ( IsSignedNumeric( type ) )
+ obj = Convert.ToInt64( value.Substring( 2 ), 16 );
+ else if ( IsUnsignedNumeric( type ) )
+ obj = Convert.ToUInt64( value.Substring( 2 ), 16 );
- if ( value != null && value.StartsWith( "0x" ) )
- {
- if ( IsSignedNumeric( type ) )
- obj = Convert.ToInt64( value.Substring( 2 ), 16 );
- else if ( IsUnsignedNumeric( type ) )
- obj = Convert.ToUInt64( value.Substring( 2 ), 16 );
-
- obj = Convert.ToInt32( value.Substring( 2 ), 16 );
- }
-
- if ( obj == null && !type.IsValueType )
- return null;
- else
- return Convert.ChangeType( obj, type );
+ obj = Convert.ToInt32( value.Substring( 2 ), 16 );
}
+
+ if ( obj == null && !type.IsValueType )
+ return null;
+ return Convert.ChangeType( obj, type );
}
catch
{
diff --git a/Scripts/Commands/Batch.cs b/Scripts/Commands/Batch.cs
index 8dfac674d..51a30e4c5 100644
--- a/Scripts/Commands/Batch.cs
+++ b/Scripts/Commands/Batch.cs
@@ -68,12 +68,13 @@ namespace Server.Commands
e.Mobile.SendMessage( "That is either an invalid command name or one that does not support this modifier: {0}.", commandString );
return;
}
- else if ( e.Mobile.AccessLevel < command.AccessLevel )
+
+ if ( e.Mobile.AccessLevel < command.AccessLevel )
{
e.Mobile.SendMessage( "You do not have access to that command: {0}.", commandString );
return;
}
- else if ( !command.ValidateArgs( m_Scope, eventArgs[i] ) )
+ if ( !command.ValidateArgs( m_Scope, eventArgs[i] ) )
{
return;
}
@@ -157,12 +158,13 @@ namespace Server.Commands
from.SendMessage( "You must select the batch command scope." );
return false;
}
- else if ( m_Condition.Length > 0 && !m_Scope.SupportsConditionals )
+
+ if ( m_Condition.Length > 0 && !m_Scope.SupportsConditionals )
{
from.SendMessage( "This command scope does not support conditionals." );
return false;
}
- else if ( m_Condition.Length > 0 && !Utility.InsensitiveStartsWith( m_Condition, "where" ) )
+ if ( m_Condition.Length > 0 && !Utility.InsensitiveStartsWith( m_Condition, "where" ) )
{
from.SendMessage( "The condition field must start with \"where\"." );
return false;
diff --git a/Scripts/Commands/Docs.cs b/Scripts/Commands/Docs.cs
index 348bfc53d..f59f369e2 100644
--- a/Scripts/Commands/Docs.cs
+++ b/Scripts/Commands/Docs.cs
@@ -68,7 +68,7 @@ namespace Server.Commands
if ( aStatic && !bStatic )
return -1;
- else if ( !aStatic && bStatic )
+ if ( !aStatic && bStatic )
return 1;
int v = 0;
@@ -115,7 +115,7 @@ namespace Server.Commands
{
if ( ctor != null )
return ctor.IsStatic;
- else if ( method != null )
+ if ( method != null )
return method.IsStatic;
if ( prop != null )
@@ -133,12 +133,11 @@ namespace Server.Commands
{
if ( ctor != null )
return ctor.DeclaringType.Name;
- else if ( prop != null )
+ if ( prop != null )
return prop.Name;
- else if ( method != null )
+ if ( method != null )
return method.Name;
- else
- return "";
+ return "";
}
}
@@ -148,9 +147,9 @@ namespace Server.Commands
{
if ( x == null && y == null )
return 0;
- else if ( x == null )
+ if ( x == null )
return -1;
- else if ( y == null )
+ if ( y == null )
return 1;
return x.TypeName.CompareTo( y.TypeName );
@@ -2465,7 +2464,7 @@ namespace Server.Commands
for( int i = 0; i < ReplaceChars.Length; ++i ) { sb.Replace( ReplaceChars[i], '-' ); }
if ( anonymousType ) return "(Anonymous-Type)"+sb.ToString();
- else return sb.ToString();
+ return sb.ToString();
}
public static string AliasForName( string name )
diff --git a/Scripts/Commands/Generic/Commands/Interface.cs b/Scripts/Commands/Generic/Commands/Interface.cs
index 362193103..acf0c57b8 100644
--- a/Scripts/Commands/Generic/Commands/Interface.cs
+++ b/Scripts/Commands/Generic/Commands/Interface.cs
@@ -308,7 +308,8 @@ namespace Server.Commands.Generic
m_From.SendGump( new InterfaceGump( m_From, m_Columns, m_List, m_Page, m_Item ) );
return;
}
- else if ( !BaseCommand.IsAccessible( m_From, m_Item ) )
+
+ if ( !BaseCommand.IsAccessible( m_From, m_Item ) )
{
m_From.SendMessage( "That is no longer accessible." );
m_From.SendGump( new InterfaceGump( m_From, m_Columns, m_List, m_Page, m_Item ) );
@@ -469,7 +470,8 @@ namespace Server.Commands.Generic
m_From.SendGump( new InterfaceGump( m_From, m_Columns, m_List, m_Page, m_Mobile ) );
return;
}
- else if ( !BaseCommand.IsAccessible( m_From, m_Mobile ) )
+
+ if ( !BaseCommand.IsAccessible( m_From, m_Mobile ) )
{
m_From.SendMessage( "That is no longer accessible." );
m_From.SendGump( new InterfaceGump( m_From, m_Columns, m_List, m_Page, m_Mobile ) );
diff --git a/Scripts/Commands/Generic/Implementors/ScreenCommandImplementor.cs b/Scripts/Commands/Generic/Implementors/ScreenCommandImplementor.cs
index d62b23274..4ad640c52 100644
--- a/Scripts/Commands/Generic/Implementors/ScreenCommandImplementor.cs
+++ b/Scripts/Commands/Generic/Implementors/ScreenCommandImplementor.cs
@@ -16,7 +16,7 @@ namespace Server.Commands.Generic
{
RangeCommandImplementor impl = RangeCommandImplementor.Instance;
- impl?.Process( 18, @from, command, args );
+ impl?.Process( 18, from, command, args );
}
}
}
diff --git a/Scripts/Commands/Handlers.cs b/Scripts/Commands/Handlers.cs
index 491a4d3da..b7ac61a19 100644
--- a/Scripts/Commands/Handlers.cs
+++ b/Scripts/Commands/Handlers.cs
@@ -628,7 +628,7 @@ namespace Server.Commands
Mobile owner = item.RootParent as Mobile;
- if ( owner?.Map != null && owner.Map != Map.Internal && !BaseCommand.IsAccessible( @from, owner ) /* !from.CanSee( owner )*/ )
+ if ( owner?.Map != null && owner.Map != Map.Internal && !BaseCommand.IsAccessible( from, owner ) /* !from.CanSee( owner )*/ )
{
from.SendMessage( "You can not go to what you can not see." );
return;
diff --git a/Scripts/Commands/HelpInfo.cs b/Scripts/Commands/HelpInfo.cs
index 07939b497..54d40a868 100644
--- a/Scripts/Commands/HelpInfo.cs
+++ b/Scripts/Commands/HelpInfo.cs
@@ -45,8 +45,8 @@ namespace Server.Commands
return;
}
- else
- e.Mobile.SendMessage($"Command '{arg}' not found!");
+
+ e.Mobile.SendMessage($"Command '{arg}' not found!");
}
e.Mobile.SendGump( new CommandListGump( 0, e.Mobile, null ) );
diff --git a/Scripts/Commands/Properties.cs b/Scripts/Commands/Properties.cs
index 647e2b7f2..baaf3f5a4 100644
--- a/Scripts/Commands/Properties.cs
+++ b/Scripts/Commands/Properties.cs
@@ -113,26 +113,27 @@ namespace Server.Commands
failReason = $"Property '{propertyName}' not found.";
return null;
}
- else if ( (access & PropertyAccess.Read) != 0 && from.AccessLevel < attr.ReadLevel )
+
+ if ( (access & PropertyAccess.Read) != 0 && from.AccessLevel < attr.ReadLevel )
{
failReason =
$"You must be at least {Mobile.GetAccessLevelName(attr.ReadLevel)} to get the property '{propertyName}'.";
return null;
}
- else if ( (access & PropertyAccess.Write) != 0 && from.AccessLevel < attr.WriteLevel )
+ if ( (access & PropertyAccess.Write) != 0 && from.AccessLevel < attr.WriteLevel )
{
failReason =
$"You must be at least {Mobile.GetAccessLevelName(attr.WriteLevel)} to set the property '{propertyName}'.";
return null;
}
- else if ( (access & PropertyAccess.Read) != 0 && !p.CanRead )
+ if ( (access & PropertyAccess.Read) != 0 && !p.CanRead )
{
failReason = $"Property '{propertyName}' is write only.";
return null;
}
- else if ( (access & PropertyAccess.Write) != 0 && (!p.CanWrite || attr.ReadOnly) && isFinal )
+ if ( (access & PropertyAccess.Write) != 0 && (!p.CanWrite || attr.ReadOnly) && isFinal )
{
failReason = $"Property '{propertyName}' is read only.";
return null;
diff --git a/Scripts/Engines/BulkOrders/LargeBODAcceptGump.cs b/Scripts/Engines/BulkOrders/LargeBODAcceptGump.cs
index 2e8e53c3d..a4cf6f421 100644
--- a/Scripts/Engines/BulkOrders/LargeBODAcceptGump.cs
+++ b/Scripts/Engines/BulkOrders/LargeBODAcceptGump.cs
@@ -95,7 +95,7 @@ namespace Server.Engines.BulkOrders
{
if ( material >= BulkMaterialType.DullCopper && material <= BulkMaterialType.Valorite )
return 1045142 + (int)(material - BulkMaterialType.DullCopper);
- else if ( material >= BulkMaterialType.Spined && material <= BulkMaterialType.Barbed )
+ if ( material >= BulkMaterialType.Spined && material <= BulkMaterialType.Barbed )
return 1049348 + (int)(material - BulkMaterialType.Spined);
return 0;
diff --git a/Scripts/Engines/BulkOrders/LargeBODGump.cs b/Scripts/Engines/BulkOrders/LargeBODGump.cs
index 30d2ad882..36b810004 100644
--- a/Scripts/Engines/BulkOrders/LargeBODGump.cs
+++ b/Scripts/Engines/BulkOrders/LargeBODGump.cs
@@ -89,7 +89,7 @@ namespace Server.Engines.BulkOrders
{
if ( material >= BulkMaterialType.DullCopper && material <= BulkMaterialType.Valorite )
return 1045142 + (int)(material - BulkMaterialType.DullCopper);
- else if ( material >= BulkMaterialType.Spined && material <= BulkMaterialType.Barbed )
+ if ( material >= BulkMaterialType.Spined && material <= BulkMaterialType.Barbed )
return 1049348 + (int)(material - BulkMaterialType.Spined);
return 0;
diff --git a/Scripts/Engines/BulkOrders/Rewards.cs b/Scripts/Engines/BulkOrders/Rewards.cs
index 6b0df0fa0..75ebef626 100644
--- a/Scripts/Engines/BulkOrders/Rewards.cs
+++ b/Scripts/Engines/BulkOrders/Rewards.cs
@@ -77,7 +77,7 @@ namespace Server.Engines.BulkOrders
{
if ( m_Items.Length == 0 )
return null;
- else if ( m_Items.Length == 1 )
+ if ( m_Items.Length == 1 )
return m_Items[0];
int totalWeight = 0;
@@ -203,9 +203,9 @@ namespace Server.Engines.BulkOrders
{
if ( type == 1 )
return new LeatherGlovesOfMining( 1 );
- else if ( type == 3 )
+ if ( type == 3 )
return new StuddedGlovesOfMining( 3 );
- else if ( type == 5 )
+ if ( type == 5 )
return new RingmailGlovesOfMining( 5 );
throw new InvalidOperationException();
diff --git a/Scripts/Engines/BulkOrders/SmallBODAcceptGump.cs b/Scripts/Engines/BulkOrders/SmallBODAcceptGump.cs
index df997dfcd..471472a8c 100644
--- a/Scripts/Engines/BulkOrders/SmallBODAcceptGump.cs
+++ b/Scripts/Engines/BulkOrders/SmallBODAcceptGump.cs
@@ -82,7 +82,7 @@ namespace Server.Engines.BulkOrders
{
if ( material >= BulkMaterialType.DullCopper && material <= BulkMaterialType.Valorite )
return 1045142 + (int)(material - BulkMaterialType.DullCopper);
- else if ( material >= BulkMaterialType.Spined && material <= BulkMaterialType.Barbed )
+ if ( material >= BulkMaterialType.Spined && material <= BulkMaterialType.Barbed )
return 1049348 + (int)(material - BulkMaterialType.Spined);
return 0;
diff --git a/Scripts/Engines/BulkOrders/SmallBODGump.cs b/Scripts/Engines/BulkOrders/SmallBODGump.cs
index 02a80e298..3e180caec 100644
--- a/Scripts/Engines/BulkOrders/SmallBODGump.cs
+++ b/Scripts/Engines/BulkOrders/SmallBODGump.cs
@@ -72,7 +72,7 @@ namespace Server.Engines.BulkOrders
{
if ( material >= BulkMaterialType.DullCopper && material <= BulkMaterialType.Valorite )
return 1045142 + (int)(material - BulkMaterialType.DullCopper);
- else if ( material >= BulkMaterialType.Spined && material <= BulkMaterialType.Barbed )
+ if ( material >= BulkMaterialType.Spined && material <= BulkMaterialType.Barbed )
return 1049348 + (int)(material - BulkMaterialType.Spined);
return 0;
diff --git a/Scripts/Engines/CannedEvil/ChampionSpawn.cs b/Scripts/Engines/CannedEvil/ChampionSpawn.cs
index 472cd2bfd..d06326b01 100644
--- a/Scripts/Engines/CannedEvil/ChampionSpawn.cs
+++ b/Scripts/Engines/CannedEvil/ChampionSpawn.cs
@@ -666,7 +666,7 @@ namespace Server.Engines.CannedEvil
return new Point3D( x, y, z );
/* try @ platform Z if map z fails */
- else if ( Map.CanSpawnMobile( new Point2D( x, y ), m_Platform.Location.Z ) )
+ if ( Map.CanSpawnMobile( new Point2D( x, y ), m_Platform.Location.Z ) )
return new Point3D( x, y, m_Platform.Location.Z );
}
@@ -683,9 +683,9 @@ namespace Server.Engines.CannedEvil
if ( level <= Level1 )
return 0;
- else if ( level <= Level2 )
+ if ( level <= Level2 )
return 1;
- else if ( level <= Level3 )
+ if ( level <= Level3 )
return 2;
return 3;
diff --git a/Scripts/Engines/Chat/Channel.cs b/Scripts/Engines/Chat/Channel.cs
index be903be46..210819a1d 100644
--- a/Scripts/Engines/Chat/Channel.cs
+++ b/Scripts/Engines/Chat/Channel.cs
@@ -121,34 +121,32 @@ namespace Server.Engines.Chat
user.SendMessage( 46, m_Name ); // You are already in the conference '%1'.
return true;
}
- else if ( IsBanned( user ) )
+
+ if ( IsBanned( user ) )
{
user.SendMessage( 64 ); // You have been banned from this conference.
return false;
}
- else if ( !ValidatePassword( password ) )
+ if ( !ValidatePassword( password ) )
{
user.SendMessage( 34 ); // That is not the correct password.
return false;
- }
- else
- {
- user.CurrentChannel?.RemoveUser( user ); // Remove them from their current channel first
-
- ChatSystem.SendCommandTo( user.Mobile, ChatCommand.JoinedChannel, m_Name );
-
- SendCommand( ChatCommand.AddUserToChannel, user.GetColorCharacter() + user.Username );
-
- m_Users.Add( user );
- user.CurrentChannel = this;
-
- if ( user.Mobile.AccessLevel >= AccessLevel.GameMaster || (!m_AlwaysAvailable && m_Users.Count == 1) )
- AddModerator( user );
-
- SendUsersTo( user );
-
- return true;
}
+ user.CurrentChannel?.RemoveUser( user ); // Remove them from their current channel first
+
+ ChatSystem.SendCommandTo( user.Mobile, ChatCommand.JoinedChannel, m_Name );
+
+ SendCommand( ChatCommand.AddUserToChannel, user.GetColorCharacter() + user.Username );
+
+ m_Users.Add( user );
+ user.CurrentChannel = this;
+
+ if ( user.Mobile.AccessLevel >= AccessLevel.GameMaster || (!m_AlwaysAvailable && m_Users.Count == 1) )
+ AddModerator( user );
+
+ SendUsersTo( user );
+
+ return true;
}
public void RemoveUser( ChatUser user )
diff --git a/Scripts/Engines/ConPVP/AcceptDuelGump.cs b/Scripts/Engines/ConPVP/AcceptDuelGump.cs
index faba86f42..75afb1297 100644
--- a/Scripts/Engines/ConPVP/AcceptDuelGump.cs
+++ b/Scripts/Engines/ConPVP/AcceptDuelGump.cs
@@ -153,7 +153,8 @@ namespace Server.Engines.ConPVP
ie.Refresh();
return;
}
- else if ( ie.Expired )
+
+ if ( ie.Expired )
{
list.RemoveAt( i-- );
}
diff --git a/Scripts/Engines/ConPVP/Arena.cs b/Scripts/Engines/ConPVP/Arena.cs
index 016e6eabf..741fb587e 100644
--- a/Scripts/Engines/ConPVP/Arena.cs
+++ b/Scripts/Engines/ConPVP/Arena.cs
@@ -821,9 +821,9 @@ namespace Server.Engines.ConPVP
if ( a == null && b == null )
return 0;
- else if ( a == null )
+ if ( a == null )
return -1;
- else if ( b == null )
+ if ( b == null )
return +1;
return a.CompareTo( b );
diff --git a/Scripts/Engines/ConPVP/ArenaGump.cs b/Scripts/Engines/ConPVP/ArenaGump.cs
index f7e128694..77b6b97e3 100644
--- a/Scripts/Engines/ConPVP/ArenaGump.cs
+++ b/Scripts/Engines/ConPVP/ArenaGump.cs
@@ -44,21 +44,19 @@ namespace Server.Engines.ConPVP
from.SendMessage( 0x22, "You have recently been in combat with another player and cannot use this moongate." );
return false;
}
- else if ( from.Spell != null )
+
+ if ( from.Spell != null )
{
from.SendLocalizedMessage( 1049616 ); // You are too busy to do that at the moment.
return false;
}
- else
- {
- from.CloseGump( typeof( ArenaGump ) );
- from.SendGump( new ArenaGump( from, this ) );
+ from.CloseGump( typeof( ArenaGump ) );
+ from.SendGump( new ArenaGump( from, this ) );
- if ( !from.Hidden || from.AccessLevel == AccessLevel.Player )
- Effects.PlaySound( from.Location, from.Map, 0x20E );
+ if ( !from.Hidden || from.AccessLevel == AccessLevel.Player )
+ Effects.PlaySound( from.Location, from.Map, 0x20E );
- return true;
- }
+ return true;
}
public override void OnDoubleClick( Mobile from )
@@ -288,4 +286,4 @@ namespace Server.Engines.ConPVP
m_ColumnX += width;
}
}
-}
\ No newline at end of file
+}
diff --git a/Scripts/Engines/ConPVP/DuelContext.cs b/Scripts/Engines/ConPVP/DuelContext.cs
index ea12a1174..a44bfa83c 100644
--- a/Scripts/Engines/ConPVP/DuelContext.cs
+++ b/Scripts/Engines/ConPVP/DuelContext.cs
@@ -851,7 +851,7 @@ namespace Server.Engines.ConPVP
}
if ( hasWinner )
- return winner == null ? (Participant) m_Participants[0] : winner;
+ return winner ?? (Participant) m_Participants[0];
return null;
}
@@ -1851,11 +1851,11 @@ namespace Server.Engines.ConPVP
pack.DropItem( item );
if ( item is BaseWeapon )
- mob.SendLocalizedMessage( 1062001, item.Name == null ? "#" + item.LabelNumber.ToString() : item.Name ); // You can no longer wield your ~1_WEAPON~
+ mob.SendLocalizedMessage( 1062001, item.Name ?? "#" + item.LabelNumber.ToString() ); // You can no longer wield your ~1_WEAPON~
else if ( item is BaseArmor && !(item is BaseShield) )
- mob.SendLocalizedMessage( 1062002, item.Name == null ? "#" + item.LabelNumber.ToString() : item.Name ); // You can no longer wear your ~1_ARMOR~
+ mob.SendLocalizedMessage( 1062002, item.Name ?? "#" + item.LabelNumber.ToString() ); // You can no longer wear your ~1_ARMOR~
else
- mob.SendLocalizedMessage( 1062003, item.Name == null ? "#" + item.LabelNumber.ToString() : item.Name ); // You can no longer equip your ~1_SHIELD~
+ mob.SendLocalizedMessage( 1062003, item.Name ?? "#" + item.LabelNumber.ToString() ); // You can no longer equip your ~1_SHIELD~
}
}
@@ -2080,7 +2080,7 @@ namespace Server.Engines.ConPVP
if ( entry.Mobile == mob )
return entry;
- else if ( entry.Expired )
+ if ( entry.Expired )
m_Entries.RemoveAt( i-- );
}
@@ -2105,11 +2105,9 @@ namespace Server.Engines.ConPVP
return false;
}
- else
- {
- m.SendLocalizedMessage( 1049383 ); // The teleporter doesn't seem to work for you.
- return true;
- }
+
+ m.SendLocalizedMessage( 1049383 ); // The teleporter doesn't seem to work for you.
+ return true;
}
public ExitTeleporter( Serial serial ) : base( serial )
@@ -2319,8 +2317,7 @@ namespace Server.Engines.ConPVP
{
if ( m_Tournament == null )
return $"{dp.Mobile.Name} is dead";
- else
- dp.Mobile.Resurrect();
+ dp.Mobile.Resurrect();
}
if ( m_Tournament == null && CheckCombat( dp.Mobile ) )
diff --git a/Scripts/Engines/ConPVP/Games/BombingRun.cs b/Scripts/Engines/ConPVP/Games/BombingRun.cs
index df4488055..4a4483a7d 100644
--- a/Scripts/Engines/ConPVP/Games/BombingRun.cs
+++ b/Scripts/Engines/ConPVP/Games/BombingRun.cs
@@ -778,10 +778,8 @@ namespace Server.Engines.ConPVP
return true;
}
- else
- {
- return false;
- }
+
+ return false;
}
}
@@ -1158,9 +1156,6 @@ namespace Server.Engines.ConPVP
AddBorderedText( 235 + 15, 105 + ( i * 75 ), 250, 20, pl.Player.Name, 0xFFC000, BlackColor32 );
}
}
- else
- {
- }
AddButton( 314, height - 42, 247, 248, 1, GumpButtonType.Reply, 0 );
}
@@ -1402,8 +1397,7 @@ namespace Server.Engines.ConPVP
{
if ( m_Name != null )
return $"({Name}) ...";
- else
- return "...";
+ return "...";
}
}
diff --git a/Scripts/Engines/ConPVP/Games/CTF.cs b/Scripts/Engines/ConPVP/Games/CTF.cs
index f1165c31c..881ee7b4b 100644
--- a/Scripts/Engines/ConPVP/Games/CTF.cs
+++ b/Scripts/Engines/ConPVP/Games/CTF.cs
@@ -218,9 +218,6 @@ namespace Server.Engines.ConPVP
AddBorderedText( 235 + 15, 105 + ( i * 75 ), 250, 20, pl.Player.Name, 0xFFC000, BlackColor32 );
}
}
- else
- {
- }
AddButton( 314, height - 42, 247, 248, 1, GumpButtonType.Reply, 0 );
}
@@ -449,7 +446,7 @@ namespace Server.Engines.ConPVP
else if ( passTeam == useTeam && passTo.PlaceInBackpack( this ) )
{
passTo.LocalOverheadMessage( MessageType.Regular, 0x59, false,
- $"{@from.Name} has passed you the cookies!");
+ $"{from.Name} has passed you the cookies!");
}
else
{
@@ -496,7 +493,7 @@ namespace Server.Engines.ConPVP
Mobile mob = FindOwner( parent );
if ( mob != null )
- mob.SolidHueOverride = ( m_TeamInfo == null ? -1 : m_TeamInfo.Game.GetColor( mob ) );
+ mob.SolidHueOverride = m_TeamInfo?.Game.GetColor( mob ) ?? -1;
}
public CTFFlag( Serial serial )
diff --git a/Scripts/Engines/ConPVP/Games/DoubleDom.cs b/Scripts/Engines/ConPVP/Games/DoubleDom.cs
index 341350bfc..a147eb3ce 100644
--- a/Scripts/Engines/ConPVP/Games/DoubleDom.cs
+++ b/Scripts/Engines/ConPVP/Games/DoubleDom.cs
@@ -214,9 +214,6 @@ namespace Server.Engines.ConPVP
AddBorderedText( 235 + 15, 105 + ( i * 75 ), 250, 20, pl.Player.Name, 0xFFC000, BlackColor32 );
}
}
- else
- {
- }
AddButton( 314, height - 42, 247, 248, 1, GumpButtonType.Reply, 0 );
}
diff --git a/Scripts/Engines/ConPVP/Games/KingOfTheHill.cs b/Scripts/Engines/ConPVP/Games/KingOfTheHill.cs
index 6dd7750ef..f1c02eb28 100644
--- a/Scripts/Engines/ConPVP/Games/KingOfTheHill.cs
+++ b/Scripts/Engines/ConPVP/Games/KingOfTheHill.cs
@@ -83,10 +83,9 @@ namespace Server.Engines.ConPVP
{
get
{
- if (m_KingTimer != null)
+ if (m_KingTimer != null)
return m_KingTimer.Captures;
- else
- return 0;
+ return 0;
}
}
@@ -136,17 +135,15 @@ namespace Server.Engines.ConPVP
public override bool OnMoveOff(Mobile m)
{
- if (base.OnMoveOff(m))
+ if (base.OnMoveOff(m))
{
if (m_King == m)
DeKingify();
return true;
}
- else
- {
- return false;
- }
+
+ return false;
}
public virtual void OnKingDied(Mobile king, KHTeamInfo kingTeam, Mobile killer, KHTeamInfo killerTeam)
@@ -725,10 +722,9 @@ namespace Server.Engines.ConPVP
public override string ToString()
{
- if (m_Name != null)
+ if (m_Name != null)
return $"({Name}) ...";
- else
- return "...";
+ return "...";
}
}
diff --git a/Scripts/Engines/ConPVP/Ladder.cs b/Scripts/Engines/ConPVP/Ladder.cs
index 4681fe13c..8fb7ec3aa 100644
--- a/Scripts/Engines/ConPVP/Ladder.cs
+++ b/Scripts/Engines/ConPVP/Ladder.cs
@@ -88,9 +88,9 @@ namespace Server.Engines.ConPVP
{
if ( xp >= 22500 )
return 50;
- else if ( xp >= 2500 )
+ if ( xp >= 2500 )
return (10 + ((xp - 2500) / 500));
- else if ( xp < 0 )
+ if ( xp < 0 )
xp = 0;
return m_ShortLevels[xp / 100];
diff --git a/Scripts/Engines/ConPVP/Tournament.cs b/Scripts/Engines/ConPVP/Tournament.cs
index 5b1516787..23318f175 100644
--- a/Scripts/Engines/ConPVP/Tournament.cs
+++ b/Scripts/Engines/ConPVP/Tournament.cs
@@ -601,7 +601,7 @@ namespace Server.Engines.ConPVP
case TournamentStage.Inactive:
{
m_Registrar?.PrivateOverheadMessage( MessageType.Regular,
- 0x35, false, "The tournament is closed.", @from.NetState );
+ 0x35, false, "The tournament is closed.", from.NetState );
break;
}
@@ -610,7 +610,7 @@ namespace Server.Engines.ConPVP
if ( m_Players.Count != tourny.PlayersPerParticipant )
{
m_Registrar?.PrivateOverheadMessage( MessageType.Regular,
- 0x35, false, "You have not yet chosen your team.", @from.NetState );
+ 0x35, false, "You have not yet chosen your team.", from.NetState );
m_From.SendGump( new ConfirmSignupGump( m_From, m_Registrar, m_Tournament, m_Players ) );
break;
@@ -818,7 +818,7 @@ namespace Server.Engines.ConPVP
m_Registrar?.PrivateOverheadMessage( MessageType.Regular,
0x59, false,
- $"As you command m'{(@from.Female ? "Lady" : "Lord")}. I've given your offer to {mob.Name}.", from.NetState );
+ $"As you command m'{(from.Female ? "Lady" : "Lord")}. I've given your offer to {mob.Name}.", from.NetState );
}
}
}
@@ -961,7 +961,7 @@ namespace Server.Engines.ConPVP
AddBorderedText( 22, 22, 294, 20, Center( sb.ToString() ), LabelColor32, BlackColor32 );
AddBorderedText( 22, 50, 294, 40,
- $"You have been asked to partner with {@from.Name} in a tournament. Do you accept?",
+ $"You have been asked to partner with {from.Name} in a tournament. Do you accept?",
0xB0C868, BlackColor32 );
AddImageTiled( 32, 88, 264, 1, 9107 );
@@ -1157,7 +1157,7 @@ namespace Server.Engines.ConPVP
0x59, false, $"{mob.Name} has accepted your offer of partnership.", from.NetState );
m_Registrar.PrivateOverheadMessage( MessageType.Regular,
- 0x59, false, $"You have accepted the partnership with {@from.Name}.", mob.NetState );
+ 0x59, false, $"You have accepted the partnership with {from.Name}.", mob.NetState );
}
}
}
@@ -1174,7 +1174,7 @@ namespace Server.Engines.ConPVP
0x22, false, $"{mob.Name} has declined your offer of partnership.", from.NetState );
m_Registrar.PrivateOverheadMessage( MessageType.Regular,
- 0x22, false, $"You have declined the partnership with {@from.Name}.", mob.NetState );
+ 0x22, false, $"You have declined the partnership with {from.Name}.", mob.NetState );
}
}
}
@@ -3133,8 +3133,8 @@ namespace Server.Engines.ConPVP
$"Guild: {(mob.Guild == null ? "None" : mob.Guild.Name + " [" + mob.Guild.Abbreviation + "]")}", false, false );
AddHtml( 25, 93, 250, 20, $"Rank: {(entry == null ? "N/A" : LadderGump.Rank(entry.Index + 1))}", false, false );
AddHtml( 25, 113, 250, 20, $"Level: {(entry == null ? 0 : Ladder.GetLevel(entry.Experience))}", false, false );
- AddHtml( 25, 133, 250, 20, $"Wins: {(entry == null ? 0 : entry.Wins):N0}", false, false );
- AddHtml( 25, 153, 250, 20, $"Losses: {(entry == null ? 0 : entry.Losses):N0}", false, false );
+ AddHtml( 25, 133, 250, 20, $"Wins: {entry?.Wins ?? 0:N0}", false, false );
+ AddHtml( 25, 153, 250, 20, $"Losses: {entry?.Losses ?? 0:N0}", false, false );
break;
}
diff --git a/Scripts/Engines/Craft/Core/CraftGump.cs b/Scripts/Engines/Craft/Core/CraftGump.cs
index cd357dfd9..33fcc1425 100644
--- a/Scripts/Engines/Craft/Core/CraftGump.cs
+++ b/Scripts/Engines/Craft/Core/CraftGump.cs
@@ -152,7 +152,7 @@ namespace Server.Engines.Craft
string nameString = craftSystem.CraftSubRes2.NameString;
int nameNumber = craftSystem.CraftSubRes2.NameNumber;
- int resIndex = ( context == null ? -1 : context.LastResourceIndex2 );
+ int resIndex = context?.LastResourceIndex2 ?? -1;
Type resourceType = craftSystem.CraftSubRes2.ResType;
@@ -481,7 +481,7 @@ namespace Server.Engines.Craft
{
if ( m_Page == CraftPage.PickResource && index >= 0 && index < system.CraftSubRes.Count )
{
- int groupIndex = ( context == null ? -1 : context.LastGroupIndex );
+ int groupIndex = context?.LastGroupIndex ?? -1;
CraftSubRes res = system.CraftSubRes.GetAt( index );
@@ -499,7 +499,7 @@ namespace Server.Engines.Craft
}
else if ( m_Page == CraftPage.PickResource2 && index >= 0 && index < system.CraftSubRes2.Count )
{
- int groupIndex = ( context == null ? -1 : context.LastGroupIndex );
+ int groupIndex = context?.LastGroupIndex ?? -1;
CraftSubRes res = system.CraftSubRes2.GetAt( index );
diff --git a/Scripts/Engines/Craft/Core/CraftItem.cs b/Scripts/Engines/Craft/Core/CraftItem.cs
index 6d7170ea7..37faa0272 100644
--- a/Scripts/Engines/Craft/Core/CraftItem.cs
+++ b/Scripts/Engines/Craft/Core/CraftItem.cs
@@ -246,30 +246,24 @@ namespace Server.Engines.Craft
message = "You lack the required hit points to make that.";
return false;
}
- else
- {
- consumHits = consume;
- }
+
+ consumHits = consume;
if ( Mana > 0 && from.Mana < Mana )
{
message = "You lack the required mana to make that.";
return false;
}
- else
- {
- consumMana = consume;
- }
+
+ consumMana = consume;
if ( Stam > 0 && from.Stam < Stam )
{
message = "You lack the required stamina to make that.";
return false;
}
- else
- {
- consumStam = consume;
- }
+
+ consumStam = consume;
if ( consumMana )
from.Mana -= Mana;
@@ -786,7 +780,7 @@ namespace Server.Engines.Craft
return true;
}
- else
+
{
CraftRes res = m_arCraftRes.GetAt( index );
diff --git a/Scripts/Engines/Craft/Core/Repair.cs b/Scripts/Engines/Craft/Core/Repair.cs
index 5aae10dce..95e055c7b 100644
--- a/Scripts/Engines/Craft/Core/Repair.cs
+++ b/Scripts/Engines/Craft/Core/Repair.cs
@@ -49,7 +49,7 @@ namespace Server.Engines.Craft
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 != null)? m_Deed.SkillLevel : mob.Skills[skill].Value) / 10);
+ return (40 + (maxHits - curHits)) - (int)((m_Deed?.SkillLevel ?? mob.Skills[skill].Value) / 10);
}
private bool CheckWeaken( Mobile mob, SkillName skill, int curHits, int maxHits )
@@ -75,17 +75,15 @@ namespace Server.Engines.Craft
if ( value < minSkill )
return false; // Too difficult
- else if ( value >= maxSkill )
+ if ( value >= maxSkill )
return true; // No challenge
double chance = (value - minSkill) / (maxSkill - minSkill);
return (chance >= Utility.RandomDouble());
}
- else
- {
- return mob.CheckSkill( skill, difficulty - 25.0, difficulty + 25.0 );
- }
+
+ return mob.CheckSkill( skill, difficulty - 25.0, difficulty + 25.0 );
}
private bool CheckDeed( Mobile from )
@@ -126,39 +124,41 @@ namespace Server.Engines.Craft
|| ( weapon is ButcherKnife )
|| ( weapon is SkinningKnife );
}
- else if ( m_CraftSystem is DefCarpentry )
+
+ if ( m_CraftSystem is DefCarpentry )
{
return ( weapon is Club )
- || ( weapon is BlackStaff )
- || ( weapon is MagicWand )
- #region Temporary
- // TODO: Make these items craftable
- || ( weapon is WildStaff );
+ || ( weapon is BlackStaff )
+ || ( weapon is MagicWand )
+ #region Temporary
+ // TODO: Make these items craftable
+ || ( weapon is WildStaff );
#endregion
}
- else if ( m_CraftSystem is DefBlacksmithy )
+ if ( m_CraftSystem is DefBlacksmithy )
{
return ( weapon is Pitchfork )
- #region Temporary
- // TODO: Make these items craftable
- || ( weapon is RadiantScimitar )
- || ( weapon is WarCleaver )
- || ( weapon is ElvenSpellblade )
- || ( weapon is AssassinSpike )
- || ( weapon is Leafblade )
- || ( weapon is RuneBlade )
- || ( weapon is ElvenMachete )
- || ( weapon is OrnateAxe )
- || ( weapon is DiamondMace );
+ #region Temporary
+ // TODO: Make these items craftable
+ || ( weapon is RadiantScimitar )
+ || ( weapon is WarCleaver )
+ || ( weapon is ElvenSpellblade )
+ || ( weapon is AssassinSpike )
+ || ( weapon is Leafblade )
+ || ( weapon is RuneBlade )
+ || ( weapon is ElvenMachete )
+ || ( weapon is OrnateAxe )
+ || ( weapon is DiamondMace );
#endregion
}
#region Temporary
// TODO: Make these items craftable
- else if ( m_CraftSystem is DefBowFletching )
+ if ( m_CraftSystem is DefBowFletching )
{
return ( weapon is ElvenCompositeLongbow )
- || ( weapon is MagicalShortbow );
+ || ( weapon is MagicalShortbow );
}
+
#endregion
return false;
@@ -184,23 +184,25 @@ namespace Server.Engines.Craft
|| ( armor is HidePants )
|| ( armor is HidePauldrons );
}
- else if ( m_CraftSystem is DefCarpentry )
+
+ if ( m_CraftSystem is DefCarpentry )
{
return ( armor is WingedHelm )
- || ( armor is RavenHelm )
- || ( armor is VultureHelm )
- || ( armor is WoodlandArms )
- || ( armor is WoodlandChest )
- || ( armor is WoodlandGloves )
- || ( armor is WoodlandGorget )
- || ( armor is WoodlandLegs );
+ || ( armor is RavenHelm )
+ || ( armor is VultureHelm )
+ || ( armor is WoodlandArms )
+ || ( armor is WoodlandChest )
+ || ( armor is WoodlandGloves )
+ || ( armor is WoodlandGorget )
+ || ( armor is WoodlandLegs );
}
- else if ( m_CraftSystem is DefBlacksmithy )
+ if ( m_CraftSystem is DefBlacksmithy )
{
return ( armor is Circlet )
- || ( armor is RoyalCirclet )
- || ( armor is GemmedCirclet );
+ || ( armor is RoyalCirclet )
+ || ( armor is GemmedCirclet );
}
+
#endregion
return false;
diff --git a/Scripts/Engines/Craft/DefAlchemy.cs b/Scripts/Engines/Craft/DefAlchemy.cs
index 5699bf87d..083092250 100644
--- a/Scripts/Engines/Craft/DefAlchemy.cs
+++ b/Scripts/Engines/Craft/DefAlchemy.cs
@@ -35,7 +35,7 @@ namespace Server.Engines.Craft
{
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
return 1044038; // You have worn out your tool!
- else if ( !BaseTool.CheckAccessible( tool, from ) )
+ if ( !BaseTool.CheckAccessible( tool, from ) )
return 1044263; // The tool must be on your person to use.
return 0;
@@ -65,27 +65,20 @@ namespace Server.Engines.Craft
from.AddToBackpack( new Bottle() );
return 500287; // You fail to create a useful potion.
}
- else
- {
- return 1044043; // You failed to create the item, and some of your materials are lost.
- }
- }
- else
- {
- from.PlaySound( 0x240 ); // Sound of a filling bottle
- if ( IsPotion( item.ItemType ) )
- {
- if ( quality == -1 )
- return 1048136; // You create the potion and pour it into a keg.
- else
- return 500279; // You pour the potion into a bottle...
- }
- else
- {
- return 1044154; // You create the item.
- }
+ return 1044043; // You failed to create the item, and some of your materials are lost.
}
+
+ from.PlaySound( 0x240 ); // Sound of a filling bottle
+
+ if ( IsPotion( item.ItemType ) )
+ {
+ if ( quality == -1 )
+ return 1048136; // You create the potion and pour it into a keg.
+ return 500279; // You pour the potion into a bottle...
+ }
+
+ return 1044154; // You create the item.
}
public override void InitCraftList()
diff --git a/Scripts/Engines/Craft/DefBlacksmithy.cs b/Scripts/Engines/Craft/DefBlacksmithy.cs
index 364225438..1b9cd2b6b 100644
--- a/Scripts/Engines/Craft/DefBlacksmithy.cs
+++ b/Scripts/Engines/Craft/DefBlacksmithy.cs
@@ -112,9 +112,9 @@ namespace Server.Engines.Craft
{
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
return 1044038; // You have worn out your tool!
- else if ( !BaseTool.CheckTool( tool, from ) )
+ if ( !BaseTool.CheckTool( tool, from ) )
return 1048146; // If you have a tool equipped, you must use that tool.
- else if ( !BaseTool.CheckAccessible( tool, from ) )
+ if ( !BaseTool.CheckAccessible( tool, from ) )
return 1044263; // The tool must be on your person to use.
bool anvil, forge;
@@ -161,20 +161,16 @@ namespace Server.Engines.Craft
{
if ( lostMaterial )
return 1044043; // You failed to create the item, and some of your materials are lost.
- else
- return 1044157; // You failed to create the item, but no materials were lost.
- }
- else
- {
- if ( quality == 0 )
- return 502785; // You were barely able to make this item. It's quality is below average.
- else if ( makersMark && quality == 2 )
- return 1044156; // You create an exceptional quality item and affix your maker's mark.
- else if ( quality == 2 )
- return 1044155; // You create an exceptional quality item.
- else
- return 1044154; // You create the item.
+ return 1044157; // You failed to create the item, but no materials were lost.
}
+
+ if ( quality == 0 )
+ return 502785; // You were barely able to make this item. It's quality is below average.
+ if ( makersMark && quality == 2 )
+ return 1044156; // You create an exceptional quality item and affix your maker's mark.
+ if ( quality == 2 )
+ return 1044155; // You create an exceptional quality item.
+ return 1044154; // You create the item.
}
public override void InitCraftList()
diff --git a/Scripts/Engines/Craft/DefBowFletching.cs b/Scripts/Engines/Craft/DefBowFletching.cs
index 61e86f81e..3c0c4345e 100644
--- a/Scripts/Engines/Craft/DefBowFletching.cs
+++ b/Scripts/Engines/Craft/DefBowFletching.cs
@@ -35,7 +35,7 @@ namespace Server.Engines.Craft
{
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
return 1044038; // You have worn out your tool!
- else if ( !BaseTool.CheckAccessible( tool, from ) )
+ if ( !BaseTool.CheckAccessible( tool, from ) )
return 1044263; // The tool must be on your person to use.
return 0;
@@ -59,20 +59,16 @@ namespace Server.Engines.Craft
{
if ( lostMaterial )
return 1044043; // You failed to create the item, and some of your materials are lost.
- else
- return 1044157; // You failed to create the item, but no materials were lost.
- }
- else
- {
- if ( quality == 0 )
- return 502785; // You were barely able to make this item. It's quality is below average.
- else if ( makersMark && quality == 2 )
- return 1044156; // You create an exceptional quality item and affix your maker's mark.
- else if ( quality == 2 )
- return 1044155; // You create an exceptional quality item.
- else
- return 1044154; // You create the item.
+ return 1044157; // You failed to create the item, but no materials were lost.
}
+
+ if ( quality == 0 )
+ return 502785; // You were barely able to make this item. It's quality is below average.
+ if ( makersMark && quality == 2 )
+ return 1044156; // You create an exceptional quality item and affix your maker's mark.
+ if ( quality == 2 )
+ return 1044155; // You create an exceptional quality item.
+ return 1044154; // You create the item.
}
public override CraftECA ECA => CraftECA.FiftyPercentChanceMinusTenPercent;
diff --git a/Scripts/Engines/Craft/DefCarpentry.cs b/Scripts/Engines/Craft/DefCarpentry.cs
index 39e9e5dc9..a760c1d13 100644
--- a/Scripts/Engines/Craft/DefCarpentry.cs
+++ b/Scripts/Engines/Craft/DefCarpentry.cs
@@ -35,7 +35,7 @@ namespace Server.Engines.Craft
{
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
return 1044038; // You have worn out your tool!
- else if ( !BaseTool.CheckAccessible( tool, from ) )
+ if ( !BaseTool.CheckAccessible( tool, from ) )
return 1044263; // The tool must be on your person to use.
return 0;
@@ -59,20 +59,16 @@ namespace Server.Engines.Craft
{
if ( lostMaterial )
return 1044043; // You failed to create the item, and some of your materials are lost.
- else
- return 1044157; // You failed to create the item, but no materials were lost.
- }
- else
- {
- if ( quality == 0 )
- return 502785; // You were barely able to make this item. It's quality is below average.
- else if ( makersMark && quality == 2 )
- return 1044156; // You create an exceptional quality item and affix your maker's mark.
- else if ( quality == 2 )
- return 1044155; // You create an exceptional quality item.
- else
- return 1044154; // You create the item.
+ return 1044157; // You failed to create the item, but no materials were lost.
}
+
+ if ( quality == 0 )
+ return 502785; // You were barely able to make this item. It's quality is below average.
+ if ( makersMark && quality == 2 )
+ return 1044156; // You create an exceptional quality item and affix your maker's mark.
+ if ( quality == 2 )
+ return 1044155; // You create an exceptional quality item.
+ return 1044154; // You create the item.
}
public override void InitCraftList()
diff --git a/Scripts/Engines/Craft/DefCartography.cs b/Scripts/Engines/Craft/DefCartography.cs
index ef8099d11..52be748ba 100644
--- a/Scripts/Engines/Craft/DefCartography.cs
+++ b/Scripts/Engines/Craft/DefCartography.cs
@@ -35,7 +35,7 @@ namespace Server.Engines.Craft
{
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
return 1044038; // You have worn out your tool!
- else if ( !BaseTool.CheckAccessible( tool, from ) )
+ if ( !BaseTool.CheckAccessible( tool, from ) )
return 1044263; // The tool must be on your person to use.
return 0;
@@ -55,20 +55,16 @@ namespace Server.Engines.Craft
{
if ( lostMaterial )
return 1044043; // You failed to create the item, and some of your materials are lost.
- else
- return 1044157; // You failed to create the item, but no materials were lost.
- }
- else
- {
- if ( quality == 0 )
- return 502785; // You were barely able to make this item. It's quality is below average.
- else if ( makersMark && quality == 2 )
- return 1044156; // You create an exceptional quality item and affix your maker's mark.
- else if ( quality == 2 )
- return 1044155; // You create an exceptional quality item.
- else
- return 1044154; // You create the item.
+ return 1044157; // You failed to create the item, but no materials were lost.
}
+
+ if ( quality == 0 )
+ return 502785; // You were barely able to make this item. It's quality is below average.
+ if ( makersMark && quality == 2 )
+ return 1044156; // You create an exceptional quality item and affix your maker's mark.
+ if ( quality == 2 )
+ return 1044155; // You create an exceptional quality item.
+ return 1044154; // You create the item.
}
public override void InitCraftList()
diff --git a/Scripts/Engines/Craft/DefCooking.cs b/Scripts/Engines/Craft/DefCooking.cs
index 0ba335a11..0a8340dd6 100644
--- a/Scripts/Engines/Craft/DefCooking.cs
+++ b/Scripts/Engines/Craft/DefCooking.cs
@@ -37,7 +37,7 @@ namespace Server.Engines.Craft
{
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
return 1044038; // You have worn out your tool!
- else if ( !BaseTool.CheckAccessible( tool, from ) )
+ if ( !BaseTool.CheckAccessible( tool, from ) )
return 1044263; // The tool must be on your person to use.
return 0;
@@ -56,20 +56,16 @@ namespace Server.Engines.Craft
{
if ( lostMaterial )
return 1044043; // You failed to create the item, and some of your materials are lost.
- else
- return 1044157; // You failed to create the item, but no materials were lost.
- }
- else
- {
- if ( quality == 0 )
- return 502785; // You were barely able to make this item. It's quality is below average.
- else if ( makersMark && quality == 2 )
- return 1044156; // You create an exceptional quality item and affix your maker's mark.
- else if ( quality == 2 )
- return 1044155; // You create an exceptional quality item.
- else
- return 1044154; // You create the item.
+ return 1044157; // You failed to create the item, but no materials were lost.
}
+
+ if ( quality == 0 )
+ return 502785; // You were barely able to make this item. It's quality is below average.
+ if ( makersMark && quality == 2 )
+ return 1044156; // You create an exceptional quality item and affix your maker's mark.
+ if ( quality == 2 )
+ return 1044155; // You create an exceptional quality item.
+ return 1044154; // You create the item.
}
public override void InitCraftList()
diff --git a/Scripts/Engines/Craft/DefGlassblowing.cs b/Scripts/Engines/Craft/DefGlassblowing.cs
index b42207510..182e48188 100644
--- a/Scripts/Engines/Craft/DefGlassblowing.cs
+++ b/Scripts/Engines/Craft/DefGlassblowing.cs
@@ -91,22 +91,18 @@ namespace Server.Engines.Craft
{
if ( lostMaterial )
return 1044043; // You failed to create the item, and some of your materials are lost.
- else
- return 1044157; // You failed to create the item, but no materials were lost.
+ return 1044157; // You failed to create the item, but no materials were lost.
}
- else
- {
- from.PlaySound( 0x41 ); // glass breaking
- if ( quality == 0 )
- return 502785; // You were barely able to make this item. It's quality is below average.
- else if ( makersMark && quality == 2 )
- return 1044156; // You create an exceptional quality item and affix your maker's mark.
- else if ( quality == 2 )
- return 1044155; // You create an exceptional quality item.
- else
- return 1044154; // You create the item.
- }
+ from.PlaySound( 0x41 ); // glass breaking
+
+ if ( quality == 0 )
+ return 502785; // You were barely able to make this item. It's quality is below average.
+ if ( makersMark && quality == 2 )
+ return 1044156; // You create an exceptional quality item and affix your maker's mark.
+ if ( quality == 2 )
+ return 1044155; // You create an exceptional quality item.
+ return 1044154; // You create the item.
}
public override void InitCraftList()
diff --git a/Scripts/Engines/Craft/DefInscription.cs b/Scripts/Engines/Craft/DefInscription.cs
index ac3a08771..d13c88ef1 100644
--- a/Scripts/Engines/Craft/DefInscription.cs
+++ b/Scripts/Engines/Craft/DefInscription.cs
@@ -82,28 +82,21 @@ namespace Server.Engines.Craft
{
if ( lostMaterial )
return 1044043; // You failed to create the item, and some of your materials are lost.
- else
- return 1044157; // You failed to create the item, but no materials were lost.
- }
- else
- {
- if ( quality == 0 )
- return 502785; // You were barely able to make this item. It's quality is below average.
- else if ( makersMark && quality == 2 )
- return 1044156; // You create an exceptional quality item and affix your maker's mark.
- else if ( quality == 2 )
- return 1044155; // You create an exceptional quality item.
- else
- return 1044154; // You create the item.
+ return 1044157; // You failed to create the item, but no materials were lost.
}
+
+ if ( quality == 0 )
+ return 502785; // You were barely able to make this item. It's quality is below average.
+ if ( makersMark && quality == 2 )
+ return 1044156; // You create an exceptional quality item and affix your maker's mark.
+ if ( quality == 2 )
+ return 1044155; // You create an exceptional quality item.
+ return 1044154; // You create the item.
}
- else
- {
- if ( failed )
- return 501630; // You fail to inscribe the scroll, and the scroll is ruined.
- else
- return 501629; // You inscribe the spell and put the scroll in your backpack.
- }
+
+ if ( failed )
+ return 501630; // You fail to inscribe the scroll, and the scroll is ruined.
+ return 501629; // You inscribe the spell and put the scroll in your backpack.
}
private int m_Circle, m_Mana;
diff --git a/Scripts/Engines/Craft/DefMasonry.cs b/Scripts/Engines/Craft/DefMasonry.cs
index 1da1743a9..6b1dda543 100644
--- a/Scripts/Engines/Craft/DefMasonry.cs
+++ b/Scripts/Engines/Craft/DefMasonry.cs
@@ -84,20 +84,16 @@ namespace Server.Engines.Craft
{
if ( lostMaterial )
return 1044043; // You failed to create the item, and some of your materials are lost.
- else
- return 1044157; // You failed to create the item, but no materials were lost.
- }
- else
- {
- if ( quality == 0 )
- return 502785; // You were barely able to make this item. It's quality is below average.
- else if ( makersMark && quality == 2 )
- return 1044156; // You create an exceptional quality item and affix your maker's mark.
- else if ( quality == 2 )
- return 1044155; // You create an exceptional quality item.
- else
- return 1044154; // You create the item.
+ return 1044157; // You failed to create the item, but no materials were lost.
}
+
+ if ( quality == 0 )
+ return 502785; // You were barely able to make this item. It's quality is below average.
+ if ( makersMark && quality == 2 )
+ return 1044156; // You create an exceptional quality item and affix your maker's mark.
+ if ( quality == 2 )
+ return 1044155; // You create an exceptional quality item.
+ return 1044154; // You create the item.
}
public override void InitCraftList()
diff --git a/Scripts/Engines/Craft/DefTailoring.cs b/Scripts/Engines/Craft/DefTailoring.cs
index ba74d7e71..91e7ae955 100644
--- a/Scripts/Engines/Craft/DefTailoring.cs
+++ b/Scripts/Engines/Craft/DefTailoring.cs
@@ -37,7 +37,7 @@ namespace Server.Engines.Craft
{
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
return 1044038; // You have worn out your tool!
- else if ( !BaseTool.CheckAccessible( tool, from ) )
+ if ( !BaseTool.CheckAccessible( tool, from ) )
return 1044263; // The tool must be on your person to use.
return 0;
@@ -79,20 +79,16 @@ namespace Server.Engines.Craft
{
if ( lostMaterial )
return 1044043; // You failed to create the item, and some of your materials are lost.
- else
- return 1044157; // You failed to create the item, but no materials were lost.
- }
- else
- {
- if ( quality == 0 )
- return 502785; // You were barely able to make this item. It's quality is below average.
- else if ( makersMark && quality == 2 )
- return 1044156; // You create an exceptional quality item and affix your maker's mark.
- else if ( quality == 2 )
- return 1044155; // You create an exceptional quality item.
- else
- return 1044154; // You create the item.
+ return 1044157; // You failed to create the item, but no materials were lost.
}
+
+ if ( quality == 0 )
+ return 502785; // You were barely able to make this item. It's quality is below average.
+ if ( makersMark && quality == 2 )
+ return 1044156; // You create an exceptional quality item and affix your maker's mark.
+ if ( quality == 2 )
+ return 1044155; // You create an exceptional quality item.
+ return 1044154; // You create the item.
}
public override void InitCraftList()
diff --git a/Scripts/Engines/Craft/DefTinkering.cs b/Scripts/Engines/Craft/DefTinkering.cs
index 88e4a0e2e..711f6503d 100644
--- a/Scripts/Engines/Craft/DefTinkering.cs
+++ b/Scripts/Engines/Craft/DefTinkering.cs
@@ -40,9 +40,9 @@ namespace Server.Engines.Craft
{
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
return 1044038; // You have worn out your tool!
- else if ( !BaseTool.CheckAccessible( tool, from ) )
+ if ( !BaseTool.CheckAccessible( tool, from ) )
return 1044263; // The tool must be on your person to use.
- else if ( itemType != null && ( itemType.IsSubclassOf( typeof( BaseFactionTrapDeed ) ) || itemType == typeof( FactionTrapRemovalKit ) ) && Faction.Find( from ) == null )
+ if ( itemType != null && ( itemType.IsSubclassOf( typeof( BaseFactionTrapDeed ) ) || itemType == typeof( FactionTrapRemovalKit ) ) && Faction.Find( from ) == null )
return 1044573; // You have to be in a faction to do that.
return 0;
@@ -91,20 +91,16 @@ namespace Server.Engines.Craft
{
if ( lostMaterial )
return 1044043; // You failed to create the item, and some of your materials are lost.
- else
- return 1044157; // You failed to create the item, but no materials were lost.
- }
- else
- {
- if ( quality == 0 )
- return 502785; // You were barely able to make this item. It's quality is below average.
- else if ( makersMark && quality == 2 )
- return 1044156; // You create an exceptional quality item and affix your maker's mark.
- else if ( quality == 2 )
- return 1044155; // You create an exceptional quality item.
- else
- return 1044154; // You create the item.
+ return 1044157; // You failed to create the item, but no materials were lost.
}
+
+ if ( quality == 0 )
+ return 502785; // You were barely able to make this item. It's quality is below average.
+ if ( makersMark && quality == 2 )
+ return 1044156; // You create an exceptional quality item and affix your maker's mark.
+ if ( quality == 2 )
+ return 1044155; // You create an exceptional quality item.
+ return 1044154; // You create the item.
}
public override bool ConsumeOnFailure( Mobile from, Type resourceType, CraftItem craftItem )
@@ -417,11 +413,9 @@ namespace Server.Engines.Craft
{
return false;
}
- else
- {
- m_Container = container;
- return true;
- }
+
+ m_Container = container;
+ return true;
}
public override void EndCraftAction()
diff --git a/Scripts/Engines/Factions/Core/Faction.cs b/Scripts/Engines/Factions/Core/Faction.cs
index f0bf26ce9..922a58de0 100644
--- a/Scripts/Engines/Factions/Core/Faction.cs
+++ b/Scripts/Engines/Factions/Core/Faction.cs
@@ -1014,7 +1014,7 @@ namespace Server.Factions
if ( pack != null )
{
- Container killerPack = ( killer == null ? null : killer.Backpack );
+ Container killerPack = killer?.Backpack;
Item[] sigils = pack.FindItemsByType( typeof( Sigil ) );
for ( int i = 0; i < sigils.Length; ++i )
diff --git a/Scripts/Engines/Factions/Core/FactionState.cs b/Scripts/Engines/Factions/Core/FactionState.cs
index c38141a26..88fb1d8e5 100644
--- a/Scripts/Engines/Factions/Core/FactionState.cs
+++ b/Scripts/Engines/Factions/Core/FactionState.cs
@@ -59,7 +59,8 @@ namespace Server.Factions
ps.IsActive = false;
continue;
}
- else if ( ps.KillPoints > 0 )
+
+ if ( ps.KillPoints > 0 )
{
int atrophy = ( ps.KillPoints + 9 ) / 10;
ps.KillPoints -= atrophy;
diff --git a/Scripts/Engines/Factions/Core/Keywords.cs b/Scripts/Engines/Factions/Core/Keywords.cs
index 4c401d196..c5ba6a414 100644
--- a/Scripts/Engines/Factions/Core/Keywords.cs
+++ b/Scripts/Engines/Factions/Core/Keywords.cs
@@ -143,7 +143,7 @@ namespace Server.Factions
{
Faction faction = Faction.Find( from );
- faction?.BeginHonorLeadership( @from );
+ faction?.BeginHonorLeadership( from );
break;
}
diff --git a/Scripts/Engines/Factions/Gumps/FactionGump.cs b/Scripts/Engines/Factions/Gumps/FactionGump.cs
index e89acb3db..18816619f 100644
--- a/Scripts/Engines/Factions/Gumps/FactionGump.cs
+++ b/Scripts/Engines/Factions/Gumps/FactionGump.cs
@@ -21,11 +21,9 @@ namespace Server.Factions
index = offset / ButtonTypes;
return true;
}
- else
- {
- type = index = 0;
- return false;
- }
+
+ type = index = 0;
+ return false;
}
public static bool Exists( Mobile mob )
diff --git a/Scripts/Engines/Factions/Gumps/FactionStoneGump.cs b/Scripts/Engines/Factions/Gumps/FactionStoneGump.cs
index 0f8bb59c5..f97e88435 100644
--- a/Scripts/Engines/Factions/Gumps/FactionStoneGump.cs
+++ b/Scripts/Engines/Factions/Gumps/FactionStoneGump.cs
@@ -128,10 +128,10 @@ namespace Server.Factions
AddHtml( 120, 100, 150, 20, from.Name, false, false );
AddHtmlLocalized( 20, 130, 100, 20, 1018064, false, false ); // score :
- AddHtml( 120, 130, 100, 20, (pl != null ? pl.KillPoints : 0).ToString(), false, false );
+ AddHtml( 120, 130, 100, 20, (pl?.KillPoints ?? 0).ToString(), false, false );
AddHtmlLocalized( 20, 160, 100, 20, 1011446, false, false ); // Rank :
- AddHtml( 120, 160, 100, 20, (pl != null ? pl.Rank.Rank : 0).ToString(), false, false );
+ AddHtml( 120, 160, 100, 20, (pl?.Rank.Rank ?? 0).ToString(), false, false );
AddHtmlLocalized( 55, 250, 100, 20, 1011447, false, false ); // BACK
AddButton( 20, 250, 4005, 4007, 0, GumpButtonType.Page, 1 );
diff --git a/Scripts/Engines/Factions/Gumps/TownStoneGump.cs b/Scripts/Engines/Factions/Gumps/TownStoneGump.cs
index 964673a89..123e07136 100644
--- a/Scripts/Engines/Factions/Gumps/TownStoneGump.cs
+++ b/Scripts/Engines/Factions/Gumps/TownStoneGump.cs
@@ -118,7 +118,8 @@ namespace Server.Factions
from.SendLocalizedMessage( 1010339 ); // You no longer control this city
return;
}
- else if ( m_Town.Sheriff != null )
+
+ if ( m_Town.Sheriff != null )
{
from.SendLocalizedMessage( 1010342 ); // You must fire your Sheriff before you can elect a new one
}
diff --git a/Scripts/Engines/Factions/Items/BaseMonolith.cs b/Scripts/Engines/Factions/Items/BaseMonolith.cs
index e9ba53e5c..7066a40ba 100644
--- a/Scripts/Engines/Factions/Items/BaseMonolith.cs
+++ b/Scripts/Engines/Factions/Items/BaseMonolith.cs
@@ -47,7 +47,7 @@ namespace Server.Factions
set
{
m_Faction = value;
- Hue = ( m_Faction == null ? 0 : m_Faction.Definition.HuePrimary );
+ Hue = m_Faction?.Definition.HuePrimary ?? 0;
}
}
diff --git a/Scripts/Engines/Factions/Items/FactionStone.cs b/Scripts/Engines/Factions/Items/FactionStone.cs
index c47c12792..ed0a1d287 100644
--- a/Scripts/Engines/Factions/Items/FactionStone.cs
+++ b/Scripts/Engines/Factions/Items/FactionStone.cs
@@ -15,7 +15,7 @@ namespace Server.Factions
{
m_Faction = value;
- AssignName( m_Faction == null ? null : m_Faction.Definition.FactionStoneName );
+ AssignName( m_Faction?.Definition.FactionStoneName );
}
}
diff --git a/Scripts/Engines/Factions/Items/JoinStone.cs b/Scripts/Engines/Factions/Items/JoinStone.cs
index be58120ea..caf370490 100644
--- a/Scripts/Engines/Factions/Items/JoinStone.cs
+++ b/Scripts/Engines/Factions/Items/JoinStone.cs
@@ -15,8 +15,8 @@ namespace Server.Factions
{
m_Faction = value;
- Hue = ( m_Faction == null ? 0 : m_Faction.Definition.HueJoin );
- AssignName( m_Faction == null ? null : m_Faction.Definition.SignupName );
+ Hue = m_Faction?.Definition.HueJoin ?? 0;
+ AssignName( m_Faction?.Definition.SignupName );
}
}
diff --git a/Scripts/Engines/Factions/Items/Power Faction Items/BloodRose.cs b/Scripts/Engines/Factions/Items/Power Faction Items/BloodRose.cs
index ca7b1222a..68c63934a 100644
--- a/Scripts/Engines/Factions/Items/Power Faction Items/BloodRose.cs
+++ b/Scripts/Engines/Factions/Items/Power Faction Items/BloodRose.cs
@@ -30,11 +30,11 @@ namespace Server {
from.AddStatMod( new StatMod( StatType.All, "blood-rose", amount, TimeSpan.FromMinutes( time ) ) );
return true;
- } else {
- from.SendLocalizedMessage( 1062927 ); // You have eaten one of these recently and eating another would provide no benefit.
-
- return false;
}
+
+ from.SendLocalizedMessage( 1062927 ); // You have eaten one of these recently and eating another would provide no benefit.
+
+ return false;
}
public override void Serialize( GenericWriter writer ) {
@@ -49,4 +49,4 @@ namespace Server {
int version = reader.ReadEncodedInt();
}
}
-}
\ No newline at end of file
+}
diff --git a/Scripts/Engines/Factions/Items/Power Faction Items/PowerFactionItem.cs b/Scripts/Engines/Factions/Items/Power Faction Items/PowerFactionItem.cs
index 6698cf66c..313b164d0 100644
--- a/Scripts/Engines/Factions/Items/Power Faction Items/PowerFactionItem.cs
+++ b/Scripts/Engines/Factions/Items/Power Faction Items/PowerFactionItem.cs
@@ -73,7 +73,8 @@ namespace Server {
weight = Utility.Random( weight );
- foreach ( WeightedItem item in _items ) {
+ foreach ( WeightedItem item in _items )
+ {
if ( weight < item.Weight ) {
Item obj = item.Construct();
@@ -95,9 +96,9 @@ namespace Server {
}
break;
- } else {
- weight -= item.Weight;
}
+
+ weight -= item.Weight;
}
}
}
diff --git a/Scripts/Engines/Factions/Items/Sigil.cs b/Scripts/Engines/Factions/Items/Sigil.cs
index 7ee2f54f6..dfae7bfa8 100644
--- a/Scripts/Engines/Factions/Items/Sigil.cs
+++ b/Scripts/Engines/Factions/Items/Sigil.cs
@@ -103,7 +103,7 @@ namespace Server.Factions
public void Update()
{
- ItemID = ( m_Town == null ? 0x1869 : m_Town.Definition.SigilID );
+ ItemID = m_Town?.Definition.SigilID ?? 0x1869;
if ( m_Town == null )
AssignName( null );
diff --git a/Scripts/Engines/Factions/Items/Silver.cs b/Scripts/Engines/Factions/Items/Silver.cs
index 9cd7b0c3f..a214561a1 100644
--- a/Scripts/Engines/Factions/Items/Silver.cs
+++ b/Scripts/Engines/Factions/Items/Silver.cs
@@ -29,10 +29,9 @@ namespace Server.Factions
{
if ( Amount <= 1 )
return 0x2E4;
- else if ( Amount <= 5 )
+ if ( Amount <= 5 )
return 0x2E5;
- else
- return 0x2E6;
+ return 0x2E6;
}
public override void Serialize( GenericWriter writer )
diff --git a/Scripts/Engines/Factions/Items/StrongholdMonolith.cs b/Scripts/Engines/Factions/Items/StrongholdMonolith.cs
index 11b8f9667..cc44b15f6 100644
--- a/Scripts/Engines/Factions/Items/StrongholdMonolith.cs
+++ b/Scripts/Engines/Factions/Items/StrongholdMonolith.cs
@@ -6,7 +6,7 @@ namespace Server.Factions
public override void OnTownChanged()
{
- AssignName( Town == null ? null : Town.Definition.StrongholdMonolithName );
+ AssignName( Town?.Definition.StrongholdMonolithName );
}
public StrongholdMonolith() : this( null, null )
diff --git a/Scripts/Engines/Factions/Items/TownMonolith.cs b/Scripts/Engines/Factions/Items/TownMonolith.cs
index f319e3c27..77626189a 100644
--- a/Scripts/Engines/Factions/Items/TownMonolith.cs
+++ b/Scripts/Engines/Factions/Items/TownMonolith.cs
@@ -6,7 +6,7 @@ namespace Server.Factions
public override void OnTownChanged()
{
- AssignName( Town == null ? null : Town.Definition.TownMonolithName );
+ AssignName( Town?.Definition.TownMonolithName );
}
public TownMonolith() : this( null )
diff --git a/Scripts/Engines/Factions/Items/TownStone.cs b/Scripts/Engines/Factions/Items/TownStone.cs
index 764fda584..af2b5e833 100644
--- a/Scripts/Engines/Factions/Items/TownStone.cs
+++ b/Scripts/Engines/Factions/Items/TownStone.cs
@@ -14,7 +14,7 @@ namespace Server.Factions
{
m_Town = value;
- AssignName( m_Town == null ? null : m_Town.Definition.TownStoneName );
+ AssignName( m_Town?.Definition.TownStoneName );
}
}
diff --git a/Scripts/Engines/Factions/Items/Traps/BaseFactionTrap.cs b/Scripts/Engines/Factions/Items/Traps/BaseFactionTrap.cs
index 47f931969..439ad1c04 100644
--- a/Scripts/Engines/Factions/Items/Traps/BaseFactionTrap.cs
+++ b/Scripts/Engines/Factions/Items/Traps/BaseFactionTrap.cs
@@ -93,7 +93,7 @@ namespace Server.Factions
if ( from.Alive )
m_Placer.SendMessage( "You have earned {0} silver pieces because {1} fell for your trap.", silverGiven, from.Name );
else
- m_Placer.SendLocalizedMessage( 1042736, $"{silverGiven} silver\t{@from.Name}"); // You have earned ~1_SILVER_AMOUNT~ pieces for vanquishing ~2_PLAYER_NAME~!
+ m_Placer.SendLocalizedMessage( 1042736, $"{silverGiven} silver\t{from.Name}"); // You have earned ~1_SILVER_AMOUNT~ pieces for vanquishing ~2_PLAYER_NAME~!
}
victimState.OnGivenSilverTo( m_Placer );
diff --git a/Scripts/Engines/Factions/Mobiles/FactionWarHorse.cs b/Scripts/Engines/Factions/Mobiles/FactionWarHorse.cs
index bc14aec45..e71f582e2 100644
--- a/Scripts/Engines/Factions/Mobiles/FactionWarHorse.cs
+++ b/Scripts/Engines/Factions/Mobiles/FactionWarHorse.cs
@@ -15,8 +15,8 @@ namespace Server.Factions
{
m_Faction = value;
- Body = ( m_Faction == null ? 0xE2 : m_Faction.Definition.WarHorseBody );
- ItemID = ( m_Faction == null ? 0x3EA0 : m_Faction.Definition.WarHorseItem );
+ Body = m_Faction?.Definition.WarHorseBody ?? 0xE2;
+ ItemID = m_Faction?.Definition.WarHorseItem ?? 0x3EA0;
}
}
diff --git a/Scripts/Engines/Factions/Mobiles/Guards/GuardAI.cs b/Scripts/Engines/Factions/Mobiles/Guards/GuardAI.cs
index ad41b1861..536ed39e7 100644
--- a/Scripts/Engines/Factions/Mobiles/Guards/GuardAI.cs
+++ b/Scripts/Engines/Factions/Mobiles/Guards/GuardAI.cs
@@ -310,45 +310,43 @@ namespace Server.Factions
return active;
}
- else
+
+ Map map = m_Mobile.Map;
+
+ if ( map != null )
{
- Map map = m_Mobile.Map;
+ Mobile active = null, inactive = null;
+ double actPrio = 0.0, inactPrio = 0.0;
- if ( map != null )
+ Mobile comb = m_Mobile.Combatant;
+
+ if ( comb != null && !comb.Deleted && comb.Alive && !comb.IsDeadBondedPet && CanDispel( comb ) )
{
- Mobile active = null, inactive = null;
- double actPrio = 0.0, inactPrio = 0.0;
+ active = inactive = comb;
+ actPrio = inactPrio = m_Mobile.GetDistanceToSqrt( comb );
+ }
- Mobile comb = m_Mobile.Combatant;
-
- if ( comb != null && !comb.Deleted && comb.Alive && !comb.IsDeadBondedPet && CanDispel( comb ) )
+ foreach ( Mobile m in m_Mobile.GetMobilesInRange( 12 ) )
+ {
+ if ( m != m_Mobile && CanDispel( m ) )
{
- active = inactive = comb;
- actPrio = inactPrio = m_Mobile.GetDistanceToSqrt( comb );
- }
+ double prio = m_Mobile.GetDistanceToSqrt( m );
- foreach ( Mobile m in m_Mobile.GetMobilesInRange( 12 ) )
- {
- if ( m != m_Mobile && CanDispel( m ) )
+ if ( !activeOnly && (inactive == null || prio < inactPrio) )
{
- double prio = m_Mobile.GetDistanceToSqrt( m );
+ inactive = m;
+ inactPrio = prio;
+ }
- if ( !activeOnly && (inactive == null || prio < inactPrio) )
- {
- inactive = m;
- inactPrio = prio;
- }
-
- if ( (m_Mobile.Combatant == m || m.Combatant == m_Mobile) && (active == null || prio < actPrio) )
- {
- active = m;
- actPrio = prio;
- }
+ if ( (m_Mobile.Combatant == m || m.Combatant == m_Mobile) && (active == null || prio < actPrio) )
+ {
+ active = m;
+ actPrio = prio;
}
}
-
- return active != null ? active : inactive;
}
+
+ return active ?? inactive;
}
return null;
@@ -473,7 +471,7 @@ namespace Server.Factions
{
Target targ = m_Guard.Target;
- Mobile toHarm = ( dispelTarget == null ? combatant : dispelTarget );
+ Mobile toHarm = dispelTarget ?? combatant;
if ( (targ.Flags & TargetFlags.Harmful) != 0 && toHarm != null )
{
diff --git a/Scripts/Engines/Harvest/Core/HarvestDefinition.cs b/Scripts/Engines/Harvest/Core/HarvestDefinition.cs
index 8bf07476c..31b66194b 100644
--- a/Scripts/Engines/Harvest/Core/HarvestDefinition.cs
+++ b/Scripts/Engines/Harvest/Core/HarvestDefinition.cs
@@ -225,15 +225,13 @@ namespace Server.Engines.Harvest
return contains;
}
- else
- {
- int dist = -1;
- for ( int i = 0; dist < 0 && i < m_Tiles.Length; ++i )
- dist = ( m_Tiles[i] - tileID );
+ int dist = -1;
- return ( dist == 0 );
- }
+ for ( int i = 0; dist < 0 && i < m_Tiles.Length; ++i )
+ dist = ( m_Tiles[i] - tileID );
+
+ return ( dist == 0 );
}
}
}
diff --git a/Scripts/Engines/Harvest/Core/HarvestSystem.cs b/Scripts/Engines/Harvest/Core/HarvestSystem.cs
index 0ecc07540..66123a748 100644
--- a/Scripts/Engines/Harvest/Core/HarvestSystem.cs
+++ b/Scripts/Engines/Harvest/Core/HarvestSystem.cs
@@ -107,7 +107,8 @@ namespace Server.Engines.Harvest
OnBadHarvestTarget( from, tool, toHarvest );
return;
}
- else if ( !def.Validate( tileID ) )
+
+ if ( !def.Validate( tileID ) )
{
OnBadHarvestTarget( from, tool, toHarvest );
return;
@@ -115,9 +116,9 @@ namespace Server.Engines.Harvest
if ( !CheckRange( from, tool, def, map, loc, true ) )
return;
- else if ( !CheckResources( from, tool, def, map, loc, true ) )
+ if ( !CheckResources( from, tool, def, map, loc, true ) )
return;
- else if ( !CheckHarvest( from, tool, def, toHarvest ) )
+ if ( !CheckHarvest( from, tool, def, toHarvest ) )
return;
if ( SpecialHarvest( from, tool, def, map, loc ) )
@@ -341,23 +342,24 @@ namespace Server.Engines.Harvest
OnBadHarvestTarget( from, tool, toHarvest );
return false;
}
- else if ( !def.Validate( tileID ) )
+
+ if ( !def.Validate( tileID ) )
{
from.EndAction( locked );
OnBadHarvestTarget( from, tool, toHarvest );
return false;
}
- else if ( !CheckRange( from, tool, def, map, loc, true ) )
+ if ( !CheckRange( from, tool, def, map, loc, true ) )
{
from.EndAction( locked );
return false;
}
- else if ( !CheckResources( from, tool, def, map, loc, true ) )
+ if ( !CheckResources( from, tool, def, map, loc, true ) )
{
from.EndAction( locked );
return false;
}
- else if ( !CheckHarvest( from, tool, def, toHarvest ) )
+ if ( !CheckHarvest( from, tool, def, toHarvest ) )
{
from.EndAction( locked );
return false;
@@ -424,9 +426,9 @@ namespace Server.Engines.Harvest
if ( !CheckRange( from, tool, def, map, loc, false ) )
return;
- else if ( !CheckResources( from, tool, def, map, loc, false ) )
+ if ( !CheckResources( from, tool, def, map, loc, false ) )
return;
- else if ( !CheckHarvest( from, tool, def, toHarvest ) )
+ if ( !CheckHarvest( from, tool, def, toHarvest ) )
return;
object toLock = GetLock( from, tool, def, toHarvest );
diff --git a/Scripts/Engines/Harvest/Mining.cs b/Scripts/Engines/Harvest/Mining.cs
index 14b69d27a..c3a9f9222 100644
--- a/Scripts/Engines/Harvest/Mining.cs
+++ b/Scripts/Engines/Harvest/Mining.cs
@@ -206,7 +206,8 @@ namespace Server.Engines.Harvest
from.SendLocalizedMessage( 501864 ); // You can't mine while riding.
return false;
}
- else if ( from.IsBodyMod && !from.Body.IsHuman )
+
+ if ( from.IsBodyMod && !from.Body.IsHuman )
{
from.SendLocalizedMessage( 501865 ); // You can't mine while polymorphed.
return false;
diff --git a/Scripts/Engines/Help/PageQueue.cs b/Scripts/Engines/Help/PageQueue.cs
index 06d202d72..31fcc187a 100644
--- a/Scripts/Engines/Help/PageQueue.cs
+++ b/Scripts/Engines/Help/PageQueue.cs
@@ -183,10 +183,9 @@ namespace Server.Engines.Help
{
if ( type == PageType.VerbalHarassment )
return "Verbal Harassment";
- else if ( type == PageType.PhysicalHarassment )
+ if ( type == PageType.PhysicalHarassment )
return "Physical Harassment";
- else
- return type.ToString();
+ return type.ToString();
}
public static void OnHandlerChanged( Mobile old, Mobile value, PageEntry entry )
diff --git a/Scripts/Engines/Help/PageResponseGump.cs b/Scripts/Engines/Help/PageResponseGump.cs
index 117d5f1a1..b4bc1142c 100644
--- a/Scripts/Engines/Help/PageResponseGump.cs
+++ b/Scripts/Engines/Help/PageResponseGump.cs
@@ -21,7 +21,7 @@ namespace Server.Engines.Help
AddHtmlLocalized( 150, 40, 360, 40, 1062610, false, false ); //
Ultima Online Help Response
- AddHtml( 80, 90, 480, 290, $"{name} tells {@from.Name}: {text}", true, true );
+ AddHtml( 80, 90, 480, 290, $"{name} tells {from.Name}: {text}", true, true );
AddHtmlLocalized( 80, 390, 480, 40, 1062611, false, false ); // Clicking the OKAY button will remove the reponse you have received.
AddButton( 400, 417, 2074, 2075, 1, GumpButtonType.Reply, 0 ); // OKAY
diff --git a/Scripts/Engines/Khaldun/PuzzleChest.cs b/Scripts/Engines/Khaldun/PuzzleChest.cs
index c9dba5f78..9080b7c11 100644
--- a/Scripts/Engines/Khaldun/PuzzleChest.cs
+++ b/Scripts/Engines/Khaldun/PuzzleChest.cs
@@ -256,10 +256,8 @@ namespace Server.Items
return true;
}
- else
- {
- return false;
- }
+
+ return false;
}
public PuzzleChestSolutionAndTime GetLastGuess( Mobile m )
diff --git a/Scripts/Engines/MLQuests/MLQuest.cs b/Scripts/Engines/MLQuests/MLQuest.cs
index 7b011e665..c7b625f93 100644
--- a/Scripts/Engines/MLQuests/MLQuest.cs
+++ b/Scripts/Engines/MLQuests/MLQuest.cs
@@ -236,7 +236,8 @@ namespace Server.Engines.MLQuests
return false;
}
- else if ( nextAvailable > DateTime.UtcNow )
+
+ if ( nextAvailable > DateTime.UtcNow )
{
if ( message )
MLQuestSystem.Tell( quester, pm, 1075575 ); // I'm sorry, but I don't have anything else for you right now. Could you check back with me in a few minutes?
diff --git a/Scripts/Engines/MLQuests/MLQuestEntry.cs b/Scripts/Engines/MLQuests/MLQuestEntry.cs
index 71cc6bd1f..d0df3bb9b 100644
--- a/Scripts/Engines/MLQuests/MLQuestEntry.cs
+++ b/Scripts/Engines/MLQuests/MLQuestEntry.cs
@@ -36,7 +36,7 @@ namespace Server.Engines.MLQuests
m_Quest = quest;
m_Quester = quester;
- m_QuesterType = ( quester == null ) ? null : quester.GetType();
+ m_QuesterType = quester?.GetType();
m_Player = player;
m_Accepted = DateTime.UtcNow;
@@ -91,7 +91,7 @@ namespace Server.Engines.MLQuests
set
{
m_Quester = value;
- m_QuesterType = ( value == null ) ? null : value.GetType();
+ m_QuesterType = value?.GetType();
}
}
@@ -156,7 +156,7 @@ namespace Server.Engines.MLQuests
if ( complete && !requiresAll )
return true;
- else if ( !complete && requiresAll )
+ if ( !complete && requiresAll )
return false;
}
@@ -369,7 +369,7 @@ namespace Server.Engines.MLQuests
foreach ( Item rewardItem in rewards )
{
- string rewardName = ( rewardItem.Name != null ) ? rewardItem.Name : string.Concat( "#", rewardItem.LabelNumber );
+ string rewardName = rewardItem.Name ?? string.Concat( "#", rewardItem.LabelNumber );
if ( rewardItem.Stackable )
m_Player.SendLocalizedMessage( 1115917, string.Concat( rewardItem.Amount, "\t", rewardName ) ); // You receive a reward: ~1_QUANTITY~ ~2_ITEM~
diff --git a/Scripts/Engines/MLQuests/MLQuestSystem.cs b/Scripts/Engines/MLQuests/MLQuestSystem.cs
index 085db9f8b..960327330 100644
--- a/Scripts/Engines/MLQuests/MLQuestSystem.cs
+++ b/Scripts/Engines/MLQuests/MLQuestSystem.cs
@@ -376,7 +376,7 @@ namespace Server.Engines.MLQuests
if ( entry.Failed )
return; // Note: OSI sends no gump at all for failed quests, they have to be cancelled in the quest overview
- else if ( entry.ClaimReward )
+ if ( entry.ClaimReward )
entry.SendRewardOffer();
else if ( entry.IsCompleted() )
entry.SendReportBackGump();
diff --git a/Scripts/Engines/MLQuests/Objectives/CollectObjective.cs b/Scripts/Engines/MLQuests/Objectives/CollectObjective.cs
index 19930bf3b..ad81acfd8 100644
--- a/Scripts/Engines/MLQuests/Objectives/CollectObjective.cs
+++ b/Scripts/Engines/MLQuests/Objectives/CollectObjective.cs
@@ -65,8 +65,7 @@ namespace Server.Engines.MLQuests.Objectives
{
if ( label < 1078872 )
return ( label - 1020000 );
- else
- return ( label - 1078872 );
+ return ( label - 1078872 );
}
public override void WriteToGump( Gump g, ref int y )
diff --git a/Scripts/Engines/MyRunUO/DatabaseCommandQueue.cs b/Scripts/Engines/MyRunUO/DatabaseCommandQueue.cs
index 995618122..0fcce464f 100644
--- a/Scripts/Engines/MyRunUO/DatabaseCommandQueue.cs
+++ b/Scripts/Engines/MyRunUO/DatabaseCommandQueue.cs
@@ -119,55 +119,53 @@ namespace Server.Engines.MyRunUO
return;
}
- else
+
+ try
+ {
+ connected = true;
+ connection = new OdbcConnection( m_ConnectionString );
+ connection.Open();
+ command = connection.CreateCommand();
+
+ if ( Config.UseTransactions )
+ {
+ transact = connection.BeginTransaction();
+ command.Transaction = transact;
+ }
+ }
+ catch ( Exception e )
{
try
{
- connected = true;
- connection = new OdbcConnection( m_ConnectionString );
- connection.Open();
- command = connection.CreateCommand();
-
- if ( Config.UseTransactions )
- {
- transact = connection.BeginTransaction();
- command.Transaction = transact;
- }
+ transact?.Rollback();
}
- catch ( Exception e )
+ catch{}
+
+ try
{
- try
- {
- transact?.Rollback();
- }
- catch{}
-
- try
- {
- connection?.Close();
- }
- catch{}
-
- try
- {
- connection?.Dispose();
- }
- catch{}
-
- try
- {
- command?.Dispose();
- }
- catch{}
-
- try{ m_Sync.Close(); }
- catch{}
-
- Console.WriteLine( "MyRunUO: Unable to connect to the database" );
- Console.WriteLine( e );
- m_HasCompleted = true;
- return;
+ connection?.Close();
}
+ catch{}
+
+ try
+ {
+ connection?.Dispose();
+ }
+ catch{}
+
+ try
+ {
+ command?.Dispose();
+ }
+ catch{}
+
+ try{ m_Sync.Close(); }
+ catch{}
+
+ Console.WriteLine( "MyRunUO: Unable to connect to the database" );
+ Console.WriteLine( e );
+ m_HasCompleted = true;
+ return;
}
}
else if ( obj is string s )
diff --git a/Scripts/Engines/Party/Party.cs b/Scripts/Engines/Party/Party.cs
index 0b4aa643f..5bd5efd88 100644
--- a/Scripts/Engines/Party/Party.cs
+++ b/Scripts/Engines/Party/Party.cs
@@ -129,7 +129,7 @@ namespace Server.Engines.PartySystem
Mobile from = e.Mobile;
Party p = Get( from );
- p?.Remove( @from );
+ p?.Remove( from );
from.Party = null;
}
diff --git a/Scripts/Engines/Plants/MainPlantGump.cs b/Scripts/Engines/Plants/MainPlantGump.cs
index 0f86c4477..a21091f3e 100644
--- a/Scripts/Engines/Plants/MainPlantGump.cs
+++ b/Scripts/Engines/Plants/MainPlantGump.cs
@@ -381,10 +381,8 @@ namespace Server.Engines.Plants
return;
}
- else
- {
- m_Plant.LabelTo( from, message );
- }
+
+ m_Plant.LabelTo( from, message );
}
from.SendGump( new MainPlantGump( m_Plant ) );
diff --git a/Scripts/Engines/Plants/MiscItems/GreenThorns.cs b/Scripts/Engines/Plants/MiscItems/GreenThorns.cs
index daf8a736f..835bc74f4 100644
--- a/Scripts/Engines/Plants/MiscItems/GreenThorns.cs
+++ b/Scripts/Engines/Plants/MiscItems/GreenThorns.cs
@@ -331,7 +331,8 @@ namespace Server.Items
item.MoveToWorld( new Point3D( x, y, Location.Z ), Map );
return true;
}
- else if ( Map.CanFit( x, y, z, 1 ) )
+
+ if ( Map.CanFit( x, y, z, 1 ) )
{
item.MoveToWorld( new Point3D( x, y, z ), Map );
return true;
@@ -355,7 +356,8 @@ namespace Server.Items
creature.Combatant = From;
return true;
}
- else if ( Map.CanSpawnMobile( x, y, z ) )
+
+ if ( Map.CanSpawnMobile( x, y, z ) )
{
creature.MoveToWorld( new Point3D( x, y, z ), Map );
creature.Combatant = From;
diff --git a/Scripts/Engines/Plants/PlantHue.cs b/Scripts/Engines/Plants/PlantHue.cs
index 74dcc569f..86c6902cc 100644
--- a/Scripts/Engines/Plants/PlantHue.cs
+++ b/Scripts/Engines/Plants/PlantHue.cs
@@ -70,8 +70,7 @@ namespace Server.Engines.Plants
{
if (m_Table.TryGetValue( plantHue, out PlantHueInfo info ))
return info;
- else
- return m_Table[PlantHue.Plain];
+ return m_Table[PlantHue.Plain];
}
public static PlantHue RandomFirstGeneration()
diff --git a/Scripts/Engines/Plants/PlantItem.cs b/Scripts/Engines/Plants/PlantItem.cs
index c13e79799..066cd5840 100644
--- a/Scripts/Engines/Plants/PlantItem.cs
+++ b/Scripts/Engines/Plants/PlantItem.cs
@@ -208,12 +208,11 @@ namespace Server.Engines.Plants
{
if ( m_PlantStatus >= PlantStatus.Plant )
return 1060812; // plant
- else if ( m_PlantStatus >= PlantStatus.Sapling )
+ if ( m_PlantStatus >= PlantStatus.Sapling )
return 1023305; // sapling
- else if ( m_PlantStatus >= PlantStatus.Seed )
+ if ( m_PlantStatus >= PlantStatus.Seed )
return 1060810; // seed
- else
- return 1026951; // dirt
+ return 1026951; // dirt
}
public int GetLocalizedContainerType()
@@ -508,11 +507,9 @@ namespace Server.Engines.Plants
message = 1053065; // The plant is already soaked with this type of potion!
return false;
}
- else
- {
- message = 1053067; // You pour the potion over the plant.
- return true;
- }
+
+ message = 1053067; // You pour the potion over the plant.
+ return true;
}
public override void Serialize( GenericWriter writer )
diff --git a/Scripts/Engines/Plants/PlantSystem.cs b/Scripts/Engines/Plants/PlantSystem.cs
index 75a555a46..d353b294a 100644
--- a/Scripts/Engines/Plants/PlantSystem.cs
+++ b/Scripts/Engines/Plants/PlantSystem.cs
@@ -116,12 +116,11 @@ namespace Server.Engines.Plants
if ( perc < 33 )
return PlantHealth.Dying;
- else if ( perc < 66 )
+ if ( perc < 66 )
return PlantHealth.Wilted;
- else if ( perc < 100 )
+ if ( perc < 100 )
return PlantHealth.Healthy;
- else
- return PlantHealth.Vibrant;
+ return PlantHealth.Vibrant;
}
}
@@ -261,8 +260,7 @@ namespace Server.Engines.Plants
{
if ( m_Pollinated )
return m_SeedType;
- else
- return m_Plant.PlantType;
+ return m_Plant.PlantType;
}
set => m_SeedType = value;
}
@@ -273,8 +271,7 @@ namespace Server.Engines.Plants
{
if ( m_Pollinated )
return m_SeedHue;
- else
- return m_Plant.PlantHue;
+ return m_Plant.PlantHue;
}
set => m_SeedHue = value;
}
@@ -346,12 +343,11 @@ namespace Server.Engines.Plants
{
if ( Water <= 1 )
return 1060826; // hard
- else if ( Water <= 2 )
+ if ( Water <= 2 )
return 1060827; // soft
- else if ( Water <= 3 )
+ if ( Water <= 3 )
return 1060828; // squishy
- else
- return 1060829; // sopping wet
+ return 1060829; // sopping wet
}
public int GetLocalizedHealth()
diff --git a/Scripts/Engines/Plants/PlantType.cs b/Scripts/Engines/Plants/PlantType.cs
index 0be3b0d89..2b8e04408 100644
--- a/Scripts/Engines/Plants/PlantType.cs
+++ b/Scripts/Engines/Plants/PlantType.cs
@@ -113,8 +113,7 @@ namespace Server.Engines.Plants
if ( index >= 0 && index < m_Table.Length )
return m_Table[index];
- else
- return m_Table[0];
+ return m_Table[0];
}
public static PlantType RandomFirstGeneration()
@@ -206,20 +205,19 @@ namespace Server.Engines.Plants
if ( rand < 0.5 / exp4 )
return PlantType.CommonGreenBonsai;
- else if ( rand < 1.0 / exp4 )
+ if ( rand < 1.0 / exp4 )
return PlantType.CommonPinkBonsai;
- else if ( rand < (k1 * 0.5 + 1.0) / exp4 )
+ if ( rand < (k1 * 0.5 + 1.0) / exp4 )
return PlantType.UncommonGreenBonsai;
- else if ( rand < exp1 / exp4 )
+ if ( rand < exp1 / exp4 )
return PlantType.UncommonPinkBonsai;
- else if ( rand < (k2 * 0.5 + exp1) / exp4 )
+ if ( rand < (k2 * 0.5 + exp1) / exp4 )
return PlantType.RareGreenBonsai;
- else if ( rand < exp2 / exp4 )
+ if ( rand < exp2 / exp4 )
return PlantType.RarePinkBonsai;
- else if ( rand < exp3 / exp4 )
+ if ( rand < exp3 / exp4 )
return PlantType.ExceptionalBonsai;
- else
- return PlantType.ExoticBonsai;
+ return PlantType.ExoticBonsai;
}
public static bool IsCrossable( PlantType plantType )
@@ -237,8 +235,7 @@ namespace Server.Engines.Plants
if ( firstIndex + 1 == secondIndex || firstIndex == secondIndex + 1 )
return Utility.RandomBool() ? first : second;
- else
- return (PlantType)( (firstIndex + secondIndex) / 2 );
+ return (PlantType)( (firstIndex + secondIndex) / 2 );
}
public static bool CanReproduce( PlantType plantType )
@@ -261,8 +258,7 @@ namespace Server.Engines.Plants
if ( m_ContainsPlant )
return hueInfo.IsBright() ? 1060832 : 1060831; // a ~1_val~ of ~2_val~ dirt with a ~3_val~ [bright] ~4_val~ ~5_val~
- else
- return hueInfo.IsBright() ? 1061887 : 1061888; // a ~1_val~ of ~2_val~ dirt with a ~3_val~ [bright] ~4_val~ ~5_val~ ~6_val~
+ return hueInfo.IsBright() ? 1061887 : 1061888; // a ~1_val~ of ~2_val~ dirt with a ~3_val~ [bright] ~4_val~ ~5_val~ ~6_val~
}
public int GetPlantLabelFullGrown( PlantHueInfo hueInfo )
@@ -272,8 +268,7 @@ namespace Server.Engines.Plants
if ( m_ContainsPlant )
return hueInfo.IsBright() ? 1061891 : 1061889; // a ~1_HEALTH~ [bright] ~2_COLOR~ ~3_NAME~
- else
- return hueInfo.IsBright() ? 1061892 : 1061890; // a ~1_HEALTH~ [bright] ~2_COLOR~ ~3_NAME~ plant
+ return hueInfo.IsBright() ? 1061892 : 1061890; // a ~1_HEALTH~ [bright] ~2_COLOR~ ~3_NAME~ plant
}
public int GetPlantLabelDecorative( PlantHueInfo hueInfo )
diff --git a/Scripts/Engines/Plants/Seed.cs b/Scripts/Engines/Plants/Seed.cs
index 86d8e36e9..22fb80105 100644
--- a/Scripts/Engines/Plants/Seed.cs
+++ b/Scripts/Engines/Plants/Seed.cs
@@ -109,25 +109,19 @@ namespace Server.Engines.Plants
args = $"#{title}\t#{typeInfo.Name}";
return typeInfo.GetSeedLabel( hueInfo );
}
- else
- {
- args = $"#{title}";
- return hueInfo.IsBright() ? 1060839 : 1060838; // [bright] ~1_val~ seed
- }
+
+ args = $"#{title}";
+ return hueInfo.IsBright() ? 1060839 : 1060838; // [bright] ~1_val~ seed
}
- else
+
+ if ( m_ShowType )
{
- if ( m_ShowType )
- {
- args = $"{Amount}\t#{title}\t#{typeInfo.Name}";
- return typeInfo.GetSeedLabelPlural( hueInfo );
- }
- else
- {
- args = $"{Amount}\t#{title}";
- return hueInfo.IsBright() ? 1113491 : 1113490; // ~1_amount~ [bright] ~2_val~ seeds
- }
+ args = $"{Amount}\t#{title}\t#{typeInfo.Name}";
+ return typeInfo.GetSeedLabelPlural( hueInfo );
}
+
+ args = $"{Amount}\t#{title}";
+ return hueInfo.IsBright() ? 1113491 : 1113490; // ~1_amount~ [bright] ~2_val~ seeds
}
public override void AddNameProperty( ObjectPropertyList list )
diff --git a/Scripts/Engines/Quests/Ambitious Solen Queen/Objectives.cs b/Scripts/Engines/Quests/Ambitious Solen Queen/Objectives.cs
index 70a5f84ef..023d6f67a 100644
--- a/Scripts/Engines/Quests/Ambitious Solen Queen/Objectives.cs
+++ b/Scripts/Engines/Quests/Ambitious Solen Queen/Objectives.cs
@@ -38,8 +38,7 @@ namespace Server.Engines.Quests.Ambitious
if ( redSolen )
return from is RedSolenQueen;
- else
- return from is BlackSolenQueen;
+ return from is BlackSolenQueen;
}
public override void OnKill( BaseCreature creature, Container corpse )
diff --git a/Scripts/Engines/Quests/Collector/Items/ImageType.cs b/Scripts/Engines/Quests/Collector/Items/ImageType.cs
index 2032e3b81..a656d9a63 100644
--- a/Scripts/Engines/Quests/Collector/Items/ImageType.cs
+++ b/Scripts/Engines/Quests/Collector/Items/ImageType.cs
@@ -60,8 +60,7 @@ namespace Server.Engines.Quests.Collector
int index = (int)image;
if ( index >= 0 && index < m_Table.Length )
return m_Table[index];
- else
- return m_Table[0];
+ return m_Table[0];
}
public static ImageType[] RandomList( int count )
diff --git a/Scripts/Engines/Quests/Collector/Items/Obsidian.cs b/Scripts/Engines/Quests/Collector/Items/Obsidian.cs
index c754fe757..ff61b06b3 100644
--- a/Scripts/Engines/Quests/Collector/Items/Obsidian.cs
+++ b/Scripts/Engines/Quests/Collector/Items/Obsidian.cs
@@ -75,8 +75,7 @@ namespace Server.Engines.Quests.Collector
int index = Utility.Random( m_Names.Length );
if ( m_Names[index] == null )
return from.Name;
- else
- return m_Names[index];
+ return m_Names[index];
}
private const int m_Partial = 2;
diff --git a/Scripts/Engines/Quests/Collector/Mobiles/ElwoodMcCarrin.cs b/Scripts/Engines/Quests/Collector/Mobiles/ElwoodMcCarrin.cs
index 3e1fee978..c4343b2ab 100644
--- a/Scripts/Engines/Quests/Collector/Mobiles/ElwoodMcCarrin.cs
+++ b/Scripts/Engines/Quests/Collector/Mobiles/ElwoodMcCarrin.cs
@@ -217,11 +217,9 @@ namespace Server.Engines.Quests.Collector
{
return true;
}
- else
- {
- bag.Delete();
- return false;
- }
+
+ bag.Delete();
+ return false;
}
public override void Serialize( GenericWriter writer )
diff --git a/Scripts/Engines/Quests/Collector/Objectives.cs b/Scripts/Engines/Quests/Collector/Objectives.cs
index 47ef2cf03..7449b82bb 100644
--- a/Scripts/Engines/Quests/Collector/Objectives.cs
+++ b/Scripts/Engines/Quests/Collector/Objectives.cs
@@ -321,14 +321,12 @@ namespace Server.Engines.Quests.Collector
{
return CaptureResponse.AlreadyDone;
}
- else
- {
- m_Done[i] = true;
- CheckCompletionStatus();
+ m_Done[i] = true;
- return CaptureResponse.Valid;
- }
+ CheckCompletionStatus();
+
+ return CaptureResponse.Valid;
}
}
diff --git a/Scripts/Engines/Quests/Core/Items/QuestItem.cs b/Scripts/Engines/Quests/Core/Items/QuestItem.cs
index a9400bc8b..af2c986ef 100644
--- a/Scripts/Engines/Quests/Core/Items/QuestItem.cs
+++ b/Scripts/Engines/Quests/Core/Items/QuestItem.cs
@@ -26,20 +26,16 @@ namespace Server.Engines.Quests
{
return true;
}
- else if ( !(from is PlayerMobile) || CanDrop( (PlayerMobile)from ) )
+
+ if ( !(from is PlayerMobile) || CanDrop( (PlayerMobile)from ) )
{
return true;
}
- else
- {
- from.SendLocalizedMessage( 1049343 ); // You can only drop quest items into the top-most level of your backpack while you still need them for your quest.
- return false;
- }
- }
- else
- {
- return ret;
+ from.SendLocalizedMessage( 1049343 ); // You can only drop quest items into the top-most level of your backpack while you still need them for your quest.
+ return false;
}
+
+ return ret;
}
public override bool DropToMobile( Mobile from, Mobile target, Point3D p )
@@ -52,20 +48,16 @@ namespace Server.Engines.Quests
{
return true;
}
- else if ( !(from is PlayerMobile) || CanDrop( (PlayerMobile)from ) )
+
+ if ( !(from is PlayerMobile) || CanDrop( (PlayerMobile)from ) )
{
return true;
}
- else
- {
- from.SendLocalizedMessage( 1049344 ); // You decide against trading the item. You still need it for your quest.
- return false;
- }
- }
- else
- {
- return ret;
+ from.SendLocalizedMessage( 1049344 ); // You decide against trading the item. You still need it for your quest.
+ return false;
}
+
+ return ret;
}
public override bool DropToItem( Mobile from, Item target, Point3D p )
@@ -78,15 +70,13 @@ namespace Server.Engines.Quests
{
return true;
}
- else if ( !(from is PlayerMobile) || CanDrop( (PlayerMobile)from ) )
+
+ if ( !(from is PlayerMobile) || CanDrop( (PlayerMobile)from ) )
{
return true;
}
- else
- {
- from.SendLocalizedMessage( 1049343 ); // You can only drop quest items into the top-most level of your backpack while you still need them for your quest.
- return false;
- }
+ from.SendLocalizedMessage( 1049343 ); // You can only drop quest items into the top-most level of your backpack while you still need them for your quest.
+ return false;
}
return ret;
}
diff --git a/Scripts/Engines/Quests/Dark Tides/Conversations.cs b/Scripts/Engines/Quests/Dark Tides/Conversations.cs
index 0205cadc9..465c6fa46 100644
--- a/Scripts/Engines/Quests/Dark Tides/Conversations.cs
+++ b/Scripts/Engines/Quests/Dark Tides/Conversations.cs
@@ -178,14 +178,12 @@ namespace Server.Engines.Quests.Necro
*/
return 1062058;
}
- else // from well of tears
- {
- /* You have arrived at the well, but no longer have the scroll
+
+ /* You have arrived at the well, but no longer have the scroll
* of calling. Use Mardoth's teleporter to return to the
* Crystal Cave and fetch another scroll from the box.
*/
- return 1060129;
- }
+ return 1060129;
}
}
diff --git a/Scripts/Engines/Quests/Dark Tides/Items/DarkTidesTeleporter.cs b/Scripts/Engines/Quests/Dark Tides/Items/DarkTidesTeleporter.cs
index ec13df860..4ba3a49a6 100644
--- a/Scripts/Engines/Quests/Dark Tides/Items/DarkTidesTeleporter.cs
+++ b/Scripts/Engines/Quests/Dark Tides/Items/DarkTidesTeleporter.cs
@@ -22,25 +22,26 @@ namespace Server.Engines.Quests.Necro
qs.AddConversation( new RadarConversation() );
return true;
}
- else if ( qs.IsObjectiveInProgress( typeof( FindCrystalCaveObjective ) ) )
+
+ if ( qs.IsObjectiveInProgress( typeof( FindCrystalCaveObjective ) ) )
{
loc = new Point3D( 1194, 521, -90 );
map = Map.Malas;
return true;
}
- else if ( qs.IsObjectiveInProgress( typeof( FindCityOfLightObjective ) ) )
+ if ( qs.IsObjectiveInProgress( typeof( FindCityOfLightObjective ) ) )
{
loc = new Point3D( 1091, 519, -90 );
map = Map.Malas;
return true;
}
- else if ( qs.IsObjectiveInProgress( typeof( ReturnToCrystalCaveObjective ) ) )
+ if ( qs.IsObjectiveInProgress( typeof( ReturnToCrystalCaveObjective ) ) )
{
loc = new Point3D( 1194, 521, -90 );
map = Map.Malas;
return true;
}
- else if ( DarkTidesQuest.HasLostCallingScroll( player ) )
+ if ( DarkTidesQuest.HasLostCallingScroll( player ) )
{
loc = new Point3D( 1194, 521, -90 );
map = Map.Malas;
diff --git a/Scripts/Engines/Quests/Dark Tides/Objectives.cs b/Scripts/Engines/Quests/Dark Tides/Objectives.cs
index c5c1cd261..094f4115d 100644
--- a/Scripts/Engines/Quests/Dark Tides/Objectives.cs
+++ b/Scripts/Engines/Quests/Dark Tides/Objectives.cs
@@ -382,14 +382,12 @@ namespace Server.Engines.Quests.Necro
*/
return 1060131;
}
- else
- {
- /* Although you were slain by the cowardly paladin,
+
+ /* Although you were slain by the cowardly paladin,
* you managed to complete the rite of calling as
* instructed. Return to Mardoth.
*/
- return 1060132;
- }
+ return 1060132;
}
}
diff --git a/Scripts/Engines/Quests/Haochi's Trials/Conversations.cs b/Scripts/Engines/Quests/Haochi's Trials/Conversations.cs
index 65390414a..d040ed707 100644
--- a/Scripts/Engines/Quests/Haochi's Trials/Conversations.cs
+++ b/Scripts/Engines/Quests/Haochi's Trials/Conversations.cs
@@ -64,11 +64,9 @@ namespace Server.Engines.Quests.Samurai
// You have just gained some Karma for killing a Cursed Soul.
return 1063040;
}
- else
- {
- // You have just gained some Karma for killing a Young Ronin.
- return 1063041;
- }
+
+ // You have just gained some Karma for killing a Young Ronin.
+ return 1063041;
}
}
@@ -119,9 +117,8 @@ namespace Server.Engines.Quests.Samurai
*/
return 1063045;
}
- else
- {
- /* It is good that you rid the land of those dishonorable Samurai.
+
+ /* It is good that you rid the land of those dishonorable Samurai.
* Perhaps they will learn a greater lesson in death.
*
* I have placed a reward in your pack.
@@ -129,8 +126,7 @@ namespace Server.Engines.Quests.Samurai
* The second trial will test your courage. You only have to follow
* the yellow path to see what awaits you.
*/
- return 1063046;
- }
+ return 1063046;
}
}
@@ -201,9 +197,8 @@ namespace Server.Engines.Quests.Samurai
*/
return 1063060;
}
- else
- {
- /* Fear remains in your eyes but you have learned that not all is
+
+ /* Fear remains in your eyes but you have learned that not all is
* what it appears to be.
*
* You must have known the dragon would slay you instantly.
@@ -217,8 +212,7 @@ namespace Server.Engines.Quests.Samurai
*
* The next trial will test your benevolence. You only have to walk the blue path.
*/
- return 1063059;
- }
+ return 1063059;
}
}
@@ -313,9 +307,8 @@ namespace Server.Engines.Quests.Samurai
*/
return 1063071;
}
- else
- {
- /* You showed respect by helping another out while allowing the gypsy
+
+ /* You showed respect by helping another out while allowing the gypsy
* what little dignity she has left.
*
* Now she will be able to feed herself and gain enough energy to walk
@@ -330,8 +323,7 @@ namespace Server.Engines.Quests.Samurai
* prove yourself again.
Please retrieve my katana from the
* treasure room and return it to me.
*/
- return 1063070;
- }
+ return 1063070;
}
}
@@ -412,9 +404,8 @@ namespace Server.Engines.Quests.Samurai
*/
return 1063077;
}
- else
- {
- /* Thank you for returning this sword to me and leaving the remaining
+
+ /* Thank you for returning this sword to me and leaving the remaining
* treasure alone.
*
* Your training is nearly complete. Before you have your final trial,
@@ -422,8 +413,7 @@ namespace Server.Engines.Quests.Samurai
*
* Go into the Altar Room and light a candle for them. Afterwards, return to me.
*/
- return 1063076;
- }
+ return 1063076;
}
}
diff --git a/Scripts/Engines/Quests/Solen Matriarch/Conversations.cs b/Scripts/Engines/Quests/Solen Matriarch/Conversations.cs
index 4bd7ac206..f85e60e04 100644
--- a/Scripts/Engines/Quests/Solen Matriarch/Conversations.cs
+++ b/Scripts/Engines/Quests/Solen Matriarch/Conversations.cs
@@ -19,9 +19,8 @@ namespace Server.Engines.Quests.Matriarch
*/
return 1054081;
}
- else
- {
- /* The Solen Matriarch smiles as she eats the seed you offered.
+
+ /* The Solen Matriarch smiles as she eats the seed you offered.
*
* Thank you for that seed. It was quite delicious.
*
@@ -29,8 +28,7 @@ namespace Server.Engines.Quests.Matriarch
* another task at the moment. Perhaps you should finish whatever is occupying
* your attention at the moment and return to me once you're done.
*/
- return 1054079;
- }
+ return 1054079;
}
}
@@ -133,9 +131,8 @@ namespace Server.Engines.Quests.Matriarch
*/
return 1054097;
}
- else
- {
- /* The Solen Matriarch listens as you report the completion of your
+
+ /* The Solen Matriarch listens as you report the completion of your
* tasks to her.
*
* I give you my thanks for your help, and I will gladly make you a friend of my
@@ -149,8 +146,7 @@ namespace Server.Engines.Quests.Matriarch
* I will also give you some gold for assisting me and my colony, but first let's
* take care of your zoogi fungus.
*/
- return 1054096;
- }
+ return 1054096;
}
}
diff --git a/Scripts/Engines/Quests/Solen Matriarch/Objectives.cs b/Scripts/Engines/Quests/Solen Matriarch/Objectives.cs
index 3a5f39508..8044382ed 100644
--- a/Scripts/Engines/Quests/Solen Matriarch/Objectives.cs
+++ b/Scripts/Engines/Quests/Solen Matriarch/Objectives.cs
@@ -38,8 +38,7 @@ namespace Server.Engines.Quests.Matriarch
if ( redSolen )
return from is BlackSolenInfiltratorWarrior || from is BlackSolenInfiltratorQueen;
- else
- return from is RedSolenInfiltratorWarrior || from is RedSolenInfiltratorQueen;
+ return from is RedSolenInfiltratorWarrior || from is RedSolenInfiltratorQueen;
}
public override void OnKill( BaseCreature creature, Container corpse )
diff --git a/Scripts/Engines/Quests/Solen Matriarch/SolenMatriarchQuest.cs b/Scripts/Engines/Quests/Solen Matriarch/SolenMatriarchQuest.cs
index 3b2cb95df..60a7d2190 100644
--- a/Scripts/Engines/Quests/Solen Matriarch/SolenMatriarchQuest.cs
+++ b/Scripts/Engines/Quests/Solen Matriarch/SolenMatriarchQuest.cs
@@ -54,9 +54,8 @@ namespace Server.Engines.Quests.Matriarch
*/
return 1054083;
}
- else
- {
- /* The Solen Matriarch smiles happily as she eats the seed you offered.
+
+ /* The Solen Matriarch smiles happily as she eats the seed you offered.
*
* I think you for that seed. I was quite delicious. So full of flavor.
*
@@ -79,8 +78,7 @@ namespace Server.Engines.Quests.Matriarch
*
* Will you accept my offer?
*/
- return 1054082;
- }
+ return 1054082;
}
}
@@ -128,8 +126,7 @@ namespace Server.Engines.Quests.Matriarch
{
if ( redSolen )
return player.SolenFriendship == SolenFriendship.Red;
- else
- return player.SolenFriendship == SolenFriendship.Black;
+ return player.SolenFriendship == SolenFriendship.Black;
}
public static bool GiveRewardTo( PlayerMobile player )
@@ -141,11 +138,9 @@ namespace Server.Engines.Quests.Matriarch
player.SendLocalizedMessage( 1054076 ); // You have been given some gold.
return true;
}
- else
- {
- gold.Delete();
- return false;
- }
+
+ gold.Delete();
+ return false;
}
}
}
diff --git a/Scripts/Engines/Quests/Study of the Solen Hive/NestArea.cs b/Scripts/Engines/Quests/Study of the Solen Hive/NestArea.cs
index 3e5e9b3cc..d451e2e07 100644
--- a/Scripts/Engines/Quests/Study of the Solen Hive/NestArea.cs
+++ b/Scripts/Engines/Quests/Study of the Solen Hive/NestArea.cs
@@ -46,8 +46,7 @@ namespace Server.Engines.Quests.Naturalist
{
if ( id >= 0 && id < m_Areas.Length )
return m_Areas[id];
- else
- return null;
+ return null;
}
private bool m_Special;
diff --git a/Scripts/Engines/Quests/Terrible Hatchlings/Mobiles/AnsellaGryen.cs b/Scripts/Engines/Quests/Terrible Hatchlings/Mobiles/AnsellaGryen.cs
index 2c6fc36ea..2f0ad16ae 100644
--- a/Scripts/Engines/Quests/Terrible Hatchlings/Mobiles/AnsellaGryen.cs
+++ b/Scripts/Engines/Quests/Terrible Hatchlings/Mobiles/AnsellaGryen.cs
@@ -38,8 +38,7 @@ namespace Server.Engines.Quests.Zento
{
if ( m.Quest == null )
return 3;
- else
- return -1;
+ return -1;
}
public override void OnTalk( PlayerMobile player, bool contextMenu )
diff --git a/Scripts/Engines/Quests/The Summoning/Mobiles/Chyloth.cs b/Scripts/Engines/Quests/The Summoning/Mobiles/Chyloth.cs
index f38bf086f..b485f006e 100644
--- a/Scripts/Engines/Quests/The Summoning/Mobiles/Chyloth.cs
+++ b/Scripts/Engines/Quests/The Summoning/Mobiles/Chyloth.cs
@@ -139,16 +139,14 @@ namespace Server.Engines.Quests.Doom
foundLoc = true;
break;
}
- else
- {
- int z = map.GetAverageZ( x, y );
- if ( map.CanSpawnMobile( x, y, z ) )
- {
- dragon.MoveToWorld( new Point3D( x, y, z ), map );
- foundLoc = true;
- break;
- }
+ int z = map.GetAverageZ( x, y );
+
+ if ( map.CanSpawnMobile( x, y, z ) )
+ {
+ dragon.MoveToWorld( new Point3D( x, y, z ), map );
+ foundLoc = true;
+ break;
}
}
diff --git a/Scripts/Engines/Quests/The Summoning/TheSummoningQuest.cs b/Scripts/Engines/Quests/The Summoning/TheSummoningQuest.cs
index e9ced7cfd..1204d2d4e 100644
--- a/Scripts/Engines/Quests/The Summoning/TheSummoningQuest.cs
+++ b/Scripts/Engines/Quests/The Summoning/TheSummoningQuest.cs
@@ -65,10 +65,9 @@ namespace Server.Engines.Quests.Doom
if ( fame < 1500 )
return Utility.Dice( 2, 5, -1 );
- else if ( fame < 20000 )
+ if ( fame < 20000 )
return Utility.Dice( 2, 4, 8 );
- else
- return 50;
+ return 50;
}
public TheSummoningQuest( Victoria victoria, PlayerMobile from ) : base( from )
diff --git a/Scripts/Engines/Quests/Uzeraan Turmoil/Conversations.cs b/Scripts/Engines/Quests/Uzeraan Turmoil/Conversations.cs
index d4cba0d3d..ad0c10af9 100644
--- a/Scripts/Engines/Quests/Uzeraan Turmoil/Conversations.cs
+++ b/Scripts/Engines/Quests/Uzeraan Turmoil/Conversations.cs
@@ -64,7 +64,8 @@ namespace Server.Engines.Quests.Haven
*/
return 1049088;
}
- else if ( System.From.Profession == 2 ) // magician
+
+ if ( System.From.Profession == 2 ) // magician
{
/* Uzeraan greets you as you approach...
*
@@ -95,9 +96,7 @@ namespace Server.Engines.Quests.Haven
*/
return 1049386;
}
- else
- {
- /* Uzeraan nods at you with approval and begins to speak...
+/* Uzeraan nods at you with approval and begins to speak...
*
* Now that you are ready, let me give you your first task.
*
@@ -120,8 +119,7 @@ namespace Server.Engines.Quests.Haven
*
* Good luck young Paladin!
*/
- return 1060388;
- }
+ return 1060388;
}
}
@@ -180,9 +178,8 @@ namespace Server.Engines.Quests.Haven
*/
return 1049387;
}
- else
- {
- /* You give your report to Uzeraan and after a while,
+
+ /* You give your report to Uzeraan and after a while,
* he begins to speak...
*
* Your report is grim, but all hope is not lost! It has become apparent
@@ -208,8 +205,7 @@ namespace Server.Engines.Quests.Haven
* and Healing potions
* to help you out along the way. Good luck.
*/
- return 1049119;
- }
+ return 1049119;
}
}
@@ -265,9 +261,8 @@ namespace Server.Engines.Quests.Haven
*/
return 1060749;
}
- else
- {
- /* Schmendrick barely pays you any attention as you approach him. His
+
+ /* Schmendrick barely pays you any attention as you approach him. His
* mind seems to be occupied with something else. You explain to him that
* you came for the scroll of power and after a long while he begins to speak,
* but apparently still not giving you his full attention...
@@ -284,8 +279,7 @@ namespace Server.Engines.Quests.Haven
* Schmendrick goes back to his work and you seem to completely fade from his
* awareness...
*/
- return 1049322;
- }
+ return 1049322;
}
}
@@ -370,9 +364,8 @@ namespace Server.Engines.Quests.Haven
*/
return 1049388;
}
- else
- {
- /* Uzeraan takes the dirt from you and smiles...
+
+ /* Uzeraan takes the dirt from you and smiles...
*
* Wonderful! I knew I could count on you. As a token of my appreciation
* I've given you a bag with some bandages as well as some healing potions.
@@ -392,8 +385,7 @@ namespace Server.Engines.Quests.Haven
*
* Good luck!
*/
- return 1049329;
- }
+ return 1049329;
}
}
@@ -440,9 +432,8 @@ namespace Server.Engines.Quests.Haven
+ "
"
+ "Return here when you have found a Daemon Bone.";
}
- else
- {
- /* You hand Uzeraan the Vial of Blood, which he hastily accepts...
+
+ /* You hand Uzeraan the Vial of Blood, which he hastily accepts...
*
* Excellent work! Only one reagent remains and the spell is complete!
* The final requirement is a Daemon Bone, which will not be as easily
@@ -459,8 +450,7 @@ namespace Server.Engines.Quests.Haven
*
* Return here when you have found a Daemon Bone.
*/
- return 1049333;
- }
+ return 1049333;
}
}
@@ -479,8 +469,7 @@ namespace Server.Engines.Quests.Haven
{
if ( System.From.Profession == 5 ) // paladin
return m_InfoPaladin;
- else
- return m_Info;
+ return m_Info;
}
}
@@ -550,9 +539,8 @@ namespace Server.Engines.Quests.Haven
*/
return 1049377;
}
- else
- {
- /* You've lost the scroll? Argh! I will have to try and re-construct
+
+ /* You've lost the scroll? Argh! I will have to try and re-construct
* the scroll from memory. Bring me a blank scroll, which you can
* purchase from the mage shop just
* East of Uzeraan's mansion in Haven.
@@ -561,8 +549,7 @@ namespace Server.Engines.Quests.Haven
*
* When you return, be sure to hand me the scroll (drag and drop).
*/
- return 1049345;
- }
+ return 1049345;
}
}
@@ -609,9 +596,8 @@ namespace Server.Engines.Quests.Haven
*/
return 1049374;
}
- else
- {
- /* You've lost the dirt I gave you?
+
+ /* You've lost the dirt I gave you?
*
* My, my, my... What ever shall we do now?
*
@@ -628,8 +614,7 @@ namespace Server.Engines.Quests.Haven
*
* Good luck.
*/
- return 1049359;
- }
+ return 1049359;
}
}
diff --git a/Scripts/Engines/Quests/Uzeraan Turmoil/Items/UzeraanTurmoilTeleporter.cs b/Scripts/Engines/Quests/Uzeraan Turmoil/Items/UzeraanTurmoilTeleporter.cs
index ef9c36e2a..3b7902d30 100644
--- a/Scripts/Engines/Quests/Uzeraan Turmoil/Items/UzeraanTurmoilTeleporter.cs
+++ b/Scripts/Engines/Quests/Uzeraan Turmoil/Items/UzeraanTurmoilTeleporter.cs
@@ -23,22 +23,23 @@ namespace Server.Engines.Quests.Haven
map = Map.Trammel;
return true;
}
- else if ( qs.IsObjectiveInProgress( typeof( FindDryadObjective ) )
- || UzeraanTurmoilQuest.HasLostFertileDirt( player ) )
+
+ if ( qs.IsObjectiveInProgress( typeof( FindDryadObjective ) )
+ || UzeraanTurmoilQuest.HasLostFertileDirt( player ) )
{
loc = new Point3D( 3557, 2690, 2 );
map = Map.Trammel;
return true;
}
- else if ( player.Profession != 5 // paladin
- && ( qs.IsObjectiveInProgress( typeof( GetDaemonBoneObjective ) )
- || UzeraanTurmoilQuest.HasLostDaemonBone( player ) ) )
+ if ( player.Profession != 5 // paladin
+ && ( qs.IsObjectiveInProgress( typeof( GetDaemonBoneObjective ) )
+ || UzeraanTurmoilQuest.HasLostDaemonBone( player ) ) )
{
loc = new Point3D( 3422, 2653, 48 );
map = Map.Trammel;
return true;
}
- else if ( qs.IsObjectiveInProgress( typeof( CashBankCheckObjective ) ) )
+ if ( qs.IsObjectiveInProgress( typeof( CashBankCheckObjective ) ) )
{
loc = new Point3D( 3624, 2610, 0 );
map = Map.Trammel;
diff --git a/Scripts/Engines/Quests/Uzeraan Turmoil/Mobiles/Schmendrick.cs b/Scripts/Engines/Quests/Uzeraan Turmoil/Mobiles/Schmendrick.cs
index f473a11b0..227d1266e 100644
--- a/Scripts/Engines/Quests/Uzeraan Turmoil/Mobiles/Schmendrick.cs
+++ b/Scripts/Engines/Quests/Uzeraan Turmoil/Mobiles/Schmendrick.cs
@@ -97,12 +97,10 @@ namespace Server.Engines.Quests.Haven
from.SendLocalizedMessage( 1046260 ); // You need to clear some space in your inventory to continue with the quest. Come back here when you have more space in your inventory.
return false;
}
- else
- {
- dropped.Consume();
- from.SendLocalizedMessage( 1049346 ); // Schmendrick scribbles on the scroll for a few moments and hands you the finished product.
- return dropped.Deleted;
- }
+
+ dropped.Consume();
+ from.SendLocalizedMessage( 1049346 ); // Schmendrick scribbles on the scroll for a few moments and hands you the finished product.
+ return dropped.Deleted;
}
return base.OnDragDrop( from, dropped );
diff --git a/Scripts/Engines/Quests/Uzeraan Turmoil/Objectives.cs b/Scripts/Engines/Quests/Uzeraan Turmoil/Objectives.cs
index fd75e684e..a034de8b7 100644
--- a/Scripts/Engines/Quests/Uzeraan Turmoil/Objectives.cs
+++ b/Scripts/Engines/Quests/Uzeraan Turmoil/Objectives.cs
@@ -119,10 +119,8 @@ namespace Server.Engines.Quests.Haven
default: return 5;
}
}
- else
- {
- return 5;
- }
+
+ return 5;
}
}
@@ -132,8 +130,7 @@ namespace Server.Engines.Quests.Haven
{
if ( m_Step == KillHordeMinionsStep.LearnKarma && HasBeenRead )
return true;
- else
- return base.Completed;
+ return base.Completed;
}
}
@@ -414,14 +411,12 @@ namespace Server.Engines.Quests.Haven
*/
return 1060755;
}
- else
- {
- /* Use Uzeraan's teleporter to get to the Haunted graveyard.
+
+ /* Use Uzeraan's teleporter to get to the Haunted graveyard.
*
* Slay the undead until you find a Daemon Bone.
*/
- return 1049362;
- }
+ return 1049362;
}
}
diff --git a/Scripts/Engines/Quests/Witch Apprentice/Conversations.cs b/Scripts/Engines/Quests/Witch Apprentice/Conversations.cs
index 84c171e4b..0c2874828 100644
--- a/Scripts/Engines/Quests/Witch Apprentice/Conversations.cs
+++ b/Scripts/Engines/Quests/Witch Apprentice/Conversations.cs
@@ -193,9 +193,8 @@ namespace Server.Engines.Quests.Hag
*/
return 1055059;
}
- else
- {
- /* Captain Blackheart looks up from polishing his cutlass, glaring at
+
+ /* Captain Blackheart looks up from polishing his cutlass, glaring at
* you with red-rimmed eyes.
*
* Well, well. Lookit the wee little deck swabby. Aren't ye a cute lil'
@@ -215,14 +214,12 @@ namespace Server.Engines.Quests.Hag
* The drunken pirate captain leans back in his chair, taking another gulp of
* his drink before he starts in on another bawdy pirate song.
*/
- return 1055057;
- }
+ return 1055057;
}
- else
+
+ if ( m_Drunken )
{
- if ( m_Drunken )
- {
- /* The inebriated pirate looks up at you with a wry grin.
+ /* The inebriated pirate looks up at you with a wry grin.
*
* Well hello again, me little matey. I see ye have a belly full of rotgut
* in ye. I bet ye think you're a right hero, ready te face the world. But
@@ -238,11 +235,10 @@ namespace Server.Engines.Quests.Hag
* Captain Blackheart shoves you aside, banging his cutlass against the
* table as he calls to the waitress for another round.
*/
- return 1055056;
- }
- else
- {
- /* Captain Blackheart looks up from his drink, almost tipping over
+ return 1055056;
+ }
+
+ /* Captain Blackheart looks up from his drink, almost tipping over
* his chair as he looks you up and down.
*
* You again? I thought I told ye te get lost? Go on with ye! Ye ain't
@@ -255,9 +251,7 @@ namespace Server.Engines.Quests.Hag
* The inebriated pirate bolts back another mug of ale and brushes you
* off with a wave of his hand.
*/
- return 1055058;
- }
- }
+ return 1055058;
}
}
@@ -319,9 +313,8 @@ namespace Server.Engines.Quests.Hag
*/
return 1055054;
}
- else
- {
- /* The drunken pirate, Captain Blackheart, looks up from his bottle
+
+ /* The drunken pirate, Captain Blackheart, looks up from his bottle
* of whiskey with a pleased expression.
*
* Well looky here! I didn't think a landlubber like yourself had the pirate
@@ -341,8 +334,7 @@ namespace Server.Engines.Quests.Hag
* Captain Blackheart hands you a jug of his famous Whiskey. You think it best
* to return it to the Hag, rather than drink any of the noxious swill.
*/
- return 1055011;
- }
+ return 1055011;
}
}
diff --git a/Scripts/Engines/Quests/Witch Apprentice/Ingredient.cs b/Scripts/Engines/Quests/Witch Apprentice/Ingredient.cs
index f18891be3..2018b030c 100644
--- a/Scripts/Engines/Quests/Witch Apprentice/Ingredient.cs
+++ b/Scripts/Engines/Quests/Witch Apprentice/Ingredient.cs
@@ -63,8 +63,7 @@ namespace Server.Engines.Quests.Hag
if ( index >= 0 && index < m_Table.Length )
return m_Table[index];
- else
- return m_Table[0];
+ return m_Table[0];
}
public static Ingredient RandomIngredient( Ingredient[] oldIngredients )
diff --git a/Scripts/Engines/Quests/Witch Apprentice/Objectives.cs b/Scripts/Engines/Quests/Witch Apprentice/Objectives.cs
index f6df3c29a..7b75135b1 100644
--- a/Scripts/Engines/Quests/Witch Apprentice/Objectives.cs
+++ b/Scripts/Engines/Quests/Witch Apprentice/Objectives.cs
@@ -297,15 +297,13 @@ namespace Server.Engines.Quests.Hag
return 1055045;
}
}
- else
- {
- /* You are still attempting to obtain a jug of Captain Blackheart's
+
+ /* You are still attempting to obtain a jug of Captain Blackheart's
* Whiskey, but the drunkard Captain refuses to share his unique brew.
* You must prove your worthiness as a pirate to Blackheart before he'll
* offer you a jug.
*/
- return 1055055;
- }
+ return 1055055;
}
}
diff --git a/Scripts/Engines/RemoteAdmin/Network.cs b/Scripts/Engines/RemoteAdmin/Network.cs
index a86bfebdc..5619e4e45 100644
--- a/Scripts/Engines/RemoteAdmin/Network.cs
+++ b/Scripts/Engines/RemoteAdmin/Network.cs
@@ -232,15 +232,11 @@ namespace Server.RemoteAdmin
Console.WriteLine( "WARNING: Unable to compress admin packet, zlib error: {0}", error );
return p;
}
- else
- {
- return new AdminCompressedPacket( dest, destSize, length );
- }
- }
- else
- {
- return p;
+
+ return new AdminCompressedPacket( dest, destSize, length );
}
+
+ return p;
}
}
diff --git a/Scripts/Engines/RemoteAdmin/PacketHandlers.cs b/Scripts/Engines/RemoteAdmin/PacketHandlers.cs
index 809d8bc72..041145063 100644
--- a/Scripts/Engines/RemoteAdmin/PacketHandlers.cs
+++ b/Scripts/Engines/RemoteAdmin/PacketHandlers.cs
@@ -36,11 +36,9 @@ namespace Server.RemoteAdmin
Console.WriteLine( "ADMIN: Invalid packet 0x{0:X2} from {1}, disconnecting", command, state );
return false;
}
- else
- {
- m_Handlers[command]( state, pvSrc );
- return true;
- }
+
+ m_Handlers[command]( state, pvSrc );
+ return true;
}
private static void ServerInfoRequest( NetState state, PacketReader pvSrc )
@@ -58,10 +56,8 @@ namespace Server.RemoteAdmin
state.Send( new MessageBoxMessage( "Invalid search term.\nThe IP sent was not valid.", "Invalid IP" ) );
return;
}
- else
- {
- term = term.ToUpper();
- }
+
+ term = term.ToUpper();
ArrayList list = new ArrayList();
@@ -161,8 +157,8 @@ namespace Server.RemoteAdmin
{
bool CreatedAccount = false;
bool UpdatedPass = false;
- bool oldbanned = a == null ? false : a.Banned;
- AccessLevel oldAcessLevel = a == null ? 0 : a.AccessLevel;
+ bool oldbanned = a?.Banned ?? false;
+ AccessLevel oldAcessLevel = a?.AccessLevel ?? 0;
if ( a == null )
{
diff --git a/Scripts/Engines/Reports/Objects/Charts/ChartItemCollection.cs b/Scripts/Engines/Reports/Objects/Charts/ChartItemCollection.cs
index 136385706..ee0121c4b 100644
--- a/Scripts/Engines/Reports/Objects/Charts/ChartItemCollection.cs
+++ b/Scripts/Engines/Reports/Objects/Charts/ChartItemCollection.cs
@@ -137,15 +137,13 @@ namespace Server.Engines.Reports
{
get
{
- if (((_index == -1)
+ if (((_index == -1)
|| (_index >= _collection.Count)))
{
throw new System.IndexOutOfRangeException("Enumerator not started.");
}
- else
- {
- return _currentElement;
- }
+
+ return _currentElement;
}
}
@@ -156,15 +154,13 @@ namespace Server.Engines.Reports
{
get
{
- if (((_index == -1)
+ if (((_index == -1)
|| (_index >= _collection.Count)))
{
throw new System.IndexOutOfRangeException("Enumerator not started.");
}
- else
- {
- return _currentElement;
- }
+
+ return _currentElement;
}
}
diff --git a/Scripts/Engines/Reports/Objects/Reports/ItemValueCollection.cs b/Scripts/Engines/Reports/Objects/Reports/ItemValueCollection.cs
index cd3c5538a..f65fa958f 100644
--- a/Scripts/Engines/Reports/Objects/Reports/ItemValueCollection.cs
+++ b/Scripts/Engines/Reports/Objects/Reports/ItemValueCollection.cs
@@ -142,15 +142,13 @@ namespace Server.Engines.Reports
{
get
{
- if (((_index == -1)
+ if (((_index == -1)
|| (_index >= _collection.Count)))
{
throw new System.IndexOutOfRangeException("Enumerator not started.");
}
- else
- {
- return _currentElement;
- }
+
+ return _currentElement;
}
}
@@ -161,15 +159,13 @@ namespace Server.Engines.Reports
{
get
{
- if (((_index == -1)
+ if (((_index == -1)
|| (_index >= _collection.Count)))
{
throw new System.IndexOutOfRangeException("Enumerator not started.");
}
- else
- {
- return _currentElement;
- }
+
+ return _currentElement;
}
}
diff --git a/Scripts/Engines/Reports/Objects/Reports/ReportColumnCollection.cs b/Scripts/Engines/Reports/Objects/Reports/ReportColumnCollection.cs
index f1c2ce7b6..fcafa62cc 100644
--- a/Scripts/Engines/Reports/Objects/Reports/ReportColumnCollection.cs
+++ b/Scripts/Engines/Reports/Objects/Reports/ReportColumnCollection.cs
@@ -142,15 +142,13 @@ namespace Server.Engines.Reports
{
get
{
- if (((_index == -1)
+ if (((_index == -1)
|| (_index >= _collection.Count)))
{
throw new System.IndexOutOfRangeException("Enumerator not started.");
}
- else
- {
- return _currentElement;
- }
+
+ return _currentElement;
}
}
@@ -161,15 +159,13 @@ namespace Server.Engines.Reports
{
get
{
- if (((_index == -1)
+ if (((_index == -1)
|| (_index >= _collection.Count)))
{
throw new System.IndexOutOfRangeException("Enumerator not started.");
}
- else
- {
- return _currentElement;
- }
+
+ return _currentElement;
}
}
diff --git a/Scripts/Engines/Reports/Objects/Reports/ReportItemCollection.cs b/Scripts/Engines/Reports/Objects/Reports/ReportItemCollection.cs
index 86b67c343..e0aa9271c 100644
--- a/Scripts/Engines/Reports/Objects/Reports/ReportItemCollection.cs
+++ b/Scripts/Engines/Reports/Objects/Reports/ReportItemCollection.cs
@@ -147,15 +147,13 @@ namespace Server.Engines.Reports
{
get
{
- if (((_index == -1)
+ if (((_index == -1)
|| (_index >= _collection.Count)))
{
throw new System.IndexOutOfRangeException("Enumerator not started.");
}
- else
- {
- return _currentElement;
- }
+
+ return _currentElement;
}
}
@@ -166,15 +164,13 @@ namespace Server.Engines.Reports
{
get
{
- if (((_index == -1)
+ if (((_index == -1)
|| (_index >= _collection.Count)))
{
throw new System.IndexOutOfRangeException("Enumerator not started.");
}
- else
- {
- return _currentElement;
- }
+
+ return _currentElement;
}
}
diff --git a/Scripts/Engines/Reports/Objects/Snapshots/SnapshotCollection.cs b/Scripts/Engines/Reports/Objects/Snapshots/SnapshotCollection.cs
index ebf42b725..eba93a3b3 100644
--- a/Scripts/Engines/Reports/Objects/Snapshots/SnapshotCollection.cs
+++ b/Scripts/Engines/Reports/Objects/Snapshots/SnapshotCollection.cs
@@ -132,15 +132,13 @@ namespace Server.Engines.Reports
{
get
{
- if (((_index == -1)
+ if (((_index == -1)
|| (_index >= _collection.Count)))
{
throw new System.IndexOutOfRangeException("Enumerator not started.");
}
- else
- {
- return _currentElement;
- }
+
+ return _currentElement;
}
}
@@ -151,15 +149,13 @@ namespace Server.Engines.Reports
{
get
{
- if (((_index == -1)
+ if (((_index == -1)
|| (_index >= _collection.Count)))
{
throw new System.IndexOutOfRangeException("Enumerator not started.");
}
- else
- {
- return _currentElement;
- }
+
+ return _currentElement;
}
}
diff --git a/Scripts/Engines/Reports/Objects/Staffing/PageInfoCollection.cs b/Scripts/Engines/Reports/Objects/Staffing/PageInfoCollection.cs
index 682221ebd..632b60f8a 100644
--- a/Scripts/Engines/Reports/Objects/Staffing/PageInfoCollection.cs
+++ b/Scripts/Engines/Reports/Objects/Staffing/PageInfoCollection.cs
@@ -132,15 +132,13 @@ namespace Server.Engines.Reports
{
get
{
- if (((_index == -1)
+ if (((_index == -1)
|| (_index >= _collection.Count)))
{
throw new System.IndexOutOfRangeException("Enumerator not started.");
}
- else
- {
- return _currentElement;
- }
+
+ return _currentElement;
}
}
@@ -151,15 +149,13 @@ namespace Server.Engines.Reports
{
get
{
- if (((_index == -1)
+ if (((_index == -1)
|| (_index >= _collection.Count)))
{
throw new System.IndexOutOfRangeException("Enumerator not started.");
}
- else
- {
- return _currentElement;
- }
+
+ return _currentElement;
}
}
diff --git a/Scripts/Engines/Reports/Objects/Staffing/QueueStatusCollection.cs b/Scripts/Engines/Reports/Objects/Staffing/QueueStatusCollection.cs
index 0e5fc8b7f..58e44b671 100644
--- a/Scripts/Engines/Reports/Objects/Staffing/QueueStatusCollection.cs
+++ b/Scripts/Engines/Reports/Objects/Staffing/QueueStatusCollection.cs
@@ -132,15 +132,13 @@ namespace Server.Engines.Reports
{
get
{
- if (((_index == -1)
+ if (((_index == -1)
|| (_index >= _collection.Count)))
{
throw new System.IndexOutOfRangeException("Enumerator not started.");
}
- else
- {
- return _currentElement;
- }
+
+ return _currentElement;
}
}
@@ -151,15 +149,13 @@ namespace Server.Engines.Reports
{
get
{
- if (((_index == -1)
+ if (((_index == -1)
|| (_index >= _collection.Count)))
{
throw new System.IndexOutOfRangeException("Enumerator not started.");
}
- else
- {
- return _currentElement;
- }
+
+ return _currentElement;
}
}
diff --git a/Scripts/Engines/Reports/Objects/Staffing/ResponseInfoCollection.cs b/Scripts/Engines/Reports/Objects/Staffing/ResponseInfoCollection.cs
index e458266c4..f9b7f0a9f 100644
--- a/Scripts/Engines/Reports/Objects/Staffing/ResponseInfoCollection.cs
+++ b/Scripts/Engines/Reports/Objects/Staffing/ResponseInfoCollection.cs
@@ -137,15 +137,13 @@ namespace Server.Engines.Reports
{
get
{
- if (((_index == -1)
+ if (((_index == -1)
|| (_index >= _collection.Count)))
{
throw new System.IndexOutOfRangeException("Enumerator not started.");
}
- else
- {
- return _currentElement;
- }
+
+ return _currentElement;
}
}
@@ -156,15 +154,13 @@ namespace Server.Engines.Reports
{
get
{
- if (((_index == -1)
+ if (((_index == -1)
|| (_index >= _collection.Count)))
{
throw new System.IndexOutOfRangeException("Enumerator not started.");
}
- else
- {
- return _currentElement;
- }
+
+ return _currentElement;
}
}
diff --git a/Scripts/Engines/Reports/Persistance/PersistableObjectCollection.cs b/Scripts/Engines/Reports/Persistance/PersistableObjectCollection.cs
index 40f116409..8df497aa8 100644
--- a/Scripts/Engines/Reports/Persistance/PersistableObjectCollection.cs
+++ b/Scripts/Engines/Reports/Persistance/PersistableObjectCollection.cs
@@ -137,15 +137,13 @@ namespace Server.Engines.Reports
{
get
{
- if (((_index == -1)
+ if (((_index == -1)
|| (_index >= _collection.Count)))
{
throw new System.IndexOutOfRangeException("Enumerator not started.");
}
- else
- {
- return _currentElement;
- }
+
+ return _currentElement;
}
}
@@ -156,15 +154,13 @@ namespace Server.Engines.Reports
{
get
{
- if (((_index == -1)
+ if (((_index == -1)
|| (_index >= _collection.Count)))
{
throw new System.IndexOutOfRangeException("Enumerator not started.");
}
- else
- {
- return _currentElement;
- }
+
+ return _currentElement;
}
}
diff --git a/Scripts/Engines/Reports/Rendering/ChartRenderer.cs b/Scripts/Engines/Reports/Rendering/ChartRenderer.cs
index 665e840aa..bc7b85f7d 100644
--- a/Scripts/Engines/Reports/Rendering/ChartRenderer.cs
+++ b/Scripts/Engines/Reports/Rendering/ChartRenderer.cs
@@ -60,11 +60,9 @@ namespace Server.Engines.Reports
{
return _color[index];
}
- else
- {
- return _color[(index+2)%_colorLimit];
- //throw new Exception("Color Limit is " + _colorLimit);
- }
+
+ return _color[(index+2)%_colorLimit];
+ //throw new Exception("Color Limit is " + _colorLimit);
}
}
}
\ No newline at end of file
diff --git a/Scripts/Engines/Spawner/Spawner.cs b/Scripts/Engines/Spawner/Spawner.cs
index 53feb73ed..ecfe497c4 100644
--- a/Scripts/Engines/Spawner/Spawner.cs
+++ b/Scripts/Engines/Spawner/Spawner.cs
@@ -113,8 +113,7 @@ namespace Server.Mobiles
{
if ( m_Running && m_Timer != null && m_Timer.Running )
return m_End - DateTime.UtcNow;
- else
- return TimeSpan.FromSeconds( 0 );
+ return TimeSpan.FromSeconds( 0 );
}
set
{
@@ -388,15 +387,11 @@ namespace Server.Mobiles
if ( thisProp == null )
return null;
- else
- {
- CPA attr = Properties.GetCPA( thisProp );
+ CPA attr = Properties.GetCPA( thisProp );
- if ( attr == null || AccessLevel.Developer < attr.WriteLevel || !thisProp.CanWrite || attr.ReadOnly )
- return null;
- else
- realProps[i] = thisProp;
- }
+ if ( attr == null || AccessLevel.Developer < attr.WriteLevel || !thisProp.CanWrite || attr.ReadOnly )
+ return null;
+ realProps[i] = thisProp;
}
}
@@ -407,11 +402,8 @@ namespace Server.Mobiles
{
if ( index >= 0 && index < m_Entries.Count )
return Spawn( m_Entries[index], out flags );
- else
- {
- flags = EntryFlags.InvalidEntry;
- return false;
- }
+ flags = EntryFlags.InvalidEntry;
+ return false;
}
public bool Spawn( SpawnerEntry entry, out EntryFlags flags )
@@ -606,7 +598,7 @@ namespace Server.Mobiles
{
if ( IsValidWater( map, x, y, Z ) )
return new Point3D( x, y, Z );
- else if ( IsValidWater( map, x, y, mapZ ) )
+ if ( IsValidWater( map, x, y, mapZ ) )
return new Point3D( x, y, mapZ );
}
@@ -614,7 +606,7 @@ namespace Server.Mobiles
{
if ( map.CanSpawnMobile( x, y, Z ) )
return new Point3D( x, y, Z );
- else if ( map.CanSpawnMobile( x, y, mapZ ) )
+ if ( map.CanSpawnMobile( x, y, mapZ ) )
return new Point3D( x, y, mapZ );
}
}
diff --git a/Scripts/Engines/VeteranRewards/Character Statue Maker/CharacterStatue.cs b/Scripts/Engines/VeteranRewards/Character Statue Maker/CharacterStatue.cs
index b7997d929..dd0fd08b0 100644
--- a/Scripts/Engines/VeteranRewards/Character Statue Maker/CharacterStatue.cs
+++ b/Scripts/Engines/VeteranRewards/Character Statue Maker/CharacterStatue.cs
@@ -261,13 +261,11 @@ namespace Server.Mobiles
return true;
}
- else
- {
- by.SendLocalizedMessage( 500720 ); // You don't have enough room in your backpack!
- deed.Delete();
- return false;
- }
+ @by.SendLocalizedMessage( 500720 ); // You don't have enough room in your backpack!
+ deed.Delete();
+
+ return false;
}
public void Restore( CharacterStatue from )
diff --git a/Scripts/Gumps/AdminGump.cs b/Scripts/Gumps/AdminGump.cs
index 918245d0c..e73184361 100644
--- a/Scripts/Gumps/AdminGump.cs
+++ b/Scripts/Gumps/AdminGump.cs
@@ -152,10 +152,8 @@ namespace Server.Gumps
{
if ( m.Kills >= 5 )
return 0x21;
- else if ( m.Criminal )
- return 0x3B1;
- return 0x58;
+ return m.Criminal ? 0x3B1 : 0x58;
}
}
}
@@ -318,14 +316,7 @@ namespace Server.Gumps
for ( int i = 0; i < pools.Count; ++i )
{
BufferPool pool = pools[i];
- string name;
- int freeCount;
- int initialCapacity;
- int currentCapacity;
- int bufferSize;
- int misses;
-
- pool.GetInfo( out name, out freeCount, out initialCapacity, out currentCapacity, out bufferSize, out misses );
+ pool.GetInfo( out string name, out int freeCount, out int initialCapacity, out int currentCapacity, out int bufferSize, out int misses );
if ( sb.Length > 0 )
sb.Append( "
" );
@@ -549,10 +540,8 @@ namespace Server.Gumps
if ( m == null )
{
- if ( RemoteAdmin.AdminNetwork.IsAuth( ns ) )
- AddLabelCropped( 12, offset, 81, 20, LabelHue, "(remote admin)" );
- else
- AddLabelCropped( 12, offset, 81, 20, LabelHue, "(logging in)" );
+ AddLabelCropped(12, offset, 81, 20, LabelHue,
+ RemoteAdmin.AdminNetwork.IsAuth(ns) ? "(remote admin)" : "(logging in)");
}
else
{
@@ -1978,7 +1967,7 @@ namespace Server.Gumps
}
else
{
- from.SendGump( new AdminGump( from, AdminGumpPage.Clients, 0, results, notice == null ? (results.Count == 0 ? "Nothing matched your search terms." : null) : notice, null ) );
+ from.SendGump( new AdminGump( from, AdminGumpPage.Clients, 0, results, notice ?? (results.Count == 0 ? "Nothing matched your search terms." : null), null ) );
}
break;
@@ -2052,7 +2041,7 @@ namespace Server.Gumps
}
}
- from.SendGump( new AdminGump( from, dispAccount != null ? AdminGumpPage.AccountDetails_Information : m_PageType, m_ListPage, m_List, notice, dispAccount != null ? dispAccount : m_State ) );
+ from.SendGump( new AdminGump( from, dispAccount != null ? AdminGumpPage.AccountDetails_Information : m_PageType, m_ListPage, m_List, notice, dispAccount ?? m_State ) );
break;
}
case 7:
@@ -2084,7 +2073,7 @@ namespace Server.Gumps
if ( results.Count == 1 )
from.SendGump( new AdminGump( from, AdminGumpPage.AccountDetails_Information, 0, null, "One match found.", results[0] ) );
else
- from.SendGump( new AdminGump( from, AdminGumpPage.Accounts, 0, results, notice == null ? (results.Count == 0 ? "Nothing matched your search terms." : null) : notice, new ArrayList() ) );
+ from.SendGump( new AdminGump( from, AdminGumpPage.Accounts, 0, results, notice ?? (results.Count == 0 ? "Nothing matched your search terms." : null), new ArrayList() ) );
break;
}
@@ -2507,14 +2496,14 @@ namespace Server.Gumps
from.SendGump( new AdminGump( from, AdminGumpPage.Firewall, 0, results,
$"Search results for : {match}", m_State ) );
else
- from.SendGump( new AdminGump( from, m_PageType, m_ListPage, m_List, notice == null ? "Nothing matched your search terms." : notice, m_State ) );
+ from.SendGump( new AdminGump( from, m_PageType, m_ListPage, m_List, notice ?? "Nothing matched your search terms.", m_State ) );
break;
}
case 1:
{
TextRelay relay = info.GetTextEntry( 0 );
- string text = ( relay == null ? null : relay.Text.Trim() );
+ string text = relay?.Text.Trim();
if ( text == null || text.Length == 0 )
{
diff --git a/Scripts/Gumps/ClientGump.cs b/Scripts/Gumps/ClientGump.cs
index 464841a78..284cc94f2 100644
--- a/Scripts/Gumps/ClientGump.cs
+++ b/Scripts/Gumps/ClientGump.cs
@@ -32,12 +32,13 @@ namespace Server.Gumps
from.SendMessage( "That character is no longer online." );
return;
}
- else if ( focus.Deleted )
+
+ if ( focus.Deleted )
{
from.SendMessage( "That character no longer exists." );
return;
}
- else if ( from != focus && focus.Hidden && from.AccessLevel < focus.AccessLevel && ( !( focus is PlayerMobile ) || !((PlayerMobile)focus).VisibilityList.Contains( from ) ) )
+ if ( from != focus && focus.Hidden && from.AccessLevel < focus.AccessLevel && ( !( focus is PlayerMobile ) || !((PlayerMobile)focus).VisibilityList.Contains( from ) ) )
{
from.SendMessage( "That character is no longer visible." );
return;
@@ -294,4 +295,4 @@ namespace Server.Gumps
}
}
}
-}
\ No newline at end of file
+}
diff --git a/Scripts/Gumps/ConfirmHouseResize.cs b/Scripts/Gumps/ConfirmHouseResize.cs
index 06da6fdf5..a61e2856a 100644
--- a/Scripts/Gumps/ConfirmHouseResize.cs
+++ b/Scripts/Gumps/ConfirmHouseResize.cs
@@ -57,7 +57,8 @@ namespace Server.Gumps
m_Mobile.SendLocalizedMessage( 1080455 ); // You can not resize your house at this time. Please remove all items fom the moving crate and try again.
return;
}
- else if ( !Guilds.Guild.NewGuildSystem && m_House.FindGuildstone() != null )
+
+ if ( !Guilds.Guild.NewGuildSystem && m_House.FindGuildstone() != null )
{
m_Mobile.SendLocalizedMessage( 501389 ); // You cannot redeed a house with a guildstone inside.
return;
@@ -67,17 +68,17 @@ namespace Server.Gumps
m_Mobile.SendLocalizedMessage( 503236 ); // You need to collect your vendor's belongings before moving.
return;
}*/
- else if ( m_House.HasRentedVendors && m_House.VendorInventories.Count > 0 )
+ if ( m_House.HasRentedVendors && m_House.VendorInventories.Count > 0 )
{
m_Mobile.SendLocalizedMessage( 1062679 ); // You cannot do that that while you still have contract vendors or unclaimed contract vendor inventory in your house.
return;
}
- else if ( m_House.HasRentedVendors )
+ if ( m_House.HasRentedVendors )
{
m_Mobile.SendLocalizedMessage( 1062680 ); // You cannot do that that while you still have contract vendors in your house.
return;
}
- else if ( m_House.VendorInventories.Count > 0 )
+ if ( m_House.VendorInventories.Count > 0 )
{
m_Mobile.SendLocalizedMessage( 1062681 ); // You cannot do that that while you still have unclaimed contract vendor inventory in your house.
return;
diff --git a/Scripts/Gumps/Guilds/GuildAdminCandidatesGump.cs b/Scripts/Gumps/Guilds/GuildAdminCandidatesGump.cs
index cb1107c87..ace292939 100644
--- a/Scripts/Gumps/Guilds/GuildAdminCandidatesGump.cs
+++ b/Scripts/Gumps/Guilds/GuildAdminCandidatesGump.cs
@@ -53,8 +53,8 @@ namespace Server.Gumps
PlayerState guildState = PlayerState.Find( m_Guild.Leader );
PlayerState targetState = PlayerState.Find( m );
- Faction guildFaction = ( guildState == null ? null : guildState.Faction );
- Faction targetFaction = ( targetState == null ? null : targetState.Faction );
+ Faction guildFaction = guildState?.Faction;
+ Faction targetFaction = targetState?.Faction;
if ( guildFaction != targetFaction )
{
@@ -67,7 +67,8 @@ namespace Server.Gumps
break;
}
- else if ( targetState != null && targetState.IsLeaving )
+
+ if ( targetState != null && targetState.IsLeaving )
{
// OSI does this quite strangely, so we'll just do it this way
m_Mobile.SendMessage( "That person is quitting their faction and so you may not recruit them." );
diff --git a/Scripts/Gumps/Guilds/GuildTitlePrompt.cs b/Scripts/Gumps/Guilds/GuildTitlePrompt.cs
index 9864825d5..a9ba1e9d9 100644
--- a/Scripts/Gumps/Guilds/GuildTitlePrompt.cs
+++ b/Scripts/Gumps/Guilds/GuildTitlePrompt.cs
@@ -19,7 +19,7 @@ namespace Server.Gumps
{
if ( GuildGump.BadLeader( m_Leader, m_Guild ) )
return;
- else if ( m_Target.Deleted || !m_Guild.IsMember( m_Target ) )
+ if ( m_Target.Deleted || !m_Guild.IsMember( m_Target ) )
return;
GuildGump.EnsureClosed( m_Leader );
@@ -30,7 +30,7 @@ namespace Server.Gumps
{
if ( GuildGump.BadLeader( m_Leader, m_Guild ) )
return;
- else if ( m_Target.Deleted || !m_Guild.IsMember( m_Target ) )
+ if ( m_Target.Deleted || !m_Guild.IsMember( m_Target ) )
return;
text = text.Trim();
diff --git a/Scripts/Gumps/Guilds/New Guild System/DiplomacyGump.cs b/Scripts/Gumps/Guilds/New Guild System/DiplomacyGump.cs
index 4cd3ccfee..21bd42ba4 100644
--- a/Scripts/Gumps/Guilds/New Guild System/DiplomacyGump.cs
+++ b/Scripts/Gumps/Guilds/New Guild System/DiplomacyGump.cs
@@ -29,9 +29,9 @@ namespace Server.Guilds
{
if ( x == null && y == null )
return 0;
- else if ( x == null )
+ if ( x == null )
return -1;
- else if ( y == null )
+ if ( y == null )
return 1;
return Insensitive.Compare( x.Name, y.Name );
@@ -56,9 +56,9 @@ namespace Server.Guilds
{
if ( x == null && y == null )
return 0;
- else if ( x == null )
+ if ( x == null )
return -1;
- else if ( y == null )
+ if ( y == null )
return 1;
GuildCompareStatus aStatus = GuildCompareStatus.Peace;
@@ -90,9 +90,9 @@ namespace Server.Guilds
{
if ( x == null && y == null )
return 0;
- else if ( x == null )
+ if ( x == null )
return -1;
- else if ( y == null )
+ if ( y == null )
return 1;
return Insensitive.Compare( x.Abbreviation, y.Abbreviation );
diff --git a/Scripts/Gumps/Guilds/New Guild System/GuildRosterGump.cs b/Scripts/Gumps/Guilds/New Guild System/GuildRosterGump.cs
index cb60b59dd..c3ce2bdcf 100644
--- a/Scripts/Gumps/Guilds/New Guild System/GuildRosterGump.cs
+++ b/Scripts/Gumps/Guilds/New Guild System/GuildRosterGump.cs
@@ -22,9 +22,9 @@ namespace Server.Guilds
{
if ( x == null && y == null )
return 0;
- else if ( x == null )
+ if ( x == null )
return -1;
- else if ( y == null )
+ if ( y == null )
return 1;
return Insensitive.Compare( x.Name, y.Name );
@@ -43,9 +43,9 @@ namespace Server.Guilds
{
if ( x == null && y == null )
return 0;
- else if ( x == null )
+ if ( x == null )
return -1;
- else if ( y == null )
+ if ( y == null )
return 1;
NetState aState = x.NetState;
@@ -53,12 +53,11 @@ namespace Server.Guilds
if ( aState == null && bState == null )
return x.LastOnline.CompareTo( y.LastOnline );
- else if ( aState == null )
+ if ( aState == null )
return -1;
- else if ( bState == null )
+ if ( bState == null )
return 1;
- else
- return 0;
+ return 0;
}
}
private class TitleComparer : IComparer
@@ -73,9 +72,9 @@ namespace Server.Guilds
{
if ( x == null && y == null )
return 0;
- else if ( x == null )
+ if ( x == null )
return -1;
- else if ( y == null )
+ if ( y == null )
return 1;
return Insensitive.Compare( x.GuildTitle, y.GuildTitle );
@@ -94,9 +93,9 @@ namespace Server.Guilds
{
if ( x == null && y == null )
return 0;
- else if ( x == null )
+ if ( x == null )
return -1;
- else if ( y == null )
+ if ( y == null )
return 1;
return x.GuildRank.Rank.CompareTo( y.GuildRank.Rank );
@@ -151,7 +150,7 @@ namespace Server.Guilds
defs[0] = name;
defs[1] = pm.GuildRank.Name;
defs[2] = (pm.NetState != null) ? new TextDefinition( 1063015 ): new TextDefinition( pm.LastOnline.ToString( "yyyy-MM-dd" ) );
- defs[3] = (pm.GuildTitle == null) ? "" : pm.GuildTitle;
+ defs[3] = pm.GuildTitle ?? "";
return defs;
}
@@ -203,8 +202,8 @@ namespace Server.Guilds
PlayerState guildState = PlayerState.Find( g.Leader );
PlayerState targetState = PlayerState.Find( targ );
- Faction guildFaction = ( guildState == null ? null : guildState.Faction );
- Faction targetFaction = ( targetState == null ? null : targetState.Faction );
+ Faction guildFaction = guildState?.Faction;
+ Faction targetFaction = targetState?.Faction;
if ( pm == null || !IsMember( pm, guild ) || !pm.GuildRank.GetFlag( RankFlags.CanInvitePlayer ) )
{
diff --git a/Scripts/Gumps/HouseDemolishGump.cs b/Scripts/Gumps/HouseDemolishGump.cs
index 8185bed41..9f02b2b4e 100644
--- a/Scripts/Gumps/HouseDemolishGump.cs
+++ b/Scripts/Gumps/HouseDemolishGump.cs
@@ -59,7 +59,8 @@ namespace Server.Gumps
{
return;
}
- else if ( !Guilds.Guild.NewGuildSystem && m_House.FindGuildstone() != null )
+
+ if ( !Guilds.Guild.NewGuildSystem && m_House.FindGuildstone() != null )
{
m_Mobile.SendLocalizedMessage( 501389 ); // You cannot redeed a house with a guildstone inside.
return;
@@ -69,17 +70,17 @@ namespace Server.Gumps
m_Mobile.SendLocalizedMessage( 503236 ); // You need to collect your vendor's belongings before moving.
return;
}*/
- else if ( m_House.HasRentedVendors && m_House.VendorInventories.Count > 0 )
+ if ( m_House.HasRentedVendors && m_House.VendorInventories.Count > 0 )
{
m_Mobile.SendLocalizedMessage( 1062679 ); // You cannot do that that while you still have contract vendors or unclaimed contract vendor inventory in your house.
return;
}
- else if ( m_House.HasRentedVendors )
+ if ( m_House.HasRentedVendors )
{
m_Mobile.SendLocalizedMessage( 1062680 ); // You cannot do that that while you still have contract vendors in your house.
return;
}
- else if ( m_House.VendorInventories.Count > 0 )
+ if ( m_House.VendorInventories.Count > 0 )
{
m_Mobile.SendLocalizedMessage( 1062681 ); // You cannot do that that while you still have unclaimed contract vendor inventory in your house.
return;
diff --git a/Scripts/Gumps/PetResurrectGump.cs b/Scripts/Gumps/PetResurrectGump.cs
index b24033e29..8be59baad 100644
--- a/Scripts/Gumps/PetResurrectGump.cs
+++ b/Scripts/Gumps/PetResurrectGump.cs
@@ -53,7 +53,8 @@ namespace Server.Gumps
from.SendLocalizedMessage( 503256 ); // You fail to resurrect the creature.
return;
}
- else if ( m_Pet.Region != null && m_Pet.Region.IsPartOf( "Khaldun" ) ) //TODO: Confirm for pets, as per Bandage's script.
+
+ if ( m_Pet.Region != null && m_Pet.Region.IsPartOf( "Khaldun" ) ) //TODO: Confirm for pets, as per Bandage's script.
{
from.SendLocalizedMessage( 1010395 ); // The veil of death in this area is too strong and resists thy efforts to restore life.
return;
diff --git a/Scripts/Gumps/Props/PropsGump.cs b/Scripts/Gumps/Props/PropsGump.cs
index a8bf7f2f2..2e43b9394 100644
--- a/Scripts/Gumps/Props/PropsGump.cs
+++ b/Scripts/Gumps/Props/PropsGump.cs
@@ -544,8 +544,7 @@ namespace Server.Gumps
if ( attrs.Length > 0 )
return attrs[0] as CPA;
- else
- return null;
+ return null;
}
private ArrayList GetGroups( Type objectType, PropertyInfo[] props )
@@ -600,7 +599,8 @@ namespace Server.Gumps
{
return s;
}
- else if ( t == typeof( byte ) || t == typeof( sbyte ) || t == typeof( short ) || t == typeof( ushort ) || t == typeof( int ) || t == typeof( uint ) || t == typeof( long ) || t == typeof( ulong ) )
+
+ if ( t == typeof( byte ) || t == typeof( sbyte ) || t == typeof( short ) || t == typeof( ushort ) || t == typeof( int ) || t == typeof( uint ) || t == typeof( long ) || t == typeof( ulong ) )
{
if ( s.StartsWith( "0x" ) )
{
@@ -608,21 +608,17 @@ namespace Server.Gumps
{
return Convert.ChangeType( Convert.ToUInt64( s.Substring( 2 ), 16 ), t );
}
- else
- {
- return Convert.ChangeType( Convert.ToInt64( s.Substring( 2 ), 16 ), t );
- }
- }
- else
- {
- return Convert.ChangeType( s, t );
+
+ return Convert.ChangeType( Convert.ToInt64( s.Substring( 2 ), 16 ), t );
}
+
+ return Convert.ChangeType( s, t );
}
- else if ( t == typeof( double ) || t == typeof( float ) )
+ if ( t == typeof( double ) || t == typeof( float ) )
{
return Convert.ChangeType( s, t );
}
- else if ( t.IsDefined( typeof( ParsableAttribute ), false ) )
+ if ( t.IsDefined( typeof( ParsableAttribute ), false ) )
{
MethodInfo parseMethod = t.GetMethod( "Parse", new[]{ typeof( string ) } );
diff --git a/Scripts/Gumps/RunebookGump.cs b/Scripts/Gumps/RunebookGump.cs
index 043d30c66..0950e019a 100644
--- a/Scripts/Gumps/RunebookGump.cs
+++ b/Scripts/Gumps/RunebookGump.cs
@@ -19,13 +19,13 @@ namespace Server.Gumps
{
if ( map == Map.Trammel )
return 10;
- else if ( map == Map.Felucca )
+ if ( map == Map.Felucca )
return 81;
- else if ( map == Map.Ilshenar )
+ if ( map == Map.Ilshenar )
return 1102;
- else if ( map == Map.Malas )
+ if ( map == Map.Malas )
return 1102;
- else if ( map == Map.Tokuno )
+ if ( map == Map.Tokuno )
return 1154;
return 0;
diff --git a/Scripts/Gumps/WhoGump.cs b/Scripts/Gumps/WhoGump.cs
index e1d2a8da6..c845cf51b 100644
--- a/Scripts/Gumps/WhoGump.cs
+++ b/Scripts/Gumps/WhoGump.cs
@@ -92,10 +92,9 @@ namespace Server.Gumps
if ( x.AccessLevel > y.AccessLevel )
return -1;
- else if ( x.AccessLevel < y.AccessLevel )
+ if ( x.AccessLevel < y.AccessLevel )
return 1;
- else
- return Insensitive.Compare( x.Name, y.Name );
+ return Insensitive.Compare( x.Name, y.Name );
}
}
@@ -232,7 +231,7 @@ namespace Server.Gumps
{
if ( m.Kills >= 5 )
return 0x21;
- else if ( m.Criminal )
+ if ( m.Criminal )
return 0x3B1;
return 0x58;
diff --git a/Scripts/Holiday Stuff/Christmas/2010/Addons/FireFliesDeed.cs b/Scripts/Holiday Stuff/Christmas/2010/Addons/FireFliesDeed.cs
index 69511c28d..862bacebd 100644
--- a/Scripts/Holiday Stuff/Christmas/2010/Addons/FireFliesDeed.cs
+++ b/Scripts/Holiday Stuff/Christmas/2010/Addons/FireFliesDeed.cs
@@ -88,8 +88,7 @@ namespace Server.Items
if ( FacingSouth )
return BaseAddon.IsWall( p.X, p.Y - 1, p.Z, map ); // north wall
- else
- return BaseAddon.IsWall( p.X - 1, p.Y, p.Z, map ); // west wall
+ return BaseAddon.IsWall( p.X - 1, p.Y, p.Z, map ); // west wall
}
}
diff --git a/Scripts/Holiday Stuff/Halloween/2006/Engines/TrickOrTreat.cs b/Scripts/Holiday Stuff/Halloween/2006/Engines/TrickOrTreat.cs
index f2ad7231a..68d19334f 100644
--- a/Scripts/Holiday Stuff/Halloween/2006/Engines/TrickOrTreat.cs
+++ b/Scripts/Holiday Stuff/Halloween/2006/Engines/TrickOrTreat.cs
@@ -272,7 +272,7 @@ namespace Server.Engines.Events
Body = from.Body;
m_From = from;
- Name = $"{@from.Name}\'s Naughty Twin";
+ Name = $"{from.Name}\'s Naughty Twin";
Timer.DelayCall( TrickOrTreat.OneSecond, Utility.RandomBool() ? StealCandy : new TimerStateCallback( ToGate ), m_From );
}
diff --git a/Scripts/Holiday Stuff/Halloween/2011/Mobiles/PumpkinHead.cs b/Scripts/Holiday Stuff/Halloween/2011/Mobiles/PumpkinHead.cs
index 0638610ef..5d010ba7f 100644
--- a/Scripts/Holiday Stuff/Halloween/2011/Mobiles/PumpkinHead.cs
+++ b/Scripts/Holiday Stuff/Halloween/2011/Mobiles/PumpkinHead.cs
@@ -100,7 +100,7 @@ namespace Server.Mobiles
{
if ( Utility.RandomBool() )
{
- if ( @from?.Map != null && Map != Map.Internal && Map == @from.Map && @from.InRange( this, 12 ) )
+ if ( from?.Map != null && Map != Map.Internal && Map == from.Map && from.InRange( this, 12 ) )
{
SpillAcid( ( willKill ) ? this : from, ( willKill ) ? 3 : 1 );
}
diff --git a/Scripts/Holiday Stuff/Valentine/2011/Items/StValentinesBears.cs b/Scripts/Holiday Stuff/Valentine/2011/Items/StValentinesBears.cs
index c34275e5f..33c93c5e4 100644
--- a/Scripts/Holiday Stuff/Valentine/2011/Items/StValentinesBears.cs
+++ b/Scripts/Holiday Stuff/Valentine/2011/Items/StValentinesBears.cs
@@ -12,8 +12,7 @@ namespace Server.Items
{
if ( m_Owner != null )
return $"{m_Owner}'s St. Valentine Bear";
- else
- return "St. Valentine Bear";
+ return "St. Valentine Bear";
}
}
@@ -194,9 +193,10 @@ namespace Server.Items
from.SendMessage( "Lines cannot be left blank." );
return;
}
- else if ( line1.Length > 25
- || line2.Length > 25
- || line3.Length > 25 )
+
+ if ( line1.Length > 25
+ || line2.Length > 25
+ || line3.Length > 25 )
{
from.SendMessage( "Lines may not exceed 25 characters." );
return;
@@ -216,7 +216,7 @@ namespace Server.Items
{
TextRelay tr = info.GetTextEntry( idx );
- return ( tr == null ) ? null : tr.Text;
+ return tr?.Text;
}
}
}
diff --git a/Scripts/Items/Addons/AddonComponent.cs b/Scripts/Items/Addons/AddonComponent.cs
index 718fa079a..a4ebe0ee8 100644
--- a/Scripts/Items/Addons/AddonComponent.cs
+++ b/Scripts/Items/Addons/AddonComponent.cs
@@ -151,7 +151,7 @@ namespace Server.Items
public override void OnDoubleClick( Mobile from )
{
- m_Addon?.OnComponentUsed( this, @from );
+ m_Addon?.OnComponentUsed( this, from );
}
public void OnChop( Mobile from )
diff --git a/Scripts/Items/Addons/AddonContainerComponent.cs b/Scripts/Items/Addons/AddonContainerComponent.cs
index 2651d9d3c..230cca655 100644
--- a/Scripts/Items/Addons/AddonContainerComponent.cs
+++ b/Scripts/Items/Addons/AddonContainerComponent.cs
@@ -60,7 +60,7 @@ namespace Server.Items
public override void OnDoubleClick( Mobile from )
{
- m_Addon?.OnComponentUsed( this, @from );
+ m_Addon?.OnComponentUsed( this, from );
}
public override void OnLocationChange( Point3D old )
@@ -71,7 +71,7 @@ namespace Server.Items
public override void GetContextMenuEntries( Mobile from, List list )
{
- m_Addon?.GetContextMenuEntries( @from, list );
+ m_Addon?.GetContextMenuEntries( from, list );
}
public override void OnMapChange()
diff --git a/Scripts/Items/Addons/ArcheryButteAddon.cs b/Scripts/Items/Addons/ArcheryButteAddon.cs
index a576b0d01..f714f531c 100644
--- a/Scripts/Items/Addons/ArcheryButteAddon.cs
+++ b/Scripts/Items/Addons/ArcheryButteAddon.cs
@@ -165,7 +165,8 @@ namespace Server.Items
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500598 ); // You are too far away from the archery butte to get an accurate shot.
return;
}
- else if ( from.InRange( worldLoc, 4 ) )
+
+ if ( from.InRange( worldLoc, 4 ) )
{
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500599 ); // You are too close to the target.
return;
@@ -250,7 +251,7 @@ namespace Server.Items
if ( split )
{
PublicOverheadMessage( MessageType.Regular, 0x3B2, 1010027 + area,
- $"{@from.Name}\t{(isArrow ? "arrow" : "bolt")}");
+ $"{from.Name}\t{(isArrow ? "arrow" : "bolt")}");
}
else
{
diff --git a/Scripts/Items/Addons/BaseAddonContainer.cs b/Scripts/Items/Addons/BaseAddonContainer.cs
index e76c306ed..fe22ceab5 100644
--- a/Scripts/Items/Addons/BaseAddonContainer.cs
+++ b/Scripts/Items/Addons/BaseAddonContainer.cs
@@ -168,7 +168,7 @@ namespace Server.Items
if ( !map.CanFit( p3D.X, p3D.Y, p3D.Z, c.ItemData.Height, false, true, ( c.Z == 0 ) ) )
return AddonFitResult.Blocked;
- else if ( !BaseAddon.CheckHouse( from, p3D, map, c.ItemData.Height, ref house ) )
+ if ( !BaseAddon.CheckHouse( from, p3D, map, c.ItemData.Height, ref house ) )
return AddonFitResult.NotInHouse;
if ( c.NeedsWall )
@@ -184,7 +184,7 @@ namespace Server.Items
if ( !map.CanFit( p3.X, p3.Y, p3.Z, ItemData.Height, false, true, ( Z == 0 ) ) )
return AddonFitResult.Blocked;
- else if ( !BaseAddon.CheckHouse( from, p3, map, ItemData.Height, ref house ) )
+ if ( !BaseAddon.CheckHouse( from, p3, map, ItemData.Height, ref house ) )
return AddonFitResult.NotInHouse;
if ( NeedsWall )
diff --git a/Scripts/Items/Addons/ElvenSpinningwheelEastAddon.cs b/Scripts/Items/Addons/ElvenSpinningwheelEastAddon.cs
index 5bf7a4a85..74570950f 100644
--- a/Scripts/Items/Addons/ElvenSpinningwheelEastAddon.cs
+++ b/Scripts/Items/Addons/ElvenSpinningwheelEastAddon.cs
@@ -77,7 +77,7 @@ namespace Server.Items
}
}
- callback?.Invoke( this, @from, hue );
+ callback?.Invoke( this, from, hue );
}
private class SpinTimer : Timer
diff --git a/Scripts/Items/Addons/ElvenSpinningwheelSouthAddon.cs b/Scripts/Items/Addons/ElvenSpinningwheelSouthAddon.cs
index e2ca8c1e9..f1eec9a81 100644
--- a/Scripts/Items/Addons/ElvenSpinningwheelSouthAddon.cs
+++ b/Scripts/Items/Addons/ElvenSpinningwheelSouthAddon.cs
@@ -79,7 +79,7 @@ namespace Server.Items
}
}
- callback?.Invoke( this, @from, hue );
+ callback?.Invoke( this, from, hue );
}
private class SpinTimer : Timer
diff --git a/Scripts/Items/Addons/SolenAntHole.cs b/Scripts/Items/Addons/SolenAntHole.cs
index eb69d07fb..87479e53f 100644
--- a/Scripts/Items/Addons/SolenAntHole.cs
+++ b/Scripts/Items/Addons/SolenAntHole.cs
@@ -22,7 +22,7 @@ namespace Server.Items
{
from.MoveToWorld( new Point3D( 5922, 2024, 0 ), map );
PublicOverheadMessage( MessageType.Regular, 0x3B2, true,
- $"* {@from.Name} dives into the hole and disappears!*");
+ $"* {from.Name} dives into the hole and disappears!*");
}
}
else
diff --git a/Scripts/Items/Addons/SpinningwheelEastAddon.cs b/Scripts/Items/Addons/SpinningwheelEastAddon.cs
index ed183d021..015d2bd73 100644
--- a/Scripts/Items/Addons/SpinningwheelEastAddon.cs
+++ b/Scripts/Items/Addons/SpinningwheelEastAddon.cs
@@ -87,7 +87,7 @@ namespace Server.Items
}
}
- callback?.Invoke( this, @from, hue );
+ callback?.Invoke( this, from, hue );
}
private class SpinTimer : Timer
diff --git a/Scripts/Items/Addons/SpinningwheelSouthAddon.cs b/Scripts/Items/Addons/SpinningwheelSouthAddon.cs
index 79c5280c2..9eefd93bd 100644
--- a/Scripts/Items/Addons/SpinningwheelSouthAddon.cs
+++ b/Scripts/Items/Addons/SpinningwheelSouthAddon.cs
@@ -79,7 +79,7 @@ namespace Server.Items
}
}
- callback?.Invoke( this, @from, hue );
+ callback?.Invoke( this, from, hue );
}
private class SpinTimer : Timer
diff --git a/Scripts/Items/Aquarium/Aquarium.cs b/Scripts/Items/Aquarium/Aquarium.cs
index 5d65d7f17..adb0cb1ac 100644
--- a/Scripts/Items/Aquarium/Aquarium.cs
+++ b/Scripts/Items/Aquarium/Aquarium.cs
@@ -110,8 +110,7 @@ namespace Server.Items
{
if ( ItemID == 0x3062 )
return new AquariumEastDeed();
- else
- return new AquariumNorthDeed();
+ return new AquariumNorthDeed();
}
}
@@ -167,7 +166,7 @@ namespace Server.Items
{
if ( from == null || from.Deleted )
return false;
- else if ( from.AccessLevel >= AccessLevel.GameMaster )
+ if ( from.AccessLevel >= AccessLevel.GameMaster )
return true;
BaseHouse house = BaseHouse.FindHouseAt( this );
@@ -822,7 +821,7 @@ namespace Server.Items
if ( IsFull || m_LiveCreatures >= MaxLiveCreatures || fish.Dead )
{
- @from?.SendLocalizedMessage( 1073633 ); // The aquarium can not hold the creature.
+ from?.SendLocalizedMessage( 1073633 ); // The aquarium can not hold the creature.
return false;
}
@@ -832,7 +831,7 @@ namespace Server.Items
m_LiveCreatures += 1;
- @from?.SendLocalizedMessage( 1073632, $"#{fish.LabelNumber}"); // You add the following creature to your aquarium: ~1_FISH~
+ from?.SendLocalizedMessage( 1073632, $"#{fish.LabelNumber}"); // You add the following creature to your aquarium: ~1_FISH~
InvalidateProperties();
return true;
@@ -874,7 +873,7 @@ namespace Server.Items
#region Static members
public static FishBowl GetEmptyBowl( Mobile from )
{
- if ( @from?.Backpack == null )
+ if ( from?.Backpack == null )
return null;
Item[] items = from.Backpack.FindItemsByType( typeof( FishBowl ) );
diff --git a/Scripts/Items/Aquarium/AquariumFishingNet.cs b/Scripts/Items/Aquarium/AquariumFishingNet.cs
index 3c74c194b..99f0ecc92 100644
--- a/Scripts/Items/Aquarium/AquariumFishingNet.cs
+++ b/Scripts/Items/Aquarium/AquariumFishingNet.cs
@@ -38,24 +38,20 @@ namespace Server.Items
Delete();
return;
}
- else
+
+ if ( from.PlaceInBackpack( fish ) )
{
- if ( from.PlaceInBackpack( fish ) )
- {
- from.PlaySound( 0x5A2 );
- from.SendLocalizedMessage( 1074490 ); // A live creature flops around in your pack before running out of air.
+ from.PlaySound( 0x5A2 );
+ from.SendLocalizedMessage( 1074490 ); // A live creature flops around in your pack before running out of air.
- fish.Kill();
- Delete();
- return;
- }
- else
- {
- fish.Delete();
-
- from.SendLocalizedMessage( 1074488 ); // You could not hold the creature.
- }
+ fish.Kill();
+ Delete();
+ return;
}
+
+ fish.Delete();
+
+ from.SendLocalizedMessage( 1074488 ); // You could not hold the creature.
}
InUse = false;
diff --git a/Scripts/Items/Armor/BaseArmor.cs b/Scripts/Items/Armor/BaseArmor.cs
index 12ca9e196..8a1afd987 100644
--- a/Scripts/Items/Armor/BaseArmor.cs
+++ b/Scripts/Items/Armor/BaseArmor.cs
@@ -368,10 +368,9 @@ namespace Server.Items
{
if ( type == StatType.Str )
return StrBonus + Attributes.BonusStr;
- else if ( type == StatType.Dex )
+ if ( type == StatType.Dex )
return DexBonus + Attributes.BonusDex;
- else
- return IntBonus + Attributes.BonusInt;
+ return IntBonus + Attributes.BonusInt;
}
[CommandProperty( AccessLevel.GameMaster )]
@@ -1141,7 +1140,8 @@ namespace Server.Items
return false;
}
- else if ( !AllowMaleWearer && !from.Female )
+
+ if ( !AllowMaleWearer && !from.Female )
{
if ( AllowFemaleWearer )
from.SendLocalizedMessage( 1010388 ); // Only females can wear this.
@@ -1150,7 +1150,7 @@ namespace Server.Items
return false;
}
- else if ( !AllowFemaleWearer && from.Female )
+ if ( !AllowFemaleWearer && from.Female )
{
if ( AllowMaleWearer )
from.SendLocalizedMessage( 1063343 ); // Only males can wear this.
@@ -1159,27 +1159,25 @@ namespace Server.Items
return false;
}
- else
- {
- int strBonus = ComputeStatBonus( StatType.Str ), strReq = ComputeStatReq( StatType.Str );
- int dexBonus = ComputeStatBonus( StatType.Dex ), dexReq = ComputeStatReq( StatType.Dex );
- int intBonus = ComputeStatBonus( StatType.Int ), intReq = ComputeStatReq( StatType.Int );
+ int strBonus = ComputeStatBonus( StatType.Str ), strReq = ComputeStatReq( StatType.Str );
+ int dexBonus = ComputeStatBonus( StatType.Dex ), dexReq = ComputeStatReq( StatType.Dex );
+ int intBonus = ComputeStatBonus( StatType.Int ), intReq = ComputeStatReq( StatType.Int );
- if ( from.Dex < dexReq || (from.Dex + dexBonus) < 1 )
- {
- from.SendLocalizedMessage( 502077 ); // You do not have enough dexterity to equip this item.
- return false;
- }
- else if ( from.Str < strReq || (from.Str + strBonus) < 1 )
- {
- from.SendLocalizedMessage( 500213 ); // You are not strong enough to equip that.
- return false;
- }
- else if ( from.Int < intReq || (from.Int + intBonus) < 1 )
- {
- from.SendMessage( "You are not smart enough to equip that." );
- return false;
- }
+ if ( from.Dex < dexReq || (from.Dex + dexBonus) < 1 )
+ {
+ from.SendLocalizedMessage( 502077 ); // You do not have enough dexterity to equip this item.
+ return false;
+ }
+
+ if ( from.Str < strReq || (from.Str + strBonus) < 1 )
+ {
+ from.SendLocalizedMessage( 500213 ); // You are not strong enough to equip that.
+ return false;
+ }
+ if ( from.Int < intReq || (from.Int + intBonus) < 1 )
+ {
+ from.SendMessage( "You are not smart enough to equip that." );
+ return false;
}
}
diff --git a/Scripts/Items/Books/BaseBook.cs b/Scripts/Items/Books/BaseBook.cs
index f094f55f9..80efe11cf 100644
--- a/Scripts/Items/Books/BaseBook.cs
+++ b/Scripts/Items/Books/BaseBook.cs
@@ -163,10 +163,10 @@ namespace Server.Items
SaveFlags flags = SaveFlags.None;
- if ( m_Title != ( content == null ? null : content.Title ) )
+ if ( m_Title != content?.Title )
flags |= SaveFlags.Title;
- if ( m_Author != ( content == null ? null : content.Author ) )
+ if ( m_Author != content?.Author )
flags |= SaveFlags.Author;
if ( m_Writable )
@@ -489,8 +489,8 @@ namespace Server.Items
{
public BookHeader( Mobile from, BaseBook book ) : base ( 0xD4 )
{
- string title = book.Title == null ? "" : book.Title;
- string author = book.Author == null ? "" : book.Author;
+ string title = book.Title ?? "";
+ string author = book.Author ?? "";
byte[] titleBuffer = Utility.UTF8.GetBytes( title );
byte[] authorBuffer = Utility.UTF8.GetBytes( author );
diff --git a/Scripts/Items/Books/Defined/BookContent.cs b/Scripts/Items/Books/Defined/BookContent.cs
index 9fbef9f47..e78989159 100644
--- a/Scripts/Items/Books/Defined/BookContent.cs
+++ b/Scripts/Items/Books/Defined/BookContent.cs
@@ -43,7 +43,8 @@ namespace Server.Items
{
return false;
}
- else if ( a != b )
+
+ if ( a != b )
{
for ( int j = 0; j < a.Length; ++j )
{
diff --git a/Scripts/Items/Clothing/BaseClothing.cs b/Scripts/Items/Clothing/BaseClothing.cs
index 9f6fde811..326d83f2a 100644
--- a/Scripts/Items/Clothing/BaseClothing.cs
+++ b/Scripts/Items/Clothing/BaseClothing.cs
@@ -191,7 +191,8 @@ namespace Server.Items
return false;
}
- else if ( !AllowMaleWearer && !from.Female )
+
+ if ( !AllowMaleWearer && !from.Female )
{
if ( AllowFemaleWearer )
from.SendLocalizedMessage( 1010388 ); // Only females can wear this.
@@ -200,7 +201,7 @@ namespace Server.Items
return false;
}
- else if ( !AllowFemaleWearer && from.Female )
+ if ( !AllowFemaleWearer && from.Female )
{
if ( AllowMaleWearer )
from.SendLocalizedMessage( 1063343 ); // Only males can wear this.
@@ -209,16 +210,13 @@ namespace Server.Items
return false;
}
- else
- {
- int strBonus = ComputeStatBonus( StatType.Str );
- int strReq = ComputeStatReq( StatType.Str );
+ int strBonus = ComputeStatBonus( StatType.Str );
+ int strReq = ComputeStatReq( StatType.Str );
- if ( from.Str < strReq || (from.Str + strBonus) < 1 )
- {
- from.SendLocalizedMessage( 500213 ); // You are not strong enough to equip that.
- return false;
- }
+ if ( from.Str < strReq || (from.Str + strBonus) < 1 )
+ {
+ from.SendLocalizedMessage( 500213 ); // You are not strong enough to equip that.
+ return false;
}
}
@@ -249,10 +247,9 @@ namespace Server.Items
{
if ( type == StatType.Str )
return BaseStrBonus + Attributes.BonusStr;
- else if ( type == StatType.Dex )
+ if ( type == StatType.Dex )
return BaseDexBonus + Attributes.BonusDex;
- else
- return BaseIntBonus + Attributes.BonusInt;
+ return BaseIntBonus + Attributes.BonusInt;
}
public virtual void AddStatBonuses( Mobile parent )
@@ -912,7 +909,7 @@ namespace Server.Items
{
if ( Deleted )
return false;
- else if ( RootParent is Mobile && from != RootParent )
+ if ( RootParent is Mobile && from != RootParent )
return false;
Hue = sender.DyedHue;
diff --git a/Scripts/Items/Containers/Strongbox.cs b/Scripts/Items/Containers/Strongbox.cs
index 056028e2d..a7c8a96bf 100644
--- a/Scripts/Items/Containers/Strongbox.cs
+++ b/Scripts/Items/Containers/Strongbox.cs
@@ -83,8 +83,7 @@ namespace Server.Items
{
if ( m_House != null && m_Owner != null && !m_Owner.Deleted )
return !m_House.IsCoOwner( m_Owner );
- else
- return true;
+ return true;
}
}
diff --git a/Scripts/Items/Containers/TreasureMapChest.cs b/Scripts/Items/Containers/TreasureMapChest.cs
index 5ba7a8773..0efd15eb6 100644
--- a/Scripts/Items/Containers/TreasureMapChest.cs
+++ b/Scripts/Items/Containers/TreasureMapChest.cs
@@ -300,10 +300,8 @@ namespace Server.Items
LockPick( from );
return false;
}
- else
- {
- return base.CheckLocked( from );
- }
+
+ return base.CheckLocked( from );
}
private List- m_Lifted = new List
- ();
diff --git a/Scripts/Items/Deeds/NameChangeDeed.cs b/Scripts/Items/Deeds/NameChangeDeed.cs
index 0840b4822..52cfdb37a 100644
--- a/Scripts/Items/Deeds/NameChangeDeed.cs
+++ b/Scripts/Items/Deeds/NameChangeDeed.cs
@@ -105,7 +105,7 @@ namespace Server.Items
Mobile m = sender.Mobile;
TextRelay nameEntry = info.GetTextEntry( 0 );
- string newName = ( nameEntry == null ? null : nameEntry.Text.Trim() );
+ string newName = nameEntry?.Text.Trim();
if ( !NameVerification.Validate( newName, 2, 16, true, false, true, 1, NameVerification.SpaceDashPeriodQuote ) )
@@ -113,13 +113,11 @@ namespace Server.Items
m.SendMessage( "That name is unacceptable." );
return;
}
- else
- {
- m.RawName = newName;
- m.SendMessage( "Your name has been changed!" );
- m.SendMessage($"You are now known as {newName}");
- m_Sender.Delete();
- }
+
+ m.RawName = newName;
+ m.SendMessage( "Your name has been changed!" );
+ m.SendMessage($"You are now known as {newName}");
+ m_Sender.Delete();
}
}
}
\ No newline at end of file
diff --git a/Scripts/Items/Food/Beverage.cs b/Scripts/Items/Food/Beverage.cs
index 0a823a0c5..514245422 100644
--- a/Scripts/Items/Food/Beverage.cs
+++ b/Scripts/Items/Food/Beverage.cs
@@ -161,7 +161,7 @@ namespace Server.Items
{
if ( ItemID >= 0x995 && ItemID <= 0x999 )
return ItemID;
- else if ( ItemID == 0x9CA )
+ if ( ItemID == 0x9CA )
return ItemID;
return 0x995;
@@ -648,12 +648,11 @@ namespace Server.Items
if ( perc <= 0 )
return 1042975; // It's empty.
- else if ( perc <= 33 )
+ if ( perc <= 33 )
return 1042974; // It's nearly empty.
- else if ( perc <= 66 )
+ if ( perc <= 66 )
return 1042973; // It's half full.
- else
- return 1042972; // It's full.
+ return 1042972; // It's full.
}
public override void GetProperties( ObjectPropertyList list )
diff --git a/Scripts/Items/Games/BasePiece.cs b/Scripts/Items/Games/BasePiece.cs
index fdb141f2d..88c5a44c8 100644
--- a/Scripts/Items/Games/BasePiece.cs
+++ b/Scripts/Items/Games/BasePiece.cs
@@ -66,15 +66,13 @@ namespace Server.Items
Delete();
return false;
}
- else if ( !IsChildOf( m_Board ) )
+
+ if ( !IsChildOf( m_Board ) )
{
m_Board.DropItem( this );
return false;
}
- else
- {
- return true;
- }
+ return true;
}
public override bool CanTarget => false;
diff --git a/Scripts/Items/Games/Dices.cs b/Scripts/Items/Games/Dices.cs
index 68f66eda1..ca4c28ba3 100644
--- a/Scripts/Items/Games/Dices.cs
+++ b/Scripts/Items/Games/Dices.cs
@@ -33,7 +33,7 @@ namespace Server.Items
public void Roll( Mobile from )
{
PublicOverheadMessage( MessageType.Regular, 0, false,
- $"*{@from.Name} rolls {Utility.Random(1, 6)}, {Utility.Random(1, 6)}*");
+ $"*{from.Name} rolls {Utility.Random(1, 6)}, {Utility.Random(1, 6)}*");
}
public override void Serialize( GenericWriter writer )
@@ -48,4 +48,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
-}
\ No newline at end of file
+}
diff --git a/Scripts/Items/Games/Mahjong/MahjongDealerIndicator.cs b/Scripts/Items/Games/Mahjong/MahjongDealerIndicator.cs
index 850b651bd..04142363c 100644
--- a/Scripts/Items/Games/Mahjong/MahjongDealerIndicator.cs
+++ b/Scripts/Items/Games/Mahjong/MahjongDealerIndicator.cs
@@ -6,8 +6,7 @@ namespace Server.Engines.Mahjong
{
if ( direction == MahjongPieceDirection.Up || direction == MahjongPieceDirection.Down )
return new MahjongPieceDim( position, 40, 20 );
- else
- return new MahjongPieceDim( position, 20, 40 );
+ return new MahjongPieceDim( position, 20, 40 );
}
private MahjongGame m_Game;
diff --git a/Scripts/Items/Games/Mahjong/MahjongDices.cs b/Scripts/Items/Games/Mahjong/MahjongDices.cs
index 4955d85d6..5c8490981 100644
--- a/Scripts/Items/Games/Mahjong/MahjongDices.cs
+++ b/Scripts/Items/Games/Mahjong/MahjongDices.cs
@@ -25,7 +25,7 @@ namespace Server.Engines.Mahjong
m_Game.Players.SendGeneralPacket( true, true );
if ( from != null )
- m_Game.Players.SendLocalizedMessage( 1062695, $"{@from.Name}\t{m_First}\t{m_Second}"); // ~1_name~ rolls the dice and gets a ~2_number~ and a ~3_number~!
+ m_Game.Players.SendLocalizedMessage( 1062695, $"{from.Name}\t{m_First}\t{m_Second}"); // ~1_name~ rolls the dice and gets a ~2_number~ and a ~3_number~!
}
public void Save( GenericWriter writer )
diff --git a/Scripts/Items/Games/Mahjong/MahjongPacketHandlers.cs b/Scripts/Items/Games/Mahjong/MahjongPacketHandlers.cs
index 62e9b30f0..54abb72f2 100644
--- a/Scripts/Items/Games/Mahjong/MahjongPacketHandlers.cs
+++ b/Scripts/Items/Games/Mahjong/MahjongPacketHandlers.cs
@@ -19,10 +19,8 @@ namespace Server.Engines.Mahjong
{
return m_SubCommandDelegates[cmd];
}
- else
- {
- return null;
- }
+
+ return null;
}
public static void Initialize()
diff --git a/Scripts/Items/Games/Mahjong/MahjongPlayers.cs b/Scripts/Items/Games/Mahjong/MahjongPlayers.cs
index 84b002feb..2690018c0 100644
--- a/Scripts/Items/Games/Mahjong/MahjongPlayers.cs
+++ b/Scripts/Items/Games/Mahjong/MahjongPlayers.cs
@@ -35,8 +35,7 @@ namespace Server.Engines.Mahjong
{
if ( index < 0 || index >= m_Players.Length )
return null;
- else
- return m_Players[index];
+ return m_Players[index];
}
public int GetPlayerIndex( Mobile mobile )
@@ -53,16 +52,14 @@ namespace Server.Engines.Mahjong
{
if ( Dealer != mobile )
return false;
- else
- return m_InGame[m_DealerPosition];
+ return m_InGame[m_DealerPosition];
}
public bool IsInGamePlayer( int index )
{
if ( index < 0 || index >= m_Players.Length || m_Players[index] == null )
return false;
- else
- return m_InGame[index];
+ return m_InGame[index];
}
public bool IsInGamePlayer( Mobile mobile )
@@ -81,16 +78,14 @@ namespace Server.Engines.Mahjong
{
if ( index < 0 || index >= m_Scores.Length )
return 0;
- else
- return m_Scores[index];
+ return m_Scores[index];
}
public bool IsPublic( int index )
{
if ( index < 0 || index >= m_PublicHand.Length )
return false;
- else
- return m_PublicHand[index];
+ return m_PublicHand[index];
}
public void SetPublic( int index, bool value )
@@ -264,10 +259,8 @@ namespace Server.Engines.Mahjong
return true;
}
- else
- {
- return false;
- }
+
+ return false;
}
private void AddPlayer( Mobile player, int index, bool sendJoinGame )
@@ -378,7 +371,7 @@ namespace Server.Engines.Mahjong
to.Send( new MahjongPlayersInfo( m_Game, to ) );
}
- SendLocalizedMessage( 1062774, $"{@from.Name}\t{to.Name}\t{amount}"); // ~1_giver~ gives ~2_receiver~ ~3_number~ points.
+ SendLocalizedMessage( 1062774, $"{from.Name}\t{to.Name}\t{amount}"); // ~1_giver~ gives ~2_receiver~ ~3_number~ points.
}
public void OpenSeat( int index )
diff --git a/Scripts/Items/Games/Mahjong/MahjongTile.cs b/Scripts/Items/Games/Mahjong/MahjongTile.cs
index 35231debf..34179704b 100644
--- a/Scripts/Items/Games/Mahjong/MahjongTile.cs
+++ b/Scripts/Items/Games/Mahjong/MahjongTile.cs
@@ -6,8 +6,7 @@ namespace Server.Engines.Mahjong
{
if ( direction == MahjongPieceDirection.Up || direction == MahjongPieceDirection.Down )
return new MahjongPieceDim( position, 20, 30 );
- else
- return new MahjongPieceDim( position, 30, 20 );
+ return new MahjongPieceDim( position, 30, 20 );
}
private MahjongGame m_Game;
diff --git a/Scripts/Items/Guilds/Guildstone.cs b/Scripts/Items/Guilds/Guildstone.cs
index 6bc06bdfc..6a1418821 100644
--- a/Scripts/Items/Guilds/Guildstone.cs
+++ b/Scripts/Items/Guilds/Guildstone.cs
@@ -194,8 +194,8 @@ namespace Server.Items
PlayerState guildState = PlayerState.Find( m_Guild.Leader );
PlayerState targetState = PlayerState.Find( from );
- Faction guildFaction = (guildState == null ? null : guildState.Faction);
- Faction targetFaction = (targetState == null ? null : targetState.Faction);
+ Faction guildFaction = guildState?.Faction;
+ Faction targetFaction = targetState?.Faction;
if ( guildFaction != targetFaction || (targetState != null && targetState.IsLeaving) )
return;
diff --git a/Scripts/Items/Lights/BaseLight.cs b/Scripts/Items/Lights/BaseLight.cs
index a5d46e720..f5b9789f6 100644
--- a/Scripts/Items/Lights/BaseLight.cs
+++ b/Scripts/Items/Lights/BaseLight.cs
@@ -59,8 +59,8 @@ namespace Server.Items
{
return m_End - DateTime.UtcNow;
}
- else
- return m_Duration;
+
+ return m_Duration;
}
set => m_Duration = value;
diff --git a/Scripts/Items/Lights/RedHangingLantern.cs b/Scripts/Items/Lights/RedHangingLantern.cs
index b45531bb6..757977b5c 100644
--- a/Scripts/Items/Lights/RedHangingLantern.cs
+++ b/Scripts/Items/Lights/RedHangingLantern.cs
@@ -11,8 +11,7 @@ namespace Server.Items
{
if ( ItemID == 0x24C2 )
return 0x24C1;
- else
- return 0x24C3;
+ return 0x24C3;
}
}
@@ -22,8 +21,7 @@ namespace Server.Items
{
if ( ItemID == 0x24C1 )
return 0x24C2;
- else
- return 0x24C4;
+ return 0x24C4;
}
}
diff --git a/Scripts/Items/Lights/WallSconce.cs b/Scripts/Items/Lights/WallSconce.cs
index abc727b10..bbf5cf2e9 100644
--- a/Scripts/Items/Lights/WallSconce.cs
+++ b/Scripts/Items/Lights/WallSconce.cs
@@ -11,8 +11,7 @@ namespace Server.Items
{
if ( ItemID == 0x9FB )
return 0x9FD;
- else
- return 0xA02;
+ return 0xA02;
}
}
@@ -22,8 +21,7 @@ namespace Server.Items
{
if ( ItemID == 0x9FD )
return 0x9FB;
- else
- return 0xA00;
+ return 0xA00;
}
}
diff --git a/Scripts/Items/Lights/WallTorch.cs b/Scripts/Items/Lights/WallTorch.cs
index 720b1b916..e8016d136 100644
--- a/Scripts/Items/Lights/WallTorch.cs
+++ b/Scripts/Items/Lights/WallTorch.cs
@@ -11,8 +11,7 @@ namespace Server.Items
{
if ( ItemID == 0xA05 )
return 0xA07;
- else
- return 0xA0C;
+ return 0xA0C;
}
}
@@ -22,8 +21,7 @@ namespace Server.Items
{
if ( ItemID == 0xA07 )
return 0xA05;
- else
- return 0xA0A;
+ return 0xA0A;
}
}
diff --git a/Scripts/Items/Lights/WhiteHangingLantern.cs b/Scripts/Items/Lights/WhiteHangingLantern.cs
index 5938cd090..26dd8af82 100644
--- a/Scripts/Items/Lights/WhiteHangingLantern.cs
+++ b/Scripts/Items/Lights/WhiteHangingLantern.cs
@@ -11,8 +11,7 @@ namespace Server.Items
{
if ( ItemID == 0x24C6 )
return 0x24C5;
- else
- return 0x24C7;
+ return 0x24C7;
}
}
@@ -22,8 +21,7 @@ namespace Server.Items
{
if ( ItemID == 0x24C5 )
return 0x24C6;
- else
- return 0x24C8;
+ return 0x24C8;
}
}
diff --git a/Scripts/Items/Maps/MapItem.cs b/Scripts/Items/Maps/MapItem.cs
index b54ce5f4d..ecccf5b87 100644
--- a/Scripts/Items/Maps/MapItem.cs
+++ b/Scripts/Items/Maps/MapItem.cs
@@ -109,7 +109,7 @@ namespace Server.Items
{
if ( !ValidateEdit( from ) )
return;
- else if ( m_Pins.Count >= MaxUserPins )
+ if ( m_Pins.Count >= MaxUserPins )
return;
Validate( ref x, ref y );
@@ -137,7 +137,7 @@ namespace Server.Items
{
if ( !ValidateEdit( from ) )
return;
- else if ( m_Pins.Count >= MaxUserPins )
+ if ( m_Pins.Count >= MaxUserPins )
return;
Validate( ref x, ref y );
@@ -182,9 +182,9 @@ namespace Server.Items
{
if ( !from.CanSee( this ) || from.Map != Map || !from.Alive || InSecureTrade )
return false;
- else if ( from.AccessLevel >= AccessLevel.GameMaster )
+ if ( from.AccessLevel >= AccessLevel.GameMaster )
return true;
- else if ( !Movable || m_Protected || !from.InRange( GetWorldLocation(), 2 ) )
+ if ( !Movable || m_Protected || !from.InRange( GetWorldLocation(), 2 ) )
return false;
object root = RootParent;
diff --git a/Scripts/Items/Maps/TreasureMap.cs b/Scripts/Items/Maps/TreasureMap.cs
index a7004619f..f41e18399 100644
--- a/Scripts/Items/Maps/TreasureMap.cs
+++ b/Scripts/Items/Maps/TreasureMap.cs
@@ -802,13 +802,12 @@ namespace Server.Items
{
if ( m_Level == 6 )
return 1063453;
- else
- return 1041516 + m_Level;
+ return 1041516 + m_Level;
}
- else if ( m_Level == 6 )
+
+ if ( m_Level == 6 )
return 1063452;
- else
- return 1041510 + m_Level;
+ return 1041510 + m_Level;
}
}
diff --git a/Scripts/Items/Misc/ArcaneGem.cs b/Scripts/Items/Misc/ArcaneGem.cs
index a266c2216..2f9a6d2b0 100644
--- a/Scripts/Items/Misc/ArcaneGem.cs
+++ b/Scripts/Items/Misc/ArcaneGem.cs
@@ -37,7 +37,7 @@ namespace Server.Items
if ( v < 16 )
return 16;
- else if ( v > 24 )
+ if ( v > 24 )
return 24;
return v;
diff --git a/Scripts/Items/Misc/BulletinBoards.cs b/Scripts/Items/Misc/BulletinBoards.cs
index ce6683c78..ed0b03193 100644
--- a/Scripts/Items/Misc/BulletinBoards.cs
+++ b/Scripts/Items/Misc/BulletinBoards.cs
@@ -70,10 +70,9 @@ namespace Server.Items
if ( minutes != 0 && seconds != 0 )
return $"{minutes} minute{(minutes == 1 ? "" : "s")} and {seconds} second{(seconds == 1 ? "" : "s")}";
- else if ( minutes != 0 )
+ if ( minutes != 0 )
return $"{minutes} minute{(minutes == 1 ? "" : "s")}";
- else
- return $"{seconds} second{(seconds == 1 ? "" : "s")}";
+ return $"{seconds} second{(seconds == 1 ? "" : "s")}";
}
public virtual void Cleanup()
diff --git a/Scripts/Items/Misc/ClockworkAssembly.cs b/Scripts/Items/Misc/ClockworkAssembly.cs
index 45f8f95e8..5f560259d 100644
--- a/Scripts/Items/Misc/ClockworkAssembly.cs
+++ b/Scripts/Items/Misc/ClockworkAssembly.cs
@@ -33,7 +33,8 @@ namespace Server.Items
from.SendMessage( "You must have at least 60.0 skill in tinkering to construct a golem." );
return;
}
- else if ( (from.Followers + 4) > from.FollowersMax )
+
+ if ( (from.Followers + 4) > from.FollowersMax )
{
from.SendLocalizedMessage( 1049607 ); // You have too many followers to control that creature.
return;
@@ -126,4 +127,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
-}
\ No newline at end of file
+}
diff --git a/Scripts/Items/Misc/CommunicationCrystals.cs b/Scripts/Items/Misc/CommunicationCrystals.cs
index 267b941c4..2cce3ff0f 100644
--- a/Scripts/Items/Misc/CommunicationCrystals.cs
+++ b/Scripts/Items/Misc/CommunicationCrystals.cs
@@ -358,7 +358,7 @@ namespace Server.Items
if ( !Active )
return;
- string text = $"{@from.Name} says {message}";
+ string text = $"{from.Name} says {message}";
if ( RootParent is Mobile mobile )
{
diff --git a/Scripts/Items/Misc/Corpses/Corpse.cs b/Scripts/Items/Misc/Corpses/Corpse.cs
index 19786c5ac..fa5bcf971 100644
--- a/Scripts/Items/Misc/Corpses/Corpse.cs
+++ b/Scripts/Items/Misc/Corpses/Corpse.cs
@@ -601,7 +601,7 @@ namespace Server.Items
writer.WriteDeltaTime( m_TimeOfDeath );
List> list = ( m_RestoreTable == null ? null : new List>( m_RestoreTable ) );
- int count = ( list == null ? 0 : list.Count );
+ int count = list?.Count ?? 0;
writer.Write( count );
@@ -971,7 +971,8 @@ namespace Server.Items
return false;
}
- else if ( IsCriminalAction( from ) )
+
+ if ( IsCriminalAction( from ) )
{
if ( m_Owner == null || !m_Owner.Player )
from.SendLocalizedMessage( 1005036 ); // Looting this monster corpse will be a criminal act!
diff --git a/Scripts/Items/Misc/DeceitBrazier.cs b/Scripts/Items/Misc/DeceitBrazier.cs
index 05ceac121..5ffa2397e 100644
--- a/Scripts/Items/Misc/DeceitBrazier.cs
+++ b/Scripts/Items/Misc/DeceitBrazier.cs
@@ -163,7 +163,7 @@ namespace Server.Items
if ( Map.CanSpawnMobile( new Point2D( x, y ), Z ) )
return new Point3D( x, y, Z );
- else if ( Map.CanSpawnMobile( new Point2D( x, y ), z ) )
+ if ( Map.CanSpawnMobile( new Point2D( x, y ), z ) )
return new Point3D( x, y, z );
}
diff --git a/Scripts/Items/Misc/Gold.cs b/Scripts/Items/Misc/Gold.cs
index 80305ff78..b444da9cb 100644
--- a/Scripts/Items/Misc/Gold.cs
+++ b/Scripts/Items/Misc/Gold.cs
@@ -33,10 +33,9 @@ namespace Server.Items
{
if ( Amount <= 1 )
return 0x2E4;
- else if ( Amount <= 5 )
+ if ( Amount <= 5 )
return 0x2E5;
- else
- return 0x2E6;
+ return 0x2E6;
}
protected override void OnAmountChange( int oldValue )
diff --git a/Scripts/Items/Misc/Moonstone.cs b/Scripts/Items/Misc/Moonstone.cs
index d4bafa54a..8e10a8ad8 100644
--- a/Scripts/Items/Misc/Moonstone.cs
+++ b/Scripts/Items/Misc/Moonstone.cs
@@ -147,7 +147,8 @@ namespace Server.Items
Stop();
return;
}
- else if ( !m_TargetMap.CanFit( m_Location, 16 ) )
+
+ if ( !m_TargetMap.CanFit( m_Location, 16 ) )
{
m_Stone.Movable = true;
m_Caster.AddToBackpack( m_Stone );
diff --git a/Scripts/Items/Misc/PlayerBulletinBoards.cs b/Scripts/Items/Misc/PlayerBulletinBoards.cs
index 230e88fdc..f65abea3c 100644
--- a/Scripts/Items/Misc/PlayerBulletinBoards.cs
+++ b/Scripts/Items/Misc/PlayerBulletinBoards.cs
@@ -224,17 +224,18 @@ namespace Server.Items
from.SendLocalizedMessage( 1062396 ); // This bulletin board must be locked down in a house to be usable.
return;
}
- else if ( !from.InRange( board.GetWorldLocation(), 2 ) || !from.InLOS( board ) )
+
+ if ( !from.InRange( board.GetWorldLocation(), 2 ) || !from.InLOS( board ) )
{
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
return;
}
- else if ( !CheckAccess( house, from ) )
+ if ( !CheckAccess( house, from ) )
{
from.SendLocalizedMessage( 1062398 ); // You are not allowed to post to this bulletin board.
return;
}
- else if ( m_Greeting && !house.IsOwner( from ) )
+ if ( m_Greeting && !house.IsOwner( from ) )
{
return;
}
@@ -299,12 +300,13 @@ namespace Server.Items
from.SendLocalizedMessage( 1062396 ); // This bulletin board must be locked down in a house to be usable.
return;
}
- else if ( !from.InRange( board.GetWorldLocation(), 2 ) || !from.InLOS( board ) )
+
+ if ( !from.InRange( board.GetWorldLocation(), 2 ) || !from.InLOS( board ) )
{
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
return;
}
- else if ( !CheckAccess( house, from ) )
+ if ( !CheckAccess( house, from ) )
{
from.SendLocalizedMessage( 1062398 ); // You are not allowed to post to this bulletin board.
return;
@@ -405,12 +407,13 @@ namespace Server.Items
from.SendLocalizedMessage( 1062396 ); // This bulletin board must be locked down in a house to be usable.
return;
}
- else if ( !from.InRange( board.GetWorldLocation(), 2 ) || !from.InLOS( board ) )
+
+ if ( !from.InRange( board.GetWorldLocation(), 2 ) || !from.InLOS( board ) )
{
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
return;
}
- else if ( !BasePlayerBB.CheckAccess( house, from ) )
+ if ( !BasePlayerBB.CheckAccess( house, from ) )
{
from.SendLocalizedMessage( 1062398 ); // You are not allowed to post to this bulletin board.
return;
@@ -604,7 +607,7 @@ namespace Server.Items
AddHtml( 255, 180, 150, 20, message.Time.ToString( "yyyy-MM-dd HH:mm:ss" ), false, false );
Mobile poster = message.Poster;
- string name = ( poster == null ? null : poster.Name );
+ string name = poster?.Name;
if ( name == null || (name = name.Trim()).Length == 0 )
name = "Someone";
diff --git a/Scripts/Items/Misc/PublicMoongate.cs b/Scripts/Items/Misc/PublicMoongate.cs
index 6d38fc225..dffe0aa59 100644
--- a/Scripts/Items/Misc/PublicMoongate.cs
+++ b/Scripts/Items/Misc/PublicMoongate.cs
@@ -61,26 +61,24 @@ namespace Server.Items
m.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
return false;
}
- else if ( SpellHelper.CheckCombat( m ) )
+
+ if ( SpellHelper.CheckCombat( m ) )
{
m.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
return false;
}
- else if ( m.Spell != null )
+ if ( m.Spell != null )
{
m.SendLocalizedMessage( 1049616 ); // You are too busy to do that at the moment.
return false;
}
- else
- {
- m.CloseGump( typeof( MoongateGump ) );
- m.SendGump( new MoongateGump( m, this ) );
+ m.CloseGump( typeof( MoongateGump ) );
+ m.SendGump( new MoongateGump( m, this ) );
- if ( !m.Hidden || m.AccessLevel == AccessLevel.Player )
- Effects.PlaySound( m.Location, m.Map, 0x20E );
+ if ( !m.Hidden || m.AccessLevel == AccessLevel.Player )
+ Effects.PlaySound( m.Location, m.Map, 0x20E );
- return true;
- }
+ return true;
}
public override void Serialize( GenericWriter writer )
@@ -366,7 +364,7 @@ namespace Server.Items
{
if ( info.ButtonID == 0 ) // Cancel
return;
- else if ( m_Mobile.Deleted || m_Moongate.Deleted || m_Mobile.Map == null )
+ if ( m_Mobile.Deleted || m_Moongate.Deleted || m_Mobile.Map == null )
return;
int[] switches = info.Switches;
diff --git a/Scripts/Items/Misc/Teleporter.cs b/Scripts/Items/Misc/Teleporter.cs
index a4e9ca53d..c5c3cdf2e 100644
--- a/Scripts/Items/Misc/Teleporter.cs
+++ b/Scripts/Items/Misc/Teleporter.cs
@@ -160,12 +160,13 @@ namespace Server.Items
{
return false;
}
- else if (m_CriminalCheck && m.Criminal)
+
+ if (m_CriminalCheck && m.Criminal)
{
m.SendLocalizedMessage(1005561, "", 0x22); // Thou'rt a criminal and cannot escape so easily.
return false;
}
- else if (m_CombatCheck && SpellHelper.CheckCombat(m))
+ if (m_CombatCheck && SpellHelper.CheckCombat(m))
{
m.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle??
return false;
@@ -617,7 +618,8 @@ namespace Server.Items
int h = (int)Math.Round(ts.TotalHours);
return $"{h} hour{((h == 1) ? "" : "s")}";
}
- else if (ts.TotalMinutes >= 1)
+
+ if (ts.TotalMinutes >= 1)
{
int m = (int)Math.Round(ts.TotalMinutes);
return $"{m} minute{((m == 1) ? "" : "s")}";
@@ -653,10 +655,8 @@ namespace Server.Items
return;
}
- else
- {
- info.Timer.Stop();
- }
+
+ info.Timer.Stop();
}
if (m_StartMessage != null)
diff --git a/Scripts/Items/Quivers/BaseQuiver.cs b/Scripts/Items/Quivers/BaseQuiver.cs
index 5b09672a0..04ebce8f3 100644
--- a/Scripts/Items/Quivers/BaseQuiver.cs
+++ b/Scripts/Items/Quivers/BaseQuiver.cs
@@ -157,7 +157,8 @@ namespace Server.Items
return false;
}
- else if ( checkItems )
+
+ if ( checkItems )
return false;
Item ammo = Ammo;
diff --git a/Scripts/Items/Resources/Blacksmithing/Ore.cs b/Scripts/Items/Resources/Blacksmithing/Ore.cs
index 8ffc07387..6065d3070 100644
--- a/Scripts/Items/Resources/Blacksmithing/Ore.cs
+++ b/Scripts/Items/Resources/Blacksmithing/Ore.cs
@@ -69,12 +69,11 @@ namespace Server.Items
if ( rand < 0.12 )
return 0x19B7;
- else if ( rand < 0.18 )
+ if ( rand < 0.18 )
return 0x19B8;
- else if ( rand < 0.25 )
+ if ( rand < 0.25 )
return 0x19BA;
- else
- return 0x19B9;
+ return 0x19B9;
}
public BaseOre( CraftResource resource ) : this( resource, 1 )
diff --git a/Scripts/Items/Shields/BaseShield.cs b/Scripts/Items/Shields/BaseShield.cs
index 31189a24b..ba7d7168c 100644
--- a/Scripts/Items/Shields/BaseShield.cs
+++ b/Scripts/Items/Shields/BaseShield.cs
@@ -50,8 +50,7 @@ namespace Server.Items
if ( m != null )
return ( ( m.Skills[SkillName.Parry].Value * ar ) / 200.0 ) + 1.0;
- else
- return ar;
+ return ar;
}
}
diff --git a/Scripts/Items/Skill Items/Carpenter Items/TaxidermyKit.cs b/Scripts/Items/Skill Items/Carpenter Items/TaxidermyKit.cs
index e3530cc3e..cea98a5bc 100644
--- a/Scripts/Items/Skill Items/Carpenter Items/TaxidermyKit.cs
+++ b/Scripts/Items/Skill Items/Carpenter Items/TaxidermyKit.cs
@@ -251,8 +251,7 @@ namespace Server.Items
if ( ItemID == m_NorthID )
return BaseAddon.IsWall( p.X, p.Y - 1, p.Z, map ); // North wall
- else
- return BaseAddon.IsWall( p.X - 1, p.Y, p.Z, map ); // West wall
+ return BaseAddon.IsWall( p.X - 1, p.Y, p.Z, map ); // West wall
}
public override void Serialize( GenericWriter writer )
diff --git a/Scripts/Items/Skill Items/Harvest Tools/ProspectorsTool.cs b/Scripts/Items/Skill Items/Harvest Tools/ProspectorsTool.cs
index 4be358b32..5b2c4b4c3 100644
--- a/Scripts/Items/Skill Items/Harvest Tools/ProspectorsTool.cs
+++ b/Scripts/Items/Skill Items/Harvest Tools/ProspectorsTool.cs
@@ -95,7 +95,8 @@ namespace Server.Items
from.SendLocalizedMessage( 1049048 ); // You cannot use your prospector tool on that.
return;
}
- else if ( vein != defaultVein )
+
+ if ( vein != defaultVein )
{
from.SendLocalizedMessage( 1049049 ); // That ore looks to be prospected already.
return;
diff --git a/Scripts/Items/Skill Items/Lumberjack/Log.cs b/Scripts/Items/Skill Items/Lumberjack/Log.cs
index 33072ac4a..b05ccd273 100644
--- a/Scripts/Items/Skill Items/Lumberjack/Log.cs
+++ b/Scripts/Items/Skill Items/Lumberjack/Log.cs
@@ -90,10 +90,10 @@ namespace Server.Items
public virtual bool TryCreateBoards( Mobile from, double skill, Item item )
{
- if ( Deleted || !from.CanSee( this ) )
+ if ( Deleted || !from.CanSee( this ) )
return false;
- else if ( from.Skills.Carpentry.Value < skill &&
- from.Skills.Lumberjacking.Value < skill )
+ if ( from.Skills.Carpentry.Value < skill &&
+ from.Skills.Lumberjacking.Value < skill )
{
item.Delete();
from.SendLocalizedMessage( 1072652 ); // You cannot work this strange and unusual wood.
@@ -107,7 +107,7 @@ namespace Server.Items
{
if ( !TryCreateBoards( from , 0, new Board() ) )
return false;
-
+
return true;
}
}
@@ -118,7 +118,7 @@ namespace Server.Items
{
}
[Constructible]
- public HeartwoodLog( int amount )
+ public HeartwoodLog( int amount )
: base( CraftResource.Heartwood, amount )
{
}
@@ -352,4 +352,4 @@ namespace Server.Items
return true;
}
}
-}
\ No newline at end of file
+}
diff --git a/Scripts/Items/Skill Items/Magical/Misc/Moongate.cs b/Scripts/Items/Skill Items/Magical/Misc/Moongate.cs
index d42456ff8..6e76629f8 100644
--- a/Scripts/Items/Skill Items/Magical/Misc/Moongate.cs
+++ b/Scripts/Items/Skill Items/Magical/Misc/Moongate.cs
@@ -98,7 +98,7 @@ namespace Server.Items
public virtual void UseGate( Mobile m )
{
- ClientFlags flags = m.NetState == null ? ClientFlags.None : m.NetState.Flags;
+ ClientFlags flags = m.NetState?.Flags ?? ClientFlags.None;
if ( Factions.Sigil.ExistsOn( m ) )
{
diff --git a/Scripts/Items/Skill Items/Magical/Misc/PotionKeg.cs b/Scripts/Items/Skill Items/Magical/Misc/PotionKeg.cs
index f9a824a7d..c11ee8b08 100644
--- a/Scripts/Items/Skill Items/Magical/Misc/PotionKeg.cs
+++ b/Scripts/Items/Skill Items/Magical/Misc/PotionKeg.cs
@@ -191,10 +191,6 @@ namespace Server.Items
pot.Delete();
}
}
- else
- {
- // TODO: Target a bottle
- }
}
else
{
diff --git a/Scripts/Items/Skill Items/Magical/Potions/Conflagration Potions/BaseConflagrationPotion.cs b/Scripts/Items/Skill Items/Magical/Potions/Conflagration Potions/BaseConflagrationPotion.cs
index 5ecaea6c8..b85c93658 100644
--- a/Scripts/Items/Skill Items/Magical/Potions/Conflagration Potions/BaseConflagrationPotion.cs
+++ b/Scripts/Items/Skill Items/Magical/Potions/Conflagration Potions/BaseConflagrationPotion.cs
@@ -315,7 +315,7 @@ namespace Server.Items
if ( (m.Z + 16) > m_Item.Z && (m_Item.Z + 12) > m.Z && (!Core.AOS || m != from) && SpellHelper.ValidIndirectTarget( from, m ) && from.CanBeHarmful( m, false ) )
{
- @from?.DoHarmful( m );
+ from?.DoHarmful( m );
AOS.Damage( m, from, m_Item.GetDamage(), 0, 100, 0, 0, 0 );
m.PlaySound( 0x208 );
diff --git a/Scripts/Items/Skill Items/Magical/Spellbook.cs b/Scripts/Items/Skill Items/Magical/Spellbook.cs
index 37e093e02..c7998a754 100644
--- a/Scripts/Items/Skill Items/Magical/Spellbook.cs
+++ b/Scripts/Items/Skill Items/Magical/Spellbook.cs
@@ -104,7 +104,7 @@ namespace Server.Items
Spellbook book = Find( from, -1, type );
- book?.DisplayTo( @from );
+ book?.DisplayTo( from );
}
private static void EventSink_CastSpellRequest( CastSpellRequestEventArgs e )
@@ -150,17 +150,17 @@ namespace Server.Items
{
if ( spellID >= 0 && spellID < 64 )
return SpellbookType.Regular;
- else if ( spellID >= 100 && spellID < 117 )
+ if ( spellID >= 100 && spellID < 117 )
return SpellbookType.Necromancer;
- else if ( spellID >= 200 && spellID < 210 )
+ if ( spellID >= 200 && spellID < 210 )
return SpellbookType.Paladin;
- else if ( spellID >= 400 && spellID < 406 )
+ if ( spellID >= 400 && spellID < 406 )
return SpellbookType.Samurai;
- else if ( spellID >= 500 && spellID < 508 )
+ if ( spellID >= 500 && spellID < 508 )
return SpellbookType.Ninja;
- else if ( spellID >= 600 && spellID < 617 )
+ if ( spellID >= 600 && spellID < 617 )
return SpellbookType.Arcanist;
- else if ( spellID >= 677 && spellID < 693 )
+ if ( spellID >= 677 && spellID < 693 )
return SpellbookType.Mystic;
return SpellbookType.Invalid;
@@ -333,7 +333,8 @@ namespace Server.Items
{
return false;
}
- else if ( !from.CanBeginAction( typeof( BaseWeapon ) ) )
+
+ if ( !from.CanBeginAction( typeof( BaseWeapon ) ) )
{
return false;
}
diff --git a/Scripts/Items/Skill Items/Misc/Bandage.cs b/Scripts/Items/Skill Items/Misc/Bandage.cs
index 65ba5262c..b3607ccb8 100644
--- a/Scripts/Items/Skill Items/Misc/Bandage.cs
+++ b/Scripts/Items/Skill Items/Misc/Bandage.cs
@@ -205,16 +205,14 @@ namespace Server.Items
{
if ( !m.Player && (m.Body.IsMonster || m.Body.IsAnimal) )
return SkillName.Veterinary;
- else
- return SkillName.Healing;
+ return SkillName.Healing;
}
public static SkillName GetSecondarySkill( Mobile m )
{
if ( !m.Player && (m.Body.IsMonster || m.Body.IsAnimal) )
return SkillName.AnimalLore;
- else
- return SkillName.Anatomy;
+ return SkillName.Anatomy;
}
public void EndHeal()
diff --git a/Scripts/Items/Skill Items/Misc/RepairDeed.cs b/Scripts/Items/Skill Items/Misc/RepairDeed.cs
index 6e7b021b1..0bb8ff965 100644
--- a/Scripts/Items/Skill Items/Misc/RepairDeed.cs
+++ b/Scripts/Items/Skill Items/Misc/RepairDeed.cs
@@ -158,7 +158,7 @@ namespace Server.Items
if ( skill >= 11 )
return (1062008 + skill-11);
- else if ( skill >=5 )
+ if ( skill >=5 )
return (1061123 + skill-5);
switch( skill )
diff --git a/Scripts/Items/Skill Items/Musical Instruments/BaseInstrument.cs b/Scripts/Items/Skill Items/Musical Instruments/BaseInstrument.cs
index b91d18cd8..6a98c0372 100644
--- a/Scripts/Items/Skill Items/Musical Instruments/BaseInstrument.cs
+++ b/Scripts/Items/Skill Items/Musical Instruments/BaseInstrument.cs
@@ -153,7 +153,7 @@ namespace Server.Items
}
else
{
- @from?.SendLocalizedMessage( 502079 ); // The instrument played its last tune.
+ from?.SendLocalizedMessage( 502079 ); // The instrument played its last tune.
Delete();
}
@@ -186,7 +186,7 @@ namespace Server.Items
if ( instrument != null )
{
- callback?.Invoke( @from, instrument );
+ callback?.Invoke( from, instrument );
}
else
{
diff --git a/Scripts/Items/Skill Items/Ninjitsu/NinjaWeapons.cs b/Scripts/Items/Skill Items/Ninjitsu/NinjaWeapons.cs
index f2261f46c..277a4096a 100644
--- a/Scripts/Items/Skill Items/Ninjitsu/NinjaWeapons.cs
+++ b/Scripts/Items/Skill Items/Ninjitsu/NinjaWeapons.cs
@@ -179,10 +179,8 @@ namespace Server.Items
{
return true;
}
- else
- {
- from.SendLocalizedMessage(weapon.NoFreeHandMessage);
- }
+
+ from.SendLocalizedMessage(weapon.NoFreeHandMessage);
}
else
{
diff --git a/Scripts/Items/Special/8th Anniversary Items/FountainOfLife.cs b/Scripts/Items/Special/8th Anniversary Items/FountainOfLife.cs
index ea2e1eaca..4f923423c 100644
--- a/Scripts/Items/Special/8th Anniversary Items/FountainOfLife.cs
+++ b/Scripts/Items/Special/8th Anniversary Items/FountainOfLife.cs
@@ -112,11 +112,9 @@ namespace Server.Items
return allow;
}
- else
- {
- from.SendLocalizedMessage( 1075209 ); // Only bandages may be dropped into the fountain.
- return false;
- }
+
+ from.SendLocalizedMessage( 1075209 ); // Only bandages may be dropped into the fountain.
+ return false;
}
public override bool OnDragDropInto( Mobile from, Item item, Point3D p )
@@ -130,11 +128,9 @@ namespace Server.Items
return allow;
}
- else
- {
- from.SendLocalizedMessage( 1075209 ); // Only bandages may be dropped into the fountain.
- return false;
- }
+
+ from.SendLocalizedMessage( 1075209 ); // Only bandages may be dropped into the fountain.
+ return false;
}
public override void AddNameProperties( ObjectPropertyList list )
diff --git a/Scripts/Items/Special/Holiday/Wreath.cs b/Scripts/Items/Special/Holiday/Wreath.cs
index 9c0f72d33..09f19eafb 100644
--- a/Scripts/Items/Special/Holiday/Wreath.cs
+++ b/Scripts/Items/Special/Holiday/Wreath.cs
@@ -31,8 +31,7 @@ namespace Server.Items
if ( ItemID == 0x232C )
return BaseAddon.IsWall( p.X, p.Y - 1, p.Z, map ); // North wall
- else
- return BaseAddon.IsWall( p.X - 1, p.Y, p.Z, map ); // West wall
+ return BaseAddon.IsWall( p.X - 1, p.Y, p.Z, map ); // West wall
}
public override void Serialize( GenericWriter writer )
@@ -108,16 +107,12 @@ namespace Server.Items
Hue = sender.DyedHue;
return true;
}
- else
- {
- from.SendLocalizedMessage( 500295 ); // You are too far away to do that.
- return false;
- }
- }
- else
- {
+
+ from.SendLocalizedMessage( 500295 ); // You are too far away to do that.
return false;
}
+
+ return false;
}
private class WreathAddonGump : Gump
diff --git a/Scripts/Items/Special/House Raffle/HouseRaffleDeed.cs b/Scripts/Items/Special/House Raffle/HouseRaffleDeed.cs
index 0adeeb733..6edbbf195 100644
--- a/Scripts/Items/Special/House Raffle/HouseRaffleDeed.cs
+++ b/Scripts/Items/Special/House Raffle/HouseRaffleDeed.cs
@@ -188,18 +188,16 @@ namespace Server.Items
"This deed functions as a recall rune marked for the location of the plot it represents." +
"";
}
- else
- {
- int daysLeft = (int)Math.Ceiling( ( deed.Stone.Started + deed.Stone.Duration + HouseRaffleStone.ExpirationTime - DateTime.UtcNow ).TotalDays );
- return "" + "This deed entitles the bearer to build a house on the plot of land " +
- $"located at {HouseRaffleStone.FormatLocation(deed.PlotLocation, deed.PlotFacet, false)} on the {deed.PlotFacet} facet.
" +
- $"The deed will expire after {daysLeft} more day{((daysLeft == 1) ? "" : "s")} have passed, and at that time the right to place " +
- "a house reverts to normal house construction rules.
" +
- "This deed functions as a recall rune marked for the location of the plot it represents.
" +
- "To place a house on the deeded plot, you must simply have this deed in your backpack " +
- "or bank box when using a House Placement Tool there." + "";
- }
+ int daysLeft = (int)Math.Ceiling( ( deed.Stone.Started + deed.Stone.Duration + HouseRaffleStone.ExpirationTime - DateTime.UtcNow ).TotalDays );
+
+ return "" + "This deed entitles the bearer to build a house on the plot of land " +
+ $"located at {HouseRaffleStone.FormatLocation(deed.PlotLocation, deed.PlotFacet, false)} on the {deed.PlotFacet} facet.
" +
+ $"The deed will expire after {daysLeft} more day{((daysLeft == 1) ? "" : "s")} have passed, and at that time the right to place " +
+ "a house reverts to normal house construction rules.
" +
+ "This deed functions as a recall rune marked for the location of the plot it represents.
" +
+ "To place a house on the deeded plot, you must simply have this deed in your backpack " +
+ "or bank box when using a House Placement Tool there." + "";
}
}
}
diff --git a/Scripts/Items/Special/House Raffle/HouseRaffleManagementGump.cs b/Scripts/Items/Special/House Raffle/HouseRaffleManagementGump.cs
index 6edd1f6e7..a3e3468f1 100644
--- a/Scripts/Items/Special/House Raffle/HouseRaffleManagementGump.cs
+++ b/Scripts/Items/Special/House Raffle/HouseRaffleManagementGump.cs
@@ -241,17 +241,16 @@ namespace Server.Gumps
if ( xIsNull && yIsNull )
return 0;
- else if ( xIsNull )
+ if ( xIsNull )
return -1;
- else if ( yIsNull )
+ if ( yIsNull )
return 1;
int result = Insensitive.Compare( x.From.Name, y.From.Name );
if ( result == 0 )
return x.Date.CompareTo( y.Date );
- else
- return result;
+ return result;
}
}
@@ -270,9 +269,9 @@ namespace Server.Gumps
if ( xIsNull && yIsNull )
return 0;
- else if ( xIsNull )
+ if ( xIsNull )
return -1;
- else if ( yIsNull )
+ if ( yIsNull )
return 1;
Account a = x.From.Account as Account;
@@ -280,17 +279,16 @@ namespace Server.Gumps
if ( a == null && b == null )
return 0;
- else if ( a == null )
+ if ( a == null )
return -1;
- else if ( b == null )
+ if ( b == null )
return 1;
int result = Insensitive.Compare( a.Username, b.Username );
if ( result == 0 )
return x.Date.CompareTo( y.Date );
- else
- return result;
+ return result;
}
}
@@ -309,9 +307,9 @@ namespace Server.Gumps
if ( xIsNull && yIsNull )
return 0;
- else if ( xIsNull )
+ if ( xIsNull )
return -1;
- else if ( yIsNull )
+ if ( yIsNull )
return 1;
byte[] a = x.Address.GetAddressBytes();
diff --git a/Scripts/Items/Special/House Raffle/HouseRaffleStone.cs b/Scripts/Items/Special/House Raffle/HouseRaffleStone.cs
index 8079f6022..846796192 100644
--- a/Scripts/Items/Special/House Raffle/HouseRaffleStone.cs
+++ b/Scripts/Items/Special/House Raffle/HouseRaffleStone.cs
@@ -362,7 +362,7 @@ namespace Server.Items
{
int x = m_Bounds.X + m_Bounds.Width / 2;
int y = m_Bounds.Y + m_Bounds.Height / 2;
- int z = ( m_Facet == null ) ? 0 : m_Facet.GetAverageZ( x, y );
+ int z = m_Facet?.GetAverageZ( x, y ) ?? 0;
return new Point3D( x, y, z );
}
@@ -379,8 +379,7 @@ namespace Server.Items
{
if ( m_TicketPrice == 0 )
return "FREE";
- else
- return $"{m_TicketPrice} gold";
+ return $"{m_TicketPrice} gold";
}
public override void GetProperties( ObjectPropertyList list )
diff --git a/Scripts/Items/Special/Mutation Core/PlagueBeastBlood.cs b/Scripts/Items/Special/Mutation Core/PlagueBeastBlood.cs
index d8a741045..f5f617da0 100644
--- a/Scripts/Items/Special/Mutation Core/PlagueBeastBlood.cs
+++ b/Scripts/Items/Special/Mutation Core/PlagueBeastBlood.cs
@@ -54,7 +54,7 @@ namespace Server.Items
for ( int i = 0; i < pack.Items.Count; i++ )
{
if ( pack.Items[ i ] is PlagueBeastMainOrgan main && main.Complete )
- main.FinishOpening( @from );
+ main.FinishOpening( from );
}
}
diff --git a/Scripts/Items/Special/Mutation Core/PlagueBeastOrgans.cs b/Scripts/Items/Special/Mutation Core/PlagueBeastOrgans.cs
index 5efdae9b0..bfb2b5292 100644
--- a/Scripts/Items/Special/Mutation Core/PlagueBeastOrgans.cs
+++ b/Scripts/Items/Special/Mutation Core/PlagueBeastOrgans.cs
@@ -71,8 +71,8 @@ namespace Server.Items
scissors.PublicOverheadMessage( MessageType.Regular, 0x3B2, 1071897 ); // You carefully cut into the organ.
return true;
}
- else
- scissors.PublicOverheadMessage( MessageType.Regular, 0x3B2, 1071898 ); // You have already cut this organ open.
+
+ scissors.PublicOverheadMessage( MessageType.Regular, 0x3B2, 1071898 ); // You have already cut this organ open.
}
return false;
@@ -378,7 +378,8 @@ namespace Server.Items
AddComponent( new PlagueBeastBlood(), 47, 72 );
return true;
}
- else if ( c.IsGland )
+
+ if ( c.IsGland )
{
m_Gland = null;
return true;
diff --git a/Scripts/Items/Special/Mutation Core/PlagueBeastVein.cs b/Scripts/Items/Special/Mutation Core/PlagueBeastVein.cs
index 860e087b6..4d3bd5c69 100644
--- a/Scripts/Items/Special/Mutation Core/PlagueBeastVein.cs
+++ b/Scripts/Items/Special/Mutation Core/PlagueBeastVein.cs
@@ -26,8 +26,8 @@ namespace Server.Items
scissors.PublicOverheadMessage( MessageType.Regular, 0x3B2, 1071899 ); // You begin cutting through the vein.
return true;
}
- else
- scissors.PublicOverheadMessage( MessageType.Regular, 0x3B2, 1071900 ); // // This vein has already been cut.
+
+ scissors.PublicOverheadMessage( MessageType.Regular, 0x3B2, 1071900 ); // // This vein has already been cut.
}
return false;
diff --git a/Scripts/Items/Special/Solen Items/BraceletOfBinding.cs b/Scripts/Items/Special/Solen Items/BraceletOfBinding.cs
index f304bfafd..a174ce1fb 100644
--- a/Scripts/Items/Special/Solen Items/BraceletOfBinding.cs
+++ b/Scripts/Items/Special/Solen Items/BraceletOfBinding.cs
@@ -247,76 +247,74 @@ namespace Server.Items
from.SendLocalizedMessage( 1054005 ); // The bracelet glows black. It must be charged before it can be used again.
return false;
}
- else if ( from.FindItemOnLayer( Layer.Bracelet ) != this )
+
+ if ( from.FindItemOnLayer( Layer.Bracelet ) != this )
{
from.SendLocalizedMessage( 1054004 ); // You must equip the bracelet in order to use its power.
return false;
}
- else if ( boundRoot?.NetState == null || boundRoot.FindItemOnLayer( Layer.Bracelet ) != bound )
+ if ( boundRoot?.NetState == null || boundRoot.FindItemOnLayer( Layer.Bracelet ) != bound )
{
from.SendLocalizedMessage( 1054006 ); // The bracelet emits a red glow. The bracelet's twin is not available for transport.
return false;
}
- else if ( !Core.AOS && from.Map != boundRoot.Map )
+ if ( !Core.AOS && from.Map != boundRoot.Map )
{
from.SendLocalizedMessage( 1054014 ); // The bracelet glows black. The bracelet's target is on another facet.
return false;
}
- else if ( Factions.Sigil.ExistsOn( from ) )
+ if ( Factions.Sigil.ExistsOn( from ) )
{
from.SendLocalizedMessage( 1061632 ); // You can't do that while carrying the sigil.
return false;
}
- else if ( !SpellHelper.CheckTravel( from, TravelCheckType.RecallFrom ) )
+ if ( !SpellHelper.CheckTravel( from, TravelCheckType.RecallFrom ) )
{
return false;
}
- else if ( !SpellHelper.CheckTravel( from, boundRoot.Map, boundRoot.Location, TravelCheckType.RecallTo ) )
+ if ( !SpellHelper.CheckTravel( from, boundRoot.Map, boundRoot.Location, TravelCheckType.RecallTo ) )
{
return false;
}
- else if ( boundRoot.Map == Map.Felucca && from is PlayerMobile mobile && mobile.Young )
+ if ( boundRoot.Map == Map.Felucca && from is PlayerMobile mobile && mobile.Young )
{
mobile.SendLocalizedMessage( 1049543 ); // You decide against traveling to Felucca while you are still young.
return false;
}
- else if ( from.Kills >= 5 && boundRoot.Map != Map.Felucca )
+ if ( from.Kills >= 5 && boundRoot.Map != Map.Felucca )
{
from.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
return false;
}
- else if ( from.Criminal )
+ if ( from.Criminal )
{
from.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
return false;
}
- else if ( SpellHelper.CheckCombat( from ) )
+ if ( SpellHelper.CheckCombat( from ) )
{
from.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
return false;
}
- else if ( Misc.WeightOverloading.IsOverloaded( from ) )
+ if ( Misc.WeightOverloading.IsOverloaded( from ) )
{
from.SendLocalizedMessage( 502359, "", 0x22 ); // Thou art too encumbered to move.
return false;
}
- else if ( from.Region.IsPartOf( typeof( Regions.Jail ) ) )
+ if ( from.Region.IsPartOf( typeof( Regions.Jail ) ) )
{
from.SendLocalizedMessage( 1114345, "", 0x35 ); // You'll need a better jailbreak plan than that!
return false;
}
- else if ( boundRoot.Region.IsPartOf( typeof( Regions.Jail ) ) )
+ if ( boundRoot.Region.IsPartOf( typeof( Regions.Jail ) ) )
{
from.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
return false;
}
- else
- {
- if ( successMessage )
- from.SendLocalizedMessage( 1054015 ); // The bracelet's twin is available for transport.
+ if ( successMessage )
+ from.SendLocalizedMessage( 1054015 ); // The bracelet's twin is available for transport.
- return true;
- }
+ return true;
}
public void Bind( Mobile from )
diff --git a/Scripts/Items/Special/SoulStone.cs b/Scripts/Items/Special/SoulStone.cs
index d5caed7df..ab0b0a4c2 100644
--- a/Scripts/Items/Special/SoulStone.cs
+++ b/Scripts/Items/Special/SoulStone.cs
@@ -162,52 +162,53 @@ namespace Server.Items
{
return false;
}
- else if ( from.Map != Map || !from.InRange( GetWorldLocation(), 2 ) )
+
+ if ( from.Map != Map || !from.InRange( GetWorldLocation(), 2 ) )
{
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
return false;
}
- else if ( Account != null && ( !(from.Account is Account) || from.Account.Username != Account ) )
+ if ( Account != null && ( !(from.Account is Account) || from.Account.Username != Account ) )
{
from.SendLocalizedMessage( 1070714 ); // This is an Account Bound Soulstone, and your character is not bound to it. You cannot use this Soulstone.
return false;
}
- else if ( CheckCombat( from, TimeSpan.FromMinutes( 2.0 ) ) )
+ if ( CheckCombat( from, TimeSpan.FromMinutes( 2.0 ) ) )
{
from.SendLocalizedMessage( 1070727 ); // You must wait two minutes after engaging in combat before you can use a Soulstone.
return false;
}
- else if ( from.Criminal )
+ if ( from.Criminal )
{
from.SendLocalizedMessage( 1070728 ); // You must wait two minutes after committing a criminal act before you can use a Soulstone.
return false;
}
- else if ( from.Region.GetLogoutDelay( from ) > TimeSpan.Zero )
+ if ( from.Region.GetLogoutDelay( from ) > TimeSpan.Zero )
{
from.SendLocalizedMessage( 1070729 ); // In order to use your Soulstone, you must be in a safe log-out location.
return false;
}
- else if ( !from.Alive )
+ if ( !from.Alive )
{
from.SendLocalizedMessage( 1070730 ); // You may not use a Soulstone while your character is dead.
return false;
}
- else if ( Factions.Sigil.ExistsOn( from ) )
+ if ( Factions.Sigil.ExistsOn( from ) )
{
from.SendLocalizedMessage( 1070731 ); // You may not use a Soulstone while your character has a faction town sigil.
return false;
}
- else if ( from.Spell != null && from.Spell.IsCasting )
+ if ( from.Spell != null && from.Spell.IsCasting )
{
from.SendLocalizedMessage( 1070733 ); // You may not use a Soulstone while your character is casting a spell.
return false;
}
- else if ( from.Poisoned )
+ if ( from.Poisoned )
{
from.SendLocalizedMessage( 1070734 ); // You may not use a Soulstone while your character is poisoned.
return false;
}
- else if ( from.Paralyzed )
+ if ( from.Paralyzed )
{
from.SendLocalizedMessage( 1070735 ); // You may not use a Soulstone while your character is paralyzed.
return false;
@@ -221,10 +222,7 @@ namespace Server.Items
}
#endregion
- else
- {
- return true;
- }
+ return true;
}
public override void OnDoubleClick( Mobile from )
diff --git a/Scripts/Items/Special/Special Scrolls/SpecialScroll.cs b/Scripts/Items/Special/Special Scrolls/SpecialScroll.cs
index 11f829015..53f27b59b 100644
--- a/Scripts/Items/Special/Special Scrolls/SpecialScroll.cs
+++ b/Scripts/Items/Special/Special Scrolls/SpecialScroll.cs
@@ -60,8 +60,7 @@ namespace Server.Items
if ( index >= 0 && index < table.Length )
return table[index].Name.ToLower();
- else
- return "???";
+ return "???";
}
public virtual bool CanUse( Mobile from )
diff --git a/Scripts/Items/Special/Valentines/2007/ValentinesCard.cs b/Scripts/Items/Special/Valentines/2007/ValentinesCard.cs
index 9c8dc462b..1a2b04e13 100644
--- a/Scripts/Items/Special/Valentines/2007/ValentinesCard.cs
+++ b/Scripts/Items/Special/Valentines/2007/ValentinesCard.cs
@@ -46,7 +46,7 @@ namespace Server.Items
public override void AddNameProperty(ObjectPropertyList list)
{
- list.Add(m_LabelNumber, $"{((m_To != null) ? m_To : Unsigned)}\t{((m_From != null) ? m_From : Unsigned)}");
+ list.Add(m_LabelNumber, $"{m_To ?? Unsigned}\t{m_From ?? Unsigned}");
}
public override void OnSingleClick( Mobile from )
@@ -54,7 +54,7 @@ namespace Server.Items
base.OnSingleClick( from );
LabelTo( from, m_LabelNumber,
- $"{((m_To != null) ? m_To : Unsigned)}\t{((m_From != null) ? m_From : Unsigned)}");
+ $"{m_To ?? Unsigned}\t{m_From ?? Unsigned}");
}
public override void OnDoubleClick(Mobile from)
diff --git a/Scripts/Items/Special/Veteran Rewards/Banner.cs b/Scripts/Items/Special/Veteran Rewards/Banner.cs
index 57ca664ea..8ddc6c841 100644
--- a/Scripts/Items/Special/Veteran Rewards/Banner.cs
+++ b/Scripts/Items/Special/Veteran Rewards/Banner.cs
@@ -104,8 +104,7 @@ namespace Server.Items
if ( FacingSouth )
return BaseAddon.IsWall( p.X, p.Y - 1, p.Z, map ); // north wall
- else
- return BaseAddon.IsWall( p.X - 1, p.Y, p.Z, map ); // west wall
+ return BaseAddon.IsWall( p.X - 1, p.Y, p.Z, map ); // west wall
}
}
diff --git a/Scripts/Items/Special/Veteran Rewards/Cannon.cs b/Scripts/Items/Special/Veteran Rewards/Cannon.cs
index cc99ed512..02579c776 100644
--- a/Scripts/Items/Special/Veteran Rewards/Cannon.cs
+++ b/Scripts/Items/Special/Veteran Rewards/Cannon.cs
@@ -172,9 +172,9 @@ namespace Server.Items
{
if ( keg.Type == PotionEffect.ExplosionLesser )
return 5;
- else if ( keg.Type == PotionEffect.Explosion )
+ if ( keg.Type == PotionEffect.Explosion )
return 10;
- else if ( keg.Type == PotionEffect.ExplosionGreater )
+ if ( keg.Type == PotionEffect.ExplosionGreater )
return 15;
}
diff --git a/Scripts/Items/Special/Veteran Rewards/DecorativeShield.cs b/Scripts/Items/Special/Veteran Rewards/DecorativeShield.cs
index 3ef927339..abd5cea3b 100644
--- a/Scripts/Items/Special/Veteran Rewards/DecorativeShield.cs
+++ b/Scripts/Items/Special/Veteran Rewards/DecorativeShield.cs
@@ -107,8 +107,7 @@ namespace Server.Items
if ( FacingSouth )
return BaseAddon.IsWall( p.X, p.Y - 1, p.Z, map ); // north wall
- else
- return BaseAddon.IsWall( p.X - 1, p.Y, p.Z, map ); // west wall
+ return BaseAddon.IsWall( p.X - 1, p.Y, p.Z, map ); // west wall
}
}
diff --git a/Scripts/Items/Special/Veteran Rewards/FlamingHead.cs b/Scripts/Items/Special/Veteran Rewards/FlamingHead.cs
index 873a06df8..e2dbf4f1b 100644
--- a/Scripts/Items/Special/Veteran Rewards/FlamingHead.cs
+++ b/Scripts/Items/Special/Veteran Rewards/FlamingHead.cs
@@ -99,9 +99,9 @@ namespace Server.Items
if ( Type == StoneFaceTrapType.NorthWestWall )
return BaseAddon.IsWall( p.X, p.Y - 1, p.Z, map ) && BaseAddon.IsWall( p.X - 1, p.Y, p.Z, map ); // north and west wall
- else if ( Type == StoneFaceTrapType.NorthWall )
+ if ( Type == StoneFaceTrapType.NorthWall )
return BaseAddon.IsWall( p.X, p.Y - 1, p.Z, map ); // north wall
- else if ( Type == StoneFaceTrapType.WestWall )
+ if ( Type == StoneFaceTrapType.WestWall )
return BaseAddon.IsWall( p.X - 1, p.Y, p.Z, map ); // west wall
return false;
diff --git a/Scripts/Items/Special/Veteran Rewards/HangingSkeleton.cs b/Scripts/Items/Special/Veteran Rewards/HangingSkeleton.cs
index d72349fce..4d7ae61dd 100644
--- a/Scripts/Items/Special/Veteran Rewards/HangingSkeleton.cs
+++ b/Scripts/Items/Special/Veteran Rewards/HangingSkeleton.cs
@@ -109,8 +109,7 @@ namespace Server.Items
if ( FacingSouth )
return BaseAddon.IsWall( p.X, p.Y - 1, p.Z, map ); // north wall
- else
- return BaseAddon.IsWall( p.X - 1, p.Y, p.Z, map ); // west wall
+ return BaseAddon.IsWall( p.X - 1, p.Y, p.Z, map ); // west wall
}
}
diff --git a/Scripts/Items/Special/Veteran Rewards/WeaponEngravingTool.cs b/Scripts/Items/Special/Veteran Rewards/WeaponEngravingTool.cs
index ee10bd4e7..ce9256246 100644
--- a/Scripts/Items/Special/Veteran Rewards/WeaponEngravingTool.cs
+++ b/Scripts/Items/Special/Veteran Rewards/WeaponEngravingTool.cs
@@ -168,7 +168,7 @@ namespace Server.Items
public static WeaponEngravingTool Find( Mobile from )
{
- return @from.Backpack?.FindItemByType( typeof( WeaponEngravingTool ) ) as WeaponEngravingTool;
+ return from.Backpack?.FindItemByType( typeof( WeaponEngravingTool ) ) as WeaponEngravingTool;
}
private class TargetWeapon : Target
diff --git a/Scripts/Items/Talismans/BaseTalisman.cs b/Scripts/Items/Talismans/BaseTalisman.cs
index 63b2e69c9..9096aa6cd 100644
--- a/Scripts/Items/Talismans/BaseTalisman.cs
+++ b/Scripts/Items/Talismans/BaseTalisman.cs
@@ -818,8 +818,7 @@ namespace Server.Items
if (num > 14)
return new TalismanAttribute(m_Summons[num], m_SummonLabels[num], 10);
- else
- return new TalismanAttribute(m_Summons[num], m_SummonLabels[num]);
+ return new TalismanAttribute(m_Summons[num], m_SummonLabels[num]);
}
return new TalismanAttribute();
diff --git a/Scripts/Items/Weapons/Abilities/DoubleShot.cs b/Scripts/Items/Weapons/Abilities/DoubleShot.cs
index 177c875a9..42ce7ccda 100644
--- a/Scripts/Items/Weapons/Abilities/DoubleShot.cs
+++ b/Scripts/Items/Weapons/Abilities/DoubleShot.cs
@@ -38,11 +38,8 @@ namespace Server.Items
{
if ( from.Mounted )
return true;
- else
- {
- from.SendLocalizedMessage( 1070770 ); // You can only execute this attack while mounted!
- ClearCurrentAbility( from );
- }
+ from.SendLocalizedMessage( 1070770 ); // You can only execute this attack while mounted!
+ ClearCurrentAbility( from );
}
return false;
diff --git a/Scripts/Items/Weapons/Abilities/WeaponAbility.cs b/Scripts/Items/Weapons/Abilities/WeaponAbility.cs
index 398881996..90f2e5073 100644
--- a/Scripts/Items/Weapons/Abilities/WeaponAbility.cs
+++ b/Scripts/Items/Weapons/Abilities/WeaponAbility.cs
@@ -45,7 +45,7 @@ namespace Server.Items
if ( weapon != null && weapon.PrimaryAbility == this )
return 70.0;
- else if ( weapon != null && weapon.SecondaryAbility == this )
+ if ( weapon != null && weapon.SecondaryAbility == this )
return 90.0;
return 200.0;
diff --git a/Scripts/Items/Weapons/Axes/BaseAxe.cs b/Scripts/Items/Weapons/Axes/BaseAxe.cs
index edfdbeb5a..712c9c650 100644
--- a/Scripts/Items/Weapons/Axes/BaseAxe.cs
+++ b/Scripts/Items/Weapons/Axes/BaseAxe.cs
@@ -88,7 +88,8 @@ namespace Server.Items
from.LocalOverheadMessage( MessageType.Regular, 0x3E9, 1019045 ); // I can't reach that
return;
}
- else if ( !IsAccessibleTo( from ) )
+
+ if ( !IsAccessibleTo( from ) )
{
PublicOverheadMessage( MessageType.Regular, 0x3E9, 1061637 ); // You are not allowed to access this.
return;
diff --git a/Scripts/Items/Weapons/BaseWeapon.cs b/Scripts/Items/Weapons/BaseWeapon.cs
index 734da83e8..b7d8765eb 100644
--- a/Scripts/Items/Weapons/BaseWeapon.cs
+++ b/Scripts/Items/Weapons/BaseWeapon.cs
@@ -364,7 +364,7 @@ namespace Server.Items
if ( Core.ML )
return MlSpeed;
- else if ( Core.AOS )
+ if ( Core.AOS )
return AosSpeed;
return OldSpeed;
@@ -540,7 +540,8 @@ namespace Server.Items
m.SendLocalizedMessage( 500214 ); // You already have something in both hands.
return true;
}
- else if ( Layer == Layer.OneHanded && layer == Layer.TwoHanded && !(item is BaseShield) && !(item is BaseEquipableLight) )
+
+ if ( Layer == Layer.OneHanded && layer == Layer.TwoHanded && !(item is BaseShield) && !(item is BaseEquipableLight) )
{
m.SendLocalizedMessage( 500215 ); // You can only wield one weapon at a time.
return true;
@@ -1525,7 +1526,7 @@ namespace Server.Items
damageGiven = AOS.Damage( defender, attacker, damage, ignoreArmor, phys, fire, cold, pois, nrgy, chaos, direct, false, this is BaseRanged, false );
- double propertyBonus = ( move == null ) ? 1.0 : move.GetPropertyBonus( attacker );
+ double propertyBonus = move?.GetPropertyBonus( attacker ) ?? 1.0;
if ( Core.AOS )
{
@@ -1866,7 +1867,8 @@ namespace Server.Items
{
continue;
}
- else if ( scalar < 1.0 )
+
+ if ( scalar < 1.0 )
{
damage *= ( 11 - from.GetDistanceToSqrt( m ) ) / 10;
}
diff --git a/Scripts/Items/Weapons/Fists.cs b/Scripts/Items/Weapons/Fists.cs
index 16bbfc3a1..841168e0a 100644
--- a/Scripts/Items/Weapons/Fists.cs
+++ b/Scripts/Items/Weapons/Fists.cs
@@ -56,8 +56,7 @@ namespace Server.Items
if ( wresValue > incrValue )
return wresValue;
- else
- return incrValue;
+ return incrValue;
}
private void CheckPreAOSMoves( Mobile attacker, Mobile defender )
diff --git a/Scripts/Items/Weapons/Ranged/BaseRanged.cs b/Scripts/Items/Weapons/Ranged/BaseRanged.cs
index 49f9599cb..371076216 100644
--- a/Scripts/Items/Weapons/Ranged/BaseRanged.cs
+++ b/Scripts/Items/Weapons/Ranged/BaseRanged.cs
@@ -91,12 +91,10 @@ namespace Server.Items
return GetDelay( attacker );
}
- else
- {
- attacker.RevealingAction();
- return TimeSpan.FromSeconds( 0.25 );
- }
+ attacker.RevealingAction();
+
+ return TimeSpan.FromSeconds( 0.25 );
}
public override void OnHit( Mobile attacker, Mobile defender, double damageBonus = 1)
diff --git a/Scripts/Misc/DoorGenerator.cs b/Scripts/Misc/DoorGenerator.cs
index 63ae332df..3d96c1742 100644
--- a/Scripts/Misc/DoorGenerator.cs
+++ b/Scripts/Misc/DoorGenerator.cs
@@ -392,7 +392,7 @@ namespace Server
if ( delta < 0 )
return false;
- else if ( delta == 0 )
+ if ( delta == 0 )
return true;
}
diff --git a/Scripts/Misc/Gifts/Winter2004/Mistletoe.cs b/Scripts/Misc/Gifts/Winter2004/Mistletoe.cs
index 0c0651839..e01e3c57b 100644
--- a/Scripts/Misc/Gifts/Winter2004/Mistletoe.cs
+++ b/Scripts/Misc/Gifts/Winter2004/Mistletoe.cs
@@ -31,8 +31,7 @@ namespace Server.Items
if ( ItemID == 0x2375 )
return BaseAddon.IsWall( p.X, p.Y - 1, p.Z, map ); // North wall
- else
- return BaseAddon.IsWall( p.X - 1, p.Y, p.Z, map ); // West wall
+ return BaseAddon.IsWall( p.X - 1, p.Y, p.Z, map ); // West wall
}
public override void Serialize( GenericWriter writer )
@@ -108,16 +107,12 @@ namespace Server.Items
Hue = sender.DyedHue;
return true;
}
- else
- {
- from.SendLocalizedMessage( 500295 ); // You are too far away to do that.
- return false;
- }
- }
- else
- {
+
+ from.SendLocalizedMessage( 500295 ); // You are too far away to do that.
return false;
}
+
+ return false;
}
private class MistletoeAddonGump : Gump
diff --git a/Scripts/Misc/Guild.cs b/Scripts/Misc/Guild.cs
index ea0d62ec4..a358237cf 100644
--- a/Scripts/Misc/Guild.cs
+++ b/Scripts/Misc/Guild.cs
@@ -361,7 +361,7 @@ namespace Server.Guilds
{
PlayerMobile pm = from as PlayerMobile;
- AllianceChat( from, (pm == null) ? 0x3B2 : pm.AllianceMessageHue, text );
+ AllianceChat( from, pm?.AllianceMessageHue ?? 0x3B2, text );
}
#endregion
@@ -519,16 +519,16 @@ namespace Server.Guilds
{
if ( m_Kills > w.m_Kills )
return WarStatus.Win;
- else if ( m_Kills < w.m_Kills )
+ if ( m_Kills < w.m_Kills )
return WarStatus.Lose;
- else
- return WarStatus.Draw;
+ return WarStatus.Draw;
}
- else if ( m_MaxKills > 0 )
+
+ if ( m_MaxKills > 0 )
{
if ( m_Kills >= m_MaxKills )
return WarStatus.Win;
- else if ( w.m_Kills >= w.MaxKills )
+ if ( w.m_Kills >= w.MaxKills )
return WarStatus.Lose;
}
diff --git a/Scripts/Misc/Loot.cs b/Scripts/Misc/Loot.cs
index eda2db12a..a91777373 100644
--- a/Scripts/Misc/Loot.cs
+++ b/Scripts/Misc/Loot.cs
@@ -378,10 +378,9 @@ namespace Server
{
if ( Core.ML )
return Construct( m_NewWandTypes ) as BaseWand;
- else if ( Core.AOS )
+ if ( Core.AOS )
return Construct( m_WandTypes, m_NewWandTypes ) as BaseWand;
- else
- return Construct( m_OldWandTypes, m_WandTypes, m_NewWandTypes ) as BaseWand;
+ return Construct( m_OldWandTypes, m_WandTypes, m_NewWandTypes ) as BaseWand;
}
public static BaseClothing RandomClothing()
diff --git a/Scripts/Misc/LootPack.cs b/Scripts/Misc/LootPack.cs
index 5ac7834c0..74c3618b0 100644
--- a/Scripts/Misc/LootPack.cs
+++ b/Scripts/Misc/LootPack.cs
@@ -594,18 +594,15 @@ namespace Server
if ( 50 > rnd )
return 1;
- else
- rnd -= 50;
+ rnd -= 50;
if ( 25 > rnd )
return 2;
- else
- rnd -= 25;
+ rnd -= 25;
if ( 14 > rnd )
return 3;
- else
- rnd -= 14;
+ rnd -= 14;
if ( 8 > rnd )
return 4;
diff --git a/Scripts/Misc/Notoriety.cs b/Scripts/Misc/Notoriety.cs
index 462162684..f77d11201 100644
--- a/Scripts/Misc/Notoriety.cs
+++ b/Scripts/Misc/Notoriety.cs
@@ -34,7 +34,7 @@ namespace Server.Misc
{
if ( m.Guild == null )
return GuildStatus.None;
- else if ( ((Guild)m.Guild).Enemies.Count == 0 && m.Guild.Type == GuildType.Regular )
+ if ( ((Guild)m.Guild).Enemies.Count == 0 && m.Guild.Type == GuildType.Regular )
return GuildStatus.Peaceful;
return GuildStatus.Waring;
diff --git a/Scripts/Misc/RaceDefinitions.cs b/Scripts/Misc/RaceDefinitions.cs
index 68f56f105..a66c6f483 100644
--- a/Scripts/Misc/RaceDefinitions.cs
+++ b/Scripts/Misc/RaceDefinitions.cs
@@ -94,10 +94,9 @@ namespace Server.Misc
{
if ( hue < 1002 )
return 1002;
- else if ( hue > 1058 )
+ if ( hue > 1058 )
return 1058;
- else
- return hue;
+ return hue;
}
public override int RandomSkinHue()
@@ -109,10 +108,9 @@ namespace Server.Misc
{
if ( hue < 1102 )
return 1102;
- else if ( hue > 1149 )
+ if ( hue > 1149 )
return 1149;
- else
- return hue;
+ return hue;
}
public override int RandomHairHue()
@@ -226,63 +224,56 @@ namespace Server.Misc
public override bool ValidateHair(bool female, int itemID)
{
- if (female == false)
+ if (female == false)
{
return itemID >= 0x4258 && itemID <= 0x425F;
}
- else
- {
- return ((itemID == 0x4261 || itemID == 0x4262) || (itemID >= 0x4273 && itemID <= 0x4275) || (itemID == 0x42B0 || itemID == 0x42B1) || (itemID == 0x42AA || itemID == 0x42AB));
- }
+
+ return ((itemID == 0x4261 || itemID == 0x4262) || (itemID >= 0x4273 && itemID <= 0x4275) || (itemID == 0x42B0 || itemID == 0x42B1) || (itemID == 0x42AA || itemID == 0x42AB));
}
public override int RandomHair(bool female)
{
if (Utility.Random(9) == 0)
return 0;
- else if (!female)
- return 0x4258 + Utility.Random(8);
- else
- {
- switch (Utility.Random(9))
- {
- case 0:
- return 0x4261;
- case 1:
- return 0x4262;
- case 2:
- return 0x4273;
- case 3:
- return 0x4274;
- case 4:
- return 0x4275;
- case 5:
- return 0x42B0;
- case 6:
- return 0x42B1;
- case 7:
- return 0x42AA;
- case 8:
- return 0x42AB;
- }
- return 0;
- }
+ if (!female)
+ return 0x4258 + Utility.Random(8);
+ switch (Utility.Random(9))
+ {
+ case 0:
+ return 0x4261;
+ case 1:
+ return 0x4262;
+ case 2:
+ return 0x4273;
+ case 3:
+ return 0x4274;
+ case 4:
+ return 0x4275;
+ case 5:
+ return 0x42B0;
+ case 6:
+ return 0x42B1;
+ case 7:
+ return 0x42AA;
+ case 8:
+ return 0x42AB;
+ }
+ return 0;
}
public override bool ValidateFacialHair(bool female, int itemID)
{
- if (female)
+ if (female)
return false;
- else
- return itemID >= 0x42AD && itemID <= 0x42B0;
+ return itemID >= 0x42AD && itemID <= 0x42B0;
}
public override int RandomFacialHair(bool female)
{
- if (female)
+ if (female)
return 0;
- else
- return Utility.RandomList(0, 0x42AD, 0x42AE, 0x42AF, 0x42B0);
+ return Utility.RandomList(0, 0x42AD, 0x42AE, 0x42AF, 0x42B0);
}
// Todo Finish body hues
diff --git a/Scripts/Misc/ResourceInfo.cs b/Scripts/Misc/ResourceInfo.cs
index 37fa37a64..7594bb208 100644
--- a/Scripts/Misc/ResourceInfo.cs
+++ b/Scripts/Misc/ResourceInfo.cs
@@ -630,7 +630,7 @@ namespace Server.Items
{
CraftResourceInfo info = GetInfo( resource );
- return ( info == null ? 0 : info.Number );
+ return info?.Number ?? 0;
}
///
@@ -640,7 +640,7 @@ namespace Server.Items
{
CraftResourceInfo info = GetInfo( resource );
- return ( info == null ? 0 : info.Hue );
+ return info?.Hue ?? 0;
}
///
@@ -660,30 +660,30 @@ namespace Server.Items
{
if ( info.Name.IndexOf( "Spined" ) >= 0 )
return CraftResource.SpinedLeather;
- else if ( info.Name.IndexOf( "Horned" ) >= 0 )
+ if ( info.Name.IndexOf( "Horned" ) >= 0 )
return CraftResource.HornedLeather;
- else if ( info.Name.IndexOf( "Barbed" ) >= 0 )
+ if ( info.Name.IndexOf( "Barbed" ) >= 0 )
return CraftResource.BarbedLeather;
- else if ( info.Name.IndexOf( "Leather" ) >= 0 )
+ if ( info.Name.IndexOf( "Leather" ) >= 0 )
return CraftResource.RegularLeather;
if ( info.Level == 0 )
return CraftResource.Iron;
- else if ( info.Level == 1 )
+ if ( info.Level == 1 )
return CraftResource.DullCopper;
- else if ( info.Level == 2 )
+ if ( info.Level == 2 )
return CraftResource.ShadowIron;
- else if ( info.Level == 3 )
+ if ( info.Level == 3 )
return CraftResource.Copper;
- else if ( info.Level == 4 )
+ if ( info.Level == 4 )
return CraftResource.Bronze;
- else if ( info.Level == 5 )
+ if ( info.Level == 5 )
return CraftResource.Gold;
- else if ( info.Level == 6 )
+ if ( info.Level == 6 )
return CraftResource.Agapite;
- else if ( info.Level == 7 )
+ if ( info.Level == 7 )
return CraftResource.Verite;
- else if ( info.Level == 8 )
+ if ( info.Level == 8 )
return CraftResource.Valorite;
return CraftResource.None;
@@ -699,11 +699,11 @@ namespace Server.Items
{
if ( info.Level == 0 )
return CraftResource.RegularLeather;
- else if ( info.Level == 1 )
+ if ( info.Level == 1 )
return CraftResource.SpinedLeather;
- else if ( info.Level == 2 )
+ if ( info.Level == 2 )
return CraftResource.HornedLeather;
- else if ( info.Level == 3 )
+ if ( info.Level == 3 )
return CraftResource.BarbedLeather;
return CraftResource.None;
diff --git a/Scripts/Misc/ServerList.cs b/Scripts/Misc/ServerList.cs
index d42184e84..f31bf0021 100644
--- a/Scripts/Misc/ServerList.cs
+++ b/Scripts/Misc/ServerList.cs
@@ -157,16 +157,15 @@ namespace Server.Misc
if ( Utility.IPMatch( "192.168.*", ip ) )
return true;
- else if ( Utility.IPMatch( "10.*", ip ) )
+ if ( Utility.IPMatch( "10.*", ip ) )
return true;
- else if ( Utility.IPMatch( "172.16-31.*", ip ) )
+ if ( Utility.IPMatch( "172.16-31.*", ip ) )
return true;
- else if ( Utility.IPMatch( "169.254.*", ip ) )
+ if ( Utility.IPMatch( "169.254.*", ip ) )
return true;
- else if ( Utility.IPMatch( "100.64-127.*", ip ) )
+ if ( Utility.IPMatch( "100.64-127.*", ip ) )
return true;
- else
- return false;
+ return false;
}
private static IPAddress FindPublicAddress()
diff --git a/Scripts/Misc/SkillCheck.cs b/Scripts/Misc/SkillCheck.cs
index d48c94d34..91da3637f 100644
--- a/Scripts/Misc/SkillCheck.cs
+++ b/Scripts/Misc/SkillCheck.cs
@@ -90,7 +90,7 @@ namespace Server.Misc
if ( value < minSkill )
return false; // Too difficult
- else if ( value >= maxSkill )
+ if ( value >= maxSkill )
return true; // No challenge
double chance = (value - minSkill) / (maxSkill - minSkill);
@@ -108,7 +108,7 @@ namespace Server.Misc
if ( chance < 0.0 )
return false; // Too difficult
- else if ( chance >= 1.0 )
+ if ( chance >= 1.0 )
return true; // No challenge
Point2D loc = new Point2D( from.Location.X / LocationSize, from.Location.Y / LocationSize );
diff --git a/Scripts/Misc/TextDefinition.cs b/Scripts/Misc/TextDefinition.cs
index 5ef54e320..078c81dc6 100644
--- a/Scripts/Misc/TextDefinition.cs
+++ b/Scripts/Misc/TextDefinition.cs
@@ -38,7 +38,7 @@ namespace Server
{
if ( m_Number > 0 )
return string.Concat( "#", m_Number.ToString() );
- else if ( m_String != null )
+ if ( m_String != null )
return m_String;
return "";
@@ -48,7 +48,7 @@ namespace Server
{
if ( m_Number > 0 )
return string.Format( "{0} (0x{0:X})", m_Number );
- else if ( m_String != null )
+ if ( m_String != null )
return $"\"{m_String}\"";
return propsGump ? "-empty-" : "empty";
@@ -58,7 +58,7 @@ namespace Server
{
if ( m_Number > 0 )
return m_Number.ToString();
- else if ( m_String != null )
+ if ( m_String != null )
return m_String;
return "";
@@ -208,8 +208,7 @@ namespace Server
if ( isInteger )
return new TextDefinition( i );
- else
- return new TextDefinition( value );
+ return new TextDefinition( value );
}
public static bool IsNullOrEmpty( TextDefinition def )
diff --git a/Scripts/Misc/VendorGenerator.cs b/Scripts/Misc/VendorGenerator.cs
index 2150ce625..88e50b860 100644
--- a/Scripts/Misc/VendorGenerator.cs
+++ b/Scripts/Misc/VendorGenerator.cs
@@ -459,7 +459,7 @@ namespace Server
if ( (landFlags & TileFlag.Impassable) != 0 && topZ > z && (z + 16) > lowZ )
return false;
- else if ( (landFlags & TileFlag.Impassable) == 0 && z == avgZ && !lt.Ignored )
+ if ( (landFlags & TileFlag.Impassable) == 0 && z == avgZ && !lt.Ignored )
hasSurface = true;
StaticTile[] staticTiles = map.Tiles.GetStaticTiles( x, y );
@@ -478,7 +478,7 @@ namespace Server
if ( (surface || impassable) && (staticTiles[i].Z + id.CalcHeight) > z && (z + 16) > staticTiles[i].Z )
return false;
- else if ( surface && !impassable && z == (staticTiles[i].Z + id.CalcHeight) )
+ if ( surface && !impassable && z == (staticTiles[i].Z + id.CalcHeight) )
hasSurface = true;
}
@@ -497,7 +497,7 @@ namespace Server
if ( (surface || impassable) && (item.Z + id.CalcHeight) > z && (z + 16) > item.Z )
return false;
- else if ( surface && !impassable && z == (item.Z + id.CalcHeight) )
+ if ( surface && !impassable && z == (item.Z + id.CalcHeight) )
hasSurface = true;
}
}
diff --git a/Scripts/Mobiles/AI/AnimalAI.cs b/Scripts/Mobiles/AI/AnimalAI.cs
index d3c934b8b..4ac7ad6cf 100644
--- a/Scripts/Mobiles/AI/AnimalAI.cs
+++ b/Scripts/Mobiles/AI/AnimalAI.cs
@@ -92,11 +92,9 @@ namespace Server.Mobiles
return true;
}
- else
- {
- if ( m_Mobile.Debug )
- m_Mobile.DebugSay( "I should be closer to {0}", combatant.Name );
- }
+
+ if ( m_Mobile.Debug )
+ m_Mobile.DebugSay( "I should be closer to {0}", combatant.Name );
}
if ( !m_Mobile.Controlled && !m_Mobile.Summoned && m_Mobile.CanFlee )
diff --git a/Scripts/Mobiles/AI/BaseAI.cs b/Scripts/Mobiles/AI/BaseAI.cs
index 589222ada..dafb2da21 100644
--- a/Scripts/Mobiles/AI/BaseAI.cs
+++ b/Scripts/Mobiles/AI/BaseAI.cs
@@ -117,7 +117,7 @@ namespace Server.Mobiles
if (!isOwner && !isFriend)
return;
- else if (isFriend && m_Order != OrderType.Follow && m_Order != OrderType.Stay && m_Order != OrderType.Stop)
+ if (isFriend && m_Order != OrderType.Follow && m_Order != OrderType.Stay && m_Order != OrderType.Stop)
return;
switch (m_Order)
@@ -141,8 +141,7 @@ namespace Server.Mobiles
{
if (m_Mobile.Summoned)
goto default;
- else
- m_From.SendGump(new Gumps.ConfirmReleaseGump(m_From, m_Mobile));
+ m_From.SendGump(new Gumps.ConfirmReleaseGump(m_From, m_Mobile));
break;
}
@@ -203,7 +202,7 @@ namespace Server.Mobiles
if (!isOwner && !isFriend)
return;
- else if (isFriend && order != OrderType.Follow && order != OrderType.Stay && order != OrderType.Stop)
+ if (isFriend && order != OrderType.Follow && order != OrderType.Stay && order != OrderType.Stop)
return;
if (from.Target == null)
@@ -947,10 +946,8 @@ namespace Server.Mobiles
Action = ActionType.Guard;
return true;
}
- else
- {
- m_Mobile.DebugSay("I am fleeing!");
- }
+
+ m_Mobile.DebugSay("I am fleeing!");
return true;
}
@@ -1353,7 +1350,7 @@ namespace Server.Mobiles
/* ~1_NAME~ has granted you the ability to give orders to their pet ~2_PET_NAME~.
* This creature will now consider you as a friend.
*/
- to.SendLocalizedMessage(1043246, $"{@from.Name}\t{m_Mobile.Name}");
+ to.SendLocalizedMessage(1043246, $"{from.Name}\t{m_Mobile.Name}");
m_Mobile.AddPetFriend(to);
@@ -1393,7 +1390,7 @@ namespace Server.Mobiles
/* ~1_NAME~ has no longer granted you the ability to give orders to their pet ~2_PET_NAME~.
* This creature will no longer consider you as a friend.
*/
- to.SendLocalizedMessage(1070952, $"{@from.Name}\t{m_Mobile.Name}");
+ to.SendLocalizedMessage(1070952, $"{from.Name}\t{m_Mobile.Name}");
m_Mobile.RemovePetFriend(to);
}
@@ -1679,7 +1676,7 @@ namespace Server.Mobiles
}
else if (accepted && !m_Creature.CanBeControlledBy(to))
{
- string args = $"{to.Name}\t{@from.Name}\t ";
+ string args = $"{to.Name}\t{from.Name}\t ";
from.SendLocalizedMessage(1043248, args); // The pet refuses to be transferred because it will not obey ~1_NAME~.~3_BLANK~
to.SendLocalizedMessage(1043249, args); // The pet will not accept you as a master because it does not trust you.~3_BLANK~
@@ -1688,7 +1685,7 @@ namespace Server.Mobiles
}
else if (accepted && !m_Creature.CanBeControlledBy(from))
{
- string args = $"{to.Name}\t{@from.Name}\t ";
+ string args = $"{to.Name}\t{from.Name}\t ";
from.SendLocalizedMessage(1043250, args); // The pet refuses to be transferred because it will not obey you sufficiently.~3_BLANK~
to.SendLocalizedMessage(1043251, args); // The pet will not accept you as a master because it does not trust ~2_NAME~.~3_BLANK~
@@ -1739,7 +1736,7 @@ namespace Server.Mobiles
m_Creature.PlaySound(m_Creature.GetIdleSound());
- string args = $"{@from.Name}\t{m_Creature.Name}\t{to.Name}";
+ string args = $"{from.Name}\t{m_Creature.Name}\t{to.Name}";
from.SendLocalizedMessage(1043253, args); // You have transferred your pet to ~3_GETTER~.
to.SendLocalizedMessage(1043252, args); // ~1_NAME~ has transferred the allegiance of ~2_PET_NAME~ to you.
@@ -1773,14 +1770,14 @@ namespace Server.Mobiles
}
else if (!m_Mobile.CanBeControlledBy(to))
{
- string args = $"{to.Name}\t{@from.Name}\t ";
+ string args = $"{to.Name}\t{from.Name}\t ";
from.SendLocalizedMessage(1043248, args); // The pet refuses to be transferred because it will not obey ~1_NAME~.~3_BLANK~
to.SendLocalizedMessage(1043249, args); // The pet will not accept you as a master because it does not trust you.~3_BLANK~
}
else if (!m_Mobile.CanBeControlledBy(from))
{
- string args = $"{to.Name}\t{@from.Name}\t ";
+ string args = $"{to.Name}\t{from.Name}\t ";
from.SendLocalizedMessage(1043250, args); // The pet refuses to be transferred because it will not obey you sufficiently.~3_BLANK~
to.SendLocalizedMessage(1043251, args); // The pet will not accept you as a master because it does not trust ~2_NAME~.~3_BLANK~
@@ -2410,7 +2407,8 @@ namespace Server.Mobiles
m_Mobile.FocusMob = m_Mobile.BardTarget;
return (m_Mobile.FocusMob != null);
}
- else if (m_Mobile.Controlled)
+
+ if (m_Mobile.Controlled)
{
if (m_Mobile.ControlTarget == null || m_Mobile.ControlTarget.Deleted || m_Mobile.ControlTarget.Hidden || !m_Mobile.ControlTarget.Alive || m_Mobile.ControlTarget.IsDeadBondedPet || !m_Mobile.InRange(m_Mobile.ControlTarget, m_Mobile.RangePerception * 2))
{
diff --git a/Scripts/Mobiles/AI/MageAI.cs b/Scripts/Mobiles/AI/MageAI.cs
index c929029e0..94a6c00ed 100644
--- a/Scripts/Mobiles/AI/MageAI.cs
+++ b/Scripts/Mobiles/AI/MageAI.cs
@@ -30,8 +30,7 @@ namespace Server.Mobiles
if ( ProcessTarget() )
return true;
- else
- return base.Think();
+ return base.Think();
}
public virtual bool SmartAI => ( m_Mobile is BaseVendor || m_Mobile is BaseEscortable || m_Mobile is Changeling );
@@ -547,14 +546,12 @@ namespace Server.Mobiles
{
return TimeSpan.FromSeconds( m_Mobile.ActiveSpeed );
}
- else
- {
- double del = ScaleBySkill( 3.0, SkillName.Magery );
- double min = 6.0 - ( del * 0.75 );
- double max = 6.0 - ( del * 1.25 );
- return TimeSpan.FromSeconds( min + ( ( max - min ) * Utility.RandomDouble() ) );
- }
+ double del = ScaleBySkill( 3.0, SkillName.Magery );
+ double min = 6.0 - ( del * 0.75 );
+ double max = 6.0 - ( del * 1.25 );
+
+ return TimeSpan.FromSeconds( min + ( ( max - min ) * Utility.RandomDouble() ) );
}
private Mobile m_LastTarget;
@@ -864,45 +861,43 @@ namespace Server.Mobiles
return active;
}
- else
+
+ Map map = m_Mobile.Map;
+
+ if ( map != null )
{
- Map map = m_Mobile.Map;
+ Mobile active = null, inactive = null;
+ double actPrio = 0.0, inactPrio = 0.0;
- if ( map != null )
+ Mobile comb = m_Mobile.Combatant;
+
+ if ( comb != null && !comb.Deleted && comb.Alive && !comb.IsDeadBondedPet && CanDispel( comb ) )
{
- Mobile active = null, inactive = null;
- double actPrio = 0.0, inactPrio = 0.0;
+ active = inactive = comb;
+ actPrio = inactPrio = m_Mobile.GetDistanceToSqrt( comb );
+ }
- Mobile comb = m_Mobile.Combatant;
-
- if ( comb != null && !comb.Deleted && comb.Alive && !comb.IsDeadBondedPet && CanDispel( comb ) )
+ foreach( Mobile m in m_Mobile.GetMobilesInRange( Core.ML ? 10 : 12 ) )
+ {
+ if ( m != m_Mobile && CanDispel( m ) )
{
- active = inactive = comb;
- actPrio = inactPrio = m_Mobile.GetDistanceToSqrt( comb );
- }
+ double prio = m_Mobile.GetDistanceToSqrt( m );
- foreach( Mobile m in m_Mobile.GetMobilesInRange( Core.ML ? 10 : 12 ) )
- {
- if ( m != m_Mobile && CanDispel( m ) )
+ if ( !activeOnly && ( inactive == null || prio < inactPrio ) )
{
- double prio = m_Mobile.GetDistanceToSqrt( m );
+ inactive = m;
+ inactPrio = prio;
+ }
- if ( !activeOnly && ( inactive == null || prio < inactPrio ) )
- {
- inactive = m;
- inactPrio = prio;
- }
-
- if ( ( m_Mobile.Combatant == m || m.Combatant == m_Mobile ) && ( active == null || prio < actPrio ) )
- {
- active = m;
- actPrio = prio;
- }
+ if ( ( m_Mobile.Combatant == m || m.Combatant == m_Mobile ) && ( active == null || prio < actPrio ) )
+ {
+ active = m;
+ actPrio = prio;
}
}
-
- return active != null ? active : inactive;
}
+
+ return active ?? inactive;
}
return null;
diff --git a/Scripts/Mobiles/AI/PredatorAI.cs b/Scripts/Mobiles/AI/PredatorAI.cs
index dc6d9c05c..961917a30 100644
--- a/Scripts/Mobiles/AI/PredatorAI.cs
+++ b/Scripts/Mobiles/AI/PredatorAI.cs
@@ -59,10 +59,8 @@ namespace Server.Mobiles
Action = ActionType.Wander;
return true;
}
- else
- {
- m_Mobile.DebugSay( "I should be closer to {0}", combatant.Name );
- }
+
+ m_Mobile.DebugSay( "I should be closer to {0}", combatant.Name );
}
return true;
diff --git a/Scripts/Mobiles/Animals/Mounts/Ethereals.cs b/Scripts/Mobiles/Animals/Mounts/Ethereals.cs
index 88e756dc9..80fdfcb65 100644
--- a/Scripts/Mobiles/Animals/Mounts/Ethereals.cs
+++ b/Scripts/Mobiles/Animals/Mounts/Ethereals.cs
@@ -118,37 +118,38 @@ namespace Server.Mobiles
from.SayTo( from, 1010095 ); // This must be on your person to use.
return false;
}
- else if ( m_IsRewardItem && !RewardSystem.CheckIsUsableBy( from, this, null ) )
+
+ if ( m_IsRewardItem && !RewardSystem.CheckIsUsableBy( from, this, null ) )
{
// CheckIsUsableBy sends the message
return false;
}
- else if ( !BaseMount.CheckMountAllowed( from ) )
+ if ( !BaseMount.CheckMountAllowed( from ) )
{
// CheckMountAllowed sends the message
return false;
}
- else if ( from.Mounted )
+ if ( from.Mounted )
{
from.SendLocalizedMessage( 1005583 ); // Please dismount first.
return false;
}
- else if ( from.IsBodyMod && !from.Body.IsHuman )
+ if ( from.IsBodyMod && !from.Body.IsHuman )
{
from.SendLocalizedMessage( 1061628 ); // You can't do that while polymorphed.
return false;
}
- else if ( from.HasTrade )
+ if ( from.HasTrade )
{
from.SendLocalizedMessage( 1042317, "", 0x41 ); // You may not ride at this time
return false;
}
- else if ( ( from.Followers + FollowerSlots ) > from.FollowersMax )
+ if ( ( from.Followers + FollowerSlots ) > from.FollowersMax )
{
from.SendLocalizedMessage( 1049679 ); // You have too many followers to summon your mount.
return false;
}
- else if ( !Multis.DesignContext.Check( from ) )
+ if ( !Multis.DesignContext.Check( from ) )
{
// Check sends the message
return false;
diff --git a/Scripts/Mobiles/Animals/Mounts/Hiryu.cs b/Scripts/Mobiles/Animals/Mounts/Hiryu.cs
index 53aaa8eaf..62ff8399e 100644
--- a/Scripts/Mobiles/Animals/Mounts/Hiryu.cs
+++ b/Scripts/Mobiles/Animals/Mounts/Hiryu.cs
@@ -42,29 +42,29 @@ namespace Server.Mobiles
if ( rand <= 0 )
return 0x855C;
- else if ( rand <= 1 )
+ if ( rand <= 1 )
return 0x8490;
- else if ( rand <= 3 )
+ if ( rand <= 3 )
return 0x8030;
- else if ( rand <= 5 )
+ if ( rand <= 5 )
return 0x8037;
- else if ( rand <= 8 )
+ if ( rand <= 8 )
return 0x8295;
- else if ( rand <= 11 )
+ if ( rand <= 11 )
return 0x8123;
- else if ( rand <= 16 )
+ if ( rand <= 16 )
return 0x8482;
- else if ( rand <= 24 )
+ if ( rand <= 24 )
return 0x8487;
- else if ( rand <= 34 )
+ if ( rand <= 34 )
return 0x8032;
- else if ( rand <= 44 )
+ if ( rand <= 44 )
return 0x8899;
- else if ( rand <= 54 )
+ if ( rand <= 54 )
return 0x8495;
- else if ( rand <= 64 )
+ if ( rand <= 64 )
return 0x848D;
- else if ( rand <= 74 )
+ if ( rand <= 74 )
return 0x847F;
diff --git a/Scripts/Mobiles/Animals/Mounts/LesserHiryu.cs b/Scripts/Mobiles/Animals/Mounts/LesserHiryu.cs
index 22460d5d8..b6334b37d 100644
--- a/Scripts/Mobiles/Animals/Mounts/LesserHiryu.cs
+++ b/Scripts/Mobiles/Animals/Mounts/LesserHiryu.cs
@@ -30,13 +30,13 @@ namespace Server.Mobiles
if ( rand <= 0 )
return 0x8258;
- else if ( rand <= 1 )
+ if ( rand <= 1 )
return 0x88AB;
- else if ( rand <= 6 )
+ if ( rand <= 6 )
return 0x87D4;
- else if ( rand <= 16 )
+ if ( rand <= 16 )
return 0x8163;
- else if ( rand <= 26 )
+ if ( rand <= 26 )
return 0x8295;
diff --git a/Scripts/Mobiles/BaseCreature.cs b/Scripts/Mobiles/BaseCreature.cs
index 796949c8b..c7162c2ca 100644
--- a/Scripts/Mobiles/BaseCreature.cs
+++ b/Scripts/Mobiles/BaseCreature.cs
@@ -592,7 +592,7 @@ namespace Server.Mobiles
{
if ( m_Paragon == value )
return;
- else if ( value )
+ if ( value )
Paragon.Convert( this );
else
Paragon.UnConvert( this );
@@ -2822,10 +2822,8 @@ namespace Server.Mobiles
return -GetDistanceToSqrt( m ); // returns closest mobile
}
}
- else
- {
- return double.MinValue;
- }
+
+ return double.MinValue;
}
// Turn, - for left, + for right
diff --git a/Scripts/Mobiles/Guards/ArcherGuard.cs b/Scripts/Mobiles/Guards/ArcherGuard.cs
index ea7f7d47a..7a16ad5ab 100644
--- a/Scripts/Mobiles/Guards/ArcherGuard.cs
+++ b/Scripts/Mobiles/Guards/ArcherGuard.cs
@@ -249,7 +249,8 @@ namespace Server.Mobiles
Stop();
return;
}
- else if ( m_Owner.Weapon is Fists )
+
+ if ( m_Owner.Weapon is Fists )
{
m_Owner.Kill();
Stop();
diff --git a/Scripts/Mobiles/Guards/WarriorGuard.cs b/Scripts/Mobiles/Guards/WarriorGuard.cs
index 87f31801f..27f69419f 100644
--- a/Scripts/Mobiles/Guards/WarriorGuard.cs
+++ b/Scripts/Mobiles/Guards/WarriorGuard.cs
@@ -263,7 +263,8 @@ namespace Server.Mobiles
Stop();
return;
}
- else if ( m_Owner.Weapon is Fists )
+
+ if ( m_Owner.Weapon is Fists )
{
m_Owner.Kill();
Stop();
diff --git a/Scripts/Mobiles/Healers/Healer.cs b/Scripts/Mobiles/Healers/Healer.cs
index 4d9d55a77..fd2fe8ab0 100644
--- a/Scripts/Mobiles/Healers/Healer.cs
+++ b/Scripts/Mobiles/Healers/Healer.cs
@@ -43,12 +43,13 @@ namespace Server.Mobiles
Say( 501222 ); // Thou art a criminal. I shall not resurrect thee.
return false;
}
- else if ( m.Kills >= 5 )
+
+ if ( m.Kills >= 5 )
{
Say( 501223 ); // Thou'rt not a decent and good person. I shall not resurrect thee.
return false;
}
- else if ( m.Karma < 0 )
+ if ( m.Karma < 0 )
{
Say( 501224 ); // Thou hast strayed from the path of virtue, but thou still deservest a second chance.
}
diff --git a/Scripts/Mobiles/Healers/WanderingHealer.cs b/Scripts/Mobiles/Healers/WanderingHealer.cs
index 1880507a2..72ad34084 100644
--- a/Scripts/Mobiles/Healers/WanderingHealer.cs
+++ b/Scripts/Mobiles/Healers/WanderingHealer.cs
@@ -39,12 +39,13 @@ namespace Server.Mobiles
Say( 501222 ); // Thou art a criminal. I shall not resurrect thee.
return false;
}
- else if ( m.Kills >= 5 )
+
+ if ( m.Kills >= 5 )
{
Say( 501223 ); // Thou'rt not a decent and good person. I shall not resurrect thee.
return false;
}
- else if ( m.Karma < 0 )
+ if ( m.Karma < 0 )
{
Say( 501224 ); // Thou hast strayed from the path of virtue, but thou still deservest a second chance.
}
diff --git a/Scripts/Mobiles/Monsters/AOS/Revenant.cs b/Scripts/Mobiles/Monsters/AOS/Revenant.cs
index dbbd2cfa8..a47ef887c 100644
--- a/Scripts/Mobiles/Monsters/AOS/Revenant.cs
+++ b/Scripts/Mobiles/Monsters/AOS/Revenant.cs
@@ -91,7 +91,8 @@ namespace Server.Mobiles
Kill();
return;
}
- else if ( Map != m_Target.Map || !InRange( m_Target, 15 ) )
+
+ if ( Map != m_Target.Map || !InRange( m_Target, 15 ) )
{
Map fromMap = Map;
Point3D from = Location;
@@ -110,15 +111,13 @@ namespace Server.Mobiles
to = loc;
break;
}
- else
- {
- loc.Z = toMap.GetAverageZ( loc.X, loc.Y );
- if ( toMap.CanSpawnMobile( loc ) )
- {
- to = loc;
- break;
- }
+ loc.Z = toMap.GetAverageZ( loc.X, loc.Y );
+
+ if ( toMap.CanSpawnMobile( loc ) )
+ {
+ to = loc;
+ break;
}
}
}
diff --git a/Scripts/Mobiles/Monsters/Ants/BlackSolenInfiltratorQueen.cs b/Scripts/Mobiles/Monsters/Ants/BlackSolenInfiltratorQueen.cs
index ed072c832..2a26d908a 100644
--- a/Scripts/Mobiles/Monsters/Ants/BlackSolenInfiltratorQueen.cs
+++ b/Scripts/Mobiles/Monsters/Ants/BlackSolenInfiltratorQueen.cs
@@ -79,8 +79,7 @@ namespace Server.Mobiles
{
if ( SolenHelper.CheckBlackFriendship( m ) )
return false;
- else
- return base.IsEnemy( m );
+ return base.IsEnemy( m );
}
public override void OnDamage( int amount, Mobile from, bool willKill )
diff --git a/Scripts/Mobiles/Monsters/Ants/BlackSolenInfiltratorWarrior.cs b/Scripts/Mobiles/Monsters/Ants/BlackSolenInfiltratorWarrior.cs
index 6e64a8ba4..eac8cdf27 100644
--- a/Scripts/Mobiles/Monsters/Ants/BlackSolenInfiltratorWarrior.cs
+++ b/Scripts/Mobiles/Monsters/Ants/BlackSolenInfiltratorWarrior.cs
@@ -80,8 +80,7 @@ namespace Server.Mobiles
{
if ( SolenHelper.CheckBlackFriendship( m ) )
return false;
- else
- return base.IsEnemy( m );
+ return base.IsEnemy( m );
}
public override void OnDamage( int amount, Mobile from, bool willKill )
diff --git a/Scripts/Mobiles/Monsters/Ants/BlackSolenQueen.cs b/Scripts/Mobiles/Monsters/Ants/BlackSolenQueen.cs
index aa240125f..daee86897 100644
--- a/Scripts/Mobiles/Monsters/Ants/BlackSolenQueen.cs
+++ b/Scripts/Mobiles/Monsters/Ants/BlackSolenQueen.cs
@@ -86,8 +86,7 @@ namespace Server.Mobiles
{
if ( SolenHelper.CheckBlackFriendship( m ) )
return false;
- else
- return base.IsEnemy( m );
+ return base.IsEnemy( m );
}
public override void OnDamage( int amount, Mobile from, bool willKill )
diff --git a/Scripts/Mobiles/Monsters/Ants/BlackSolenWarrior.cs b/Scripts/Mobiles/Monsters/Ants/BlackSolenWarrior.cs
index 6dba169a7..532d690b4 100644
--- a/Scripts/Mobiles/Monsters/Ants/BlackSolenWarrior.cs
+++ b/Scripts/Mobiles/Monsters/Ants/BlackSolenWarrior.cs
@@ -87,8 +87,7 @@ namespace Server.Mobiles
{
if ( SolenHelper.CheckBlackFriendship( m ) )
return false;
- else
- return base.IsEnemy( m );
+ return base.IsEnemy( m );
}
public override void OnDamage( int amount, Mobile from, bool willKill )
diff --git a/Scripts/Mobiles/Monsters/Ants/BlackSolenWorker.cs b/Scripts/Mobiles/Monsters/Ants/BlackSolenWorker.cs
index e00105891..116f5b64a 100644
--- a/Scripts/Mobiles/Monsters/Ants/BlackSolenWorker.cs
+++ b/Scripts/Mobiles/Monsters/Ants/BlackSolenWorker.cs
@@ -80,8 +80,7 @@ namespace Server.Mobiles
{
if ( SolenHelper.CheckBlackFriendship( m ) )
return false;
- else
- return base.IsEnemy( m );
+ return base.IsEnemy( m );
}
public override void OnDamage( int amount, Mobile from, bool willKill )
diff --git a/Scripts/Mobiles/Monsters/Ants/RedSolenInfiltratorQueen.cs b/Scripts/Mobiles/Monsters/Ants/RedSolenInfiltratorQueen.cs
index 447ec2af2..70c5fd31e 100644
--- a/Scripts/Mobiles/Monsters/Ants/RedSolenInfiltratorQueen.cs
+++ b/Scripts/Mobiles/Monsters/Ants/RedSolenInfiltratorQueen.cs
@@ -78,8 +78,7 @@ namespace Server.Mobiles
{
if ( SolenHelper.CheckRedFriendship( m ) )
return false;
- else
- return base.IsEnemy( m );
+ return base.IsEnemy( m );
}
public override void OnDamage( int amount, Mobile from, bool willKill )
diff --git a/Scripts/Mobiles/Monsters/Ants/RedSolenInfiltratorWarrior.cs b/Scripts/Mobiles/Monsters/Ants/RedSolenInfiltratorWarrior.cs
index b5bf052fd..e51742e15 100644
--- a/Scripts/Mobiles/Monsters/Ants/RedSolenInfiltratorWarrior.cs
+++ b/Scripts/Mobiles/Monsters/Ants/RedSolenInfiltratorWarrior.cs
@@ -80,8 +80,7 @@ namespace Server.Mobiles
{
if ( SolenHelper.CheckRedFriendship( m ) )
return false;
- else
- return base.IsEnemy( m );
+ return base.IsEnemy( m );
}
public override void OnDamage( int amount, Mobile from, bool willKill )
diff --git a/Scripts/Mobiles/Monsters/Ants/RedSolenQueen.cs b/Scripts/Mobiles/Monsters/Ants/RedSolenQueen.cs
index 2e7ab3c59..2c6cce7d3 100644
--- a/Scripts/Mobiles/Monsters/Ants/RedSolenQueen.cs
+++ b/Scripts/Mobiles/Monsters/Ants/RedSolenQueen.cs
@@ -86,8 +86,7 @@ namespace Server.Mobiles
{
if ( SolenHelper.CheckRedFriendship( m ) )
return false;
- else
- return base.IsEnemy( m );
+ return base.IsEnemy( m );
}
public override void OnDamage( int amount, Mobile from, bool willKill )
diff --git a/Scripts/Mobiles/Monsters/Ants/RedSolenWarrior.cs b/Scripts/Mobiles/Monsters/Ants/RedSolenWarrior.cs
index 78ca5f9e3..b7a6d555e 100644
--- a/Scripts/Mobiles/Monsters/Ants/RedSolenWarrior.cs
+++ b/Scripts/Mobiles/Monsters/Ants/RedSolenWarrior.cs
@@ -86,8 +86,7 @@ namespace Server.Mobiles
{
if ( SolenHelper.CheckRedFriendship( m ) )
return false;
- else
- return base.IsEnemy( m );
+ return base.IsEnemy( m );
}
public override void OnDamage( int amount, Mobile from, bool willKill )
diff --git a/Scripts/Mobiles/Monsters/Ants/RedSolenWorker.cs b/Scripts/Mobiles/Monsters/Ants/RedSolenWorker.cs
index 18610e0ce..8b9a1007f 100644
--- a/Scripts/Mobiles/Monsters/Ants/RedSolenWorker.cs
+++ b/Scripts/Mobiles/Monsters/Ants/RedSolenWorker.cs
@@ -79,8 +79,7 @@ namespace Server.Mobiles
{
if ( SolenHelper.CheckRedFriendship( m ) )
return false;
- else
- return base.IsEnemy( m );
+ return base.IsEnemy( m );
}
public override void OnDamage( int amount, Mobile from, bool willKill )
diff --git a/Scripts/Mobiles/Monsters/Humanoid/Melee/KhaldunRevenant.cs b/Scripts/Mobiles/Monsters/Humanoid/Melee/KhaldunRevenant.cs
index a05fb86f8..b5612e8cb 100644
--- a/Scripts/Mobiles/Monsters/Humanoid/Melee/KhaldunRevenant.cs
+++ b/Scripts/Mobiles/Monsters/Humanoid/Melee/KhaldunRevenant.cs
@@ -48,7 +48,7 @@ namespace Server.Mobiles
public static bool IsInsideKhaldun( Mobile from )
{
- return @from?.Region != null && @from.Region.IsPartOf( "Khaldun" );
+ return from?.Region != null && from.Region.IsPartOf( "Khaldun" );
}
private Mobile m_Target;
diff --git a/Scripts/Mobiles/Monsters/ML/Labyrinth/Pyre.cs b/Scripts/Mobiles/Monsters/ML/Labyrinth/Pyre.cs
index 0cf02cf4a..9d15f9bb9 100644
--- a/Scripts/Mobiles/Monsters/ML/Labyrinth/Pyre.cs
+++ b/Scripts/Mobiles/Monsters/ML/Labyrinth/Pyre.cs
@@ -53,8 +53,7 @@ namespace Server.Mobiles
{
if ( Utility.RandomBool() )
return WeaponAbility.ParalyzingBlow;
- else
- return WeaponAbility.BleedAttack;
+ return WeaponAbility.BleedAttack;
}
public override bool GivesMLMinorArtifact => true;
diff --git a/Scripts/Mobiles/Monsters/ML/Labyrinth/Rend.cs b/Scripts/Mobiles/Monsters/ML/Labyrinth/Rend.cs
index 56ddfb188..34aa3b260 100644
--- a/Scripts/Mobiles/Monsters/ML/Labyrinth/Rend.cs
+++ b/Scripts/Mobiles/Monsters/ML/Labyrinth/Rend.cs
@@ -50,8 +50,7 @@ namespace Server.Mobiles
{
if ( Utility.RandomBool() )
return WeaponAbility.ParalyzingBlow;
- else
- return WeaponAbility.BleedAttack;
+ return WeaponAbility.BleedAttack;
}
public override bool GivesMLMinorArtifact => true;
diff --git a/Scripts/Mobiles/Monsters/Ore Elementals/ValoriteElemental.cs b/Scripts/Mobiles/Monsters/Ore Elementals/ValoriteElemental.cs
index e49ef6308..3651aba03 100644
--- a/Scripts/Mobiles/Monsters/Ore Elementals/ValoriteElemental.cs
+++ b/Scripts/Mobiles/Monsters/Ore Elementals/ValoriteElemental.cs
@@ -64,7 +64,7 @@ namespace Server.Mobiles
public override void AlterMeleeDamageFrom( Mobile from, ref int damage )
{
- if ( @from is BaseCreature bc )
+ if ( from is BaseCreature bc )
{
if ( bc.Controlled || bc.BardTarget == this )
damage = 0; // Immune to pets and provoked creatures
diff --git a/Scripts/Mobiles/Monsters/SE/Kappa.cs b/Scripts/Mobiles/Monsters/SE/Kappa.cs
index de2e1b0d5..6d4a71c62 100644
--- a/Scripts/Mobiles/Monsters/SE/Kappa.cs
+++ b/Scripts/Mobiles/Monsters/SE/Kappa.cs
@@ -144,7 +144,7 @@ namespace Server.Mobiles
public override void OnDamage( int amount, Mobile from, bool willKill )
{
- if ( @from?.Map != null )
+ if ( from?.Map != null )
{
int amt=0;
Mobile target = this;
diff --git a/Scripts/Mobiles/PlayerMobile.cs b/Scripts/Mobiles/PlayerMobile.cs
index e5b58cda9..69cb15751 100644
--- a/Scripts/Mobiles/PlayerMobile.cs
+++ b/Scripts/Mobiles/PlayerMobile.cs
@@ -93,7 +93,8 @@ namespace Server.Mobiles
{
return;
}
- else if (Flying)
+
+ if (Flying)
{
Freeze(TimeSpan.FromSeconds(1));
Animate(61, 10, 1, true, false, 0);
@@ -232,8 +233,7 @@ namespace Server.Mobiles
{
if ( AccessLevel >= AccessLevel.GameMaster )
return Guilds.RankDefinition.Leader;
- else
- return m_GuildRank;
+ return m_GuildRank;
}
set => m_GuildRank = value;
}
@@ -880,7 +880,7 @@ namespace Server.Mobiles
{
string notice;
- if ( !(@from.Account is Account acct) || !acct.HasAccess( from.NetState ) )
+ if ( !(from.Account is Account acct) || !acct.HasAccess( from.NetState ) )
{
if ( from.AccessLevel == AccessLevel.Player )
notice = "The server is currently under lockdown. No players are allowed to log in at this time.";
@@ -902,7 +902,7 @@ namespace Server.Mobiles
return;
}
- if ( @from is PlayerMobile mobile )
+ if ( from is PlayerMobile mobile )
mobile.ClaimAutoStabledPets();
}
@@ -2526,10 +2526,10 @@ namespace Server.Mobiles
WeightOverloading.FatigueOnDamage( this, amount );
- m_ReceivedHonorContext?.OnTargetDamaged( @from, amount );
- m_SentHonorContext?.OnSourceDamaged( @from, amount );
+ m_ReceivedHonorContext?.OnTargetDamaged( from, amount );
+ m_SentHonorContext?.OnSourceDamaged( from, amount );
- if ( willKill && @from is PlayerMobile mobile )
+ if ( willKill && from is PlayerMobile mobile )
Timer.DelayCall( TimeSpan.FromSeconds( 10 ), mobile.RecoverAmmo );
base.OnDamage( amount, from, willKill );
@@ -2857,18 +2857,16 @@ namespace Server.Mobiles
{
return true;
}
- else
- {
- for (int i = 0; i < m_StuckMenuUses.Length; ++i)
- {
- if ((DateTime.UtcNow - m_StuckMenuUses[i]) > TimeSpan.FromDays(1.0))
- {
- return true;
- }
- }
- return false;
+ for (int i = 0; i < m_StuckMenuUses.Length; ++i)
+ {
+ if ((DateTime.UtcNow - m_StuckMenuUses[i]) > TimeSpan.FromDays(1.0))
+ {
+ return true;
+ }
}
+
+ return false;
}
public void UsedStuckMenu()
@@ -3218,8 +3216,7 @@ namespace Server.Mobiles
++count.Count;
if ( count.Count <= SkillCheck.Allowance )
return true;
- else
- return false;
+ return false;
}
tbl[obj] = count = new CountAndTimeStamp();
@@ -3716,8 +3713,7 @@ namespace Server.Mobiles
{
if ( NetState != null )
return m_GameTime + (DateTime.UtcNow - m_SessionStart);
- else
- return m_GameTime;
+ return m_GameTime;
}
}
@@ -4388,7 +4384,7 @@ namespace Server.Mobiles
if ( Region is BaseRegion region && !region.YoungProtected )
return false;
- if ( @from is BaseCreature creature && creature.IgnoreYoungProtection )
+ if ( from is BaseCreature creature && creature.IgnoreYoungProtection )
return false;
if ( Quest != null && Quest.IgnoreYoungProtection( from ) )
diff --git a/Scripts/Mobiles/Special/BaseChampion.cs b/Scripts/Mobiles/Special/BaseChampion.cs
index 37ac0b5ca..f6c98bd0e 100644
--- a/Scripts/Mobiles/Special/BaseChampion.cs
+++ b/Scripts/Mobiles/Special/BaseChampion.cs
@@ -50,10 +50,11 @@ namespace Server.Mobiles
double random = Utility.RandomDouble();
if ( 0.05 >= random )
return CreateArtifact( UniqueList );
- else if ( 0.15 >= random )
+ if ( 0.15 >= random )
return CreateArtifact( SharedList );
- else if ( 0.30 >= random )
+ if ( 0.30 >= random )
return CreateArtifact( DecorativeList );
+
return null;
}
@@ -169,15 +170,13 @@ namespace Server.Mobiles
m.AddToBackpack( ps );
}
- if ( m is PlayerMobile )
+ if ( m is PlayerMobile pm )
{
- PlayerMobile pm = (PlayerMobile)m;
-
for( int j = 0; j < pm.JusticeProtectors.Count; ++j )
{
Mobile prot = pm.JusticeProtectors[j];
- if ( prot.Map != m.Map || prot.Kills >= 5 || prot.Criminal || !JusticeVirtue.CheckMapRegion( m, prot ) )
+ if ( prot.Map != pm.Map || prot.Kills >= 5 || prot.Criminal || !JusticeVirtue.CheckMapRegion( pm, prot ) )
continue;
int chance = 0;
diff --git a/Scripts/Mobiles/Special/Harrower.cs b/Scripts/Mobiles/Special/Harrower.cs
index 714e5600c..bbd2404cb 100644
--- a/Scripts/Mobiles/Special/Harrower.cs
+++ b/Scripts/Mobiles/Special/Harrower.cs
@@ -291,15 +291,13 @@ namespace Server.Mobiles
m.SendLocalizedMessage( 1049524 ); // You have received a scroll of power!
m.AddToBackpack( new StatCapScroll( 225 + level ) );
- if ( m is PlayerMobile )
+ if ( m is PlayerMobile pm )
{
- PlayerMobile pm = (PlayerMobile)m;
-
for ( int j = 0; j < pm.JusticeProtectors.Count; ++j )
{
- Mobile prot = (Mobile)pm.JusticeProtectors[j];
+ Mobile prot = pm.JusticeProtectors[j];
- if ( prot.Map != m.Map || prot.Kills >= 5 || prot.Criminal || !JusticeVirtue.CheckMapRegion( m, prot ) )
+ if ( prot.Map != pm.Map || prot.Kills >= 5 || prot.Criminal || !JusticeVirtue.CheckMapRegion( pm, prot ) )
continue;
int chance = 0;
@@ -377,11 +375,9 @@ namespace Server.Mobiles
return base.OnBeforeDeath();
}
- else
- {
- Morph();
- return false;
- }
+
+ Morph();
+ return false;
}
Dictionary m_DamageEntries;
@@ -414,7 +410,7 @@ namespace Server.Mobiles
else
m_DamageEntries.Add( from, amount );
- from.SendMessage($"Total Damage: {m_DamageEntries[@from]}");
+ from.SendMessage($"Total Damage: {m_DamageEntries[from]}");
}
public void AwardArtifact( Item artifact )
@@ -476,10 +472,11 @@ namespace Server.Mobiles
double random = Utility.RandomDouble();
if ( 0.05 >= random )
return CreateArtifact( UniqueList );
- else if ( 0.15 >= random )
+ if ( 0.15 >= random )
return CreateArtifact( SharedList );
- else if ( 0.30 >= random )
+ if ( 0.30 >= random )
return CreateArtifact( DecorativeList );
+
return null;
}
@@ -560,15 +557,13 @@ namespace Server.Mobiles
to = new Point3D( x, y, m_Owner.Z );
break;
}
- else
- {
- int z = map.GetAverageZ( x, y );
- if ( map.CanSpawnMobile( x, y, z ) )
- {
- to = new Point3D( x, y, z );
- break;
- }
+ int z = map.GetAverageZ( x, y );
+
+ if ( map.CanSpawnMobile( x, y, z ) )
+ {
+ to = new Point3D( x, y, z );
+ break;
}
}
diff --git a/Scripts/Mobiles/Special/HarrowerTentacles.cs b/Scripts/Mobiles/Special/HarrowerTentacles.cs
index f200f0cb6..89c0c84a0 100644
--- a/Scripts/Mobiles/Special/HarrowerTentacles.cs
+++ b/Scripts/Mobiles/Special/HarrowerTentacles.cs
@@ -176,10 +176,8 @@ namespace Server.Mobiles
if ( m == m_Owner || m == m_Owner.Harrower || !m_Owner.CanBeHarmful( m ) )
continue;
- if ( m is BaseCreature )
+ if ( m is BaseCreature bc )
{
- BaseCreature bc = m as BaseCreature;
-
if ( bc.Controlled || bc.Summoned )
m_ToDrain.Add( m );
}
diff --git a/Scripts/Mobiles/Townfolk/BaseEscortable.cs b/Scripts/Mobiles/Townfolk/BaseEscortable.cs
index 5d54fe960..60dd50d65 100644
--- a/Scripts/Mobiles/Townfolk/BaseEscortable.cs
+++ b/Scripts/Mobiles/Townfolk/BaseEscortable.cs
@@ -71,8 +71,7 @@ namespace Server.Mobiles
}
}
- List result = new List();
- result.Add( m_MLQuest );
+ List result = new List { m_MLQuest };
return result;
}
@@ -105,7 +104,7 @@ namespace Server.Mobiles
[CommandProperty(AccessLevel.GameMaster)]
public string Destination
{
- get => m_Destination == null ? null : m_Destination.Name;
+ get => m_Destination?.Name;
set { m_DestinationString = value; m_Destination = EDI.Find(value); }
}
@@ -220,7 +219,8 @@ namespace Server.Mobiles
Say("I am looking to go to {0}, will you take me?", (dest.Name == "Ocllo" && m.Map == Map.Trammel) ? "Haven" : dest.Name);
return true;
}
- else if (escorter == m)
+
+ if (escorter == m)
{
Say("Lead on! Payment will be made when we arrive in {0}.", (dest.Name == "Ocllo" && m.Map == Map.Trammel) ? "Haven" : dest.Name);
return true;
@@ -252,14 +252,15 @@ namespace Server.Mobiles
Say("I see you already have an escort.");
return false;
}
- else if (m is PlayerMobile && (((PlayerMobile)m).LastEscortTime + EscortDelay) >= DateTime.UtcNow)
+
+ if (m is PlayerMobile && (((PlayerMobile)m).LastEscortTime + EscortDelay) >= DateTime.UtcNow)
{
int minutes = (int)Math.Ceiling(((((PlayerMobile)m).LastEscortTime + EscortDelay) - DateTime.UtcNow).TotalMinutes);
Say("You must rest {0} minute{1} before we set out on this journey.", minutes, minutes == 1 ? "" : "s");
return false;
}
- else if (SetControlMaster(m))
+ if (SetControlMaster(m))
{
m_LastSeenEscorter = DateTime.UtcNow;
@@ -391,11 +392,9 @@ namespace Server.Mobiles
Timer.DelayCall(TimeSpan.FromSeconds(5.0), Delete);
return null;
}
- else
- {
- ControlOrder = OrderType.Stay;
- return master;
- }
+
+ ControlOrder = OrderType.Stay;
+ return master;
}
if (ControlOrder != OrderType.Follow)
@@ -585,8 +584,7 @@ namespace Server.Mobiles
{
if (!Core.ML)
return m_TownNames;
- else
- return m_MLTownNames;
+ return m_MLTownNames;
}
public virtual string PickRandomDestination()
diff --git a/Scripts/Mobiles/Townfolk/SeekerOfAdventure.cs b/Scripts/Mobiles/Townfolk/SeekerOfAdventure.cs
index 4c91068d6..bd3934033 100644
--- a/Scripts/Mobiles/Townfolk/SeekerOfAdventure.cs
+++ b/Scripts/Mobiles/Townfolk/SeekerOfAdventure.cs
@@ -20,8 +20,7 @@ namespace Server.Mobiles
{
if ( Core.ML )
return m_MLDestinations;
- else
- return m_Dungeons;
+ return m_Dungeons;
}
[Constructible]
diff --git a/Scripts/Mobiles/Vendors/GenericSell.cs b/Scripts/Mobiles/Vendors/GenericSell.cs
index d2da566a5..cda000922 100644
--- a/Scripts/Mobiles/Vendors/GenericSell.cs
+++ b/Scripts/Mobiles/Vendors/GenericSell.cs
@@ -97,8 +97,7 @@ namespace Server.Mobiles
{
if ( item.Name != null )
return item.Name;
- else
- return item.LabelNumber.ToString();
+ return item.LabelNumber.ToString();
}
public bool IsSellable( Item item )
diff --git a/Scripts/Mobiles/Vendors/NPC/AnimalTrainer.cs b/Scripts/Mobiles/Vendors/NPC/AnimalTrainer.cs
index c3ad9546c..29c9dcb15 100644
--- a/Scripts/Mobiles/Vendors/NPC/AnimalTrainer.cs
+++ b/Scripts/Mobiles/Vendors/NPC/AnimalTrainer.cs
@@ -230,7 +230,7 @@ namespace Server.Mobiles
from.Stabled.Remove( pet );
- (@from as PlayerMobile)?.AutoStabled.Remove( pet );
+ (from as PlayerMobile)?.AutoStabled.Remove( pet );
}
else
{
@@ -373,7 +373,7 @@ namespace Server.Mobiles
from.Stabled.RemoveAt( i );
- (@from as PlayerMobile)?.AutoStabled.Remove( pet );
+ (from as PlayerMobile)?.AutoStabled.Remove( pet );
--i;
@@ -468,4 +468,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
-}
\ No newline at end of file
+}
diff --git a/Scripts/Mobiles/Vendors/NPC/Guildmasters/ThiefGuildmaster.cs b/Scripts/Mobiles/Vendors/NPC/Guildmasters/ThiefGuildmaster.cs
index c2ccf1d27..993af8baf 100644
--- a/Scripts/Mobiles/Vendors/NPC/Guildmasters/ThiefGuildmaster.cs
+++ b/Scripts/Mobiles/Vendors/NPC/Guildmasters/ThiefGuildmaster.cs
@@ -40,12 +40,13 @@ namespace Server.Mobiles
SayTo( pm, 502089 ); // You cannot be a member of the Thieves' Guild while you are Young.
return false;
}
- else if ( pm.Kills > 0 )
+
+ if ( pm.Kills > 0 )
{
SayTo( pm, 501050 ); // This guild is for cunning thieves, not oafish cutthroats.
return false;
}
- else if ( pm.Skills[SkillName.Stealing].Base < 60.0 )
+ if ( pm.Skills[SkillName.Stealing].Base < 60.0 )
{
SayTo( pm, 501051 ); // You must be at least a journeyman pickpocket to join this elite organization.
return false;
diff --git a/Scripts/Mobiles/Vendors/NPC/RealEstateBroker.cs b/Scripts/Mobiles/Vendors/NPC/RealEstateBroker.cs
index fa92473ec..70723af5f 100644
--- a/Scripts/Mobiles/Vendors/NPC/RealEstateBroker.cs
+++ b/Scripts/Mobiles/Vendors/NPC/RealEstateBroker.cs
@@ -82,17 +82,13 @@ namespace Server.Mobiles
deed.Delete();
return true;
}
- else
- {
- PublicOverheadMessage( MessageType.Regular, 0x3B2, 500390 ); // Your bank box is full.
- return false;
- }
- }
- else
- {
- PublicOverheadMessage( MessageType.Regular, 0x3B2, 500607 ); // I'm not interested in that.
+
+ PublicOverheadMessage( MessageType.Regular, 0x3B2, 500390 ); // Your bank box is full.
return false;
}
+
+ PublicOverheadMessage( MessageType.Regular, 0x3B2, 500607 ); // I'm not interested in that.
+ return false;
}
return base.OnDragDrop (from, dropped);
diff --git a/Scripts/Mobiles/Vendors/PlayerBarkeeper.cs b/Scripts/Mobiles/Vendors/PlayerBarkeeper.cs
index b63bbc808..97b503891 100644
--- a/Scripts/Mobiles/Vendors/PlayerBarkeeper.cs
+++ b/Scripts/Mobiles/Vendors/PlayerBarkeeper.cs
@@ -935,7 +935,7 @@ namespace Server.Mobiles
AddHtml( 250, 95, 500, 20, "Change this tip message", false, false );
AddHtml( 100, 190, 50, 20, "Message", false, false );
- AddHtml( 100, 210, 450, 40, m_Barkeeper.TipMessage == null ? "No current message" : m_Barkeeper.TipMessage, true, false );
+ AddHtml( 100, 210, 450, 40, m_Barkeeper.TipMessage ?? "No current message", true, false );
AddButton( 60, 210, 4005, 4007, GetButtonID( 3, 0 ), GumpButtonType.Reply, 0 );
@@ -951,7 +951,7 @@ namespace Server.Mobiles
AddHtml( 250, 95, 500, 20, "Remove this tip message", false, false );
AddHtml( 100, 190, 50, 20, "Message", false, false );
- AddHtml( 100, 210, 450, 40, m_Barkeeper.TipMessage == null ? "No current message" : m_Barkeeper.TipMessage, true, false );
+ AddHtml( 100, 210, 450, 40, m_Barkeeper.TipMessage ?? "No current message", true, false );
AddButton( 60, 210, 4005, 4007, GetButtonID( 4, 0 ), GumpButtonType.Reply, 0 );
diff --git a/Scripts/Mobiles/Vendors/PlayerVendor.cs b/Scripts/Mobiles/Vendors/PlayerVendor.cs
index 9b73cee87..0bb7a5917 100644
--- a/Scripts/Mobiles/Vendors/PlayerVendor.cs
+++ b/Scripts/Mobiles/Vendors/PlayerVendor.cs
@@ -568,21 +568,19 @@ namespace Server.Mobiles
{
return ChargePerRealWorldDay / 12;
}
- else
+
+ long total = 0;
+ foreach ( VendorItem vi in m_SellItems.Values )
{
- long total = 0;
- foreach ( VendorItem vi in m_SellItems.Values )
- {
- total += vi.Price;
- }
-
- total -= 500;
-
- if ( total < 0 )
- total = 0;
-
- return (int)( 20 + (total / 500) );
+ total += vi.Price;
}
+
+ total -= 500;
+
+ if ( total < 0 )
+ total = 0;
+
+ return (int)( 20 + (total / 500) );
}
}
@@ -600,10 +598,8 @@ namespace Server.Mobiles
return (int)( 60 + (total / 500) * 3 );
}
- else
- {
- return ChargePerDay * 12;
- }
+
+ return ChargePerDay * 12;
}
}
@@ -616,10 +612,8 @@ namespace Server.Mobiles
{
return House.IsOwner( m );
}
- else
- {
- return m == Owner;
- }
+
+ return m == Owner;
}
protected List- GetItems()
@@ -883,49 +877,39 @@ namespace Server.Mobiles
return true;
}
- else
- {
- from.SendLocalizedMessage( 1062493 ); // Your vendor has sufficient funds for operation and cannot accept this gold.
- return false;
- }
+ from.SendLocalizedMessage( 1062493 ); // Your vendor has sufficient funds for operation and cannot accept this gold.
+
+ return false;
}
- else
+
+ if ( BankAccount < 1000000 )
{
- if ( BankAccount < 1000000 )
- {
- SayTo( from, 503210 ); // I'll take that to fund my services.
+ SayTo( from, 503210 ); // I'll take that to fund my services.
- BankAccount += item.Amount;
- item.Delete();
-
- return true;
- }
- else
- {
- from.SendLocalizedMessage( 1062493 ); // Your vendor has sufficient funds for operation and cannot accept this gold.
-
- return false;
- }
- }
- }
- else
- {
- bool newItem = ( GetVendorItem( item ) == null );
-
- if ( Backpack != null && Backpack.TryDropItem( from, item, false ) )
- {
- if ( newItem )
- OnItemGiven( from, item );
+ BankAccount += item.Amount;
+ item.Delete();
return true;
}
- else
- {
- SayTo( from, 503211 ); // I can't carry any more.
- return false;
- }
+
+ from.SendLocalizedMessage( 1062493 ); // Your vendor has sufficient funds for operation and cannot accept this gold.
+
+ return false;
}
+
+ bool newItem = ( GetVendorItem( item ) == null );
+
+ if ( Backpack != null && Backpack.TryDropItem( from, item, false ) )
+ {
+ if ( newItem )
+ OnItemGiven( from, item );
+
+ return true;
+ }
+
+ SayTo( from, 503211 ); // I can't carry any more.
+ return false;
}
public override bool CheckNonlocalDrop( Mobile from, Item item, Item target )
@@ -940,11 +924,9 @@ namespace Server.Mobiles
return true;
}
- else
- {
- SayTo( from, 503209 ); // I can only take item from the shop owner.
- return false;
- }
+
+ SayTo( from, 503209 ); // I can only take item from the shop owner.
+ return false;
}
private void NonLocalDropCallback( object state )
@@ -990,13 +972,12 @@ namespace Server.Mobiles
{
return true;
}
- else
- {
- SayTo( from, 503223 ); // If you'd like to purchase an item, just ask.
- return false;
- }
+
+ SayTo( from, 503223 ); // If you'd like to purchase an item, just ask.
+ return false;
}
- else if ( BaseHouse.NewVendorSystem && IsOwner( from ) )
+
+ if ( BaseHouse.NewVendorSystem && IsOwner( from ) )
{
return true;
}
@@ -1359,8 +1340,7 @@ namespace Server.Mobiles
{
if ( BaseHouse.NewVendorSystem )
return TimeSpan.FromDays( 1.0 );
- else
- return TimeSpan.FromMinutes( Clock.MinutesPerUODay );
+ return TimeSpan.FromMinutes( Clock.MinutesPerUODay );
}
private PlayerVendor m_Vendor;
diff --git a/Scripts/Multis/BaseHouse.cs b/Scripts/Multis/BaseHouse.cs
index d9c759d44..9d5c2fb40 100644
--- a/Scripts/Multis/BaseHouse.cs
+++ b/Scripts/Multis/BaseHouse.cs
@@ -209,15 +209,15 @@ namespace Server.Multis
if ( percent >= 1000 ) // 100.0%
return ( HasRentedVendors || VendorInventories.Count > 0 ) ? DecayLevel.DemolitionPending : DecayLevel.Collapsed;
- else if ( percent >= 950 ) // 95.0% - 99.9%
+ if ( percent >= 950 ) // 95.0% - 99.9%
return DecayLevel.IDOC;
- else if ( percent >= 750 ) // 75.0% - 94.9%
+ if ( percent >= 750 ) // 75.0% - 94.9%
return DecayLevel.Greatly;
- else if ( percent >= 500 ) // 50.0% - 74.9%
+ if ( percent >= 500 ) // 50.0% - 74.9%
return DecayLevel.Fairly;
- else if ( percent >= 250 ) // 25.0% - 49.9%
+ if ( percent >= 250 ) // 25.0% - 49.9%
return DecayLevel.Somewhat;
- else if ( percent >= 005 ) // 00.5% - 24.9%
+ if ( percent >= 005 ) // 00.5% - 24.9%
return DecayLevel.Slightly;
return DecayLevel.LikeNew;
@@ -1108,37 +1108,37 @@ namespace Server.Multis
if ( !IsLockedDown( item ) )
return true;
- else if ( from.AccessLevel >= AccessLevel.GameMaster )
+ if ( from.AccessLevel >= AccessLevel.GameMaster )
return true;
- else if ( item is Runebook )
+ if ( item is Runebook )
return true;
- else if ( item is ISecurable )
+ if ( item is ISecurable )
return HasSecureAccess( from, ((ISecurable)item).Level );
- else if ( item is Container )
+ if ( item is Container )
return IsCoOwner( from );
- else if ( item.Stackable )
+ if ( item.Stackable )
return true;
- else if ( item is BaseLight )
+ if ( item is BaseLight )
return IsFriend( from );
- else if ( item is PotionKeg )
+ if ( item is PotionKeg )
return IsFriend( from );
- else if ( item is BaseBoard )
+ if ( item is BaseBoard )
return true;
- else if ( item is Dices )
+ if ( item is Dices )
return true;
- else if ( item is RecallRune )
+ if ( item is RecallRune )
return true;
- else if ( item is TreasureMap )
+ if ( item is TreasureMap )
return true;
- else if ( item is Clock )
+ if ( item is Clock )
return true;
- else if ( item is BaseInstrument )
+ if ( item is BaseInstrument )
return true;
- else if ( item is Dyes || item is DyeTub )
+ if ( item is Dyes || item is DyeTub )
return true;
- else if ( item is VendorRentalContract )
+ if ( item is VendorRentalContract )
return true;
- else if ( item is RewardBrazier )
+ if ( item is RewardBrazier )
return true;
return false;
@@ -1473,8 +1473,7 @@ namespace Server.Multis
{
if ( wood )
return new DarkWoodHouseDoor( facing );
- else
- return new MetalHouseDoor( facing );
+ return new MetalHouseDoor( facing );
}
public void AddDoor( BaseDoor door, int xoff, int yoff, int zoff )
@@ -1663,7 +1662,7 @@ namespace Server.Multis
houseName = ( m_House == null ? "an unnamed house" : m_House.Sign.GetName() );
- Mobile houseOwner = ( m_House == null ? null : m_House.Owner );
+ Mobile houseOwner = m_House?.Owner;
if ( houseOwner == null )
owner = "nobody";
@@ -1709,7 +1708,7 @@ namespace Server.Multis
{
if ( !base.AllowSecureTrade( from, to, newOwner, accepted ) )
return false;
- else if ( !accepted )
+ if ( !accepted )
return true;
if ( Deleted || m_House == null || m_House.Deleted || !m_House.IsOwner( from ) || !from.CheckAlive() || !to.CheckAlive() )
@@ -1758,7 +1757,7 @@ namespace Server.Multis
{
bool isValid = true;
Item sign = m_Sign;
- Point3D p = ( sign == null ? Point3D.Zero : sign.GetWorldLocation() );
+ Point3D p = sign?.GetWorldLocation() ?? Point3D.Zero;
if ( from.Map != Map || to.Map != Map )
isValid = false;
@@ -2945,7 +2944,7 @@ namespace Server.Multis
if ( info.Item.Deleted )
continue;
- else if ( info.Item is StrongBox )
+ if ( info.Item is StrongBox )
count += 1;
else
count += 125;
@@ -2970,7 +2969,7 @@ namespace Server.Multis
if ( info.Item.Deleted )
continue;
- else if ( !(info.Item is StrongBox) )
+ if ( !(info.Item is StrongBox) )
count += 1;
}
}
diff --git a/Scripts/Multis/Boats/BaseBoat.cs b/Scripts/Multis/Boats/BaseBoat.cs
index 5128f2dce..960555ffb 100644
--- a/Scripts/Multis/Boats/BaseBoat.cs
+++ b/Scripts/Multis/Boats/BaseBoat.cs
@@ -649,7 +649,8 @@ namespace Server.Multis
return;
}
- else if ( !from.Alive )
+
+ if ( !from.Alive )
{
m_TillerMan?.Say( 502582 ); // You appear to be dead.
@@ -765,7 +766,8 @@ namespace Server.Multis
return;
}
- else if ( !e.Mobile.Alive )
+
+ if ( !e.Mobile.Alive )
{
m_TillerMan?.Say( 502582 ); // You appear to be dead.
@@ -819,7 +821,8 @@ namespace Server.Multis
return;
}
- else if ( !m.Alive )
+
+ if ( !m.Alive )
{
m_TillerMan?.Say( 502582 ); // You appear to be dead.
@@ -940,21 +943,22 @@ namespace Server.Multis
return false;
}
- else if ( MapItem == null || MapItem.Deleted )
+
+ if ( MapItem == null || MapItem.Deleted )
{
if ( message )
TillerMan?.Say( 502513 ); // I have seen no map, sir.
return false;
}
- else if ( Map != MapItem.Map || !Contains( MapItem.GetWorldLocation() ) )
+ if ( Map != MapItem.Map || !Contains( MapItem.GetWorldLocation() ) )
{
if ( message )
TillerMan?.Say( 502514 ); // The map is too far away from me, sir.
return false;
}
- else if ( ( Map != Map.Trammel && Map != Map.Felucca ) || NextNavPoint < 0 || NextNavPoint >= MapItem.Pins.Count )
+ if ( ( Map != Map.Trammel && Map != Map.Felucca ) || NextNavPoint < 0 || NextNavPoint >= MapItem.Pins.Count )
{
if ( message )
TillerMan?.Say( 1042551 ); // I don't see that navpoint, sir.
@@ -1055,24 +1059,22 @@ namespace Server.Multis
return false;
}
- else
+
+ if ( m_MoveTimer != null && Order != BoatOrder.Move )
{
- if ( m_MoveTimer != null && Order != BoatOrder.Move )
- {
- m_MoveTimer.Stop();
- m_MoveTimer = null;
- }
-
- m_TurnTimer?.Stop();
-
- m_TurnTimer = new TurnTimer( this, offset );
- m_TurnTimer.Start();
-
- if ( message )
- TillerMan?.Say( 501429 ); // Aye aye sir.
-
- return true;
+ m_MoveTimer.Stop();
+ m_MoveTimer = null;
}
+
+ m_TurnTimer?.Stop();
+
+ m_TurnTimer = new TurnTimer( this, offset );
+ m_TurnTimer.Start();
+
+ if ( message )
+ TillerMan?.Say( 501429 ); // Aye aye sir.
+
+ return true;
}
public bool Turn( int offset, bool message )
@@ -1093,17 +1095,15 @@ namespace Server.Multis
return false;
}
- else if ( SetFacing( (Direction)(((int)m_Facing + offset) & 0x7) ) )
+
+ if ( SetFacing( (Direction)(((int)m_Facing + offset) & 0x7) ) )
{
return true;
}
- else
- {
- if ( message )
- m_TillerMan.Say( 501423 ); // Ar, can't turn sir.
+ if ( message )
+ m_TillerMan.Say( 501423 ); // Ar, can't turn sir.
- return false;
- }
+ return false;
}
private class TurnTimer : Timer
@@ -1239,7 +1239,7 @@ namespace Server.Multis
if ( x >= 0 && x < newComponents.Width && y >= 0 && y < newComponents.Height && newComponents.Tiles[x][y].Length == 0 )
continue;
- else if ( Contains( item ) )
+ if ( Contains( item ) )
continue;
eable.Free();
@@ -1303,10 +1303,9 @@ namespace Server.Multis
{
if ( m == Map.Ilshenar )
return m_IlshWrap;
- else if ( m == Map.Tokuno )
+ if ( m == Map.Tokuno )
return m_TokunoWrap;
- else
- return m_BritWrap;
+ return m_BritWrap;
}
public Direction GetMovementFor( int x, int y, out int maxSpeed )
@@ -1390,20 +1389,18 @@ namespace Server.Multis
return false;
}
- else
- {
- NextNavPoint = -1;
- if ( message && Order == BoatOrder.Course )
- TillerMan?.Say( 502515 ); // The course is completed, sir.
+ NextNavPoint = -1;
- return false;
- }
+ if ( message && Order == BoatOrder.Course )
+ TillerMan?.Say( 502515 ); // The course is completed, sir.
+
+ return false;
}
if ( dir == Left || dir == BackwardLeft || dir == Backward )
return Turn( -2, true );
- else if ( dir == Right || dir == BackwardRight )
+ if ( dir == Right || dir == BackwardRight )
return Turn( 2, true );
speed = Math.Min( Speed, maxSpeed );
diff --git a/Scripts/Multis/Boats/BaseBoatDeed.cs b/Scripts/Multis/Boats/BaseBoatDeed.cs
index 9498f6600..989119336 100644
--- a/Scripts/Multis/Boats/BaseBoatDeed.cs
+++ b/Scripts/Multis/Boats/BaseBoatDeed.cs
@@ -95,7 +95,8 @@ namespace Server.Multis
{
return;
}
- else if ( !IsChildOf( from.Backpack ) )
+
+ if ( !IsChildOf( from.Backpack ) )
{
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
}
@@ -182,4 +183,4 @@ namespace Server.Multis
}
}
}
-}
\ No newline at end of file
+}
diff --git a/Scripts/Multis/Boats/BaseDockedBoat.cs b/Scripts/Multis/Boats/BaseDockedBoat.cs
index bf7114ad3..38dc4a582 100644
--- a/Scripts/Multis/Boats/BaseDockedBoat.cs
+++ b/Scripts/Multis/Boats/BaseDockedBoat.cs
@@ -117,7 +117,8 @@ namespace Server.Multis
{
return;
}
- else if ( !IsChildOf( from.Backpack ) )
+
+ if ( !IsChildOf( from.Backpack ) )
{
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
}
@@ -193,4 +194,4 @@ namespace Server.Multis
}
}
}
-}
\ No newline at end of file
+}
diff --git a/Scripts/Multis/Boats/Plank.cs b/Scripts/Multis/Boats/Plank.cs
index f0d34d213..a7bc898c9 100644
--- a/Scripts/Multis/Boats/Plank.cs
+++ b/Scripts/Multis/Boats/Plank.cs
@@ -201,10 +201,8 @@ namespace Server.Items
return true;
}
- else
- {
- return false;
- }
+
+ return false;
}
public bool CanClose()
diff --git a/Scripts/Multis/Boats/Strandedness.cs b/Scripts/Multis/Boats/Strandedness.cs
index 5c61b5041..a44ac7869 100644
--- a/Scripts/Multis/Boats/Strandedness.cs
+++ b/Scripts/Multis/Boats/Strandedness.cs
@@ -101,7 +101,9 @@ namespace Server.Misc
return (id >= 168 && id <= 171)
|| (id >= 310 && id <= 311);
- } else if ( surface is StaticTile ) {
+ }
+
+ if ( surface is StaticTile ) {
int id = ((StaticTile)surface).ID;
return (id >= 0x1796 && id <= 0x17B2);
diff --git a/Scripts/Multis/Boats/TillerMan.cs b/Scripts/Multis/Boats/TillerMan.cs
index f7b2e19d9..049b01d80 100644
--- a/Scripts/Multis/Boats/TillerMan.cs
+++ b/Scripts/Multis/Boats/TillerMan.cs
@@ -67,7 +67,7 @@ namespace Server.Items
m_Boat.BeginRename( from );
else
{
- m_Boat?.BeginDryDock( @from );
+ m_Boat?.BeginDryDock( from );
}
}
@@ -115,4 +115,4 @@ namespace Server.Items
}
}
}
-}
\ No newline at end of file
+}
diff --git a/Scripts/Multis/HouseFoundation.cs b/Scripts/Multis/HouseFoundation.cs
index ce25f83cb..81aecdcaf 100644
--- a/Scripts/Multis/HouseFoundation.cs
+++ b/Scripts/Multis/HouseFoundation.cs
@@ -648,7 +648,9 @@ namespace Server.Multis
{
if ( !m.CheckAlive() ) {
return;
- } else if ( SpellHelper.CheckCombat( m ) ) {
+ }
+
+ if ( SpellHelper.CheckCombat( m ) ) {
m.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
return;
}
@@ -1063,8 +1065,7 @@ namespace Server.Multis
if ( mcl.Width >= 14 || mcl.Height >= 14 )
return 4;
- else
- return 3;
+ return 3;
}
}
@@ -1121,7 +1122,7 @@ namespace Server.Multis
if ( !roof && ( TileData.ItemTable[itemID].Flags & TileFlag.Roof ) != 0 )
return false;
- else if ( roof && ( TileData.ItemTable[itemID].Flags & TileFlag.Roof ) == 0 )
+ if ( roof && ( TileData.ItemTable[itemID].Flags & TileFlag.Roof ) == 0 )
return false;
return Verification.IsItemValid( itemID );
@@ -1853,62 +1854,62 @@ namespace Server.Multis
{
if ( itemID >= 0x675 && itemID < 0x6F5 )
return true;
- else if ( itemID >= 0x314 && itemID < 0x364 )
+ if ( itemID >= 0x314 && itemID < 0x364 )
return true;
- else if ( itemID >= 0x824 && itemID < 0x834 )
+ if ( itemID >= 0x824 && itemID < 0x834 )
return true;
- else if ( itemID >= 0x839 && itemID < 0x849 )
+ if ( itemID >= 0x839 && itemID < 0x849 )
return true;
- else if ( itemID >= 0x84C && itemID < 0x85C )
+ if ( itemID >= 0x84C && itemID < 0x85C )
return true;
- else if ( itemID >= 0x866 && itemID < 0x876 )
+ if ( itemID >= 0x866 && itemID < 0x876 )
return true;
- else if ( itemID >= 0x0E8 && itemID < 0x0F8 )
+ if ( itemID >= 0x0E8 && itemID < 0x0F8 )
return true;
- else if ( itemID >= 0x1FED && itemID < 0x1FFD )
+ if ( itemID >= 0x1FED && itemID < 0x1FFD )
return true;
- else if ( itemID >= 0x181D && itemID < 0x1829 )
+ if ( itemID >= 0x181D && itemID < 0x1829 )
return true;
- else if ( itemID >= 0x241F && itemID < 0x2421 )
+ if ( itemID >= 0x241F && itemID < 0x2421 )
return true;
- else if ( itemID >= 0x2423 && itemID < 0x2425 )
+ if ( itemID >= 0x2423 && itemID < 0x2425 )
return true;
- else if ( itemID >= 0x2A05 && itemID < 0x2A1D )
+ if ( itemID >= 0x2A05 && itemID < 0x2A1D )
return true;
- else if ( itemID >= 0x319C && itemID < 0x31B0 )
+ if ( itemID >= 0x319C && itemID < 0x31B0 )
return true;
// ML doors
- else if ( itemID == 0x2D46 ||itemID == 0x2D48 || itemID == 0x2FE2 || itemID == 0x2FE4 )
+ if ( itemID == 0x2D46 ||itemID == 0x2D48 || itemID == 0x2FE2 || itemID == 0x2FE4 )
return true;
- else if ( itemID >= 0x2D63 && itemID < 0x2D70 )
+ if ( itemID >= 0x2D63 && itemID < 0x2D70 )
return true;
- else if ( itemID >= 0x319C && itemID < 0x31AF )
+ if ( itemID >= 0x319C && itemID < 0x31AF )
return true;
- else if ( itemID >= 0x367B && itemID < 0x369B )
+ if ( itemID >= 0x367B && itemID < 0x369B )
return true;
// SA doors
- else if ( itemID >= 0x409B && itemID < 0x40A3 )
+ if ( itemID >= 0x409B && itemID < 0x40A3 )
return true;
- else if ( itemID >= 0x410C && itemID < 0x4114 )
+ if ( itemID >= 0x410C && itemID < 0x4114 )
return true;
- else if ( itemID >= 0x41C2 && itemID < 0x41CA )
+ if ( itemID >= 0x41C2 && itemID < 0x41CA )
return true;
- else if ( itemID >= 0x41CF && itemID < 0x41D7 )
+ if ( itemID >= 0x41CF && itemID < 0x41D7 )
return true;
- else if ( itemID >= 0x436E && itemID < 0x437E )
+ if ( itemID >= 0x436E && itemID < 0x437E )
return true;
- else if ( itemID >= 0x46DD && itemID < 0x46E5 )
+ if ( itemID >= 0x46DD && itemID < 0x46E5 )
return true;
- else if ( itemID >= 0x4D22 && itemID < 0x4D2A )
+ if ( itemID >= 0x4D22 && itemID < 0x4D2A )
return true;
- else if ( itemID >= 0x50C8 && itemID < 0x50D8 )
+ if ( itemID >= 0x50C8 && itemID < 0x50D8 )
return true;
- else if ( itemID >= 0x5142 && itemID < 0x514A )
+ if ( itemID >= 0x5142 && itemID < 0x514A )
return true;
// TOL doors
- else if ( itemID >= 0x9AD7 && itemID < 0x9AE7 )
+ if ( itemID >= 0x9AD7 && itemID < 0x9AE7 )
return true;
- else if ( itemID >= 0x9B3C && itemID < 0x9B4C )
+ if ( itemID >= 0x9B3C && itemID < 0x9B4C )
return true;
return false;
diff --git a/Scripts/Multis/HousePlacementTool.cs b/Scripts/Multis/HousePlacementTool.cs
index 82e5f7b52..ce7262fdf 100644
--- a/Scripts/Multis/HousePlacementTool.cs
+++ b/Scripts/Multis/HousePlacementTool.cs
@@ -231,7 +231,7 @@ namespace Server.Items
protected override void OnTarget( Mobile from, object o )
{
- if ( !@from.CheckAlive() || @from.Backpack?.FindItemByType( typeof( HousePlacementTool ) ) == null )
+ if ( !from.CheckAlive() || from.Backpack?.FindItemByType( typeof( HousePlacementTool ) ) == null )
return;
IPoint3D ip = o as IPoint3D;
@@ -260,7 +260,7 @@ namespace Server.Items
protected override void OnTargetFinish( Mobile from )
{
- if ( !@from.CheckAlive() || @from.Backpack?.FindItemByType( typeof( HousePlacementTool ) ) == null )
+ if ( !from.CheckAlive() || from.Backpack?.FindItemByType( typeof( HousePlacementTool ) ) == null )
return;
if ( !m_Placed )
@@ -332,7 +332,7 @@ namespace Server.Items
public void PlacementWarning_Callback( Mobile from, bool okay, object state )
{
- if ( !@from.CheckAlive() || @from.Backpack?.FindItemByType( typeof( HousePlacementTool ) ) == null )
+ if ( !from.CheckAlive() || from.Backpack?.FindItemByType( typeof( HousePlacementTool ) ) == null )
return;
PreviewHouse prevHouse = (PreviewHouse)state;
@@ -447,7 +447,7 @@ namespace Server.Items
public bool OnPlacement( Mobile from, Point3D p )
{
- if ( !@from.CheckAlive() || @from.Backpack?.FindItemByType( typeof( HousePlacementTool ) ) == null )
+ if ( !from.CheckAlive() || from.Backpack?.FindItemByType( typeof( HousePlacementTool ) ) == null )
return false;
ArrayList toMove;
@@ -569,7 +569,8 @@ namespace Server.Items
{
return ((HousePlacementEntry)obj);
}
- else if ( obj is ArrayList )
+
+ if ( obj is ArrayList )
{
ArrayList list = (ArrayList)obj;
diff --git a/Scripts/Regions/BaseRegion.cs b/Scripts/Regions/BaseRegion.cs
index 9554164e3..8a24c1f9e 100644
--- a/Scripts/Regions/BaseRegion.cs
+++ b/Scripts/Regions/BaseRegion.cs
@@ -472,10 +472,9 @@ namespace Server.Regions
{
if ( Name != null )
return Name;
- else if ( RuneName != null )
+ if ( RuneName != null )
return RuneName;
- else
- return GetType().Name;
+ return GetType().Name;
}
public BaseRegion( string name, Map map, int priority, params Rectangle2D[] area ) : base( name, map, priority, area )
diff --git a/Scripts/Regions/GreenAcres.cs b/Scripts/Regions/GreenAcres.cs
index fbe6ecbc3..9cf089cc1 100644
--- a/Scripts/Regions/GreenAcres.cs
+++ b/Scripts/Regions/GreenAcres.cs
@@ -16,8 +16,7 @@ namespace Server.Regions
{
if ( from.AccessLevel == AccessLevel.Player )
return false;
- else
- return base.AllowHousing( from, p );
+ return base.AllowHousing( from, p );
}
public override bool OnBeginSpellCast( Mobile m, ISpell s )
@@ -27,10 +26,8 @@ namespace Server.Regions
m.SendMessage( "You cannot cast that spell here." );
return false;
}
- else
- {
- return base.OnBeginSpellCast( m, s );
- }
+
+ return base.OnBeginSpellCast( m, s );
}
}
}
diff --git a/Scripts/Regions/GuardedRegion.cs b/Scripts/Regions/GuardedRegion.cs
index 1aac3c012..5310aaf07 100644
--- a/Scripts/Regions/GuardedRegion.cs
+++ b/Scripts/Regions/GuardedRegion.cs
@@ -117,8 +117,7 @@ namespace Server.Regions
{
if ( Map == Map.Ilshenar || Map == Map.Malas )
return typeof( ArcherGuard );
- else
- return typeof( WarriorGuard );
+ return typeof( WarriorGuard );
}
}
@@ -280,7 +279,7 @@ namespace Server.Regions
foreach ( Mobile v in m.GetMobilesInRange( 8 ) )
{
- if ( !v.Player && v != m && !IsGuardCandidate( v ) && ((v is BaseCreature)? ((BaseCreature)v).IsHumanInTown() : (v.Body.IsHuman && v.Region.IsPartOf( this ))) )
+ if ( !v.Player && v != m && !IsGuardCandidate( v ) && ((v as BaseCreature)?.IsHumanInTown() ?? (v.Body.IsHuman && v.Region.IsPartOf( this ))) )
{
double dist = m.GetDistanceToSqrt( v );
diff --git a/Scripts/Regions/HouseRegion.cs b/Scripts/Regions/HouseRegion.cs
index a8a152af4..e6a06cc16 100644
--- a/Scripts/Regions/HouseRegion.cs
+++ b/Scripts/Regions/HouseRegion.cs
@@ -176,7 +176,7 @@ namespace Server.Regions
{
HouseFoundation foundation = m_House as HouseFoundation;
- if ( foundation?.Customizer != null && foundation.Customizer != @from && m_House.IsInside( newLocation, 16 ) )
+ if ( foundation?.Customizer != null && foundation.Customizer != from && m_House.IsInside( newLocation, 16 ) )
return false;
}
@@ -198,8 +198,7 @@ namespace Server.Regions
{
if ( (m_House.IsLockedDown( item ) || m_House.IsSecure( item )) && m_House.IsInside( item ) )
return false;
- else
- return base.OnDecay(item );
+ return base.OnDecay(item );
}
public static TimeSpan CombatHeatDelay = TimeSpan.FromSeconds( 30.0 );
@@ -263,7 +262,7 @@ namespace Server.Regions
if ( !m_House.IsInside( from ) || !m_House.IsActive )
return;
- else if ( e.HasKeyword( 0x33 ) ) // remove thyself
+ if ( e.HasKeyword( 0x33 ) ) // remove thyself
{
if ( isFriend )
{
diff --git a/Scripts/Regions/Spawning/SpawnDefinition.cs b/Scripts/Regions/Spawning/SpawnDefinition.cs
index f9a22e6d4..9519a8763 100644
--- a/Scripts/Regions/Spawning/SpawnDefinition.cs
+++ b/Scripts/Regions/Spawning/SpawnDefinition.cs
@@ -32,15 +32,13 @@ namespace Server.Regions
{
return SpawnMobile.Get( type );
}
- else if ( typeof( Item ).IsAssignableFrom( type ) )
+
+ if ( typeof( Item ).IsAssignableFrom( type ) )
{
return SpawnItem.Get( type );
}
- else
- {
- Console.WriteLine( "Invalid type '{0}' in a SpawnDefinition", type.FullName );
- return null;
- }
+ Console.WriteLine( "Invalid type '{0}' in a SpawnDefinition", type.FullName );
+ return null;
}
case "group":
{
@@ -55,10 +53,8 @@ namespace Server.Regions
Console.WriteLine( "Could not find group '{0}' in a SpawnDefinition", group );
return null;
}
- else
- {
- return def;
- }
+
+ return def;
}
case "treasureChest":
{
diff --git a/Scripts/Skills/Anatomy.cs b/Scripts/Skills/Anatomy.cs
index baf677d7d..44e18a6d9 100644
--- a/Scripts/Skills/Anatomy.cs
+++ b/Scripts/Skills/Anatomy.cs
@@ -78,9 +78,9 @@ namespace Server.SkillHandlers
}
else
{
- (targeted as Item)?.SendLocalizedMessageTo( @from, 500323, "" ); // Only living things have anatomies!
+ (targeted as Item)?.SendLocalizedMessageTo( from, 500323, "" ); // Only living things have anatomies!
}
}
}
}
-}
\ No newline at end of file
+}
diff --git a/Scripts/Skills/EvalInt.cs b/Scripts/Skills/EvalInt.cs
index cfd99b659..0eb8dc44c 100644
--- a/Scripts/Skills/EvalInt.cs
+++ b/Scripts/Skills/EvalInt.cs
@@ -72,17 +72,17 @@ namespace Server.SkillHandlers
if ( from.Skills[SkillName.EvalInt].Base >= 76.0 )
targ.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1038202 + mnMod, from.NetState ); // That being is at [10,20,...] percent mental strength.
- }
- else
+ }
+ else
{
targ.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1038166 + (body / 11), from.NetState ); // You cannot judge his/her/its mental abilities.
}
}
else
{
- (targeted as Item)?.SendLocalizedMessageTo( @from, 500908, "" ); // It looks smarter than a rock, but dumber than a piece of wood.
+ (targeted as Item)?.SendLocalizedMessageTo( from, 500908, "" ); // It looks smarter than a rock, but dumber than a piece of wood.
}
}
}
}
-}
\ No newline at end of file
+}
diff --git a/Scripts/Skills/Hiding.cs b/Scripts/Skills/Hiding.cs
index 83747b882..83f1395df 100644
--- a/Scripts/Skills/Hiding.cs
+++ b/Scripts/Skills/Hiding.cs
@@ -90,23 +90,21 @@ namespace Server.SkillHandlers
return TimeSpan.FromSeconds( 1.0 );
}
- else
+
+ if ( ok )
{
- if ( ok )
- {
- m.Hidden = true;
- m.Warmode = false;
- m.LocalOverheadMessage( MessageType.Regular, 0x1F4, 501240 ); // You have hidden yourself well.
- }
- else
- {
- m.RevealingAction();
-
- m.LocalOverheadMessage( MessageType.Regular, 0x22, 501241 ); // You can't seem to hide here.
- }
-
- return TimeSpan.FromSeconds( 10.0 );
+ m.Hidden = true;
+ m.Warmode = false;
+ m.LocalOverheadMessage( MessageType.Regular, 0x1F4, 501240 ); // You have hidden yourself well.
}
+ else
+ {
+ m.RevealingAction();
+
+ m.LocalOverheadMessage( MessageType.Regular, 0x22, 501241 ); // You can't seem to hide here.
+ }
+
+ return TimeSpan.FromSeconds( 10.0 );
}
}
}
\ No newline at end of file
diff --git a/Scripts/Skills/Meditation.cs b/Scripts/Skills/Meditation.cs
index a19de4eb6..8c32944e1 100644
--- a/Scripts/Skills/Meditation.cs
+++ b/Scripts/Skills/Meditation.cs
@@ -36,66 +36,64 @@ namespace Server.SkillHandlers
m.SendLocalizedMessage( 501845 ); // You are busy doing something else and cannot focus.
return TimeSpan.FromSeconds( 5.0 );
- }
- else if ( !Core.AOS && m.Hits < (m.HitsMax / 10) ) // Less than 10% health
+ }
+
+ if ( !Core.AOS && m.Hits < (m.HitsMax / 10) ) // Less than 10% health
{
m.SendLocalizedMessage( 501849 ); // The mind is strong but the body is weak.
return TimeSpan.FromSeconds( 5.0 );
}
- else if ( m.Mana >= m.ManaMax )
+ if ( m.Mana >= m.ManaMax )
{
m.SendLocalizedMessage( 501846 ); // You are at peace.
return TimeSpan.FromSeconds( Core.AOS ? 10.0 : 5.0 );
}
- else if ( Core.AOS && Misc.RegenRates.GetArmorOffset( m ) > 0 )
+ if ( Core.AOS && Misc.RegenRates.GetArmorOffset( m ) > 0 )
{
m.SendLocalizedMessage( 500135 ); // Regenerative forces cannot penetrate your armor!
return TimeSpan.FromSeconds( 10.0 );
}
+ Item oneHanded = m.FindItemOnLayer( Layer.OneHanded );
+ Item twoHanded = m.FindItemOnLayer( Layer.TwoHanded );
+
+ if ( Core.AOS && m.Player )
+ {
+ if ( !CheckOkayHolding( oneHanded ) )
+ m.AddToBackpack( oneHanded );
+
+ if ( !CheckOkayHolding( twoHanded ) )
+ m.AddToBackpack( twoHanded );
+ }
+ else if ( !CheckOkayHolding( oneHanded ) || !CheckOkayHolding( twoHanded ) )
+ {
+ m.SendLocalizedMessage( 502626 ); // Your hands must be free to cast spells or meditate.
+
+ return TimeSpan.FromSeconds( 2.5 );
+ }
+
+ double skillVal = m.Skills[SkillName.Meditation].Value;
+ double chance = (50.0 + (( skillVal - ( m.ManaMax - m.Mana ) ) * 2)) / 100;
+
+ if ( chance > Utility.RandomDouble() )
+ {
+ m.CheckSkill( SkillName.Meditation, 0.0, 100.0 );
+
+ m.SendLocalizedMessage( 501851 ); // You enter a meditative trance.
+ m.Meditating = true;
+ BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.ActiveMeditation, 1075657 ) );
+
+ if ( m.Player || m.Body.IsHuman )
+ m.PlaySound( 0xF9 );
+ }
else
{
- Item oneHanded = m.FindItemOnLayer( Layer.OneHanded );
- Item twoHanded = m.FindItemOnLayer( Layer.TwoHanded );
-
- if ( Core.AOS && m.Player )
- {
- if ( !CheckOkayHolding( oneHanded ) )
- m.AddToBackpack( oneHanded );
-
- if ( !CheckOkayHolding( twoHanded ) )
- m.AddToBackpack( twoHanded );
- }
- else if ( !CheckOkayHolding( oneHanded ) || !CheckOkayHolding( twoHanded ) )
- {
- m.SendLocalizedMessage( 502626 ); // Your hands must be free to cast spells or meditate.
-
- return TimeSpan.FromSeconds( 2.5 );
- }
-
- double skillVal = m.Skills[SkillName.Meditation].Value;
- double chance = (50.0 + (( skillVal - ( m.ManaMax - m.Mana ) ) * 2)) / 100;
-
- if ( chance > Utility.RandomDouble() )
- {
- m.CheckSkill( SkillName.Meditation, 0.0, 100.0 );
-
- m.SendLocalizedMessage( 501851 ); // You enter a meditative trance.
- m.Meditating = true;
- BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.ActiveMeditation, 1075657 ) );
-
- if ( m.Player || m.Body.IsHuman )
- m.PlaySound( 0xF9 );
- }
- else
- {
- m.SendLocalizedMessage( 501850 ); // You cannot focus your concentration.
- }
-
- return TimeSpan.FromSeconds( 10.0 );
+ m.SendLocalizedMessage( 501850 ); // You cannot focus your concentration.
}
+
+ return TimeSpan.FromSeconds( 10.0 );
}
}
}
diff --git a/Scripts/Skills/RemoveTrap.cs b/Scripts/Skills/RemoveTrap.cs
index 10526d498..537d7a92f 100644
--- a/Scripts/Skills/RemoveTrap.cs
+++ b/Scripts/Skills/RemoveTrap.cs
@@ -58,7 +58,7 @@ namespace Server.SkillHandlers
}
from.PlaySound( 0x241 );
-
+
if ( from.CheckTargetSkill( SkillName.RemoveTrap, targ, targ.TrapPower, targ.TrapPower + 30 ) )
{
targ.TrapPower = 0;
@@ -76,7 +76,7 @@ namespace Server.SkillHandlers
BaseFactionTrap trap = (BaseFactionTrap) targeted;
Faction faction = Faction.Find( from );
- FactionTrapRemovalKit kit = ( from.Backpack == null ? null : from.Backpack.FindItemByType( typeof( FactionTrapRemovalKit ) ) as FactionTrapRemovalKit );
+ FactionTrapRemovalKit kit = @from.Backpack?.FindItemByType( typeof( FactionTrapRemovalKit ) ) as FactionTrapRemovalKit;
bool isOwner = ( trap.Placer == from || ( trap.Faction != null && trap.Faction.IsCommander( from ) ) );
@@ -114,7 +114,7 @@ namespace Server.SkillHandlers
}
if ( !isOwner )
- kit?.ConsumeCharge( @from );
+ kit?.ConsumeCharge( from );
}
}
else
@@ -124,4 +124,4 @@ namespace Server.SkillHandlers
}
}
}
-}
\ No newline at end of file
+}
diff --git a/Scripts/Skills/Snooping.cs b/Scripts/Skills/Snooping.cs
index 3cc0e95a5..f130d6992 100644
--- a/Scripts/Skills/Snooping.cs
+++ b/Scripts/Skills/Snooping.cs
@@ -64,7 +64,7 @@ namespace Server.SkillHandlers
if ( map != null )
{
- string message = $"You notice {@from.Name} attempting to peek into {root.Name}'s belongings.";
+ string message = $"You notice {from.Name} attempting to peek into {root.Name}'s belongings.";
IPooledEnumerable eable = map.GetClientsInRange( from.Location, 8 );
@@ -91,7 +91,7 @@ namespace Server.SkillHandlers
else
{
from.SendLocalizedMessage( 500210 ); // You failed to peek into the container.
-
+
if ( from.Skills[SkillName.Hiding].Value / 2 < Utility.Random( 100 ) )
from.RevealingAction();
}
diff --git a/Scripts/Skills/Stealing.cs b/Scripts/Skills/Stealing.cs
index e810bc9ba..786ce3e05 100644
--- a/Scripts/Skills/Stealing.cs
+++ b/Scripts/Skills/Stealing.cs
@@ -89,7 +89,7 @@ namespace Server.SkillHandlers
else if ( toSteal is Sigil )
{
PlayerState pl = PlayerState.Find( m_Thief );
- Faction faction = ( pl == null ? null : pl.Faction );
+ Faction faction = pl?.Faction;
Sigil sig = (Sigil) toSteal;
diff --git a/Scripts/Skills/Tracking.cs b/Scripts/Skills/Tracking.cs
index fa1f58b39..ffc8368c7 100644
--- a/Scripts/Skills/Tracking.cs
+++ b/Scripts/Skills/Tracking.cs
@@ -144,9 +144,9 @@ namespace Server.SkillHandlers
{
if ( x == null && y == null )
return 0;
- else if ( x == null )
+ if ( x == null )
return -1;
- else if ( y == null )
+ if ( y == null )
return 1;
return m_From.GetDistanceToSqrt( x ).CompareTo( m_From.GetDistanceToSqrt( y ) );
@@ -378,7 +378,8 @@ namespace Server.SkillHandlers
Stop();
return;
}
- else if ( m_From.NetState == null || m_From.Deleted || m_Target.Deleted || m_From.Map != m_Target.Map || !m_From.InRange( m_Target, m_Range ) || ( m_Target.Hidden && m_Target.AccessLevel > m_From.AccessLevel ) )
+
+ if ( m_From.NetState == null || m_From.Deleted || m_Target.Deleted || m_From.Map != m_Target.Map || !m_From.InRange( m_Target, m_Range ) || ( m_Target.Hidden && m_Target.AccessLevel > m_From.AccessLevel ) )
{
m_Arrow.Stop();
Stop();
diff --git a/Scripts/Spells/Base/Spell.cs b/Scripts/Spells/Base/Spell.cs
index 6e88b187f..0380d64e2 100644
--- a/Scripts/Spells/Base/Spell.cs
+++ b/Scripts/Spells/Base/Spell.cs
@@ -112,10 +112,8 @@ namespace Server.Spells
{
return GetNewAosDamage( bonus, dice, sides, (Caster.Player && singleTarget.Player), GetDamageScalar( singleTarget ) );
}
- else
- {
- return GetNewAosDamage( bonus, dice, sides, false );
- }
+
+ return GetNewAosDamage( bonus, dice, sides, false );
}
public virtual int GetNewAosDamage( int bonus, int dice, int sides, bool playerVsPlayer )
@@ -483,7 +481,8 @@ namespace Server.Spells
{
return false;
}
- else if ( m_Scroll is BaseWand && m_Caster.Spell != null && m_Caster.Spell.IsCasting )
+
+ if ( m_Scroll is BaseWand && m_Caster.Spell != null && m_Caster.Spell.IsCasting )
{
m_Caster.SendLocalizedMessage( 502643 ); // You can not cast a spell while frozen.
}
@@ -562,10 +561,8 @@ namespace Server.Spells
return true;
}
- else
- {
- return false;
- }
+
+ return false;
}
else
{
@@ -820,15 +817,13 @@ namespace Server.Spells
m_Caster.SendLocalizedMessage( 501857 ); // This spell won't work on that!
return false;
}
- else if ( Caster.CanBeBeneficial( target, true, allowDead ) && CheckSequence() )
+
+ if ( Caster.CanBeBeneficial( target, true, allowDead ) && CheckSequence() )
{
Caster.DoBeneficial( target );
return true;
}
- else
- {
- return false;
- }
+ return false;
}
public bool CheckHSequence( Mobile target )
@@ -838,15 +833,13 @@ namespace Server.Spells
m_Caster.SendLocalizedMessage( 501857 ); // This spell won't work on that!
return false;
}
- else if ( Caster.CanBeHarmful( target ) && CheckSequence() )
+
+ if ( Caster.CanBeHarmful( target ) && CheckSequence() )
{
Caster.DoHarmful( target );
return true;
}
- else
- {
- return false;
- }
+ return false;
}
private class AnimTimer : Timer
@@ -898,7 +891,8 @@ namespace Server.Spells
{
return;
}
- else if ( m_Spell.m_State == SpellState.Casting && m_Spell.m_Caster.Spell == m_Spell )
+
+ if ( m_Spell.m_State == SpellState.Casting && m_Spell.m_Caster.Spell == m_Spell )
{
m_Spell.m_State = SpellState.Sequencing;
m_Spell.m_CastTimer = null;
diff --git a/Scripts/Spells/Base/SpellHelper.cs b/Scripts/Spells/Base/SpellHelper.cs
index 22d3b78b9..c81e5397f 100644
--- a/Scripts/Spells/Base/SpellHelper.cs
+++ b/Scripts/Spells/Base/SpellHelper.cs
@@ -210,7 +210,7 @@ namespace Server.Spells
{
if ( offset > 0 )
return AddStatBonus( m, m, type, offset, duration );
- else if ( offset < 0 )
+ if ( offset < 0 )
return AddStatCurse( m, m, type, -offset, duration );
return true;
@@ -233,7 +233,8 @@ namespace Server.Spells
target.AddStatMod( new StatMod( type, name, mod.Offset + offset, duration ) );
return true;
}
- else if ( mod == null || mod.Offset < offset )
+
+ if ( mod == null || mod.Offset < offset )
{
target.AddStatMod( new StatMod( type, name, offset, duration ) );
return true;
@@ -259,7 +260,8 @@ namespace Server.Spells
target.AddStatMod( new StatMod( type, name, mod.Offset + offset, duration ) );
return true;
}
- else if ( mod == null || mod.Offset > offset )
+
+ if ( mod == null || mod.Offset > offset )
{
target.AddStatMod( new StatMod( type, name, offset, duration ) );
return true;
@@ -545,15 +547,13 @@ namespace Server.Spells
p = new Point3D( x, y, p.Z );
return true;
}
- else
- {
- int z = map.GetAverageZ( x, y );
- if ( map.CanSpawnMobile( x, y, z ) )
- {
- p = new Point3D( x, y, z );
- return true;
- }
+ int z = map.GetAverageZ( x, y );
+
+ if ( map.CanSpawnMobile( x, y, z ) )
+ {
+ p = new Point3D( x, y, z );
+ return true;
}
}
@@ -981,9 +981,9 @@ namespace Server.Spells
if ( delay == TimeSpan.Zero )
{
- (@from as BaseCreature)?.AlterSpellDamageTo( target, ref iDamage );
+ (from as BaseCreature)?.AlterSpellDamageTo( target, ref iDamage );
- (target as BaseCreature)?.AlterSpellDamageFrom( @from, ref iDamage );
+ (target as BaseCreature)?.AlterSpellDamageFrom( from, ref iDamage );
target.Damage( iDamage, from );
}
@@ -1036,9 +1036,9 @@ namespace Server.Spells
if ( delay == TimeSpan.Zero )
{
- (@from as BaseCreature)?.AlterSpellDamageTo( target, ref iDamage );
+ (from as BaseCreature)?.AlterSpellDamageTo( target, ref iDamage );
- (target as BaseCreature)?.AlterSpellDamageFrom( @from, ref iDamage );
+ (target as BaseCreature)?.AlterSpellDamageFrom( from, ref iDamage );
WeightOverloading.DFA = dfa;
@@ -1257,12 +1257,13 @@ namespace Server.Spells
caster.SendLocalizedMessage( 1061632 ); // You can't do that while carrying the sigil.
return false;
}
- else if ( !caster.CanBeginAction( typeof( PolymorphSpell ) ) )
+
+ if ( !caster.CanBeginAction( typeof( PolymorphSpell ) ) )
{
caster.SendLocalizedMessage( 1061628 ); // You can't do that while polymorphed.
return false;
}
- else if ( AnimalForm.UnderTransformation( caster ) )
+ if ( AnimalForm.UnderTransformation( caster ) )
{
caster.SendLocalizedMessage( 1061091 ); // You cannot cast that spell in this form.
return false;
diff --git a/Scripts/Spells/Bushido/SamuraiSpell.cs b/Scripts/Spells/Bushido/SamuraiSpell.cs
index 14128bc68..035e27a6f 100644
--- a/Scripts/Spells/Bushido/SamuraiSpell.cs
+++ b/Scripts/Spells/Bushido/SamuraiSpell.cs
@@ -55,7 +55,8 @@ namespace Server.Spells.Bushido
Caster.SendLocalizedMessage( 1063013, args ); // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
return false;
}
- else if ( Caster.Mana < mana )
+
+ if ( Caster.Mana < mana )
{
Caster.SendLocalizedMessage( 1060174, mana.ToString() ); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
return false;
@@ -73,7 +74,8 @@ namespace Server.Spells.Bushido
Caster.SendLocalizedMessage( 1070768, RequiredSkill.ToString( "F1" ) ); // You need ~1_SKILL_REQUIREMENT~ Bushido skill to perform that attack!
return false;
}
- else if ( Caster.Mana < mana )
+
+ if ( Caster.Mana < mana )
{
Caster.SendLocalizedMessage( 1060174, mana.ToString() ); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
return false;
diff --git a/Scripts/Spells/Chivalry/PaladinSpell.cs b/Scripts/Spells/Chivalry/PaladinSpell.cs
index 283381a12..fc0cb58c2 100644
--- a/Scripts/Spells/Chivalry/PaladinSpell.cs
+++ b/Scripts/Spells/Chivalry/PaladinSpell.cs
@@ -35,7 +35,8 @@ namespace Server.Spells.Chivalry
Caster.SendLocalizedMessage( 1060173, RequiredTithing.ToString() ); // You must have at least ~1_TITHE_REQUIREMENT~ Tithing Points to use this ability,
return false;
}
- else if ( Caster.Mana < mana )
+
+ if ( Caster.Mana < mana )
{
Caster.SendLocalizedMessage( 1060174, mana.ToString() ); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
return false;
@@ -58,7 +59,8 @@ namespace Server.Spells.Chivalry
Caster.SendLocalizedMessage( 1060173, RequiredTithing.ToString() ); // You must have at least ~1_TITHE_REQUIREMENT~ Tithing Points to use this ability,
return false;
}
- else if ( Caster.Mana < mana )
+
+ if ( Caster.Mana < mana )
{
Caster.SendLocalizedMessage( 1060174, mana.ToString() ); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
return false;
diff --git a/Scripts/Spells/Chivalry/SacredJourney.cs b/Scripts/Spells/Chivalry/SacredJourney.cs
index 704c8020d..21d4e0ec2 100644
--- a/Scripts/Spells/Chivalry/SacredJourney.cs
+++ b/Scripts/Spells/Chivalry/SacredJourney.cs
@@ -54,17 +54,18 @@ namespace Server.Spells.Chivalry
Caster.SendLocalizedMessage( 1061632 ); // You can't do that while carrying the sigil.
return false;
}
- else if ( Caster.Criminal )
+
+ if ( Caster.Criminal )
{
Caster.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
return false;
}
- else if ( SpellHelper.CheckCombat( Caster ) )
+ if ( SpellHelper.CheckCombat( Caster ) )
{
Caster.SendLocalizedMessage( 1061282 ); // You cannot use the Sacred Journey ability to flee from combat.
return false;
}
- else if ( Misc.WeightOverloading.IsOverloaded( Caster ) )
+ if ( Misc.WeightOverloading.IsOverloaded( Caster ) )
{
Caster.SendLocalizedMessage( 502359, "", 0x22 ); // Thou art too encumbered to move.
return false;
diff --git a/Scripts/Spells/Fifth/Incognito.cs b/Scripts/Spells/Fifth/Incognito.cs
index 4b06639cd..d95d498d1 100644
--- a/Scripts/Spells/Fifth/Incognito.cs
+++ b/Scripts/Spells/Fifth/Incognito.cs
@@ -30,12 +30,13 @@ namespace Server.Spells.Fifth
Caster.SendLocalizedMessage( 1010445 ); // You cannot incognito if you have a sigil
return false;
}
- else if ( !Caster.CanBeginAction( typeof( IncognitoSpell ) ) )
+
+ if ( !Caster.CanBeginAction( typeof( IncognitoSpell ) ) )
{
Caster.SendLocalizedMessage( 1005559 ); // This spell is already in effect.
return false;
}
- else if ( Caster.BodyMod == 183 || Caster.BodyMod == 184 )
+ if ( Caster.BodyMod == 183 || Caster.BodyMod == 184 )
{
Caster.SendLocalizedMessage( 1042402 ); // You cannot use incognito while wearing body paint
return false;
diff --git a/Scripts/Spells/Fifth/MagicReflect.cs b/Scripts/Spells/Fifth/MagicReflect.cs
index 972ac5f22..d29fbea63 100644
--- a/Scripts/Spells/Fifth/MagicReflect.cs
+++ b/Scripts/Spells/Fifth/MagicReflect.cs
@@ -30,7 +30,8 @@ namespace Server.Spells.Fifth
Caster.SendLocalizedMessage( 1005559 ); // This spell is already in effect.
return false;
}
- else if ( !Caster.CanBeginAction( typeof( DefensiveSpell ) ) )
+
+ if ( !Caster.CanBeginAction( typeof( DefensiveSpell ) ) )
{
Caster.SendLocalizedMessage( 1005385 ); // The spell will not adhere to you at this time.
return false;
diff --git a/Scripts/Spells/First/ReactiveArmor.cs b/Scripts/Spells/First/ReactiveArmor.cs
index ea8c0cea6..4b471d979 100644
--- a/Scripts/Spells/First/ReactiveArmor.cs
+++ b/Scripts/Spells/First/ReactiveArmor.cs
@@ -30,7 +30,8 @@ namespace Server.Spells.First
Caster.SendLocalizedMessage( 1005559 ); // This spell is already in effect.
return false;
}
- else if ( !Caster.CanBeginAction( typeof( DefensiveSpell ) ) )
+
+ if ( !Caster.CanBeginAction( typeof( DefensiveSpell ) ) )
{
Caster.SendLocalizedMessage( 1005385 ); // The spell will not adhere to you at this time.
return false;
diff --git a/Scripts/Spells/Fourth/Recall.cs b/Scripts/Spells/Fourth/Recall.cs
index abcee9ed5..5a9034c51 100644
--- a/Scripts/Spells/Fourth/Recall.cs
+++ b/Scripts/Spells/Fourth/Recall.cs
@@ -58,17 +58,18 @@ namespace Server.Spells.Fourth
Caster.SendLocalizedMessage( 1061632 ); // You can't do that while carrying the sigil.
return false;
}
- else if ( Caster.Criminal )
+
+ if ( Caster.Criminal )
{
Caster.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
return false;
}
- else if ( SpellHelper.CheckCombat( Caster ) )
+ if ( SpellHelper.CheckCombat( Caster ) )
{
Caster.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
return false;
}
- else if ( Misc.WeightOverloading.IsOverloaded( Caster ) )
+ if ( Misc.WeightOverloading.IsOverloaded( Caster ) )
{
Caster.SendLocalizedMessage( 502359, "", 0x22 ); // Thou art too encumbered to move.
return false;
diff --git a/Scripts/Spells/Mysticism/StoneFormSpell.cs b/Scripts/Spells/Mysticism/StoneFormSpell.cs
index 9315c180a..175bb6c75 100644
--- a/Scripts/Spells/Mysticism/StoneFormSpell.cs
+++ b/Scripts/Spells/Mysticism/StoneFormSpell.cs
@@ -46,17 +46,18 @@ namespace Server.Spells.Mysticism
Caster.SendLocalizedMessage( 1061632 ); // You can't do that while carrying the sigil.
return false;
}
- else if ( !Caster.CanBeginAction( typeof( PolymorphSpell ) ) )
+
+ if ( !Caster.CanBeginAction( typeof( PolymorphSpell ) ) )
{
Caster.SendLocalizedMessage( 1061628 ); // You can't do that while polymorphed.
return false;
}
- else if ( Ninjitsu.AnimalForm.UnderTransformation( Caster ) )
+ if ( Ninjitsu.AnimalForm.UnderTransformation( Caster ) )
{
Caster.SendLocalizedMessage( 1063218 ); // You cannot use that ability in this form.
return false;
}
- else if ( Caster.Flying )
+ if ( Caster.Flying )
{
Caster.SendLocalizedMessage( 1113415 ); // You cannot use this ability while flying.
return false;
diff --git a/Scripts/Spells/Ninjitsu/AnimalForm.cs b/Scripts/Spells/Ninjitsu/AnimalForm.cs
index fb6b4a1d7..93ae0fbb2 100644
--- a/Scripts/Spells/Ninjitsu/AnimalForm.cs
+++ b/Scripts/Spells/Ninjitsu/AnimalForm.cs
@@ -50,12 +50,13 @@ namespace Server.Spells.Ninjitsu
Caster.SendLocalizedMessage(1061628); // You can't do that while polymorphed.
return false;
}
- else if (TransformationSpellHelper.UnderTransformation(Caster))
+
+ if (TransformationSpellHelper.UnderTransformation(Caster))
{
Caster.SendLocalizedMessage(1063219); // You cannot mimic an animal while in that form.
return false;
}
- else if (DisguiseTimers.IsDisguised(Caster))
+ if (DisguiseTimers.IsDisguised(Caster))
{
Caster.SendLocalizedMessage(1061631); // You can't do that while disguised.
return false;
diff --git a/Scripts/Spells/Ninjitsu/MirrorImage.cs b/Scripts/Spells/Ninjitsu/MirrorImage.cs
index e11c80d57..de456c2f4 100644
--- a/Scripts/Spells/Ninjitsu/MirrorImage.cs
+++ b/Scripts/Spells/Ninjitsu/MirrorImage.cs
@@ -66,12 +66,13 @@ namespace Server.Spells.Ninjitsu
Caster.SendLocalizedMessage( 1063132 ); // You cannot use this ability while mounted.
return false;
}
- else if ( (Caster.Followers + 1) > Caster.FollowersMax )
+
+ if ( (Caster.Followers + 1) > Caster.FollowersMax )
{
Caster.SendLocalizedMessage( 1063133 ); // You cannot summon a mirror image because you have too many followers.
return false;
}
- else if ( TransformationSpellHelper.UnderTransformation( Caster, typeof( HorrificBeastSpell ) ) )
+ if ( TransformationSpellHelper.UnderTransformation( Caster, typeof( HorrificBeastSpell ) ) )
{
Caster.SendLocalizedMessage( 1061091 ); // You cannot cast that spell in this form.
return false;
diff --git a/Scripts/Spells/Ninjitsu/NinjaSpell.cs b/Scripts/Spells/Ninjitsu/NinjaSpell.cs
index 04e8ddbb6..e0b2dff15 100644
--- a/Scripts/Spells/Ninjitsu/NinjaSpell.cs
+++ b/Scripts/Spells/Ninjitsu/NinjaSpell.cs
@@ -55,7 +55,8 @@ namespace Server.Spells.Ninjitsu
Caster.SendLocalizedMessage( 1063013, args ); // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
return false;
}
- else if ( Caster.Mana < mana )
+
+ if ( Caster.Mana < mana )
{
Caster.SendLocalizedMessage( 1060174, mana.ToString() ); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
return false;
@@ -73,7 +74,8 @@ namespace Server.Spells.Ninjitsu
Caster.SendLocalizedMessage( 1063352, RequiredSkill.ToString( "F1" ) ); // You need ~1_SKILL_REQUIREMENT~ Ninjitsu skill to perform that attack!
return false;
}
- else if ( Caster.Mana < mana )
+
+ if ( Caster.Mana < mana )
{
Caster.SendLocalizedMessage( 1060174, mana.ToString() ); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
return false;
diff --git a/Scripts/Spells/Second/Protection.cs b/Scripts/Spells/Second/Protection.cs
index 5eb08ceee..91afa74e0 100644
--- a/Scripts/Spells/Second/Protection.cs
+++ b/Scripts/Spells/Second/Protection.cs
@@ -33,7 +33,8 @@ namespace Server.Spells.Second
Caster.SendLocalizedMessage( 1005559 ); // This spell is already in effect.
return false;
}
- else if ( !Caster.CanBeginAction( typeof( DefensiveSpell ) ) )
+
+ if ( !Caster.CanBeginAction( typeof( DefensiveSpell ) ) )
{
Caster.SendLocalizedMessage( 1005385 ); // The spell will not adhere to you at this time.
return false;
diff --git a/Scripts/Spells/Seventh/GateTravel.cs b/Scripts/Spells/Seventh/GateTravel.cs
index 0a2decb06..47e339d16 100644
--- a/Scripts/Spells/Seventh/GateTravel.cs
+++ b/Scripts/Spells/Seventh/GateTravel.cs
@@ -46,12 +46,13 @@ namespace Server.Spells.Seventh
Caster.SendLocalizedMessage( 1061632 ); // You can't do that while carrying the sigil.
return false;
}
- else if ( Caster.Criminal )
+
+ if ( Caster.Criminal )
{
Caster.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
return false;
}
- else if ( SpellHelper.CheckCombat( Caster ) )
+ if ( SpellHelper.CheckCombat( Caster ) )
{
Caster.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
return false;
diff --git a/Scripts/Spells/Seventh/Polymorph.cs b/Scripts/Spells/Seventh/Polymorph.cs
index 12c72f85c..0737539bb 100644
--- a/Scripts/Spells/Seventh/Polymorph.cs
+++ b/Scripts/Spells/Seventh/Polymorph.cs
@@ -43,22 +43,23 @@ namespace Server.Spells.Seventh
Caster.SendLocalizedMessage( 1010521 ); // You cannot polymorph while you have a Town Sigil
return false;
}
- else if ( TransformationSpellHelper.UnderTransformation( Caster ) )
+
+ if ( TransformationSpellHelper.UnderTransformation( Caster ) )
{
Caster.SendLocalizedMessage( 1061633 ); // You cannot polymorph while in that form.
return false;
}
- else if ( DisguiseTimers.IsDisguised( Caster ) )
+ if ( DisguiseTimers.IsDisguised( Caster ) )
{
Caster.SendLocalizedMessage( 502167 ); // You cannot polymorph while disguised.
return false;
}
- else if ( Caster.BodyMod == 183 || Caster.BodyMod == 184 )
+ if ( Caster.BodyMod == 183 || Caster.BodyMod == 184 )
{
Caster.SendLocalizedMessage( 1042512 ); // You cannot polymorph while wearing body paint
return false;
}
- else if ( !Caster.CanBeginAction( typeof( PolymorphSpell ) ) )
+ if ( !Caster.CanBeginAction( typeof( PolymorphSpell ) ) )
{
if ( Core.ML )
EndPolymorph( Caster );
@@ -66,7 +67,7 @@ namespace Server.Spells.Seventh
Caster.SendLocalizedMessage( 1005559 ); // This spell is already in effect.
return false;
}
- else if ( m_NewBody == 0 )
+ if ( m_NewBody == 0 )
{
Gump gump;
if ( Core.SE )
diff --git a/Scripts/Spells/Spellweaving/ArcaneCircle.cs b/Scripts/Spells/Spellweaving/ArcaneCircle.cs
index a06ea53fc..5c7ee7b3b 100644
--- a/Scripts/Spells/Spellweaving/ArcaneCircle.cs
+++ b/Scripts/Spells/Spellweaving/ArcaneCircle.cs
@@ -82,7 +82,7 @@ namespace Server.Spells.Spellweaving
if ( t.Z + id.CalcHeight != location.Z )
continue;
- else if ( IsValidTile( tand ) )
+ if ( IsValidTile( tand ) )
return true;
}
@@ -94,7 +94,7 @@ namespace Server.Spells.Spellweaving
if ( item == null || item.Z + id.CalcHeight != location.Z )
continue;
- else if ( IsValidTile( item.ItemID ) )
+ if ( IsValidTile( item.ItemID ) )
{
eable.Free();
return true;
diff --git a/Scripts/Spells/Spellweaving/ArcanistSpell.cs b/Scripts/Spells/Spellweaving/ArcanistSpell.cs
index 209500f3a..44fe70005 100644
--- a/Scripts/Spells/Spellweaving/ArcanistSpell.cs
+++ b/Scripts/Spells/Spellweaving/ArcanistSpell.cs
@@ -36,7 +36,7 @@ namespace Server.Spells.Spellweaving
public static ArcaneFocus FindArcaneFocus( Mobile from )
{
- if ( @from?.Backpack == null )
+ if ( from?.Backpack == null )
return null;
if ( from.Holding is ArcaneFocus )
@@ -87,7 +87,8 @@ namespace Server.Spells.Spellweaving
caster.SendLocalizedMessage( 1060174, mana.ToString() ); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
return false;
}
- else if ( caster.Skills[CastSkill].Value < RequiredSkill )
+
+ if ( caster.Skills[CastSkill].Value < RequiredSkill )
{
caster.SendLocalizedMessage( 1063013, $"{RequiredSkill.ToString("F1")}\t{"#1044114"}"); // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
return false;
diff --git a/Scripts/Spells/Spellweaving/AttuneWeapon.cs b/Scripts/Spells/Spellweaving/AttuneWeapon.cs
index f6947ee9f..9c305cb10 100644
--- a/Scripts/Spells/Spellweaving/AttuneWeapon.cs
+++ b/Scripts/Spells/Spellweaving/AttuneWeapon.cs
@@ -27,7 +27,8 @@ namespace Server.Spells.Spellweaving
Caster.SendLocalizedMessage( 501775 ); // This spell is already in effect.
return false;
}
- else if ( !Caster.CanBeginAction( typeof( AttuneWeaponSpell ) ) )
+
+ if ( !Caster.CanBeginAction( typeof( AttuneWeaponSpell ) ) )
{
Caster.SendLocalizedMessage( 1075124 ); // You must wait before casting that spell again.
return false;
diff --git a/Scripts/Spells/Spellweaving/Items/TransientItem.cs b/Scripts/Spells/Spellweaving/Items/TransientItem.cs
index 6ecf860e9..3f11ec9c0 100644
--- a/Scripts/Spells/Spellweaving/Items/TransientItem.cs
+++ b/Scripts/Spells/Spellweaving/Items/TransientItem.cs
@@ -38,7 +38,7 @@ namespace Server.Items
public virtual void Expire( Mobile parent )
{
- parent?.SendLocalizedMessage( 1072515, (Name == null ? $"#{LabelNumber}" : Name) ); // The ~1_name~ expired...
+ parent?.SendLocalizedMessage( 1072515, Name ?? $"#{LabelNumber}" ); // The ~1_name~ expired...
Effects.PlaySound( GetWorldLocation(), Map, 0x201 );
@@ -48,7 +48,7 @@ namespace Server.Items
public virtual void SendTimeRemainingMessage( Mobile to )
{
to.SendLocalizedMessage( 1072516,
- $"{(Name == null ? $"#{LabelNumber}" : Name)}\t{(int) m_LifeSpan.TotalSeconds}"); // ~1_name~ will expire in ~2_val~ seconds!
+ $"{Name ?? $"#{LabelNumber}"}\t{(int) m_LifeSpan.TotalSeconds}"); // ~1_name~ will expire in ~2_val~ seconds!
}
public override void OnDelete()
diff --git a/Scripts/Spells/Third/Teleport.cs b/Scripts/Spells/Third/Teleport.cs
index 7ed087259..285549a1e 100644
--- a/Scripts/Spells/Third/Teleport.cs
+++ b/Scripts/Spells/Third/Teleport.cs
@@ -27,7 +27,8 @@ namespace Server.Spells.Third
Caster.SendLocalizedMessage( 1061632 ); // You can't do that while carrying the sigil.
return false;
}
- else if ( Misc.WeightOverloading.IsOverloaded( Caster ) )
+
+ if ( Misc.WeightOverloading.IsOverloaded( Caster ) )
{
Caster.SendLocalizedMessage( 502359, "", 0x22 ); // Thou art too encumbered to move.
return false;
diff --git a/Server/Body.cs b/Server/Body.cs
index 6837cd3a7..c2c757a5b 100644
--- a/Server/Body.cs
+++ b/Server/Body.cs
@@ -90,8 +90,7 @@ namespace Server
{
if ( m_BodyID >= 0 && m_BodyID < m_Types.Length )
return m_Types[m_BodyID];
- else
- return BodyType.Empty;
+ return BodyType.Empty;
}
}
diff --git a/Server/ClientVersion.cs b/Server/ClientVersion.cs
index f1041f380..a0cf3eb58 100644
--- a/Server/ClientVersion.cs
+++ b/Server/ClientVersion.cs
@@ -213,22 +213,21 @@ namespace Server
if ( m_Major > o.m_Major )
return 1;
- else if ( m_Major < o.m_Major )
+ if ( m_Major < o.m_Major )
return -1;
- else if ( m_Minor > o.m_Minor )
+ if ( m_Minor > o.m_Minor )
return 1;
- else if ( m_Minor < o.m_Minor )
+ if ( m_Minor < o.m_Minor )
return -1;
- else if ( m_Revision > o.m_Revision )
+ if ( m_Revision > o.m_Revision )
return 1;
- else if ( m_Revision < o.m_Revision )
+ if ( m_Revision < o.m_Revision )
return -1;
- else if ( m_Patch > o.m_Patch )
+ if ( m_Patch > o.m_Patch )
return 1;
- else if ( m_Patch < o.m_Patch )
+ if ( m_Patch < o.m_Patch )
return -1;
- else
- return 0;
+ return 0;
}
public static bool IsNull( object x )
@@ -240,9 +239,9 @@ namespace Server
{
if ( IsNull( x ) && IsNull( y ) )
return 0;
- else if ( IsNull( x ) )
+ if ( IsNull( x ) )
return -1;
- else if ( IsNull( y ) )
+ if ( IsNull( y ) )
return 1;
ClientVersion a = x as ClientVersion;
@@ -258,9 +257,9 @@ namespace Server
{
if ( IsNull( a ) && IsNull( b ) )
return 0;
- else if ( IsNull( a ) )
+ if ( IsNull( a ) )
return -1;
- else if ( IsNull( b ) )
+ if ( IsNull( b ) )
return 1;
return a.CompareTo( b );
diff --git a/Server/Gumps/Gump.cs b/Server/Gumps/Gump.cs
index 39bc5cae4..c53d182ac 100644
--- a/Server/Gumps/Gump.cs
+++ b/Server/Gumps/Gump.cs
@@ -314,12 +314,10 @@ namespace Server.Gumps
{
return indexOf;
}
- else
- {
- Invalidate();
- m_Strings.Add( value );
- return m_Strings.Count - 1;
- }
+
+ Invalidate();
+ m_Strings.Add( value );
+ return m_Strings.Count - 1;
}
public void SendTo( NetState state )
diff --git a/Server/Gumps/GumpImage.cs b/Server/Gumps/GumpImage.cs
index fa0dc375b..b6bccf711 100644
--- a/Server/Gumps/GumpImage.cs
+++ b/Server/Gumps/GumpImage.cs
@@ -69,8 +69,7 @@ namespace Server.Gumps
{
if ( m_Hue == 0 )
return $"{{ gumppic {m_X} {m_Y} {m_GumpID} }}";
- else
- return $"{{ gumppic {m_X} {m_Y} {m_GumpID} hue={m_Hue} }}";
+ return $"{{ gumppic {m_X} {m_Y} {m_GumpID} hue={m_Hue} }}";
}
private static byte[] m_LayoutName = Gump.StringToBuffer( "gumppic" );
diff --git a/Server/Gumps/GumpImageTileButton.cs b/Server/Gumps/GumpImageTileButton.cs
index 42946db30..13250e219 100644
--- a/Server/Gumps/GumpImageTileButton.cs
+++ b/Server/Gumps/GumpImageTileButton.cs
@@ -147,9 +147,8 @@ namespace Server.Gumps
if ( m_LocalizedTooltip > 0 )
return
$"{{ buttontileart {m_X} {m_Y} {m_ID1} {m_ID2} {(int) m_Type} {m_Param} {m_ButtonID} {m_ItemID} {m_Hue} {m_Width} {m_Height} }}{{ tooltip {m_LocalizedTooltip} }}";
- else
- return
- $"{{ buttontileart {m_X} {m_Y} {m_ID1} {m_ID2} {(int) m_Type} {m_Param} {m_ButtonID} {m_ItemID} {m_Hue} {m_Width} {m_Height} }}";
+ return
+ $"{{ buttontileart {m_X} {m_Y} {m_ID1} {m_ID2} {(int) m_Type} {m_Param} {m_ButtonID} {m_ItemID} {m_Hue} {m_Width} {m_Height} }}";
}
private static byte[] m_LayoutName = Gump.StringToBuffer( "buttontileart" );
diff --git a/Server/Gumps/GumpItem.cs b/Server/Gumps/GumpItem.cs
index 2c06cd1d9..064161b46 100644
--- a/Server/Gumps/GumpItem.cs
+++ b/Server/Gumps/GumpItem.cs
@@ -69,8 +69,7 @@ namespace Server.Gumps
{
if ( m_Hue == 0 )
return $"{{ tilepic {m_X} {m_Y} {m_ItemID} }}";
- else
- return $"{{ tilepichue {m_X} {m_Y} {m_ItemID} {m_Hue} }}";
+ return $"{{ tilepichue {m_X} {m_Y} {m_ItemID} {m_Hue} }}";
}
private static byte[] m_LayoutName = Gump.StringToBuffer( "tilepic" );
diff --git a/Server/Insensitive.cs b/Server/Insensitive.cs
index 439c14225..828b59df2 100644
--- a/Server/Insensitive.cs
+++ b/Server/Insensitive.cs
@@ -37,7 +37,7 @@ namespace Server
{
if ( a == null && b == null )
return true;
- else if ( a == null || b == null || a.Length != b.Length )
+ if ( a == null || b == null || a.Length != b.Length )
return false;
return ( m_Comparer.Compare( a, b ) == 0 );
diff --git a/Server/Item.cs b/Server/Item.cs
index 0f4cecffa..2174ef3e7 100644
--- a/Server/Item.cs
+++ b/Server/Item.cs
@@ -2694,10 +2694,9 @@ namespace Server
protected virtual Packet GetWorldPacketFor( NetState state ) {
if ( state.HighSeas )
return WorldPacketHS;
- else if ( state.StygianAbyss )
+ if ( state.StygianAbyss )
return WorldPacketSA;
- else
- return WorldPacket;
+ return WorldPacket;
}
public virtual bool IsVirtualItem => false;
@@ -2871,10 +2870,8 @@ namespace Server
{
break;
}
- else
- {
- p = item.m_Parent;
- }
+
+ p = item.m_Parent;
}
return p;
@@ -4079,8 +4076,7 @@ namespace Server
if ( root == null )
return m_Location;
- else
- return root.Location;
+ return root.Location;
//return root == null ? m_Location : new Point3D( (IPoint3D) root );
}
diff --git a/Server/Items/BaseMulti.cs b/Server/Items/BaseMulti.cs
index a7276fb22..757bfc10c 100644
--- a/Server/Items/BaseMulti.cs
+++ b/Server/Items/BaseMulti.cs
@@ -74,8 +74,7 @@ namespace Server.Items
if ( id < 0x4000 )
return 1020000 + id;
- else
- return 1078872 + id;
+ return 1078872 + id;
}
return base.LabelNumber;
@@ -129,16 +128,14 @@ namespace Server.Items
{
if ( m.Map == Map )
return Contains( m.X, m.Y );
- else
- return false;
+ return false;
}
public bool Contains( Item item )
{
if ( item.Map == Map )
return Contains( item.X, item.Y );
- else
- return false;
+ return false;
}
public override void Serialize( GenericWriter writer )
diff --git a/Server/Items/Container.cs b/Server/Items/Container.cs
index 205f7724e..b5f7ed652 100644
--- a/Server/Items/Container.cs
+++ b/Server/Items/Container.cs
@@ -151,7 +151,7 @@ namespace Server.Items
public override void OnSnoop( Mobile from )
{
- m_SnoopHandler?.Invoke( this, @from );
+ m_SnoopHandler?.Invoke( this, from );
}
public override bool CheckLift( Mobile from, Item item, ref LRReason reject )
@@ -373,7 +373,7 @@ namespace Server.Items
{
if ( types.Length != amounts.Length )
throw new ArgumentException();
- else if ( grouper == null )
+ if ( grouper == null )
throw new ArgumentNullException();
Item[][][] items = new Item[types.Length][][];
@@ -472,7 +472,7 @@ namespace Server.Items
{
if ( types.Length != amounts.Length )
throw new ArgumentException();
- else if ( grouper == null )
+ if ( grouper == null )
throw new ArgumentNullException();
Item[][][] items = new Item[types.Length][][];
@@ -1082,7 +1082,8 @@ namespace Server.Items
{
return item;
}
- else if ( recurse && item is Container )
+
+ if ( recurse && item is Container )
{
Item check = RecurseFindItemByType( item, type, recurse );
@@ -1119,7 +1120,8 @@ namespace Server.Items
{
return item;
}
- else if ( recurse && item is Container )
+
+ if ( recurse && item is Container )
{
Item check = RecurseFindItemByType( item, types, recurse );
@@ -1464,10 +1466,8 @@ namespace Server.Items
return true;
}
- else
- {
- return false;
- }
+
+ return false;
}
public virtual bool TryDropItem( Mobile from, Item dropped, bool sendFullMessage )
@@ -1873,8 +1873,7 @@ namespace Server.Items
if ( data != null )
return data;
- else
- return m_Default;
+ return m_Default;
}
private int m_GumpID;
diff --git a/Server/Items/Containers.cs b/Server/Items/Containers.cs
index d3bd1215d..361af98e3 100644
--- a/Server/Items/Containers.cs
+++ b/Server/Items/Containers.cs
@@ -125,26 +125,23 @@ namespace Server.Items
public override bool IsAccessibleTo(Mobile check)
{
- if ( ( check == m_Owner && m_Open ) || check.AccessLevel >= AccessLevel.GameMaster )
+ if ( ( check == m_Owner && m_Open ) || check.AccessLevel >= AccessLevel.GameMaster )
return base.IsAccessibleTo (check);
- else
- return false;
+ return false;
}
public override bool OnDragDrop( Mobile from, Item dropped )
{
- if ( ( from == m_Owner && m_Open ) || from.AccessLevel >= AccessLevel.GameMaster )
+ if ( ( from == m_Owner && m_Open ) || from.AccessLevel >= AccessLevel.GameMaster )
return base.OnDragDrop( from, dropped );
- else
- return false;
+ return false;
}
public override bool OnDragDropInto(Mobile from, Item item, Point3D p)
{
- if ( ( from == m_Owner && m_Open ) || from.AccessLevel >= AccessLevel.GameMaster )
+ if ( ( from == m_Owner && m_Open ) || from.AccessLevel >= AccessLevel.GameMaster )
return base.OnDragDropInto (from, item, p);
- else
- return false;
+ return false;
}
public override int GetTotal(TotalType type)
diff --git a/Server/Mobile.cs b/Server/Mobile.cs
index db1aedeef..0c3f36825 100644
--- a/Server/Mobile.cs
+++ b/Server/Mobile.cs
@@ -599,24 +599,21 @@ namespace Server
{
if ( m_HitsRegenRate == null )
return m_DefaultHitsRate;
- else
- return m_HitsRegenRate( m );
+ return m_HitsRegenRate( m );
}
public static TimeSpan GetStamRegenRate( Mobile m )
{
if ( m_StamRegenRate == null )
return m_DefaultStamRate;
- else
- return m_StamRegenRate( m );
+ return m_StamRegenRate( m );
}
public static TimeSpan GetManaRegenRate( Mobile m )
{
if ( m_ManaRegenRate == null )
return m_DefaultManaRate;
- else
- return m_ManaRegenRate( m );
+ return m_ManaRegenRate( m );
}
#endregion
@@ -1396,7 +1393,9 @@ namespace Server
_actions.Add( toLock );
return true;
- } else if ( !_actions.Contains( toLock ) ) {
+ }
+
+ if ( !_actions.Contains( toLock ) ) {
_actions.Add( toLock );
return true;
@@ -3180,7 +3179,7 @@ namespace Server
{
if ( !shoved.Alive || !Alive || shoved.IsDeadBondedPet || IsDeadBondedPet )
return true;
- else if ( shoved.m_Hidden && shoved.m_AccessLevel > AccessLevel.Player )
+ if ( shoved.m_Hidden && shoved.m_AccessLevel > AccessLevel.Player )
return true;
if ( !m_Pushing )
@@ -3810,14 +3809,12 @@ namespace Server
{
return m_BaseSoundID + 4;
}
- else if ( m_Body.IsHuman )
+
+ if ( m_Body.IsHuman )
{
return Utility.Random( m_Female ? 0x314 : 0x423, m_Female ? 4 : 5 );
}
- else
- {
- return -1;
- }
+ return -1;
}
#endregion
@@ -6313,7 +6310,8 @@ namespace Server
return null;
}
- public bool CloseGump( Type type ) {
+ public bool CloseGump( Type type )
+ {
if ( m_NetState != null ) {
Gump gump = FindGump( type );
@@ -6326,9 +6324,9 @@ namespace Server
}
return true;
- } else {
- return false;
}
+
+ return false;
}
[Obsolete( "Use CloseGump( Type ) instead." )]
@@ -6356,9 +6354,9 @@ namespace Server
}
return true;
- } else {
- return false;
}
+
+ return false;
}
[Obsolete( "Use CloseAllGumps() instead.", false )]
@@ -6383,11 +6381,12 @@ namespace Server
if ( m_NetState != null ) {
g.SendTo( m_NetState );
return true;
- } else if ( throwOnOffline ) {
- throw new MobileNotConnectedException( this, "Gump could not be sent." );
- } else {
- return false;
}
+
+ if ( throwOnOffline ) {
+ throw new MobileNotConnectedException( this, "Gump could not be sent." );
+ }
+ return false;
}
public bool SendMenu( IMenu m ) {
@@ -6398,11 +6397,12 @@ namespace Server
if ( m_NetState != null ) {
m.SendTo( m_NetState );
return true;
- } else if ( throwOnOffline ) {
- throw new MobileNotConnectedException( this, "Menu could not be sent." );
- } else {
- return false;
}
+
+ if ( throwOnOffline ) {
+ throw new MobileNotConnectedException( this, "Menu could not be sent." );
+ }
+ return false;
}
#endregion
@@ -8296,8 +8296,7 @@ namespace Server
return Map.Internal.DefaultRegion;
else
return Map.DefaultRegion;
- else
- return m_Region;
+ return m_Region;
}
}
@@ -9924,10 +9923,8 @@ namespace Server
return false;
}
- else
- {
- return true;
- }
+
+ return true;
}
#region Overhead messages
@@ -10530,16 +10527,14 @@ namespace Server
{
if ( m_SkillCheckLocationHandler == null )
return false;
- else
- return m_SkillCheckLocationHandler( this, skill, minSkill, maxSkill );
+ return m_SkillCheckLocationHandler( this, skill, minSkill, maxSkill );
}
public bool CheckSkill( SkillName skill, double chance )
{
if ( m_SkillCheckDirectLocationHandler == null )
return false;
- else
- return m_SkillCheckDirectLocationHandler( this, skill, chance );
+ return m_SkillCheckDirectLocationHandler( this, skill, chance );
}
public bool CheckTargetSkill( SkillName skill, object target, double minSkill, double maxSkill )
diff --git a/Server/Network/Compression.cs b/Server/Network/Compression.cs
index 90273d273..6d79c744b 100644
--- a/Server/Network/Compression.cs
+++ b/Server/Network/Compression.cs
@@ -88,15 +88,16 @@ namespace Server.Network {
{
throw new ArgumentNullException("input");
}
- else if (offset < 0 || offset >= input.Length)
+
+ if (offset < 0 || offset >= input.Length)
{
throw new ArgumentOutOfRangeException("offset");
}
- else if (count < 0 || count > input.Length)
+ if (count < 0 || count > input.Length)
{
throw new ArgumentOutOfRangeException("count");
}
- else if ((input.Length - offset) < count)
+ if ((input.Length - offset) < count)
{
throw new ArgumentException();
}
diff --git a/Server/Network/MessagePump.cs b/Server/Network/MessagePump.cs
index b67f3c1ed..2dc2707b0 100644
--- a/Server/Network/MessagePump.cs
+++ b/Server/Network/MessagePump.cs
@@ -139,7 +139,9 @@ namespace Server.Network
// 0xEF = 239 = multicast IP, so this should never appear in a normal seed. So this is backwards compatible with older clients.
ns.Seeded = true;
return true;
- } else if (buffer.Length >= 4) {
+ }
+
+ if (buffer.Length >= 4) {
byte[] m_Peek = new byte[4];
buffer.Dequeue(m_Peek, 0, 4);
@@ -155,9 +157,8 @@ namespace Server.Network
ns.m_Seed = seed;
ns.Seeded = true;
return true;
- } else {
- return false;
}
+ return false;
}
private bool CheckEncrypted(NetState ns, int packetID) {
@@ -216,12 +217,15 @@ namespace Server.Network
}
if ( length >= packetLength ) {
- if (handler.Ingame) {
+ if (handler.Ingame)
+ {
if (ns.Mobile == null ) {
Console.WriteLine( "Client: {0}: Sent ingame packet (0x{1:X2}) before having been attached to a mobile", ns, packetID );
ns.Dispose();
break;
- } else if (ns.Mobile.Deleted) {
+ }
+
+ if (ns.Mobile.Deleted) {
ns.Dispose();
break;
}
diff --git a/Server/Network/NetState.cs b/Server/Network/NetState.cs
index 15711880c..c04c01902 100644
--- a/Server/Network/NetState.cs
+++ b/Server/Network/NetState.cs
@@ -278,7 +278,9 @@ namespace Server.Network {
if ( from.Mobile == m_Mobile && to.Mobile == m ) {
return from.Container;
- } else if ( from.Mobile == m && to.Mobile == m_Mobile ) {
+ }
+
+ if ( from.Mobile == m && to.Mobile == m_Mobile ) {
return to.Container;
}
}
@@ -507,7 +509,7 @@ namespace Server.Network {
}
PacketSendProfile prof = null;
-
+
if (Core.Profiling) prof = PacketSendProfile.Acquire(p.GetType());
prof?.Start();
@@ -611,7 +613,9 @@ namespace Server.Network {
if ( e.SocketError != SocketError.Success || byteCount <= 0 ) {
Dispose( false );
return;
- } else if ( m_Disposing ) {
+ }
+
+ if ( m_Disposing ) {
return;
}
@@ -641,7 +645,7 @@ namespace Server.Network {
if ( result )
Send_Process( m_SendEventArgs );
- } while ( result );
+ } while ( result );
} catch ( Exception ex ) {
TraceException( ex );
Dispose( false );
@@ -931,8 +935,7 @@ namespace Server.Network {
{
if ( ContainerGridLines )
return PacketHandlers.Get6017Handler( packetID );
- else
- return PacketHandlers.GetHandler( packetID );
+ return PacketHandlers.GetHandler( packetID );
}
public static void FlushAll() {
@@ -1159,4 +1162,4 @@ namespace Server.Network {
return m_ToString.CompareTo( other.m_ToString );
}
}
-}
\ No newline at end of file
+}
diff --git a/Server/Network/PacketHandlers.cs b/Server/Network/PacketHandlers.cs
index 6f71e8928..d987b2a21 100644
--- a/Server/Network/PacketHandlers.cs
+++ b/Server/Network/PacketHandlers.cs
@@ -206,12 +206,9 @@ namespace Server.Network
{
if ( packetID >= 0 && packetID < 0x100 )
return m_ExtendedHandlersLow[packetID];
- else
- {
- PacketHandler handler;
- m_ExtendedHandlersHigh.TryGetValue( packetID, out handler );
- return handler;
- }
+ PacketHandler handler;
+ m_ExtendedHandlersHigh.TryGetValue( packetID, out handler );
+ return handler;
}
public static void RemoveExtendedHandler( int packetID )
@@ -234,12 +231,9 @@ namespace Server.Network
{
if ( packetID >= 0 && packetID < 0x100 )
return m_EncodedHandlersLow[packetID];
- else
- {
- EncodedPacketHandler handler;
- m_EncodedHandlersHigh.TryGetValue( packetID, out handler );
- return handler;
- }
+ EncodedPacketHandler handler;
+ m_EncodedHandlersHigh.TryGetValue( packetID, out handler );
+ return handler;
}
public static void RemoveEncodedHandler( int packetID )
@@ -410,7 +404,8 @@ namespace Server.Network
{
return;
}
- else if ( vendor.Deleted || !Utility.RangeCheck( vendor.Location, state.Mobile.Location, 10 ) )
+
+ if ( vendor.Deleted || !Utility.RangeCheck( vendor.Location, state.Mobile.Location, 10 ) )
{
state.Send( new EndVendorBuy( vendor ) );
return;
@@ -451,7 +446,8 @@ namespace Server.Network
{
return;
}
- else if ( vendor.Deleted || !Utility.RangeCheck( vendor.Location, state.Mobile.Location, 10 ) )
+
+ if ( vendor.Deleted || !Utility.RangeCheck( vendor.Location, state.Mobile.Location, 10 ) )
{
state.Send( new EndVendorSell( vendor ) );
return;
@@ -723,10 +719,8 @@ namespace Server.Network
state.Dispose();
return false;
}
- else
- {
- return true;
- }
+
+ return true;
}
public static void TextCommand( NetState state, PacketReader pvSrc )
@@ -1601,7 +1595,7 @@ namespace Server.Network
bool rightClick = pvSrc.ReadBoolean();
Mobile from = state.Mobile;
- @from?.QuestArrow?.OnClick( rightClick );
+ from?.QuestArrow?.OnClick( rightClick );
}
public static void ExtendedCommand( NetState state, PacketReader pvSrc )
@@ -2543,7 +2537,8 @@ namespace Server.Network
state.Dispose();
return;
}
- else if ( state.m_AuthID == 0 && authID != state.m_Seed )
+
+ if ( state.m_AuthID == 0 && authID != state.m_Seed )
{
Console.WriteLine( "Login: {0}: Invalid client detected, disconnecting", state );
state.Dispose();
diff --git a/Server/Network/Packets.cs b/Server/Network/Packets.cs
index 78a35b769..275a3f124 100644
--- a/Server/Network/Packets.cs
+++ b/Server/Network/Packets.cs
@@ -449,7 +449,7 @@ namespace Server.Network
public DeathAnimation( Mobile killed, Item corpse ) : base( 0xAF, 13 )
{
m_Stream.Write( (int) killed.Serial );
- m_Stream.Write( (int) (corpse == null ? Serial.Zero : corpse.Serial) );
+ m_Stream.Write( (int) (corpse?.Serial ?? Serial.Zero) );
m_Stream.Write( (int) 0 ) ;
}
}
@@ -591,7 +591,7 @@ namespace Server.Network
{
public ChangeCombatant( Mobile combatant ) : base( 0xAA, 5 )
{
- m_Stream.Write( combatant != null ? combatant.Serial : Serial.Zero );
+ m_Stream.Write( combatant?.Serial ?? Serial.Zero );
}
}
@@ -904,7 +904,7 @@ namespace Server.Network
IEntity target = menu.Target as IEntity;
- m_Stream.Write( (int) ( target == null ? Serial.MinusOne : target.Serial ) );
+ m_Stream.Write( (int) (target?.Serial ?? Serial.MinusOne) );
m_Stream.Write( (byte) length );
@@ -953,7 +953,7 @@ namespace Server.Network
IEntity target = menu.Target as IEntity;
- m_Stream.Write( (int) ( target == null ? Serial.MinusOne : target.Serial ) );
+ m_Stream.Write( (int) (target?.Serial ?? Serial.MinusOne) );
m_Stream.Write( (byte) length );
@@ -2746,7 +2746,7 @@ namespace Server.Network
EnsureCapacity( 6 );
m_Stream.Write( (short) 0x08 );
- m_Stream.Write( (byte) (m.Map == null ? 0 : m.Map.MapID) );
+ m_Stream.Write( (byte) (m.Map?.MapID ?? 0) );
}
}
@@ -2782,10 +2782,8 @@ namespace Server.Network
return p;
}
- else
- {
- return new SeasonChange( season, playSound );
- }
+
+ return new SeasonChange( season, playSound );
}
public SeasonChange( int season ) : this( season, true )
@@ -3338,10 +3336,9 @@ namespace Server.Network
{
if (ns.NewMobileIncoming)
return new MobileIncoming(beholder, beheld);
- else if (ns.StygianAbyss)
+ if (ns.StygianAbyss)
return new MobileIncomingSA(beholder, beheld);
- else
- return new MobileIncomingOld(beholder, beheld);
+ return new MobileIncomingOld(beholder, beheld);
}
private static ThreadLocal m_DupedLayersTL = new ThreadLocal(() => {return new int[256];});
@@ -3842,8 +3839,8 @@ namespace Server.Network
m_Stream.Write( (short) 0 );
m_Stream.Write( (short) 0 );
- m_Stream.Write( (short) (map==null?6144:map.Width) );
- m_Stream.Write( (short) (map==null?4096:map.Height) );
+ m_Stream.Write( (short) (map?.Width ?? 6144) );
+ m_Stream.Write( (short) (map?.Height ?? 4096) );
m_Stream.Fill();
}
diff --git a/Server/Network/SendQueue.cs b/Server/Network/SendQueue.cs
index a8e0b0e73..127d160ab 100644
--- a/Server/Network/SendQueue.cs
+++ b/Server/Network/SendQueue.cs
@@ -148,15 +148,19 @@ namespace Server.Network {
public Gram Enqueue( byte[] buffer, int offset, int length ) {
if ( buffer == null ) {
throw new ArgumentNullException( "buffer" );
- } else if ( !(offset >= 0 && offset < buffer.Length) ) {
+ }
+
+ if ( !(offset >= 0 && offset < buffer.Length) ) {
throw new ArgumentOutOfRangeException( "offset", offset, "Offset must be greater than or equal to zero and less than the size of the buffer." );
- } else if ( length < 0 || length > buffer.Length ) {
+ }
+ if ( length < 0 || length > buffer.Length ) {
throw new ArgumentOutOfRangeException( "length", length, "Length cannot be less than zero or greater than the size of the buffer." );
- } else if ( ( buffer.Length - offset ) < length ) {
+ }
+ if ( ( buffer.Length - offset ) < length ) {
throw new ArgumentException( "Offset and length do not point to a valid segment within the buffer." );
}
- int existingBytes = ( _pending.Count * m_CoalesceBufferSize ) + ( _buffered == null ? 0 : _buffered.Length );
+ int existingBytes = ( _pending.Count * m_CoalesceBufferSize ) + (_buffered?.Length ?? 0);
if ( ( existingBytes + length ) > PendingCap ) {
throw new CapacityExceededException();
diff --git a/Server/Notoriety.cs b/Server/Notoriety.cs
index 3614e3868..0ef104ff6 100644
--- a/Server/Notoriety.cs
+++ b/Server/Notoriety.cs
@@ -67,7 +67,7 @@ namespace Server
public static int Compute( Mobile source, Mobile target )
{
- return m_Handler == null ? CanBeAttacked : m_Handler( source, target );
+ return m_Handler?.Invoke( source, target ) ?? CanBeAttacked;
}
}
}
\ No newline at end of file
diff --git a/Server/Persistence/FileQueue.cs b/Server/Persistence/FileQueue.cs
index 62cf3a328..0c6862226 100644
--- a/Server/Persistence/FileQueue.cs
+++ b/Server/Persistence/FileQueue.cs
@@ -87,9 +87,12 @@ namespace Server {
public FileQueue( int concurrentWrites, FileCommitCallback callback ) {
if ( concurrentWrites < 1 ) {
throw new ArgumentOutOfRangeException( "concurrentWrites" );
- } else if ( bufferSize < 1 ) {
+ }
+
+ if ( bufferSize < 1 ) {
throw new ArgumentOutOfRangeException( "bufferSize" );
- } else if ( callback == null ) {
+ }
+ if ( callback == null ) {
throw new ArgumentNullException( "callback" );
}
@@ -194,11 +197,15 @@ namespace Server {
public void Enqueue( byte[] buffer, int offset, int size ) {
if ( buffer == null ) {
throw new ArgumentNullException( "buffer" );
- } else if ( offset < 0 ) {
+ }
+
+ if ( offset < 0 ) {
throw new ArgumentOutOfRangeException( "offset" );
- } else if ( size < 0 ) {
+ }
+ if ( size < 0 ) {
throw new ArgumentOutOfRangeException( "size" );
- } else if ( ( buffer.Length - offset ) < size ) {
+ }
+ if ( ( buffer.Length - offset ) < size ) {
throw new ArgumentException();
}
diff --git a/Server/Persistence/SaveStrategy.cs b/Server/Persistence/SaveStrategy.cs
index 57564eb70..94bb4e6a4 100644
--- a/Server/Persistence/SaveStrategy.cs
+++ b/Server/Persistence/SaveStrategy.cs
@@ -32,15 +32,11 @@ namespace Server
{
return new DualSaveStrategy(); // return new DynamicSaveStrategy(); (4.0 or return new ParallelSaveStrategy(processorCount); (2.0)
}
- else
- {
- return new DualSaveStrategy();
- }
- }
- else
- {
- return new StandardSaveStrategy();
+
+ return new DualSaveStrategy();
}
+
+ return new StandardSaveStrategy();
}
public abstract string Name { get; }
diff --git a/Server/Poison.cs b/Server/Poison.cs
index cd08477ab..98f6ad696 100644
--- a/Server/Poison.cs
+++ b/Server/Poison.cs
@@ -47,10 +47,10 @@ namespace Server
for ( int i = 0; i < m_Poisons.Count; i++ )
{
- if ( reg.Level == m_Poisons[i].Level )
+ if ( reg.Level == m_Poisons[i].Level )
throw new Exception( "A poison with that level already exists." );
- else if ( regName == m_Poisons[i].Name.ToLower() )
- throw new Exception( "A poison with that name already exists." );
+ if ( regName == m_Poisons[i].Name.ToLower() )
+ throw new Exception( "A poison with that name already exists." );
}
m_Poisons.Add( reg );
diff --git a/Server/Region.cs b/Server/Region.cs
index b9a360c00..1301535a4 100644
--- a/Server/Region.cs
+++ b/Server/Region.cs
@@ -194,7 +194,7 @@ namespace Server
}
public bool IsDefault => m_Map.DefaultRegion == this;
- public virtual MusicName DefaultMusic => m_Parent != null ? m_Parent.Music : MusicName.Invalid;
+ public virtual MusicName DefaultMusic => m_Parent?.Music ?? MusicName.Invalid;
public Region( string name, Map map, int priority, params Rectangle2D[] area ) : this( name, map, priority, ConvertTo3D( area ) )
{
@@ -526,8 +526,7 @@ namespace Server
{
if ( m_Name != null )
return m_Name;
- else
- return GetType().Name;
+ return GetType().Name;
}
@@ -790,10 +789,9 @@ namespace Server
{
if ( m_Parent != null )
return m_Parent.GetLogoutDelay( m );
- else if ( m.AccessLevel > AccessLevel.Player )
+ if ( m.AccessLevel > AccessLevel.Player )
return m_StaffLogoutDelay;
- else
- return m_DefaultLogoutDelay;
+ return m_DefaultLogoutDelay;
}
@@ -833,8 +831,8 @@ namespace Server
while ( oldR != newR )
{
- int oldRChild = ( oldR != null ? oldR.ChildLevel : -1 );
- int newRChild = ( newR != null ? newR.ChildLevel : -1 );
+ int oldRChild = oldR?.ChildLevel ?? -1;
+ int newRChild = newR?.ChildLevel ?? -1;
if ( oldRChild >= newRChild )
{
@@ -992,17 +990,15 @@ namespace Server
return null;
}
- else if ( xml.HasAttribute( attribute ) )
+
+ if ( xml.HasAttribute( attribute ) )
{
return xml.GetAttribute( attribute );
}
- else
- {
- if ( mandatory )
- Console.WriteLine( "Missing attribute '{0}' in element '{1}'", attribute, xml.Name );
+ if ( mandatory )
+ Console.WriteLine( "Missing attribute '{0}' in element '{1}'", attribute, xml.Name );
- return null;
- }
+ return null;
}
public static bool ReadString( XmlElement xml, string attribute, ref string value )
@@ -1142,11 +1138,9 @@ namespace Server
value = tempVal;
return true;
}
- else
- {
- Console.WriteLine( "Could not parse {0} enum attribute '{1}' in element '{2}'", type, attribute, xml.Name );
- return false;
- }
+
+ Console.WriteLine( "Could not parse {0} enum attribute '{1}' in element '{2}'", type, attribute, xml.Name );
+ return false;
}
public static bool ReadMap( XmlElement xml, string attribute, ref Map value )
diff --git a/Server/ScriptCompiler.cs b/Server/ScriptCompiler.cs
index 43111b161..3ece619e0 100644
--- a/Server/ScriptCompiler.cs
+++ b/Server/ScriptCompiler.cs
@@ -92,7 +92,7 @@ namespace Server
AppendCompilerOption(ref sb, "/d:NEWPARENT");
#endif
- return (sb == null ? null : sb.ToString());
+ return sb?.ToString();
}
private static void AppendCompilerOption( ref StringBuilder sb, string define )
diff --git a/Server/Sector.cs b/Server/Sector.cs
index 2d81f9ca2..3bb0358a4 100644
--- a/Server/Sector.cs
+++ b/Server/Sector.cs
@@ -97,7 +97,7 @@ namespace Server {
private void Replace( ref List list, T oldValue, T newValue ) {
if ( oldValue != null && newValue != null ) {
- int index = ( list != null ? list.IndexOf( oldValue ) : -1 );
+ int index = list?.IndexOf( oldValue ) ?? -1;
if ( index >= 0 ) {
list[index] = newValue;
diff --git a/Server/Serialization.cs b/Server/Serialization.cs
index 34cb6a99d..1227789e3 100644
--- a/Server/Serialization.cs
+++ b/Server/Serialization.cs
@@ -969,8 +969,7 @@ namespace Server
{
if ( ReadByte() != 0 )
return m_File.ReadString();
- else
- return null;
+ return null;
}
public override DateTime ReadDeltaTime()
@@ -980,11 +979,15 @@ namespace Server
if ( ticks > 0 && (ticks+now) < 0 )
return DateTime.MaxValue;
- else if ( ticks < 0 && (ticks+now) < 0 )
+ if ( ticks < 0 && (ticks+now) < 0 )
return DateTime.MinValue;
try { return new DateTime( now+ticks ); }
- catch { if ( ticks > 0 ) return DateTime.MaxValue; else return DateTime.MinValue; }
+ catch
+ {
+ if ( ticks > 0 ) return DateTime.MaxValue;
+ return DateTime.MinValue;
+ }
}
public override IPAddress ReadIPAddress()
@@ -1121,8 +1124,7 @@ namespace Server
IEntity entity = World.FindEntity( serial );
if ( entity == null )
return new Entity( serial, new Point3D( 0, 0, 0 ), Map.Internal );
- else
- return entity;
+ return entity;
}
public override Item ReadItem()
@@ -1171,9 +1173,9 @@ namespace Server
}
return list;
- } else {
- return new ArrayList();
}
+
+ return new ArrayList();
}
public override ArrayList ReadMobileList()
@@ -1192,9 +1194,9 @@ namespace Server
}
return list;
- } else {
- return new ArrayList();
}
+
+ return new ArrayList();
}
public override ArrayList ReadGuildList()
@@ -1213,9 +1215,9 @@ namespace Server
}
return list;
- } else {
- return new ArrayList();
}
+
+ return new ArrayList();
}
public override List
- ReadStrongItemList()
diff --git a/Server/Skills.cs b/Server/Skills.cs
index 889b83c62..5a7c54bbe 100644
--- a/Server/Skills.cs
+++ b/Server/Skills.cs
@@ -847,9 +847,9 @@ namespace Server
{
if ( !from.CheckAlive() )
return false;
- else if ( !from.Region.OnSkillUse( from, skillID ) )
+ if ( !from.Region.OnSkillUse( from, skillID ) )
return false;
- else if ( !from.AllowSkillUse( (SkillName)skillID ) )
+ if ( !from.AllowSkillUse( (SkillName)skillID ) )
return false;
if ( skillID >= 0 && skillID < SkillInfo.Table.Length )
@@ -866,10 +866,8 @@ namespace Server
return true;
}
- else
- {
- from.SendSkillMessage();
- }
+
+ from.SendSkillMessage();
}
else
{
diff --git a/Server/Targeting/MultiTarget.cs b/Server/Targeting/MultiTarget.cs
index b1fe2ef34..19b1e012a 100644
--- a/Server/Targeting/MultiTarget.cs
+++ b/Server/Targeting/MultiTarget.cs
@@ -55,8 +55,7 @@ namespace Server.Targeting
{
if ( ns.HighSeas )
return new MultiTargetReqHS( this );
- else
- return new MultiTargetReq( this );
+ return new MultiTargetReq( this );
}
}
}
\ No newline at end of file
diff --git a/Server/TileData.cs b/Server/TileData.cs
index 5f918b493..caf6aa1ed 100644
--- a/Server/TileData.cs
+++ b/Server/TileData.cs
@@ -153,8 +153,7 @@ namespace Server
{
if ( (m_Flags & TileFlag.Bridge) != 0 )
return m_Height / 2;
- else
- return m_Height;
+ return m_Height;
}
}
}
diff --git a/Server/TileMatrix.cs b/Server/TileMatrix.cs
index ae3ee2f8e..221602686 100644
--- a/Server/TileMatrix.cs
+++ b/Server/TileMatrix.cs
@@ -304,10 +304,8 @@ namespace Server
return m_TilesList.ToArray();
}
- else
- {
- return tiles[x & 0x7][y & 0x7];
- }
+
+ return tiles[x & 0x7][y & 0x7];
}
[MethodImpl(MethodImplOptions.Synchronized)]
@@ -399,59 +397,57 @@ namespace Server
{
return m_EmptyStaticBlock;
}
- else
+
+ int count = length / 7;
+
+ m_Statics.Seek( lookup, SeekOrigin.Begin );
+
+ if ( m_TileBuffer.Length < count )
+ m_TileBuffer = new StaticTile[count];
+
+ StaticTile[] staTiles = m_TileBuffer;//new StaticTile[tileCount];
+
+ fixed ( StaticTile *pTiles = staTiles )
{
- int count = length / 7;
-
- m_Statics.Seek( lookup, SeekOrigin.Begin );
-
- if ( m_TileBuffer.Length < count )
- m_TileBuffer = new StaticTile[count];
-
- StaticTile[] staTiles = m_TileBuffer;//new StaticTile[tileCount];
-
- fixed ( StaticTile *pTiles = staTiles )
- {
#if !MONO
- NativeReader.Read( m_Statics.SafeFileHandle.DangerousGetHandle(), pTiles, length );
+ NativeReader.Read( m_Statics.SafeFileHandle.DangerousGetHandle(), pTiles, length );
#else
NativeReader.Read( m_Statics.Handle, pTiles, length );
#endif
- if ( m_Lists == null )
- {
- m_Lists = new TileList[8][];
-
- for ( int i = 0; i < 8; ++i )
- {
- m_Lists[i] = new TileList[8];
-
- for ( int j = 0; j < 8; ++j )
- m_Lists[i][j] = new TileList();
- }
- }
-
- TileList[][] lists = m_Lists;
-
- StaticTile *pCur = pTiles, pEnd = pTiles + count;
-
- 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][][];
+ if ( m_Lists == null )
+ {
+ m_Lists = new TileList[8][];
for ( int i = 0; i < 8; ++i )
{
- tiles[i] = new StaticTile[8][];
+ m_Lists[i] = new TileList[8];
for ( int j = 0; j < 8; ++j )
- tiles[i][j] = lists[i][j].ToArray();
+ m_Lists[i][j] = new TileList();
}
-
- return tiles;
}
+
+ TileList[][] lists = m_Lists;
+
+ StaticTile *pCur = pTiles, pEnd = pTiles + count;
+
+ 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 i = 0; i < 8; ++i )
+ {
+ tiles[i] = new StaticTile[8][];
+
+ for ( int j = 0; j < 8; ++j )
+ tiles[i][j] = lists[i][j].ToArray();
+ }
+
+ return tiles;
}
}
catch ( EndOfStreamException )
diff --git a/Server/Utility.cs b/Server/Utility.cs
index 5ec3bd3ce..84a45dda9 100644
--- a/Server/Utility.cs
+++ b/Server/Utility.cs
@@ -68,7 +68,7 @@ namespace Server
{
if ( str == null )
return null;
- else if ( str.Length == 0 )
+ if ( str.Length == 0 )
return string.Empty;
return string.Intern( str );
@@ -683,30 +683,24 @@ namespace Server
{
if ( dx > 0 )
return Direction.East;
- else
- return Direction.West;
+ return Direction.West;
}
- else if ( ady >= adx * 3 )
+
+ if ( ady >= adx * 3 )
{
if ( dy > 0 )
return Direction.South;
- else
- return Direction.North;
+ return Direction.North;
}
- else if ( dx > 0 )
+ if ( dx > 0 )
{
if ( dy > 0 )
return Direction.Down;
- else
- return Direction.Right;
- }
- else
- {
- if ( dy > 0 )
- return Direction.Left;
- else
- return Direction.Up;
+ return Direction.Right;
}
+ if ( dy > 0 )
+ return Direction.Left;
+ return Direction.Up;
}
/* Should probably be rewritten to use an ITile interface
@@ -776,10 +770,8 @@ namespace Server
return array.GetValue( index );
}
- else
- {
- return emptyValue;
- }
+
+ return emptyValue;
}
#region Random
@@ -825,11 +817,12 @@ namespace Server
{
if ( count == 0 ) {
return from;
- } else if ( count > 0 ) {
- return from + RandomImpl.Next(count);
- } else {
- return from - RandomImpl.Next(-count);
}
+
+ if ( count > 0 ) {
+ return from + RandomImpl.Next(count);
+ }
+ return from - RandomImpl.Next(-count);
}
public static int Random( int count )
@@ -968,10 +961,9 @@ namespace Server
{
if ( hue < 2 )
return 2;
- else if ( hue > 1001 )
+ if ( hue > 1001 )
return 1001;
- else
- return hue;
+ return hue;
}
///
@@ -998,10 +990,9 @@ namespace Server
{
if ( hue < 1002 )
return 1002;
- else if ( hue > 1058 )
+ if ( hue > 1058 )
return 1058;
- else
- return hue;
+ return hue;
}
//[Obsolete( "Depreciated, use the methods for the Mobile's race", false )]
@@ -1015,10 +1006,9 @@ namespace Server
{
if ( hue < 1102 )
return 1102;
- else if ( hue > 1149 )
+ if ( hue > 1149 )
return 1149;
- else
- return hue;
+ return hue;
}
//[Obsolete( "Depreciated, use the methods for the Mobile's race", false )]
diff --git a/Server/VirtueInfo.cs b/Server/VirtueInfo.cs
index 4e624b43d..bd05dacb8 100644
--- a/Server/VirtueInfo.cs
+++ b/Server/VirtueInfo.cs
@@ -31,8 +31,7 @@ namespace Server
{
if ( m_Values == null )
return 0;
- else
- return m_Values[index];
+ return m_Values[index];
}
public void SetValue( int index, int value )
diff --git a/Server/World.cs b/Server/World.cs
index 9d470c971..d7c6dd492 100644
--- a/Server/World.cs
+++ b/Server/World.cs
@@ -127,7 +127,7 @@ namespace Server {
public BaseGuild Guild => m_Guild;
- public Serial Serial => m_Guild == null ? 0 : m_Guild.Id;
+ public Serial Serial => m_Guild?.Id ?? 0;
public int TypeID => 0;
@@ -151,7 +151,7 @@ namespace Server {
public Item Item => m_Item;
- public Serial Serial => m_Item == null ? Serial.MinusOne : m_Item.Serial;
+ public Serial Serial => m_Item?.Serial ?? Serial.MinusOne;
public int TypeID => m_TypeID;
@@ -179,7 +179,7 @@ namespace Server {
public Mobile Mobile => m_Mobile;
- public Serial Serial => m_Mobile == null ? Serial.MinusOne : m_Mobile.Serial;
+ public Serial Serial => m_Mobile?.Serial ?? Serial.MinusOne;
public int TypeID => m_TypeID;
@@ -728,7 +728,7 @@ namespace Server {
public static IEntity FindEntity( Serial serial ) {
if ( serial.IsItem )
return FindItem( serial );
- else if ( serial.IsMobile )
+ if ( serial.IsMobile )
return FindMobile( serial );
return null;