Adds style cop (#109)
This commit is contained in:
parent
3e715bcb60
commit
556a17aba8
1725 changed files with 33831 additions and 38046 deletions
|
|
@ -8,14 +8,19 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Scripts", "Projects\Scripts
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Analyze|Any CPU = Analyze|Any CPU
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
Release|Any CPU = Release|Any CPU
|
Release|Any CPU = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{5E93BB35-3661-4822-9A8A-859726BAD87F}.Analyze|Any CPU.ActiveCfg = Analyze|Any CPU
|
||||||
|
{5E93BB35-3661-4822-9A8A-859726BAD87F}.Analyze|Any CPU.Build.0 = Analyze|Any CPU
|
||||||
{5E93BB35-3661-4822-9A8A-859726BAD87F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{5E93BB35-3661-4822-9A8A-859726BAD87F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{5E93BB35-3661-4822-9A8A-859726BAD87F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{5E93BB35-3661-4822-9A8A-859726BAD87F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{5E93BB35-3661-4822-9A8A-859726BAD87F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{5E93BB35-3661-4822-9A8A-859726BAD87F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{5E93BB35-3661-4822-9A8A-859726BAD87F}.Release|Any CPU.Build.0 = Release|Any CPU
|
{5E93BB35-3661-4822-9A8A-859726BAD87F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{83CF2484-BCCB-4B7C-9C5F-7AB43AEA5E8F}.Analyze|Any CPU.ActiveCfg = Analyze|Any CPU
|
||||||
|
{83CF2484-BCCB-4B7C-9C5F-7AB43AEA5E8F}.Analyze|Any CPU.Build.0 = Analyze|Any CPU
|
||||||
{83CF2484-BCCB-4B7C-9C5F-7AB43AEA5E8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{83CF2484-BCCB-4B7C-9C5F-7AB43AEA5E8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{83CF2484-BCCB-4B7C-9C5F-7AB43AEA5E8F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{83CF2484-BCCB-4B7C-9C5F-7AB43AEA5E8F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{83CF2484-BCCB-4B7C-9C5F-7AB43AEA5E8F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{83CF2484-BCCB-4B7C-9C5F-7AB43AEA5E8F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -10,7 +10,7 @@ namespace Server.Accounting
|
||||||
{
|
{
|
||||||
public static bool Enabled = true;
|
public static bool Enabled = true;
|
||||||
|
|
||||||
private static List<InvalidAccountAccessLog> m_List = new List<InvalidAccountAccessLog>();
|
private static readonly List<InvalidAccountAccessLog> m_List = new List<InvalidAccountAccessLog>();
|
||||||
|
|
||||||
public static void Initialize()
|
public static void Initialize()
|
||||||
{
|
{
|
||||||
|
|
@ -75,8 +75,7 @@ namespace Server.Accounting
|
||||||
"{0}\t{1}\t{2}",
|
"{0}\t{1}\t{2}",
|
||||||
DateTime.UtcNow,
|
DateTime.UtcNow,
|
||||||
ns,
|
ns,
|
||||||
accessLog.Counts
|
accessLog.Counts);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|
@ -113,13 +112,13 @@ namespace Server.Accounting
|
||||||
RefreshAccessTime();
|
RefreshAccessTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
public IPAddress Address{ get; set; }
|
public IPAddress Address { get; set; }
|
||||||
|
|
||||||
public DateTime LastAccessTime{ get; set; }
|
public DateTime LastAccessTime { get; set; }
|
||||||
|
|
||||||
public bool HasExpired => DateTime.UtcNow >= LastAccessTime + TimeSpan.FromHours(1.0);
|
public bool HasExpired => DateTime.UtcNow >= LastAccessTime + TimeSpan.FromHours(1.0);
|
||||||
|
|
||||||
public int Counts{ get; set; }
|
public int Counts { get; set; }
|
||||||
|
|
||||||
public void RefreshAccessTime()
|
public void RefreshAccessTime()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ namespace Server.Accounting
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A string representing who added this comment.
|
/// A string representing who added this comment.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string AddedBy{ get; }
|
public string AddedBy { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the body of this comment. Setting this value will reset LastModified.
|
/// Gets or sets the body of this comment. Setting this value will reset LastModified.
|
||||||
|
|
@ -51,7 +51,7 @@ namespace Server.Accounting
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The date and time when this account was last modified -or- the comment creation time, if never modified.
|
/// The date and time when this account was last modified -or- the comment creation time, if never modified.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime LastModified{ get; private set; }
|
public DateTime LastModified { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Serializes this AccountComment instance to an XmlTextWriter.
|
/// Serializes this AccountComment instance to an XmlTextWriter.
|
||||||
|
|
|
||||||
|
|
@ -18,14 +18,14 @@ namespace Server.Misc
|
||||||
|
|
||||||
public class AccountHandler
|
public class AccountHandler
|
||||||
{
|
{
|
||||||
private static int MaxAccountsPerIP = 1;
|
private static readonly int MaxAccountsPerIP = 1;
|
||||||
private static bool AutoAccountCreation = true;
|
private static readonly bool AutoAccountCreation = true;
|
||||||
private static bool RestrictDeletion = !TestCenter.Enabled;
|
private static readonly bool RestrictDeletion = !TestCenter.Enabled;
|
||||||
private static TimeSpan DeleteDelay = TimeSpan.FromDays(7.0);
|
private static readonly TimeSpan DeleteDelay = TimeSpan.FromDays(7.0);
|
||||||
|
|
||||||
public static PasswordProtection ProtectPasswords = PasswordProtection.NewCrypt;
|
public static PasswordProtection ProtectPasswords = PasswordProtection.NewCrypt;
|
||||||
|
|
||||||
private static CityInfo[] StartingCities =
|
private static readonly CityInfo[] StartingCities =
|
||||||
{
|
{
|
||||||
new CityInfo("New Haven", "New Haven Bank", 1150168, 3667, 2625, 0),
|
new CityInfo("New Haven", "New Haven Bank", 1150168, 3667, 2625, 0),
|
||||||
new CityInfo("Yew", "The Empath Abbey", 1075072, 633, 858, 0),
|
new CityInfo("Yew", "The Empath Abbey", 1075072, 633, 858, 0),
|
||||||
|
|
@ -47,7 +47,7 @@ namespace Server.Misc
|
||||||
// ..
|
// ..
|
||||||
new CityInfo( "Haven", "Buckler's Hideaway", 3667, 2625, 0 )
|
new CityInfo( "Haven", "Buckler's Hideaway", 3667, 2625, 0 )
|
||||||
|
|
||||||
if ( Core.AOS )
|
if (Core.AOS)
|
||||||
{
|
{
|
||||||
//CityInfo haven = new CityInfo( "Haven", "Uzeraan's Mansion", 3618, 2591, 0 );
|
//CityInfo haven = new CityInfo( "Haven", "Uzeraan's Mansion", 3618, 2591, 0 );
|
||||||
CityInfo haven = new CityInfo( "Haven", "Uzeraan's Mansion", 3503, 2574, 14 );
|
CityInfo haven = new CityInfo( "Haven", "Uzeraan's Mansion", 3503, 2574, 14 );
|
||||||
|
|
@ -55,7 +55,7 @@ namespace Server.Misc
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private static bool PasswordCommandEnabled = false;
|
private static readonly bool PasswordCommandEnabled = false;
|
||||||
|
|
||||||
private static Dictionary<IPAddress, int> m_IPTable;
|
private static Dictionary<IPAddress, int> m_IPTable;
|
||||||
|
|
||||||
|
|
@ -64,7 +64,7 @@ namespace Server.Misc
|
||||||
'<', '>', ':', '"', '/', '\\', '|', '?', '*'
|
'<', '>', ':', '"', '/', '\\', '|', '?', '*'
|
||||||
};
|
};
|
||||||
|
|
||||||
public static AccessLevel LockdownLevel{ get; set; }
|
public static AccessLevel LockdownLevel { get; set; }
|
||||||
|
|
||||||
public static Dictionary<IPAddress, int> IPTable
|
public static Dictionary<IPAddress, int> IPTable
|
||||||
{
|
{
|
||||||
|
|
@ -174,10 +174,10 @@ namespace Server.Misc
|
||||||
from.SendMessage(
|
from.SendMessage(
|
||||||
"Your IP address does not match that which created this account. A page has been entered into the help system on your behalf.");
|
"Your IP address does not match that which created this account. A page has been entered into the help system on your behalf.");
|
||||||
|
|
||||||
from.SendLocalizedMessage(501234, "",
|
/* The next available Counselor/Game Master will respond as soon as possible.
|
||||||
0x35); /* The next available Counselor/Game Master will respond as soon as possible.
|
|
||||||
* Please check your Journal for messages every few minutes.
|
* Please check your Journal for messages every few minutes.
|
||||||
*/
|
*/
|
||||||
|
from.SendLocalizedMessage(501234, "", 0x35);
|
||||||
|
|
||||||
PageQueue.Enqueue(new PageEntry(from,
|
PageQueue.Enqueue(new PageEntry(from,
|
||||||
$"[Automated: Change Password]<br>Desired password: {pass}<br>Current IP address: {ipAddress}<br>Account IP address: {accessList[0]}",
|
$"[Automated: Change Password]<br>Desired password: {pass}<br>Current IP address: {ipAddress}<br>Account IP address: {accessList[0]}",
|
||||||
|
|
@ -222,8 +222,7 @@ namespace Server.Misc
|
||||||
state.Send(new CharacterListUpdate(acct));
|
state.Send(new CharacterListUpdate(acct));
|
||||||
}
|
}
|
||||||
else if (m.AccessLevel == AccessLevel.Player &&
|
else if (m.AccessLevel == AccessLevel.Player &&
|
||||||
Region.Find(m.LogoutLocation, m.LogoutMap).IsPartOf<Jail>()
|
Region.Find(m.LogoutLocation, m.LogoutMap).IsPartOf<Jail>()) // Don't need to check current location, if netstate is null, they're logged out
|
||||||
) //Don't need to check current location, if netstate is null, they're logged out
|
|
||||||
{
|
{
|
||||||
state.Send(new DeleteResult(DeleteResultType.BadRequest));
|
state.Send(new DeleteResult(DeleteResultType.BadRequest));
|
||||||
state.Send(new CharacterListUpdate(acct));
|
state.Send(new CharacterListUpdate(acct));
|
||||||
|
|
|
||||||
|
|
@ -28,12 +28,12 @@ namespace Server.Accounting
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the name of this tag.
|
/// Gets or sets the name of this tag.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Name{ get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the value of this tag.
|
/// Gets or sets the value of this tag.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Value{ get; set; }
|
public string Value { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Serializes this AccountTag instance to an XmlTextWriter.
|
/// Serializes this AccountTag instance to an XmlTextWriter.
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,6 @@ namespace Server.Accounting
|
||||||
using StreamWriter op = new StreamWriter(filePath);
|
using StreamWriter op = new StreamWriter(filePath);
|
||||||
XmlTextWriter xml = new XmlTextWriter(op) { Formatting = Formatting.Indented, IndentChar = '\t', Indentation = 1 };
|
XmlTextWriter xml = new XmlTextWriter(op) { Formatting = Formatting.Indented, IndentChar = '\t', Indentation = 1 };
|
||||||
|
|
||||||
|
|
||||||
xml.WriteStartDocument(true);
|
xml.WriteStartDocument(true);
|
||||||
|
|
||||||
xml.WriteStartElement("accounts");
|
xml.WriteStartElement("accounts");
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ namespace Server
|
||||||
object toAdd;
|
object toAdd;
|
||||||
|
|
||||||
IPAddress addr;
|
IPAddress addr;
|
||||||
if ( IPAddress.TryParse( line, out addr ) )
|
if (IPAddress.TryParse( line, out addr ))
|
||||||
toAdd = addr;
|
toAdd = addr;
|
||||||
else
|
else
|
||||||
toAdd = line;
|
toAdd = line;
|
||||||
|
|
@ -41,7 +41,7 @@ namespace Server
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<IFirewallEntry> List{ get; }
|
public static List<IFirewallEntry> List { get; }
|
||||||
|
|
||||||
public static IFirewallEntry ToFirewallEntry(object entry)
|
public static IFirewallEntry ToFirewallEntry(object entry)
|
||||||
{
|
{
|
||||||
|
|
@ -60,7 +60,7 @@ namespace Server
|
||||||
if (IPAddress.TryParse(entry, out IPAddress addr))
|
if (IPAddress.TryParse(entry, out IPAddress addr))
|
||||||
return new IPFirewallEntry(addr);
|
return new IPFirewallEntry(addr);
|
||||||
|
|
||||||
//Try CIDR parse
|
// Try CIDR parse
|
||||||
string[] str = entry.Split('/');
|
string[] str = entry.Split('/');
|
||||||
|
|
||||||
if (str.Length == 2)
|
if (str.Length == 2)
|
||||||
|
|
@ -147,15 +147,15 @@ namespace Server
|
||||||
|
|
||||||
for ( int i = 0; !contains && i < m_Blocked.Count; ++i )
|
for ( int i = 0; !contains && i < m_Blocked.Count; ++i )
|
||||||
{
|
{
|
||||||
if ( m_Blocked[i] is IPAddress )
|
if (m_Blocked[i] is IPAddress)
|
||||||
contains = ip.Equals( m_Blocked[i] );
|
contains = ip.Equals( m_Blocked[i] );
|
||||||
else if ( m_Blocked[i] is String )
|
else if (m_Blocked[i] is String)
|
||||||
{
|
{
|
||||||
string s = (string)m_Blocked[i];
|
string s = (string)m_Blocked[i];
|
||||||
|
|
||||||
contains = Utility.IPMatchCIDR( s, ip );
|
contains = Utility.IPMatchCIDR( s, ip );
|
||||||
|
|
||||||
if ( !contains )
|
if (!contains)
|
||||||
contains = Utility.IPMatch( s, ip );
|
contains = Utility.IPMatch( s, ip );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -164,8 +164,6 @@ namespace Server
|
||||||
* */
|
* */
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Firewall Entries
|
|
||||||
|
|
||||||
public interface IFirewallEntry
|
public interface IFirewallEntry
|
||||||
{
|
{
|
||||||
bool IsBlocked(IPAddress address);
|
bool IsBlocked(IPAddress address);
|
||||||
|
|
@ -173,7 +171,7 @@ namespace Server
|
||||||
|
|
||||||
public class IPFirewallEntry : IFirewallEntry
|
public class IPFirewallEntry : IFirewallEntry
|
||||||
{
|
{
|
||||||
private IPAddress m_Address;
|
private readonly IPAddress m_Address;
|
||||||
|
|
||||||
public IPFirewallEntry(IPAddress address) => m_Address = address;
|
public IPFirewallEntry(IPAddress address) => m_Address = address;
|
||||||
|
|
||||||
|
|
@ -203,8 +201,8 @@ namespace Server
|
||||||
|
|
||||||
public class CIDRFirewallEntry : IFirewallEntry
|
public class CIDRFirewallEntry : IFirewallEntry
|
||||||
{
|
{
|
||||||
private int m_CIDRLength;
|
private readonly int m_CIDRLength;
|
||||||
private IPAddress m_CIDRPrefix;
|
private readonly IPAddress m_CIDRPrefix;
|
||||||
|
|
||||||
public CIDRFirewallEntry(IPAddress cidrPrefix, int cidrLength)
|
public CIDRFirewallEntry(IPAddress cidrPrefix, int cidrLength)
|
||||||
{
|
{
|
||||||
|
|
@ -240,7 +238,7 @@ namespace Server
|
||||||
|
|
||||||
public class WildcardIPFirewallEntry : IFirewallEntry
|
public class WildcardIPFirewallEntry : IFirewallEntry
|
||||||
{
|
{
|
||||||
private string m_Entry;
|
private readonly string m_Entry;
|
||||||
|
|
||||||
private bool m_Valid;
|
private bool m_Valid;
|
||||||
|
|
||||||
|
|
@ -249,7 +247,7 @@ namespace Server
|
||||||
public bool IsBlocked(IPAddress address)
|
public bool IsBlocked(IPAddress address)
|
||||||
{
|
{
|
||||||
if (!m_Valid)
|
if (!m_Valid)
|
||||||
return false; //Why process if it's invalid? it'll return false anyway after processing it.
|
return false; // Why process if it's invalid? it'll return false anyway after processing it.
|
||||||
|
|
||||||
bool matched = Utility.IPMatch(m_Entry, address, out bool valid);
|
bool matched = Utility.IPMatch(m_Entry, address, out bool valid);
|
||||||
m_Valid = valid;
|
m_Valid = valid;
|
||||||
|
|
@ -268,7 +266,5 @@ namespace Server
|
||||||
|
|
||||||
public override int GetHashCode() => m_Entry.GetHashCode();
|
public override int GetHashCode() => m_Entry.GetHashCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ namespace Server.Misc
|
||||||
|
|
||||||
public static IPAddress[] Exemptions =
|
public static IPAddress[] Exemptions =
|
||||||
{
|
{
|
||||||
//IPAddress.Parse( "127.0.0.1" ),
|
// IPAddress.Parse( "127.0.0.1" ),
|
||||||
};
|
};
|
||||||
|
|
||||||
public static bool IsExempt(IPAddress ip)
|
public static bool IsExempt(IPAddress ip)
|
||||||
|
|
|
||||||
|
|
@ -9,20 +9,20 @@ namespace Server.Commands
|
||||||
{
|
{
|
||||||
public class Add
|
public class Add
|
||||||
{
|
{
|
||||||
private static Type m_EntityType = typeof(IEntity);
|
private static readonly Type m_EntityType = typeof(IEntity);
|
||||||
|
|
||||||
private static Type m_ConstructibleType = typeof(ConstructibleAttribute);
|
private static readonly Type m_ConstructibleType = typeof(ConstructibleAttribute);
|
||||||
|
|
||||||
private static Type m_EnumType = typeof(Enum);
|
private static readonly Type m_EnumType = typeof(Enum);
|
||||||
|
|
||||||
private static Type m_TypeType = typeof(Type);
|
private static readonly Type m_TypeType = typeof(Type);
|
||||||
|
|
||||||
private static Type m_ParsableType = typeof(ParsableAttribute);
|
private static readonly Type m_ParsableType = typeof(ParsableAttribute);
|
||||||
|
|
||||||
private static Type[] m_ParseTypes = { typeof(string) };
|
private static readonly Type[] m_ParseTypes = { typeof(string) };
|
||||||
private static object[] m_ParseArgs = new object[1];
|
private static readonly object[] m_ParseArgs = new object[1];
|
||||||
|
|
||||||
private static Type[] m_SignedNumerics =
|
private static readonly Type[] m_SignedNumerics =
|
||||||
{
|
{
|
||||||
typeof(long),
|
typeof(long),
|
||||||
typeof(int),
|
typeof(int),
|
||||||
|
|
@ -30,7 +30,7 @@ namespace Server.Commands
|
||||||
typeof(sbyte)
|
typeof(sbyte)
|
||||||
};
|
};
|
||||||
|
|
||||||
private static Type[] m_UnsignedNumerics =
|
private static readonly Type[] m_UnsignedNumerics =
|
||||||
{
|
{
|
||||||
typeof(ulong),
|
typeof(ulong),
|
||||||
typeof(uint),
|
typeof(uint),
|
||||||
|
|
@ -198,7 +198,6 @@ namespace Server.Commands
|
||||||
if (!paramList[j].HasDefaultValue)
|
if (!paramList[j].HasDefaultValue)
|
||||||
totalParams += 1;
|
totalParams += 1;
|
||||||
|
|
||||||
|
|
||||||
if (args.Length >= totalParams && args.Length <= paramList.Length)
|
if (args.Length >= totalParams && args.Length <= paramList.Length)
|
||||||
{
|
{
|
||||||
object[] paramValues = ParseValues(paramList, args);
|
object[] paramValues = ParseValues(paramList, args);
|
||||||
|
|
@ -667,10 +666,10 @@ namespace Server.Commands
|
||||||
|
|
||||||
private class TileState
|
private class TileState
|
||||||
{
|
{
|
||||||
public string[] m_Args;
|
public readonly string[] m_Args;
|
||||||
public int m_FixedZ;
|
public readonly int m_FixedZ;
|
||||||
public bool m_Outline;
|
public readonly bool m_Outline;
|
||||||
public TileZType m_ZType;
|
public readonly TileZType m_ZType;
|
||||||
|
|
||||||
public TileState(TileZType zType, int fixedZ, string[] args, bool outline)
|
public TileState(TileZType zType, int fixedZ, string[] args, bool outline)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -6,20 +6,20 @@ namespace Server
|
||||||
{
|
{
|
||||||
public UsageAttribute(string usage) => Usage = usage;
|
public UsageAttribute(string usage) => Usage = usage;
|
||||||
|
|
||||||
public string Usage{ get; }
|
public string Usage { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DescriptionAttribute : Attribute
|
public class DescriptionAttribute : Attribute
|
||||||
{
|
{
|
||||||
public DescriptionAttribute(string description) => Description = description;
|
public DescriptionAttribute(string description) => Description = description;
|
||||||
|
|
||||||
public string Description{ get; }
|
public string Description { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class AliasesAttribute : Attribute
|
public class AliasesAttribute : Attribute
|
||||||
{
|
{
|
||||||
public AliasesAttribute(params string[] aliases) => Aliases = aliases;
|
public AliasesAttribute(params string[] aliases) => Aliases = aliases;
|
||||||
|
|
||||||
public string[] Aliases{ get; }
|
public string[] Aliases { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -15,11 +15,11 @@ namespace Server.Commands
|
||||||
ListOptimized = true;
|
ListOptimized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BaseCommandImplementor Scope{ get; set; }
|
public BaseCommandImplementor Scope { get; set; }
|
||||||
|
|
||||||
public string Condition{ get; set; } = "";
|
public string Condition { get; set; } = "";
|
||||||
|
|
||||||
public List<BatchCommand> BatchCommands{ get; } = new List<BatchCommand>();
|
public List<BatchCommand> BatchCommands { get; } = new List<BatchCommand>();
|
||||||
|
|
||||||
public override void ExecuteList(CommandEventArgs e, List<object> list)
|
public override void ExecuteList(CommandEventArgs e, List<object> list)
|
||||||
{
|
{
|
||||||
|
|
@ -180,9 +180,9 @@ namespace Server.Commands
|
||||||
Object = obj;
|
Object = obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Command{ get; set; }
|
public string Command { get; set; }
|
||||||
|
|
||||||
public string Object{ get; set; }
|
public string Object { get; set; }
|
||||||
|
|
||||||
public void GetDetails(out string command, out string argString, out string[] args)
|
public void GetDetails(out string command, out string argString, out string[] args)
|
||||||
{
|
{
|
||||||
|
|
@ -199,15 +199,15 @@ namespace Server.Commands
|
||||||
{
|
{
|
||||||
argString = "";
|
argString = "";
|
||||||
command = Command.ToLower();
|
command = Command.ToLower();
|
||||||
args = new string[0];
|
args = Array.Empty<string>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class BatchGump : BaseGridGump
|
public class BatchGump : BaseGridGump
|
||||||
{
|
{
|
||||||
private Batch m_Batch;
|
private readonly Batch m_Batch;
|
||||||
private Mobile m_From;
|
private readonly Mobile m_From;
|
||||||
|
|
||||||
public BatchGump(Mobile from, Batch batch) : base(30, 30)
|
public BatchGump(Mobile from, Batch batch) : base(30, 30)
|
||||||
{
|
{
|
||||||
|
|
@ -356,8 +356,8 @@ namespace Server.Commands
|
||||||
|
|
||||||
public class BatchScopeGump : BaseGridGump
|
public class BatchScopeGump : BaseGridGump
|
||||||
{
|
{
|
||||||
private Batch m_Batch;
|
private readonly Batch m_Batch;
|
||||||
private Mobile m_From;
|
private readonly Mobile m_From;
|
||||||
|
|
||||||
public BatchScopeGump(Mobile from, Batch batch) : base(30, 30)
|
public BatchScopeGump(Mobile from, Batch batch) : base(30, 30)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,10 @@ namespace Server
|
||||||
|
|
||||||
private class PickTarget : Target
|
private class PickTarget : Target
|
||||||
{
|
{
|
||||||
private BoundingBoxCallback m_Callback;
|
private readonly BoundingBoxCallback m_Callback;
|
||||||
private bool m_First;
|
private readonly bool m_First;
|
||||||
private Map m_Map;
|
private readonly Map m_Map;
|
||||||
private Point3D m_Store;
|
private readonly Point3D m_Store;
|
||||||
|
|
||||||
public PickTarget(BoundingBoxCallback callback) : this(Point3D.Zero, true, null, callback)
|
public PickTarget(BoundingBoxCallback callback) : this(Point3D.Zero, true, null, callback)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ namespace Server.Commands
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static PropertyInfo[] _mobProps =
|
private static readonly PropertyInfo[] _mobProps =
|
||||||
typeof(Mobile).GetProperties(BindingFlags.Public | BindingFlags.Instance)
|
typeof(Mobile).GetProperties(BindingFlags.Public | BindingFlags.Instance)
|
||||||
.Where(prop => prop.CanRead && prop.CanWrite).ToArray();
|
.Where(prop => prop.CanRead && prop.CanWrite).ToArray();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
|
||||||
using Server.Engines.Quests.Haven;
|
using Server.Engines.Quests.Haven;
|
||||||
using Server.Engines.Quests.Necro;
|
using Server.Engines.Quests.Necro;
|
||||||
using Server.Items;
|
using Server.Items;
|
||||||
|
|
@ -12,7 +10,7 @@ using Server.Utilities;
|
||||||
|
|
||||||
namespace Server.Commands
|
namespace Server.Commands
|
||||||
{
|
{
|
||||||
public class Decorate
|
public static class Decorate
|
||||||
{
|
{
|
||||||
private static Mobile m_Mobile;
|
private static Mobile m_Mobile;
|
||||||
private static int m_Count;
|
private static int m_Count;
|
||||||
|
|
@ -60,22 +58,22 @@ namespace Server.Commands
|
||||||
|
|
||||||
public class DecorationList
|
public class DecorationList
|
||||||
{
|
{
|
||||||
private static Type typeofStatic = typeof(Static);
|
private static readonly Type typeofStatic = typeof(Static);
|
||||||
private static Type typeofLocalizedStatic = typeof(LocalizedStatic);
|
private static readonly Type typeofLocalizedStatic = typeof(LocalizedStatic);
|
||||||
private static Type typeofBaseDoor = typeof(BaseDoor);
|
private static readonly Type typeofBaseDoor = typeof(BaseDoor);
|
||||||
private static Type typeofAnkhWest = typeof(AnkhWest);
|
private static readonly Type typeofAnkhWest = typeof(AnkhWest);
|
||||||
private static Type typeofAnkhNorth = typeof(AnkhNorth);
|
private static readonly Type typeofAnkhNorth = typeof(AnkhNorth);
|
||||||
private static Type typeofBeverage = typeof(BaseBeverage);
|
private static readonly Type typeofBeverage = typeof(BaseBeverage);
|
||||||
private static Type typeofLocalizedSign = typeof(LocalizedSign);
|
private static readonly Type typeofLocalizedSign = typeof(LocalizedSign);
|
||||||
private static Type typeofMarkContainer = typeof(MarkContainer);
|
private static readonly Type typeofMarkContainer = typeof(MarkContainer);
|
||||||
private static Type typeofWarningItem = typeof(WarningItem);
|
private static readonly Type typeofWarningItem = typeof(WarningItem);
|
||||||
private static Type typeofHintItem = typeof(HintItem);
|
private static readonly Type typeofHintItem = typeof(HintItem);
|
||||||
private static Type typeofCannon = typeof(Cannon);
|
private static readonly Type typeofCannon = typeof(Cannon);
|
||||||
private static Type typeofSerpentPillar = typeof(SerpentPillar);
|
private static readonly Type typeofSerpentPillar = typeof(SerpentPillar);
|
||||||
|
|
||||||
private static Queue<Item> m_DeleteQueue = new Queue<Item>();
|
private static readonly Queue<Item> m_DeleteQueue = new Queue<Item>();
|
||||||
|
|
||||||
private static string[] m_EmptyParams = new string[0];
|
private static readonly string[] m_EmptyParams = Array.Empty<string>();
|
||||||
private List<DecorationEntry> m_Entries;
|
private List<DecorationEntry> m_Entries;
|
||||||
private int m_ItemID;
|
private int m_ItemID;
|
||||||
private string[] m_Params;
|
private string[] m_Params;
|
||||||
|
|
@ -934,14 +932,13 @@ namespace Server.Commands
|
||||||
|
|
||||||
for (int j = 0; j < maps.Length; ++j)
|
for (int j = 0; j < maps.Length; ++j)
|
||||||
{
|
{
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
item ??= Construct();
|
item ??= Construct();
|
||||||
}
|
}
|
||||||
catch(TypeInitializationException e)
|
catch (TypeInitializationException e)
|
||||||
{
|
{
|
||||||
Console.WriteLine($"{nameof(Generate)}() failed to load type: {e.TypeName}: {e.InnerException.Message}");
|
Console.WriteLine($"{nameof(Generate)}() failed to load type: {e.TypeName}: {e.InnerException?.Message}");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1083,11 +1080,11 @@ namespace Server.Commands
|
||||||
Extra = line;
|
Extra = line;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Point3D Location{ get; }
|
public Point3D Location { get; }
|
||||||
|
|
||||||
public string Extra{ get; }
|
public string Extra { get; }
|
||||||
|
|
||||||
public void Pop(out string v, ref string line)
|
public static void Pop(out string v, ref string line)
|
||||||
{
|
{
|
||||||
int space = line.IndexOf(' ');
|
int space = line.IndexOf(' ');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,6 @@ namespace Server.Commands
|
||||||
Generate("Data/Decoration/RuinedMaginciaTram", Map.Trammel);
|
Generate("Data/Decoration/RuinedMaginciaTram", Map.Trammel);
|
||||||
Generate("Data/Decoration/RuinedMaginciaFel", Map.Felucca);
|
Generate("Data/Decoration/RuinedMaginciaFel", Map.Felucca);
|
||||||
|
|
||||||
|
|
||||||
m_Mobile.SendMessage("World generating complete. {0} items were generated.", m_Count);
|
m_Mobile.SendMessage("World generating complete. {0} items were generated.", m_Count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -56,22 +55,22 @@ namespace Server.Commands
|
||||||
|
|
||||||
public class DecorationListMag
|
public class DecorationListMag
|
||||||
{
|
{
|
||||||
private static Type typeofStatic = typeof(Static);
|
private static readonly Type typeofStatic = typeof(Static);
|
||||||
private static Type typeofLocalizedStatic = typeof(LocalizedStatic);
|
private static readonly Type typeofLocalizedStatic = typeof(LocalizedStatic);
|
||||||
private static Type typeofBaseDoor = typeof(BaseDoor);
|
private static readonly Type typeofBaseDoor = typeof(BaseDoor);
|
||||||
private static Type typeofAnkhWest = typeof(AnkhWest);
|
private static readonly Type typeofAnkhWest = typeof(AnkhWest);
|
||||||
private static Type typeofAnkhNorth = typeof(AnkhNorth);
|
private static readonly Type typeofAnkhNorth = typeof(AnkhNorth);
|
||||||
private static Type typeofBeverage = typeof(BaseBeverage);
|
private static readonly Type typeofBeverage = typeof(BaseBeverage);
|
||||||
private static Type typeofLocalizedSign = typeof(LocalizedSign);
|
private static readonly Type typeofLocalizedSign = typeof(LocalizedSign);
|
||||||
private static Type typeofMarkContainer = typeof(MarkContainer);
|
private static readonly Type typeofMarkContainer = typeof(MarkContainer);
|
||||||
private static Type typeofWarningItem = typeof(WarningItem);
|
private static readonly Type typeofWarningItem = typeof(WarningItem);
|
||||||
private static Type typeofHintItem = typeof(HintItem);
|
private static readonly Type typeofHintItem = typeof(HintItem);
|
||||||
private static Type typeofCannon = typeof(Cannon);
|
private static readonly Type typeofCannon = typeof(Cannon);
|
||||||
private static Type typeofSerpentPillar = typeof(SerpentPillar);
|
private static readonly Type typeofSerpentPillar = typeof(SerpentPillar);
|
||||||
|
|
||||||
private static Queue m_DeleteQueue = new Queue();
|
private static readonly Queue m_DeleteQueue = new Queue();
|
||||||
|
|
||||||
private static string[] m_EmptyParams = new string[0];
|
private static readonly string[] m_EmptyParams = Array.Empty<string>();
|
||||||
private List<DecorationEntryMag> m_Entries;
|
private List<DecorationEntryMag> m_Entries;
|
||||||
private int m_ItemID;
|
private int m_ItemID;
|
||||||
private string[] m_Params;
|
private string[] m_Params;
|
||||||
|
|
@ -1070,9 +1069,9 @@ namespace Server.Commands
|
||||||
Extra = line;
|
Extra = line;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Point3D Location{ get; }
|
public Point3D Location { get; }
|
||||||
|
|
||||||
public string Extra{ get; }
|
public string Extra { get; }
|
||||||
|
|
||||||
public void Pop(out string v, ref string line)
|
public void Pop(out string v, ref string line)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -243,7 +243,7 @@ namespace Server.Commands
|
||||||
|
|
||||||
nameBuilder.Append(sanitizedName);
|
nameBuilder.Append(sanitizedName);
|
||||||
fnamBuilder.Append("T");
|
fnamBuilder.Append("T");
|
||||||
if (DontLink(typeArguments[i])) //if ( DontLink( typeArguments[i].Name ) )
|
if (DontLink(typeArguments[i]))
|
||||||
linkBuilder.Append($"<font color=\"blue\">{aliasedName}</font>");
|
linkBuilder.Append($"<font color=\"blue\">{aliasedName}</font>");
|
||||||
else
|
else
|
||||||
linkBuilder.Append(
|
linkBuilder.Append(
|
||||||
|
|
@ -270,7 +270,7 @@ namespace Server.Commands
|
||||||
else
|
else
|
||||||
linkName = link;
|
linkName = link;
|
||||||
|
|
||||||
//Console.WriteLine( typeName+":"+fileName+":"+linkName );
|
// Console.WriteLine( typeName+":"+fileName+":"+linkName );
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string SanitizeType(string name)
|
public static string SanitizeType(string name)
|
||||||
|
|
@ -312,7 +312,7 @@ namespace Server.Commands
|
||||||
public static bool DontLink( string name )
|
public static bool DontLink( string name )
|
||||||
{
|
{
|
||||||
foreach( string dontLink in m_DontLink )
|
foreach( string dontLink in m_DontLink )
|
||||||
if ( dontLink == name ) return true;
|
if (dontLink == name ) return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
@ -416,9 +416,13 @@ namespace Server.Commands
|
||||||
private class TypeInfo
|
private class TypeInfo
|
||||||
{
|
{
|
||||||
public List<TypeInfo> m_Derived, m_Nested;
|
public List<TypeInfo> m_Derived, m_Nested;
|
||||||
private string m_FileName, m_TypeName, m_LinkName;
|
private readonly string m_FileName;
|
||||||
public Type[] m_Interfaces;
|
private readonly string m_TypeName;
|
||||||
public Type m_Type, m_BaseType, m_Declaring;
|
private readonly string m_LinkName;
|
||||||
|
public readonly Type[] m_Interfaces;
|
||||||
|
public readonly Type m_Type;
|
||||||
|
public readonly Type m_BaseType;
|
||||||
|
public readonly Type m_Declaring;
|
||||||
|
|
||||||
public TypeInfo(Type type)
|
public TypeInfo(Type type)
|
||||||
{
|
{
|
||||||
|
|
@ -437,8 +441,6 @@ namespace Server.Commands
|
||||||
public string LinkName(string dirRoot) => m_LinkName.Replace("@directory@", dirRoot);
|
public string LinkName(string dirRoot) => m_LinkName.Replace("@directory@", dirRoot);
|
||||||
}
|
}
|
||||||
|
|
||||||
#region FileSystem
|
|
||||||
|
|
||||||
private static readonly char[] ReplaceChars = "<>".ToCharArray();
|
private static readonly char[] ReplaceChars = "<>".ToCharArray();
|
||||||
|
|
||||||
public static string GetFileName(string root, string name, string ext)
|
public static string GetFileName(string root, string name, string ext)
|
||||||
|
|
@ -460,7 +462,7 @@ namespace Server.Commands
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string m_RootDirectory = Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]);
|
private static readonly string m_RootDirectory = Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]);
|
||||||
|
|
||||||
private static void EnsureDirectory(string path)
|
private static void EnsureDirectory(string path)
|
||||||
{
|
{
|
||||||
|
|
@ -482,11 +484,7 @@ namespace Server.Commands
|
||||||
|
|
||||||
private static StreamWriter GetWriter(string path) => new StreamWriter(Path.Combine(m_RootDirectory, path));
|
private static StreamWriter GetWriter(string path) => new StreamWriter(Path.Combine(m_RootDirectory, path));
|
||||||
|
|
||||||
#endregion
|
private static readonly string[,] m_Aliases =
|
||||||
|
|
||||||
#region GetPair
|
|
||||||
|
|
||||||
private static string[,] m_Aliases =
|
|
||||||
{
|
{
|
||||||
{ "System.Object", "<font color=\"blue\">object</font>" },
|
{ "System.Object", "<font color=\"blue\">object</font>" },
|
||||||
{ "System.String", "<font color=\"blue\">string</font>" },
|
{ "System.String", "<font color=\"blue\">string</font>" },
|
||||||
|
|
@ -506,7 +504,7 @@ namespace Server.Commands
|
||||||
{ "System.Void", "<font color=\"blue\">void</font>" }
|
{ "System.Void", "<font color=\"blue\">void</font>" }
|
||||||
};
|
};
|
||||||
|
|
||||||
private static int m_AliasLength = m_Aliases.GetLength(0);
|
private static readonly int m_AliasLength = m_Aliases.GetLength(0);
|
||||||
|
|
||||||
public static string GetPair(Type varType, string name, bool ignoreRef)
|
public static string GetPair(Type varType, string name, bool ignoreRef)
|
||||||
{
|
{
|
||||||
|
|
@ -600,10 +598,6 @@ namespace Server.Commands
|
||||||
return string.Concat(prepend, aliased, append, name);
|
return string.Concat(prepend, aliased, append, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Root documentation
|
|
||||||
|
|
||||||
private static bool Document()
|
private static bool Document()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
@ -634,7 +628,6 @@ namespace Server.Commands
|
||||||
|
|
||||||
List<Assembly> assemblies = new List<Assembly> { Core.Assembly };
|
List<Assembly> assemblies = new List<Assembly> { Core.Assembly };
|
||||||
|
|
||||||
|
|
||||||
foreach (Assembly asm in AssemblyHandler.Assemblies)
|
foreach (Assembly asm in AssemblyHandler.Assemblies)
|
||||||
assemblies.Add(asm);
|
assemblies.Add(asm);
|
||||||
|
|
||||||
|
|
@ -713,10 +706,6 @@ namespace Server.Commands
|
||||||
html.WriteLine("</html>");
|
html.WriteLine("</html>");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region BODs
|
|
||||||
|
|
||||||
private const int Iron = 0xCCCCDD;
|
private const int Iron = 0xCCCCDD;
|
||||||
private const int DullCopper = 0xAAAAAA;
|
private const int DullCopper = 0xAAAAAA;
|
||||||
private const int ShadowIron = 0x777799;
|
private const int ShadowIron = 0x777799;
|
||||||
|
|
@ -763,7 +752,6 @@ namespace Server.Commands
|
||||||
html.WriteLine(" <br><br>");
|
html.WriteLine(" <br><br>");
|
||||||
html.WriteLine(" <br><br>");
|
html.WriteLine(" <br><br>");
|
||||||
|
|
||||||
|
|
||||||
sbod.Type = typeof(PlateArms);
|
sbod.Type = typeof(PlateArms);
|
||||||
|
|
||||||
WriteSmithBODHeader(html, "(Small) Armor: Normal");
|
WriteSmithBODHeader(html, "(Small) Armor: Normal");
|
||||||
|
|
@ -923,8 +911,6 @@ namespace Server.Commands
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Tailor Bods
|
|
||||||
|
|
||||||
private static void WriteTailorLBOD(StreamWriter html, string name, SmallBulkEntry[] entries, bool expandCloth,
|
private static void WriteTailorLBOD(StreamWriter html, string name, SmallBulkEntry[] entries, bool expandCloth,
|
||||||
bool expandPlain)
|
bool expandPlain)
|
||||||
{
|
{
|
||||||
|
|
@ -1281,10 +1267,6 @@ namespace Server.Commands
|
||||||
html.WriteLine(" </tr>");
|
html.WriteLine(" </tr>");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Smith Bods
|
|
||||||
|
|
||||||
private static void WriteSmithLBOD(StreamWriter html, string name, SmallBulkEntry[] entries)
|
private static void WriteSmithLBOD(StreamWriter html, string name, SmallBulkEntry[] entries)
|
||||||
{
|
{
|
||||||
LargeBOD lbod = new LargeSmithBOD();
|
LargeBOD lbod = new LargeSmithBOD();
|
||||||
|
|
@ -1564,12 +1546,6 @@ namespace Server.Commands
|
||||||
html.WriteLine(" </tr>");
|
html.WriteLine(" </tr>");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Bodies
|
|
||||||
|
|
||||||
public static List<BodyEntry> LoadBodies()
|
public static List<BodyEntry> LoadBodies()
|
||||||
{
|
{
|
||||||
List<BodyEntry> list = new List<BodyEntry>();
|
List<BodyEntry> list = new List<BodyEntry>();
|
||||||
|
|
@ -1689,10 +1665,6 @@ namespace Server.Commands
|
||||||
html.WriteLine("</html>");
|
html.WriteLine("</html>");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Speech
|
|
||||||
|
|
||||||
private static void DocumentKeywords()
|
private static void DocumentKeywords()
|
||||||
{
|
{
|
||||||
List<Dictionary<int, SpeechEntry>> tables = LoadSpeechFile();
|
List<Dictionary<int, SpeechEntry>> tables = LoadSpeechFile();
|
||||||
|
|
@ -1728,7 +1700,7 @@ namespace Server.Commands
|
||||||
|
|
||||||
html.Write(" <tr><td class=\"lentry\">0x{0:X4}</td><td class=\"rentry\">", entry.Index);
|
html.Write(" <tr><td class=\"lentry\">0x{0:X4}</td><td class=\"rentry\">", entry.Index);
|
||||||
|
|
||||||
entry.Strings.Sort(); //( new EnglishPrioStringSorter() );
|
entry.Strings.Sort(); // ( new EnglishPrioStringSorter() );
|
||||||
|
|
||||||
for (int j = 0; j < entry.Strings.Count; ++j)
|
for (int j = 0; j < entry.Strings.Count; ++j)
|
||||||
{
|
{
|
||||||
|
|
@ -1776,9 +1748,9 @@ namespace Server.Commands
|
||||||
Strings = new List<string>();
|
Strings = new List<string>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Index{ get; }
|
public int Index { get; }
|
||||||
|
|
||||||
public List<string> Strings{ get; }
|
public List<string> Strings { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
private class SpeechEntrySorter : IComparer<SpeechEntry>
|
private class SpeechEntrySorter : IComparer<SpeechEntry>
|
||||||
|
|
@ -1833,10 +1805,6 @@ namespace Server.Commands
|
||||||
return tables;
|
return tables;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Commands
|
|
||||||
|
|
||||||
public class DocCommandEntry
|
public class DocCommandEntry
|
||||||
{
|
{
|
||||||
public DocCommandEntry(AccessLevel accessLevel, string name, string[] aliases, string usage, string description)
|
public DocCommandEntry(AccessLevel accessLevel, string name, string[] aliases, string usage, string description)
|
||||||
|
|
@ -1848,15 +1816,15 @@ namespace Server.Commands
|
||||||
Description = description;
|
Description = description;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AccessLevel AccessLevel{ get; }
|
public AccessLevel AccessLevel { get; }
|
||||||
|
|
||||||
public string Name{ get; }
|
public string Name { get; }
|
||||||
|
|
||||||
public string[] Aliases{ get; }
|
public string[] Aliases { get; }
|
||||||
|
|
||||||
public string Usage{ get; }
|
public string Usage { get; }
|
||||||
|
|
||||||
public string Description{ get; }
|
public string Description { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CommandEntrySorter : IComparer<DocCommandEntry>
|
public class CommandEntrySorter : IComparer<DocCommandEntry>
|
||||||
|
|
@ -2112,12 +2080,10 @@ namespace Server.Commands
|
||||||
html.WriteLine("</tr>");
|
html.WriteLine("</tr>");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
private static readonly Type typeofItem = typeof(Item);
|
||||||
|
private static readonly Type typeofMobile = typeof(Mobile);
|
||||||
#region Constructible Objects
|
private static readonly Type typeofMap = typeof(Map);
|
||||||
|
private static readonly Type typeofCustomEnum = typeof(CustomEnumAttribute);
|
||||||
private static Type typeofItem = typeof(Item), typeofMobile = typeof(Mobile), typeofMap = typeof(Map);
|
|
||||||
private static Type typeofCustomEnum = typeof(CustomEnumAttribute);
|
|
||||||
|
|
||||||
private static bool IsConstructible(Type t, out bool isItem) => (isItem = typeofItem.IsAssignableFrom(t)) || typeofMobile.IsAssignableFrom(t);
|
private static bool IsConstructible(Type t, out bool isItem) => (isItem = typeofItem.IsAssignableFrom(t)) || typeofMobile.IsAssignableFrom(t);
|
||||||
|
|
||||||
|
|
@ -2226,13 +2192,9 @@ namespace Server.Commands
|
||||||
html.WriteLine("</td></tr>");
|
html.WriteLine("</td></tr>");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Tooltips
|
|
||||||
|
|
||||||
private const string HtmlNewLine = " ";
|
private const string HtmlNewLine = " ";
|
||||||
|
|
||||||
private static object[,] m_Tooltips =
|
private static readonly object[,] m_Tooltips =
|
||||||
{
|
{
|
||||||
{ typeof(byte), "Numeric value in the range from 0 to 255, inclusive." },
|
{ typeof(byte), "Numeric value in the range from 0 to 255, inclusive." },
|
||||||
{ typeof(sbyte), "Numeric value in the range from negative 128 to positive 127, inclusive." },
|
{ typeof(sbyte), "Numeric value in the range from negative 128 to positive 127, inclusive." },
|
||||||
|
|
@ -2319,10 +2281,6 @@ namespace Server.Commands
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Const Strings
|
|
||||||
|
|
||||||
private const string RefString = "<font color=\"blue\">ref</font> ";
|
private const string RefString = "<font color=\"blue\">ref</font> ";
|
||||||
private const string GetString = " <font color=\"blue\">get</font>;";
|
private const string GetString = " <font color=\"blue\">get</font>;";
|
||||||
private const string SetString = " <font color=\"blue\">set</font>;";
|
private const string SetString = " <font color=\"blue\">set</font>;";
|
||||||
|
|
@ -2334,10 +2292,6 @@ namespace Server.Commands
|
||||||
private const string CtorString = "(<font color=\"blue\">ctor</font>) ";
|
private const string CtorString = "(<font color=\"blue\">ctor</font>) ";
|
||||||
private const string StaticString = "(<font color=\"blue\">static</font>) ";
|
private const string StaticString = "(<font color=\"blue\">static</font>) ";
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Write[...]
|
|
||||||
|
|
||||||
private static void WriteEnum(TypeInfo info, StreamWriter typeHtml)
|
private static void WriteEnum(TypeInfo info, StreamWriter typeHtml)
|
||||||
{
|
{
|
||||||
Type type = info.m_Type;
|
Type type = info.m_Type;
|
||||||
|
|
@ -2381,7 +2335,7 @@ namespace Server.Commands
|
||||||
if (decInfo == null)
|
if (decInfo == null)
|
||||||
typeHtml.Write(decType.Name);
|
typeHtml.Write(decType.Name);
|
||||||
else
|
else
|
||||||
//typeHtml.Write( "<a href=\"{0}\">{1}</a>", decInfo.m_FileName, decInfo.m_TypeName );
|
// typeHtml.Write( "<a href=\"{0}\">{1}</a>", decInfo.m_FileName, decInfo.m_TypeName );
|
||||||
typeHtml.Write(decInfo.LinkName(null));
|
typeHtml.Write(decInfo.LinkName(null));
|
||||||
|
|
||||||
typeHtml.Write(") - ");
|
typeHtml.Write(") - ");
|
||||||
|
|
@ -2452,7 +2406,7 @@ namespace Server.Commands
|
||||||
if (i != 0)
|
if (i != 0)
|
||||||
typeHtml.Write(", ");
|
typeHtml.Write(", ");
|
||||||
|
|
||||||
//typeHtml.Write( "<a href=\"{0}\">{1}</a>", derivedInfo.m_FileName, derivedInfo.m_TypeName );
|
// typeHtml.Write( "<a href=\"{0}\">{1}</a>", derivedInfo.m_FileName, derivedInfo.m_TypeName );
|
||||||
typeHtml.Write($"<!-- DBG-3 -->{derivedInfo.LinkName(null)}");
|
typeHtml.Write($"<!-- DBG-3 -->{derivedInfo.LinkName(null)}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2474,7 +2428,7 @@ namespace Server.Commands
|
||||||
if (i != 0)
|
if (i != 0)
|
||||||
typeHtml.Write(", ");
|
typeHtml.Write(", ");
|
||||||
|
|
||||||
//typeHtml.Write( "<a href=\"{0}\">{1}</a>", nestedInfo.m_FileName, nestedInfo.m_TypeName );
|
// typeHtml.Write( "<a href=\"{0}\">{1}</a>", nestedInfo.m_FileName, nestedInfo.m_TypeName );
|
||||||
typeHtml.Write($"<!-- DBG-4 -->{nestedInfo.LinkName(null)}");
|
typeHtml.Write($"<!-- DBG-4 -->{nestedInfo.LinkName(null)}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2600,12 +2554,8 @@ namespace Server.Commands
|
||||||
|
|
||||||
html.WriteLine(")<br>");
|
html.WriteLine(")<br>");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region BodyEntry & BodyType
|
|
||||||
|
|
||||||
public enum ModelBodyType
|
public enum ModelBodyType
|
||||||
{
|
{
|
||||||
Invalid = -1,
|
Invalid = -1,
|
||||||
|
|
@ -2625,11 +2575,11 @@ namespace Server.Commands
|
||||||
Name = name;
|
Name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Body Body{ get; }
|
public Body Body { get; }
|
||||||
|
|
||||||
public ModelBodyType BodyType{ get; }
|
public ModelBodyType BodyType { get; }
|
||||||
|
|
||||||
public string Name{ get; }
|
public string Name { get; }
|
||||||
|
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
|
|
@ -2657,6 +2607,4 @@ namespace Server.Commands
|
||||||
return a?.Name.CompareTo(b?.Name) ?? 1;
|
return a?.Name.CompareTo(b?.Name) ?? 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
|
using System;
|
||||||
|
using System.Reflection;
|
||||||
using Server.Items;
|
using Server.Items;
|
||||||
using Server.Targeting;
|
using Server.Targeting;
|
||||||
using Server.Utilities;
|
using Server.Utilities;
|
||||||
using System;
|
|
||||||
using System.Reflection;
|
|
||||||
|
|
||||||
namespace Server.Commands
|
namespace Server.Commands
|
||||||
{
|
{
|
||||||
|
|
@ -48,14 +48,14 @@ namespace Server.Commands
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
//Console.WriteLine( "Denied" );
|
// Console.WriteLine( "Denied" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class DupeTarget : Target
|
private class DupeTarget : Target
|
||||||
{
|
{
|
||||||
private int m_Amount;
|
private readonly int m_Amount;
|
||||||
private bool m_InBag;
|
private readonly bool m_InBag;
|
||||||
|
|
||||||
public DupeTarget(bool inbag, int amount)
|
public DupeTarget(bool inbag, int amount)
|
||||||
: base(15, false, TargetFlags.None)
|
: base(15, false, TargetFlags.None)
|
||||||
|
|
@ -103,7 +103,7 @@ namespace Server.Commands
|
||||||
for (int i = 0; i < m_Amount; i++)
|
for (int i = 0; i < m_Amount; i++)
|
||||||
if (c.Invoke(args) is Item newItem)
|
if (c.Invoke(args) is Item newItem)
|
||||||
{
|
{
|
||||||
CopyProperties(newItem, copy); //copy.Dupe( item, copy.Amount );
|
CopyProperties(newItem, copy); // copy.Dupe( item, copy.Amount );
|
||||||
copy.OnAfterDuped(newItem);
|
copy.OnAfterDuped(newItem);
|
||||||
newItem.Parent = null;
|
newItem.Parent = null;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,9 @@ namespace Server.Commands
|
||||||
{
|
{
|
||||||
private static CategoryEntry m_RootItems, m_RootMobiles;
|
private static CategoryEntry m_RootItems, m_RootMobiles;
|
||||||
|
|
||||||
private static Type typeofItem = typeof(Item);
|
private static readonly Type typeofItem = typeof(Item);
|
||||||
private static Type typeofMobile = typeof(Mobile);
|
private static readonly Type typeofMobile = typeof(Mobile);
|
||||||
private static Type typeofConstructible = typeof(ConstructibleAttribute);
|
private static readonly Type typeofConstructible = typeof(ConstructibleAttribute);
|
||||||
|
|
||||||
public static CategoryEntry Items
|
public static CategoryEntry Items
|
||||||
{
|
{
|
||||||
|
|
@ -275,9 +275,9 @@ namespace Server.Commands
|
||||||
Object = ActivatorUtil.CreateInstance(type);
|
Object = ActivatorUtil.CreateInstance(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Type Type{ get; }
|
public Type Type { get; }
|
||||||
|
|
||||||
public object Object{ get; }
|
public object Object { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CategoryEntry
|
public class CategoryEntry
|
||||||
|
|
@ -286,8 +286,8 @@ namespace Server.Commands
|
||||||
{
|
{
|
||||||
Parent = parent;
|
Parent = parent;
|
||||||
Title = title;
|
Title = title;
|
||||||
SubCategories = subCats ?? new CategoryEntry[0];
|
SubCategories = subCats ?? Array.Empty<CategoryEntry>();
|
||||||
Matches = new Type[0];
|
Matches = Array.Empty<Type>();
|
||||||
Matched = new List<CategoryTypeEntry>();
|
Matched = new List<CategoryTypeEntry>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -342,15 +342,15 @@ namespace Server.Commands
|
||||||
Matched = new List<CategoryTypeEntry>();
|
Matched = new List<CategoryTypeEntry>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Title{ get; }
|
public string Title { get; }
|
||||||
|
|
||||||
public Type[] Matches{ get; }
|
public Type[] Matches { get; }
|
||||||
|
|
||||||
public CategoryEntry Parent{ get; }
|
public CategoryEntry Parent { get; }
|
||||||
|
|
||||||
public CategoryEntry[] SubCategories{ get; }
|
public CategoryEntry[] SubCategories { get; }
|
||||||
|
|
||||||
public List<CategoryTypeEntry> Matched{ get; }
|
public List<CategoryTypeEntry> Matched { get; }
|
||||||
|
|
||||||
public bool IsMatch(Type type)
|
public bool IsMatch(Type type)
|
||||||
{
|
{
|
||||||
|
|
@ -380,9 +380,9 @@ namespace Server.Commands
|
||||||
Text = input.Substring(index);
|
Text = input.Substring(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Indentation{ get; }
|
public int Indentation { get; }
|
||||||
|
|
||||||
public string Text{ get; }
|
public string Text { get; }
|
||||||
|
|
||||||
public static CategoryLine[] Load(string path)
|
public static CategoryLine[] Load(string path)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
using Server.Items;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
using Server.Items;
|
||||||
using Server.Json;
|
using Server.Json;
|
||||||
|
|
||||||
namespace Server.Commands
|
namespace Server.Commands
|
||||||
|
|
@ -122,7 +122,7 @@ namespace Server.Commands
|
||||||
public int Count { get; private set; }
|
public int Count { get; private set; }
|
||||||
public int DelCount { get; private set; }
|
public int DelCount { get; private set; }
|
||||||
|
|
||||||
private static bool IsWithinZ(int delta) => -12 <= delta && delta <= 12;
|
private static bool IsWithinZ(int delta) => delta >= -12 && delta <= 12;
|
||||||
|
|
||||||
public static int DeleteTeleporters(Location location)
|
public static int DeleteTeleporters(Location location)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -12,22 +12,22 @@ namespace Server.Commands.Generic
|
||||||
|
|
||||||
public abstract class BaseCommand
|
public abstract class BaseCommand
|
||||||
{
|
{
|
||||||
private List<MessageEntry> m_Responses = new List<MessageEntry>();
|
private readonly List<MessageEntry> m_Responses = new List<MessageEntry>();
|
||||||
private List<MessageEntry> m_Failures = new List<MessageEntry>();
|
private readonly List<MessageEntry> m_Failures = new List<MessageEntry>();
|
||||||
|
|
||||||
public bool ListOptimized{ get; set; }
|
public bool ListOptimized { get; set; }
|
||||||
|
|
||||||
public string[] Commands{ get; set; }
|
public string[] Commands { get; set; }
|
||||||
|
|
||||||
public string Usage{ get; set; }
|
public string Usage { get; set; }
|
||||||
|
|
||||||
public string Description{ get; set; }
|
public string Description { get; set; }
|
||||||
|
|
||||||
public AccessLevel AccessLevel{ get; set; }
|
public AccessLevel AccessLevel { get; set; }
|
||||||
|
|
||||||
public ObjectTypes ObjectTypes{ get; set; }
|
public ObjectTypes ObjectTypes { get; set; }
|
||||||
|
|
||||||
public CommandSupport Supports{ get; set; }
|
public CommandSupport Supports { get; set; }
|
||||||
|
|
||||||
public static bool IsAccessible(Mobile from, object obj)
|
public static bool IsAccessible(Mobile from, object obj)
|
||||||
{
|
{
|
||||||
|
|
@ -117,7 +117,7 @@ namespace Server.Commands.Generic
|
||||||
private class MessageEntry
|
private class MessageEntry
|
||||||
{
|
{
|
||||||
public int m_Count;
|
public int m_Count;
|
||||||
public string m_Message;
|
public readonly string m_Message;
|
||||||
|
|
||||||
public MessageEntry(string message)
|
public MessageEntry(string message)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ namespace Server.Commands.Generic
|
||||||
{
|
{
|
||||||
public class TargetCommands
|
public class TargetCommands
|
||||||
{
|
{
|
||||||
public static List<BaseCommand> AllCommands{ get; } = new List<BaseCommand>();
|
public static List<BaseCommand> AllCommands { get; } = new List<BaseCommand>();
|
||||||
|
|
||||||
public static void Initialize()
|
public static void Initialize()
|
||||||
{
|
{
|
||||||
|
|
@ -348,7 +348,7 @@ namespace Server.Commands.Generic
|
||||||
|
|
||||||
public class TellCommand : BaseCommand
|
public class TellCommand : BaseCommand
|
||||||
{
|
{
|
||||||
private bool m_InGump;
|
private readonly bool m_InGump;
|
||||||
|
|
||||||
public TellCommand(bool inGump)
|
public TellCommand(bool inGump)
|
||||||
{
|
{
|
||||||
|
|
@ -511,7 +511,7 @@ namespace Server.Commands.Generic
|
||||||
|
|
||||||
SpellHelper.GetSurfaceTop(ref p);
|
SpellHelper.GetSurfaceTop(ref p);
|
||||||
|
|
||||||
//CommandLogging.WriteLine( from, "{0} {1} teleporting to {2}", from.AccessLevel, CommandLogging.Format( from ), new Point3D( p ) );
|
// CommandLogging.WriteLine( from, "{0} {1} teleporting to {2}", from.AccessLevel, CommandLogging.Format( from ), new Point3D( p ) );
|
||||||
|
|
||||||
Point3D fromLoc = from.Location;
|
Point3D fromLoc = from.Location;
|
||||||
Point3D toLoc = new Point3D(p);
|
Point3D toLoc = new Point3D(p);
|
||||||
|
|
@ -683,8 +683,8 @@ namespace Server.Commands.Generic
|
||||||
|
|
||||||
public class AliasedSetCommand : BaseCommand
|
public class AliasedSetCommand : BaseCommand
|
||||||
{
|
{
|
||||||
private string m_Name;
|
private readonly string m_Name;
|
||||||
private string m_Value;
|
private readonly string m_Value;
|
||||||
|
|
||||||
public AliasedSetCommand(AccessLevel level, string command, string name, string value, ObjectTypes objects)
|
public AliasedSetCommand(AccessLevel level, string command, string name, string value, ObjectTypes objects)
|
||||||
{
|
{
|
||||||
|
|
@ -830,7 +830,7 @@ namespace Server.Commands.Generic
|
||||||
|
|
||||||
public class KillCommand : BaseCommand
|
public class KillCommand : BaseCommand
|
||||||
{
|
{
|
||||||
private bool m_Value;
|
private readonly bool m_Value;
|
||||||
|
|
||||||
public KillCommand(bool value)
|
public KillCommand(bool value)
|
||||||
{
|
{
|
||||||
|
|
@ -916,7 +916,7 @@ namespace Server.Commands.Generic
|
||||||
|
|
||||||
public class HideCommand : BaseCommand
|
public class HideCommand : BaseCommand
|
||||||
{
|
{
|
||||||
private bool m_Value;
|
private readonly bool m_Value;
|
||||||
|
|
||||||
public HideCommand(bool value)
|
public HideCommand(bool value)
|
||||||
{
|
{
|
||||||
|
|
@ -1011,7 +1011,7 @@ namespace Server.Commands.Generic
|
||||||
|
|
||||||
public class KickCommand : BaseCommand
|
public class KickCommand : BaseCommand
|
||||||
{
|
{
|
||||||
private bool m_Ban;
|
private readonly bool m_Ban;
|
||||||
|
|
||||||
public KickCommand(bool ban)
|
public KickCommand(bool ban)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ namespace Server.Commands.Generic
|
||||||
{
|
{
|
||||||
house = null;
|
house = null;
|
||||||
|
|
||||||
if (item == null || item is BaseMulti || item is HouseSign || staticsOnly && !(item is Static))
|
if (item == null || item is BaseMulti || item is HouseSign || (staticsOnly && !(item is Static)))
|
||||||
return DesignInsertResult.InvalidItem;
|
return DesignInsertResult.InvalidItem;
|
||||||
|
|
||||||
house = BaseHouse.FindHouseAt(item) as HouseFoundation;
|
house = BaseHouse.FindHouseAt(item) as HouseFoundation;
|
||||||
|
|
@ -69,8 +69,6 @@ namespace Server.Commands.Generic
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Single targeting mode
|
|
||||||
|
|
||||||
public override void Execute(CommandEventArgs e, object obj)
|
public override void Execute(CommandEventArgs e, object obj)
|
||||||
{
|
{
|
||||||
Target t = new DesignInsertTarget(new List<HouseFoundation>(), e.Length < 1 || !e.GetBoolean(0));
|
Target t = new DesignInsertTarget(new List<HouseFoundation>(), e.Length < 1 || !e.GetBoolean(0));
|
||||||
|
|
@ -79,8 +77,8 @@ namespace Server.Commands.Generic
|
||||||
|
|
||||||
private class DesignInsertTarget : Target
|
private class DesignInsertTarget : Target
|
||||||
{
|
{
|
||||||
private List<HouseFoundation> m_Foundations;
|
private readonly List<HouseFoundation> m_Foundations;
|
||||||
private bool m_StaticsOnly;
|
private readonly bool m_StaticsOnly;
|
||||||
|
|
||||||
public DesignInsertTarget(List<HouseFoundation> foundations, bool staticsOnly)
|
public DesignInsertTarget(List<HouseFoundation> foundations, bool staticsOnly)
|
||||||
: base(-1, false, TargetFlags.None)
|
: base(-1, false, TargetFlags.None)
|
||||||
|
|
@ -136,10 +134,6 @@ namespace Server.Commands.Generic
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Area targeting mode
|
|
||||||
|
|
||||||
public override void ExecuteList(CommandEventArgs e, List<object> list)
|
public override void ExecuteList(CommandEventArgs e, List<object> list)
|
||||||
{
|
{
|
||||||
Mobile from = e.Mobile;
|
Mobile from = e.Mobile;
|
||||||
|
|
@ -197,7 +191,5 @@ namespace Server.Commands.Generic
|
||||||
|
|
||||||
Flush(from, flushToLog);
|
Flush(from, flushToLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -25,7 +25,6 @@ namespace Server.Commands.Generic
|
||||||
{
|
{
|
||||||
List<string> columns = new List<string> { "Object" };
|
List<string> columns = new List<string> { "Object" };
|
||||||
|
|
||||||
|
|
||||||
if (e.Length > 0)
|
if (e.Length > 0)
|
||||||
{
|
{
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
|
|
@ -50,13 +49,13 @@ namespace Server.Commands.Generic
|
||||||
{
|
{
|
||||||
private const int EntriesPerPage = 15;
|
private const int EntriesPerPage = 15;
|
||||||
|
|
||||||
private string[] m_Columns;
|
private readonly string[] m_Columns;
|
||||||
private Mobile m_From;
|
private readonly Mobile m_From;
|
||||||
|
|
||||||
private List<object> m_List;
|
private readonly List<object> m_List;
|
||||||
private int m_Page;
|
private readonly int m_Page;
|
||||||
|
|
||||||
private object m_Select;
|
private readonly object m_Select;
|
||||||
|
|
||||||
public InterfaceGump(Mobile from, string[] columns, List<object> list, int page, object select) : base(30, 30)
|
public InterfaceGump(Mobile from, string[] columns, List<object> list, int page, object select) : base(30, 30)
|
||||||
{
|
{
|
||||||
|
|
@ -241,13 +240,13 @@ namespace Server.Commands.Generic
|
||||||
|
|
||||||
public class InterfaceItemGump : BaseGridGump
|
public class InterfaceItemGump : BaseGridGump
|
||||||
{
|
{
|
||||||
private string[] m_Columns;
|
private readonly string[] m_Columns;
|
||||||
private Mobile m_From;
|
private readonly Mobile m_From;
|
||||||
|
|
||||||
private Item m_Item;
|
private readonly Item m_Item;
|
||||||
|
|
||||||
private List<object> m_List;
|
private readonly List<object> m_List;
|
||||||
private int m_Page;
|
private readonly int m_Page;
|
||||||
|
|
||||||
public InterfaceItemGump(Mobile from, string[] columns, List<object> list, int page, Item item) : base(30, 30)
|
public InterfaceItemGump(Mobile from, string[] columns, List<object> list, int page, Item item) : base(30, 30)
|
||||||
{
|
{
|
||||||
|
|
@ -376,13 +375,13 @@ namespace Server.Commands.Generic
|
||||||
|
|
||||||
public class InterfaceMobileGump : BaseGridGump
|
public class InterfaceMobileGump : BaseGridGump
|
||||||
{
|
{
|
||||||
private string[] m_Columns;
|
private readonly string[] m_Columns;
|
||||||
private Mobile m_From;
|
private readonly Mobile m_From;
|
||||||
|
|
||||||
private List<object> m_List;
|
private readonly List<object> m_List;
|
||||||
|
|
||||||
private Mobile m_Mobile;
|
private readonly Mobile m_Mobile;
|
||||||
private int m_Page;
|
private readonly int m_Page;
|
||||||
|
|
||||||
public InterfaceMobileGump(Mobile from, string[] columns, List<object> list, int page, Mobile mob)
|
public InterfaceMobileGump(Mobile from, string[] columns, List<object> list, int page, Mobile mob)
|
||||||
: base(30, 30)
|
: base(30, 30)
|
||||||
|
|
|
||||||
|
|
@ -17,18 +17,18 @@ namespace Server.Commands.Generic
|
||||||
Constructor = constructor;
|
Constructor = constructor;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Dictionary<string, ExtensionInfo> Table{ get; } =
|
public static Dictionary<string, ExtensionInfo> Table { get; } =
|
||||||
new Dictionary<string, ExtensionInfo>(StringComparer.InvariantCultureIgnoreCase);
|
new Dictionary<string, ExtensionInfo>(StringComparer.InvariantCultureIgnoreCase);
|
||||||
|
|
||||||
public int Order{ get; }
|
public int Order { get; }
|
||||||
|
|
||||||
public string Name{ get; }
|
public string Name { get; }
|
||||||
|
|
||||||
public int Size{ get; }
|
public int Size { get; }
|
||||||
|
|
||||||
public bool IsFixedSize => Size >= 0;
|
public bool IsFixedSize => Size >= 0;
|
||||||
|
|
||||||
public ExtensionConstructor Constructor{ get; }
|
public ExtensionConstructor Constructor { get; }
|
||||||
|
|
||||||
public static void Register(ExtensionInfo ext)
|
public static void Register(ExtensionInfo ext)
|
||||||
{
|
{
|
||||||
|
|
@ -103,7 +103,7 @@ namespace Server.Commands.Generic
|
||||||
|
|
||||||
public abstract class BaseExtension
|
public abstract class BaseExtension
|
||||||
{
|
{
|
||||||
public abstract ExtensionInfo Info{ get; }
|
public abstract ExtensionInfo Info { get; }
|
||||||
|
|
||||||
public string Name => Info.Name;
|
public string Name => Info.Name;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
using Server.Utilities;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Reflection.Emit;
|
using System.Reflection.Emit;
|
||||||
|
using Server.Utilities;
|
||||||
|
|
||||||
namespace Server.Commands.Generic
|
namespace Server.Commands.Generic
|
||||||
{
|
{
|
||||||
|
|
@ -47,11 +47,11 @@ namespace Server.Commands.Generic
|
||||||
Value = value;
|
Value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Type Type{ get; }
|
public Type Type { get; }
|
||||||
|
|
||||||
public object Value{ get; private set; }
|
public object Value { get; private set; }
|
||||||
|
|
||||||
public FieldInfo Field{ get; private set; }
|
public FieldInfo Field { get; private set; }
|
||||||
|
|
||||||
public bool HasField => Field != null;
|
public bool HasField => Field != null;
|
||||||
|
|
||||||
|
|
@ -119,8 +119,7 @@ namespace Server.Commands.Generic
|
||||||
BindingFlags.Public | BindingFlags.Static,
|
BindingFlags.Public | BindingFlags.Static,
|
||||||
null,
|
null,
|
||||||
new[] { typeof(string), typeof(NumberStyles) },
|
new[] { typeof(string), typeof(NumberStyles) },
|
||||||
null
|
null);
|
||||||
);
|
|
||||||
|
|
||||||
if (parseNumber != null)
|
if (parseNumber != null)
|
||||||
{
|
{
|
||||||
|
|
@ -142,8 +141,7 @@ namespace Server.Commands.Generic
|
||||||
BindingFlags.Public | BindingFlags.Static,
|
BindingFlags.Public | BindingFlags.Static,
|
||||||
null,
|
null,
|
||||||
new[] { typeof(string) },
|
new[] { typeof(string) },
|
||||||
null
|
null);
|
||||||
);
|
|
||||||
|
|
||||||
parseMethod = parseGeneral;
|
parseMethod = parseGeneral;
|
||||||
parseArgs = new object[] { toParse };
|
parseArgs = new object[] { toParse };
|
||||||
|
|
@ -158,13 +156,11 @@ namespace Server.Commands.Generic
|
||||||
Field = typeBuilder.DefineField(
|
Field = typeBuilder.DefineField(
|
||||||
fieldName,
|
fieldName,
|
||||||
Type,
|
Type,
|
||||||
FieldAttributes.Private | FieldAttributes.InitOnly
|
FieldAttributes.Private | FieldAttributes.InitOnly);
|
||||||
);
|
|
||||||
|
|
||||||
// parseMethod.Invoke(null,
|
// parseMethod.Invoke(null,
|
||||||
// parseArgs.Length == 2 ? new object[] {toParse, (int) parseArgs[1]} : new object[] {toParse});
|
// parseArgs.Length == 2 ? new object[] {toParse, (int) parseArgs[1]} : new object[] {toParse});
|
||||||
|
|
||||||
|
|
||||||
il.Emit(OpCodes.Ldarg_0);
|
il.Emit(OpCodes.Ldarg_0);
|
||||||
|
|
||||||
il.Emit(OpCodes.Ldstr, toParse);
|
il.Emit(OpCodes.Ldstr, toParse);
|
||||||
|
|
@ -179,8 +175,7 @@ namespace Server.Commands.Generic
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw new InvalidOperationException(
|
throw new InvalidOperationException(
|
||||||
$"Unable to convert string \"{Value}\" into type '{Type}'."
|
$"Unable to convert string \"{Value}\" into type '{Type}'.");
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -215,9 +210,9 @@ namespace Server.Commands.Generic
|
||||||
|
|
||||||
public sealed class StringCondition : PropertyCondition
|
public sealed class StringCondition : PropertyCondition
|
||||||
{
|
{
|
||||||
private bool m_IgnoreCase;
|
private readonly bool m_IgnoreCase;
|
||||||
private StringOperator m_Operator;
|
private readonly StringOperator m_Operator;
|
||||||
private PropertyValue m_Value;
|
private readonly PropertyValue m_Value;
|
||||||
|
|
||||||
public StringCondition(Property property, bool not, StringOperator op, object value, bool ignoreCase)
|
public StringCondition(Property property, bool not, StringOperator op, object value, bool ignoreCase)
|
||||||
: base(property, not)
|
: base(property, not)
|
||||||
|
|
@ -280,9 +275,7 @@ namespace Server.Commands.Generic
|
||||||
typeof(string),
|
typeof(string),
|
||||||
typeof(string)
|
typeof(string)
|
||||||
},
|
},
|
||||||
null
|
null));
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
emitter.Chain(m_Property);
|
emitter.Chain(m_Property);
|
||||||
m_Value.Load(emitter);
|
m_Value.Load(emitter);
|
||||||
|
|
@ -319,9 +312,7 @@ namespace Server.Commands.Generic
|
||||||
{
|
{
|
||||||
typeof(string)
|
typeof(string)
|
||||||
},
|
},
|
||||||
null
|
null));
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
m_Value.Load(emitter);
|
m_Value.Load(emitter);
|
||||||
|
|
||||||
|
|
@ -347,8 +338,8 @@ namespace Server.Commands.Generic
|
||||||
|
|
||||||
public sealed class ComparisonCondition : PropertyCondition
|
public sealed class ComparisonCondition : PropertyCondition
|
||||||
{
|
{
|
||||||
private ComparisonOperator m_Operator;
|
private readonly ComparisonOperator m_Operator;
|
||||||
private PropertyValue m_Value;
|
private readonly PropertyValue m_Value;
|
||||||
|
|
||||||
public ComparisonCondition(Property property, bool not, ComparisonOperator op, object value)
|
public ComparisonCondition(Property property, bool not, ComparisonOperator op, object value)
|
||||||
: base(property, not)
|
: base(property, not)
|
||||||
|
|
@ -369,7 +360,7 @@ namespace Server.Commands.Generic
|
||||||
bool inverse = false;
|
bool inverse = false;
|
||||||
|
|
||||||
bool couldCompare =
|
bool couldCompare =
|
||||||
emitter.CompareTo(1, delegate { m_Value.Load(emitter); });
|
emitter.CompareTo(1, () => { m_Value.Load(emitter); });
|
||||||
|
|
||||||
if (couldCompare)
|
if (couldCompare)
|
||||||
{
|
{
|
||||||
|
|
@ -449,17 +440,12 @@ namespace Server.Commands.Generic
|
||||||
TypeBuilder typeBuilder = assembly.DefineType(
|
TypeBuilder typeBuilder = assembly.DefineType(
|
||||||
$"__conditional{index}",
|
$"__conditional{index}",
|
||||||
TypeAttributes.Public,
|
TypeAttributes.Public,
|
||||||
typeof(object)
|
typeof(object));
|
||||||
);
|
|
||||||
|
|
||||||
#region Constructor
|
|
||||||
|
|
||||||
{
|
{
|
||||||
ConstructorBuilder ctor = typeBuilder.DefineConstructor(
|
ConstructorBuilder ctor = typeBuilder.DefineConstructor(
|
||||||
MethodAttributes.Public,
|
MethodAttributes.Public,
|
||||||
CallingConventions.Standard,
|
CallingConventions.Standard,
|
||||||
Type.EmptyTypes
|
Type.EmptyTypes);
|
||||||
);
|
|
||||||
|
|
||||||
ILGenerator il = ctor.GetILGenerator();
|
ILGenerator il = ctor.GetILGenerator();
|
||||||
|
|
||||||
|
|
@ -474,16 +460,9 @@ namespace Server.Commands.Generic
|
||||||
il.Emit(OpCodes.Ret);
|
il.Emit(OpCodes.Ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region IComparer
|
|
||||||
|
|
||||||
typeBuilder.AddInterfaceImplementation(typeof(IConditional));
|
typeBuilder.AddInterfaceImplementation(typeof(IConditional));
|
||||||
|
|
||||||
MethodBuilder compareMethod;
|
MethodBuilder compareMethod;
|
||||||
|
|
||||||
#region Compare
|
|
||||||
|
|
||||||
{
|
{
|
||||||
MethodEmitter emitter = new MethodEmitter(typeBuilder);
|
MethodEmitter emitter = new MethodEmitter(typeBuilder);
|
||||||
|
|
||||||
|
|
@ -531,17 +510,11 @@ namespace Server.Commands.Generic
|
||||||
new[]
|
new[]
|
||||||
{
|
{
|
||||||
typeof(object)
|
typeof(object)
|
||||||
}
|
}));
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
compareMethod = emitter.Method;
|
compareMethod = emitter.Method;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
Type conditionalType = typeBuilder.CreateType();
|
Type conditionalType = typeBuilder.CreateType();
|
||||||
|
|
||||||
return (IConditional)ActivatorUtil.CreateInstance(conditionalType);
|
return (IConditional)ActivatorUtil.CreateInstance(conditionalType);
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
using Server.Utilities;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Reflection.Emit;
|
using System.Reflection.Emit;
|
||||||
|
using Server.Utilities;
|
||||||
|
|
||||||
namespace Server.Commands.Generic
|
namespace Server.Commands.Generic
|
||||||
{
|
{
|
||||||
|
|
@ -13,17 +13,12 @@ namespace Server.Commands.Generic
|
||||||
TypeBuilder typeBuilder = assembly.DefineType(
|
TypeBuilder typeBuilder = assembly.DefineType(
|
||||||
"__distinct",
|
"__distinct",
|
||||||
TypeAttributes.Public,
|
TypeAttributes.Public,
|
||||||
typeof(object)
|
typeof(object));
|
||||||
);
|
|
||||||
|
|
||||||
#region Constructor
|
|
||||||
|
|
||||||
{
|
{
|
||||||
ConstructorBuilder ctor = typeBuilder.DefineConstructor(
|
ConstructorBuilder ctor = typeBuilder.DefineConstructor(
|
||||||
MethodAttributes.Public,
|
MethodAttributes.Public,
|
||||||
CallingConventions.Standard,
|
CallingConventions.Standard,
|
||||||
Type.EmptyTypes
|
Type.EmptyTypes);
|
||||||
);
|
|
||||||
|
|
||||||
ILGenerator il = ctor.GetILGenerator();
|
ILGenerator il = ctor.GetILGenerator();
|
||||||
|
|
||||||
|
|
@ -36,16 +31,9 @@ namespace Server.Commands.Generic
|
||||||
il.Emit(OpCodes.Ret);
|
il.Emit(OpCodes.Ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region IComparer
|
|
||||||
|
|
||||||
typeBuilder.AddInterfaceImplementation(typeof(IComparer<T>));
|
typeBuilder.AddInterfaceImplementation(typeof(IComparer<T>));
|
||||||
|
|
||||||
MethodBuilder compareMethod;
|
MethodBuilder compareMethod;
|
||||||
|
|
||||||
#region Compare
|
|
||||||
|
|
||||||
{
|
{
|
||||||
MethodEmitter emitter = new MethodEmitter(typeBuilder);
|
MethodEmitter emitter = new MethodEmitter(typeBuilder);
|
||||||
|
|
||||||
|
|
@ -78,7 +66,7 @@ namespace Server.Commands.Generic
|
||||||
if (i > 0)
|
if (i > 0)
|
||||||
{
|
{
|
||||||
emitter.LoadLocal(v);
|
emitter.LoadLocal(v);
|
||||||
emitter.BranchIfTrue(end); // if ( v != 0 ) return v;
|
emitter.BranchIfTrue(end);
|
||||||
}
|
}
|
||||||
|
|
||||||
Property prop = props[i];
|
Property prop = props[i];
|
||||||
|
|
@ -87,7 +75,7 @@ namespace Server.Commands.Generic
|
||||||
emitter.Chain(prop);
|
emitter.Chain(prop);
|
||||||
|
|
||||||
bool couldCompare =
|
bool couldCompare =
|
||||||
emitter.CompareTo(1, delegate
|
emitter.CompareTo(1, () =>
|
||||||
{
|
{
|
||||||
emitter.LoadLocal(b);
|
emitter.LoadLocal(b);
|
||||||
emitter.Chain(prop);
|
emitter.Chain(prop);
|
||||||
|
|
@ -112,23 +100,12 @@ namespace Server.Commands.Generic
|
||||||
{
|
{
|
||||||
typeof(T),
|
typeof(T),
|
||||||
typeof(T)
|
typeof(T)
|
||||||
}
|
}) ?? throw new Exception($"No Compare method found for type {typeof(T).FullName}"));
|
||||||
) ?? throw new Exception($"No Compare method found for type {typeof(T).FullName}")
|
|
||||||
);
|
|
||||||
|
|
||||||
compareMethod = emitter.Method;
|
compareMethod = emitter.Method;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region IEqualityComparer
|
|
||||||
|
|
||||||
typeBuilder.AddInterfaceImplementation(typeof(IEqualityComparer<T>));
|
typeBuilder.AddInterfaceImplementation(typeof(IEqualityComparer<T>));
|
||||||
|
|
||||||
#region Equals
|
|
||||||
|
|
||||||
{
|
{
|
||||||
MethodEmitter emitter = new MethodEmitter(typeBuilder);
|
MethodEmitter emitter = new MethodEmitter(typeBuilder);
|
||||||
|
|
||||||
|
|
@ -158,14 +135,8 @@ namespace Server.Commands.Generic
|
||||||
{
|
{
|
||||||
typeof(T),
|
typeof(T),
|
||||||
typeof(T)
|
typeof(T)
|
||||||
|
}) ?? throw new Exception($"No Equals method found for type {typeof(T).FullName}"));
|
||||||
}
|
}
|
||||||
) ?? throw new Exception($"No Equals method found for type {typeof(T).FullName}")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region GetHashCode
|
|
||||||
|
|
||||||
{
|
{
|
||||||
MethodEmitter emitter = new MethodEmitter(typeBuilder);
|
MethodEmitter emitter = new MethodEmitter(typeBuilder);
|
||||||
|
|
@ -242,14 +213,8 @@ namespace Server.Commands.Generic
|
||||||
new[]
|
new[]
|
||||||
{
|
{
|
||||||
typeof(T)
|
typeof(T)
|
||||||
|
}) ?? throw new Exception($"No GetHashCode method found for type {typeof(T).FullName}"));
|
||||||
}
|
}
|
||||||
) ?? throw new Exception($"No GetHashCode method found for type {typeof(T).FullName}")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
Type comparerType = typeBuilder.CreateType();
|
Type comparerType = typeBuilder.CreateType();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
using Server.Utilities;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Reflection.Emit;
|
using System.Reflection.Emit;
|
||||||
|
using Server.Utilities;
|
||||||
|
|
||||||
namespace Server.Commands.Generic
|
namespace Server.Commands.Generic
|
||||||
{
|
{
|
||||||
|
|
@ -17,7 +17,7 @@ namespace Server.Commands.Generic
|
||||||
IsAscending = isAscending;
|
IsAscending = isAscending;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Property Property{ get; set; }
|
public Property Property { get; set; }
|
||||||
|
|
||||||
public bool IsAscending
|
public bool IsAscending
|
||||||
{
|
{
|
||||||
|
|
@ -51,17 +51,12 @@ namespace Server.Commands.Generic
|
||||||
TypeBuilder typeBuilder = assembly.DefineType(
|
TypeBuilder typeBuilder = assembly.DefineType(
|
||||||
"__sort",
|
"__sort",
|
||||||
TypeAttributes.Public,
|
TypeAttributes.Public,
|
||||||
typeof(T)
|
typeof(T));
|
||||||
);
|
|
||||||
|
|
||||||
#region Constructor
|
|
||||||
|
|
||||||
{
|
{
|
||||||
ConstructorBuilder ctor = typeBuilder.DefineConstructor(
|
ConstructorBuilder ctor = typeBuilder.DefineConstructor(
|
||||||
MethodAttributes.Public,
|
MethodAttributes.Public,
|
||||||
CallingConventions.Standard,
|
CallingConventions.Standard,
|
||||||
Type.EmptyTypes
|
Type.EmptyTypes);
|
||||||
);
|
|
||||||
|
|
||||||
ILGenerator il = ctor.GetILGenerator();
|
ILGenerator il = ctor.GetILGenerator();
|
||||||
|
|
||||||
|
|
@ -74,13 +69,7 @@ namespace Server.Commands.Generic
|
||||||
il.Emit(OpCodes.Ret);
|
il.Emit(OpCodes.Ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region IComparer
|
|
||||||
|
|
||||||
typeBuilder.AddInterfaceImplementation(typeof(IComparer<T>));
|
typeBuilder.AddInterfaceImplementation(typeof(IComparer<T>));
|
||||||
|
|
||||||
#region Compare
|
|
||||||
{
|
{
|
||||||
MethodEmitter emitter = new MethodEmitter(typeBuilder);
|
MethodEmitter emitter = new MethodEmitter(typeBuilder);
|
||||||
|
|
||||||
|
|
@ -113,7 +102,7 @@ namespace Server.Commands.Generic
|
||||||
if (i > 0)
|
if (i > 0)
|
||||||
{
|
{
|
||||||
emitter.LoadLocal(v);
|
emitter.LoadLocal(v);
|
||||||
emitter.BranchIfTrue(end); // if ( v != 0 ) return v;
|
emitter.BranchIfTrue(end);
|
||||||
}
|
}
|
||||||
|
|
||||||
OrderInfo orderInfo = orders[i];
|
OrderInfo orderInfo = orders[i];
|
||||||
|
|
@ -125,7 +114,7 @@ namespace Server.Commands.Generic
|
||||||
emitter.Chain(prop);
|
emitter.Chain(prop);
|
||||||
|
|
||||||
bool couldCompare =
|
bool couldCompare =
|
||||||
emitter.CompareTo(sign, delegate
|
emitter.CompareTo(sign, () =>
|
||||||
{
|
{
|
||||||
emitter.LoadLocal(b);
|
emitter.LoadLocal(b);
|
||||||
emitter.Chain(prop);
|
emitter.Chain(prop);
|
||||||
|
|
@ -150,14 +139,8 @@ namespace Server.Commands.Generic
|
||||||
{
|
{
|
||||||
typeof(T),
|
typeof(T),
|
||||||
typeof(T)
|
typeof(T)
|
||||||
|
}) ?? throw new Exception($"No Compare method found for type {typeof(T).FullName}"));
|
||||||
}
|
}
|
||||||
) ?? throw new Exception($"No Compare method found for type {typeof(T).FullName}")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
Type comparerType = typeBuilder.CreateType();
|
Type comparerType = typeBuilder.CreateType();
|
||||||
return (IComparer<T>)ActivatorUtil.CreateInstance(comparerType);
|
return (IComparer<T>)ActivatorUtil.CreateInstance(comparerType);
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ namespace Server.Commands.Generic
|
||||||
|
|
||||||
private IComparer<object> m_Comparer;
|
private IComparer<object> m_Comparer;
|
||||||
|
|
||||||
private List<Property> m_Properties;
|
private readonly List<Property> m_Properties;
|
||||||
|
|
||||||
public DistinctExtension() => m_Properties = new List<Property>();
|
public DistinctExtension() => m_Properties = new List<Property>();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ namespace Server.Commands.Generic
|
||||||
|
|
||||||
public override ExtensionInfo Info => ExtInfo;
|
public override ExtensionInfo Info => ExtInfo;
|
||||||
|
|
||||||
public int Limit{ get; private set; }
|
public int Limit { get; private set; }
|
||||||
|
|
||||||
public static void Initialize()
|
public static void Initialize()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ namespace Server.Commands.Generic
|
||||||
|
|
||||||
private IComparer<object> m_Comparer;
|
private IComparer<object> m_Comparer;
|
||||||
|
|
||||||
private List<OrderInfo> m_Orders;
|
private readonly List<OrderInfo> m_Orders;
|
||||||
|
|
||||||
public SortExtension() => m_Orders = new List<OrderInfo>();
|
public SortExtension() => m_Orders = new List<OrderInfo>();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ namespace Server.Commands.Generic
|
||||||
|
|
||||||
public override ExtensionInfo Info => ExtInfo;
|
public override ExtensionInfo Info => ExtInfo;
|
||||||
|
|
||||||
public ObjectConditional Conditional{ get; private set; }
|
public ObjectConditional Conditional { get; private set; }
|
||||||
|
|
||||||
public static void Initialize()
|
public static void Initialize()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace Server.Commands.Generic
|
namespace Server.Commands.Generic
|
||||||
{
|
{
|
||||||
|
|
@ -19,7 +18,7 @@ namespace Server.Commands.Generic
|
||||||
Instance = this;
|
Instance = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static AreaCommandImplementor Instance{ get; private set; }
|
public static AreaCommandImplementor Instance { get; private set; }
|
||||||
|
|
||||||
public override void Process(Mobile from, BaseCommand command, string[] args)
|
public override void Process(Mobile from, BaseCommand command, string[] args)
|
||||||
{
|
{
|
||||||
|
|
@ -48,7 +47,6 @@ namespace Server.Commands.Generic
|
||||||
if ((!mobiles || obj is Mobile) && BaseCommand.IsAccessible(from, obj) && ext.IsValid(obj))
|
if ((!mobiles || obj is Mobile) && BaseCommand.IsAccessible(from, obj) && ext.IsValid(obj))
|
||||||
objs.Add(obj);
|
objs.Add(obj);
|
||||||
|
|
||||||
|
|
||||||
eable.Free();
|
eable.Free();
|
||||||
ext.Filter(objs);
|
ext.Filter(objs);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,19 +32,19 @@ namespace Server.Commands.Generic
|
||||||
|
|
||||||
public BaseCommandImplementor() => Commands = new Dictionary<string, BaseCommand>(StringComparer.OrdinalIgnoreCase);
|
public BaseCommandImplementor() => Commands = new Dictionary<string, BaseCommand>(StringComparer.OrdinalIgnoreCase);
|
||||||
|
|
||||||
public bool SupportsConditionals{ get; set; }
|
public bool SupportsConditionals { get; set; }
|
||||||
|
|
||||||
public string[] Accessors{ get; set; }
|
public string[] Accessors { get; set; }
|
||||||
|
|
||||||
public string Usage{ get; set; }
|
public string Usage { get; set; }
|
||||||
|
|
||||||
public string Description{ get; set; }
|
public string Description { get; set; }
|
||||||
|
|
||||||
public AccessLevel AccessLevel{ get; set; }
|
public AccessLevel AccessLevel { get; set; }
|
||||||
|
|
||||||
public CommandSupport SupportRequirement{ get; set; }
|
public CommandSupport SupportRequirement { get; set; }
|
||||||
|
|
||||||
public Dictionary<string, BaseCommand> Commands{ get; }
|
public Dictionary<string, BaseCommand> Commands { get; }
|
||||||
|
|
||||||
public static List<BaseCommandImplementor> Implementors
|
public static List<BaseCommandImplementor> Implementors
|
||||||
{
|
{
|
||||||
|
|
@ -226,7 +226,7 @@ namespace Server.Commands.Generic
|
||||||
else if (obj != null)
|
else if (obj != null)
|
||||||
{
|
{
|
||||||
if (command.ListOptimized)
|
if (command.ListOptimized)
|
||||||
command.ExecuteList(e, new List<object>{ obj });
|
command.ExecuteList(e, new List<object> { obj });
|
||||||
else
|
else
|
||||||
command.Execute(e, obj);
|
command.Execute(e, obj);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ namespace Server.Commands.Generic
|
||||||
|
|
||||||
private IConditional[] m_Conditionals;
|
private IConditional[] m_Conditionals;
|
||||||
|
|
||||||
private ICondition[][] m_Conditions;
|
private readonly ICondition[][] m_Conditions;
|
||||||
|
|
||||||
public ObjectConditional(Type objectType, ICondition[][] conditions)
|
public ObjectConditional(Type objectType, ICondition[][] conditions)
|
||||||
{
|
{
|
||||||
|
|
@ -20,7 +20,7 @@ namespace Server.Commands.Generic
|
||||||
m_Conditions = conditions;
|
m_Conditions = conditions;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Type Type{ get; }
|
public Type Type { get; }
|
||||||
|
|
||||||
public bool IsItem => Type == null || Type == typeofItem || Type.IsSubclassOf(typeofItem);
|
public bool IsItem => Type == null || Type == typeofItem || Type.IsSubclassOf(typeofItem);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ namespace Server.Commands.Generic
|
||||||
Instance = this;
|
Instance = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static RangeCommandImplementor Instance{ get; private set; }
|
public static RangeCommandImplementor Instance { get; private set; }
|
||||||
|
|
||||||
public override void Execute(CommandEventArgs e)
|
public override void Execute(CommandEventArgs e)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -287,7 +287,7 @@ namespace Server.Commands
|
||||||
|
|
||||||
foreach (Mobile m in World.Mobiles.Values)
|
foreach (Mobile m in World.Mobiles.Values)
|
||||||
if (m is BaseCreature bc)
|
if (m is BaseCreature bc)
|
||||||
if (bc.Controlled && bc.ControlMaster == master || bc.Summoned && bc.SummonMaster == master)
|
if ((bc.Controlled && bc.ControlMaster == master) || (bc.Summoned && bc.SummonMaster == master))
|
||||||
pets.Add(bc);
|
pets.Add(bc);
|
||||||
|
|
||||||
if (pets.Count > 0)
|
if (pets.Count > 0)
|
||||||
|
|
@ -408,7 +408,7 @@ namespace Server.Commands
|
||||||
AutoSave.Save(true);
|
AutoSave.Save(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool FixMap(ref Map map, ref Point3D loc, Item item) => map != null && map != Map.Internal || item.RootParent is Mobile m && FixMap(ref map, ref loc, m);
|
private static bool FixMap(ref Map map, ref Point3D loc, Item item) => (map != null && map != Map.Internal) || (item.RootParent is Mobile m && FixMap(ref map, ref loc, m));
|
||||||
|
|
||||||
private static bool FixMap(ref Map map, ref Point3D loc, Mobile m)
|
private static bool FixMap(ref Map map, ref Point3D loc, Mobile m)
|
||||||
{
|
{
|
||||||
|
|
@ -782,7 +782,7 @@ namespace Server.Commands
|
||||||
|
|
||||||
private class EquipMenu : ItemListMenu
|
private class EquipMenu : ItemListMenu
|
||||||
{
|
{
|
||||||
private Mobile m_Mobile;
|
private readonly Mobile m_Mobile;
|
||||||
|
|
||||||
public EquipMenu(Mobile from, Mobile m, ItemListEntry[] entries) : base("Equipment", entries)
|
public EquipMenu(Mobile from, Mobile m, ItemListEntry[] entries) : base("Equipment", entries)
|
||||||
{
|
{
|
||||||
|
|
@ -804,8 +804,8 @@ namespace Server.Commands
|
||||||
|
|
||||||
private class EquipDetailsMenu : QuestionMenu
|
private class EquipDetailsMenu : QuestionMenu
|
||||||
{
|
{
|
||||||
private Item m_Item;
|
private readonly Item m_Item;
|
||||||
private Mobile m_Mobile;
|
private readonly Mobile m_Mobile;
|
||||||
|
|
||||||
public EquipDetailsMenu(Mobile m, Item item) : base($"{item.Layer}: {item.GetType().Name}",
|
public EquipDetailsMenu(Mobile m, Item item) : base($"{item.Layer}: {item.GetType().Name}",
|
||||||
new[] { "Move", "Delete", "Props" })
|
new[] { "Move", "Delete", "Props" })
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,9 @@ namespace Server.Commands
|
||||||
{
|
{
|
||||||
public class HelpInfo
|
public class HelpInfo
|
||||||
{
|
{
|
||||||
public static Dictionary<string, CommandInfo> HelpInfos{ get; } = new Dictionary<string, CommandInfo>();
|
public static Dictionary<string, CommandInfo> HelpInfos { get; } = new Dictionary<string, CommandInfo>();
|
||||||
|
|
||||||
public static List<CommandInfo> SortedHelpInfo{ get; private set; } = new List<CommandInfo>();
|
public static List<CommandInfo> SortedHelpInfo { get; private set; } = new List<CommandInfo>();
|
||||||
|
|
||||||
[CallPriority(100)]
|
[CallPriority(100)]
|
||||||
public static void Initialize()
|
public static void Initialize()
|
||||||
|
|
@ -106,7 +106,6 @@ namespace Server.Commands
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for (int i = 0; i < TargetCommands.AllCommands.Count; ++i)
|
for (int i = 0; i < TargetCommands.AllCommands.Count; ++i)
|
||||||
{
|
{
|
||||||
BaseCommand command = TargetCommands.AllCommands[i];
|
BaseCommand command = TargetCommands.AllCommands[i];
|
||||||
|
|
@ -221,9 +220,9 @@ namespace Server.Commands
|
||||||
public class CommandListGump : BaseGridGump
|
public class CommandListGump : BaseGridGump
|
||||||
{
|
{
|
||||||
private const int EntriesPerPage = 15;
|
private const int EntriesPerPage = 15;
|
||||||
private List<CommandInfo> m_List;
|
private readonly List<CommandInfo> m_List;
|
||||||
|
|
||||||
private int m_Page;
|
private readonly int m_Page;
|
||||||
|
|
||||||
public CommandListGump(int page, Mobile from, List<CommandInfo> list)
|
public CommandListGump(int page, Mobile from, List<CommandInfo> list)
|
||||||
: base(30, 30)
|
: base(30, 30)
|
||||||
|
|
@ -334,7 +333,6 @@ namespace Server.Commands
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class CommandInfoGump : Gump
|
public class CommandInfoGump : Gump
|
||||||
{
|
{
|
||||||
public CommandInfoGump(CommandInfo info, int width = 320, int height = 200)
|
public CommandInfoGump(CommandInfo info, int width = 320, int height = 200)
|
||||||
|
|
@ -344,13 +342,13 @@ namespace Server.Commands
|
||||||
|
|
||||||
AddBackground(0, 0, width, height, 5054);
|
AddBackground(0, 0, width, height, 5054);
|
||||||
|
|
||||||
//AddImageTiled( 10, 10, width - 20, 20, 2624 );
|
// AddImageTiled( 10, 10, width - 20, 20, 2624 );
|
||||||
//AddAlphaRegion( 10, 10, width - 20, 20 );
|
// AddAlphaRegion( 10, 10, width - 20, 20 );
|
||||||
//AddHtmlLocalized( 10, 10, width - 20, 20, header, headerColor, false, false );
|
// AddHtmlLocalized( 10, 10, width - 20, 20, header, headerColor, false, false );
|
||||||
AddHtml(10, 10, width - 20, 20, Color(Center(info.Name), 0xFF0000));
|
AddHtml(10, 10, width - 20, 20, Color(Center(info.Name), 0xFF0000));
|
||||||
|
|
||||||
//AddImageTiled( 10, 40, width - 20, height - 80, 2624 );
|
// AddImageTiled( 10, 40, width - 20, height - 80, 2624 );
|
||||||
//AddAlphaRegion( 10, 40, width - 20, height - 80 );
|
// AddAlphaRegion( 10, 40, width - 20, height - 80 );
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
|
|
@ -384,8 +382,8 @@ namespace Server.Commands
|
||||||
|
|
||||||
AddHtml(10, 40, width - 20, height - 80, sb.ToString(), false, true);
|
AddHtml(10, 40, width - 20, height - 80, sb.ToString(), false, true);
|
||||||
|
|
||||||
//AddImageTiled( 10, height - 30, width - 20, 20, 2624 );
|
// AddImageTiled( 10, height - 30, width - 20, 20, 2624 );
|
||||||
//AddAlphaRegion( 10, height - 30, width - 20, 20 );
|
// AddAlphaRegion( 10, height - 30, width - 20, 20 );
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Color(string text, int color) => $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
|
public string Color(string text, int color) => $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
using Server.Commands.Generic;
|
using Server.Commands.Generic;
|
||||||
using Server.Items;
|
using Server.Items;
|
||||||
using Server.Targeting;
|
using Server.Targeting;
|
||||||
using System.Globalization;
|
|
||||||
|
|
||||||
namespace Server.Commands
|
namespace Server.Commands
|
||||||
{
|
{
|
||||||
public class LocationCommand : BaseCommand
|
public class LocationCommand : BaseCommand
|
||||||
{
|
{
|
||||||
private static readonly List<int> m_DefaultGraphics = new List<int>{ 0x17AF, 0x17B0, 0x17B1, 0x17B2 };
|
private static readonly List<int> m_DefaultGraphics = new List<int> { 0x17AF, 0x17B0, 0x17B1, 0x17B2 };
|
||||||
|
|
||||||
public LocationCommand()
|
public LocationCommand()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,10 @@ namespace Server.Commands
|
||||||
{
|
{
|
||||||
public class CommandLogging
|
public class CommandLogging
|
||||||
{
|
{
|
||||||
private static char[] m_NotSafe = { '\\', '/', ':', '*', '?', '"', '<', '>', '|' };
|
private static readonly char[] m_NotSafe = { '\\', '/', ':', '*', '?', '"', '<', '>', '|' };
|
||||||
public static bool Enabled{ get; set; } = true;
|
public static bool Enabled { get; set; } = true;
|
||||||
|
|
||||||
public static StreamWriter Output{ get; private set; }
|
public static StreamWriter Output { get; private set; }
|
||||||
|
|
||||||
public static void Initialize()
|
public static void Initialize()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ using Server.Diagnostics;
|
||||||
|
|
||||||
namespace Server.Commands
|
namespace Server.Commands
|
||||||
{
|
{
|
||||||
public class Profiling
|
public static class Profiling
|
||||||
{
|
{
|
||||||
public static void Initialize()
|
public static void Initialize()
|
||||||
{
|
{
|
||||||
|
|
@ -168,10 +168,10 @@ namespace Server.Commands
|
||||||
if ((flags & ExpandFlag.Blessed) != 0)
|
if ((flags & ExpandFlag.Blessed) != 0)
|
||||||
++countTable[4];
|
++countTable[4];
|
||||||
|
|
||||||
/*if ( ( flags & ExpandFlag.TempFlag ) != 0 )
|
/*if (( flags & ExpandFlag.TempFlag ) != 0)
|
||||||
++countTable[5];
|
++countTable[5];
|
||||||
|
|
||||||
if ( ( flags & ExpandFlag.SaveFlag ) != 0 )
|
if (( flags & ExpandFlag.SaveFlag ) != 0)
|
||||||
++countTable[6];*/
|
++countTable[6];*/
|
||||||
|
|
||||||
if ((flags & ExpandFlag.Weight) != 0)
|
if ((flags & ExpandFlag.Weight) != 0)
|
||||||
|
|
@ -243,7 +243,8 @@ namespace Server.Commands
|
||||||
{
|
{
|
||||||
parms[0]++;
|
parms[0]++;
|
||||||
parms[1] += item.Amount;
|
parms[1] += item.Amount;
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
table[type] = new[] { 1, item.Amount };
|
table[type] = new[] { 1, item.Amount };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,25 +18,25 @@ namespace Server.Commands
|
||||||
|
|
||||||
public static class Properties
|
public static class Properties
|
||||||
{
|
{
|
||||||
private static Type typeofCPA = typeof(CPA);
|
private static readonly Type typeofCPA = typeof(CPA);
|
||||||
|
|
||||||
private static Type typeofSerial = typeof(Serial);
|
private static readonly Type typeofSerial = typeof(Serial);
|
||||||
|
|
||||||
private static Type typeofType = typeof(Type);
|
private static readonly Type typeofType = typeof(Type);
|
||||||
|
|
||||||
private static Type typeofChar = typeof(char);
|
private static readonly Type typeofChar = typeof(char);
|
||||||
|
|
||||||
private static Type typeofString = typeof(string);
|
private static readonly Type typeofString = typeof(string);
|
||||||
|
|
||||||
private static Type typeofText = typeof(TextDefinition);
|
private static readonly Type typeofText = typeof(TextDefinition);
|
||||||
|
|
||||||
private static Type typeofTimeSpan = typeof(TimeSpan);
|
private static readonly Type typeofTimeSpan = typeof(TimeSpan);
|
||||||
private static Type typeofParsable = typeof(ParsableAttribute);
|
private static readonly Type typeofParsable = typeof(ParsableAttribute);
|
||||||
|
|
||||||
private static Type[] m_ParseTypes = { typeof(string) };
|
private static readonly Type[] m_ParseTypes = { typeof(string) };
|
||||||
private static object[] m_ParseParams = new object[1];
|
private static readonly object[] m_ParseParams = new object[1];
|
||||||
|
|
||||||
private static Type[] m_NumericTypes =
|
private static readonly Type[] m_NumericTypes =
|
||||||
{
|
{
|
||||||
typeof(byte), typeof(sbyte),
|
typeof(byte), typeof(sbyte),
|
||||||
typeof(short), typeof(ushort),
|
typeof(short), typeof(ushort),
|
||||||
|
|
@ -602,8 +602,8 @@ namespace Server
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public AccessLevel PlayerAccess{ get; set; }
|
public AccessLevel PlayerAccess { get; set; }
|
||||||
public AccessLevel NeededAccess{ get; set; }
|
public AccessLevel NeededAccess { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public sealed class ReadAccessException : ClearanceException
|
public sealed class ReadAccessException : ClearanceException
|
||||||
|
|
@ -630,11 +630,11 @@ namespace Server
|
||||||
|
|
||||||
public Property(PropertyInfo[] chain) => m_Chain = chain;
|
public Property(PropertyInfo[] chain) => m_Chain = chain;
|
||||||
|
|
||||||
public string Binding{ get; }
|
public string Binding { get; }
|
||||||
|
|
||||||
public bool IsBound => m_Chain != null;
|
public bool IsBound => m_Chain != null;
|
||||||
|
|
||||||
public PropertyAccess Access{ get; private set; }
|
public PropertyAccess Access { get; private set; }
|
||||||
|
|
||||||
public PropertyInfo[] Chain
|
public PropertyInfo[] Chain
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ namespace Server.Commands
|
||||||
{
|
{
|
||||||
public class SignParser
|
public class SignParser
|
||||||
{
|
{
|
||||||
private static Queue<Item> m_ToDelete = new Queue<Item>();
|
private static readonly Queue<Item> m_ToDelete = new Queue<Item>();
|
||||||
|
|
||||||
public static void Initialize()
|
public static void Initialize()
|
||||||
{
|
{
|
||||||
|
|
@ -119,10 +119,10 @@ namespace Server.Commands
|
||||||
|
|
||||||
private class SignEntry
|
private class SignEntry
|
||||||
{
|
{
|
||||||
public int m_ItemID;
|
public readonly int m_ItemID;
|
||||||
public Point3D m_Location;
|
public readonly Point3D m_Location;
|
||||||
public int m_Map;
|
public readonly int m_Map;
|
||||||
public string m_Text;
|
public readonly string m_Text;
|
||||||
|
|
||||||
public SignEntry(string text, Point3D pt, int itemID, int mapLoc)
|
public SignEntry(string text, Point3D pt, int itemID, int mapLoc)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ namespace Server.Commands
|
||||||
|
|
||||||
public class AllSkillsTarget : Target
|
public class AllSkillsTarget : Target
|
||||||
{
|
{
|
||||||
private double m_Value;
|
private readonly double m_Value;
|
||||||
|
|
||||||
public AllSkillsTarget(double value) : base(-1, false, TargetFlags.None) => m_Value = value;
|
public AllSkillsTarget(double value) : base(-1, false, TargetFlags.None) => m_Value = value;
|
||||||
|
|
||||||
|
|
@ -82,9 +82,9 @@ namespace Server.Commands
|
||||||
|
|
||||||
public class SkillTarget : Target
|
public class SkillTarget : Target
|
||||||
{
|
{
|
||||||
private bool m_Set;
|
private readonly bool m_Set;
|
||||||
private SkillName m_Skill;
|
private readonly SkillName m_Skill;
|
||||||
private double m_Value;
|
private readonly double m_Value;
|
||||||
|
|
||||||
public SkillTarget(SkillName skill, double value) : base(-1, false, TargetFlags.None)
|
public SkillTarget(SkillName skill, double value) : base(-1, false, TargetFlags.None)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ namespace Server
|
||||||
"It is strongly recommended that you make backup of the data files mentioned above. " +
|
"It is strongly recommended that you make backup of the data files mentioned above. " +
|
||||||
"Do you wish to proceed?";
|
"Do you wish to proceed?";
|
||||||
|
|
||||||
private static Point3D NullP3D = new Point3D(int.MinValue, int.MinValue, int.MinValue);
|
private static readonly Point3D NullP3D = new Point3D(int.MinValue, int.MinValue, int.MinValue);
|
||||||
|
|
||||||
private static byte[] m_Buffer;
|
private static byte[] m_Buffer;
|
||||||
|
|
||||||
|
|
@ -45,7 +45,7 @@ namespace Server
|
||||||
CommandSystem.Register("UnfreezeWorld", AccessLevel.Administrator, UnfreezeWorld_OnCommand);
|
CommandSystem.Register("UnfreezeWorld", AccessLevel.Administrator, UnfreezeWorld_OnCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
public delegate void FreezeCallback( Mobile from, bool okay, StateInfo si );
|
public delegate void FreezeCallback(Mobile from, bool okay, StateInfo si);
|
||||||
|
|
||||||
[Usage("Freeze")]
|
[Usage("Freeze")]
|
||||||
[Description("Makes a targeted area of dynamic items static.")]
|
[Description("Makes a targeted area of dynamic items static.")]
|
||||||
|
|
@ -551,8 +551,9 @@ namespace Server
|
||||||
|
|
||||||
private class DeltaState
|
private class DeltaState
|
||||||
{
|
{
|
||||||
public List<Item> m_List;
|
public readonly List<Item> m_List;
|
||||||
public int m_X, m_Y;
|
public readonly int m_X;
|
||||||
|
public readonly int m_Y;
|
||||||
|
|
||||||
public DeltaState(Point2D p)
|
public DeltaState(Point2D p)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ namespace Server.Commands
|
||||||
|
|
||||||
IPooledEnumerable<IEntity> eable;
|
IPooledEnumerable<IEntity> eable;
|
||||||
|
|
||||||
if (!items && !multis || !mobiles)
|
if ((!items && !multis) || !mobiles)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
eable = map.GetObjectsInBounds(rect);
|
eable = map.GetObjectsInBounds(rect);
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@ namespace Server.ContextMenus
|
||||||
{
|
{
|
||||||
public class AddToPartyEntry : ContextMenuEntry
|
public class AddToPartyEntry : ContextMenuEntry
|
||||||
{
|
{
|
||||||
private Mobile m_From;
|
private readonly Mobile m_From;
|
||||||
private Mobile m_Target;
|
private readonly Mobile m_Target;
|
||||||
|
|
||||||
public AddToPartyEntry(Mobile from, Mobile target) : base(0197, 12)
|
public AddToPartyEntry(Mobile from, Mobile target) : base(0197, 12)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ namespace Server.ContextMenus
|
||||||
|
|
||||||
private class InternalTarget : Target
|
private class InternalTarget : Target
|
||||||
{
|
{
|
||||||
private SpellScroll m_Scroll;
|
private readonly SpellScroll m_Scroll;
|
||||||
|
|
||||||
public InternalTarget(SpellScroll scroll) : base(3, false, TargetFlags.None) => m_Scroll = scroll;
|
public InternalTarget(SpellScroll scroll) : base(3, false, TargetFlags.None) => m_Scroll = scroll;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@ namespace Server.ContextMenus
|
||||||
{
|
{
|
||||||
public class EatEntry : ContextMenuEntry
|
public class EatEntry : ContextMenuEntry
|
||||||
{
|
{
|
||||||
private Food m_Food;
|
private readonly Food m_Food;
|
||||||
private Mobile m_From;
|
private readonly Mobile m_From;
|
||||||
|
|
||||||
public EatEntry(Mobile from, Food food) : base(6135, 1)
|
public EatEntry(Mobile from, Food food) : base(6135, 1)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,9 @@ namespace Server.ContextMenus
|
||||||
{
|
{
|
||||||
public class EjectPlayerEntry : ContextMenuEntry
|
public class EjectPlayerEntry : ContextMenuEntry
|
||||||
{
|
{
|
||||||
private Mobile m_From;
|
private readonly Mobile m_From;
|
||||||
private Mobile m_Target;
|
private readonly Mobile m_Target;
|
||||||
private BaseHouse m_TargetHouse;
|
private readonly BaseHouse m_TargetHouse;
|
||||||
|
|
||||||
public EjectPlayerEntry(Mobile from, Mobile target) : base(6206, 12)
|
public EjectPlayerEntry(Mobile from, Mobile target) : base(6206, 12)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ namespace Server.ContextMenus
|
||||||
{
|
{
|
||||||
public class OpenBankEntry : ContextMenuEntry
|
public class OpenBankEntry : ContextMenuEntry
|
||||||
{
|
{
|
||||||
private Mobile m_Banker;
|
private readonly Mobile m_Banker;
|
||||||
|
|
||||||
public OpenBankEntry(Mobile from, Mobile banker) : base(6105, 12) => m_Banker = banker;
|
public OpenBankEntry(Mobile from, Mobile banker) : base(6105, 12) => m_Banker = banker;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,9 @@ namespace Server.ContextMenus
|
||||||
{
|
{
|
||||||
public class TeachEntry : ContextMenuEntry
|
public class TeachEntry : ContextMenuEntry
|
||||||
{
|
{
|
||||||
private Mobile m_From;
|
private readonly Mobile m_From;
|
||||||
private BaseCreature m_Mobile;
|
private readonly BaseCreature m_Mobile;
|
||||||
private SkillName m_Skill;
|
private readonly SkillName m_Skill;
|
||||||
|
|
||||||
public TeachEntry(SkillName skill, BaseCreature m, Mobile from, bool enabled) : base(6000 + (int)skill)
|
public TeachEntry(SkillName skill, BaseCreature m, Mobile from, bool enabled) : base(6000 + (int)skill)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ namespace Server.Engines.BulkOrders
|
||||||
{
|
{
|
||||||
public class BODTarget : Target
|
public class BODTarget : Target
|
||||||
{
|
{
|
||||||
private BaseBOD m_Deed;
|
private readonly BaseBOD m_Deed;
|
||||||
|
|
||||||
public BODTarget(BaseBOD deed) : base(18, false, TargetFlags.None) => m_Deed = deed;
|
public BODTarget(BaseBOD deed) : base(18, false, TargetFlags.None) => m_Deed = deed;
|
||||||
|
|
||||||
|
|
@ -15,7 +15,7 @@ namespace Server.Engines.BulkOrders
|
||||||
|
|
||||||
if (!(targeted is Item item && item.IsChildOf(from.Backpack)))
|
if (!(targeted is Item item && item.IsChildOf(from.Backpack)))
|
||||||
{
|
{
|
||||||
from.SendLocalizedMessage( 1045158 ); // You must have the item in your backpack to target it.
|
from.SendLocalizedMessage(1045158); // You must have the item in your backpack to target it.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,9 @@ namespace Server.Engines.BulkOrders
|
||||||
{
|
{
|
||||||
double random = Utility.RandomDouble();
|
double random = Utility.RandomDouble();
|
||||||
|
|
||||||
for ( int i = 0; i < chances.Length; ++i )
|
for (int i = 0; i < chances.Length; ++i)
|
||||||
{
|
{
|
||||||
if ( random < chances[i] )
|
if (random < chances[i])
|
||||||
return i == 0 ? BulkMaterialType.None : start + (i - 1);
|
return i == 0 ? BulkMaterialType.None : start + (i - 1);
|
||||||
|
|
||||||
random -= chances[i];
|
random -= chances[i];
|
||||||
|
|
@ -41,30 +41,30 @@ namespace Server.Engines.BulkOrders
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract bool Complete{ get; }
|
public abstract bool Complete { get; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public sealed override int Hue{ get; set; }
|
public sealed override int Hue { get; set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public int AmountMax
|
public int AmountMax
|
||||||
{
|
{
|
||||||
get => m_AmountMax;
|
get => m_AmountMax;
|
||||||
set{ m_AmountMax = value; InvalidateProperties(); }
|
set { m_AmountMax = value; InvalidateProperties(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
[CommandProperty( AccessLevel.GameMaster )]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public bool RequireExceptional
|
public bool RequireExceptional
|
||||||
{
|
{
|
||||||
get => m_RequireExceptional;
|
get => m_RequireExceptional;
|
||||||
set{ m_RequireExceptional = value; InvalidateProperties(); }
|
set { m_RequireExceptional = value; InvalidateProperties(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
[CommandProperty( AccessLevel.GameMaster )]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public BulkMaterialType Material
|
public BulkMaterialType Material
|
||||||
{
|
{
|
||||||
get => m_Material;
|
get => m_Material;
|
||||||
set{ m_Material = value; InvalidateProperties(); }
|
set { m_Material = value; InvalidateProperties(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract RewardGroup GetRewardGroup();
|
public abstract RewardGroup GetRewardGroup();
|
||||||
|
|
@ -118,24 +118,24 @@ namespace Server.Engines.BulkOrders
|
||||||
from.Target = new BODTarget(this);
|
from.Target = new BODTarget(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer )
|
public override void Serialize(IGenericWriter writer)
|
||||||
{
|
{
|
||||||
base.Serialize( writer );
|
base.Serialize(writer);
|
||||||
|
|
||||||
writer.WriteEncodedInt( 0 ); // version
|
writer.WriteEncodedInt(0); // version
|
||||||
|
|
||||||
writer.Write( m_AmountMax );
|
writer.Write(m_AmountMax);
|
||||||
writer.Write( m_RequireExceptional );
|
writer.Write(m_RequireExceptional);
|
||||||
writer.Write( (int) m_Material );
|
writer.Write((int)m_Material);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Deserialize( IGenericReader reader )
|
public override void Deserialize(IGenericReader reader)
|
||||||
{
|
{
|
||||||
base.Deserialize( reader );
|
base.Deserialize(reader);
|
||||||
|
|
||||||
int version = reader.ReadEncodedInt();
|
int version = reader.ReadEncodedInt();
|
||||||
|
|
||||||
switch ( version )
|
switch (version)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
{
|
{
|
||||||
|
|
@ -146,7 +146,7 @@ namespace Server.Engines.BulkOrders
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( Parent == null && Map == Map.Internal && Location == Point3D.Zero )
|
if (Parent == null && Map == Map.Internal && Location == Point3D.Zero)
|
||||||
Delete();
|
Delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,13 +26,13 @@ namespace Server.Engines.BulkOrders
|
||||||
|
|
||||||
public bool IsDefault => Type == 0 && Quality == 0 && Material == 0 && Quantity == 0;
|
public bool IsDefault => Type == 0 && Quality == 0 && Material == 0 && Quantity == 0;
|
||||||
|
|
||||||
public int Type{ get; set; }
|
public int Type { get; set; }
|
||||||
|
|
||||||
public int Quality{ get; set; }
|
public int Quality { get; set; }
|
||||||
|
|
||||||
public int Material{ get; set; }
|
public int Material { get; set; }
|
||||||
|
|
||||||
public int Quantity{ get; set; }
|
public int Quantity { get; set; }
|
||||||
|
|
||||||
public void Clear()
|
public void Clear()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ namespace Server.Engines.BulkOrders
|
||||||
{
|
{
|
||||||
private const int LabelColor = 0x7FFF;
|
private const int LabelColor = 0x7FFF;
|
||||||
|
|
||||||
private static int[,] m_MaterialFilters =
|
private static readonly int[,] m_MaterialFilters =
|
||||||
{
|
{
|
||||||
{ 1044067, 1 }, // Blacksmithy
|
{ 1044067, 1 }, // Blacksmithy
|
||||||
{ 1062226, 3 }, // Iron
|
{ 1062226, 3 }, // Iron
|
||||||
|
|
@ -16,14 +16,12 @@ namespace Server.Engines.BulkOrders
|
||||||
{ 1018333, 5 }, // Shadow Iron
|
{ 1018333, 5 }, // Shadow Iron
|
||||||
{ 1018334, 6 }, // Copper
|
{ 1018334, 6 }, // Copper
|
||||||
{ 1018335, 7 }, // Bronze
|
{ 1018335, 7 }, // Bronze
|
||||||
|
|
||||||
{ 0, 0 }, // --Blank--
|
{ 0, 0 }, // --Blank--
|
||||||
{ 1018336, 8 }, // Golden
|
{ 1018336, 8 }, // Golden
|
||||||
{ 1018337, 9 }, // Agapite
|
{ 1018337, 9 }, // Agapite
|
||||||
{ 1018338, 10 }, // Verite
|
{ 1018338, 10 }, // Verite
|
||||||
{ 1018339, 11 }, // Valorite
|
{ 1018339, 11 }, // Valorite
|
||||||
{ 0, 0 }, // --Blank--
|
{ 0, 0 }, // --Blank--
|
||||||
|
|
||||||
{ 1044094, 2 }, // Tailoring
|
{ 1044094, 2 }, // Tailoring
|
||||||
{ 1044286, 12 }, // Cloth
|
{ 1044286, 12 }, // Cloth
|
||||||
{ 1062235, 13 }, // Leather
|
{ 1062235, 13 }, // Leather
|
||||||
|
|
@ -32,21 +30,21 @@ namespace Server.Engines.BulkOrders
|
||||||
{ 1062238, 16 } // Barbed
|
{ 1062238, 16 } // Barbed
|
||||||
};
|
};
|
||||||
|
|
||||||
private static int[,] m_TypeFilters =
|
private static readonly int[,] m_TypeFilters =
|
||||||
{
|
{
|
||||||
{ 1062229, 0 }, // All
|
{ 1062229, 0 }, // All
|
||||||
{ 1062224, 1 }, // Small
|
{ 1062224, 1 }, // Small
|
||||||
{ 1062225, 2 } // Large
|
{ 1062225, 2 } // Large
|
||||||
};
|
};
|
||||||
|
|
||||||
private static int[,] m_QualityFilters =
|
private static readonly int[,] m_QualityFilters =
|
||||||
{
|
{
|
||||||
{ 1062229, 0 }, // All
|
{ 1062229, 0 }, // All
|
||||||
{ 1011542, 1 }, // Normal
|
{ 1011542, 1 }, // Normal
|
||||||
{ 1060636, 2 } // Exceptional
|
{ 1060636, 2 } // Exceptional
|
||||||
};
|
};
|
||||||
|
|
||||||
private static int[,] m_AmountFilters =
|
private static readonly int[,] m_AmountFilters =
|
||||||
{
|
{
|
||||||
{ 1062229, 0 }, // All
|
{ 1062229, 0 }, // All
|
||||||
{ 1049706, 1 }, // 10
|
{ 1049706, 1 }, // 10
|
||||||
|
|
@ -54,7 +52,7 @@ namespace Server.Engines.BulkOrders
|
||||||
{ 1062239, 3 } // 20
|
{ 1062239, 3 } // 20
|
||||||
};
|
};
|
||||||
|
|
||||||
private static int[][,] m_Filters =
|
private static readonly int[][,] m_Filters =
|
||||||
{
|
{
|
||||||
m_TypeFilters,
|
m_TypeFilters,
|
||||||
m_QualityFilters,
|
m_QualityFilters,
|
||||||
|
|
@ -62,15 +60,15 @@ namespace Server.Engines.BulkOrders
|
||||||
m_AmountFilters
|
m_AmountFilters
|
||||||
};
|
};
|
||||||
|
|
||||||
private static int[] m_XOffsets_Type = { 0, 75, 170 };
|
private static readonly int[] m_XOffsets_Type = { 0, 75, 170 };
|
||||||
private static int[] m_XOffsets_Quality = { 0, 75, 170 };
|
private static readonly int[] m_XOffsets_Quality = { 0, 75, 170 };
|
||||||
private static int[] m_XOffsets_Amount = { 0, 75, 180, 275 };
|
private static readonly int[] m_XOffsets_Amount = { 0, 75, 180, 275 };
|
||||||
private static int[] m_XOffsets_Material = { 0, 105, 210, 305, 390, 485 };
|
private static readonly int[] m_XOffsets_Material = { 0, 105, 210, 305, 390, 485 };
|
||||||
|
|
||||||
private static int[] m_XWidths_Small = { 50, 50, 70, 50 };
|
private static readonly int[] m_XWidths_Small = { 50, 50, 70, 50 };
|
||||||
private static int[] m_XWidths_Large = { 80, 50, 50, 50, 50, 50 };
|
private static readonly int[] m_XWidths_Large = { 80, 50, 50, 50, 50, 50 };
|
||||||
private BulkOrderBook m_Book;
|
private readonly BulkOrderBook m_Book;
|
||||||
private PlayerMobile m_From;
|
private readonly PlayerMobile m_From;
|
||||||
|
|
||||||
public BOBFilterGump(PlayerMobile from, BulkOrderBook book) : base(12, 24)
|
public BOBFilterGump(PlayerMobile from, BulkOrderBook book) : base(12, 24)
|
||||||
{
|
{
|
||||||
|
|
@ -132,7 +130,7 @@ namespace Server.Engines.BulkOrders
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
bool isSelected = filters[i, 1] == filterValue ||
|
bool isSelected = filters[i, 1] == filterValue ||
|
||||||
i % xOffsets.Length == 0 && filterValue == 0;
|
(i % xOffsets.Length == 0 && filterValue == 0);
|
||||||
|
|
||||||
AddHtmlLocalized(x + 35 + xOffsets[i % xOffsets.Length], y + i / xOffsets.Length * yOffset,
|
AddHtmlLocalized(x + 35 + xOffsets[i % xOffsets.Length], y + i / xOffsets.Length * yOffset,
|
||||||
xWidths[i % xOffsets.Length], 32, number, isSelected ? 16927 : LabelColor);
|
xWidths[i % xOffsets.Length], 32, number, isSelected ? 16927 : LabelColor);
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,9 @@ namespace Server.Engines.BulkOrders
|
||||||
public class BOBGump : Gump
|
public class BOBGump : Gump
|
||||||
{
|
{
|
||||||
private const int LabelColor = 0x7FFF;
|
private const int LabelColor = 0x7FFF;
|
||||||
private BulkOrderBook m_Book;
|
private readonly BulkOrderBook m_Book;
|
||||||
private PlayerMobile m_From;
|
private readonly PlayerMobile m_From;
|
||||||
private List<IBOBEntry> m_List;
|
private readonly List<IBOBEntry> m_List;
|
||||||
|
|
||||||
private int m_Page;
|
private int m_Page;
|
||||||
|
|
||||||
|
|
@ -173,7 +173,7 @@ namespace Server.Engines.BulkOrders
|
||||||
if (canDrop)
|
if (canDrop)
|
||||||
AddButton(35, y + 2, 5602, 5606, 5 + i * 2);
|
AddButton(35, y + 2, 5602, 5606, 5 + i * 2);
|
||||||
|
|
||||||
if (canDrop || canBuy && entry.Price > 0)
|
if (canDrop || (canBuy && entry.Price > 0))
|
||||||
{
|
{
|
||||||
AddButton(579, y + 2, 2117, 2118, 6 + i * 2);
|
AddButton(579, y + 2, 2117, 2118, 6 + i * 2);
|
||||||
AddLabel(495, y, 1152, entry.Price.ToString());
|
AddLabel(495, y, 1152, entry.Price.ToString());
|
||||||
|
|
@ -214,7 +214,7 @@ namespace Server.Engines.BulkOrders
|
||||||
if (canDrop)
|
if (canDrop)
|
||||||
AddButton(35, y + 2, 5602, 5606, 5 + i * 2);
|
AddButton(35, y + 2, 5602, 5606, 5 + i * 2);
|
||||||
|
|
||||||
if (canDrop || canBuy && smallEntry.Price > 0)
|
if (canDrop || (canBuy && smallEntry.Price > 0))
|
||||||
{
|
{
|
||||||
AddButton(579, y + 2, 2117, 2118, 6 + i * 2);
|
AddButton(579, y + 2, 2117, 2118, 6 + i * 2);
|
||||||
AddLabel(495, y, 1152, smallEntry.Price.ToString());
|
AddLabel(495, y, 1152, smallEntry.Price.ToString());
|
||||||
|
|
@ -281,22 +281,22 @@ namespace Server.Engines.BulkOrders
|
||||||
|
|
||||||
return f.Material switch
|
return f.Material switch
|
||||||
{
|
{
|
||||||
1 => (deedType == BODType.Smith),
|
1 => deedType == BODType.Smith,
|
||||||
2 => (deedType == BODType.Tailor),
|
2 => deedType == BODType.Tailor,
|
||||||
3 => (mat == BulkMaterialType.None && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Iron),
|
3 => mat == BulkMaterialType.None && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Iron,
|
||||||
4 => (mat == BulkMaterialType.DullCopper),
|
4 => mat == BulkMaterialType.DullCopper,
|
||||||
5 => (mat == BulkMaterialType.ShadowIron),
|
5 => mat == BulkMaterialType.ShadowIron,
|
||||||
6 => (mat == BulkMaterialType.Copper),
|
6 => mat == BulkMaterialType.Copper,
|
||||||
7 => (mat == BulkMaterialType.Bronze),
|
7 => mat == BulkMaterialType.Bronze,
|
||||||
8 => (mat == BulkMaterialType.Gold),
|
8 => mat == BulkMaterialType.Gold,
|
||||||
9 => (mat == BulkMaterialType.Agapite),
|
9 => mat == BulkMaterialType.Agapite,
|
||||||
10 => (mat == BulkMaterialType.Verite),
|
10 => mat == BulkMaterialType.Verite,
|
||||||
11 => (mat == BulkMaterialType.Valorite),
|
11 => mat == BulkMaterialType.Valorite,
|
||||||
12 => (mat == BulkMaterialType.None && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Cloth),
|
12 => mat == BulkMaterialType.None && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Cloth,
|
||||||
13 => (mat == BulkMaterialType.None && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Leather),
|
13 => mat == BulkMaterialType.None && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Leather,
|
||||||
14 => (mat == BulkMaterialType.Spined),
|
14 => mat == BulkMaterialType.Spined,
|
||||||
15 => (mat == BulkMaterialType.Horned),
|
15 => mat == BulkMaterialType.Horned,
|
||||||
16 => (mat == BulkMaterialType.Barbed),
|
16 => mat == BulkMaterialType.Barbed,
|
||||||
_ => true
|
_ => true
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -391,7 +391,6 @@ namespace Server.Engines.BulkOrders
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public object GetMaterialName(BulkMaterialType mat, BODType type, Type itemType)
|
public object GetMaterialName(BulkMaterialType mat, BODType type, Type itemType)
|
||||||
{
|
{
|
||||||
switch (type)
|
switch (type)
|
||||||
|
|
@ -581,10 +580,10 @@ namespace Server.Engines.BulkOrders
|
||||||
|
|
||||||
private class SetPricePrompt : Prompt
|
private class SetPricePrompt : Prompt
|
||||||
{
|
{
|
||||||
private BulkOrderBook m_Book;
|
private readonly BulkOrderBook m_Book;
|
||||||
private List<IBOBEntry> m_List;
|
private readonly List<IBOBEntry> m_List;
|
||||||
private IBOBEntry m_Entry;
|
private readonly IBOBEntry m_Entry;
|
||||||
private int m_Page;
|
private readonly int m_Page;
|
||||||
|
|
||||||
public SetPricePrompt(BulkOrderBook book, IBOBEntry entry, int page, List<IBOBEntry> list)
|
public SetPricePrompt(BulkOrderBook book, IBOBEntry entry, int page, List<IBOBEntry> list)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
namespace Server.Engines.BulkOrders
|
namespace Server.Engines.BulkOrders
|
||||||
{
|
{
|
||||||
public class BOBLargeEntry: IBOBEntry
|
public class BOBLargeEntry : IBOBEntry
|
||||||
{
|
{
|
||||||
public BOBLargeEntry(LargeBOD bod)
|
public BOBLargeEntry(LargeBOD bod)
|
||||||
{
|
{
|
||||||
|
|
@ -46,17 +46,17 @@ namespace Server.Engines.BulkOrders
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool RequireExceptional{ get; }
|
public bool RequireExceptional { get; }
|
||||||
|
|
||||||
public BODType DeedType{ get; }
|
public BODType DeedType { get; }
|
||||||
|
|
||||||
public BulkMaterialType Material{ get; }
|
public BulkMaterialType Material { get; }
|
||||||
|
|
||||||
public int AmountMax{ get; }
|
public int AmountMax { get; }
|
||||||
|
|
||||||
public int Price{ get; set; }
|
public int Price { get; set; }
|
||||||
|
|
||||||
public BOBLargeSubEntry[] Entries{ get; }
|
public BOBLargeSubEntry[] Entries { get; }
|
||||||
|
|
||||||
public Item Reconstruct()
|
public Item Reconstruct()
|
||||||
{
|
{
|
||||||
|
|
@ -79,7 +79,8 @@ namespace Server.Engines.BulkOrders
|
||||||
|
|
||||||
for (int i = 0; i < Entries.Length; ++i)
|
for (int i = 0; i < Entries.Length; ++i)
|
||||||
entries[i] = new LargeBulkEntry(null,
|
entries[i] = new LargeBulkEntry(null,
|
||||||
new SmallBulkEntry(Entries[i].ItemType, Entries[i].Number, Entries[i].Graphic)) { Amount = Entries[i].AmountCur };
|
new SmallBulkEntry(Entries[i].ItemType, Entries[i].Number, Entries[i].Graphic))
|
||||||
|
{ Amount = Entries[i].AmountCur };
|
||||||
|
|
||||||
return entries;
|
return entries;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,13 +34,13 @@ namespace Server.Engines.BulkOrders
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Type ItemType{ get; }
|
public Type ItemType { get; }
|
||||||
|
|
||||||
public int AmountCur{ get; }
|
public int AmountCur { get; }
|
||||||
|
|
||||||
public int Number{ get; }
|
public int Number { get; }
|
||||||
|
|
||||||
public int Graphic{ get; }
|
public int Graphic { get; }
|
||||||
|
|
||||||
public void Serialize(IGenericWriter writer)
|
public void Serialize(IGenericWriter writer)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -50,23 +50,23 @@ namespace Server.Engines.BulkOrders
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Type ItemType{ get; }
|
public Type ItemType { get; }
|
||||||
|
|
||||||
public bool RequireExceptional{ get; }
|
public bool RequireExceptional { get; }
|
||||||
|
|
||||||
public BODType DeedType{ get; }
|
public BODType DeedType { get; }
|
||||||
|
|
||||||
public BulkMaterialType Material{ get; }
|
public BulkMaterialType Material { get; }
|
||||||
|
|
||||||
public int AmountCur{ get; }
|
public int AmountCur { get; }
|
||||||
|
|
||||||
public int AmountMax{ get; }
|
public int AmountMax { get; }
|
||||||
|
|
||||||
public int Number{ get; }
|
public int Number { get; }
|
||||||
|
|
||||||
public int Graphic{ get; }
|
public int Graphic { get; }
|
||||||
|
|
||||||
public int Price{ get; set; }
|
public int Price { get; set; }
|
||||||
|
|
||||||
public Item Reconstruct()
|
public Item Reconstruct()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,11 @@ namespace Server.Engines.BulkOrders
|
||||||
{
|
{
|
||||||
public class BODBuyGump : Gump
|
public class BODBuyGump : Gump
|
||||||
{
|
{
|
||||||
private BulkOrderBook m_Book;
|
private readonly BulkOrderBook m_Book;
|
||||||
private PlayerMobile m_From;
|
private readonly PlayerMobile m_From;
|
||||||
private IBOBEntry m_Entry;
|
private readonly IBOBEntry m_Entry;
|
||||||
private int m_Page;
|
private readonly int m_Page;
|
||||||
private int m_Price;
|
private readonly int m_Price;
|
||||||
|
|
||||||
public BODBuyGump(PlayerMobile from, BulkOrderBook book, IBOBEntry entry, int page, int price) : base(100, 200)
|
public BODBuyGump(PlayerMobile from, BulkOrderBook book, IBOBEntry entry, int page, int price) : base(100, 200)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -12,14 +12,14 @@ namespace Server.Engines.BulkOrders
|
||||||
{
|
{
|
||||||
private string m_BookName;
|
private string m_BookName;
|
||||||
|
|
||||||
[CommandProperty( AccessLevel.GameMaster )]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public string BookName
|
public string BookName
|
||||||
{
|
{
|
||||||
get => m_BookName;
|
get => m_BookName;
|
||||||
set{ m_BookName = value; InvalidateProperties(); }
|
set { m_BookName = value; InvalidateProperties(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
[CommandProperty( AccessLevel.GameMaster )]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public SecureLevel Level { get; set; }
|
public SecureLevel Level { get; set; }
|
||||||
|
|
||||||
public List<IBOBEntry> Entries { get; private set; }
|
public List<IBOBEntry> Entries { get; private set; }
|
||||||
|
|
@ -29,7 +29,7 @@ namespace Server.Engines.BulkOrders
|
||||||
public int ItemCount { get; set; }
|
public int ItemCount { get; set; }
|
||||||
|
|
||||||
[Constructible]
|
[Constructible]
|
||||||
public BulkOrderBook() : base( 0x2259 )
|
public BulkOrderBook() : base(0x2259)
|
||||||
{
|
{
|
||||||
Weight = 1.0;
|
Weight = 1.0;
|
||||||
LootType = LootType.Blessed;
|
LootType = LootType.Blessed;
|
||||||
|
|
@ -40,89 +40,89 @@ namespace Server.Engines.BulkOrders
|
||||||
Level = SecureLevel.CoOwners;
|
Level = SecureLevel.CoOwners;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnDoubleClick( Mobile from )
|
public override void OnDoubleClick(Mobile from)
|
||||||
{
|
{
|
||||||
if ( !from.InRange( GetWorldLocation(), 2 ) )
|
if (!from.InRange(GetWorldLocation(), 2))
|
||||||
from.LocalOverheadMessage( Network.MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
|
from.LocalOverheadMessage(Network.MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
|
||||||
else if ( Entries.Count == 0 )
|
else if (Entries.Count == 0)
|
||||||
from.SendLocalizedMessage( 1062381 ); // The book is empty.
|
from.SendLocalizedMessage(1062381); // The book is empty.
|
||||||
else if ( from is PlayerMobile mobile )
|
else if (from is PlayerMobile mobile)
|
||||||
mobile.SendGump( new BOBGump( mobile, this ) );
|
mobile.SendGump(new BOBGump(mobile, this));
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnDoubleClickSecureTrade( Mobile from )
|
public override void OnDoubleClickSecureTrade(Mobile from)
|
||||||
{
|
{
|
||||||
if ( !from.InRange( GetWorldLocation(), 2 ) )
|
if (!from.InRange(GetWorldLocation(), 2))
|
||||||
{
|
{
|
||||||
from.SendLocalizedMessage( 500446 ); // That is too far away.
|
from.SendLocalizedMessage(500446); // That is too far away.
|
||||||
}
|
}
|
||||||
else if ( Entries.Count == 0 )
|
else if (Entries.Count == 0)
|
||||||
{
|
{
|
||||||
from.SendLocalizedMessage( 1062381 ); // The book is empty.
|
from.SendLocalizedMessage(1062381); // The book is empty.
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
from.SendGump( new BOBGump( (PlayerMobile)from, this ) );
|
from.SendGump(new BOBGump((PlayerMobile)from, this));
|
||||||
|
|
||||||
SecureTrade trade = GetSecureTradeCont()?.Trade;
|
SecureTrade trade = GetSecureTradeCont()?.Trade;
|
||||||
|
|
||||||
if (trade?.From.Mobile == from )
|
if (trade?.From.Mobile == from)
|
||||||
trade.To.Mobile.SendGump( new BOBGump( (PlayerMobile)trade.To.Mobile, this ) );
|
trade.To.Mobile.SendGump(new BOBGump((PlayerMobile)trade.To.Mobile, this));
|
||||||
else if (trade?.To.Mobile == from )
|
else if (trade?.To.Mobile == from)
|
||||||
trade.From.Mobile.SendGump( new BOBGump( (PlayerMobile)trade.From.Mobile, this ) );
|
trade.From.Mobile.SendGump(new BOBGump((PlayerMobile)trade.From.Mobile, this));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool OnDragDrop( Mobile from, Item dropped )
|
public override bool OnDragDrop(Mobile from, Item dropped)
|
||||||
{
|
{
|
||||||
if ( dropped is BaseBOD )
|
if (dropped is BaseBOD)
|
||||||
{
|
{
|
||||||
if ( !IsChildOf( from.Backpack ) )
|
if (!IsChildOf(from.Backpack))
|
||||||
{
|
{
|
||||||
from.SendLocalizedMessage( 1062385 ); // You must have the book in your backpack to add deeds to it.
|
from.SendLocalizedMessage(1062385); // You must have the book in your backpack to add deeds to it.
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ( !from.Backpack.CheckHold( from, dropped, true, true ) )
|
if (!from.Backpack.CheckHold(from, dropped, true, true))
|
||||||
return false;
|
return false;
|
||||||
if ( Entries.Count < 500 )
|
if (Entries.Count < 500)
|
||||||
{
|
{
|
||||||
if ( dropped is LargeBOD bod )
|
if (dropped is LargeBOD bod)
|
||||||
Entries.Add( new BOBLargeEntry( bod ) );
|
Entries.Add(new BOBLargeEntry(bod));
|
||||||
else
|
else
|
||||||
Entries.Add( new BOBSmallEntry( (SmallBOD)dropped ) );
|
Entries.Add(new BOBSmallEntry((SmallBOD)dropped));
|
||||||
|
|
||||||
InvalidateProperties();
|
InvalidateProperties();
|
||||||
|
|
||||||
if ( Entries.Count / 5 > ItemCount )
|
if (Entries.Count / 5 > ItemCount)
|
||||||
{
|
{
|
||||||
ItemCount++;
|
ItemCount++;
|
||||||
InvalidateItems();
|
InvalidateItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
from.SendSound(0x42, GetWorldLocation());
|
from.SendSound(0x42, GetWorldLocation());
|
||||||
from.SendLocalizedMessage( 1062386 ); // Deed added to book.
|
from.SendLocalizedMessage(1062386); // Deed added to book.
|
||||||
|
|
||||||
if ( from is PlayerMobile pm )
|
if (from is PlayerMobile pm)
|
||||||
pm.SendGump( new BOBGump( pm, this ) );
|
pm.SendGump(new BOBGump(pm, this));
|
||||||
|
|
||||||
dropped.Delete();
|
dropped.Delete();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
from.SendLocalizedMessage( 1062387 ); // The book is full of deeds.
|
from.SendLocalizedMessage(1062387); // The book is full of deeds.
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
from.SendLocalizedMessage( 1062388 ); // That is not a bulk order deed.
|
from.SendLocalizedMessage(1062388); // That is not a bulk order deed.
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override int GetTotal( TotalType type )
|
public override int GetTotal(TotalType type)
|
||||||
{
|
{
|
||||||
int total = base.GetTotal( type );
|
int total = base.GetTotal(type);
|
||||||
|
|
||||||
if ( type == TotalType.Items )
|
if (type == TotalType.Items)
|
||||||
total = ItemCount;
|
total = ItemCount;
|
||||||
|
|
||||||
return total;
|
return total;
|
||||||
|
|
@ -130,66 +130,66 @@ namespace Server.Engines.BulkOrders
|
||||||
|
|
||||||
public void InvalidateItems()
|
public void InvalidateItems()
|
||||||
{
|
{
|
||||||
if ( RootParent is Mobile m )
|
if (RootParent is Mobile m)
|
||||||
{
|
{
|
||||||
m.UpdateTotals();
|
m.UpdateTotals();
|
||||||
InvalidateContainers( Parent );
|
InvalidateContainers(Parent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void InvalidateContainers(IEntity parent)
|
public void InvalidateContainers(IEntity parent)
|
||||||
{
|
{
|
||||||
if ( parent is Container c )
|
if (parent is Container c)
|
||||||
{
|
{
|
||||||
c.InvalidateProperties();
|
c.InvalidateProperties();
|
||||||
InvalidateContainers( c.Parent );
|
InvalidateContainers(c.Parent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public BulkOrderBook( Serial serial ) : base( serial )
|
public BulkOrderBook(Serial serial) : base(serial)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer )
|
public override void Serialize(IGenericWriter writer)
|
||||||
{
|
{
|
||||||
base.Serialize( writer );
|
base.Serialize(writer);
|
||||||
|
|
||||||
writer.Write( 2 ); // version
|
writer.Write(2); // version
|
||||||
|
|
||||||
writer.Write( ItemCount );
|
writer.Write(ItemCount);
|
||||||
|
|
||||||
writer.Write( (int) Level );
|
writer.Write((int)Level);
|
||||||
|
|
||||||
writer.Write( m_BookName );
|
writer.Write(m_BookName);
|
||||||
|
|
||||||
Filter.Serialize( writer );
|
Filter.Serialize(writer);
|
||||||
|
|
||||||
writer.WriteEncodedInt( Entries.Count );
|
writer.WriteEncodedInt(Entries.Count);
|
||||||
|
|
||||||
for ( int i = 0; i < Entries.Count; ++i )
|
for (int i = 0; i < Entries.Count; ++i)
|
||||||
{
|
{
|
||||||
object obj = Entries[i];
|
object obj = Entries[i];
|
||||||
|
|
||||||
if ( obj is BOBLargeEntry entry )
|
if (obj is BOBLargeEntry entry)
|
||||||
{
|
{
|
||||||
writer.WriteEncodedInt( 0 );
|
writer.WriteEncodedInt(0);
|
||||||
entry.Serialize( writer );
|
entry.Serialize(writer);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
writer.WriteEncodedInt( 1 );
|
writer.WriteEncodedInt(1);
|
||||||
((BOBSmallEntry)obj).Serialize( writer );
|
((BOBSmallEntry)obj).Serialize(writer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Deserialize( IGenericReader reader )
|
public override void Deserialize(IGenericReader reader)
|
||||||
{
|
{
|
||||||
base.Deserialize( reader );
|
base.Deserialize(reader);
|
||||||
|
|
||||||
int version = reader.ReadInt();
|
int version = reader.ReadInt();
|
||||||
|
|
||||||
switch ( version )
|
switch (version)
|
||||||
{
|
{
|
||||||
case 2:
|
case 2:
|
||||||
{
|
{
|
||||||
|
|
@ -205,20 +205,20 @@ namespace Server.Engines.BulkOrders
|
||||||
{
|
{
|
||||||
m_BookName = reader.ReadString();
|
m_BookName = reader.ReadString();
|
||||||
|
|
||||||
Filter = new BOBFilter( reader );
|
Filter = new BOBFilter(reader);
|
||||||
|
|
||||||
int count = reader.ReadEncodedInt();
|
int count = reader.ReadEncodedInt();
|
||||||
|
|
||||||
Entries = new List<IBOBEntry>( count );
|
Entries = new List<IBOBEntry>(count);
|
||||||
|
|
||||||
for ( int i = 0; i < count; ++i )
|
for (int i = 0; i < count; ++i)
|
||||||
{
|
{
|
||||||
int v = reader.ReadEncodedInt();
|
int v = reader.ReadEncodedInt();
|
||||||
|
|
||||||
switch ( v )
|
switch (v)
|
||||||
{
|
{
|
||||||
case 0: Entries.Add( new BOBLargeEntry( reader ) ); break;
|
case 0: Entries.Add(new BOBLargeEntry(reader)); break;
|
||||||
case 1: Entries.Add( new BOBSmallEntry( reader ) ); break;
|
case 1: Entries.Add(new BOBSmallEntry(reader)); break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -227,14 +227,14 @@ namespace Server.Engines.BulkOrders
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void GetProperties( ObjectPropertyList list )
|
public override void GetProperties(ObjectPropertyList list)
|
||||||
{
|
{
|
||||||
base.GetProperties( list );
|
base.GetProperties(list);
|
||||||
|
|
||||||
list.Add( 1062344, Entries.Count.ToString() ); // Deeds in book: ~1_val~
|
list.Add(1062344, Entries.Count.ToString()); // Deeds in book: ~1_val~
|
||||||
|
|
||||||
if ( !string.IsNullOrEmpty(m_BookName) )
|
if (!string.IsNullOrEmpty(m_BookName))
|
||||||
list.Add( 1062481, m_BookName ); // Book Name: ~1_val~
|
list.Add(1062481, m_BookName); // Book Name: ~1_val~
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnSingleClick(Mobile from)
|
public override void OnSingleClick(Mobile from)
|
||||||
|
|
@ -247,22 +247,22 @@ namespace Server.Engines.BulkOrders
|
||||||
LabelTo(from, 1062481, m_BookName);
|
LabelTo(from, 1062481, m_BookName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void GetContextMenuEntries( Mobile from, List<ContextMenuEntry> list )
|
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||||
{
|
{
|
||||||
base.GetContextMenuEntries( from, list );
|
base.GetContextMenuEntries(from, list);
|
||||||
|
|
||||||
if ( from.CheckAlive() && IsChildOf( from.Backpack ) )
|
if (from.CheckAlive() && IsChildOf(from.Backpack))
|
||||||
list.Add( new NameBookEntry( from, this ) );
|
list.Add(new NameBookEntry(from, this));
|
||||||
|
|
||||||
SetSecureLevelEntry.AddTo( from, this, list );
|
SetSecureLevelEntry.AddTo(from, this, list);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class NameBookEntry : ContextMenuEntry
|
private class NameBookEntry : ContextMenuEntry
|
||||||
{
|
{
|
||||||
private Mobile m_From;
|
private readonly Mobile m_From;
|
||||||
private BulkOrderBook m_Book;
|
private readonly BulkOrderBook m_Book;
|
||||||
|
|
||||||
public NameBookEntry( Mobile from, BulkOrderBook book ) : base( 6216 )
|
public NameBookEntry(Mobile from, BulkOrderBook book) : base(6216)
|
||||||
{
|
{
|
||||||
m_From = from;
|
m_From = from;
|
||||||
m_Book = book;
|
m_Book = book;
|
||||||
|
|
@ -270,34 +270,34 @@ namespace Server.Engines.BulkOrders
|
||||||
|
|
||||||
public override void OnClick()
|
public override void OnClick()
|
||||||
{
|
{
|
||||||
if ( m_From.CheckAlive() && m_Book.IsChildOf( m_From.Backpack ) )
|
if (m_From.CheckAlive() && m_Book.IsChildOf(m_From.Backpack))
|
||||||
{
|
{
|
||||||
m_From.Prompt = new NameBookPrompt( m_Book );
|
m_From.Prompt = new NameBookPrompt(m_Book);
|
||||||
m_From.SendLocalizedMessage( 1062479 ); // Type in the new name of the book:
|
m_From.SendLocalizedMessage(1062479); // Type in the new name of the book:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class NameBookPrompt : Prompt
|
private class NameBookPrompt : Prompt
|
||||||
{
|
{
|
||||||
private BulkOrderBook m_Book;
|
private readonly BulkOrderBook m_Book;
|
||||||
|
|
||||||
public NameBookPrompt( BulkOrderBook book ) => m_Book = book;
|
public NameBookPrompt(BulkOrderBook book) => m_Book = book;
|
||||||
|
|
||||||
public override void OnResponse( Mobile from, string text )
|
public override void OnResponse(Mobile from, string text)
|
||||||
{
|
{
|
||||||
if ( text.Length > 40 )
|
if (text.Length > 40)
|
||||||
text = text.Substring( 0, 40 );
|
text = text.Substring(0, 40);
|
||||||
|
|
||||||
if ( from.CheckAlive() && m_Book.IsChildOf( from.Backpack ) )
|
if (from.CheckAlive() && m_Book.IsChildOf(from.Backpack))
|
||||||
{
|
{
|
||||||
m_Book.BookName = Utility.FixHtml( text.Trim() );
|
m_Book.BookName = Utility.FixHtml(text.Trim());
|
||||||
|
|
||||||
from.SendLocalizedMessage( 1062480 ); // The bulk order book's name has been changed.
|
from.SendLocalizedMessage(1062480); // The bulk order book's name has been changed.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnCancel( Mobile from )
|
public override void OnCancel(Mobile from)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,11 @@ namespace Server.Engines.BulkOrders
|
||||||
{
|
{
|
||||||
public interface IBOBEntry
|
public interface IBOBEntry
|
||||||
{
|
{
|
||||||
bool RequireExceptional{ get; }
|
bool RequireExceptional { get; }
|
||||||
BODType DeedType{ get; }
|
BODType DeedType { get; }
|
||||||
BulkMaterialType Material{ get; }
|
BulkMaterialType Material { get; }
|
||||||
int AmountMax{ get; }
|
int AmountMax { get; }
|
||||||
int Price{ get; set; }
|
int Price { get; set; }
|
||||||
Item Reconstruct();
|
Item Reconstruct();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -9,16 +9,16 @@ namespace Server.Engines.BulkOrders
|
||||||
public LargeBulkEntry[] Entries
|
public LargeBulkEntry[] Entries
|
||||||
{
|
{
|
||||||
get => m_Entries;
|
get => m_Entries;
|
||||||
set{ m_Entries = value; InvalidateProperties(); }
|
set { m_Entries = value; InvalidateProperties(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
[CommandProperty( AccessLevel.GameMaster )]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public override bool Complete
|
public override bool Complete
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
for ( int i = 0; i < m_Entries.Length; ++i )
|
for (int i = 0; i < m_Entries.Length; ++i)
|
||||||
if ( m_Entries[i].Amount < AmountMax )
|
if (m_Entries[i].Amount < AmountMax)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -27,48 +27,47 @@ namespace Server.Engines.BulkOrders
|
||||||
|
|
||||||
public override int LabelNumber => 1045151; // a bulk order deed
|
public override int LabelNumber => 1045151; // a bulk order deed
|
||||||
|
|
||||||
public LargeBOD(int hue, int amountMax, bool requireExeptional, BulkMaterialType material, LargeBulkEntry[] entries) :
|
public LargeBOD(int hue, int amountMax, bool requireExeptional, BulkMaterialType material, LargeBulkEntry[] entries) : base(hue, amountMax, requireExeptional, material) =>
|
||||||
base(hue, amountMax, requireExeptional, material) =>
|
|
||||||
m_Entries = entries;
|
m_Entries = entries;
|
||||||
|
|
||||||
public LargeBOD()
|
public LargeBOD()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void GetProperties( ObjectPropertyList list )
|
public override void GetProperties(ObjectPropertyList list)
|
||||||
{
|
{
|
||||||
base.GetProperties( list );
|
base.GetProperties(list);
|
||||||
|
|
||||||
list.Add( 1060655 ); // large bulk order
|
list.Add(1060655); // large bulk order
|
||||||
|
|
||||||
if ( RequireExceptional )
|
if (RequireExceptional)
|
||||||
list.Add( 1045141 ); // All items must be exceptional.
|
list.Add(1045141); // All items must be exceptional.
|
||||||
|
|
||||||
if ( Material != BulkMaterialType.None )
|
if (Material != BulkMaterialType.None)
|
||||||
list.Add( LargeBODGump.GetMaterialNumberFor( Material ) ); // All items must be made with x material.
|
list.Add(LargeBODGump.GetMaterialNumberFor(Material)); // All items must be made with x material.
|
||||||
|
|
||||||
list.Add( 1060656, AmountMax.ToString() ); // amount to make: ~1_val~
|
list.Add(1060656, AmountMax.ToString()); // amount to make: ~1_val~
|
||||||
|
|
||||||
for ( int i = 0; i < m_Entries.Length; ++i )
|
for (int i = 0; i < m_Entries.Length; ++i)
|
||||||
list.Add( 1060658 + i, "#{0}\t{1}", m_Entries[i].Details.Number, m_Entries[i].Amount ); // ~1_val~: ~2_val~
|
list.Add(1060658 + i, "#{0}\t{1}", m_Entries[i].Details.Number, m_Entries[i].Amount); // ~1_val~: ~2_val~
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnDoubleClickNotAccessible( Mobile from )
|
public override void OnDoubleClickNotAccessible(Mobile from)
|
||||||
{
|
{
|
||||||
OnDoubleClick( from );
|
OnDoubleClick(from);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnDoubleClickSecureTrade( Mobile from )
|
public override void OnDoubleClickSecureTrade(Mobile from)
|
||||||
{
|
{
|
||||||
OnDoubleClick( from );
|
OnDoubleClick(from);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnDoubleClick( Mobile from )
|
public override void OnDoubleClick(Mobile from)
|
||||||
{
|
{
|
||||||
if ( IsChildOf( from.Backpack ) || InSecureTrade || RootParent is PlayerVendor )
|
if (IsChildOf(from.Backpack) || InSecureTrade || RootParent is PlayerVendor)
|
||||||
from.SendGump( new LargeBODGump( from, this ) );
|
from.SendGump(new LargeBODGump(from, this));
|
||||||
else
|
else
|
||||||
from.SendLocalizedMessage( 1045156 ); // You must have the deed in your backpack to use it.
|
from.SendLocalizedMessage(1045156); // You must have the deed in your backpack to use it.
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void EndCombine(Mobile from, Item item)
|
public override void EndCombine(Mobile from, Item item)
|
||||||
|
|
@ -136,32 +135,32 @@ namespace Server.Engines.BulkOrders
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer )
|
public override void Serialize(IGenericWriter writer)
|
||||||
{
|
{
|
||||||
base.Serialize( writer );
|
base.Serialize(writer);
|
||||||
|
|
||||||
writer.WriteEncodedInt( 0 ); // version
|
writer.WriteEncodedInt(0); // version
|
||||||
|
|
||||||
writer.Write( m_Entries.Length );
|
writer.Write(m_Entries.Length);
|
||||||
|
|
||||||
for ( int i = 0; i < m_Entries.Length; ++i )
|
for (int i = 0; i < m_Entries.Length; ++i)
|
||||||
m_Entries[i].Serialize( writer );
|
m_Entries[i].Serialize(writer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Deserialize( IGenericReader reader )
|
public override void Deserialize(IGenericReader reader)
|
||||||
{
|
{
|
||||||
base.Deserialize( reader );
|
base.Deserialize(reader);
|
||||||
|
|
||||||
int version = reader.ReadEncodedInt();
|
int version = reader.ReadEncodedInt();
|
||||||
|
|
||||||
switch ( version )
|
switch (version)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
{
|
{
|
||||||
m_Entries = new LargeBulkEntry[reader.ReadInt()];
|
m_Entries = new LargeBulkEntry[reader.ReadInt()];
|
||||||
|
|
||||||
for ( int i = 0; i < m_Entries.Length; ++i )
|
for (int i = 0; i < m_Entries.Length; ++i)
|
||||||
m_Entries[i] = new LargeBulkEntry( this, reader );
|
m_Entries[i] = new LargeBulkEntry(this, reader);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@ namespace Server.Engines.BulkOrders
|
||||||
{
|
{
|
||||||
public class LargeBODAcceptGump : Gump
|
public class LargeBODAcceptGump : Gump
|
||||||
{
|
{
|
||||||
private LargeBOD m_Deed;
|
private readonly LargeBOD m_Deed;
|
||||||
private Mobile m_From;
|
private readonly Mobile m_From;
|
||||||
|
|
||||||
public LargeBODAcceptGump(Mobile from, LargeBOD deed) : base(50, 50)
|
public LargeBODAcceptGump(Mobile from, LargeBOD deed) : base(50, 50)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@ namespace Server.Engines.BulkOrders
|
||||||
{
|
{
|
||||||
public class LargeBODGump : Gump
|
public class LargeBODGump : Gump
|
||||||
{
|
{
|
||||||
private LargeBOD m_Deed;
|
private readonly LargeBOD m_Deed;
|
||||||
private Mobile m_From;
|
private readonly Mobile m_From;
|
||||||
|
|
||||||
public LargeBODGump(Mobile from, LargeBOD deed) : base(25, 25)
|
public LargeBODGump(Mobile from, LargeBOD deed) : base(25, 25)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -12,88 +12,86 @@ namespace Server.Engines.BulkOrders
|
||||||
public int Amount
|
public int Amount
|
||||||
{
|
{
|
||||||
get => m_Amount;
|
get => m_Amount;
|
||||||
set{ m_Amount = value; Owner?.InvalidateProperties(); }
|
set { m_Amount = value; Owner?.InvalidateProperties(); }
|
||||||
}
|
}
|
||||||
public SmallBulkEntry Details { get; }
|
public SmallBulkEntry Details { get; }
|
||||||
|
|
||||||
public static SmallBulkEntry[] LargeRing => GetEntries( "Blacksmith", "largering" );
|
public static SmallBulkEntry[] LargeRing => GetEntries("Blacksmith", "largering");
|
||||||
|
|
||||||
public static SmallBulkEntry[] LargePlate => GetEntries( "Blacksmith", "largeplate" );
|
public static SmallBulkEntry[] LargePlate => GetEntries("Blacksmith", "largeplate");
|
||||||
|
|
||||||
public static SmallBulkEntry[] LargeChain => GetEntries( "Blacksmith", "largechain" );
|
public static SmallBulkEntry[] LargeChain => GetEntries("Blacksmith", "largechain");
|
||||||
|
|
||||||
public static SmallBulkEntry[] LargeAxes => GetEntries( "Blacksmith", "largeaxes" );
|
public static SmallBulkEntry[] LargeAxes => GetEntries("Blacksmith", "largeaxes");
|
||||||
|
|
||||||
public static SmallBulkEntry[] LargeFencing => GetEntries( "Blacksmith", "largefencing" );
|
public static SmallBulkEntry[] LargeFencing => GetEntries("Blacksmith", "largefencing");
|
||||||
|
|
||||||
public static SmallBulkEntry[] LargeMaces => GetEntries( "Blacksmith", "largemaces" );
|
public static SmallBulkEntry[] LargeMaces => GetEntries("Blacksmith", "largemaces");
|
||||||
|
|
||||||
public static SmallBulkEntry[] LargePolearms => GetEntries( "Blacksmith", "largepolearms" );
|
public static SmallBulkEntry[] LargePolearms => GetEntries("Blacksmith", "largepolearms");
|
||||||
|
|
||||||
public static SmallBulkEntry[] LargeSwords => GetEntries( "Blacksmith", "largeswords" );
|
public static SmallBulkEntry[] LargeSwords => GetEntries("Blacksmith", "largeswords");
|
||||||
|
|
||||||
|
public static SmallBulkEntry[] BoneSet => GetEntries("Tailoring", "boneset");
|
||||||
|
|
||||||
public static SmallBulkEntry[] BoneSet => GetEntries( "Tailoring", "boneset" );
|
public static SmallBulkEntry[] Farmer => GetEntries("Tailoring", "farmer");
|
||||||
|
|
||||||
public static SmallBulkEntry[] Farmer => GetEntries( "Tailoring", "farmer" );
|
public static SmallBulkEntry[] FemaleLeatherSet => GetEntries("Tailoring", "femaleleatherset");
|
||||||
|
|
||||||
public static SmallBulkEntry[] FemaleLeatherSet => GetEntries( "Tailoring", "femaleleatherset" );
|
public static SmallBulkEntry[] FisherGirl => GetEntries("Tailoring", "fishergirl");
|
||||||
|
|
||||||
public static SmallBulkEntry[] FisherGirl => GetEntries( "Tailoring", "fishergirl" );
|
public static SmallBulkEntry[] Gypsy => GetEntries("Tailoring", "gypsy");
|
||||||
|
|
||||||
public static SmallBulkEntry[] Gypsy => GetEntries( "Tailoring", "gypsy" );
|
public static SmallBulkEntry[] HatSet => GetEntries("Tailoring", "hatset");
|
||||||
|
|
||||||
public static SmallBulkEntry[] HatSet => GetEntries( "Tailoring", "hatset" );
|
public static SmallBulkEntry[] Jester => GetEntries("Tailoring", "jester");
|
||||||
|
|
||||||
public static SmallBulkEntry[] Jester => GetEntries( "Tailoring", "jester" );
|
public static SmallBulkEntry[] Lady => GetEntries("Tailoring", "lady");
|
||||||
|
|
||||||
public static SmallBulkEntry[] Lady => GetEntries( "Tailoring", "lady" );
|
public static SmallBulkEntry[] MaleLeatherSet => GetEntries("Tailoring", "maleleatherset");
|
||||||
|
|
||||||
public static SmallBulkEntry[] MaleLeatherSet => GetEntries( "Tailoring", "maleleatherset" );
|
public static SmallBulkEntry[] Pirate => GetEntries("Tailoring", "pirate");
|
||||||
|
|
||||||
public static SmallBulkEntry[] Pirate => GetEntries( "Tailoring", "pirate" );
|
public static SmallBulkEntry[] ShoeSet => GetEntries("Tailoring", "shoeset");
|
||||||
|
|
||||||
public static SmallBulkEntry[] ShoeSet => GetEntries( "Tailoring", "shoeset" );
|
public static SmallBulkEntry[] StuddedSet => GetEntries("Tailoring", "studdedset");
|
||||||
|
|
||||||
public static SmallBulkEntry[] StuddedSet => GetEntries( "Tailoring", "studdedset" );
|
public static SmallBulkEntry[] TownCrier => GetEntries("Tailoring", "towncrier");
|
||||||
|
|
||||||
public static SmallBulkEntry[] TownCrier => GetEntries( "Tailoring", "towncrier" );
|
public static SmallBulkEntry[] Wizard => GetEntries("Tailoring", "wizard");
|
||||||
|
|
||||||
public static SmallBulkEntry[] Wizard => GetEntries( "Tailoring", "wizard" );
|
private static Dictionary<string, Dictionary<string, SmallBulkEntry[]>> m_Cache;
|
||||||
|
|
||||||
|
public static SmallBulkEntry[] GetEntries(string type, string name)
|
||||||
private static Dictionary<string,Dictionary<string,SmallBulkEntry[]>> m_Cache;
|
|
||||||
|
|
||||||
public static SmallBulkEntry[] GetEntries( string type, string name )
|
|
||||||
{
|
{
|
||||||
m_Cache ??= new Dictionary<string, Dictionary<string, SmallBulkEntry[]>>();
|
m_Cache ??= new Dictionary<string, Dictionary<string, SmallBulkEntry[]>>();
|
||||||
|
|
||||||
if (!m_Cache.TryGetValue( type, out Dictionary<string, SmallBulkEntry[]> table ))
|
if (!m_Cache.TryGetValue(type, out Dictionary<string, SmallBulkEntry[]> table))
|
||||||
m_Cache[type] = table = new Dictionary<string, SmallBulkEntry[]>();
|
m_Cache[type] = table = new Dictionary<string, SmallBulkEntry[]>();
|
||||||
|
|
||||||
if (!table.TryGetValue( name, out SmallBulkEntry[] entries ))
|
if (!table.TryGetValue(name, out SmallBulkEntry[] entries))
|
||||||
table[name] = entries = SmallBulkEntry.LoadEntries(type, name);
|
table[name] = entries = SmallBulkEntry.LoadEntries(type, name);
|
||||||
|
|
||||||
return entries;
|
return entries;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static LargeBulkEntry[] ConvertEntries( LargeBOD owner, SmallBulkEntry[] small )
|
public static LargeBulkEntry[] ConvertEntries(LargeBOD owner, SmallBulkEntry[] small)
|
||||||
{
|
{
|
||||||
LargeBulkEntry[] large = new LargeBulkEntry[small.Length];
|
LargeBulkEntry[] large = new LargeBulkEntry[small.Length];
|
||||||
|
|
||||||
for ( int i = 0; i < small.Length; ++i )
|
for (int i = 0; i < small.Length; ++i)
|
||||||
large[i] = new LargeBulkEntry( owner, small[i] );
|
large[i] = new LargeBulkEntry(owner, small[i]);
|
||||||
|
|
||||||
return large;
|
return large;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LargeBulkEntry( LargeBOD owner, SmallBulkEntry details )
|
public LargeBulkEntry(LargeBOD owner, SmallBulkEntry details)
|
||||||
{
|
{
|
||||||
Owner = owner;
|
Owner = owner;
|
||||||
Details = details;
|
Details = details;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LargeBulkEntry( LargeBOD owner, IGenericReader reader )
|
public LargeBulkEntry(LargeBOD owner, IGenericReader reader)
|
||||||
{
|
{
|
||||||
Owner = owner;
|
Owner = owner;
|
||||||
m_Amount = reader.ReadInt();
|
m_Amount = reader.ReadInt();
|
||||||
|
|
@ -102,18 +100,18 @@ namespace Server.Engines.BulkOrders
|
||||||
|
|
||||||
string type = reader.ReadString();
|
string type = reader.ReadString();
|
||||||
|
|
||||||
if ( type != null )
|
if (type != null)
|
||||||
realType = AssemblyHandler.FindFirstTypeForName( type );
|
realType = AssemblyHandler.FindFirstTypeForName(type);
|
||||||
|
|
||||||
Details = new SmallBulkEntry( realType, reader.ReadInt(), reader.ReadInt() );
|
Details = new SmallBulkEntry(realType, reader.ReadInt(), reader.ReadInt());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Serialize(IGenericWriter writer )
|
public void Serialize(IGenericWriter writer)
|
||||||
{
|
{
|
||||||
writer.Write( m_Amount );
|
writer.Write(m_Amount);
|
||||||
writer.Write( Details.Type?.FullName );
|
writer.Write(Details.Type?.FullName);
|
||||||
writer.Write( Details.Number );
|
writer.Write(Details.Number);
|
||||||
writer.Write( Details.Graphic );
|
writer.Write(Details.Graphic);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ namespace Server.Engines.BulkOrders
|
||||||
|
|
||||||
int hue = 0x44E;
|
int hue = 0x44E;
|
||||||
int amountMax = Utility.RandomList(10, 15, 20, 20);
|
int amountMax = Utility.RandomList(10, 15, 20, 20);
|
||||||
bool reqExceptional = 0.825 > Utility.RandomDouble();
|
bool reqExceptional = Utility.RandomDouble() < 0.825;
|
||||||
|
|
||||||
BulkMaterialType material = useMaterials ? GetRandomMaterial(BulkMaterialType.DullCopper, m_BlacksmithMaterialChances)
|
BulkMaterialType material = useMaterials ? GetRandomMaterial(BulkMaterialType.DullCopper, m_BlacksmithMaterialChances)
|
||||||
: BulkMaterialType.None;
|
: BulkMaterialType.None;
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ namespace Server.Engines.BulkOrders
|
||||||
|
|
||||||
int hue = 0x483;
|
int hue = 0x483;
|
||||||
int amountMax = Utility.RandomList(10, 15, 20, 20);
|
int amountMax = Utility.RandomList(10, 15, 20, 20);
|
||||||
bool reqExceptional = 0.825 > Utility.RandomDouble();
|
bool reqExceptional = Utility.RandomDouble() < 0.825;
|
||||||
|
|
||||||
BulkMaterialType material = useMaterials ? GetRandomMaterial(BulkMaterialType.Spined, m_TailoringMaterialChances)
|
BulkMaterialType material = useMaterials ? GetRandomMaterial(BulkMaterialType.Spined, m_TailoringMaterialChances)
|
||||||
: BulkMaterialType.None;
|
: BulkMaterialType.None;
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,9 @@ namespace Server.Engines.BulkOrders
|
||||||
Types = types;
|
Types = types;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Points{ get; }
|
public int Points { get; }
|
||||||
|
|
||||||
public Type[] Types{ get; }
|
public Type[] Types { get; }
|
||||||
|
|
||||||
public bool Contains(Type type)
|
public bool Contains(Type type)
|
||||||
{
|
{
|
||||||
|
|
@ -36,11 +36,11 @@ namespace Server.Engines.BulkOrders
|
||||||
Type = type;
|
Type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Weight{ get; }
|
public int Weight { get; }
|
||||||
|
|
||||||
public ConstructCallback Constructor{ get; }
|
public ConstructCallback Constructor { get; }
|
||||||
|
|
||||||
public int Type{ get; }
|
public int Type { get; }
|
||||||
|
|
||||||
public Item Construct()
|
public Item Construct()
|
||||||
{
|
{
|
||||||
|
|
@ -63,9 +63,9 @@ namespace Server.Engines.BulkOrders
|
||||||
Items = items;
|
Items = items;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Points{ get; }
|
public int Points { get; }
|
||||||
|
|
||||||
public RewardItem[] Items{ get; }
|
public RewardItem[] Items { get; }
|
||||||
|
|
||||||
public RewardItem AcquireItem()
|
public RewardItem AcquireItem()
|
||||||
{
|
{
|
||||||
|
|
@ -97,7 +97,7 @@ namespace Server.Engines.BulkOrders
|
||||||
|
|
||||||
public abstract class RewardCalculator
|
public abstract class RewardCalculator
|
||||||
{
|
{
|
||||||
public RewardGroup[] Groups{ get; set; }
|
public RewardGroup[] Groups { get; set; }
|
||||||
|
|
||||||
public abstract int ComputePoints(int quantity, bool exceptional, BulkMaterialType material, int itemCount,
|
public abstract int ComputePoints(int quantity, bool exceptional, BulkMaterialType material, int itemCount,
|
||||||
Type type);
|
Type type);
|
||||||
|
|
@ -165,7 +165,7 @@ namespace Server.Engines.BulkOrders
|
||||||
private static readonly ConstructCallback AncientHammer = CreateAncientHammer;
|
private static readonly ConstructCallback AncientHammer = CreateAncientHammer;
|
||||||
public static readonly SmithRewardCalculator Instance = new SmithRewardCalculator();
|
public static readonly SmithRewardCalculator Instance = new SmithRewardCalculator();
|
||||||
|
|
||||||
private static int[][][] m_GoldTable =
|
private static readonly int[][][] m_GoldTable =
|
||||||
{
|
{
|
||||||
new[] // 1-part (regular)
|
new[] // 1-part (regular)
|
||||||
{
|
{
|
||||||
|
|
@ -253,7 +253,7 @@ namespace Server.Engines.BulkOrders
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private RewardType[] m_Types =
|
private readonly RewardType[] m_Types =
|
||||||
{
|
{
|
||||||
// Armors
|
// Armors
|
||||||
new RewardType(200, typeof(RingmailGloves), typeof(RingmailChest), typeof(RingmailArms), typeof(RingmailLegs)),
|
new RewardType(200, typeof(RingmailGloves), typeof(RingmailChest), typeof(RingmailArms), typeof(RingmailLegs)),
|
||||||
|
|
@ -264,7 +264,7 @@ namespace Server.Engines.BulkOrders
|
||||||
// Weapons
|
// Weapons
|
||||||
new RewardType(200, typeof(Bardiche), typeof(Halberd)),
|
new RewardType(200, typeof(Bardiche), typeof(Halberd)),
|
||||||
new RewardType(300, typeof(Dagger), typeof(ShortSpear), typeof(Spear), typeof(WarFork),
|
new RewardType(300, typeof(Dagger), typeof(ShortSpear), typeof(Spear), typeof(WarFork),
|
||||||
typeof(Kryss)), //OSI put the dagger in there. Odd, ain't it.
|
typeof(Kryss)), // OSI put the dagger in there. Odd, ain't it.
|
||||||
new RewardType(350, typeof(Axe), typeof(BattleAxe), typeof(DoubleAxe), typeof(ExecutionersAxe),
|
new RewardType(350, typeof(Axe), typeof(BattleAxe), typeof(DoubleAxe), typeof(ExecutionersAxe),
|
||||||
typeof(LargeBattleAxe), typeof(TwoHandedAxe)),
|
typeof(LargeBattleAxe), typeof(TwoHandedAxe)),
|
||||||
new RewardType(350, typeof(Broadsword), typeof(Cutlass), typeof(Katana), typeof(Longsword),
|
new RewardType(350, typeof(Broadsword), typeof(Cutlass), typeof(Katana), typeof(Longsword),
|
||||||
|
|
@ -379,8 +379,6 @@ namespace Server.Engines.BulkOrders
|
||||||
return Utility.RandomMinMax(min, max);
|
return Utility.RandomMinMax(min, max);
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Constructors
|
|
||||||
|
|
||||||
private static Item CreateSturdyShovel(int type) => new SturdyShovel();
|
private static Item CreateSturdyShovel(int type) => new SturdyShovel();
|
||||||
|
|
||||||
private static Item CreateSturdyPickaxe(int type) => new SturdyPickaxe();
|
private static Item CreateSturdyPickaxe(int type) => new SturdyPickaxe();
|
||||||
|
|
@ -427,8 +425,6 @@ namespace Server.Engines.BulkOrders
|
||||||
|
|
||||||
throw new InvalidOperationException();
|
throw new InvalidOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public sealed class TailorRewardCalculator : RewardCalculator
|
public sealed class TailorRewardCalculator : RewardCalculator
|
||||||
|
|
@ -443,7 +439,7 @@ namespace Server.Engines.BulkOrders
|
||||||
private static readonly ConstructCallback ClothingBlessDeed = CreateCBD;
|
private static readonly ConstructCallback ClothingBlessDeed = CreateCBD;
|
||||||
public static readonly TailorRewardCalculator Instance = new TailorRewardCalculator();
|
public static readonly TailorRewardCalculator Instance = new TailorRewardCalculator();
|
||||||
|
|
||||||
private static int[][][] m_AosGoldTable =
|
private static readonly int[][][] m_AosGoldTable =
|
||||||
{
|
{
|
||||||
new[] // 1-part (regular)
|
new[] // 1-part (regular)
|
||||||
{
|
{
|
||||||
|
|
@ -495,7 +491,7 @@ namespace Server.Engines.BulkOrders
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private static int[][][] m_OldGoldTable =
|
private static readonly int[][][] m_OldGoldTable =
|
||||||
{
|
{
|
||||||
new[] // 1-part (regular)
|
new[] // 1-part (regular)
|
||||||
{
|
{
|
||||||
|
|
@ -636,9 +632,7 @@ namespace Server.Engines.BulkOrders
|
||||||
return Utility.RandomMinMax(min, max);
|
return Utility.RandomMinMax(min, max);
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Constructors
|
private static readonly int[][] m_ClothHues =
|
||||||
|
|
||||||
private static int[][] m_ClothHues =
|
|
||||||
{
|
{
|
||||||
new[] { 0x483, 0x48C, 0x488, 0x48A },
|
new[] { 0x483, 0x48C, 0x488, 0x48A },
|
||||||
new[] { 0x495, 0x48B, 0x486, 0x485 },
|
new[] { 0x495, 0x48B, 0x486, 0x485 },
|
||||||
|
|
@ -659,7 +653,7 @@ namespace Server.Engines.BulkOrders
|
||||||
throw new InvalidOperationException();
|
throw new InvalidOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int[] m_SandalHues =
|
private static readonly int[] m_SandalHues =
|
||||||
{
|
{
|
||||||
0x489, 0x47F, 0x482,
|
0x489, 0x47F, 0x482,
|
||||||
0x47E, 0x48F, 0x494,
|
0x47E, 0x48F, 0x494,
|
||||||
|
|
@ -718,7 +712,5 @@ namespace Server.Engines.BulkOrders
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Item CreateCBD(int type) => new ClothingBlessDeed();
|
private static Item CreateCBD(int type) => new ClothingBlessDeed();
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ namespace Server.Engines.BulkOrders
|
||||||
}
|
}
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public Type Type{ get; set; }
|
public Type Type { get; set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public int Number
|
public int Number
|
||||||
|
|
@ -52,7 +52,7 @@ namespace Server.Engines.BulkOrders
|
||||||
}
|
}
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public int Graphic{ get; set; }
|
public int Graphic { get; set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public override bool Complete => m_AmountCur == AmountMax;
|
public override bool Complete => m_AmountCur == AmountMax;
|
||||||
|
|
@ -121,8 +121,8 @@ namespace Server.Engines.BulkOrders
|
||||||
from.SendLocalizedMessage(
|
from.SendLocalizedMessage(
|
||||||
1045166); // The maximum amount of requested items have already been combined to this deed.
|
1045166); // The maximum amount of requested items have already been combined to this deed.
|
||||||
}
|
}
|
||||||
else if (Type == null || objectType != Type && !objectType.IsSubclassOf(Type) ||
|
else if (Type == null || (objectType != Type && !objectType.IsSubclassOf(Type)) ||
|
||||||
!(item is BaseWeapon) && !(item is BaseArmor) && !(item is BaseClothing))
|
(!(item is BaseWeapon) && !(item is BaseArmor) && !(item is BaseClothing)))
|
||||||
{
|
{
|
||||||
from.SendLocalizedMessage(1045169); // The item is not in the request.
|
from.SendLocalizedMessage(1045169); // The item is not in the request.
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@ namespace Server.Engines.BulkOrders
|
||||||
{
|
{
|
||||||
public class SmallBODAcceptGump : Gump
|
public class SmallBODAcceptGump : Gump
|
||||||
{
|
{
|
||||||
private SmallBOD m_Deed;
|
private readonly SmallBOD m_Deed;
|
||||||
private Mobile m_From;
|
private readonly Mobile m_From;
|
||||||
|
|
||||||
public SmallBODAcceptGump(Mobile from, SmallBOD deed) : base(50, 50)
|
public SmallBODAcceptGump(Mobile from, SmallBOD deed) : base(50, 50)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@ namespace Server.Engines.BulkOrders
|
||||||
{
|
{
|
||||||
public class SmallBODGump : Gump
|
public class SmallBODGump : Gump
|
||||||
{
|
{
|
||||||
private SmallBOD m_Deed;
|
private readonly SmallBOD m_Deed;
|
||||||
private Mobile m_From;
|
private readonly Mobile m_From;
|
||||||
|
|
||||||
public SmallBODGump(Mobile from, SmallBOD deed) : base(25, 25)
|
public SmallBODGump(Mobile from, SmallBOD deed) : base(25, 25)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -12,66 +12,66 @@ namespace Server.Engines.BulkOrders
|
||||||
|
|
||||||
public int Graphic { get; }
|
public int Graphic { get; }
|
||||||
|
|
||||||
public SmallBulkEntry( Type type, int number, int graphic )
|
public SmallBulkEntry(Type type, int number, int graphic)
|
||||||
{
|
{
|
||||||
Type = type;
|
Type = type;
|
||||||
Number = number;
|
Number = number;
|
||||||
Graphic = graphic;
|
Graphic = graphic;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static SmallBulkEntry[] BlacksmithWeapons => GetEntries( "Blacksmith", "weapons" );
|
public static SmallBulkEntry[] BlacksmithWeapons => GetEntries("Blacksmith", "weapons");
|
||||||
|
|
||||||
public static SmallBulkEntry[] BlacksmithArmor => GetEntries( "Blacksmith", "armor" );
|
public static SmallBulkEntry[] BlacksmithArmor => GetEntries("Blacksmith", "armor");
|
||||||
|
|
||||||
public static SmallBulkEntry[] TailorCloth => GetEntries( "Tailoring", "cloth" );
|
public static SmallBulkEntry[] TailorCloth => GetEntries("Tailoring", "cloth");
|
||||||
|
|
||||||
public static SmallBulkEntry[] TailorLeather => GetEntries( "Tailoring", "leather" );
|
public static SmallBulkEntry[] TailorLeather => GetEntries("Tailoring", "leather");
|
||||||
|
|
||||||
private static Dictionary<string, Dictionary<string, SmallBulkEntry[]>> m_Cache;
|
private static Dictionary<string, Dictionary<string, SmallBulkEntry[]>> m_Cache;
|
||||||
|
|
||||||
public static SmallBulkEntry[] GetEntries( string type, string name )
|
public static SmallBulkEntry[] GetEntries(string type, string name)
|
||||||
{
|
{
|
||||||
if ( m_Cache == null )
|
if (m_Cache == null)
|
||||||
m_Cache = new Dictionary<string, Dictionary<string, SmallBulkEntry[]>>();
|
m_Cache = new Dictionary<string, Dictionary<string, SmallBulkEntry[]>>();
|
||||||
|
|
||||||
if (!m_Cache.TryGetValue( type, out Dictionary<string, SmallBulkEntry[]> table ))
|
if (!m_Cache.TryGetValue(type, out Dictionary<string, SmallBulkEntry[]> table))
|
||||||
m_Cache[type] = table = new Dictionary<string, SmallBulkEntry[]>();
|
m_Cache[type] = table = new Dictionary<string, SmallBulkEntry[]>();
|
||||||
|
|
||||||
if (!table.TryGetValue( name, out SmallBulkEntry[] entries ))
|
if (!table.TryGetValue(name, out SmallBulkEntry[] entries))
|
||||||
table[name] = entries = LoadEntries(type, name);
|
table[name] = entries = LoadEntries(type, name);
|
||||||
|
|
||||||
return entries;
|
return entries;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static SmallBulkEntry[] LoadEntries( string type, string name ) => LoadEntries($"Data/Bulk Orders/{type}/{name}.cfg");
|
public static SmallBulkEntry[] LoadEntries(string type, string name) => LoadEntries($"Data/Bulk Orders/{type}/{name}.cfg");
|
||||||
|
|
||||||
public static SmallBulkEntry[] LoadEntries( string path )
|
public static SmallBulkEntry[] LoadEntries(string path)
|
||||||
{
|
{
|
||||||
path = Path.Combine( Core.BaseDirectory, path );
|
path = Path.Combine(Core.BaseDirectory, path);
|
||||||
|
|
||||||
List<SmallBulkEntry> list = new List<SmallBulkEntry>();
|
List<SmallBulkEntry> list = new List<SmallBulkEntry>();
|
||||||
|
|
||||||
if ( File.Exists( path ) )
|
if (File.Exists(path))
|
||||||
{
|
{
|
||||||
using StreamReader ip = new StreamReader( path );
|
using StreamReader ip = new StreamReader(path);
|
||||||
string line;
|
string line;
|
||||||
|
|
||||||
while ( (line = ip.ReadLine()) != null )
|
while ((line = ip.ReadLine()) != null)
|
||||||
{
|
{
|
||||||
if ( line.Length == 0 || line.StartsWith( "#" ) )
|
if (line.Length == 0 || line.StartsWith("#"))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string[] split = line.Split( '\t' );
|
string[] split = line.Split('\t');
|
||||||
|
|
||||||
if ( split.Length >= 2 )
|
if (split.Length >= 2)
|
||||||
{
|
{
|
||||||
Type type = AssemblyHandler.FindFirstTypeForName( split[0] );
|
Type type = AssemblyHandler.FindFirstTypeForName(split[0]);
|
||||||
int graphic = Utility.ToInt32( split[split.Length - 1] );
|
int graphic = Utility.ToInt32(split[split.Length - 1]);
|
||||||
|
|
||||||
if ( type != null && graphic > 0 )
|
if (type != null && graphic > 0)
|
||||||
list.Add( new SmallBulkEntry( type, graphic < 0x4000 ? 1020000 + graphic : 1078872 + graphic, graphic ) );
|
list.Add(new SmallBulkEntry(type, graphic < 0x4000 ? 1020000 + graphic : 1078872 + graphic, graphic));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
|
|
|
||||||
|
|
@ -153,7 +153,6 @@ namespace Server.Engines.BulkOrders
|
||||||
|
|
||||||
SmallBulkEntry entry = validEntries[Utility.Random(validEntries.Count)];
|
SmallBulkEntry entry = validEntries[Utility.Random(validEntries.Count)];
|
||||||
return new SmallSmithBOD(entry, material, amountMax, reqExceptional);
|
return new SmallSmithBOD(entry, material, amountMax, reqExceptional);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
public override void Serialize(IGenericWriter writer)
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,6 @@ namespace Server.Engines.BulkOrders
|
||||||
|
|
||||||
bool reqExceptional = excChance > Utility.RandomDouble();
|
bool reqExceptional = excChance > Utility.RandomDouble();
|
||||||
|
|
||||||
|
|
||||||
CraftSystem system = DefTailoring.CraftSystem;
|
CraftSystem system = DefTailoring.CraftSystem;
|
||||||
|
|
||||||
List<SmallBulkEntry> validEntries = new List<SmallBulkEntry>();
|
List<SmallBulkEntry> validEntries = new List<SmallBulkEntry>();
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ namespace Server.Engines.CannedEvil
|
||||||
}
|
}
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public ChampionSkullPlatform Platform{ get; private set; }
|
public ChampionSkullPlatform Platform { get; private set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public ChampionSkullType Type
|
public ChampionSkullType Type
|
||||||
|
|
@ -168,7 +168,7 @@ namespace Server.Engines.CannedEvil
|
||||||
|
|
||||||
private class SacrificeTarget : Target
|
private class SacrificeTarget : Target
|
||||||
{
|
{
|
||||||
private ChampionSkullBrazier m_Brazier;
|
private readonly ChampionSkullBrazier m_Brazier;
|
||||||
|
|
||||||
public SacrificeTarget(ChampionSkullBrazier brazier) : base(12, false, TargetFlags.None) => m_Brazier = brazier;
|
public SacrificeTarget(ChampionSkullBrazier brazier) : base(12, false, TargetFlags.None) => m_Brazier = brazier;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ namespace Server.Engines.CannedEvil
|
||||||
private List<Item> m_RedSkulls;
|
private List<Item> m_RedSkulls;
|
||||||
private ChampionSpawnRegion m_Region;
|
private ChampionSpawnRegion m_Region;
|
||||||
|
|
||||||
//private int m_SpawnRange;
|
// private int m_SpawnRange;
|
||||||
private Rectangle2D m_SpawnArea;
|
private Rectangle2D m_SpawnArea;
|
||||||
private int m_SPawnSzMod;
|
private int m_SPawnSzMod;
|
||||||
|
|
||||||
|
|
@ -68,13 +68,13 @@ namespace Server.Engines.CannedEvil
|
||||||
}
|
}
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public bool ConfinedRoaming{ get; set; }
|
public bool ConfinedRoaming { get; set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public bool HasBeenAdvanced{ get; set; }
|
public bool HasBeenAdvanced { get; set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public bool RandomizeType{ get; set; }
|
public bool RandomizeType { get; set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public int Kills
|
public int Kills
|
||||||
|
|
@ -100,16 +100,16 @@ namespace Server.Engines.CannedEvil
|
||||||
}
|
}
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public TimeSpan RestartDelay{ get; set; }
|
public TimeSpan RestartDelay { get; set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public DateTime RestartTime{ get; private set; }
|
public DateTime RestartTime { get; private set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public TimeSpan ExpireDelay{ get; set; }
|
public TimeSpan ExpireDelay { get; set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public DateTime ExpireTime{ get; set; }
|
public DateTime ExpireTime { get; set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public ChampionSpawnType Type
|
public ChampionSpawnType Type
|
||||||
|
|
@ -138,7 +138,7 @@ namespace Server.Engines.CannedEvil
|
||||||
}
|
}
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public Mobile Champion{ get; set; }
|
public Mobile Champion { get; set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public int Level
|
public int Level
|
||||||
|
|
@ -173,7 +173,7 @@ namespace Server.Engines.CannedEvil
|
||||||
|
|
||||||
public void SetInitialSpawnArea()
|
public void SetInitialSpawnArea()
|
||||||
{
|
{
|
||||||
//Previous default used to be 24;
|
// Previous default used to be 24;
|
||||||
SpawnArea = new Rectangle2D(new Point2D(X - 24, Y - 24), new Point2D(X + 24, Y + 24));
|
SpawnArea = new Rectangle2D(new Point2D(X - 24, Y - 24), new Point2D(X + 24, Y + 24));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -188,7 +188,7 @@ namespace Server.Engines.CannedEvil
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if ( m_Region == null )
|
if (m_Region == null)
|
||||||
{
|
{
|
||||||
m_Region = new ChampionSpawnRegion( this );
|
m_Region = new ChampionSpawnRegion( this );
|
||||||
}
|
}
|
||||||
|
|
@ -307,8 +307,6 @@ namespace Server.Engines.CannedEvil
|
||||||
Start();
|
Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Scroll of Transcendence
|
|
||||||
|
|
||||||
private ScrollofTranscendence CreateRandomSoT(bool felucca)
|
private ScrollofTranscendence CreateRandomSoT(bool felucca)
|
||||||
{
|
{
|
||||||
int level = Utility.RandomMinMax(1, 5);
|
int level = Utility.RandomMinMax(1, 5);
|
||||||
|
|
@ -319,11 +317,9 @@ namespace Server.Engines.CannedEvil
|
||||||
return ScrollofTranscendence.CreateRandom(level, level);
|
return ScrollofTranscendence.CreateRandom(level, level);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
public static void GiveScrollTo(Mobile killer, SpecialScroll scroll)
|
public static void GiveScrollTo(Mobile killer, SpecialScroll scroll)
|
||||||
{
|
{
|
||||||
if (scroll == null || killer == null) //sanity
|
if (scroll == null || killer == null) // sanity
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (scroll is ScrollofTranscendence)
|
if (scroll is ScrollofTranscendence)
|
||||||
|
|
@ -437,8 +433,6 @@ namespace Server.Engines.CannedEvil
|
||||||
|
|
||||||
if (killer is PlayerMobile pm)
|
if (killer is PlayerMobile pm)
|
||||||
{
|
{
|
||||||
#region Scroll of Transcendence
|
|
||||||
|
|
||||||
if (Core.ML)
|
if (Core.ML)
|
||||||
{
|
{
|
||||||
if (Map == Map.Felucca)
|
if (Map == Map.Felucca)
|
||||||
|
|
@ -467,8 +461,6 @@ namespace Server.Engines.CannedEvil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
int mobSubLevel = GetSubLevelFor(m) + 1;
|
int mobSubLevel = GetSubLevelFor(m) + 1;
|
||||||
|
|
||||||
if (mobSubLevel >= 0)
|
if (mobSubLevel >= 0)
|
||||||
|
|
@ -484,7 +476,7 @@ namespace Server.Engines.CannedEvil
|
||||||
else
|
else
|
||||||
m.SendLocalizedMessage(1054030); // You have gained in Valor!
|
m.SendLocalizedMessage(1054030); // You have gained in Valor!
|
||||||
|
|
||||||
//No delay on Valor gains
|
// No delay on Valor gains
|
||||||
}
|
}
|
||||||
|
|
||||||
PlayerMobile.ChampionTitleInfo info = pm.ChampionTitles;
|
PlayerMobile.ChampionTitleInfo info = pm.ChampionTitles;
|
||||||
|
|
@ -790,7 +782,7 @@ namespace Server.Engines.CannedEvil
|
||||||
list.Add(1060659, "Level\t{0}", Level); // ~1_val~: ~2_val~
|
list.Add(1060659, "Level\t{0}", Level); // ~1_val~: ~2_val~
|
||||||
list.Add(1060660, "Kills\t{0} of {1} ({2:F1}%)", m_Kills, MaxKills,
|
list.Add(1060660, "Kills\t{0} of {1} ({2:F1}%)", m_Kills, MaxKills,
|
||||||
100.0 * ((double)m_Kills / MaxKills)); // ~1_val~: ~2_val~
|
100.0 * ((double)m_Kills / MaxKills)); // ~1_val~: ~2_val~
|
||||||
//list.Add( 1060661, "Spawn Range\t{0}", m_SpawnRange ); // ~1_val~: ~2_val~
|
// list.Add( 1060661, "Spawn Range\t{0}", m_SpawnRange ); // ~1_val~: ~2_val~
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -988,9 +980,9 @@ namespace Server.Engines.CannedEvil
|
||||||
1062317); // For your valor in combating the fallen beast, a special artifact has been bestowed on you.
|
1062317); // For your valor in combating the fallen beast, a special artifact has been bestowed on you.
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsEligible(Mobile m, Item Artifact) =>
|
public bool IsEligible(Mobile m, Item artifact) =>
|
||||||
m.Player && m.Alive && m.Region != null && m.Region == m_Region &&
|
m.Player && m.Alive && m.Region != null && m.Region == m_Region &&
|
||||||
m.Backpack?.CheckHold(m, Artifact, false) == true;
|
m.Backpack?.CheckHold(m, artifact, false) == true;
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
public override void Serialize(IGenericWriter writer)
|
||||||
{
|
{
|
||||||
|
|
@ -1103,7 +1095,7 @@ namespace Server.Engines.CannedEvil
|
||||||
{
|
{
|
||||||
if (version < 1)
|
if (version < 1)
|
||||||
m_SpawnArea =
|
m_SpawnArea =
|
||||||
new Rectangle2D(new Point2D(X - 24, Y - 24), new Point2D(X + 24, Y + 24)); //Default was 24
|
new Rectangle2D(new Point2D(X - 24, Y - 24), new Point2D(X + 24, Y + 24)); // Default was 24
|
||||||
|
|
||||||
bool active = reader.ReadBool();
|
bool active = reader.ReadBool();
|
||||||
m_Type = (ChampionSpawnType)reader.ReadInt();
|
m_Type = (ChampionSpawnType)reader.ReadInt();
|
||||||
|
|
@ -1150,7 +1142,7 @@ namespace Server.Engines.CannedEvil
|
||||||
|
|
||||||
public override bool YoungProtected => false;
|
public override bool YoungProtected => false;
|
||||||
|
|
||||||
public ChampionSpawn ChampionSpawn{ get; }
|
public ChampionSpawn ChampionSpawn { get; }
|
||||||
|
|
||||||
public override bool AllowHousing(Mobile from, Point3D p) => false;
|
public override bool AllowHousing(Mobile from, Point3D p) => false;
|
||||||
|
|
||||||
|
|
@ -1159,7 +1151,7 @@ namespace Server.Engines.CannedEvil
|
||||||
base.AlterLightLevel(m, ref global, ref personal);
|
base.AlterLightLevel(m, ref global, ref personal);
|
||||||
global = Math.Max(global,
|
global = Math.Max(global,
|
||||||
1 + ChampionSpawn
|
1 + ChampionSpawn
|
||||||
.Level); //This is a guesstimate. TODO: Verify & get exact values // OSI testing: at 2 red skulls, light = 0x3 ; 1 red = 0x3.; 3 = 8; 9 = 0xD 8 = 0xD 12 = 0x12 10 = 0xD
|
.Level); // This is a guesstimate. TODO: Verify & get exact values // OSI testing: at 2 red skulls, light = 0x3 ; 1 red = 0x3.; 3 = 8; 9 = 0xD 8 = 0xD 12 = 0x12 10 = 0xD
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1175,7 +1167,7 @@ namespace Server.Engines.CannedEvil
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public ChampionSpawn Spawn{ get; private set; }
|
public ChampionSpawn Spawn { get; private set; }
|
||||||
|
|
||||||
public override string DefaultName => "Idol of the Champion";
|
public override string DefaultName => "Idol of the Champion";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,15 +26,15 @@ namespace Server.Engines.CannedEvil
|
||||||
SpawnTypes = spawnTypes;
|
SpawnTypes = spawnTypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Name{ get; }
|
public string Name { get; }
|
||||||
|
|
||||||
public Type Champion{ get; }
|
public Type Champion { get; }
|
||||||
|
|
||||||
public Type[][] SpawnTypes{ get; }
|
public Type[][] SpawnTypes { get; }
|
||||||
|
|
||||||
public string[] LevelNames{ get; }
|
public string[] LevelNames { get; }
|
||||||
|
|
||||||
public static ChampionSpawnInfo[] Table{ get; } =
|
public static ChampionSpawnInfo[] Table { get; } =
|
||||||
{
|
{
|
||||||
new ChampionSpawnInfo("Abyss", typeof(Semidar), new[] { "Foe", "Assassin", "Conqueror" }, new[] // Abyss
|
new ChampionSpawnInfo("Abyss", typeof(Semidar), new[] { "Foe", "Assassin", "Conqueror" }, new[] // Abyss
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ namespace Server.Engines.CannedEvil
|
||||||
{
|
{
|
||||||
public class RestartTimer : Timer
|
public class RestartTimer : Timer
|
||||||
{
|
{
|
||||||
private ChampionSpawn m_Spawn;
|
private readonly ChampionSpawn m_Spawn;
|
||||||
|
|
||||||
public RestartTimer(ChampionSpawn spawn, TimeSpan delay) : base(delay)
|
public RestartTimer(ChampionSpawn spawn, TimeSpan delay) : base(delay)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ namespace Server.Engines.CannedEvil
|
||||||
{
|
{
|
||||||
public class SliceTimer : Timer
|
public class SliceTimer : Timer
|
||||||
{
|
{
|
||||||
private ChampionSpawn m_Spawn;
|
private readonly ChampionSpawn m_Spawn;
|
||||||
|
|
||||||
public SliceTimer(ChampionSpawn spawn) : base(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.0))
|
public SliceTimer(ChampionSpawn spawn) : base(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.0))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ namespace Server.Items
|
||||||
|
|
||||||
private class InternalTimer : Timer
|
private class InternalTimer : Timer
|
||||||
{
|
{
|
||||||
private Item m_Item;
|
private readonly Item m_Item;
|
||||||
|
|
||||||
public InternalTimer(Item item, DateTime end) : base(end - DateTime.UtcNow) => m_Item = item;
|
public InternalTimer(Item item, DateTime end) : base(end - DateTime.UtcNow) => m_Item = item;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,10 @@ namespace Server.Engines.Chat
|
||||||
{
|
{
|
||||||
private string m_Name;
|
private string m_Name;
|
||||||
private string m_Password;
|
private string m_Password;
|
||||||
private List<ChatUser> m_Users, m_Banned, m_Moderators, m_Voices;
|
private readonly List<ChatUser> m_Users;
|
||||||
|
private readonly List<ChatUser> m_Banned;
|
||||||
|
private readonly List<ChatUser> m_Moderators;
|
||||||
|
private readonly List<ChatUser> m_Voices;
|
||||||
private bool m_VoiceRestricted;
|
private bool m_VoiceRestricted;
|
||||||
|
|
||||||
public Channel(string name)
|
public Channel(string name)
|
||||||
|
|
@ -66,9 +69,9 @@ namespace Server.Engines.Chat
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool AlwaysAvailable{ get; set; }
|
public bool AlwaysAvailable { get; set; }
|
||||||
|
|
||||||
public static List<Channel> Channels{ get; } = new List<Channel>();
|
public static List<Channel> Channels { get; } = new List<Channel>();
|
||||||
|
|
||||||
public bool Contains(ChatUser user) => m_Users.Contains(user);
|
public bool Contains(ChatUser user) => m_Users.Contains(user);
|
||||||
|
|
||||||
|
|
@ -100,7 +103,6 @@ namespace Server.Engines.Chat
|
||||||
|
|
||||||
from.Mobile.SendMessage("Your access level is too low to do this.");
|
from.Mobile.SendMessage("Your access level is too low to do this.");
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool AddUser(ChatUser user, string password = null)
|
public bool AddUser(ChatUser user, string password = null)
|
||||||
|
|
@ -132,7 +134,7 @@ namespace Server.Engines.Chat
|
||||||
m_Users.Add(user);
|
m_Users.Add(user);
|
||||||
user.CurrentChannel = this;
|
user.CurrentChannel = this;
|
||||||
|
|
||||||
if (user.Mobile.AccessLevel >= AccessLevel.GameMaster || !AlwaysAvailable && m_Users.Count == 1)
|
if (user.Mobile.AccessLevel >= AccessLevel.GameMaster || (!AlwaysAvailable && m_Users.Count == 1))
|
||||||
AddModerator(user);
|
AddModerator(user);
|
||||||
|
|
||||||
SendUsersTo(user);
|
SendUsersTo(user);
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ namespace Server.Engines.Chat
|
||||||
{
|
{
|
||||||
public class ChatSystem
|
public class ChatSystem
|
||||||
{
|
{
|
||||||
public static bool Enabled{ get; set; } = true;
|
public static bool Enabled { get; set; } = true;
|
||||||
|
|
||||||
public static void Initialize()
|
public static void Initialize()
|
||||||
{
|
{
|
||||||
|
|
@ -128,9 +128,10 @@ namespace Server.Engines.Chat
|
||||||
Channel channel = user.CurrentChannel;
|
Channel channel = user.CurrentChannel;
|
||||||
|
|
||||||
if (handler.RequireConference && channel == null)
|
if (handler.RequireConference && channel == null)
|
||||||
user.SendMessage(31); /* You must be in a conference to do this.
|
/* You must be in a conference to do this.
|
||||||
* To join a conference, select one from the Conference menu.
|
* To join a conference, select one from the Conference menu.
|
||||||
*/
|
*/
|
||||||
|
user.SendMessage(31);
|
||||||
else if (handler.RequireModerator && !user.IsModerator)
|
else if (handler.RequireModerator && !user.IsModerator)
|
||||||
user.SendMessage(29); // You must have operator status to do this.
|
user.SendMessage(29); // You must have operator status to do this.
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -11,10 +11,10 @@ namespace Server.Engines.Chat
|
||||||
Callback = callback;
|
Callback = callback;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool RequireModerator{ get; }
|
public bool RequireModerator { get; }
|
||||||
|
|
||||||
public bool RequireConference{ get; }
|
public bool RequireConference { get; }
|
||||||
|
|
||||||
public OnChatAction Callback{ get; }
|
public OnChatAction Callback { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2,7 +2,7 @@ namespace Server.Engines.Chat
|
||||||
{
|
{
|
||||||
public class ChatActionHandlers
|
public class ChatActionHandlers
|
||||||
{
|
{
|
||||||
private static ChatActionHandler[] m_Handlers;
|
private static readonly ChatActionHandler[] m_Handlers;
|
||||||
|
|
||||||
static ChatActionHandlers()
|
static ChatActionHandlers()
|
||||||
{
|
{
|
||||||
|
|
@ -111,9 +111,10 @@ namespace Server.Engines.Chat
|
||||||
public static void DisallowPrivateMessages(ChatUser from, Channel channel, string param)
|
public static void DisallowPrivateMessages(ChatUser from, Channel channel, string param)
|
||||||
{
|
{
|
||||||
from.IgnorePrivateMessage = true;
|
from.IgnorePrivateMessage = true;
|
||||||
from.SendMessage(38); /* You will no longer receive private messages.
|
/* You will no longer receive private messages.
|
||||||
* Those who send you a message will be notified that you are blocking incoming messages.
|
* Those who send you a message will be notified that you are blocking incoming messages.
|
||||||
*/
|
*/
|
||||||
|
from.SendMessage(38);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void TogglePrivateMessages(ChatUser from, Channel channel, string param)
|
public static void TogglePrivateMessages(ChatUser from, Channel channel, string param)
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@ namespace Server.Engines.Chat
|
||||||
public const char ModeratorColorCharacter = '1';
|
public const char ModeratorColorCharacter = '1';
|
||||||
public const char VoicedColorCharacter = '2';
|
public const char VoicedColorCharacter = '2';
|
||||||
|
|
||||||
private static List<ChatUser> m_Users = new List<ChatUser>();
|
private static readonly List<ChatUser> m_Users = new List<ChatUser>();
|
||||||
private static Dictionary<Mobile, ChatUser> m_Table = new Dictionary<Mobile, ChatUser>();
|
private static readonly Dictionary<Mobile, ChatUser> m_Table = new Dictionary<Mobile, ChatUser>();
|
||||||
|
|
||||||
public ChatUser(Mobile m)
|
public ChatUser(Mobile m)
|
||||||
{
|
{
|
||||||
|
|
@ -19,11 +19,11 @@ namespace Server.Engines.Chat
|
||||||
Ignoring = new List<ChatUser>();
|
Ignoring = new List<ChatUser>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Mobile Mobile{ get; }
|
public Mobile Mobile { get; }
|
||||||
|
|
||||||
public List<ChatUser> Ignored{ get; }
|
public List<ChatUser> Ignored { get; }
|
||||||
|
|
||||||
public List<ChatUser> Ignoring{ get; }
|
public List<ChatUser> Ignoring { get; }
|
||||||
|
|
||||||
public string Username
|
public string Username
|
||||||
{
|
{
|
||||||
|
|
@ -41,13 +41,13 @@ namespace Server.Engines.Chat
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Channel CurrentChannel{ get; set; }
|
public Channel CurrentChannel { get; set; }
|
||||||
|
|
||||||
public bool IsOnline => Mobile.NetState != null;
|
public bool IsOnline => Mobile.NetState != null;
|
||||||
|
|
||||||
public bool Anonymous{ get; set; }
|
public bool Anonymous { get; set; }
|
||||||
|
|
||||||
public bool IgnorePrivateMessage{ get; set; }
|
public bool IgnorePrivateMessage { get; set; }
|
||||||
|
|
||||||
public bool IsModerator => CurrentChannel?.IsModerator(this) == true;
|
public bool IsModerator => CurrentChannel?.IsModerator(this) == true;
|
||||||
|
|
||||||
|
|
@ -135,7 +135,7 @@ namespace Server.Engines.Chat
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//ChatSystem.SendCommandTo( user.m_Mobile, ChatCommand.AddUserToChannel, user.GetColorCharacter() + user.Username );
|
// ChatSystem.SendCommandTo( user.m_Mobile, ChatCommand.AddUserToChannel, user.GetColorCharacter() + user.Username );
|
||||||
|
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,15 +11,15 @@ namespace Server.Engines.Chat
|
||||||
|
|
||||||
EnsureCapacity(13 + (param1.Length + param2.Length) * 2);
|
EnsureCapacity(13 + (param1.Length + param2.Length) * 2);
|
||||||
|
|
||||||
m_Stream.Write((ushort)(number - 20));
|
Stream.Write((ushort)(number - 20));
|
||||||
|
|
||||||
if (who != null)
|
if (who != null)
|
||||||
m_Stream.WriteAsciiFixed(who.Language, 4);
|
Stream.WriteAsciiFixed(who.Language, 4);
|
||||||
else
|
else
|
||||||
m_Stream.Write(0);
|
Stream.Write(0);
|
||||||
|
|
||||||
m_Stream.WriteBigUniNull(param1);
|
Stream.WriteBigUniNull(param1);
|
||||||
m_Stream.WriteBigUniNull(param2);
|
Stream.WriteBigUniNull(param2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,13 +11,14 @@ namespace Server.Engines.ConPVP
|
||||||
private const int LabelColor32 = 0xFFFFFF;
|
private const int LabelColor32 = 0xFFFFFF;
|
||||||
private const int BlackColor32 = 0x000008;
|
private const int BlackColor32 = 0x000008;
|
||||||
|
|
||||||
private static Dictionary<Mobile, List<IgnoreEntry>> m_IgnoreLists = new Dictionary<Mobile, List<IgnoreEntry>>();
|
private static readonly Dictionary<Mobile, List<IgnoreEntry>> m_IgnoreLists = new Dictionary<Mobile, List<IgnoreEntry>>();
|
||||||
|
|
||||||
private bool m_Active = true;
|
private bool m_Active = true;
|
||||||
private Mobile m_Challenger, m_Challenged;
|
private readonly Mobile m_Challenger;
|
||||||
private DuelContext m_Context;
|
private readonly Mobile m_Challenged;
|
||||||
private Participant m_Participant;
|
private readonly DuelContext m_Context;
|
||||||
private int m_Slot;
|
private readonly Participant m_Participant;
|
||||||
|
private readonly int m_Slot;
|
||||||
|
|
||||||
public AcceptDuelGump(Mobile challenger, Mobile challenged, DuelContext context, Participant p, int slot) : base(50,
|
public AcceptDuelGump(Mobile challenger, Mobile challenged, DuelContext context, Participant p, int slot) : base(50,
|
||||||
50)
|
50)
|
||||||
|
|
@ -34,15 +35,15 @@ namespace Server.Engines.ConPVP
|
||||||
|
|
||||||
AddPage(0);
|
AddPage(0);
|
||||||
|
|
||||||
//AddBackground( 0, 0, 400, 220, 9150 );
|
// AddBackground( 0, 0, 400, 220, 9150 );
|
||||||
AddBackground(1, 1, 398, 218, 3600);
|
AddBackground(1, 1, 398, 218, 3600);
|
||||||
//AddBackground( 16, 15, 369, 189, 9100 );
|
// AddBackground( 16, 15, 369, 189, 9100 );
|
||||||
|
|
||||||
AddImageTiled(16, 15, 369, 189, 3604);
|
AddImageTiled(16, 15, 369, 189, 3604);
|
||||||
AddAlphaRegion(16, 15, 369, 189);
|
AddAlphaRegion(16, 15, 369, 189);
|
||||||
|
|
||||||
AddImage(215, -43, 0xEE40);
|
AddImage(215, -43, 0xEE40);
|
||||||
//AddImage( 330, 141, 0x8BA );
|
// AddImage( 330, 141, 0x8BA );
|
||||||
|
|
||||||
AddHtml(22 - 1, 22, 294, 20, Color(Center("Duel Challenge"), BlackColor32));
|
AddHtml(22 - 1, 22, 294, 20, Color(Center("Duel Challenge"), BlackColor32));
|
||||||
AddHtml(22 + 1, 22, 294, 20, Color(Center("Duel Challenge"), BlackColor32));
|
AddHtml(22 + 1, 22, 294, 20, Color(Center("Duel Challenge"), BlackColor32));
|
||||||
|
|
@ -251,9 +252,9 @@ namespace Server.Engines.ConPVP
|
||||||
|
|
||||||
private class IgnoreEntry
|
private class IgnoreEntry
|
||||||
{
|
{
|
||||||
private static TimeSpan ExpireDelay = TimeSpan.FromMinutes(15.0);
|
private static readonly TimeSpan ExpireDelay = TimeSpan.FromMinutes(15.0);
|
||||||
public DateTime m_Expire;
|
public DateTime m_Expire;
|
||||||
public Mobile m_Ignored;
|
public readonly Mobile m_Ignored;
|
||||||
|
|
||||||
public IgnoreEntry(Mobile ignored)
|
public IgnoreEntry(Mobile ignored)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -24,14 +24,14 @@ namespace Server.Engines.ConPVP
|
||||||
}
|
}
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public Arena Arena{ get; private set; }
|
public Arena Arena { get; private set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public bool IsPrivate{ get; set; }
|
public bool IsPrivate { get; set; }
|
||||||
|
|
||||||
public override string DefaultName => "arena controller";
|
public override string DefaultName => "arena controller";
|
||||||
|
|
||||||
public static List<ArenaController> Instances{ get; set; } = new List<ArenaController>();
|
public static List<ArenaController> Instances { get; set; } = new List<ArenaController>();
|
||||||
|
|
||||||
public override void OnDelete()
|
public override void OnDelete()
|
||||||
{
|
{
|
||||||
|
|
@ -96,7 +96,7 @@ namespace Server.Engines.ConPVP
|
||||||
Points[i] = reader.ReadPoint3D();
|
Points[i] = reader.ReadPoint3D();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Point3D[] Points{ get; }
|
public Point3D[] Points { get; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public Point3D EdgeWest
|
public Point3D EdgeWest
|
||||||
|
|
@ -275,7 +275,7 @@ namespace Server.Engines.ConPVP
|
||||||
}
|
}
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public LadderController Ladder{ get; set; }
|
public LadderController Ladder { get; set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public bool IsGuarded
|
public bool IsGuarded
|
||||||
|
|
@ -305,7 +305,7 @@ namespace Server.Engines.ConPVP
|
||||||
}
|
}
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public Mobile Announcer{ get; set; }
|
public Mobile Announcer { get; set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public string Name
|
public string Name
|
||||||
|
|
@ -385,10 +385,10 @@ namespace Server.Engines.ConPVP
|
||||||
}
|
}
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public Point3D Outside{ get; set; }
|
public Point3D Outside { get; set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public Point3D GateIn{ get; set; }
|
public Point3D GateIn { get; set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public Point3D GateOut
|
public Point3D GateOut
|
||||||
|
|
@ -403,17 +403,17 @@ namespace Server.Engines.ConPVP
|
||||||
}
|
}
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public Point3D Wall{ get; set; }
|
public Point3D Wall { get; set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public bool IsOccupied => Players.Count > 0;
|
public bool IsOccupied => Players.Count > 0;
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public ArenaStartPoints Points{ get; private set; }
|
public ArenaStartPoints Points { get; private set; }
|
||||||
|
|
||||||
public Item Teleporter{ get; set; }
|
public Item Teleporter { get; set; }
|
||||||
|
|
||||||
public List<Mobile> Players{ get; }
|
public List<Mobile> Players { get; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public bool Active
|
public bool Active
|
||||||
|
|
@ -448,7 +448,7 @@ namespace Server.Engines.ConPVP
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<Arena> Arenas{ get; } = new List<Arena>();
|
public static List<Arena> Arenas { get; } = new List<Arena>();
|
||||||
|
|
||||||
public int CompareTo(Arena c)
|
public int CompareTo(Arena c)
|
||||||
{
|
{
|
||||||
|
|
@ -738,7 +738,7 @@ namespace Server.Engines.ConPVP
|
||||||
|
|
||||||
private class ArenaEntry
|
private class ArenaEntry
|
||||||
{
|
{
|
||||||
public Arena m_Arena;
|
public readonly Arena m_Arena;
|
||||||
public int m_VotesAgainst;
|
public int m_VotesAgainst;
|
||||||
public int m_VotesFor;
|
public int m_VotesFor;
|
||||||
|
|
||||||
|
|
@ -747,9 +747,7 @@ namespace Server.Engines.ConPVP
|
||||||
public int Value => m_VotesFor;
|
public int Value => m_VotesFor;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Offsets & Rotation
|
private static readonly Point2D[] m_EdgeOffsets =
|
||||||
|
|
||||||
private static Point2D[] m_EdgeOffsets =
|
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* /\
|
* /\
|
||||||
|
|
@ -772,7 +770,7 @@ namespace Server.Engines.ConPVP
|
||||||
};
|
};
|
||||||
|
|
||||||
// nw corner
|
// nw corner
|
||||||
private static Point2D[] m_CornerOffsets =
|
private static readonly Point2D[] m_CornerOffsets =
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* /\
|
* /\
|
||||||
|
|
@ -793,7 +791,7 @@ namespace Server.Engines.ConPVP
|
||||||
new Point2D(3, 0)
|
new Point2D(3, 0)
|
||||||
};
|
};
|
||||||
|
|
||||||
private static int[][,] m_Rotate =
|
private static readonly int[][,] m_Rotate =
|
||||||
{
|
{
|
||||||
new[,] { { +1, 0 }, { 0, +1 } }, // west
|
new[,] { { +1, 0 }, { 0, +1 } }, // west
|
||||||
new[,] { { -1, 0 }, { 0, -1 } }, // east
|
new[,] { { -1, 0 }, { 0, -1 } }, // east
|
||||||
|
|
@ -804,7 +802,5 @@ namespace Server.Engines.ConPVP
|
||||||
new[,] { { 0, +1 }, { +1, 0 } }, // sw
|
new[,] { { 0, +1 }, { +1, 0 } }, // sw
|
||||||
new[,] { { 0, -1 }, { -1, 0 } } // ne
|
new[,] { { 0, -1 }, { -1, 0 } } // ne
|
||||||
};
|
};
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,8 @@ namespace Server.Engines.ConPVP
|
||||||
|
|
||||||
public class DuelContext
|
public class DuelContext
|
||||||
{
|
{
|
||||||
private static TimeSpan CombatDelay = TimeSpan.FromSeconds(30.0);
|
private static readonly TimeSpan CombatDelay = TimeSpan.FromSeconds(30.0);
|
||||||
private static TimeSpan AutoTieDelay = TimeSpan.FromMinutes(15.0);
|
private static readonly TimeSpan AutoTieDelay = TimeSpan.FromMinutes(15.0);
|
||||||
|
|
||||||
private Timer m_AutoTieTimer;
|
private Timer m_AutoTieTimer;
|
||||||
|
|
||||||
|
|
@ -44,7 +44,7 @@ namespace Server.Engines.ConPVP
|
||||||
private Timer m_SDWarnTimer, m_SDActivateTimer;
|
private Timer m_SDWarnTimer, m_SDActivateTimer;
|
||||||
public Tournament m_Tournament;
|
public Tournament m_Tournament;
|
||||||
|
|
||||||
private List<Item> m_Walls = new List<Item>();
|
private readonly List<Item> m_Walls = new List<Item>();
|
||||||
|
|
||||||
private bool m_Yielding;
|
private bool m_Yielding;
|
||||||
|
|
||||||
|
|
@ -63,36 +63,36 @@ namespace Server.Engines.ConPVP
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Rematch{ get; private set; }
|
public bool Rematch { get; private set; }
|
||||||
|
|
||||||
public bool ReadyWait{ get; private set; }
|
public bool ReadyWait { get; private set; }
|
||||||
|
|
||||||
public int ReadyCount{ get; private set; }
|
public int ReadyCount { get; private set; }
|
||||||
|
|
||||||
public bool Registered{ get; private set; } = true;
|
public bool Registered { get; private set; } = true;
|
||||||
|
|
||||||
public bool Finished{ get; private set; }
|
public bool Finished { get; private set; }
|
||||||
|
|
||||||
public bool Started{ get; private set; }
|
public bool Started { get; private set; }
|
||||||
|
|
||||||
public Mobile Initiator{ get; }
|
public Mobile Initiator { get; }
|
||||||
|
|
||||||
public List<Participant> Participants{ get; }
|
public List<Participant> Participants { get; }
|
||||||
|
|
||||||
public Ruleset Ruleset{ get; private set; }
|
public Ruleset Ruleset { get; private set; }
|
||||||
|
|
||||||
public Arena Arena{ get; private set; }
|
public Arena Arena { get; private set; }
|
||||||
|
|
||||||
public bool Tied{ get; private set; }
|
public bool Tied { get; private set; }
|
||||||
|
|
||||||
public bool IsSuddenDeath{ get; set; }
|
public bool IsSuddenDeath { get; set; }
|
||||||
|
|
||||||
public bool IsOneVsOne => Participants.Count == 2 && Participants[0].Players.Length == 1 &&
|
public bool IsOneVsOne => Participants.Count == 2 && Participants[0].Players.Length == 1 &&
|
||||||
Participants[1].Players.Length == 1;
|
Participants[1].Players.Length == 1;
|
||||||
|
|
||||||
public bool StartedBeginCountdown{ get; private set; }
|
public bool StartedBeginCountdown { get; private set; }
|
||||||
|
|
||||||
public bool StartedReadyCountdown{ get; private set; }
|
public bool StartedReadyCountdown { get; private set; }
|
||||||
|
|
||||||
public Tournament Tournament => m_Tournament;
|
public Tournament Tournament => m_Tournament;
|
||||||
|
|
||||||
|
|
@ -139,7 +139,6 @@ namespace Server.Engines.ConPVP
|
||||||
else if (move is SamuraiMove)
|
else if (move is SamuraiMove)
|
||||||
title = "Ninjitsu";
|
title = "Ninjitsu";
|
||||||
|
|
||||||
|
|
||||||
if (title == null || name == null || Ruleset.GetOption(title, name))
|
if (title == null || name == null || Ruleset.GetOption(title, name))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|
@ -1202,7 +1201,7 @@ namespace Server.Engines.ConPVP
|
||||||
|
|
||||||
if (instance == null)
|
if (instance == null)
|
||||||
{
|
{
|
||||||
//pm.SendMessage( "Ladder not yet initialized." );
|
// pm.SendMessage( "Ladder not yet initialized." );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -1218,8 +1217,8 @@ namespace Server.Engines.ConPVP
|
||||||
pm.NonlocalOverheadMessage(MessageType.Regular, pm.SpeechHue, true,
|
pm.NonlocalOverheadMessage(MessageType.Regular, pm.SpeechHue, true,
|
||||||
string.Format(text, pm.Name, "is"));
|
string.Format(text, pm.Name, "is"));
|
||||||
|
|
||||||
//pm.PublicOverheadMessage( MessageType.Regular, pm.SpeechHue, true, String.Format( "Level {0} with {1} win{2} and {3} loss{4}.", Ladder.GetLevel( entry.Experience ), entry.Wins, entry.Wins==1?"":"s", entry.Losses, entry.Losses==1?"":"es" ) );
|
// pm.PublicOverheadMessage( MessageType.Regular, pm.SpeechHue, true, String.Format( "Level {0} with {1} win{2} and {3} loss{4}.", Ladder.GetLevel( entry.Experience ), entry.Wins, entry.Wins==1?"":"s", entry.Losses, entry.Losses==1?"":"es" ) );
|
||||||
//pm.PublicOverheadMessage( MessageType.Regular, pm.SpeechHue, true, String.Format( "Level {0} with {1} win{2} and {3} loss{4}.", Ladder.GetLevel( entry.Experience ), entry.Wins, entry.Wins==1?"":"s", entry.Losses, entry.Losses==1?"":"es" ) );
|
// pm.PublicOverheadMessage( MessageType.Regular, pm.SpeechHue, true, String.Format( "Level {0} with {1} win{2} and {3} loss{4}.", Ladder.GetLevel( entry.Experience ), entry.Wins, entry.Wins==1?"":"s", entry.Losses, entry.Losses==1?"":"es" ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1236,7 +1235,7 @@ namespace Server.Engines.ConPVP
|
||||||
|
|
||||||
if (instance == null)
|
if (instance == null)
|
||||||
{
|
{
|
||||||
//pm.SendMessage( "Ladder not yet initialized." );
|
// pm.SendMessage( "Ladder not yet initialized." );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -1765,7 +1764,7 @@ namespace Server.Engines.ConPVP
|
||||||
|
|
||||||
BounceInfo bi = inHand.GetBounce();
|
BounceInfo bi = inHand.GetBounce();
|
||||||
|
|
||||||
if (bi.m_Parent == mob)
|
if (bi.Parent == mob)
|
||||||
pack.DropItem(inHand);
|
pack.DropItem(inHand);
|
||||||
else
|
else
|
||||||
inHand.Bounce(mob);
|
inHand.Bounce(mob);
|
||||||
|
|
@ -2210,11 +2209,11 @@ namespace Server.Engines.ConPVP
|
||||||
m_Expire = DateTime.UtcNow + TimeSpan.FromMinutes(30.0);
|
m_Expire = DateTime.UtcNow + TimeSpan.FromMinutes(30.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Mobile Mobile{ get; }
|
public Mobile Mobile { get; }
|
||||||
|
|
||||||
public Point3D Location{ get; private set; }
|
public Point3D Location { get; private set; }
|
||||||
|
|
||||||
public Map Facet{ get; private set; }
|
public Map Facet { get; private set; }
|
||||||
|
|
||||||
public bool Expired => DateTime.UtcNow >= m_Expire;
|
public bool Expired => DateTime.UtcNow >= m_Expire;
|
||||||
|
|
||||||
|
|
@ -2373,7 +2372,7 @@ namespace Server.Engines.ConPVP
|
||||||
|
|
||||||
private class ArenaMoongate : ConfirmationMoongate
|
private class ArenaMoongate : ConfirmationMoongate
|
||||||
{
|
{
|
||||||
private ExitTeleporter m_Teleporter;
|
private readonly ExitTeleporter m_Teleporter;
|
||||||
|
|
||||||
public ArenaMoongate(Point3D target, Map map, ExitTeleporter tp) : base(target, map)
|
public ArenaMoongate(Point3D target, Map map, ExitTeleporter tp) : base(target, map)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -14,16 +14,15 @@ namespace Server.Engines.ConPVP
|
||||||
{
|
{
|
||||||
private bool m_Flying;
|
private bool m_Flying;
|
||||||
|
|
||||||
private BRGame m_Game;
|
private readonly BRGame m_Game;
|
||||||
|
|
||||||
private List<Mobile> m_Helpers;
|
private readonly List<Mobile> m_Helpers;
|
||||||
|
|
||||||
private Point3DList m_Path = new Point3DList();
|
private readonly Point3DList m_Path = new Point3DList();
|
||||||
private int m_PathIdx;
|
private int m_PathIdx;
|
||||||
private EffectTimer m_Timer;
|
private readonly EffectTimer m_Timer;
|
||||||
|
|
||||||
public BRBomb(BRGame game) :
|
public BRBomb(BRGame game) : base(0x103C) // 0x103C = bread, 0x1042 = pie, 0x1364 = rock, 0x13a8 = pillow, 0x2256 = bagball
|
||||||
base(0x103C) // 0x103C = bread, 0x1042 = pie, 0x1364 = rock, 0x13a8 = pillow, 0x2256 = bagball
|
|
||||||
{
|
{
|
||||||
Movable = false;
|
Movable = false;
|
||||||
Hue = 0x35;
|
Hue = 0x35;
|
||||||
|
|
@ -42,7 +41,7 @@ namespace Server.Engines.ConPVP
|
||||||
|
|
||||||
public override string DefaultName => "da bomb";
|
public override string DefaultName => "da bomb";
|
||||||
|
|
||||||
public Mobile Thrower{ get; private set; }
|
public Mobile Thrower { get; private set; }
|
||||||
|
|
||||||
private Mobile FindOwner(IEntity parent)
|
private Mobile FindOwner(IEntity parent)
|
||||||
{
|
{
|
||||||
|
|
@ -262,7 +261,7 @@ namespace Server.Engines.ConPVP
|
||||||
|
|
||||||
org.Z += 10; // always add 10 at the start cause we're coming from a mobile's eye level
|
org.Z += 10; // always add 10 at the start cause we're coming from a mobile's eye level
|
||||||
|
|
||||||
/*if ( org.X > dest.X || ( org.X == dest.X && org.Y > dest.Y ) || ( org.X == dest.X && org.Y == dest.Y && org.Z > dest.Z ) )
|
/*if (org.X > dest.X || ( org.X == dest.X && org.Y > dest.Y ) || ( org.X == dest.X && org.Y == dest.Y && org.Z > dest.Z ))
|
||||||
{
|
{
|
||||||
Point3D swap = org;
|
Point3D swap = org;
|
||||||
org = dest;
|
org = dest;
|
||||||
|
|
@ -311,12 +310,12 @@ namespace Server.Engines.ConPVP
|
||||||
if (list.Count > 0 && list[list.Count - 1] != dest)
|
if (list.Count > 0 && list[list.Count - 1] != dest)
|
||||||
list.Add(dest);
|
list.Add(dest);
|
||||||
|
|
||||||
/*if ( dist3d > 4 && ( dest.X != org.X || dest.Y != org.Y ) )
|
/*if (dist3d > 4 && ( dest.X != org.X || dest.Y != org.Y ))
|
||||||
{
|
{
|
||||||
int count = list.Count;
|
int count = list.Count;
|
||||||
int i;
|
int i;
|
||||||
int climb = count / 2;
|
int climb = count / 2;
|
||||||
if ( climb > 3 )
|
if (climb > 3)
|
||||||
climb = 3;
|
climb = 3;
|
||||||
|
|
||||||
for ( i = 0; i < climb; i++ )
|
for ( i = 0; i < climb; i++ )
|
||||||
|
|
@ -470,7 +469,7 @@ namespace Server.Engines.ConPVP
|
||||||
point = m_Path[j];
|
point = m_Path[j];
|
||||||
|
|
||||||
if (loc.X == point.X && loc.Y == point.Y &&
|
if (loc.X == point.X && loc.Y == point.Y &&
|
||||||
(i is Blocker || loc.Z <= point.Z && loc.Z + height >= point.Z))
|
(i is Blocker || (loc.Z <= point.Z && loc.Z + height >= point.Z)))
|
||||||
{
|
{
|
||||||
found = true;
|
found = true;
|
||||||
if (j > m_PathIdx)
|
if (j > m_PathIdx)
|
||||||
|
|
@ -663,7 +662,7 @@ namespace Server.Engines.ConPVP
|
||||||
|
|
||||||
private class EffectTimer : Timer
|
private class EffectTimer : Timer
|
||||||
{
|
{
|
||||||
private BRBomb m_Bomb;
|
private readonly BRBomb m_Bomb;
|
||||||
private int m_Count;
|
private int m_Count;
|
||||||
|
|
||||||
public EffectTimer(BRBomb bomb) : base(TimeSpan.Zero, TimeSpan.FromSeconds(1.0))
|
public EffectTimer(BRBomb bomb) : base(TimeSpan.Zero, TimeSpan.FromSeconds(1.0))
|
||||||
|
|
@ -705,8 +704,8 @@ namespace Server.Engines.ConPVP
|
||||||
|
|
||||||
private class BombTarget : Target
|
private class BombTarget : Target
|
||||||
{
|
{
|
||||||
private BRBomb m_Bomb;
|
private readonly BRBomb m_Bomb;
|
||||||
private Mobile m_Mob;
|
private readonly Mobile m_Mob;
|
||||||
private bool m_Resend = true;
|
private bool m_Resend = true;
|
||||||
|
|
||||||
public BombTarget(BRBomb bomb, Mobile from) : base(10, true, TargetFlags.None)
|
public BombTarget(BRBomb bomb, Mobile from) : base(10, true, TargetFlags.None)
|
||||||
|
|
@ -1010,7 +1009,7 @@ namespace Server.Engines.ConPVP
|
||||||
AddAlphaRegion(16, 15, 369, height - 29);
|
AddAlphaRegion(16, 15, 369, height - 29);
|
||||||
|
|
||||||
AddImage(215, -45, 0xEE40);
|
AddImage(215, -45, 0xEE40);
|
||||||
//AddImage( 330, 141, 0x8BA );
|
// AddImage( 330, 141, 0x8BA );
|
||||||
|
|
||||||
AddBorderedText(22, 22, 294, 20, Center("BR Scoreboard"), LabelColor32, BlackColor32);
|
AddBorderedText(22, 22, 294, 20, Center("BR Scoreboard"), LabelColor32, BlackColor32);
|
||||||
|
|
||||||
|
|
@ -1117,7 +1116,7 @@ namespace Server.Engines.ConPVP
|
||||||
private int m_Kills;
|
private int m_Kills;
|
||||||
|
|
||||||
private int m_Score;
|
private int m_Score;
|
||||||
private BRTeamInfo m_TeamInfo;
|
private readonly BRTeamInfo m_TeamInfo;
|
||||||
|
|
||||||
public BRPlayerInfo(BRTeamInfo teamInfo, Mobile player)
|
public BRPlayerInfo(BRTeamInfo teamInfo, Mobile player)
|
||||||
{
|
{
|
||||||
|
|
@ -1125,7 +1124,7 @@ namespace Server.Engines.ConPVP
|
||||||
Player = player;
|
Player = player;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Mobile Player{ get; }
|
public Mobile Player { get; }
|
||||||
|
|
||||||
public int CompareTo(BRPlayerInfo pi)
|
public int CompareTo(BRPlayerInfo pi)
|
||||||
{
|
{
|
||||||
|
|
@ -1208,16 +1207,16 @@ namespace Server.Engines.ConPVP
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public BRGame Game{ get; set; }
|
public BRGame Game { get; set; }
|
||||||
|
|
||||||
public int TeamID{ get; }
|
public int TeamID { get; }
|
||||||
|
|
||||||
public BRPlayerInfo Leader{ get; set; }
|
public BRPlayerInfo Leader { get; set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public BRBoard Board{ get; set; }
|
public BRBoard Board { get; set; }
|
||||||
|
|
||||||
public Dictionary<Mobile, BRPlayerInfo> Players{ get; }
|
public Dictionary<Mobile, BRPlayerInfo> Players { get; }
|
||||||
|
|
||||||
public BRPlayerInfo this[Mobile mob]
|
public BRPlayerInfo this[Mobile mob]
|
||||||
{
|
{
|
||||||
|
|
@ -1234,10 +1233,10 @@ namespace Server.Engines.ConPVP
|
||||||
}
|
}
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public int Color{ get; set; }
|
public int Color { get; set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public string TeamName{ get; set; }
|
public string TeamName { get; set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public BRGoal Goal
|
public BRGoal Goal
|
||||||
|
|
@ -1267,11 +1266,11 @@ namespace Server.Engines.ConPVP
|
||||||
|
|
||||||
public string Name => $"{TeamName} Team";
|
public string Name => $"{TeamName} Team";
|
||||||
|
|
||||||
public int Kills{ get; set; }
|
public int Kills { get; set; }
|
||||||
|
|
||||||
public int Captures{ get; set; }
|
public int Captures { get; set; }
|
||||||
|
|
||||||
public int Score{ get; set; }
|
public int Score { get; set; }
|
||||||
|
|
||||||
public void Reset()
|
public void Reset()
|
||||||
{
|
{
|
||||||
|
|
@ -1333,7 +1332,7 @@ namespace Server.Engines.ConPVP
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public BRTeamInfo[] TeamInfo{ get; private set; }
|
public BRTeamInfo[] TeamInfo { get; private set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public BRTeamInfo Team1 => TeamInfo[0];
|
public BRTeamInfo Team1 => TeamInfo[0];
|
||||||
|
|
@ -1348,10 +1347,10 @@ namespace Server.Engines.ConPVP
|
||||||
public BRTeamInfo Team4 => TeamInfo[3];
|
public BRTeamInfo Team4 => TeamInfo[3];
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public TimeSpan Duration{ get; set; }
|
public TimeSpan Duration { get; set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public Point3D BombHome{ get; set; }
|
public Point3D BombHome { get; set; }
|
||||||
|
|
||||||
public override string Title => "Bombing Run";
|
public override string Title => "Bombing Run";
|
||||||
public override string DefaultName => "Bombing Run Controller";
|
public override string DefaultName => "Bombing Run Controller";
|
||||||
|
|
@ -1411,7 +1410,7 @@ namespace Server.Engines.ConPVP
|
||||||
|
|
||||||
public BRGame(BRController controller, DuelContext context) : base(context) => Controller = controller;
|
public BRGame(BRController controller, DuelContext context) : base(context) => Controller = controller;
|
||||||
|
|
||||||
public BRController Controller{ get; }
|
public BRController Controller { get; }
|
||||||
|
|
||||||
public Map Facet
|
public Map Facet
|
||||||
{
|
{
|
||||||
|
|
@ -1676,8 +1675,8 @@ namespace Server.Engines.ConPVP
|
||||||
{
|
{
|
||||||
sb.Append(": ");
|
sb.Append(": ");
|
||||||
|
|
||||||
//sb.Append( pl.Score.ToString( "N0" ) );
|
// sb.Append( pl.Score.ToString( "N0" ) );
|
||||||
//sb.Append( pl.Score == 1 ? " point" : " points" );
|
// sb.Append( pl.Score == 1 ? " point" : " points" );
|
||||||
|
|
||||||
sb.Append(pl.Kills.ToString("N0"));
|
sb.Append(pl.Kills.ToString("N0"));
|
||||||
sb.Append(pl.Kills == 1 ? " kill" : " kills");
|
sb.Append(pl.Kills == 1 ? " kill" : " kills");
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ namespace Server.Engines.ConPVP
|
||||||
if (player.Score > 0)
|
if (player.Score > 0)
|
||||||
entries.Add(player);
|
entries.Add(player);
|
||||||
|
|
||||||
entries.Sort(delegate(IRankedCTF a, IRankedCTF b) { return b.Score - a.Score; });
|
entries.Sort((a, b) => b.Score - a.Score);
|
||||||
|
|
||||||
int height = 0;
|
int height = 0;
|
||||||
|
|
||||||
|
|
@ -102,7 +102,7 @@ namespace Server.Engines.ConPVP
|
||||||
AddAlphaRegion(16, 15, 369, height - 29);
|
AddAlphaRegion(16, 15, 369, height - 29);
|
||||||
|
|
||||||
AddImage(215, -45, 0xEE40);
|
AddImage(215, -45, 0xEE40);
|
||||||
//AddImage( 330, 141, 0x8BA );
|
// AddImage( 330, 141, 0x8BA );
|
||||||
|
|
||||||
AddBorderedText(22, 22, 294, 20, Center("CTF Scoreboard"), LabelColor32, BlackColor32);
|
AddBorderedText(22, 22, 294, 20, Center("CTF Scoreboard"), LabelColor32, BlackColor32);
|
||||||
|
|
||||||
|
|
@ -497,10 +497,10 @@ namespace Server.Engines.ConPVP
|
||||||
|
|
||||||
public interface IRankedCTF
|
public interface IRankedCTF
|
||||||
{
|
{
|
||||||
int Kills{ get; }
|
int Kills { get; }
|
||||||
int Captures{ get; }
|
int Captures { get; }
|
||||||
int Score{ get; }
|
int Score { get; }
|
||||||
string Name{ get; }
|
string Name { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public sealed class CTFPlayerInfo : IRankedCTF
|
public sealed class CTFPlayerInfo : IRankedCTF
|
||||||
|
|
@ -510,7 +510,7 @@ namespace Server.Engines.ConPVP
|
||||||
private int m_Kills;
|
private int m_Kills;
|
||||||
|
|
||||||
private int m_Score;
|
private int m_Score;
|
||||||
private CTFTeamInfo m_TeamInfo;
|
private readonly CTFTeamInfo m_TeamInfo;
|
||||||
|
|
||||||
public CTFPlayerInfo(CTFTeamInfo teamInfo, Mobile player)
|
public CTFPlayerInfo(CTFTeamInfo teamInfo, Mobile player)
|
||||||
{
|
{
|
||||||
|
|
@ -518,7 +518,7 @@ namespace Server.Engines.ConPVP
|
||||||
Player = player;
|
Player = player;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Mobile Player{ get; }
|
public Mobile Player { get; }
|
||||||
|
|
||||||
string IRankedCTF.Name => Player.Name;
|
string IRankedCTF.Name => Player.Name;
|
||||||
|
|
||||||
|
|
@ -597,16 +597,16 @@ namespace Server.Engines.ConPVP
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public CTFGame Game{ get; set; }
|
public CTFGame Game { get; set; }
|
||||||
|
|
||||||
public int TeamID{ get; }
|
public int TeamID { get; }
|
||||||
|
|
||||||
public CTFPlayerInfo Leader{ get; set; }
|
public CTFPlayerInfo Leader { get; set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public CTFBoard Board{ get; set; }
|
public CTFBoard Board { get; set; }
|
||||||
|
|
||||||
public Dictionary<Mobile, CTFPlayerInfo> Players{ get; }
|
public Dictionary<Mobile, CTFPlayerInfo> Players { get; }
|
||||||
|
|
||||||
public CTFPlayerInfo this[Mobile mob]
|
public CTFPlayerInfo this[Mobile mob]
|
||||||
{
|
{
|
||||||
|
|
@ -623,24 +623,24 @@ namespace Server.Engines.ConPVP
|
||||||
}
|
}
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public int Color{ get; set; }
|
public int Color { get; set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public string Name{ get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public CTFFlag Flag{ get; set; }
|
public CTFFlag Flag { get; set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public Point3D Origin{ get; set; }
|
public Point3D Origin { get; set; }
|
||||||
|
|
||||||
string IRankedCTF.Name => $"{Name} Team";
|
string IRankedCTF.Name => $"{Name} Team";
|
||||||
|
|
||||||
public int Kills{ get; set; }
|
public int Kills { get; set; }
|
||||||
|
|
||||||
public int Captures{ get; set; }
|
public int Captures { get; set; }
|
||||||
|
|
||||||
public int Score{ get; set; }
|
public int Score { get; set; }
|
||||||
|
|
||||||
public void Reset()
|
public void Reset()
|
||||||
{
|
{
|
||||||
|
|
@ -702,7 +702,7 @@ namespace Server.Engines.ConPVP
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public CTFTeamInfo[] TeamInfo{ get; private set; }
|
public CTFTeamInfo[] TeamInfo { get; private set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public CTFTeamInfo Team1 => TeamInfo[0];
|
public CTFTeamInfo Team1 => TeamInfo[0];
|
||||||
|
|
@ -729,7 +729,7 @@ namespace Server.Engines.ConPVP
|
||||||
public CTFTeamInfo Team8 => TeamInfo[7];
|
public CTFTeamInfo Team8 => TeamInfo[7];
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public TimeSpan Duration{ get; set; }
|
public TimeSpan Duration { get; set; }
|
||||||
|
|
||||||
public override string Title => "CTF";
|
public override string Title => "CTF";
|
||||||
|
|
||||||
|
|
@ -796,7 +796,7 @@ namespace Server.Engines.ConPVP
|
||||||
|
|
||||||
public CTFGame(CTFController controller, DuelContext context) : base(context) => Controller = controller;
|
public CTFGame(CTFController controller, DuelContext context) : base(context) => Controller = controller;
|
||||||
|
|
||||||
public CTFController Controller{ get; }
|
public CTFController Controller { get; }
|
||||||
|
|
||||||
public Map Facet
|
public Map Facet
|
||||||
{
|
{
|
||||||
|
|
@ -999,7 +999,7 @@ namespace Server.Engines.ConPVP
|
||||||
teams.Add(teamInfo);
|
teams.Add(teamInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
teams.Sort(delegate(CTFTeamInfo a, CTFTeamInfo b) { return b.Score - a.Score; });
|
teams.Sort((a, b) => b.Score - a.Score);
|
||||||
|
|
||||||
Tournament tourney = m_Context.m_Tournament;
|
Tournament tourney = m_Context.m_Tournament;
|
||||||
|
|
||||||
|
|
@ -1063,7 +1063,7 @@ namespace Server.Engines.ConPVP
|
||||||
if (mob == null)
|
if (mob == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
//"Red v Blue CTF Champion"
|
// "Red v Blue CTF Champion"
|
||||||
|
|
||||||
sb = new StringBuilder();
|
sb = new StringBuilder();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ namespace Server.Engines.ConPVP
|
||||||
if (player.Score > 0)
|
if (player.Score > 0)
|
||||||
entries.Add(player);
|
entries.Add(player);
|
||||||
|
|
||||||
entries.Sort(delegate(IRankedCTF a, IRankedCTF b) { return b.Score - a.Score; });
|
entries.Sort((a, b) => b.Score - a.Score);
|
||||||
|
|
||||||
int height = 0;
|
int height = 0;
|
||||||
|
|
||||||
|
|
@ -97,7 +97,7 @@ namespace Server.Engines.ConPVP
|
||||||
AddAlphaRegion(16, 15, 369, height - 29);
|
AddAlphaRegion(16, 15, 369, height - 29);
|
||||||
|
|
||||||
AddImage(215, -45, 0xEE40);
|
AddImage(215, -45, 0xEE40);
|
||||||
//AddImage( 330, 141, 0x8BA );
|
// AddImage( 330, 141, 0x8BA );
|
||||||
|
|
||||||
AddBorderedText(22, 22, 294, 20, Center("DD Scoreboard"), LabelColor32, BlackColor32);
|
AddBorderedText(22, 22, 294, 20, Center("DD Scoreboard"), LabelColor32, BlackColor32);
|
||||||
|
|
||||||
|
|
@ -204,7 +204,7 @@ namespace Server.Engines.ConPVP
|
||||||
private int m_Kills;
|
private int m_Kills;
|
||||||
|
|
||||||
private int m_Score;
|
private int m_Score;
|
||||||
private DDTeamInfo m_TeamInfo;
|
private readonly DDTeamInfo m_TeamInfo;
|
||||||
|
|
||||||
public DDPlayerInfo(DDTeamInfo teamInfo, Mobile player)
|
public DDPlayerInfo(DDTeamInfo teamInfo, Mobile player)
|
||||||
{
|
{
|
||||||
|
|
@ -212,7 +212,7 @@ namespace Server.Engines.ConPVP
|
||||||
Player = player;
|
Player = player;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Mobile Player{ get; }
|
public Mobile Player { get; }
|
||||||
|
|
||||||
public string Name => Player.Name;
|
public string Name => Player.Name;
|
||||||
|
|
||||||
|
|
@ -279,16 +279,16 @@ namespace Server.Engines.ConPVP
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public DDGame Game{ get; set; }
|
public DDGame Game { get; set; }
|
||||||
|
|
||||||
public int TeamID{ get; }
|
public int TeamID { get; }
|
||||||
|
|
||||||
public DDPlayerInfo Leader{ get; set; }
|
public DDPlayerInfo Leader { get; set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public DDBoard Board{ get; set; }
|
public DDBoard Board { get; set; }
|
||||||
|
|
||||||
public Dictionary<Mobile, DDPlayerInfo> Players{ get; }
|
public Dictionary<Mobile, DDPlayerInfo> Players { get; }
|
||||||
|
|
||||||
public DDPlayerInfo this[Mobile mob]
|
public DDPlayerInfo this[Mobile mob]
|
||||||
{
|
{
|
||||||
|
|
@ -305,21 +305,21 @@ namespace Server.Engines.ConPVP
|
||||||
}
|
}
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public int Color{ get; set; }
|
public int Color { get; set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public string TeamName{ get; set; }
|
public string TeamName { get; set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public Point3D Origin{ get; set; }
|
public Point3D Origin { get; set; }
|
||||||
|
|
||||||
public string Name => $"{TeamName} Team";
|
public string Name => $"{TeamName} Team";
|
||||||
|
|
||||||
public int Kills{ get; set; }
|
public int Kills { get; set; }
|
||||||
|
|
||||||
public int Captures{ get; set; }
|
public int Captures { get; set; }
|
||||||
|
|
||||||
public int Score{ get; set; }
|
public int Score { get; set; }
|
||||||
|
|
||||||
public void Reset()
|
public void Reset()
|
||||||
{
|
{
|
||||||
|
|
@ -370,7 +370,7 @@ namespace Server.Engines.ConPVP
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public DDTeamInfo[] TeamInfo{ get; private set; }
|
public DDTeamInfo[] TeamInfo { get; private set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public DDTeamInfo Team1 => TeamInfo[0];
|
public DDTeamInfo Team1 => TeamInfo[0];
|
||||||
|
|
@ -379,13 +379,13 @@ namespace Server.Engines.ConPVP
|
||||||
public DDTeamInfo Team2 => TeamInfo[1];
|
public DDTeamInfo Team2 => TeamInfo[1];
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public DDWayPoint PointA{ get; set; }
|
public DDWayPoint PointA { get; set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public DDWayPoint PointB{ get; set; }
|
public DDWayPoint PointB { get; set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public TimeSpan Duration{ get; set; }
|
public TimeSpan Duration { get; set; }
|
||||||
|
|
||||||
public override string Title => "DoubleDom";
|
public override string Title => "DoubleDom";
|
||||||
|
|
||||||
|
|
@ -449,7 +449,7 @@ namespace Server.Engines.ConPVP
|
||||||
|
|
||||||
public DDGame(DDController controller, DuelContext context) : base(context) => Controller = controller;
|
public DDGame(DDController controller, DuelContext context) : base(context) => Controller = controller;
|
||||||
|
|
||||||
public DDController Controller{ get; }
|
public DDController Controller { get; }
|
||||||
|
|
||||||
public Map Facet
|
public Map Facet
|
||||||
{
|
{
|
||||||
|
|
@ -693,7 +693,7 @@ namespace Server.Engines.ConPVP
|
||||||
if (mob == null)
|
if (mob == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
//"Red v Blue DD Champion"
|
// "Red v Blue DD Champion"
|
||||||
|
|
||||||
sb = new StringBuilder();
|
sb = new StringBuilder();
|
||||||
|
|
||||||
|
|
@ -1071,7 +1071,7 @@ namespace Server.Engines.ConPVP
|
||||||
{
|
{
|
||||||
base.Serialize(writer);
|
base.Serialize(writer);
|
||||||
|
|
||||||
writer.Write(0); //version
|
writer.Write(0); // version
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool OnMoveOver(Mobile m) => Addon.OnMoveOver(m);
|
public override bool OnMoveOver(Mobile m) => Addon.OnMoveOver(m);
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ namespace Server.Engines.ConPVP
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract string Title{ get; }
|
public abstract string Title { get; }
|
||||||
public abstract EventGame Construct(DuelContext dc);
|
public abstract EventGame Construct(DuelContext dc);
|
||||||
|
|
||||||
public abstract string GetTeamName(int teamID);
|
public abstract string GetTeamName(int teamID);
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ namespace Server.Engines.ConPVP
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public Mobile King{ get; private set; }
|
public Mobile King { get; private set; }
|
||||||
|
|
||||||
public KHGame Game
|
public KHGame Game
|
||||||
{
|
{
|
||||||
|
|
@ -47,7 +47,7 @@ namespace Server.Engines.ConPVP
|
||||||
}
|
}
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public int ScoreInterval{ get; set; }
|
public int ScoreInterval { get; set; }
|
||||||
|
|
||||||
public int CapturesSoFar
|
public int CapturesSoFar
|
||||||
{
|
{
|
||||||
|
|
@ -182,7 +182,7 @@ namespace Server.Engines.ConPVP
|
||||||
private class KingTimer : Timer
|
private class KingTimer : Timer
|
||||||
{
|
{
|
||||||
private int m_Counter;
|
private int m_Counter;
|
||||||
private HillOfTheKing m_Hill;
|
private readonly HillOfTheKing m_Hill;
|
||||||
|
|
||||||
public KingTimer(HillOfTheKing hill)
|
public KingTimer(HillOfTheKing hill)
|
||||||
: base(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.0))
|
: base(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.0))
|
||||||
|
|
@ -194,7 +194,7 @@ namespace Server.Engines.ConPVP
|
||||||
Priority = TimerPriority.FiftyMS;
|
Priority = TimerPriority.FiftyMS;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Captures{ get; private set; }
|
public int Captures { get; private set; }
|
||||||
|
|
||||||
public void StartHillTicker()
|
public void StartHillTicker()
|
||||||
{
|
{
|
||||||
|
|
@ -384,7 +384,7 @@ namespace Server.Engines.ConPVP
|
||||||
AddAlphaRegion(16, 15, 369, height - 29);
|
AddAlphaRegion(16, 15, 369, height - 29);
|
||||||
|
|
||||||
AddImage(215, -45, 0xEE40);
|
AddImage(215, -45, 0xEE40);
|
||||||
//AddImage( 330, 141, 0x8BA );
|
// AddImage( 330, 141, 0x8BA );
|
||||||
|
|
||||||
AddBorderedText(22, 22, 294, 20, Center("King of the Hill Scoreboard"), LabelColor32, BlackColor32);
|
AddBorderedText(22, 22, 294, 20, Center("King of the Hill Scoreboard"), LabelColor32, BlackColor32);
|
||||||
|
|
||||||
|
|
@ -486,7 +486,7 @@ namespace Server.Engines.ConPVP
|
||||||
|
|
||||||
private int m_Kills;
|
private int m_Kills;
|
||||||
private int m_Score;
|
private int m_Score;
|
||||||
private KHTeamInfo m_TeamInfo;
|
private readonly KHTeamInfo m_TeamInfo;
|
||||||
|
|
||||||
public KHPlayerInfo(KHTeamInfo teamInfo, Mobile player)
|
public KHPlayerInfo(KHTeamInfo teamInfo, Mobile player)
|
||||||
{
|
{
|
||||||
|
|
@ -494,7 +494,7 @@ namespace Server.Engines.ConPVP
|
||||||
Player = player;
|
Player = player;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Mobile Player{ get; }
|
public Mobile Player { get; }
|
||||||
|
|
||||||
public int CompareTo(KHPlayerInfo pi)
|
public int CompareTo(KHPlayerInfo pi)
|
||||||
{
|
{
|
||||||
|
|
@ -570,13 +570,13 @@ namespace Server.Engines.ConPVP
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public KHGame Game{ get; set; }
|
public KHGame Game { get; set; }
|
||||||
|
|
||||||
public int TeamID{ get; }
|
public int TeamID { get; }
|
||||||
|
|
||||||
public KHPlayerInfo Leader{ get; set; }
|
public KHPlayerInfo Leader { get; set; }
|
||||||
|
|
||||||
public Dictionary<Mobile, KHPlayerInfo> Players{ get; }
|
public Dictionary<Mobile, KHPlayerInfo> Players { get; }
|
||||||
|
|
||||||
public KHPlayerInfo this[Mobile mob]
|
public KHPlayerInfo this[Mobile mob]
|
||||||
{
|
{
|
||||||
|
|
@ -593,10 +593,10 @@ namespace Server.Engines.ConPVP
|
||||||
}
|
}
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public int Color{ get; set; }
|
public int Color { get; set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public string TeamName{ get; set; }
|
public string TeamName { get; set; }
|
||||||
|
|
||||||
public int CompareTo(KHTeamInfo ti)
|
public int CompareTo(KHTeamInfo ti)
|
||||||
{
|
{
|
||||||
|
|
@ -614,11 +614,11 @@ namespace Server.Engines.ConPVP
|
||||||
|
|
||||||
public string Name => $"{TeamName ?? "(none)"} Team";
|
public string Name => $"{TeamName ?? "(none)"} Team";
|
||||||
|
|
||||||
public int Kills{ get; set; }
|
public int Kills { get; set; }
|
||||||
|
|
||||||
public int Captures{ get; set; }
|
public int Captures { get; set; }
|
||||||
|
|
||||||
public int Score{ get; set; }
|
public int Score { get; set; }
|
||||||
|
|
||||||
public void Reset()
|
public void Reset()
|
||||||
{
|
{
|
||||||
|
|
@ -668,7 +668,7 @@ namespace Server.Engines.ConPVP
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public KHTeamInfo[] TeamInfo{ get; private set; }
|
public KHTeamInfo[] TeamInfo { get; private set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public KHTeamInfo Team1_W => TeamInfo[0];
|
public KHTeamInfo Team1_W => TeamInfo[0];
|
||||||
|
|
@ -694,7 +694,7 @@ namespace Server.Engines.ConPVP
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public KHTeamInfo Team8_NE => TeamInfo[7];
|
public KHTeamInfo Team8_NE => TeamInfo[7];
|
||||||
|
|
||||||
public HillOfTheKing[] Hills{ get; private set; }
|
public HillOfTheKing[] Hills { get; private set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public HillOfTheKing Hill1
|
public HillOfTheKing Hill1
|
||||||
|
|
@ -724,10 +724,10 @@ namespace Server.Engines.ConPVP
|
||||||
set => Hills[3] = value;
|
set => Hills[3] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<KHBoard> Boards{ get; private set; }
|
public List<KHBoard> Boards { get; private set; }
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public TimeSpan Duration{ get; set; }
|
public TimeSpan Duration { get; set; }
|
||||||
|
|
||||||
public override string Title => "King of the Hill";
|
public override string Title => "King of the Hill";
|
||||||
|
|
||||||
|
|
@ -806,7 +806,7 @@ namespace Server.Engines.ConPVP
|
||||||
|
|
||||||
public KHGame(KHController controller, DuelContext context) : base(context) => Controller = controller;
|
public KHGame(KHController controller, DuelContext context) : base(context) => Controller = controller;
|
||||||
|
|
||||||
public KHController Controller{ get; }
|
public KHController Controller { get; }
|
||||||
|
|
||||||
public Map Facet
|
public Map Facet
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -43,11 +43,11 @@ namespace Server.Engines.ConPVP
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<TourneyParticipant> Participants{ get; set; }
|
public List<TourneyParticipant> Participants { get; set; }
|
||||||
|
|
||||||
public TourneyParticipant Winner{ get; set; }
|
public TourneyParticipant Winner { get; set; }
|
||||||
|
|
||||||
public DuelContext Context{ get; set; }
|
public DuelContext Context { get; set; }
|
||||||
|
|
||||||
public bool InProgress => Context?.Registered == true;
|
public bool InProgress => Context?.Registered == true;
|
||||||
|
|
||||||
|
|
@ -67,7 +67,6 @@ namespace Server.Engines.ConPVP
|
||||||
TourneyPart = tourneyPart
|
TourneyPart = tourneyPart
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
for (int j = 0; j < tourneyPart.Players.Count; ++j)
|
for (int j = 0; j < tourneyPart.Players.Count; ++j)
|
||||||
duelPart.Add(tourneyPart.Players[j]);
|
duelPart.Add(tourneyPart.Players[j]);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,14 +14,13 @@ namespace Server.Engines.ConPVP
|
||||||
private const int LabelColor32 = 0xFFFFFF;
|
private const int LabelColor32 = 0xFFFFFF;
|
||||||
private bool m_Active;
|
private bool m_Active;
|
||||||
|
|
||||||
private Mobile m_From;
|
private readonly Mobile m_From;
|
||||||
private List<Mobile> m_Players;
|
private readonly List<Mobile> m_Players;
|
||||||
private Mobile m_Registrar;
|
private readonly Mobile m_Registrar;
|
||||||
private Mobile m_Requested;
|
private readonly Mobile m_Requested;
|
||||||
private Tournament m_Tournament;
|
private readonly Tournament m_Tournament;
|
||||||
|
|
||||||
public AcceptTeamGump(Mobile from, Mobile requested, Tournament tourney, Mobile registrar, List<Mobile> players) :
|
public AcceptTeamGump(Mobile from, Mobile requested, Tournament tourney, Mobile registrar, List<Mobile> players) : base(50, 50)
|
||||||
base(50, 50)
|
|
||||||
{
|
{
|
||||||
m_From = from;
|
m_From = from;
|
||||||
m_Requested = requested;
|
m_Requested = requested;
|
||||||
|
|
@ -31,8 +30,6 @@ namespace Server.Engines.ConPVP
|
||||||
|
|
||||||
m_Active = true;
|
m_Active = true;
|
||||||
|
|
||||||
#region Rules
|
|
||||||
|
|
||||||
Ruleset ruleset = tourney.Ruleset;
|
Ruleset ruleset = tourney.Ruleset;
|
||||||
Ruleset basedef = ruleset.Base;
|
Ruleset basedef = ruleset.Base;
|
||||||
|
|
||||||
|
|
@ -66,8 +63,6 @@ namespace Server.Engines.ConPVP
|
||||||
|
|
||||||
height += 10 + 22 + 25 + 25;
|
height += 10 + 22 + 25 + 25;
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
Closable = false;
|
Closable = false;
|
||||||
|
|
||||||
AddPage(0);
|
AddPage(0);
|
||||||
|
|
@ -124,8 +119,6 @@ namespace Server.Engines.ConPVP
|
||||||
AddImageTiled(32, 88, 264, 1, 9107);
|
AddImageTiled(32, 88, 264, 1, 9107);
|
||||||
AddImageTiled(42, 90, 264, 1, 9157);
|
AddImageTiled(42, 90, 264, 1, 9157);
|
||||||
|
|
||||||
#region Rules
|
|
||||||
|
|
||||||
int y = 100;
|
int y = 100;
|
||||||
|
|
||||||
var groupText = tourney.GroupType switch
|
var groupText = tourney.GroupType switch
|
||||||
|
|
@ -144,8 +137,8 @@ namespace Server.Engines.ConPVP
|
||||||
TieType.Random => "Random",
|
TieType.Random => "Random",
|
||||||
TieType.Highest => "Highest advances",
|
TieType.Highest => "Highest advances",
|
||||||
TieType.Lowest => "Lowest advances",
|
TieType.Lowest => "Lowest advances",
|
||||||
TieType.FullAdvancement => (tourney.ParticipantsPerMatch == 2 ? "Both advance" : "Everyone advances"),
|
TieType.FullAdvancement => tourney.ParticipantsPerMatch == 2 ? "Both advance" : "Everyone advances",
|
||||||
TieType.FullElimination => (tourney.ParticipantsPerMatch == 2 ? "Both eliminated" : "Everyone eliminated"),
|
TieType.FullElimination => tourney.ParticipantsPerMatch == 2 ? "Both eliminated" : "Everyone eliminated",
|
||||||
_ => null
|
_ => null
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -205,8 +198,6 @@ namespace Server.Engines.ConPVP
|
||||||
y += 20;
|
y += 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
y += 8;
|
y += 8;
|
||||||
AddImageTiled(32, y - 1, 264, 1, 9107);
|
AddImageTiled(32, y - 1, 264, 1, 9107);
|
||||||
AddImageTiled(42, y + 1, 264, 1, 9157);
|
AddImageTiled(42, y + 1, 264, 1, 9157);
|
||||||
|
|
|
||||||
|
|
@ -72,11 +72,11 @@ namespace Server.Engines.ConPVP
|
||||||
|
|
||||||
public class ArenaGump : Gump
|
public class ArenaGump : Gump
|
||||||
{
|
{
|
||||||
private List<Arena> m_Arenas;
|
private readonly List<Arena> m_Arenas;
|
||||||
|
|
||||||
private int m_ColumnX = 12;
|
private int m_ColumnX = 12;
|
||||||
private Mobile m_From;
|
private readonly Mobile m_From;
|
||||||
private ArenasMoongate m_Gate;
|
private readonly ArenasMoongate m_Gate;
|
||||||
|
|
||||||
public ArenaGump(Mobile from, ArenasMoongate gate) : base(50, 50)
|
public ArenaGump(Mobile from, ArenasMoongate gate) : base(50, 50)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,10 @@ namespace Server.Engines.ConPVP
|
||||||
{
|
{
|
||||||
private const int BlackColor32 = 0x000008;
|
private const int BlackColor32 = 0x000008;
|
||||||
private const int LabelColor32 = 0xFFFFFF;
|
private const int LabelColor32 = 0xFFFFFF;
|
||||||
private Mobile m_From;
|
private readonly Mobile m_From;
|
||||||
private List<Mobile> m_Players;
|
private readonly List<Mobile> m_Players;
|
||||||
private Mobile m_Registrar;
|
private readonly Mobile m_Registrar;
|
||||||
private Tournament m_Tournament;
|
private readonly Tournament m_Tournament;
|
||||||
|
|
||||||
public ConfirmSignupGump(Mobile from, Mobile registrar, Tournament tourney, List<Mobile> players) : base(50, 50)
|
public ConfirmSignupGump(Mobile from, Mobile registrar, Tournament tourney, List<Mobile> players) : base(50, 50)
|
||||||
{
|
{
|
||||||
|
|
@ -31,8 +31,6 @@ namespace Server.Engines.ConPVP
|
||||||
m_From.CloseGump<DuelContextGump>();
|
m_From.CloseGump<DuelContextGump>();
|
||||||
m_From.CloseGump<ConfirmSignupGump>();
|
m_From.CloseGump<ConfirmSignupGump>();
|
||||||
|
|
||||||
#region Rules
|
|
||||||
|
|
||||||
Ruleset ruleset = tourney.Ruleset;
|
Ruleset ruleset = tourney.Ruleset;
|
||||||
Ruleset basedef = ruleset.Base;
|
Ruleset basedef = ruleset.Base;
|
||||||
|
|
||||||
|
|
@ -69,21 +67,19 @@ namespace Server.Engines.ConPVP
|
||||||
if (tourney.PlayersPerParticipant > 1)
|
if (tourney.PlayersPerParticipant > 1)
|
||||||
height += 36 + tourney.PlayersPerParticipant * 20;
|
height += 36 + tourney.PlayersPerParticipant * 20;
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
Closable = false;
|
Closable = false;
|
||||||
|
|
||||||
AddPage(0);
|
AddPage(0);
|
||||||
|
|
||||||
//AddBackground( 0, 0, 400, 220, 9150 );
|
// AddBackground( 0, 0, 400, 220, 9150 );
|
||||||
AddBackground(1, 1, 398, height, 3600);
|
AddBackground(1, 1, 398, height, 3600);
|
||||||
//AddBackground( 16, 15, 369, 189, 9100 );
|
// AddBackground( 16, 15, 369, 189, 9100 );
|
||||||
|
|
||||||
AddImageTiled(16, 15, 369, height - 29, 3604);
|
AddImageTiled(16, 15, 369, height - 29, 3604);
|
||||||
AddAlphaRegion(16, 15, 369, height - 29);
|
AddAlphaRegion(16, 15, 369, height - 29);
|
||||||
|
|
||||||
AddImage(215, -43, 0xEE40);
|
AddImage(215, -43, 0xEE40);
|
||||||
//AddImage( 330, 141, 0x8BA );
|
// AddImage( 330, 141, 0x8BA );
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
|
|
@ -128,8 +124,6 @@ namespace Server.Engines.ConPVP
|
||||||
AddImageTiled(32, 88, 264, 1, 9107);
|
AddImageTiled(32, 88, 264, 1, 9107);
|
||||||
AddImageTiled(42, 90, 264, 1, 9157);
|
AddImageTiled(42, 90, 264, 1, 9157);
|
||||||
|
|
||||||
#region Rules
|
|
||||||
|
|
||||||
int y = 100;
|
int y = 100;
|
||||||
|
|
||||||
var groupText = tourney.GroupType switch
|
var groupText = tourney.GroupType switch
|
||||||
|
|
@ -148,8 +142,8 @@ namespace Server.Engines.ConPVP
|
||||||
TieType.Random => "Random",
|
TieType.Random => "Random",
|
||||||
TieType.Highest => "Highest advances",
|
TieType.Highest => "Highest advances",
|
||||||
TieType.Lowest => "Lowest advances",
|
TieType.Lowest => "Lowest advances",
|
||||||
TieType.FullAdvancement => (tourney.ParticipantsPerMatch == 2 ? "Both advance" : "Everyone advances"),
|
TieType.FullAdvancement => tourney.ParticipantsPerMatch == 2 ? "Both advance" : "Everyone advances",
|
||||||
TieType.FullElimination => (tourney.ParticipantsPerMatch == 2 ? "Both eliminated" : "Everyone eliminated"),
|
TieType.FullElimination => tourney.ParticipantsPerMatch == 2 ? "Both eliminated" : "Everyone eliminated",
|
||||||
_ => null
|
_ => null
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -209,10 +203,6 @@ namespace Server.Engines.ConPVP
|
||||||
y += 20;
|
y += 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Team
|
|
||||||
|
|
||||||
if (tourney.PlayersPerParticipant > 1)
|
if (tourney.PlayersPerParticipant > 1)
|
||||||
{
|
{
|
||||||
y += 8;
|
y += 8;
|
||||||
|
|
@ -244,8 +234,6 @@ namespace Server.Engines.ConPVP
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
y += 8;
|
y += 8;
|
||||||
AddImageTiled(32, y - 1, 264, 1, 9107);
|
AddImageTiled(32, y - 1, 264, 1, 9107);
|
||||||
AddImageTiled(42, y + 1, 264, 1, 9157);
|
AddImageTiled(42, y + 1, 264, 1, 9157);
|
||||||
|
|
|
||||||
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