Cleanup & Fixes for .NET 5 (#309)
- [X] Fixes several bugs - [X] Updates more ordinal issues - [X] Cleans up the code a bit - [X] Turns classes static that should have been - [X] Changes TcpServer.Instances to a HashSet Bumps release version
This commit is contained in:
parent
4ad8811df2
commit
525cda5413
266 changed files with 1348 additions and 1800 deletions
|
|
@ -26,7 +26,7 @@ namespace Server.Engines.BulkOrders
|
|||
Leather
|
||||
}
|
||||
|
||||
public class BGTClassifier
|
||||
public static class BGTClassifier
|
||||
{
|
||||
public static BulkGenericType Classify(BODType deedType, Type itemType)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ namespace Server.Engines.BulkOrders
|
|||
|
||||
while ((line = ip.ReadLine()) != null)
|
||||
{
|
||||
if (line.Length == 0 || line.StartsWith("#"))
|
||||
if (line.Length == 0 || line.StartsWith("#", StringComparison.Ordinal))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Engines.Chat
|
||||
{
|
||||
public class ChatActionHandlers
|
||||
public static class ChatActionHandlers
|
||||
{
|
||||
private static readonly ChatActionHandler[] m_Handlers;
|
||||
|
||||
|
|
@ -84,7 +86,7 @@ namespace Server.Engines.Chat
|
|||
|
||||
public static void PrivateMessage(ChatUser from, Channel channel, string param)
|
||||
{
|
||||
var indexOf = param.IndexOf(' ');
|
||||
var indexOf = param.IndexOf(' ', StringComparison.Ordinal);
|
||||
|
||||
var name = param.Substring(0, indexOf);
|
||||
var text = param.Substring(indexOf + 1);
|
||||
|
|
@ -171,7 +173,7 @@ namespace Server.Engines.Chat
|
|||
string name;
|
||||
string password = null;
|
||||
|
||||
var start = param.IndexOf('\"');
|
||||
var start = param.IndexOf('\"', StringComparison.Ordinal);
|
||||
|
||||
if (start >= 0)
|
||||
{
|
||||
|
|
@ -189,7 +191,7 @@ namespace Server.Engines.Chat
|
|||
}
|
||||
else
|
||||
{
|
||||
var indexOf = param.IndexOf(' ');
|
||||
var indexOf = param.IndexOf(' ', StringComparison.Ordinal);
|
||||
|
||||
if (indexOf >= 0)
|
||||
{
|
||||
|
|
@ -226,7 +228,7 @@ namespace Server.Engines.Chat
|
|||
string name;
|
||||
string password = null;
|
||||
|
||||
var start = param.IndexOf('{');
|
||||
var start = param.IndexOf('{', StringComparison.Ordinal);
|
||||
|
||||
if (start >= 0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -800,7 +800,7 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
if (!m_Bomb.m_Flying && m_Bomb.Map != Map.Internal)
|
||||
{
|
||||
Effects.SendLocationEffect(m_Bomb.GetWorldLocation(), m_Bomb.Map, 0x377A, 16, 10, m_Bomb.Hue, 0);
|
||||
Effects.SendLocationEffect(m_Bomb.GetWorldLocation(), m_Bomb.Map, 0x377A, 16, 10, m_Bomb.Hue);
|
||||
}
|
||||
|
||||
if (m_Bomb.Location != m_Bomb.m_Game.Controller.BombHome)
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ namespace Server.Engines.ConPVP
|
|||
hasAppended = true;
|
||||
}
|
||||
|
||||
sb.Append(".");
|
||||
sb.Append('.');
|
||||
|
||||
part.AddLog(sb.ToString());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
|
@ -25,7 +26,7 @@ namespace Server.Engines.ConPVP
|
|||
private const int BlackColor32 = 0x000008;
|
||||
private const int LabelColor32 = 0xFFFFFF;
|
||||
private readonly Mobile m_From;
|
||||
private readonly List<object> m_List;
|
||||
private List<object> m_List;
|
||||
private readonly object m_Object;
|
||||
private readonly int m_Page;
|
||||
private readonly Tournament m_Tournament;
|
||||
|
|
@ -279,9 +280,8 @@ namespace Server.Engines.ConPVP
|
|||
AddPage(0);
|
||||
AddBackground(0, 0, 300, 300, 9380);
|
||||
|
||||
var pList = m_List != null
|
||||
? Utility.CastListCovariant<object, TourneyParticipant>(m_List)
|
||||
: new List<TourneyParticipant>(tourney.Participants);
|
||||
var pList = m_List?.CastListCovariant<object, TourneyParticipant>()
|
||||
?? new List<TourneyParticipant>(tourney.Participants);
|
||||
|
||||
AddLeftArrow(25, 11, ToButtonID(0, 0));
|
||||
AddHtml(25, 35, 250, 20, Center($"{pList.Count} Participant{(pList.Count == 1 ? "" : "s")}"));
|
||||
|
|
@ -440,7 +440,7 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
|
||||
var matchesList = m_List != null
|
||||
? Utility.CastListCovariant<object, TourneyMatch>(m_List)
|
||||
? m_List.CastListCovariant<object, TourneyMatch>()
|
||||
: new List<TourneyMatch>(level.Matches);
|
||||
|
||||
AddRightArrow(
|
||||
|
|
@ -522,31 +522,14 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
if (m_Tournament.ParticipantsPerMatch == 4)
|
||||
{
|
||||
var name = "(null)";
|
||||
|
||||
switch (j)
|
||||
var name = j switch
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
name = "Minax";
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
name = "Council of Mages";
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
name = "True Britannians";
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
name = "Shadowlords";
|
||||
break;
|
||||
}
|
||||
}
|
||||
0 => "Minax",
|
||||
1 => "Council of Mages",
|
||||
2 => "True Britannians",
|
||||
3 => "Shadowlords",
|
||||
_ => "(null)"
|
||||
};
|
||||
|
||||
txt = $"{name} ({part.Players.Count})";
|
||||
}
|
||||
|
|
@ -658,31 +641,14 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
if (m_Tournament.ParticipantsPerMatch == 4)
|
||||
{
|
||||
var name = "(null)";
|
||||
|
||||
switch (i)
|
||||
var name = i switch
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
name = "Minax";
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
name = "Council of Mages";
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
name = "True Britannians";
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
name = "Shadowlords";
|
||||
break;
|
||||
}
|
||||
}
|
||||
0 => "Minax",
|
||||
1 => "Council of Mages",
|
||||
2 => "True Britannians",
|
||||
3 => "Shadowlords",
|
||||
_ => "(null)"
|
||||
};
|
||||
|
||||
AddRightArrow(
|
||||
25,
|
||||
|
|
|
|||
|
|
@ -478,7 +478,7 @@ namespace Server.Engines.ConPVP
|
|||
hasAppended = true;
|
||||
}
|
||||
|
||||
sb.Append(".");
|
||||
sb.Append('.');
|
||||
|
||||
if (TourneyType == TourneyType.Standard)
|
||||
{
|
||||
|
|
@ -784,35 +784,14 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
if (m_ParticipantsPerMatch == 4)
|
||||
{
|
||||
var name = "(null)";
|
||||
|
||||
switch (Pyramid.Levels[0]
|
||||
.Matches[0]
|
||||
.Participants.IndexOf(
|
||||
winner
|
||||
))
|
||||
var name = Pyramid.Levels[0].Matches[0].Participants.IndexOf(winner) switch
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
name = "Minax";
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
name = "Council of Mages";
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
name = "True Britannians";
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
name = "Shadowlords";
|
||||
break;
|
||||
}
|
||||
}
|
||||
0 => "Minax",
|
||||
1 => "Council of Mages",
|
||||
2 => "True Britannians",
|
||||
3 => "Shadowlords",
|
||||
_ => "(null)"
|
||||
};
|
||||
|
||||
Alert("The tournament has completed!", $"The {name} team has won!");
|
||||
}
|
||||
|
|
@ -940,33 +919,14 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
if (m_ParticipantsPerMatch == 4)
|
||||
{
|
||||
var name = "(null)";
|
||||
|
||||
switch (Pyramid.Levels[0]
|
||||
.Matches[0]
|
||||
.Participants.IndexOf(winner))
|
||||
var name = Pyramid.Levels[0].Matches[0].Participants.IndexOf(winner) switch
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
name = "Minax";
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
name = "Council of Mages";
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
name = "True Britannians";
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
name = "Shadowlords";
|
||||
break;
|
||||
}
|
||||
}
|
||||
0 => "Minax",
|
||||
1 => "Council of Mages",
|
||||
2 => "True Britannians",
|
||||
3 => "Shadowlords",
|
||||
_ => "(null)"
|
||||
};
|
||||
|
||||
Alert("The tournament has completed!", $"The {name} team has won!");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -456,7 +456,7 @@ namespace Server.Engines.Craft
|
|||
{
|
||||
if (types.Length != amounts.Length)
|
||||
{
|
||||
throw new ArgumentException();
|
||||
throw new ArgumentOutOfRangeException(nameof(types));
|
||||
}
|
||||
|
||||
var items = new Item[types.Length][];
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ namespace Server.Engines.Craft
|
|||
NoSkill
|
||||
}
|
||||
|
||||
public class Enhance
|
||||
public static class Enhance
|
||||
{
|
||||
public static EnhanceResult Invoke(
|
||||
Mobile from, CraftSystem craftSystem, BaseTool tool, Item item,
|
||||
|
|
|
|||
|
|
@ -43,8 +43,7 @@ namespace Server.Engines.Craft
|
|||
CommandSystem.Register("ForgetAllRecipes", AccessLevel.GameMaster, ForgetAllRecipes_OnCommand);
|
||||
}
|
||||
|
||||
[Usage("LearnAllRecipes")]
|
||||
[Description("Teaches a player all available recipes.")]
|
||||
[Usage("LearnAllRecipes"), Description("Teaches a player all available recipes.")]
|
||||
private static void LearnAllRecipes_OnCommand(CommandEventArgs e)
|
||||
{
|
||||
var m = e.Mobile;
|
||||
|
|
@ -73,8 +72,7 @@ namespace Server.Engines.Craft
|
|||
);
|
||||
}
|
||||
|
||||
[Usage("ForgetAllRecipes")]
|
||||
[Description("Makes a player forget all the recipes they've learned.")]
|
||||
[Usage("ForgetAllRecipes"), Description("Makes a player forget all the recipes they've learned.")]
|
||||
private static void ForgetAllRecipes_OnCommand(CommandEventArgs e)
|
||||
{
|
||||
var m = e.Mobile;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ using Server.Targeting;
|
|||
|
||||
namespace Server.Engines.Craft
|
||||
{
|
||||
public class Repair
|
||||
public static class Repair
|
||||
{
|
||||
public static void Do(Mobile from, CraftSystem craftSystem, BaseTool tool)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1351,10 +1351,12 @@ namespace Server.Engines.Craft
|
|||
}
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class ForgeAttribute : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class AnvilAttribute : Attribute
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -189,8 +189,7 @@ namespace Server.Engines.Doom
|
|||
CommandSystem.Register("GenLeverPuzzle", AccessLevel.Administrator, GenLampPuzzle_OnCommand);
|
||||
}
|
||||
|
||||
[Usage("GenLeverPuzzle")]
|
||||
[Description("Generates lamp room and lever puzzle in doom.")]
|
||||
[Usage("GenLeverPuzzle"), Description("Generates lamp room and lever puzzle in doom.")]
|
||||
public static void GenLampPuzzle_OnCommand(CommandEventArgs e)
|
||||
{
|
||||
if (Map.Malas.GetItemsInRange(lp_Center, 0).OfType<LeverPuzzleController>().Any())
|
||||
|
|
@ -372,7 +371,7 @@ namespace Server.Engines.Doom
|
|||
SendLocationEffect(lp_Center, 0x1153, 0, 60, 1);
|
||||
PlaySounds(lp_Center, cs1);
|
||||
|
||||
Effects.SendBoltEffect(player, true);
|
||||
Effects.SendBoltEffect(player);
|
||||
player.MoveToWorld(lr_Enter, Map.Malas);
|
||||
|
||||
m_Timer = new LampRoomTimer(this);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ using System.Linq;
|
|||
|
||||
namespace Server.Factions
|
||||
{
|
||||
public class Generator
|
||||
public static class Generator
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
|
|
@ -35,14 +35,14 @@ namespace Server.Factions
|
|||
|
||||
var def = town.Definition;
|
||||
|
||||
if (!CheckExistance(def.Monolith, facet, typeof(TownMonolith)))
|
||||
if (!CheckExistence(def.Monolith, facet, typeof(TownMonolith)))
|
||||
{
|
||||
var mono = new TownMonolith(town);
|
||||
mono.MoveToWorld(def.Monolith, facet);
|
||||
mono.Sigil = new Sigil(town);
|
||||
}
|
||||
|
||||
if (!CheckExistance(def.TownStone, facet, typeof(TownStone)))
|
||||
if (!CheckExistence(def.TownStone, facet, typeof(TownStone)))
|
||||
{
|
||||
new TownStone(town).MoveToWorld(def.TownStone, facet);
|
||||
}
|
||||
|
|
@ -56,12 +56,12 @@ namespace Server.Factions
|
|||
|
||||
var stronghold = faction.Definition.Stronghold;
|
||||
|
||||
if (!CheckExistance(stronghold.JoinStone, facet, typeof(JoinStone)))
|
||||
if (!CheckExistence(stronghold.JoinStone, facet, typeof(JoinStone)))
|
||||
{
|
||||
new JoinStone(faction).MoveToWorld(stronghold.JoinStone, facet);
|
||||
}
|
||||
|
||||
if (!CheckExistance(stronghold.FactionStone, facet, typeof(FactionStone)))
|
||||
if (!CheckExistence(stronghold.FactionStone, facet, typeof(FactionStone)))
|
||||
{
|
||||
new FactionStone(faction).MoveToWorld(stronghold.FactionStone, facet);
|
||||
}
|
||||
|
|
@ -70,14 +70,14 @@ namespace Server.Factions
|
|||
{
|
||||
var monolith = stronghold.Monoliths[i];
|
||||
|
||||
if (!CheckExistance(monolith, facet, typeof(StrongholdMonolith)))
|
||||
if (!CheckExistence(monolith, facet, typeof(StrongholdMonolith)))
|
||||
{
|
||||
new StrongholdMonolith(towns[i], faction).MoveToWorld(monolith, facet);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static bool CheckExistance(Point3D loc, Map facet, Type type) =>
|
||||
private static bool CheckExistence(Point3D loc, Map facet, Type type) =>
|
||||
facet.GetItemsInRange(loc, 0).Any(type.IsInstanceOfType);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ namespace Server.Factions
|
|||
public TextDefinition Assigned { get; }
|
||||
}
|
||||
|
||||
public class MerchantTitles
|
||||
public static class MerchantTitles
|
||||
{
|
||||
public static MerchantTitleInfo[] Info { get; } =
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ using Server.Utilities;
|
|||
|
||||
namespace Server.Factions
|
||||
{
|
||||
public class Reflector
|
||||
public static class Reflector
|
||||
{
|
||||
private static List<Town> m_Towns;
|
||||
|
||||
|
|
|
|||
|
|
@ -286,7 +286,7 @@ namespace Server.Factions
|
|||
|
||||
public void ConstructGuardLists()
|
||||
{
|
||||
var defs = Owner?.Definition.Guards ?? new GuardDefinition[0];
|
||||
var defs = Owner?.Definition.Guards ?? Array.Empty<GuardDefinition>();
|
||||
|
||||
GuardLists = new List<GuardList>();
|
||||
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ namespace Server.Factions
|
|||
|
||||
var silverToAward = from.Alive ? 20 : 40;
|
||||
|
||||
if (silverToAward > 0 && Placer != null && Faction != null)
|
||||
if (Placer != null && Faction != null)
|
||||
{
|
||||
var victimState = PlayerState.Find(from);
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ namespace Server.Factions
|
|||
|
||||
public override void DoVisibleEffect()
|
||||
{
|
||||
Effects.SendLocationEffect(GetWorldLocation(), Map, 0x36BD, 15, 10);
|
||||
Effects.SendLocationEffect(GetWorldLocation(), Map, 0x36BD, 15);
|
||||
}
|
||||
|
||||
public override void DoAttackEffect(Mobile m)
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ namespace Server.Factions
|
|||
|
||||
public override void DoVisibleEffect()
|
||||
{
|
||||
Effects.SendLocationEffect(Location, Map, 0x11AD, 25, 10);
|
||||
Effects.SendLocationEffect(Location, Map, 0x11AD, 25);
|
||||
}
|
||||
|
||||
public override void DoAttackEffect(Mobile m)
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ namespace Server.Engines.Help
|
|||
}
|
||||
}
|
||||
|
||||
public class PageQueue
|
||||
public static class PageQueue
|
||||
{
|
||||
private static readonly Dictionary<Mobile, PageEntry> m_KeyedByHandler = new Dictionary<Mobile, PageEntry>();
|
||||
private static readonly Dictionary<Mobile, PageEntry> m_KeyedBySender = new Dictionary<Mobile, PageEntry>();
|
||||
|
|
@ -172,8 +172,7 @@ namespace Server.Engines.Help
|
|||
}
|
||||
}
|
||||
|
||||
[Usage("Pages")]
|
||||
[Description("Opens the page queue menu.")]
|
||||
[Usage("Pages"), Description("Opens the page queue menu.")]
|
||||
private static void Pages_OnCommand(CommandEventArgs e)
|
||||
{
|
||||
if (m_KeyedByHandler.TryGetValue(e.Mobile, out var entry))
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ namespace Server.Engines.Help
|
|||
|
||||
while ((line = ip.ReadLine()?.Trim()) != null)
|
||||
{
|
||||
if (line.Length == 0 || line.StartsWith("#"))
|
||||
if (line.Length == 0 || line.StartsWith("#", StringComparison.Ordinal))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,8 +34,7 @@ namespace Server.Engines.Help
|
|||
CommandSystem.Register("SpeechLog", AccessLevel.Counselor, SpeechLog_OnCommand);
|
||||
}
|
||||
|
||||
[Usage("SpeechLog")]
|
||||
[Description("Opens the speech log of a given target.")]
|
||||
[Usage("SpeechLog"), Description("Opens the speech log of a given target.")]
|
||||
private static void SpeechLog_OnCommand(CommandEventArgs e)
|
||||
{
|
||||
var from = e.Mobile;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ using Server.Items;
|
|||
|
||||
namespace Server.Commands
|
||||
{
|
||||
public class GenKhaldun
|
||||
public static class GenKhaldun
|
||||
{
|
||||
private static int m_Count;
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,9 @@ namespace Server.Engines.MLQuests
|
|||
|
||||
while ((line = sr.ReadLine()) != null)
|
||||
{
|
||||
if (line.Length == 0 || line.StartsWith("#"))
|
||||
line = line.Trim();
|
||||
|
||||
if (line.Length == 0 || line.StartsWith("#", StringComparison.Ordinal))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
@ -176,8 +178,8 @@ namespace Server.Engines.MLQuests
|
|||
EventSink.QuestGumpRequest += EventSink_QuestGumpRequest;
|
||||
}
|
||||
|
||||
[Usage("MLQuestsInfo")]
|
||||
[Description("Displays general information about the ML quest system, or a quest by type name.")]
|
||||
[Usage("MLQuestsInfo"),
|
||||
Description("Displays general information about the ML quest system, or a quest by type name.")]
|
||||
public static void MLQuestsInfo_OnCommand(CommandEventArgs e)
|
||||
{
|
||||
var m = e.Mobile;
|
||||
|
|
@ -202,8 +204,8 @@ namespace Server.Engines.MLQuests
|
|||
m.SendMessage("Number of active instances: {0}", quest.Instances.Count);
|
||||
}
|
||||
|
||||
[Usage("SaveQuest <type> [saveEnabled=true]")]
|
||||
[Description("Allows serialization for a specific quest to be turned on or off.")]
|
||||
[Usage("SaveQuest <type> [saveEnabled=true]"),
|
||||
Description("Allows serialization for a specific quest to be turned on or off.")]
|
||||
public static void SaveQuest_OnCommand(CommandEventArgs e)
|
||||
{
|
||||
var m = e.Mobile;
|
||||
|
|
@ -235,8 +237,8 @@ namespace Server.Engines.MLQuests
|
|||
}
|
||||
}
|
||||
|
||||
[Usage("SaveAllQuests [saveEnabled=true]")]
|
||||
[Description("Allows serialization for all quests to be turned on or off.")]
|
||||
[Usage("SaveAllQuests [saveEnabled=true]"),
|
||||
Description("Allows serialization for all quests to be turned on or off.")]
|
||||
public static void SaveAllQuests_OnCommand(CommandEventArgs e)
|
||||
{
|
||||
var m = e.Mobile;
|
||||
|
|
@ -264,8 +266,8 @@ namespace Server.Engines.MLQuests
|
|||
}
|
||||
}
|
||||
|
||||
[Usage("InvalidQuestItems")]
|
||||
[Description("Provides an overview of all quest items not located in the top-level of a player's backpack.")]
|
||||
[Usage("InvalidQuestItems"),
|
||||
Description("Provides an overview of all quest items not located in the top-level of a player's backpack.")]
|
||||
public static void InvalidQuestItems_OnCommand(CommandEventArgs e)
|
||||
{
|
||||
var m = e.Mobile;
|
||||
|
|
|
|||
|
|
@ -295,8 +295,7 @@ namespace Server.PathAlgorithms.FastAStar
|
|||
int y;
|
||||
switch (i)
|
||||
{
|
||||
default:
|
||||
case 0:
|
||||
default: // 0
|
||||
x = 0;
|
||||
y = -1;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -99,13 +99,13 @@ namespace Server.PathAlgorithms.SlowAStar
|
|||
var yBacktrack = curNode.py;
|
||||
var zBacktrack = curNode.pz;
|
||||
|
||||
path[pathCount++] = (Direction)curNode.dir;
|
||||
|
||||
if (pathCount == MaxNodes)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
path[pathCount++] = (Direction)curNode.dir;
|
||||
|
||||
while (xBacktrack != startNode.x || yBacktrack != startNode.y || zBacktrack != startNode.z)
|
||||
{
|
||||
var found = false;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Engines.Quests.Necro
|
||||
{
|
||||
|
|
@ -32,21 +31,46 @@ namespace Server.Engines.Quests.Necro
|
|||
return;
|
||||
}
|
||||
|
||||
if (from is PlayerMobile pm)
|
||||
if (!(from is PlayerMobile pm))
|
||||
{
|
||||
var qs = pm.Quest;
|
||||
return;
|
||||
}
|
||||
|
||||
if (qs is DarkTidesQuest)
|
||||
var qs = pm.Quest;
|
||||
|
||||
if (qs is DarkTidesQuest)
|
||||
{
|
||||
if (qs.IsObjectiveInProgress(typeof(FindMardothAboutKronusObjective)))
|
||||
{
|
||||
if (qs.IsObjectiveInProgress(typeof(FindMardothAboutKronusObjective)))
|
||||
pm.SendLocalizedMessage(
|
||||
1060151,
|
||||
"",
|
||||
0x41
|
||||
); // You read the scroll, but decide against performing the calling until you are instructed to do so by Mardoth.
|
||||
}
|
||||
else if (qs.IsObjectiveInProgress(typeof(FindWellOfTearsObjective)))
|
||||
{
|
||||
pm.SendLocalizedMessage(
|
||||
1060152,
|
||||
"",
|
||||
0x41
|
||||
); // You must be at the Well of Tears in the city of Necromancers to use this scroll.
|
||||
}
|
||||
else if (qs.IsObjectiveInProgress(typeof(UseCallingScrollObjective)))
|
||||
{
|
||||
if (pm.Map == m_WellOfTearsMap && m_WellOfTearsArea.Contains(pm))
|
||||
{
|
||||
pm.SendLocalizedMessage(
|
||||
1060151,
|
||||
"",
|
||||
0x41
|
||||
); // You read the scroll, but decide against performing the calling until you are instructed to do so by Mardoth.
|
||||
QuestObjective obj = qs.FindObjective<UseCallingScrollObjective>();
|
||||
|
||||
if (obj?.Completed == false)
|
||||
{
|
||||
obj.Complete();
|
||||
}
|
||||
|
||||
Delete();
|
||||
new CallingTimer(pm).Start();
|
||||
}
|
||||
else if (qs.IsObjectiveInProgress(typeof(FindWellOfTearsObjective)))
|
||||
else
|
||||
{
|
||||
pm.SendLocalizedMessage(
|
||||
1060152,
|
||||
|
|
@ -54,37 +78,14 @@ namespace Server.Engines.Quests.Necro
|
|||
0x41
|
||||
); // You must be at the Well of Tears in the city of Necromancers to use this scroll.
|
||||
}
|
||||
else if (qs.IsObjectiveInProgress(typeof(UseCallingScrollObjective)))
|
||||
{
|
||||
if (pm.Map == m_WellOfTearsMap && m_WellOfTearsArea.Contains(pm))
|
||||
{
|
||||
QuestObjective obj = qs.FindObjective<UseCallingScrollObjective>();
|
||||
|
||||
if (obj?.Completed == false)
|
||||
{
|
||||
obj.Complete();
|
||||
}
|
||||
|
||||
Delete();
|
||||
new CallingTimer(pm).Start();
|
||||
}
|
||||
else
|
||||
{
|
||||
pm.SendLocalizedMessage(
|
||||
1060152,
|
||||
"",
|
||||
0x41
|
||||
); // You must be at the Well of Tears in the city of Necromancers to use this scroll.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pm.SendLocalizedMessage(
|
||||
1060150,
|
||||
"",
|
||||
0x41
|
||||
); // A strange terror grips your heart as you attempt to read the scroll. You decide it would be a bad idea to read it out loud.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pm.SendLocalizedMessage(
|
||||
1060150,
|
||||
"",
|
||||
0x41
|
||||
); // A strange terror grips your heart as you attempt to read the scroll. You decide it would be a bad idea to read it out loud.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,9 +78,9 @@ namespace Server.Engines.Quests.Necro
|
|||
Maabus.Delete();
|
||||
Maabus = null;
|
||||
|
||||
foreach (MaabusCoffinComponent c in Components)
|
||||
foreach (var c in Components)
|
||||
{
|
||||
c.TurnToFull();
|
||||
(c as MaabusCoffinComponent)?.TurnToFull();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ namespace Server.Engines.Quests.Hag
|
|||
Corpse = new HagApprenticeCorpse();
|
||||
Corpse.MoveToWorld(m_CorpseLocation, map);
|
||||
|
||||
Effects.SendLocationEffect(m_CorpseLocation, map, 0x3728, 10, 10);
|
||||
Effects.SendLocationEffect(m_CorpseLocation, map, 0x3728, 10);
|
||||
Effects.PlaySound(m_CorpseLocation, map, 0x1FE);
|
||||
|
||||
Mobile imp = new Zeefzorpul();
|
||||
|
|
@ -65,7 +65,7 @@ namespace Server.Engines.Quests.Hag
|
|||
{
|
||||
if (m?.Deleted == false)
|
||||
{
|
||||
Effects.SendLocationEffect(m.Location, m.Map, 0x3728, 10, 10);
|
||||
Effects.SendLocationEffect(m.Location, m.Map, 0x3728, 10);
|
||||
Effects.PlaySound(m.Location, m.Map, 0x1FE);
|
||||
|
||||
m.Delete();
|
||||
|
|
@ -213,7 +213,7 @@ namespace Server.Engines.Quests.Hag
|
|||
Mobile from = System.From;
|
||||
var map = from.Map;
|
||||
|
||||
Effects.SendLocationEffect(ImpLocation, map, 0x3728, 10, 10);
|
||||
Effects.SendLocationEffect(ImpLocation, map, 0x3728, 10);
|
||||
Effects.PlaySound(ImpLocation, map, 0x1FE);
|
||||
|
||||
Mobile imp = new Zeefzorpul();
|
||||
|
|
@ -228,7 +228,7 @@ namespace Server.Engines.Quests.Hag
|
|||
{
|
||||
if (imp is Mobile m && !m.Deleted)
|
||||
{
|
||||
Effects.SendLocationEffect(m.Location, m.Map, 0x3728, 10, 10);
|
||||
Effects.SendLocationEffect(m.Location, m.Map, 0x3728, 10);
|
||||
Effects.PlaySound(m.Location, m.Map, 0x1FE);
|
||||
|
||||
m.Delete();
|
||||
|
|
|
|||
|
|
@ -228,12 +228,8 @@ namespace Server.Items
|
|||
return true;
|
||||
}
|
||||
|
||||
if (i is ITokunoDyable)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return IsInTypeList(t, TreasuresOfTokuno.LesserArtifactsTotal)
|
||||
return IsInTypeList(t, TreasuresOfTokuno.TokunoDyable)
|
||||
|| IsInTypeList(t, TreasuresOfTokuno.LesserArtifactsTotal)
|
||||
|| IsInTypeList(t, TreasuresOfTokuno.GreaterArtifacts)
|
||||
|| IsInTypeList(t, DemonKnight.ArtifactRarity10)
|
||||
|| IsInTypeList(t, DemonKnight.ArtifactRarity11)
|
||||
|
|
@ -251,7 +247,7 @@ namespace Server.Items
|
|||
{
|
||||
for (var i = 0; i < list.Length; i++)
|
||||
{
|
||||
if (list[i] == t)
|
||||
if (list[i].IsAssignableFrom(t))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -783,8 +783,7 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
|
||||
[Furniture]
|
||||
[Flippable(0x2811, 0x2812)]
|
||||
[Furniture, Flippable(0x2811, 0x2812)]
|
||||
public class ChestOfHeirlooms : LockableContainer
|
||||
{
|
||||
[Constructible]
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ namespace Server.Misc
|
|||
ToTThree
|
||||
}
|
||||
|
||||
public class TreasuresOfTokuno
|
||||
public static class TreasuresOfTokuno
|
||||
{
|
||||
public const int ItemsPerReward = 10;
|
||||
|
||||
|
|
@ -80,6 +80,12 @@ namespace Server.Misc
|
|||
typeof(ChestOfHeirlooms)
|
||||
};
|
||||
|
||||
public static Type[] TokunoDyable { get; } =
|
||||
{
|
||||
typeof(DupresShield), typeof(CrimsonCincture), typeof(OssianGrimoire), typeof(QuiverOfInfinity),
|
||||
typeof(BaseFormTalisman), typeof(BaseWand), typeof(JesterHatofChuckles)
|
||||
};
|
||||
|
||||
public static TreasuresOfTokunoEra DropEra { get; set; } = TreasuresOfTokunoEra.None;
|
||||
|
||||
public static TreasuresOfTokunoEra RewardEra { get; set; } = TreasuresOfTokunoEra.ToTOne;
|
||||
|
|
@ -338,7 +344,7 @@ namespace Server.Gumps
|
|||
|
||||
public ToTTurnInGump(Mobile collector, List<ItemTileButtonInfo> buttons) : base(
|
||||
1071012,
|
||||
Utility.CastListContravariant<ItemTileButtonInfo, ImageTileButtonInfo>(buttons)
|
||||
buttons.ToList<ImageTileButtonInfo>()
|
||||
) // Click a minor artifact to give it to Ihara Soko.
|
||||
=>
|
||||
m_Collector = collector;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ using Server.Mobiles;
|
|||
|
||||
namespace Server.Engines.VeteranRewards
|
||||
{
|
||||
public class RewardSystem
|
||||
public static class RewardSystem
|
||||
{
|
||||
private static RewardCategory[] m_Categories;
|
||||
private static RewardList[] m_Lists;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ using Server.Mobiles;
|
|||
|
||||
namespace Server
|
||||
{
|
||||
public class CompassionVirtue
|
||||
public static class CompassionVirtue
|
||||
{
|
||||
private const int LossAmount = 500;
|
||||
private static readonly TimeSpan LossDelay = TimeSpan.FromDays(7.0);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ using Server.Targeting;
|
|||
|
||||
namespace Server
|
||||
{
|
||||
public class HonorVirtue
|
||||
public static class HonorVirtue
|
||||
{
|
||||
private static readonly TimeSpan UseDelay = TimeSpan.FromMinutes(5.0);
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ using Server.Targeting;
|
|||
|
||||
namespace Server
|
||||
{
|
||||
#pragma warning disable CA1052
|
||||
public class JusticeVirtue
|
||||
{
|
||||
private const int LossAmount = 950;
|
||||
|
|
@ -285,4 +286,5 @@ namespace Server
|
|||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore CA1052
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ using Server.Targeting;
|
|||
|
||||
namespace Server
|
||||
{
|
||||
public class SacrificeVirtue
|
||||
public static class SacrificeVirtue
|
||||
{
|
||||
private const int LossAmount = 500;
|
||||
private static readonly TimeSpan GainDelay = TimeSpan.FromDays(1.0);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ using Server.Targeting;
|
|||
|
||||
namespace Server
|
||||
{
|
||||
public class ValorVirtue
|
||||
public static class ValorVirtue
|
||||
{
|
||||
private const int LossAmount = 250;
|
||||
private static readonly TimeSpan LossDelay = TimeSpan.FromDays(7.0);
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ namespace Server
|
|||
Honesty
|
||||
}
|
||||
|
||||
public class VirtueHelper
|
||||
public static class VirtueHelper
|
||||
{
|
||||
public static bool HasAny(Mobile from, VirtueName virtue) => from.Virtues.GetValue((int)virtue) > 0;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue