Fixes implicit ternary expressions
This commit is contained in:
parent
c85b0a740c
commit
ff26dfa375
345 changed files with 1905 additions and 2336 deletions
|
|
@ -24,7 +24,8 @@ namespace Server
|
||||||
e.AllowConnection = false;
|
e.AllowConnection = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if ( IPLimiter.SocketBlock && !IPLimiter.Verify( ip ) )
|
|
||||||
|
if ( IPLimiter.SocketBlock && !IPLimiter.Verify( ip ) )
|
||||||
{
|
{
|
||||||
Console.WriteLine( "Client: {0}: Past IP limit threshold", ip );
|
Console.WriteLine( "Client: {0}: Past IP limit threshold", ip );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
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.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 )
|
if ( !e.Accepted )
|
||||||
e.RejectReason = ALRReason.BadComm;
|
e.RejectReason = ALRReason.BadComm;
|
||||||
|
|
|
||||||
|
|
@ -219,33 +219,30 @@ namespace Server.Commands
|
||||||
{
|
{
|
||||||
return Enum.Parse( type, value, true );
|
return Enum.Parse( type, value, true );
|
||||||
}
|
}
|
||||||
else if ( IsType( type ) )
|
|
||||||
|
if ( IsType( type ) )
|
||||||
{
|
{
|
||||||
return ScriptCompiler.FindTypeByName( value );
|
return ScriptCompiler.FindTypeByName( value );
|
||||||
}
|
}
|
||||||
else if ( IsParsable( type ) )
|
if ( IsParsable( type ) )
|
||||||
{
|
{
|
||||||
return ParseParsable( type, value );
|
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" ) )
|
obj = Convert.ToInt32( value.Substring( 2 ), 16 );
|
||||||
{
|
|
||||||
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 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( obj == null && !type.IsValueType )
|
||||||
|
return null;
|
||||||
|
return Convert.ChangeType( obj, type );
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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 );
|
e.Mobile.SendMessage( "That is either an invalid command name or one that does not support this modifier: {0}.", commandString );
|
||||||
return;
|
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 );
|
e.Mobile.SendMessage( "You do not have access to that command: {0}.", commandString );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if ( !command.ValidateArgs( m_Scope, eventArgs[i] ) )
|
if ( !command.ValidateArgs( m_Scope, eventArgs[i] ) )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -157,12 +158,13 @@ namespace Server.Commands
|
||||||
from.SendMessage( "You must select the batch command scope." );
|
from.SendMessage( "You must select the batch command scope." );
|
||||||
return false;
|
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." );
|
from.SendMessage( "This command scope does not support conditionals." );
|
||||||
return false;
|
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\"." );
|
from.SendMessage( "The condition field must start with \"where\"." );
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ namespace Server.Commands
|
||||||
|
|
||||||
if ( aStatic && !bStatic )
|
if ( aStatic && !bStatic )
|
||||||
return -1;
|
return -1;
|
||||||
else if ( !aStatic && bStatic )
|
if ( !aStatic && bStatic )
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
int v = 0;
|
int v = 0;
|
||||||
|
|
@ -115,7 +115,7 @@ namespace Server.Commands
|
||||||
{
|
{
|
||||||
if ( ctor != null )
|
if ( ctor != null )
|
||||||
return ctor.IsStatic;
|
return ctor.IsStatic;
|
||||||
else if ( method != null )
|
if ( method != null )
|
||||||
return method.IsStatic;
|
return method.IsStatic;
|
||||||
|
|
||||||
if ( prop != null )
|
if ( prop != null )
|
||||||
|
|
@ -133,12 +133,11 @@ namespace Server.Commands
|
||||||
{
|
{
|
||||||
if ( ctor != null )
|
if ( ctor != null )
|
||||||
return ctor.DeclaringType.Name;
|
return ctor.DeclaringType.Name;
|
||||||
else if ( prop != null )
|
if ( prop != null )
|
||||||
return prop.Name;
|
return prop.Name;
|
||||||
else if ( method != null )
|
if ( method != null )
|
||||||
return method.Name;
|
return method.Name;
|
||||||
else
|
return "";
|
||||||
return "";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -148,9 +147,9 @@ namespace Server.Commands
|
||||||
{
|
{
|
||||||
if ( x == null && y == null )
|
if ( x == null && y == null )
|
||||||
return 0;
|
return 0;
|
||||||
else if ( x == null )
|
if ( x == null )
|
||||||
return -1;
|
return -1;
|
||||||
else if ( y == null )
|
if ( y == null )
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
return x.TypeName.CompareTo( y.TypeName );
|
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], '-' ); }
|
for( int i = 0; i < ReplaceChars.Length; ++i ) { sb.Replace( ReplaceChars[i], '-' ); }
|
||||||
|
|
||||||
if ( anonymousType ) return "(Anonymous-Type)"+sb.ToString();
|
if ( anonymousType ) return "(Anonymous-Type)"+sb.ToString();
|
||||||
else return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string AliasForName( string name )
|
public static string AliasForName( string name )
|
||||||
|
|
|
||||||
|
|
@ -308,7 +308,8 @@ namespace Server.Commands.Generic
|
||||||
m_From.SendGump( new InterfaceGump( m_From, m_Columns, m_List, m_Page, m_Item ) );
|
m_From.SendGump( new InterfaceGump( m_From, m_Columns, m_List, m_Page, m_Item ) );
|
||||||
return;
|
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.SendMessage( "That is no longer accessible." );
|
||||||
m_From.SendGump( new InterfaceGump( m_From, m_Columns, m_List, m_Page, m_Item ) );
|
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 ) );
|
m_From.SendGump( new InterfaceGump( m_From, m_Columns, m_List, m_Page, m_Mobile ) );
|
||||||
return;
|
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.SendMessage( "That is no longer accessible." );
|
||||||
m_From.SendGump( new InterfaceGump( m_From, m_Columns, m_List, m_Page, m_Mobile ) );
|
m_From.SendGump( new InterfaceGump( m_From, m_Columns, m_List, m_Page, m_Mobile ) );
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ namespace Server.Commands.Generic
|
||||||
{
|
{
|
||||||
RangeCommandImplementor impl = RangeCommandImplementor.Instance;
|
RangeCommandImplementor impl = RangeCommandImplementor.Instance;
|
||||||
|
|
||||||
impl?.Process( 18, @from, command, args );
|
impl?.Process( 18, from, command, args );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -628,7 +628,7 @@ namespace Server.Commands
|
||||||
|
|
||||||
Mobile owner = item.RootParent as Mobile;
|
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." );
|
from.SendMessage( "You can not go to what you can not see." );
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -45,8 +45,8 @@ namespace Server.Commands
|
||||||
|
|
||||||
return;
|
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 ) );
|
e.Mobile.SendGump( new CommandListGump( 0, e.Mobile, null ) );
|
||||||
|
|
|
||||||
|
|
@ -113,26 +113,27 @@ namespace Server.Commands
|
||||||
failReason = $"Property '{propertyName}' not found.";
|
failReason = $"Property '{propertyName}' not found.";
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
else if ( (access & PropertyAccess.Read) != 0 && from.AccessLevel < attr.ReadLevel )
|
|
||||||
|
if ( (access & PropertyAccess.Read) != 0 && from.AccessLevel < attr.ReadLevel )
|
||||||
{
|
{
|
||||||
failReason =
|
failReason =
|
||||||
$"You must be at least {Mobile.GetAccessLevelName(attr.ReadLevel)} to get the property '{propertyName}'.";
|
$"You must be at least {Mobile.GetAccessLevelName(attr.ReadLevel)} to get the property '{propertyName}'.";
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
else if ( (access & PropertyAccess.Write) != 0 && from.AccessLevel < attr.WriteLevel )
|
if ( (access & PropertyAccess.Write) != 0 && from.AccessLevel < attr.WriteLevel )
|
||||||
{
|
{
|
||||||
failReason =
|
failReason =
|
||||||
$"You must be at least {Mobile.GetAccessLevelName(attr.WriteLevel)} to set the property '{propertyName}'.";
|
$"You must be at least {Mobile.GetAccessLevelName(attr.WriteLevel)} to set the property '{propertyName}'.";
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
else if ( (access & PropertyAccess.Read) != 0 && !p.CanRead )
|
if ( (access & PropertyAccess.Read) != 0 && !p.CanRead )
|
||||||
{
|
{
|
||||||
failReason = $"Property '{propertyName}' is write only.";
|
failReason = $"Property '{propertyName}' is write only.";
|
||||||
return null;
|
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.";
|
failReason = $"Property '{propertyName}' is read only.";
|
||||||
return null;
|
return null;
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ namespace Server.Engines.BulkOrders
|
||||||
{
|
{
|
||||||
if ( material >= BulkMaterialType.DullCopper && material <= BulkMaterialType.Valorite )
|
if ( material >= BulkMaterialType.DullCopper && material <= BulkMaterialType.Valorite )
|
||||||
return 1045142 + (int)(material - BulkMaterialType.DullCopper);
|
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 1049348 + (int)(material - BulkMaterialType.Spined);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ namespace Server.Engines.BulkOrders
|
||||||
{
|
{
|
||||||
if ( material >= BulkMaterialType.DullCopper && material <= BulkMaterialType.Valorite )
|
if ( material >= BulkMaterialType.DullCopper && material <= BulkMaterialType.Valorite )
|
||||||
return 1045142 + (int)(material - BulkMaterialType.DullCopper);
|
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 1049348 + (int)(material - BulkMaterialType.Spined);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ namespace Server.Engines.BulkOrders
|
||||||
{
|
{
|
||||||
if ( m_Items.Length == 0 )
|
if ( m_Items.Length == 0 )
|
||||||
return null;
|
return null;
|
||||||
else if ( m_Items.Length == 1 )
|
if ( m_Items.Length == 1 )
|
||||||
return m_Items[0];
|
return m_Items[0];
|
||||||
|
|
||||||
int totalWeight = 0;
|
int totalWeight = 0;
|
||||||
|
|
@ -203,9 +203,9 @@ namespace Server.Engines.BulkOrders
|
||||||
{
|
{
|
||||||
if ( type == 1 )
|
if ( type == 1 )
|
||||||
return new LeatherGlovesOfMining( 1 );
|
return new LeatherGlovesOfMining( 1 );
|
||||||
else if ( type == 3 )
|
if ( type == 3 )
|
||||||
return new StuddedGlovesOfMining( 3 );
|
return new StuddedGlovesOfMining( 3 );
|
||||||
else if ( type == 5 )
|
if ( type == 5 )
|
||||||
return new RingmailGlovesOfMining( 5 );
|
return new RingmailGlovesOfMining( 5 );
|
||||||
|
|
||||||
throw new InvalidOperationException();
|
throw new InvalidOperationException();
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ namespace Server.Engines.BulkOrders
|
||||||
{
|
{
|
||||||
if ( material >= BulkMaterialType.DullCopper && material <= BulkMaterialType.Valorite )
|
if ( material >= BulkMaterialType.DullCopper && material <= BulkMaterialType.Valorite )
|
||||||
return 1045142 + (int)(material - BulkMaterialType.DullCopper);
|
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 1049348 + (int)(material - BulkMaterialType.Spined);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ namespace Server.Engines.BulkOrders
|
||||||
{
|
{
|
||||||
if ( material >= BulkMaterialType.DullCopper && material <= BulkMaterialType.Valorite )
|
if ( material >= BulkMaterialType.DullCopper && material <= BulkMaterialType.Valorite )
|
||||||
return 1045142 + (int)(material - BulkMaterialType.DullCopper);
|
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 1049348 + (int)(material - BulkMaterialType.Spined);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
|
|
@ -666,7 +666,7 @@ namespace Server.Engines.CannedEvil
|
||||||
return new Point3D( x, y, z );
|
return new Point3D( x, y, z );
|
||||||
|
|
||||||
/* try @ platform Z if map z fails */
|
/* 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 );
|
return new Point3D( x, y, m_Platform.Location.Z );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -683,9 +683,9 @@ namespace Server.Engines.CannedEvil
|
||||||
|
|
||||||
if ( level <= Level1 )
|
if ( level <= Level1 )
|
||||||
return 0;
|
return 0;
|
||||||
else if ( level <= Level2 )
|
if ( level <= Level2 )
|
||||||
return 1;
|
return 1;
|
||||||
else if ( level <= Level3 )
|
if ( level <= Level3 )
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
return 3;
|
return 3;
|
||||||
|
|
|
||||||
|
|
@ -121,34 +121,32 @@ namespace Server.Engines.Chat
|
||||||
user.SendMessage( 46, m_Name ); // You are already in the conference '%1'.
|
user.SendMessage( 46, m_Name ); // You are already in the conference '%1'.
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if ( IsBanned( user ) )
|
|
||||||
|
if ( IsBanned( user ) )
|
||||||
{
|
{
|
||||||
user.SendMessage( 64 ); // You have been banned from this conference.
|
user.SendMessage( 64 ); // You have been banned from this conference.
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if ( !ValidatePassword( password ) )
|
if ( !ValidatePassword( password ) )
|
||||||
{
|
{
|
||||||
user.SendMessage( 34 ); // That is not the correct password.
|
user.SendMessage( 34 ); // That is not the correct password.
|
||||||
return false;
|
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 )
|
public void RemoveUser( ChatUser user )
|
||||||
|
|
|
||||||
|
|
@ -153,7 +153,8 @@ namespace Server.Engines.ConPVP
|
||||||
ie.Refresh();
|
ie.Refresh();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if ( ie.Expired )
|
|
||||||
|
if ( ie.Expired )
|
||||||
{
|
{
|
||||||
list.RemoveAt( i-- );
|
list.RemoveAt( i-- );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -821,9 +821,9 @@ namespace Server.Engines.ConPVP
|
||||||
|
|
||||||
if ( a == null && b == null )
|
if ( a == null && b == null )
|
||||||
return 0;
|
return 0;
|
||||||
else if ( a == null )
|
if ( a == null )
|
||||||
return -1;
|
return -1;
|
||||||
else if ( b == null )
|
if ( b == null )
|
||||||
return +1;
|
return +1;
|
||||||
|
|
||||||
return a.CompareTo( b );
|
return a.CompareTo( b );
|
||||||
|
|
|
||||||
|
|
@ -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." );
|
from.SendMessage( 0x22, "You have recently been in combat with another player and cannot use this moongate." );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if ( from.Spell != null )
|
|
||||||
|
if ( from.Spell != null )
|
||||||
{
|
{
|
||||||
from.SendLocalizedMessage( 1049616 ); // You are too busy to do that at the moment.
|
from.SendLocalizedMessage( 1049616 ); // You are too busy to do that at the moment.
|
||||||
return false;
|
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 )
|
if ( !from.Hidden || from.AccessLevel == AccessLevel.Player )
|
||||||
Effects.PlaySound( from.Location, from.Map, 0x20E );
|
Effects.PlaySound( from.Location, from.Map, 0x20E );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnDoubleClick( Mobile from )
|
public override void OnDoubleClick( Mobile from )
|
||||||
|
|
@ -288,4 +286,4 @@ namespace Server.Engines.ConPVP
|
||||||
m_ColumnX += width;
|
m_ColumnX += width;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -851,7 +851,7 @@ namespace Server.Engines.ConPVP
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( hasWinner )
|
if ( hasWinner )
|
||||||
return winner == null ? (Participant) m_Participants[0] : winner;
|
return winner ?? (Participant) m_Participants[0];
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
@ -1851,11 +1851,11 @@ namespace Server.Engines.ConPVP
|
||||||
pack.DropItem( item );
|
pack.DropItem( item );
|
||||||
|
|
||||||
if ( item is BaseWeapon )
|
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) )
|
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
|
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 )
|
if ( entry.Mobile == mob )
|
||||||
return entry;
|
return entry;
|
||||||
else if ( entry.Expired )
|
if ( entry.Expired )
|
||||||
m_Entries.RemoveAt( i-- );
|
m_Entries.RemoveAt( i-- );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2105,11 +2105,9 @@ namespace Server.Engines.ConPVP
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
m.SendLocalizedMessage( 1049383 ); // The teleporter doesn't seem to work for you.
|
||||||
m.SendLocalizedMessage( 1049383 ); // The teleporter doesn't seem to work for you.
|
return true;
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ExitTeleporter( Serial serial ) : base( serial )
|
public ExitTeleporter( Serial serial ) : base( serial )
|
||||||
|
|
@ -2319,8 +2317,7 @@ namespace Server.Engines.ConPVP
|
||||||
{
|
{
|
||||||
if ( m_Tournament == null )
|
if ( m_Tournament == null )
|
||||||
return $"{dp.Mobile.Name} is dead";
|
return $"{dp.Mobile.Name} is dead";
|
||||||
else
|
dp.Mobile.Resurrect();
|
||||||
dp.Mobile.Resurrect();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_Tournament == null && CheckCombat( dp.Mobile ) )
|
if ( m_Tournament == null && CheckCombat( dp.Mobile ) )
|
||||||
|
|
|
||||||
|
|
@ -778,10 +778,8 @@ namespace Server.Engines.ConPVP
|
||||||
|
|
||||||
return true;
|
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 );
|
AddBorderedText( 235 + 15, 105 + ( i * 75 ), 250, 20, pl.Player.Name, 0xFFC000, BlackColor32 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
AddButton( 314, height - 42, 247, 248, 1, GumpButtonType.Reply, 0 );
|
AddButton( 314, height - 42, 247, 248, 1, GumpButtonType.Reply, 0 );
|
||||||
}
|
}
|
||||||
|
|
@ -1402,8 +1397,7 @@ namespace Server.Engines.ConPVP
|
||||||
{
|
{
|
||||||
if ( m_Name != null )
|
if ( m_Name != null )
|
||||||
return $"({Name}) ...";
|
return $"({Name}) ...";
|
||||||
else
|
return "...";
|
||||||
return "...";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -218,9 +218,6 @@ namespace Server.Engines.ConPVP
|
||||||
AddBorderedText( 235 + 15, 105 + ( i * 75 ), 250, 20, pl.Player.Name, 0xFFC000, BlackColor32 );
|
AddBorderedText( 235 + 15, 105 + ( i * 75 ), 250, 20, pl.Player.Name, 0xFFC000, BlackColor32 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
AddButton( 314, height - 42, 247, 248, 1, GumpButtonType.Reply, 0 );
|
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 ) )
|
else if ( passTeam == useTeam && passTo.PlaceInBackpack( this ) )
|
||||||
{
|
{
|
||||||
passTo.LocalOverheadMessage( MessageType.Regular, 0x59, false,
|
passTo.LocalOverheadMessage( MessageType.Regular, 0x59, false,
|
||||||
$"{@from.Name} has passed you the cookies!");
|
$"{from.Name} has passed you the cookies!");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -496,7 +493,7 @@ namespace Server.Engines.ConPVP
|
||||||
Mobile mob = FindOwner( parent );
|
Mobile mob = FindOwner( parent );
|
||||||
|
|
||||||
if ( mob != null )
|
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 )
|
public CTFFlag( Serial serial )
|
||||||
|
|
|
||||||
|
|
@ -214,9 +214,6 @@ namespace Server.Engines.ConPVP
|
||||||
AddBorderedText( 235 + 15, 105 + ( i * 75 ), 250, 20, pl.Player.Name, 0xFFC000, BlackColor32 );
|
AddBorderedText( 235 + 15, 105 + ( i * 75 ), 250, 20, pl.Player.Name, 0xFFC000, BlackColor32 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
AddButton( 314, height - 42, 247, 248, 1, GumpButtonType.Reply, 0 );
|
AddButton( 314, height - 42, 247, 248, 1, GumpButtonType.Reply, 0 );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -83,10 +83,9 @@ namespace Server.Engines.ConPVP
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (m_KingTimer != null)
|
if (m_KingTimer != null)
|
||||||
return m_KingTimer.Captures;
|
return m_KingTimer.Captures;
|
||||||
else
|
return 0;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -136,17 +135,15 @@ namespace Server.Engines.ConPVP
|
||||||
|
|
||||||
public override bool OnMoveOff(Mobile m)
|
public override bool OnMoveOff(Mobile m)
|
||||||
{
|
{
|
||||||
if (base.OnMoveOff(m))
|
if (base.OnMoveOff(m))
|
||||||
{
|
{
|
||||||
if (m_King == m)
|
if (m_King == m)
|
||||||
DeKingify();
|
DeKingify();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
return false;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void OnKingDied(Mobile king, KHTeamInfo kingTeam, Mobile killer, KHTeamInfo killerTeam)
|
public virtual void OnKingDied(Mobile king, KHTeamInfo kingTeam, Mobile killer, KHTeamInfo killerTeam)
|
||||||
|
|
@ -725,10 +722,9 @@ namespace Server.Engines.ConPVP
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
if (m_Name != null)
|
if (m_Name != null)
|
||||||
return $"({Name}) ...";
|
return $"({Name}) ...";
|
||||||
else
|
return "...";
|
||||||
return "...";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -88,9 +88,9 @@ namespace Server.Engines.ConPVP
|
||||||
{
|
{
|
||||||
if ( xp >= 22500 )
|
if ( xp >= 22500 )
|
||||||
return 50;
|
return 50;
|
||||||
else if ( xp >= 2500 )
|
if ( xp >= 2500 )
|
||||||
return (10 + ((xp - 2500) / 500));
|
return (10 + ((xp - 2500) / 500));
|
||||||
else if ( xp < 0 )
|
if ( xp < 0 )
|
||||||
xp = 0;
|
xp = 0;
|
||||||
|
|
||||||
return m_ShortLevels[xp / 100];
|
return m_ShortLevels[xp / 100];
|
||||||
|
|
|
||||||
|
|
@ -601,7 +601,7 @@ namespace Server.Engines.ConPVP
|
||||||
case TournamentStage.Inactive:
|
case TournamentStage.Inactive:
|
||||||
{
|
{
|
||||||
m_Registrar?.PrivateOverheadMessage( MessageType.Regular,
|
m_Registrar?.PrivateOverheadMessage( MessageType.Regular,
|
||||||
0x35, false, "The tournament is closed.", @from.NetState );
|
0x35, false, "The tournament is closed.", from.NetState );
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -610,7 +610,7 @@ namespace Server.Engines.ConPVP
|
||||||
if ( m_Players.Count != tourny.PlayersPerParticipant )
|
if ( m_Players.Count != tourny.PlayersPerParticipant )
|
||||||
{
|
{
|
||||||
m_Registrar?.PrivateOverheadMessage( MessageType.Regular,
|
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 ) );
|
m_From.SendGump( new ConfirmSignupGump( m_From, m_Registrar, m_Tournament, m_Players ) );
|
||||||
break;
|
break;
|
||||||
|
|
@ -818,7 +818,7 @@ namespace Server.Engines.ConPVP
|
||||||
|
|
||||||
m_Registrar?.PrivateOverheadMessage( MessageType.Regular,
|
m_Registrar?.PrivateOverheadMessage( MessageType.Regular,
|
||||||
0x59, false,
|
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, 22, 294, 20, Center( sb.ToString() ), LabelColor32, BlackColor32 );
|
||||||
|
|
||||||
AddBorderedText( 22, 50, 294, 40,
|
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 );
|
0xB0C868, BlackColor32 );
|
||||||
|
|
||||||
AddImageTiled( 32, 88, 264, 1, 9107 );
|
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 );
|
0x59, false, $"{mob.Name} has accepted your offer of partnership.", from.NetState );
|
||||||
|
|
||||||
m_Registrar.PrivateOverheadMessage( MessageType.Regular,
|
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 );
|
0x22, false, $"{mob.Name} has declined your offer of partnership.", from.NetState );
|
||||||
|
|
||||||
m_Registrar.PrivateOverheadMessage( MessageType.Regular,
|
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 );
|
$"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, 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, 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, 133, 250, 20, $"Wins: {entry?.Wins ?? 0:N0}", false, false );
|
||||||
AddHtml( 25, 153, 250, 20, $"Losses: {(entry == null ? 0 : entry.Losses):N0}", false, false );
|
AddHtml( 25, 153, 250, 20, $"Losses: {entry?.Losses ?? 0:N0}", false, false );
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -152,7 +152,7 @@ namespace Server.Engines.Craft
|
||||||
string nameString = craftSystem.CraftSubRes2.NameString;
|
string nameString = craftSystem.CraftSubRes2.NameString;
|
||||||
int nameNumber = craftSystem.CraftSubRes2.NameNumber;
|
int nameNumber = craftSystem.CraftSubRes2.NameNumber;
|
||||||
|
|
||||||
int resIndex = ( context == null ? -1 : context.LastResourceIndex2 );
|
int resIndex = context?.LastResourceIndex2 ?? -1;
|
||||||
|
|
||||||
Type resourceType = craftSystem.CraftSubRes2.ResType;
|
Type resourceType = craftSystem.CraftSubRes2.ResType;
|
||||||
|
|
||||||
|
|
@ -481,7 +481,7 @@ namespace Server.Engines.Craft
|
||||||
{
|
{
|
||||||
if ( m_Page == CraftPage.PickResource && index >= 0 && index < system.CraftSubRes.Count )
|
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 );
|
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 )
|
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 );
|
CraftSubRes res = system.CraftSubRes2.GetAt( index );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -246,30 +246,24 @@ namespace Server.Engines.Craft
|
||||||
message = "You lack the required hit points to make that.";
|
message = "You lack the required hit points to make that.";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
consumHits = consume;
|
||||||
consumHits = consume;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( Mana > 0 && from.Mana < Mana )
|
if ( Mana > 0 && from.Mana < Mana )
|
||||||
{
|
{
|
||||||
message = "You lack the required mana to make that.";
|
message = "You lack the required mana to make that.";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
consumMana = consume;
|
||||||
consumMana = consume;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( Stam > 0 && from.Stam < Stam )
|
if ( Stam > 0 && from.Stam < Stam )
|
||||||
{
|
{
|
||||||
message = "You lack the required stamina to make that.";
|
message = "You lack the required stamina to make that.";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
consumStam = consume;
|
||||||
consumStam = consume;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( consumMana )
|
if ( consumMana )
|
||||||
from.Mana -= Mana;
|
from.Mana -= Mana;
|
||||||
|
|
@ -786,7 +780,7 @@ namespace Server.Engines.Craft
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
{
|
||||||
CraftRes res = m_arCraftRes.GetAt( index );
|
CraftRes res = m_arCraftRes.GetAt( index );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ namespace Server.Engines.Craft
|
||||||
private int GetWeakenChance( Mobile mob, SkillName skill, int curHits, int maxHits )
|
private int GetWeakenChance( Mobile mob, SkillName skill, int curHits, int maxHits )
|
||||||
{
|
{
|
||||||
// 40% - (1% per hp lost) - (1% per 10 craft skill)
|
// 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 )
|
private bool CheckWeaken( Mobile mob, SkillName skill, int curHits, int maxHits )
|
||||||
|
|
@ -75,17 +75,15 @@ namespace Server.Engines.Craft
|
||||||
|
|
||||||
if ( value < minSkill )
|
if ( value < minSkill )
|
||||||
return false; // Too difficult
|
return false; // Too difficult
|
||||||
else if ( value >= maxSkill )
|
if ( value >= maxSkill )
|
||||||
return true; // No challenge
|
return true; // No challenge
|
||||||
|
|
||||||
double chance = (value - minSkill) / (maxSkill - minSkill);
|
double chance = (value - minSkill) / (maxSkill - minSkill);
|
||||||
|
|
||||||
return (chance >= Utility.RandomDouble());
|
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 )
|
private bool CheckDeed( Mobile from )
|
||||||
|
|
@ -126,39 +124,41 @@ namespace Server.Engines.Craft
|
||||||
|| ( weapon is ButcherKnife )
|
|| ( weapon is ButcherKnife )
|
||||||
|| ( weapon is SkinningKnife );
|
|| ( weapon is SkinningKnife );
|
||||||
}
|
}
|
||||||
else if ( m_CraftSystem is DefCarpentry )
|
|
||||||
|
if ( m_CraftSystem is DefCarpentry )
|
||||||
{
|
{
|
||||||
return ( weapon is Club )
|
return ( weapon is Club )
|
||||||
|| ( weapon is BlackStaff )
|
|| ( weapon is BlackStaff )
|
||||||
|| ( weapon is MagicWand )
|
|| ( weapon is MagicWand )
|
||||||
#region Temporary
|
#region Temporary
|
||||||
// TODO: Make these items craftable
|
// TODO: Make these items craftable
|
||||||
|| ( weapon is WildStaff );
|
|| ( weapon is WildStaff );
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
else if ( m_CraftSystem is DefBlacksmithy )
|
if ( m_CraftSystem is DefBlacksmithy )
|
||||||
{
|
{
|
||||||
return ( weapon is Pitchfork )
|
return ( weapon is Pitchfork )
|
||||||
#region Temporary
|
#region Temporary
|
||||||
// TODO: Make these items craftable
|
// TODO: Make these items craftable
|
||||||
|| ( weapon is RadiantScimitar )
|
|| ( weapon is RadiantScimitar )
|
||||||
|| ( weapon is WarCleaver )
|
|| ( weapon is WarCleaver )
|
||||||
|| ( weapon is ElvenSpellblade )
|
|| ( weapon is ElvenSpellblade )
|
||||||
|| ( weapon is AssassinSpike )
|
|| ( weapon is AssassinSpike )
|
||||||
|| ( weapon is Leafblade )
|
|| ( weapon is Leafblade )
|
||||||
|| ( weapon is RuneBlade )
|
|| ( weapon is RuneBlade )
|
||||||
|| ( weapon is ElvenMachete )
|
|| ( weapon is ElvenMachete )
|
||||||
|| ( weapon is OrnateAxe )
|
|| ( weapon is OrnateAxe )
|
||||||
|| ( weapon is DiamondMace );
|
|| ( weapon is DiamondMace );
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
#region Temporary
|
#region Temporary
|
||||||
// TODO: Make these items craftable
|
// TODO: Make these items craftable
|
||||||
else if ( m_CraftSystem is DefBowFletching )
|
if ( m_CraftSystem is DefBowFletching )
|
||||||
{
|
{
|
||||||
return ( weapon is ElvenCompositeLongbow )
|
return ( weapon is ElvenCompositeLongbow )
|
||||||
|| ( weapon is MagicalShortbow );
|
|| ( weapon is MagicalShortbow );
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -184,23 +184,25 @@ namespace Server.Engines.Craft
|
||||||
|| ( armor is HidePants )
|
|| ( armor is HidePants )
|
||||||
|| ( armor is HidePauldrons );
|
|| ( armor is HidePauldrons );
|
||||||
}
|
}
|
||||||
else if ( m_CraftSystem is DefCarpentry )
|
|
||||||
|
if ( m_CraftSystem is DefCarpentry )
|
||||||
{
|
{
|
||||||
return ( armor is WingedHelm )
|
return ( armor is WingedHelm )
|
||||||
|| ( armor is RavenHelm )
|
|| ( armor is RavenHelm )
|
||||||
|| ( armor is VultureHelm )
|
|| ( armor is VultureHelm )
|
||||||
|| ( armor is WoodlandArms )
|
|| ( armor is WoodlandArms )
|
||||||
|| ( armor is WoodlandChest )
|
|| ( armor is WoodlandChest )
|
||||||
|| ( armor is WoodlandGloves )
|
|| ( armor is WoodlandGloves )
|
||||||
|| ( armor is WoodlandGorget )
|
|| ( armor is WoodlandGorget )
|
||||||
|| ( armor is WoodlandLegs );
|
|| ( armor is WoodlandLegs );
|
||||||
}
|
}
|
||||||
else if ( m_CraftSystem is DefBlacksmithy )
|
if ( m_CraftSystem is DefBlacksmithy )
|
||||||
{
|
{
|
||||||
return ( armor is Circlet )
|
return ( armor is Circlet )
|
||||||
|| ( armor is RoyalCirclet )
|
|| ( armor is RoyalCirclet )
|
||||||
|| ( armor is GemmedCirclet );
|
|| ( armor is GemmedCirclet );
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ namespace Server.Engines.Craft
|
||||||
{
|
{
|
||||||
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
|
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
|
||||||
return 1044038; // You have worn out your tool!
|
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 1044263; // The tool must be on your person to use.
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -65,27 +65,20 @@ namespace Server.Engines.Craft
|
||||||
from.AddToBackpack( new Bottle() );
|
from.AddToBackpack( new Bottle() );
|
||||||
return 500287; // You fail to create a useful potion.
|
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 ) )
|
return 1044043; // You failed to create the item, and some of your materials are lost.
|
||||||
{
|
|
||||||
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.
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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()
|
public override void InitCraftList()
|
||||||
|
|
|
||||||
|
|
@ -112,9 +112,9 @@ namespace Server.Engines.Craft
|
||||||
{
|
{
|
||||||
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
|
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
|
||||||
return 1044038; // You have worn out your tool!
|
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.
|
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.
|
return 1044263; // The tool must be on your person to use.
|
||||||
|
|
||||||
bool anvil, forge;
|
bool anvil, forge;
|
||||||
|
|
@ -161,20 +161,16 @@ namespace Server.Engines.Craft
|
||||||
{
|
{
|
||||||
if ( lostMaterial )
|
if ( lostMaterial )
|
||||||
return 1044043; // You failed to create the item, and some of your materials are lost.
|
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
|
|
||||||
{
|
|
||||||
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.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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()
|
public override void InitCraftList()
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ namespace Server.Engines.Craft
|
||||||
{
|
{
|
||||||
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
|
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
|
||||||
return 1044038; // You have worn out your tool!
|
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 1044263; // The tool must be on your person to use.
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -59,20 +59,16 @@ namespace Server.Engines.Craft
|
||||||
{
|
{
|
||||||
if ( lostMaterial )
|
if ( lostMaterial )
|
||||||
return 1044043; // You failed to create the item, and some of your materials are lost.
|
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
|
|
||||||
{
|
|
||||||
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.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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;
|
public override CraftECA ECA => CraftECA.FiftyPercentChanceMinusTenPercent;
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ namespace Server.Engines.Craft
|
||||||
{
|
{
|
||||||
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
|
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
|
||||||
return 1044038; // You have worn out your tool!
|
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 1044263; // The tool must be on your person to use.
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -59,20 +59,16 @@ namespace Server.Engines.Craft
|
||||||
{
|
{
|
||||||
if ( lostMaterial )
|
if ( lostMaterial )
|
||||||
return 1044043; // You failed to create the item, and some of your materials are lost.
|
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
|
|
||||||
{
|
|
||||||
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.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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()
|
public override void InitCraftList()
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ namespace Server.Engines.Craft
|
||||||
{
|
{
|
||||||
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
|
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
|
||||||
return 1044038; // You have worn out your tool!
|
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 1044263; // The tool must be on your person to use.
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -55,20 +55,16 @@ namespace Server.Engines.Craft
|
||||||
{
|
{
|
||||||
if ( lostMaterial )
|
if ( lostMaterial )
|
||||||
return 1044043; // You failed to create the item, and some of your materials are lost.
|
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
|
|
||||||
{
|
|
||||||
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.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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()
|
public override void InitCraftList()
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ namespace Server.Engines.Craft
|
||||||
{
|
{
|
||||||
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
|
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
|
||||||
return 1044038; // You have worn out your tool!
|
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 1044263; // The tool must be on your person to use.
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -56,20 +56,16 @@ namespace Server.Engines.Craft
|
||||||
{
|
{
|
||||||
if ( lostMaterial )
|
if ( lostMaterial )
|
||||||
return 1044043; // You failed to create the item, and some of your materials are lost.
|
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
|
|
||||||
{
|
|
||||||
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.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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()
|
public override void InitCraftList()
|
||||||
|
|
|
||||||
|
|
@ -91,22 +91,18 @@ namespace Server.Engines.Craft
|
||||||
{
|
{
|
||||||
if ( lostMaterial )
|
if ( lostMaterial )
|
||||||
return 1044043; // You failed to create the item, and some of your materials are lost.
|
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 )
|
from.PlaySound( 0x41 ); // glass breaking
|
||||||
return 502785; // You were barely able to make this item. It's quality is below average.
|
|
||||||
else if ( makersMark && quality == 2 )
|
if ( quality == 0 )
|
||||||
return 1044156; // You create an exceptional quality item and affix your maker's mark.
|
return 502785; // You were barely able to make this item. It's quality is below average.
|
||||||
else if ( quality == 2 )
|
if ( makersMark && quality == 2 )
|
||||||
return 1044155; // You create an exceptional quality item.
|
return 1044156; // You create an exceptional quality item and affix your maker's mark.
|
||||||
else
|
if ( quality == 2 )
|
||||||
return 1044154; // You create the item.
|
return 1044155; // You create an exceptional quality item.
|
||||||
}
|
return 1044154; // You create the item.
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void InitCraftList()
|
public override void InitCraftList()
|
||||||
|
|
|
||||||
|
|
@ -82,28 +82,21 @@ namespace Server.Engines.Craft
|
||||||
{
|
{
|
||||||
if ( lostMaterial )
|
if ( lostMaterial )
|
||||||
return 1044043; // You failed to create the item, and some of your materials are lost.
|
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
|
|
||||||
{
|
|
||||||
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.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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 )
|
||||||
if ( failed )
|
return 501630; // You fail to inscribe the scroll, and the scroll is ruined.
|
||||||
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.
|
||||||
else
|
|
||||||
return 501629; // You inscribe the spell and put the scroll in your backpack.
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private int m_Circle, m_Mana;
|
private int m_Circle, m_Mana;
|
||||||
|
|
|
||||||
|
|
@ -84,20 +84,16 @@ namespace Server.Engines.Craft
|
||||||
{
|
{
|
||||||
if ( lostMaterial )
|
if ( lostMaterial )
|
||||||
return 1044043; // You failed to create the item, and some of your materials are lost.
|
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
|
|
||||||
{
|
|
||||||
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.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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()
|
public override void InitCraftList()
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ namespace Server.Engines.Craft
|
||||||
{
|
{
|
||||||
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
|
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
|
||||||
return 1044038; // You have worn out your tool!
|
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 1044263; // The tool must be on your person to use.
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -79,20 +79,16 @@ namespace Server.Engines.Craft
|
||||||
{
|
{
|
||||||
if ( lostMaterial )
|
if ( lostMaterial )
|
||||||
return 1044043; // You failed to create the item, and some of your materials are lost.
|
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
|
|
||||||
{
|
|
||||||
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.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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()
|
public override void InitCraftList()
|
||||||
|
|
|
||||||
|
|
@ -40,9 +40,9 @@ namespace Server.Engines.Craft
|
||||||
{
|
{
|
||||||
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
|
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
|
||||||
return 1044038; // You have worn out your tool!
|
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 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 1044573; // You have to be in a faction to do that.
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -91,20 +91,16 @@ namespace Server.Engines.Craft
|
||||||
{
|
{
|
||||||
if ( lostMaterial )
|
if ( lostMaterial )
|
||||||
return 1044043; // You failed to create the item, and some of your materials are lost.
|
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
|
|
||||||
{
|
|
||||||
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.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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 )
|
public override bool ConsumeOnFailure( Mobile from, Type resourceType, CraftItem craftItem )
|
||||||
|
|
@ -417,11 +413,9 @@ namespace Server.Engines.Craft
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
m_Container = container;
|
||||||
m_Container = container;
|
return true;
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void EndCraftAction()
|
public override void EndCraftAction()
|
||||||
|
|
|
||||||
|
|
@ -1014,7 +1014,7 @@ namespace Server.Factions
|
||||||
|
|
||||||
if ( pack != null )
|
if ( pack != null )
|
||||||
{
|
{
|
||||||
Container killerPack = ( killer == null ? null : killer.Backpack );
|
Container killerPack = killer?.Backpack;
|
||||||
Item[] sigils = pack.FindItemsByType( typeof( Sigil ) );
|
Item[] sigils = pack.FindItemsByType( typeof( Sigil ) );
|
||||||
|
|
||||||
for ( int i = 0; i < sigils.Length; ++i )
|
for ( int i = 0; i < sigils.Length; ++i )
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,8 @@ namespace Server.Factions
|
||||||
ps.IsActive = false;
|
ps.IsActive = false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if ( ps.KillPoints > 0 )
|
|
||||||
|
if ( ps.KillPoints > 0 )
|
||||||
{
|
{
|
||||||
int atrophy = ( ps.KillPoints + 9 ) / 10;
|
int atrophy = ( ps.KillPoints + 9 ) / 10;
|
||||||
ps.KillPoints -= atrophy;
|
ps.KillPoints -= atrophy;
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,7 @@ namespace Server.Factions
|
||||||
{
|
{
|
||||||
Faction faction = Faction.Find( from );
|
Faction faction = Faction.Find( from );
|
||||||
|
|
||||||
faction?.BeginHonorLeadership( @from );
|
faction?.BeginHonorLeadership( from );
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,11 +21,9 @@ namespace Server.Factions
|
||||||
index = offset / ButtonTypes;
|
index = offset / ButtonTypes;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
type = index = 0;
|
||||||
type = index = 0;
|
return false;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool Exists( Mobile mob )
|
public static bool Exists( Mobile mob )
|
||||||
|
|
|
||||||
|
|
@ -128,10 +128,10 @@ namespace Server.Factions
|
||||||
AddHtml( 120, 100, 150, 20, from.Name, false, false );
|
AddHtml( 120, 100, 150, 20, from.Name, false, false );
|
||||||
|
|
||||||
AddHtmlLocalized( 20, 130, 100, 20, 1018064, false, false ); // score :
|
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 :
|
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
|
AddHtmlLocalized( 55, 250, 100, 20, 1011447, false, false ); // BACK
|
||||||
AddButton( 20, 250, 4005, 4007, 0, GumpButtonType.Page, 1 );
|
AddButton( 20, 250, 4005, 4007, 0, GumpButtonType.Page, 1 );
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,8 @@ namespace Server.Factions
|
||||||
from.SendLocalizedMessage( 1010339 ); // You no longer control this city
|
from.SendLocalizedMessage( 1010339 ); // You no longer control this city
|
||||||
return;
|
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
|
from.SendLocalizedMessage( 1010342 ); // You must fire your Sheriff before you can elect a new one
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ namespace Server.Factions
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
m_Faction = value;
|
m_Faction = value;
|
||||||
Hue = ( m_Faction == null ? 0 : m_Faction.Definition.HuePrimary );
|
Hue = m_Faction?.Definition.HuePrimary ?? 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ namespace Server.Factions
|
||||||
{
|
{
|
||||||
m_Faction = value;
|
m_Faction = value;
|
||||||
|
|
||||||
AssignName( m_Faction == null ? null : m_Faction.Definition.FactionStoneName );
|
AssignName( m_Faction?.Definition.FactionStoneName );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,8 @@ namespace Server.Factions
|
||||||
{
|
{
|
||||||
m_Faction = value;
|
m_Faction = value;
|
||||||
|
|
||||||
Hue = ( m_Faction == null ? 0 : m_Faction.Definition.HueJoin );
|
Hue = m_Faction?.Definition.HueJoin ?? 0;
|
||||||
AssignName( m_Faction == null ? null : m_Faction.Definition.SignupName );
|
AssignName( m_Faction?.Definition.SignupName );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,11 +30,11 @@ namespace Server {
|
||||||
from.AddStatMod( new StatMod( StatType.All, "blood-rose", amount, TimeSpan.FromMinutes( time ) ) );
|
from.AddStatMod( new StatMod( StatType.All, "blood-rose", amount, TimeSpan.FromMinutes( time ) ) );
|
||||||
|
|
||||||
return true;
|
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 ) {
|
public override void Serialize( GenericWriter writer ) {
|
||||||
|
|
@ -49,4 +49,4 @@ namespace Server {
|
||||||
int version = reader.ReadEncodedInt();
|
int version = reader.ReadEncodedInt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,8 @@ namespace Server {
|
||||||
|
|
||||||
weight = Utility.Random( weight );
|
weight = Utility.Random( weight );
|
||||||
|
|
||||||
foreach ( WeightedItem item in _items ) {
|
foreach ( WeightedItem item in _items )
|
||||||
|
{
|
||||||
if ( weight < item.Weight ) {
|
if ( weight < item.Weight ) {
|
||||||
Item obj = item.Construct();
|
Item obj = item.Construct();
|
||||||
|
|
||||||
|
|
@ -95,9 +96,9 @@ namespace Server {
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
} else {
|
|
||||||
weight -= item.Weight;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
weight -= item.Weight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ namespace Server.Factions
|
||||||
|
|
||||||
public void Update()
|
public void Update()
|
||||||
{
|
{
|
||||||
ItemID = ( m_Town == null ? 0x1869 : m_Town.Definition.SigilID );
|
ItemID = m_Town?.Definition.SigilID ?? 0x1869;
|
||||||
|
|
||||||
if ( m_Town == null )
|
if ( m_Town == null )
|
||||||
AssignName( null );
|
AssignName( null );
|
||||||
|
|
|
||||||
|
|
@ -29,10 +29,9 @@ namespace Server.Factions
|
||||||
{
|
{
|
||||||
if ( Amount <= 1 )
|
if ( Amount <= 1 )
|
||||||
return 0x2E4;
|
return 0x2E4;
|
||||||
else if ( Amount <= 5 )
|
if ( Amount <= 5 )
|
||||||
return 0x2E5;
|
return 0x2E5;
|
||||||
else
|
return 0x2E6;
|
||||||
return 0x2E6;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Serialize( GenericWriter writer )
|
public override void Serialize( GenericWriter writer )
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ namespace Server.Factions
|
||||||
|
|
||||||
public override void OnTownChanged()
|
public override void OnTownChanged()
|
||||||
{
|
{
|
||||||
AssignName( Town == null ? null : Town.Definition.StrongholdMonolithName );
|
AssignName( Town?.Definition.StrongholdMonolithName );
|
||||||
}
|
}
|
||||||
|
|
||||||
public StrongholdMonolith() : this( null, null )
|
public StrongholdMonolith() : this( null, null )
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ namespace Server.Factions
|
||||||
|
|
||||||
public override void OnTownChanged()
|
public override void OnTownChanged()
|
||||||
{
|
{
|
||||||
AssignName( Town == null ? null : Town.Definition.TownMonolithName );
|
AssignName( Town?.Definition.TownMonolithName );
|
||||||
}
|
}
|
||||||
|
|
||||||
public TownMonolith() : this( null )
|
public TownMonolith() : this( null )
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ namespace Server.Factions
|
||||||
{
|
{
|
||||||
m_Town = value;
|
m_Town = value;
|
||||||
|
|
||||||
AssignName( m_Town == null ? null : m_Town.Definition.TownStoneName );
|
AssignName( m_Town?.Definition.TownStoneName );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ namespace Server.Factions
|
||||||
if ( from.Alive )
|
if ( from.Alive )
|
||||||
m_Placer.SendMessage( "You have earned {0} silver pieces because {1} fell for your trap.", silverGiven, from.Name );
|
m_Placer.SendMessage( "You have earned {0} silver pieces because {1} fell for your trap.", silverGiven, from.Name );
|
||||||
else
|
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 );
|
victimState.OnGivenSilverTo( m_Placer );
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,8 @@ namespace Server.Factions
|
||||||
{
|
{
|
||||||
m_Faction = value;
|
m_Faction = value;
|
||||||
|
|
||||||
Body = ( m_Faction == null ? 0xE2 : m_Faction.Definition.WarHorseBody );
|
Body = m_Faction?.Definition.WarHorseBody ?? 0xE2;
|
||||||
ItemID = ( m_Faction == null ? 0x3EA0 : m_Faction.Definition.WarHorseItem );
|
ItemID = m_Faction?.Definition.WarHorseItem ?? 0x3EA0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -310,45 +310,43 @@ namespace Server.Factions
|
||||||
|
|
||||||
return active;
|
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;
|
active = inactive = comb;
|
||||||
double actPrio = 0.0, inactPrio = 0.0;
|
actPrio = inactPrio = m_Mobile.GetDistanceToSqrt( comb );
|
||||||
|
}
|
||||||
|
|
||||||
Mobile comb = m_Mobile.Combatant;
|
foreach ( Mobile m in m_Mobile.GetMobilesInRange( 12 ) )
|
||||||
|
{
|
||||||
if ( comb != null && !comb.Deleted && comb.Alive && !comb.IsDeadBondedPet && CanDispel( comb ) )
|
if ( m != m_Mobile && CanDispel( m ) )
|
||||||
{
|
{
|
||||||
active = inactive = comb;
|
double prio = m_Mobile.GetDistanceToSqrt( m );
|
||||||
actPrio = inactPrio = m_Mobile.GetDistanceToSqrt( comb );
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ( Mobile m in m_Mobile.GetMobilesInRange( 12 ) )
|
if ( !activeOnly && (inactive == null || prio < inactPrio) )
|
||||||
{
|
|
||||||
if ( m != m_Mobile && CanDispel( m ) )
|
|
||||||
{
|
{
|
||||||
double prio = m_Mobile.GetDistanceToSqrt( m );
|
inactive = m;
|
||||||
|
inactPrio = prio;
|
||||||
|
}
|
||||||
|
|
||||||
if ( !activeOnly && (inactive == null || prio < inactPrio) )
|
if ( (m_Mobile.Combatant == m || m.Combatant == m_Mobile) && (active == null || prio < actPrio) )
|
||||||
{
|
{
|
||||||
inactive = m;
|
active = m;
|
||||||
inactPrio = prio;
|
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;
|
return null;
|
||||||
|
|
@ -473,7 +471,7 @@ namespace Server.Factions
|
||||||
{
|
{
|
||||||
Target targ = m_Guard.Target;
|
Target targ = m_Guard.Target;
|
||||||
|
|
||||||
Mobile toHarm = ( dispelTarget == null ? combatant : dispelTarget );
|
Mobile toHarm = dispelTarget ?? combatant;
|
||||||
|
|
||||||
if ( (targ.Flags & TargetFlags.Harmful) != 0 && toHarm != null )
|
if ( (targ.Flags & TargetFlags.Harmful) != 0 && toHarm != null )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -225,15 +225,13 @@ namespace Server.Engines.Harvest
|
||||||
|
|
||||||
return contains;
|
return contains;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
int dist = -1;
|
|
||||||
|
|
||||||
for ( int i = 0; dist < 0 && i < m_Tiles.Length; ++i )
|
int dist = -1;
|
||||||
dist = ( m_Tiles[i] - tileID );
|
|
||||||
|
|
||||||
return ( dist == 0 );
|
for ( int i = 0; dist < 0 && i < m_Tiles.Length; ++i )
|
||||||
}
|
dist = ( m_Tiles[i] - tileID );
|
||||||
|
|
||||||
|
return ( dist == 0 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,8 @@ namespace Server.Engines.Harvest
|
||||||
OnBadHarvestTarget( from, tool, toHarvest );
|
OnBadHarvestTarget( from, tool, toHarvest );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if ( !def.Validate( tileID ) )
|
|
||||||
|
if ( !def.Validate( tileID ) )
|
||||||
{
|
{
|
||||||
OnBadHarvestTarget( from, tool, toHarvest );
|
OnBadHarvestTarget( from, tool, toHarvest );
|
||||||
return;
|
return;
|
||||||
|
|
@ -115,9 +116,9 @@ namespace Server.Engines.Harvest
|
||||||
|
|
||||||
if ( !CheckRange( from, tool, def, map, loc, true ) )
|
if ( !CheckRange( from, tool, def, map, loc, true ) )
|
||||||
return;
|
return;
|
||||||
else if ( !CheckResources( from, tool, def, map, loc, true ) )
|
if ( !CheckResources( from, tool, def, map, loc, true ) )
|
||||||
return;
|
return;
|
||||||
else if ( !CheckHarvest( from, tool, def, toHarvest ) )
|
if ( !CheckHarvest( from, tool, def, toHarvest ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( SpecialHarvest( from, tool, def, map, loc ) )
|
if ( SpecialHarvest( from, tool, def, map, loc ) )
|
||||||
|
|
@ -341,23 +342,24 @@ namespace Server.Engines.Harvest
|
||||||
OnBadHarvestTarget( from, tool, toHarvest );
|
OnBadHarvestTarget( from, tool, toHarvest );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if ( !def.Validate( tileID ) )
|
|
||||||
|
if ( !def.Validate( tileID ) )
|
||||||
{
|
{
|
||||||
from.EndAction( locked );
|
from.EndAction( locked );
|
||||||
OnBadHarvestTarget( from, tool, toHarvest );
|
OnBadHarvestTarget( from, tool, toHarvest );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if ( !CheckRange( from, tool, def, map, loc, true ) )
|
if ( !CheckRange( from, tool, def, map, loc, true ) )
|
||||||
{
|
{
|
||||||
from.EndAction( locked );
|
from.EndAction( locked );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if ( !CheckResources( from, tool, def, map, loc, true ) )
|
if ( !CheckResources( from, tool, def, map, loc, true ) )
|
||||||
{
|
{
|
||||||
from.EndAction( locked );
|
from.EndAction( locked );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if ( !CheckHarvest( from, tool, def, toHarvest ) )
|
if ( !CheckHarvest( from, tool, def, toHarvest ) )
|
||||||
{
|
{
|
||||||
from.EndAction( locked );
|
from.EndAction( locked );
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -424,9 +426,9 @@ namespace Server.Engines.Harvest
|
||||||
|
|
||||||
if ( !CheckRange( from, tool, def, map, loc, false ) )
|
if ( !CheckRange( from, tool, def, map, loc, false ) )
|
||||||
return;
|
return;
|
||||||
else if ( !CheckResources( from, tool, def, map, loc, false ) )
|
if ( !CheckResources( from, tool, def, map, loc, false ) )
|
||||||
return;
|
return;
|
||||||
else if ( !CheckHarvest( from, tool, def, toHarvest ) )
|
if ( !CheckHarvest( from, tool, def, toHarvest ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
object toLock = GetLock( from, tool, def, toHarvest );
|
object toLock = GetLock( from, tool, def, toHarvest );
|
||||||
|
|
|
||||||
|
|
@ -206,7 +206,8 @@ namespace Server.Engines.Harvest
|
||||||
from.SendLocalizedMessage( 501864 ); // You can't mine while riding.
|
from.SendLocalizedMessage( 501864 ); // You can't mine while riding.
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if ( from.IsBodyMod && !from.Body.IsHuman )
|
|
||||||
|
if ( from.IsBodyMod && !from.Body.IsHuman )
|
||||||
{
|
{
|
||||||
from.SendLocalizedMessage( 501865 ); // You can't mine while polymorphed.
|
from.SendLocalizedMessage( 501865 ); // You can't mine while polymorphed.
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -183,10 +183,9 @@ namespace Server.Engines.Help
|
||||||
{
|
{
|
||||||
if ( type == PageType.VerbalHarassment )
|
if ( type == PageType.VerbalHarassment )
|
||||||
return "Verbal Harassment";
|
return "Verbal Harassment";
|
||||||
else if ( type == PageType.PhysicalHarassment )
|
if ( type == PageType.PhysicalHarassment )
|
||||||
return "Physical Harassment";
|
return "Physical Harassment";
|
||||||
else
|
return type.ToString();
|
||||||
return type.ToString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void OnHandlerChanged( Mobile old, Mobile value, PageEntry entry )
|
public static void OnHandlerChanged( Mobile old, Mobile value, PageEntry entry )
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ namespace Server.Engines.Help
|
||||||
|
|
||||||
AddHtmlLocalized( 150, 40, 360, 40, 1062610, false, false ); // <CENTER><U>Ultima Online Help Response</U></CENTER>
|
AddHtmlLocalized( 150, 40, 360, 40, 1062610, false, false ); // <CENTER><U>Ultima Online Help Response</U></CENTER>
|
||||||
|
|
||||||
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.
|
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
|
AddButton( 400, 417, 2074, 2075, 1, GumpButtonType.Reply, 0 ); // OKAY
|
||||||
|
|
|
||||||
|
|
@ -256,10 +256,8 @@ namespace Server.Items
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
return false;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public PuzzleChestSolutionAndTime GetLastGuess( Mobile m )
|
public PuzzleChestSolutionAndTime GetLastGuess( Mobile m )
|
||||||
|
|
|
||||||
|
|
@ -236,7 +236,8 @@ namespace Server.Engines.MLQuests
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if ( nextAvailable > DateTime.UtcNow )
|
|
||||||
|
if ( nextAvailable > DateTime.UtcNow )
|
||||||
{
|
{
|
||||||
if ( message )
|
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?
|
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?
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ namespace Server.Engines.MLQuests
|
||||||
m_Quest = quest;
|
m_Quest = quest;
|
||||||
|
|
||||||
m_Quester = quester;
|
m_Quester = quester;
|
||||||
m_QuesterType = ( quester == null ) ? null : quester.GetType();
|
m_QuesterType = quester?.GetType();
|
||||||
m_Player = player;
|
m_Player = player;
|
||||||
|
|
||||||
m_Accepted = DateTime.UtcNow;
|
m_Accepted = DateTime.UtcNow;
|
||||||
|
|
@ -91,7 +91,7 @@ namespace Server.Engines.MLQuests
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
m_Quester = value;
|
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 )
|
if ( complete && !requiresAll )
|
||||||
return true;
|
return true;
|
||||||
else if ( !complete && requiresAll )
|
if ( !complete && requiresAll )
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -369,7 +369,7 @@ namespace Server.Engines.MLQuests
|
||||||
|
|
||||||
foreach ( Item rewardItem in rewards )
|
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 )
|
if ( rewardItem.Stackable )
|
||||||
m_Player.SendLocalizedMessage( 1115917, string.Concat( rewardItem.Amount, "\t", rewardName ) ); // You receive a reward: ~1_QUANTITY~ ~2_ITEM~
|
m_Player.SendLocalizedMessage( 1115917, string.Concat( rewardItem.Amount, "\t", rewardName ) ); // You receive a reward: ~1_QUANTITY~ ~2_ITEM~
|
||||||
|
|
|
||||||
|
|
@ -376,7 +376,7 @@ namespace Server.Engines.MLQuests
|
||||||
|
|
||||||
if ( entry.Failed )
|
if ( entry.Failed )
|
||||||
return; // Note: OSI sends no gump at all for failed quests, they have to be cancelled in the quest overview
|
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();
|
entry.SendRewardOffer();
|
||||||
else if ( entry.IsCompleted() )
|
else if ( entry.IsCompleted() )
|
||||||
entry.SendReportBackGump();
|
entry.SendReportBackGump();
|
||||||
|
|
|
||||||
|
|
@ -65,8 +65,7 @@ namespace Server.Engines.MLQuests.Objectives
|
||||||
{
|
{
|
||||||
if ( label < 1078872 )
|
if ( label < 1078872 )
|
||||||
return ( label - 1020000 );
|
return ( label - 1020000 );
|
||||||
else
|
return ( label - 1078872 );
|
||||||
return ( label - 1078872 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void WriteToGump( Gump g, ref int y )
|
public override void WriteToGump( Gump g, ref int y )
|
||||||
|
|
|
||||||
|
|
@ -119,55 +119,53 @@ namespace Server.Engines.MyRunUO
|
||||||
|
|
||||||
return;
|
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
|
try
|
||||||
{
|
{
|
||||||
connected = true;
|
transact?.Rollback();
|
||||||
connection = new OdbcConnection( m_ConnectionString );
|
|
||||||
connection.Open();
|
|
||||||
command = connection.CreateCommand();
|
|
||||||
|
|
||||||
if ( Config.UseTransactions )
|
|
||||||
{
|
|
||||||
transact = connection.BeginTransaction();
|
|
||||||
command.Transaction = transact;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch ( Exception e )
|
catch{}
|
||||||
|
|
||||||
|
try
|
||||||
{
|
{
|
||||||
try
|
connection?.Close();
|
||||||
{
|
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
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 )
|
else if ( obj is string s )
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@ namespace Server.Engines.PartySystem
|
||||||
Mobile from = e.Mobile;
|
Mobile from = e.Mobile;
|
||||||
Party p = Get( from );
|
Party p = Get( from );
|
||||||
|
|
||||||
p?.Remove( @from );
|
p?.Remove( from );
|
||||||
|
|
||||||
from.Party = null;
|
from.Party = null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -381,10 +381,8 @@ namespace Server.Engines.Plants
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
m_Plant.LabelTo( from, message );
|
||||||
m_Plant.LabelTo( from, message );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
from.SendGump( new MainPlantGump( m_Plant ) );
|
from.SendGump( new MainPlantGump( m_Plant ) );
|
||||||
|
|
|
||||||
|
|
@ -331,7 +331,8 @@ namespace Server.Items
|
||||||
item.MoveToWorld( new Point3D( x, y, Location.Z ), Map );
|
item.MoveToWorld( new Point3D( x, y, Location.Z ), Map );
|
||||||
return true;
|
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 );
|
item.MoveToWorld( new Point3D( x, y, z ), Map );
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -355,7 +356,8 @@ namespace Server.Items
|
||||||
creature.Combatant = From;
|
creature.Combatant = From;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if ( Map.CanSpawnMobile( x, y, z ) )
|
|
||||||
|
if ( Map.CanSpawnMobile( x, y, z ) )
|
||||||
{
|
{
|
||||||
creature.MoveToWorld( new Point3D( x, y, z ), Map );
|
creature.MoveToWorld( new Point3D( x, y, z ), Map );
|
||||||
creature.Combatant = From;
|
creature.Combatant = From;
|
||||||
|
|
|
||||||
|
|
@ -70,8 +70,7 @@ namespace Server.Engines.Plants
|
||||||
{
|
{
|
||||||
if (m_Table.TryGetValue( plantHue, out PlantHueInfo info ))
|
if (m_Table.TryGetValue( plantHue, out PlantHueInfo info ))
|
||||||
return info;
|
return info;
|
||||||
else
|
return m_Table[PlantHue.Plain];
|
||||||
return m_Table[PlantHue.Plain];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static PlantHue RandomFirstGeneration()
|
public static PlantHue RandomFirstGeneration()
|
||||||
|
|
|
||||||
|
|
@ -208,12 +208,11 @@ namespace Server.Engines.Plants
|
||||||
{
|
{
|
||||||
if ( m_PlantStatus >= PlantStatus.Plant )
|
if ( m_PlantStatus >= PlantStatus.Plant )
|
||||||
return 1060812; // plant
|
return 1060812; // plant
|
||||||
else if ( m_PlantStatus >= PlantStatus.Sapling )
|
if ( m_PlantStatus >= PlantStatus.Sapling )
|
||||||
return 1023305; // sapling
|
return 1023305; // sapling
|
||||||
else if ( m_PlantStatus >= PlantStatus.Seed )
|
if ( m_PlantStatus >= PlantStatus.Seed )
|
||||||
return 1060810; // seed
|
return 1060810; // seed
|
||||||
else
|
return 1026951; // dirt
|
||||||
return 1026951; // dirt
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int GetLocalizedContainerType()
|
public int GetLocalizedContainerType()
|
||||||
|
|
@ -508,11 +507,9 @@ namespace Server.Engines.Plants
|
||||||
message = 1053065; // The plant is already soaked with this type of potion!
|
message = 1053065; // The plant is already soaked with this type of potion!
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
message = 1053067; // You pour the potion over the plant.
|
||||||
message = 1053067; // You pour the potion over the plant.
|
return true;
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Serialize( GenericWriter writer )
|
public override void Serialize( GenericWriter writer )
|
||||||
|
|
|
||||||
|
|
@ -116,12 +116,11 @@ namespace Server.Engines.Plants
|
||||||
|
|
||||||
if ( perc < 33 )
|
if ( perc < 33 )
|
||||||
return PlantHealth.Dying;
|
return PlantHealth.Dying;
|
||||||
else if ( perc < 66 )
|
if ( perc < 66 )
|
||||||
return PlantHealth.Wilted;
|
return PlantHealth.Wilted;
|
||||||
else if ( perc < 100 )
|
if ( perc < 100 )
|
||||||
return PlantHealth.Healthy;
|
return PlantHealth.Healthy;
|
||||||
else
|
return PlantHealth.Vibrant;
|
||||||
return PlantHealth.Vibrant;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -261,8 +260,7 @@ namespace Server.Engines.Plants
|
||||||
{
|
{
|
||||||
if ( m_Pollinated )
|
if ( m_Pollinated )
|
||||||
return m_SeedType;
|
return m_SeedType;
|
||||||
else
|
return m_Plant.PlantType;
|
||||||
return m_Plant.PlantType;
|
|
||||||
}
|
}
|
||||||
set => m_SeedType = value;
|
set => m_SeedType = value;
|
||||||
}
|
}
|
||||||
|
|
@ -273,8 +271,7 @@ namespace Server.Engines.Plants
|
||||||
{
|
{
|
||||||
if ( m_Pollinated )
|
if ( m_Pollinated )
|
||||||
return m_SeedHue;
|
return m_SeedHue;
|
||||||
else
|
return m_Plant.PlantHue;
|
||||||
return m_Plant.PlantHue;
|
|
||||||
}
|
}
|
||||||
set => m_SeedHue = value;
|
set => m_SeedHue = value;
|
||||||
}
|
}
|
||||||
|
|
@ -346,12 +343,11 @@ namespace Server.Engines.Plants
|
||||||
{
|
{
|
||||||
if ( Water <= 1 )
|
if ( Water <= 1 )
|
||||||
return 1060826; // hard
|
return 1060826; // hard
|
||||||
else if ( Water <= 2 )
|
if ( Water <= 2 )
|
||||||
return 1060827; // soft
|
return 1060827; // soft
|
||||||
else if ( Water <= 3 )
|
if ( Water <= 3 )
|
||||||
return 1060828; // squishy
|
return 1060828; // squishy
|
||||||
else
|
return 1060829; // sopping wet
|
||||||
return 1060829; // sopping wet
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int GetLocalizedHealth()
|
public int GetLocalizedHealth()
|
||||||
|
|
|
||||||
|
|
@ -113,8 +113,7 @@ namespace Server.Engines.Plants
|
||||||
|
|
||||||
if ( index >= 0 && index < m_Table.Length )
|
if ( index >= 0 && index < m_Table.Length )
|
||||||
return m_Table[index];
|
return m_Table[index];
|
||||||
else
|
return m_Table[0];
|
||||||
return m_Table[0];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static PlantType RandomFirstGeneration()
|
public static PlantType RandomFirstGeneration()
|
||||||
|
|
@ -206,20 +205,19 @@ namespace Server.Engines.Plants
|
||||||
|
|
||||||
if ( rand < 0.5 / exp4 )
|
if ( rand < 0.5 / exp4 )
|
||||||
return PlantType.CommonGreenBonsai;
|
return PlantType.CommonGreenBonsai;
|
||||||
else if ( rand < 1.0 / exp4 )
|
if ( rand < 1.0 / exp4 )
|
||||||
return PlantType.CommonPinkBonsai;
|
return PlantType.CommonPinkBonsai;
|
||||||
else if ( rand < (k1 * 0.5 + 1.0) / exp4 )
|
if ( rand < (k1 * 0.5 + 1.0) / exp4 )
|
||||||
return PlantType.UncommonGreenBonsai;
|
return PlantType.UncommonGreenBonsai;
|
||||||
else if ( rand < exp1 / exp4 )
|
if ( rand < exp1 / exp4 )
|
||||||
return PlantType.UncommonPinkBonsai;
|
return PlantType.UncommonPinkBonsai;
|
||||||
else if ( rand < (k2 * 0.5 + exp1) / exp4 )
|
if ( rand < (k2 * 0.5 + exp1) / exp4 )
|
||||||
return PlantType.RareGreenBonsai;
|
return PlantType.RareGreenBonsai;
|
||||||
else if ( rand < exp2 / exp4 )
|
if ( rand < exp2 / exp4 )
|
||||||
return PlantType.RarePinkBonsai;
|
return PlantType.RarePinkBonsai;
|
||||||
else if ( rand < exp3 / exp4 )
|
if ( rand < exp3 / exp4 )
|
||||||
return PlantType.ExceptionalBonsai;
|
return PlantType.ExceptionalBonsai;
|
||||||
else
|
return PlantType.ExoticBonsai;
|
||||||
return PlantType.ExoticBonsai;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsCrossable( PlantType plantType )
|
public static bool IsCrossable( PlantType plantType )
|
||||||
|
|
@ -237,8 +235,7 @@ namespace Server.Engines.Plants
|
||||||
|
|
||||||
if ( firstIndex + 1 == secondIndex || firstIndex == secondIndex + 1 )
|
if ( firstIndex + 1 == secondIndex || firstIndex == secondIndex + 1 )
|
||||||
return Utility.RandomBool() ? first : second;
|
return Utility.RandomBool() ? first : second;
|
||||||
else
|
return (PlantType)( (firstIndex + secondIndex) / 2 );
|
||||||
return (PlantType)( (firstIndex + secondIndex) / 2 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool CanReproduce( PlantType plantType )
|
public static bool CanReproduce( PlantType plantType )
|
||||||
|
|
@ -261,8 +258,7 @@ namespace Server.Engines.Plants
|
||||||
|
|
||||||
if ( m_ContainsPlant )
|
if ( m_ContainsPlant )
|
||||||
return hueInfo.IsBright() ? 1060832 : 1060831; // a ~1_val~ of ~2_val~ dirt with a ~3_val~ [bright] ~4_val~ ~5_val~
|
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 )
|
public int GetPlantLabelFullGrown( PlantHueInfo hueInfo )
|
||||||
|
|
@ -272,8 +268,7 @@ namespace Server.Engines.Plants
|
||||||
|
|
||||||
if ( m_ContainsPlant )
|
if ( m_ContainsPlant )
|
||||||
return hueInfo.IsBright() ? 1061891 : 1061889; // a ~1_HEALTH~ [bright] ~2_COLOR~ ~3_NAME~
|
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 )
|
public int GetPlantLabelDecorative( PlantHueInfo hueInfo )
|
||||||
|
|
|
||||||
|
|
@ -109,25 +109,19 @@ namespace Server.Engines.Plants
|
||||||
args = $"#{title}\t#{typeInfo.Name}";
|
args = $"#{title}\t#{typeInfo.Name}";
|
||||||
return typeInfo.GetSeedLabel( hueInfo );
|
return typeInfo.GetSeedLabel( hueInfo );
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
args = $"#{title}";
|
||||||
args = $"#{title}";
|
return hueInfo.IsBright() ? 1060839 : 1060838; // [bright] ~1_val~ seed
|
||||||
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 );
|
||||||
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}";
|
||||||
|
return hueInfo.IsBright() ? 1113491 : 1113490; // ~1_amount~ [bright] ~2_val~ seeds
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void AddNameProperty( ObjectPropertyList list )
|
public override void AddNameProperty( ObjectPropertyList list )
|
||||||
|
|
|
||||||
|
|
@ -38,8 +38,7 @@ namespace Server.Engines.Quests.Ambitious
|
||||||
|
|
||||||
if ( redSolen )
|
if ( redSolen )
|
||||||
return from is RedSolenQueen;
|
return from is RedSolenQueen;
|
||||||
else
|
return from is BlackSolenQueen;
|
||||||
return from is BlackSolenQueen;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnKill( BaseCreature creature, Container corpse )
|
public override void OnKill( BaseCreature creature, Container corpse )
|
||||||
|
|
|
||||||
|
|
@ -60,8 +60,7 @@ namespace Server.Engines.Quests.Collector
|
||||||
int index = (int)image;
|
int index = (int)image;
|
||||||
if ( index >= 0 && index < m_Table.Length )
|
if ( index >= 0 && index < m_Table.Length )
|
||||||
return m_Table[index];
|
return m_Table[index];
|
||||||
else
|
return m_Table[0];
|
||||||
return m_Table[0];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ImageType[] RandomList( int count )
|
public static ImageType[] RandomList( int count )
|
||||||
|
|
|
||||||
|
|
@ -75,8 +75,7 @@ namespace Server.Engines.Quests.Collector
|
||||||
int index = Utility.Random( m_Names.Length );
|
int index = Utility.Random( m_Names.Length );
|
||||||
if ( m_Names[index] == null )
|
if ( m_Names[index] == null )
|
||||||
return from.Name;
|
return from.Name;
|
||||||
else
|
return m_Names[index];
|
||||||
return m_Names[index];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private const int m_Partial = 2;
|
private const int m_Partial = 2;
|
||||||
|
|
|
||||||
|
|
@ -217,11 +217,9 @@ namespace Server.Engines.Quests.Collector
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
bag.Delete();
|
||||||
bag.Delete();
|
return false;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Serialize( GenericWriter writer )
|
public override void Serialize( GenericWriter writer )
|
||||||
|
|
|
||||||
|
|
@ -321,14 +321,12 @@ namespace Server.Engines.Quests.Collector
|
||||||
{
|
{
|
||||||
return CaptureResponse.AlreadyDone;
|
return CaptureResponse.AlreadyDone;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
m_Done[i] = true;
|
|
||||||
|
|
||||||
CheckCompletionStatus();
|
m_Done[i] = true;
|
||||||
|
|
||||||
return CaptureResponse.Valid;
|
CheckCompletionStatus();
|
||||||
}
|
|
||||||
|
return CaptureResponse.Valid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,20 +26,16 @@ namespace Server.Engines.Quests
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if ( !(from is PlayerMobile) || CanDrop( (PlayerMobile)from ) )
|
|
||||||
|
if ( !(from is PlayerMobile) || CanDrop( (PlayerMobile)from ) )
|
||||||
{
|
{
|
||||||
return true;
|
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool DropToMobile( Mobile from, Mobile target, Point3D p )
|
public override bool DropToMobile( Mobile from, Mobile target, Point3D p )
|
||||||
|
|
@ -52,20 +48,16 @@ namespace Server.Engines.Quests
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if ( !(from is PlayerMobile) || CanDrop( (PlayerMobile)from ) )
|
|
||||||
|
if ( !(from is PlayerMobile) || CanDrop( (PlayerMobile)from ) )
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
from.SendLocalizedMessage( 1049344 ); // You decide against trading the item. You still need it for your quest.
|
||||||
{
|
return false;
|
||||||
from.SendLocalizedMessage( 1049344 ); // You decide against trading the item. You still need it for your quest.
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool DropToItem( Mobile from, Item target, Point3D p )
|
public override bool DropToItem( Mobile from, Item target, Point3D p )
|
||||||
|
|
@ -78,15 +70,13 @@ namespace Server.Engines.Quests
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if ( !(from is PlayerMobile) || CanDrop( (PlayerMobile)from ) )
|
|
||||||
|
if ( !(from is PlayerMobile) || CanDrop( (PlayerMobile)from ) )
|
||||||
{
|
{
|
||||||
return true;
|
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;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -178,14 +178,12 @@ namespace Server.Engines.Quests.Necro
|
||||||
*/
|
*/
|
||||||
return 1062058;
|
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
|
* of calling. Use Mardoth's teleporter to return to the
|
||||||
* Crystal Cave and fetch another scroll from the box.
|
* Crystal Cave and fetch another scroll from the box.
|
||||||
*/
|
*/
|
||||||
return 1060129;
|
return 1060129;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,25 +22,26 @@ namespace Server.Engines.Quests.Necro
|
||||||
qs.AddConversation( new RadarConversation() );
|
qs.AddConversation( new RadarConversation() );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if ( qs.IsObjectiveInProgress( typeof( FindCrystalCaveObjective ) ) )
|
|
||||||
|
if ( qs.IsObjectiveInProgress( typeof( FindCrystalCaveObjective ) ) )
|
||||||
{
|
{
|
||||||
loc = new Point3D( 1194, 521, -90 );
|
loc = new Point3D( 1194, 521, -90 );
|
||||||
map = Map.Malas;
|
map = Map.Malas;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if ( qs.IsObjectiveInProgress( typeof( FindCityOfLightObjective ) ) )
|
if ( qs.IsObjectiveInProgress( typeof( FindCityOfLightObjective ) ) )
|
||||||
{
|
{
|
||||||
loc = new Point3D( 1091, 519, -90 );
|
loc = new Point3D( 1091, 519, -90 );
|
||||||
map = Map.Malas;
|
map = Map.Malas;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if ( qs.IsObjectiveInProgress( typeof( ReturnToCrystalCaveObjective ) ) )
|
if ( qs.IsObjectiveInProgress( typeof( ReturnToCrystalCaveObjective ) ) )
|
||||||
{
|
{
|
||||||
loc = new Point3D( 1194, 521, -90 );
|
loc = new Point3D( 1194, 521, -90 );
|
||||||
map = Map.Malas;
|
map = Map.Malas;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if ( DarkTidesQuest.HasLostCallingScroll( player ) )
|
if ( DarkTidesQuest.HasLostCallingScroll( player ) )
|
||||||
{
|
{
|
||||||
loc = new Point3D( 1194, 521, -90 );
|
loc = new Point3D( 1194, 521, -90 );
|
||||||
map = Map.Malas;
|
map = Map.Malas;
|
||||||
|
|
|
||||||
|
|
@ -382,14 +382,12 @@ namespace Server.Engines.Quests.Necro
|
||||||
*/
|
*/
|
||||||
return 1060131;
|
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
|
* you managed to complete the rite of calling as
|
||||||
* instructed. Return to Mardoth.
|
* instructed. Return to Mardoth.
|
||||||
*/
|
*/
|
||||||
return 1060132;
|
return 1060132;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,11 +64,9 @@ namespace Server.Engines.Quests.Samurai
|
||||||
// You have just gained some <a href="?ForceTopic45">Karma</a> for killing a Cursed Soul.
|
// You have just gained some <a href="?ForceTopic45">Karma</a> for killing a Cursed Soul.
|
||||||
return 1063040;
|
return 1063040;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
// You have just gained some <a href="?ForceTopic45">Karma</a> for killing a Young Ronin.
|
||||||
// You have just gained some <a href="?ForceTopic45">Karma</a> for killing a Young Ronin.
|
return 1063041;
|
||||||
return 1063041;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -119,9 +117,8 @@ namespace Server.Engines.Quests.Samurai
|
||||||
*/
|
*/
|
||||||
return 1063045;
|
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.<BR><BR>
|
* Perhaps they will learn a greater lesson in death.<BR><BR>
|
||||||
*
|
*
|
||||||
* I have placed a reward in your pack.<BR><BR>
|
* I have placed a reward in your pack.<BR><BR>
|
||||||
|
|
@ -129,8 +126,7 @@ namespace Server.Engines.Quests.Samurai
|
||||||
* The second trial will test your courage. You only have to follow
|
* The second trial will test your courage. You only have to follow
|
||||||
* the yellow path to see what awaits you.
|
* the yellow path to see what awaits you.
|
||||||
*/
|
*/
|
||||||
return 1063046;
|
return 1063046;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -201,9 +197,8 @@ namespace Server.Engines.Quests.Samurai
|
||||||
*/
|
*/
|
||||||
return 1063060;
|
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. <BR><BR>
|
* what it appears to be. <BR><BR>
|
||||||
*
|
*
|
||||||
* You must have known the dragon would slay you instantly.
|
* 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.
|
* 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;
|
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. <BR><BR>
|
* what little dignity she has left. <BR><BR>
|
||||||
*
|
*
|
||||||
* Now she will be able to feed herself and gain enough energy to walk
|
* 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. <BR><BR>Please retrieve my katana from the
|
* prove yourself again. <BR><BR>Please retrieve my katana from the
|
||||||
* treasure room and return it to me.
|
* treasure room and return it to me.
|
||||||
*/
|
*/
|
||||||
return 1063070;
|
return 1063070;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -412,9 +404,8 @@ namespace Server.Engines.Quests.Samurai
|
||||||
*/
|
*/
|
||||||
return 1063077;
|
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. <BR><BR>
|
* treasure alone. <BR><BR>
|
||||||
*
|
*
|
||||||
* Your training is nearly complete. Before you have your final trial,
|
* 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.
|
* Go into the Altar Room and light a candle for them. Afterwards, return to me.
|
||||||
*/
|
*/
|
||||||
return 1063076;
|
return 1063076;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,8 @@ namespace Server.Engines.Quests.Matriarch
|
||||||
*/
|
*/
|
||||||
return 1054081;
|
return 1054081;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
/* <I>The Solen Matriarch smiles as she eats the seed you offered.</I><BR><BR>
|
||||||
/* <I>The Solen Matriarch smiles as she eats the seed you offered.</I><BR><BR>
|
|
||||||
*
|
*
|
||||||
* Thank you for that seed. It was quite delicious. <BR><BR>
|
* Thank you for that seed. It was quite delicious. <BR><BR>
|
||||||
*
|
*
|
||||||
|
|
@ -29,8 +28,7 @@ namespace Server.Engines.Quests.Matriarch
|
||||||
* another task at the moment. Perhaps you should finish whatever is occupying
|
* 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.
|
* 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;
|
return 1054097;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
/* <I>The Solen Matriarch listens as you report the completion of your
|
||||||
/* <I>The Solen Matriarch listens as you report the completion of your
|
|
||||||
* tasks to her.</I><BR><BR>
|
* tasks to her.</I><BR><BR>
|
||||||
*
|
*
|
||||||
* I give you my thanks for your help, and I will gladly make you a friend of my
|
* 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
|
* I will also give you some gold for assisting me and my colony, but first let's
|
||||||
* take care of your zoogi fungus.
|
* take care of your zoogi fungus.
|
||||||
*/
|
*/
|
||||||
return 1054096;
|
return 1054096;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,8 +38,7 @@ namespace Server.Engines.Quests.Matriarch
|
||||||
|
|
||||||
if ( redSolen )
|
if ( redSolen )
|
||||||
return from is BlackSolenInfiltratorWarrior || from is BlackSolenInfiltratorQueen;
|
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 )
|
public override void OnKill( BaseCreature creature, Container corpse )
|
||||||
|
|
|
||||||
|
|
@ -54,9 +54,8 @@ namespace Server.Engines.Quests.Matriarch
|
||||||
*/
|
*/
|
||||||
return 1054083;
|
return 1054083;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
/* <I>The Solen Matriarch smiles happily as she eats the seed you offered.</I><BR><BR>
|
||||||
/* <I>The Solen Matriarch smiles happily as she eats the seed you offered.</I><BR><BR>
|
|
||||||
*
|
*
|
||||||
* I think you for that seed. I was quite delicious. So full of flavor.<BR><BR>
|
* I think you for that seed. I was quite delicious. So full of flavor.<BR><BR>
|
||||||
*
|
*
|
||||||
|
|
@ -79,8 +78,7 @@ namespace Server.Engines.Quests.Matriarch
|
||||||
*
|
*
|
||||||
* Will you accept my offer?
|
* Will you accept my offer?
|
||||||
*/
|
*/
|
||||||
return 1054082;
|
return 1054082;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -128,8 +126,7 @@ namespace Server.Engines.Quests.Matriarch
|
||||||
{
|
{
|
||||||
if ( redSolen )
|
if ( redSolen )
|
||||||
return player.SolenFriendship == SolenFriendship.Red;
|
return player.SolenFriendship == SolenFriendship.Red;
|
||||||
else
|
return player.SolenFriendship == SolenFriendship.Black;
|
||||||
return player.SolenFriendship == SolenFriendship.Black;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool GiveRewardTo( PlayerMobile player )
|
public static bool GiveRewardTo( PlayerMobile player )
|
||||||
|
|
@ -141,11 +138,9 @@ namespace Server.Engines.Quests.Matriarch
|
||||||
player.SendLocalizedMessage( 1054076 ); // You have been given some gold.
|
player.SendLocalizedMessage( 1054076 ); // You have been given some gold.
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
gold.Delete();
|
||||||
gold.Delete();
|
return false;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,8 +46,7 @@ namespace Server.Engines.Quests.Naturalist
|
||||||
{
|
{
|
||||||
if ( id >= 0 && id < m_Areas.Length )
|
if ( id >= 0 && id < m_Areas.Length )
|
||||||
return m_Areas[id];
|
return m_Areas[id];
|
||||||
else
|
return null;
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool m_Special;
|
private bool m_Special;
|
||||||
|
|
|
||||||
|
|
@ -38,8 +38,7 @@ namespace Server.Engines.Quests.Zento
|
||||||
{
|
{
|
||||||
if ( m.Quest == null )
|
if ( m.Quest == null )
|
||||||
return 3;
|
return 3;
|
||||||
else
|
return -1;
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnTalk( PlayerMobile player, bool contextMenu )
|
public override void OnTalk( PlayerMobile player, bool contextMenu )
|
||||||
|
|
|
||||||
|
|
@ -139,16 +139,14 @@ namespace Server.Engines.Quests.Doom
|
||||||
foundLoc = true;
|
foundLoc = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
int z = map.GetAverageZ( x, y );
|
|
||||||
|
|
||||||
if ( map.CanSpawnMobile( x, y, z ) )
|
int z = map.GetAverageZ( x, y );
|
||||||
{
|
|
||||||
dragon.MoveToWorld( new Point3D( x, y, z ), map );
|
if ( map.CanSpawnMobile( x, y, z ) )
|
||||||
foundLoc = true;
|
{
|
||||||
break;
|
dragon.MoveToWorld( new Point3D( x, y, z ), map );
|
||||||
}
|
foundLoc = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -65,10 +65,9 @@ namespace Server.Engines.Quests.Doom
|
||||||
|
|
||||||
if ( fame < 1500 )
|
if ( fame < 1500 )
|
||||||
return Utility.Dice( 2, 5, -1 );
|
return Utility.Dice( 2, 5, -1 );
|
||||||
else if ( fame < 20000 )
|
if ( fame < 20000 )
|
||||||
return Utility.Dice( 2, 4, 8 );
|
return Utility.Dice( 2, 4, 8 );
|
||||||
else
|
return 50;
|
||||||
return 50;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public TheSummoningQuest( Victoria victoria, PlayerMobile from ) : base( from )
|
public TheSummoningQuest( Victoria victoria, PlayerMobile from ) : base( from )
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,8 @@ namespace Server.Engines.Quests.Haven
|
||||||
*/
|
*/
|
||||||
return 1049088;
|
return 1049088;
|
||||||
}
|
}
|
||||||
else if ( System.From.Profession == 2 ) // magician
|
|
||||||
|
if ( System.From.Profession == 2 ) // magician
|
||||||
{
|
{
|
||||||
/* <I>Uzeraan greets you as you approach...</I><BR><BR>
|
/* <I>Uzeraan greets you as you approach...</I><BR><BR>
|
||||||
*
|
*
|
||||||
|
|
@ -95,9 +96,7 @@ namespace Server.Engines.Quests.Haven
|
||||||
*/
|
*/
|
||||||
return 1049386;
|
return 1049386;
|
||||||
}
|
}
|
||||||
else
|
/* <I>Uzeraan nods at you with approval and begins to speak...</I><BR><BR>
|
||||||
{
|
|
||||||
/* <I>Uzeraan nods at you with approval and begins to speak...</I><BR><BR>
|
|
||||||
*
|
*
|
||||||
* Now that you are ready, let me give you your first task.<BR><BR>
|
* Now that you are ready, let me give you your first task.<BR><BR>
|
||||||
*
|
*
|
||||||
|
|
@ -120,8 +119,7 @@ namespace Server.Engines.Quests.Haven
|
||||||
*
|
*
|
||||||
* Good luck young Paladin!
|
* Good luck young Paladin!
|
||||||
*/
|
*/
|
||||||
return 1060388;
|
return 1060388;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -180,9 +178,8 @@ namespace Server.Engines.Quests.Haven
|
||||||
*/
|
*/
|
||||||
return 1049387;
|
return 1049387;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
/* <I>You give your report to Uzeraan and after a while,
|
||||||
/* <I>You give your report to Uzeraan and after a while,
|
|
||||||
* he begins to speak...</I><BR><BR>
|
* he begins to speak...</I><BR><BR>
|
||||||
*
|
*
|
||||||
* Your report is grim, but all hope is not lost! It has become apparent
|
* Your report is grim, but all hope is not lost! It has become apparent
|
||||||
|
|
@ -208,8 +205,7 @@ namespace Server.Engines.Quests.Haven
|
||||||
* and <a href="?ForceTopic76">Healing</a> <a href="?ForceTopic74">potions</a>
|
* and <a href="?ForceTopic76">Healing</a> <a href="?ForceTopic74">potions</a>
|
||||||
* to help you out along the way. Good luck.
|
* to help you out along the way. Good luck.
|
||||||
*/
|
*/
|
||||||
return 1049119;
|
return 1049119;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -265,9 +261,8 @@ namespace Server.Engines.Quests.Haven
|
||||||
*/
|
*/
|
||||||
return 1060749;
|
return 1060749;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
/* <I>Schmendrick barely pays you any attention as you approach him. His
|
||||||
/* <I>Schmendrick barely pays you any attention as you approach him. His
|
|
||||||
* mind seems to be occupied with something else. You explain to him that
|
* 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,
|
* 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...</I><BR><BR>
|
* but apparently still not giving you his full attention...</I><BR><BR>
|
||||||
|
|
@ -284,8 +279,7 @@ namespace Server.Engines.Quests.Haven
|
||||||
* <I>Schmendrick goes back to his work and you seem to completely fade from his
|
* <I>Schmendrick goes back to his work and you seem to completely fade from his
|
||||||
* awareness...
|
* awareness...
|
||||||
*/
|
*/
|
||||||
return 1049322;
|
return 1049322;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -370,9 +364,8 @@ namespace Server.Engines.Quests.Haven
|
||||||
*/
|
*/
|
||||||
return 1049388;
|
return 1049388;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
/* <I>Uzeraan takes the dirt from you and smiles...<BR><BR></I>
|
||||||
/* <I>Uzeraan takes the dirt from you and smiles...<BR><BR></I>
|
|
||||||
*
|
*
|
||||||
* Wonderful! I knew I could count on you. As a token of my appreciation
|
* 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.
|
* 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!
|
* Good luck!
|
||||||
*/
|
*/
|
||||||
return 1049329;
|
return 1049329;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -440,9 +432,8 @@ namespace Server.Engines.Quests.Haven
|
||||||
+ "<BR>"
|
+ "<BR>"
|
||||||
+ "Return here when you have found a <I>Daemon Bone</I>.";
|
+ "Return here when you have found a <I>Daemon Bone</I>.";
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
/* <I>You hand Uzeraan the Vial of Blood, which he hastily accepts...</I><BR><BR>
|
||||||
/* <I>You hand Uzeraan the Vial of Blood, which he hastily accepts...</I><BR><BR>
|
|
||||||
*
|
*
|
||||||
* Excellent work! Only one reagent remains and the spell is complete!
|
* Excellent work! Only one reagent remains and the spell is complete!
|
||||||
* The final requirement is a <I>Daemon Bone</I>, which will not be as easily
|
* The final requirement is a <I>Daemon Bone</I>, which will not be as easily
|
||||||
|
|
@ -459,8 +450,7 @@ namespace Server.Engines.Quests.Haven
|
||||||
*
|
*
|
||||||
* Return here when you have found a <I>Daemon Bone</I>.
|
* Return here when you have found a <I>Daemon Bone</I>.
|
||||||
*/
|
*/
|
||||||
return 1049333;
|
return 1049333;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -479,8 +469,7 @@ namespace Server.Engines.Quests.Haven
|
||||||
{
|
{
|
||||||
if ( System.From.Profession == 5 ) // paladin
|
if ( System.From.Profession == 5 ) // paladin
|
||||||
return m_InfoPaladin;
|
return m_InfoPaladin;
|
||||||
else
|
return m_Info;
|
||||||
return m_Info;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -550,9 +539,8 @@ namespace Server.Engines.Quests.Haven
|
||||||
*/
|
*/
|
||||||
return 1049377;
|
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
|
* the scroll from memory. Bring me a blank scroll, which you can
|
||||||
* <a href = "?ForceTopic33">purchase from the mage shop</a> just
|
* <a href = "?ForceTopic33">purchase from the mage shop</a> just
|
||||||
* <a href = "?ForceTopic13">East</a> of Uzeraan's mansion in Haven.<BR><BR>
|
* <a href = "?ForceTopic13">East</a> of Uzeraan's mansion in Haven.<BR><BR>
|
||||||
|
|
@ -561,8 +549,7 @@ namespace Server.Engines.Quests.Haven
|
||||||
*
|
*
|
||||||
* When you return, be sure to hand me the scroll (drag and drop).
|
* 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;
|
return 1049374;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
/* You've lost the dirt I gave you?<BR><BR>
|
||||||
/* You've lost the dirt I gave you?<BR><BR>
|
|
||||||
*
|
*
|
||||||
* My, my, my... What ever shall we do now?<BR><BR>
|
* My, my, my... What ever shall we do now?<BR><BR>
|
||||||
*
|
*
|
||||||
|
|
@ -628,8 +614,7 @@ namespace Server.Engines.Quests.Haven
|
||||||
*
|
*
|
||||||
* Good luck.<BR><BR>
|
* Good luck.<BR><BR>
|
||||||
*/
|
*/
|
||||||
return 1049359;
|
return 1049359;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,22 +23,23 @@ namespace Server.Engines.Quests.Haven
|
||||||
map = Map.Trammel;
|
map = Map.Trammel;
|
||||||
return true;
|
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 );
|
loc = new Point3D( 3557, 2690, 2 );
|
||||||
map = Map.Trammel;
|
map = Map.Trammel;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if ( player.Profession != 5 // paladin
|
if ( player.Profession != 5 // paladin
|
||||||
&& ( qs.IsObjectiveInProgress( typeof( GetDaemonBoneObjective ) )
|
&& ( qs.IsObjectiveInProgress( typeof( GetDaemonBoneObjective ) )
|
||||||
|| UzeraanTurmoilQuest.HasLostDaemonBone( player ) ) )
|
|| UzeraanTurmoilQuest.HasLostDaemonBone( player ) ) )
|
||||||
{
|
{
|
||||||
loc = new Point3D( 3422, 2653, 48 );
|
loc = new Point3D( 3422, 2653, 48 );
|
||||||
map = Map.Trammel;
|
map = Map.Trammel;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if ( qs.IsObjectiveInProgress( typeof( CashBankCheckObjective ) ) )
|
if ( qs.IsObjectiveInProgress( typeof( CashBankCheckObjective ) ) )
|
||||||
{
|
{
|
||||||
loc = new Point3D( 3624, 2610, 0 );
|
loc = new Point3D( 3624, 2610, 0 );
|
||||||
map = Map.Trammel;
|
map = Map.Trammel;
|
||||||
|
|
|
||||||
|
|
@ -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.
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
dropped.Consume();
|
||||||
dropped.Consume();
|
from.SendLocalizedMessage( 1049346 ); // Schmendrick scribbles on the scroll for a few moments and hands you the finished product.
|
||||||
from.SendLocalizedMessage( 1049346 ); // Schmendrick scribbles on the scroll for a few moments and hands you the finished product.
|
return dropped.Deleted;
|
||||||
return dropped.Deleted;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return base.OnDragDrop( from, dropped );
|
return base.OnDragDrop( from, dropped );
|
||||||
|
|
|
||||||
|
|
@ -119,10 +119,8 @@ namespace Server.Engines.Quests.Haven
|
||||||
default: return 5;
|
default: return 5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
return 5;
|
||||||
return 5;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -132,8 +130,7 @@ namespace Server.Engines.Quests.Haven
|
||||||
{
|
{
|
||||||
if ( m_Step == KillHordeMinionsStep.LearnKarma && HasBeenRead )
|
if ( m_Step == KillHordeMinionsStep.LearnKarma && HasBeenRead )
|
||||||
return true;
|
return true;
|
||||||
else
|
return base.Completed;
|
||||||
return base.Completed;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -414,14 +411,12 @@ namespace Server.Engines.Quests.Haven
|
||||||
*/
|
*/
|
||||||
return 1060755;
|
return 1060755;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
/* Use Uzeraan's teleporter to get to the Haunted graveyard.<BR><BR>
|
||||||
/* Use Uzeraan's teleporter to get to the Haunted graveyard.<BR><BR>
|
|
||||||
*
|
*
|
||||||
* Slay the undead until you find a <I>Daemon Bone</I>.
|
* Slay the undead until you find a <I>Daemon Bone</I>.
|
||||||
*/
|
*/
|
||||||
return 1049362;
|
return 1049362;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue