Adds style cop (#109)

This commit is contained in:
Kamron Batman 2020-04-26 00:16:02 -07:00 committed by GitHub
parent 3e715bcb60
commit 556a17aba8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1725 changed files with 33831 additions and 38046 deletions

View file

@ -6,7 +6,7 @@ namespace Server.Engines.Quests.Ambitious
{
public class AmbitiousQueenQuest : QuestSystem
{
private static Type[] m_TypeReferenceTable =
private static readonly Type[] m_TypeReferenceTable =
{
typeof(DontOfferConversation),
typeof(AcceptConversation),
@ -40,7 +40,7 @@ namespace Server.Engines.Quests.Ambitious
public override int Picture => 0x15C9;
public bool RedSolen{ get; private set; }
public bool RedSolen { get; private set; }
public override void ChildDeserialize(IGenericReader reader)
{

View file

@ -65,7 +65,7 @@ namespace Server.Engines.Quests.Ambitious
private bool m_BagOfSending;
private bool m_Gold;
private bool m_Logged;
private readonly bool m_Logged;
private bool m_PowderOfTranslocation;
public FullBackpackConversation(bool logged, bool bagOfSending, bool powderOfTranslocation, bool gold)

View file

@ -13,7 +13,7 @@ namespace Server.Engines.Quests.Ambitious
{
}
public abstract bool RedSolen{ get; }
public abstract bool RedSolen { get; }
public override string DefaultName => "an ambitious solen queen";
public override bool DisallowAllMoves => false;
@ -54,7 +54,7 @@ namespace Server.Engines.Quests.Ambitious
else
{
GetRewardObjective lastObj = qs.FindObjective<GetRewardObjective>();
if (lastObj?.Completed == false)
{
bool bagOfSending = lastObj.BagOfSending;

View file

@ -95,11 +95,11 @@ namespace Server.Engines.Quests.Ambitious
public override object Message => 1054148;
public bool BagOfSending{ get; set; }
public bool BagOfSending { get; set; }
public bool PowderOfTranslocation{ get; set; }
public bool PowderOfTranslocation { get; set; }
public bool Gold{ get; set; }
public bool Gold { get; set; }
public override void OnComplete()
{

View file

@ -5,7 +5,7 @@ namespace Server.Engines.Quests.Collector
{
public class CollectorQuest : QuestSystem
{
private static Type[] m_TypeReferenceTable =
private static readonly Type[] m_TypeReferenceTable =
{
typeof(DontOfferConversation),
typeof(DeclineConversation),

View file

@ -241,7 +241,7 @@ namespace Server.Engines.Quests.Collector
public class FullEndConversation : QuestConversation
{
private bool m_Logged;
private readonly bool m_Logged;
public FullEndConversation(bool logged) => m_Logged = logged;

View file

@ -54,7 +54,7 @@ namespace Server.Engines.Quests.Collector
private class InternalTarget : Target
{
private EnchantedPaints m_Paints;
private readonly EnchantedPaints m_Paints;
public InternalTarget(EnchantedPaints paints) : base(-1, false, TargetFlags.None)
{
@ -78,7 +78,7 @@ namespace Server.Engines.Quests.Collector
if (obj?.Completed != false)
return;
if (targeted is Mobile)
{
CaptureResponse response = obj.CaptureImage(
@ -89,27 +89,27 @@ namespace Server.Engines.Quests.Collector
switch (response)
{
case CaptureResponse.Valid:
{
player.SendLocalizedMessage(
1055125); // The enchanted paints swirl for a moment then an image begins to take shape. *Click*
player.AddToBackpack(new PaintedImage(image));
{
player.SendLocalizedMessage(
1055125); // The enchanted paints swirl for a moment then an image begins to take shape. *Click*
player.AddToBackpack(new PaintedImage(image));
break;
}
break;
}
case CaptureResponse.AlreadyDone:
{
player.SendAsciiMessage(0x2C,
"You have already captured the image of this creature");
{
player.SendAsciiMessage(0x2C,
"You have already captured the image of this creature");
break;
}
break;
}
case CaptureResponse.Invalid:
{
player.SendLocalizedMessage(
1055124); // You have no interest in capturing the image of this creature.
{
player.SendLocalizedMessage(
1055124); // You have no interest in capturing the image of this creature.
break;
}
break;
}
}
}
else

View file

@ -66,13 +66,13 @@ namespace Server.Engines.Quests.Collector
Y = y;
}
public int Figurine{ get; }
public int Figurine { get; }
public Type Type{ get; }
public Type Type { get; }
public int Name => Figurine < 0x4000 ? 1020000 + Figurine : 1078872 + Figurine;
public int X{ get; }
public int Y{ get; }
public int X { get; }
public int Y { get; }
public static ImageTypeInfo Get(ImageType image)
{
@ -88,7 +88,7 @@ namespace Server.Engines.Quests.Collector
for (int i = 0; i < m_Table.Length; i++)
m_ImageTypeList[i] = (ImageType)i;
}
ImageType[] array = m_ImageTypeList.ToArray();
Utility.Shuffle(array);
return array.Take(count).ToArray();

View file

@ -197,7 +197,7 @@ namespace Server.Engines.Quests.Collector
private class DisassembleEntry : ContextMenuEntry
{
private Obsidian m_Obsidian;
private readonly Obsidian m_Obsidian;
public DisassembleEntry(Obsidian obsidian) : base(6142) => m_Obsidian = obsidian;
@ -217,7 +217,7 @@ namespace Server.Engines.Quests.Collector
private class InternalTarget : Target
{
private Obsidian m_Obsidian;
private readonly Obsidian m_Obsidian;
public InternalTarget(Obsidian obsidian) : base(-1, false, TargetFlags.None) => m_Obsidian = obsidian;

View file

@ -152,7 +152,6 @@ namespace Server.Engines.Quests.Collector
{
if (player.FindBankNoCreate()?.ConsumeTotal(typeof(Gold), 10) == true)
obj.Complete();
else
player.SendLocalizedMessage(
1055108); // You don't have enough gold to buy the sheet music.

View file

@ -33,7 +33,7 @@ namespace Server.Engines.Quests.Collector
AddItem(new Boots(0x452));
AddItem(new FullApron(0x455));
HairItemID = 0x203B; //ShortHair
HairItemID = 0x203B; // ShortHair
HairHue = 0x455;
}

View file

@ -7,7 +7,7 @@ namespace Server.Engines.Quests
{
public class TalkEntry : ContextMenuEntry
{
private BaseQuester m_Quester;
private readonly BaseQuester m_Quester;
public TalkEntry(BaseQuester quester) : base(quester.TalkNumber) => m_Quester = quester;

View file

@ -8,7 +8,7 @@ namespace Server.Items
private const double m_ShortDistance = 5.0;
//TODO: Trammel/Haven
// TODO: Trammel/Haven
private static readonly Point2D[] m_TrammelBanks =
{
new Point2D(652, 820),
@ -99,8 +99,8 @@ namespace Server.Items
else if (from.Map == Map.Ilshenar)
{
#if false
banks = m_IlshenarBanks;
moongates = PMList.Ilshenar;
banks = m_IlshenarBanks;
moongates = PMList.Ilshenar;
#else
from.Send(new MessageLocalized(Serial, ItemID, MessageType.Label, 0x482, 3, 1061684, "",
"")); // The magic of the sextant fails...
@ -183,4 +183,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
}
}

View file

@ -23,10 +23,10 @@ namespace Server.Engines.Quests
}
[CommandProperty(AccessLevel.GameMaster)]
public Point3D DestLoc{ get; set; }
public Point3D DestLoc { get; set; }
[CommandProperty(AccessLevel.GameMaster)]
public Map DestMap{ get; set; }
public Map DestMap { get; set; }
[CommandProperty(AccessLevel.GameMaster)]
public int Charges
@ -120,19 +120,19 @@ namespace Server.Engines.Quests
switch (version)
{
case 0:
{
DestLoc = reader.ReadPoint3D();
DestMap = reader.ReadMap();
m_Charges = reader.ReadInt();
break;
}
{
DestLoc = reader.ReadPoint3D();
DestMap = reader.ReadMap();
m_Charges = reader.ReadInt();
break;
}
}
}
}
public class HornOfRetreatMoongate : Moongate
{
private Mobile m_Caster;
private readonly Mobile m_Caster;
public HornOfRetreatMoongate(Point3D destLoc, Map destMap, Mobile caster, int hue)
{

View file

@ -4,7 +4,7 @@ namespace Server.Engines.Quests
{
public class QuestCallbackEntry : ContextMenuEntry
{
private QuestCallback m_Callback;
private readonly QuestCallback m_Callback;
public QuestCallbackEntry(int number, QuestCallback callback) : this(number, -1, callback)
{

View file

@ -6,14 +6,14 @@ namespace Server.Engines.Quests
{
public abstract class QuestConversation
{
public abstract object Message{ get; }
public abstract object Message { get; }
public virtual QuestItemInfo[] Info => null;
public virtual bool Logged => true;
public QuestSystem System{ get; set; }
public QuestSystem System { get; set; }
public bool HasBeenRead{ get; set; }
public bool HasBeenRead { get; set; }
public virtual void BaseDeserialize(IGenericReader reader)
{
@ -22,11 +22,11 @@ namespace Server.Engines.Quests
switch (version)
{
case 0:
{
HasBeenRead = reader.ReadBool();
{
HasBeenRead = reader.ReadBool();
break;
}
break;
}
}
ChildDeserialize(reader);
@ -58,9 +58,9 @@ namespace Server.Engines.Quests
public class QuestConversationsGump : BaseQuestGump
{
private List<QuestConversation> m_Conversations;
private readonly List<QuestConversation> m_Conversations;
public QuestConversationsGump(QuestConversation conv) : this(new List<QuestConversation>{ conv })
public QuestConversationsGump(QuestConversation conv) : this(new List<QuestConversation> { conv })
{
}

View file

@ -8,9 +8,9 @@ namespace Server.Engines.Quests
ItemID = itemID;
}
public object Name{ get; set; }
public object Name { get; set; }
public int ItemID{ get; set; }
public int ItemID { get; set; }
}
public class QuestItemInfoGump : BaseQuestGump

View file

@ -10,14 +10,14 @@ namespace Server.Engines.Quests
{
private int m_CurProgress;
public abstract object Message{ get; }
public abstract object Message { get; }
public virtual int MaxProgress => 1;
public virtual QuestItemInfo[] Info => null;
public QuestSystem System{ get; set; }
public QuestSystem System { get; set; }
public bool HasBeenRead{ get; set; }
public bool HasBeenRead { get; set; }
public int CurProgress
{
@ -29,7 +29,7 @@ namespace Server.Engines.Quests
}
}
public bool HasCompleted{ get; set; }
public bool HasCompleted { get; set; }
public virtual bool Completed => m_CurProgress >= MaxProgress;
@ -42,17 +42,17 @@ namespace Server.Engines.Quests
switch (version)
{
case 1:
{
HasBeenRead = reader.ReadBool();
goto case 0;
}
{
HasBeenRead = reader.ReadBool();
goto case 0;
}
case 0:
{
m_CurProgress = reader.ReadEncodedInt();
HasCompleted = reader.ReadBool();
{
m_CurProgress = reader.ReadEncodedInt();
HasCompleted = reader.ReadBool();
break;
}
break;
}
}
ChildDeserialize(reader);
@ -128,7 +128,7 @@ namespace Server.Engines.Quests
public class QuestLogUpdatedGump : BaseQuestGump
{
private QuestSystem m_System;
private readonly QuestSystem m_System;
public QuestLogUpdatedGump(QuestSystem system) : base(3, 30)
{
@ -155,9 +155,9 @@ namespace Server.Engines.Quests
public class QuestObjectivesGump : BaseQuestGump
{
private List<QuestObjective> m_Objectives;
private readonly List<QuestObjective> m_Objectives;
public QuestObjectivesGump(QuestObjective obj) : this(new List<QuestObjective>{ obj })
public QuestObjectivesGump(QuestObjective obj) : this(new List<QuestObjective> { obj })
{
}

View file

@ -16,9 +16,9 @@ namespace Server.Engines.Quests
RestartTime = restartTime;
}
public Type QuestType{ get; set; }
public Type QuestType { get; set; }
public DateTime RestartTime{ get; set; }
public DateTime RestartTime { get; set; }
public void Reset(TimeSpan restartDelay)
{

View file

@ -1,5 +1,5 @@
using Server.Utilities;
using System;
using Server.Utilities;
namespace Server.Engines.Quests
{
@ -45,27 +45,27 @@ namespace Server.Engines.Quests
switch (encoding)
{
default:
{
return null;
}
case 0x01: // indexed
{
int index = reader.ReadEncodedInt();
if (index >= 0 && index < referenceTable.Length)
return referenceTable[index];
return null;
}
case 0x02: // by name
{
string fullName = reader.ReadString();
if (fullName == null)
{
return null;
}
case 0x01: // indexed
{
int index = reader.ReadEncodedInt();
return AssemblyHandler.FindFirstTypeForName(fullName, false);
}
if (index >= 0 && index < referenceTable.Length)
return referenceTable[index];
return null;
}
case 0x02: // by name
{
string fullName = reader.ReadString();
if (fullName == null)
return null;
return AssemblyHandler.FindFirstTypeForName(fullName, false);
}
}
}
@ -76,19 +76,19 @@ namespace Server.Engines.Quests
switch (encoding)
{
default:
{
return null;
}
{
return null;
}
case 0x01:
{
Type type = ReadType(QuestSystem.QuestTypes, reader);
{
Type type = ReadType(QuestSystem.QuestTypes, reader);
QuestSystem qs = Construct(type) as QuestSystem;
QuestSystem qs = Construct(type) as QuestSystem;
qs?.BaseDeserialize(reader);
qs?.BaseDeserialize(reader);
return qs;
}
return qs;
}
}
}
@ -115,19 +115,19 @@ namespace Server.Engines.Quests
switch (encoding)
{
default:
{
return null;
}
{
return null;
}
case 0x01:
{
Type type = ReadType(referenceTable, reader);
{
Type type = ReadType(referenceTable, reader);
QuestObjective obj = Construct(type) as QuestObjective;
QuestObjective obj = Construct(type) as QuestObjective;
obj?.BaseDeserialize(reader);
obj?.BaseDeserialize(reader);
return obj;
}
return obj;
}
}
}
@ -154,19 +154,19 @@ namespace Server.Engines.Quests
switch (encoding)
{
default:
{
return null;
}
{
return null;
}
case 0x01:
{
Type type = ReadType(referenceTable, reader);
{
Type type = ReadType(referenceTable, reader);
QuestConversation conv = Construct(type) as QuestConversation;
QuestConversation conv = Construct(type) as QuestConversation;
conv?.BaseDeserialize(reader);
conv?.BaseDeserialize(reader);
return conv;
}
return conv;
}
}
}

View file

@ -51,21 +51,21 @@ namespace Server.Engines.Quests
{
}
public abstract object Name{ get; }
public abstract object OfferMessage{ get; }
public abstract object Name { get; }
public abstract object OfferMessage { get; }
public abstract int Picture{ get; }
public abstract int Picture { get; }
public abstract bool IsTutorial{ get; }
public abstract TimeSpan RestartDelay{ get; }
public abstract bool IsTutorial { get; }
public abstract TimeSpan RestartDelay { get; }
public abstract Type[] TypeReferenceTable{ get; }
public abstract Type[] TypeReferenceTable { get; }
public PlayerMobile From{ get; set; }
public PlayerMobile From { get; set; }
public List<QuestObjective> Objectives{ get; set; }
public List<QuestObjective> Objectives { get; set; }
public List<QuestConversation> Conversations{ get; set; }
public List<QuestConversation> Conversations { get; set; }
public virtual void StartTimer()
{
@ -126,39 +126,39 @@ namespace Server.Engines.Quests
switch (version)
{
case 0:
{
int count = reader.ReadEncodedInt();
Objectives = new List<QuestObjective>(count);
for (int i = 0; i < count; ++i)
{
QuestObjective obj = QuestSerializer.DeserializeObjective(referenceTable, reader);
int count = reader.ReadEncodedInt();
if (obj != null)
Objectives = new List<QuestObjective>(count);
for (int i = 0; i < count; ++i)
{
obj.System = this;
Objectives.Add(obj);
QuestObjective obj = QuestSerializer.DeserializeObjective(referenceTable, reader);
if (obj != null)
{
obj.System = this;
Objectives.Add(obj);
}
}
}
count = reader.ReadEncodedInt();
count = reader.ReadEncodedInt();
Conversations = new List<QuestConversation>(count);
Conversations = new List<QuestConversation>(count);
for (int i = 0; i < count; ++i)
{
QuestConversation conv = QuestSerializer.DeserializeConversation(referenceTable, reader);
if (conv != null)
for (int i = 0; i < count; ++i)
{
conv.System = this;
Conversations.Add(conv);
}
}
QuestConversation conv = QuestSerializer.DeserializeConversation(referenceTable, reader);
break;
}
if (conv != null)
{
conv.System = this;
Conversations.Add(conv);
}
}
break;
}
}
ChildDeserialize(reader);
@ -324,7 +324,7 @@ namespace Server.Engines.Quests
TimeSpan restartDelay = RestartDelay;
if (completed && restartDelay > TimeSpan.Zero || !completed && restartDelay == TimeSpan.MaxValue)
if ((completed && restartDelay > TimeSpan.Zero) || (!completed && restartDelay == TimeSpan.MaxValue))
{
From.DoneQuests ??= new List<QuestRestartInfo>();
@ -405,8 +405,7 @@ namespace Server.Engines.Quests
if (questType == typeof(DarkTidesQuest) && pm.Profession != 4) // necromancer
return false;
if (questType == typeof(UzeraanTurmoilQuest) && pm.Profession != 1 && pm.Profession != 2 && pm.Profession != 5
) // warrior / magician / paladin
if (questType == typeof(UzeraanTurmoilQuest) && pm.Profession != 1 && pm.Profession != 2 && pm.Profession != 5) // warrior / magician / paladin
return false;
if (questType == typeof(HaochisTrialsQuest) && pm.Profession != 6) // samurai
@ -463,7 +462,7 @@ namespace Server.Engines.Quests
public static int RandomBrightHue()
{
if (0.1 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.1)
return Utility.RandomList(0x62, 0x71);
return Utility.RandomList(0x03, 0x0D, 0x13, 0x1C, 0x21, 0x30, 0x37, 0x3A, 0x44, 0x59);
@ -472,7 +471,7 @@ namespace Server.Engines.Quests
public class QuestCancelGump : BaseQuestGump
{
private QuestSystem m_System;
private readonly QuestSystem m_System;
public QuestCancelGump(QuestSystem system) : base(120, 50)
{
@ -542,7 +541,7 @@ namespace Server.Engines.Quests
public class QuestOfferGump : BaseQuestGump
{
private QuestSystem m_System;
private readonly QuestSystem m_System;
public QuestOfferGump(QuestSystem system) : base(75, 25)
{

View file

@ -7,7 +7,7 @@ namespace Server.Engines.Quests
{
public class CancelQuestRegion : BaseRegion
{
private Type m_Quest;
private readonly Type m_Quest;
public CancelQuestRegion(XmlElement xml, Map map, Region parent) : base(xml, map, parent)
{

View file

@ -7,8 +7,8 @@ namespace Server.Engines.Quests
{
public class QuestCompleteObjectiveRegion : BaseRegion
{
private Type m_Objective;
private Type m_Quest;
private readonly Type m_Objective;
private readonly Type m_Quest;
public QuestCompleteObjectiveRegion(XmlElement xml, Map map, Region parent) : base(xml, map, parent)
{

View file

@ -7,10 +7,10 @@ namespace Server.Engines.Quests
{
public class QuestNoEntryRegion : BaseRegion
{
private Type m_MaxObjective;
private int m_Message;
private Type m_MinObjective;
private Type m_Quest;
private readonly Type m_MaxObjective;
private readonly int m_Message;
private readonly Type m_MinObjective;
private readonly Type m_Quest;
public QuestNoEntryRegion(XmlElement xml, Map map, Region parent) : base(xml, map, parent)
{

View file

@ -8,7 +8,7 @@ namespace Server.Engines.Quests
{
public class QuestOfferRegion : BaseRegion
{
private Type m_Quest;
private readonly Type m_Quest;
public QuestOfferRegion(XmlElement xml, Map map, Region parent) : base(xml, map, parent)
{

View file

@ -20,7 +20,7 @@ namespace Server.Engines.Quests.Necro
public class ReanimateMaabusConversation : QuestConversation
{
private static QuestItemInfo[] m_Info =
private static readonly QuestItemInfo[] m_Info =
{
new QuestItemInfo(1026153, 6178), // teleporter
new QuestItemInfo(1049117, 4036), // Horn of Retreat
@ -39,7 +39,7 @@ namespace Server.Engines.Quests.Necro
public class MaabasConversation : QuestConversation
{
private static QuestItemInfo[] m_Info =
private static readonly QuestItemInfo[] m_Info =
{
new QuestItemInfo(1026153, 6178) // teleporter
};
@ -76,7 +76,7 @@ namespace Server.Engines.Quests.Necro
public class VaultOfSecretsConversation : QuestConversation
{
private static QuestItemInfo[] m_Info =
private static readonly QuestItemInfo[] m_Info =
{
new QuestItemInfo(1023643, 8787) // spellbook
};

View file

@ -5,7 +5,7 @@ namespace Server.Engines.Quests.Necro
{
public class DarkTidesQuest : QuestSystem
{
private static Type[] m_TypeReferenceTable =
private static readonly Type[] m_TypeReferenceTable =
{
typeof(AcceptConversation),
typeof(AnimateMaabusCorpseObjective),

View file

@ -89,7 +89,7 @@ namespace Server.Engines.Quests.Necro
private class CallingTimer : Timer
{
private PlayerMobile m_Player;
private readonly PlayerMobile m_Player;
private int m_Step;
public CallingTimer(PlayerMobile player) : base(TimeSpan.Zero, TimeSpan.FromSeconds(1.0), 6)

View file

@ -24,10 +24,10 @@ namespace Server.Engines.Quests.Necro
}
[CommandProperty(AccessLevel.GameMaster)]
public Maabus Maabus{ get; private set; }
public Maabus Maabus { get; private set; }
[CommandProperty(AccessLevel.GameMaster)]
public Point3D SpawnLocation{ get; set; }
public Point3D SpawnLocation { get; set; }
public void Awake(Mobile caller)
{

View file

@ -166,8 +166,8 @@ namespace Server.Engines.Quests.Necro
private class SpeakPasswordEntry : ContextMenuEntry
{
private PlayerMobile m_From;
private Horus m_Horus;
private readonly PlayerMobile m_From;
private readonly Horus m_Horus;
public SpeakPasswordEntry(Horus horus, PlayerMobile from, bool enabled) : base(6193, 3)
{

View file

@ -48,7 +48,7 @@ namespace Server.Engines.Quests.Necro
}
else
{
player.SendLocalizedMessage(1114333); //You must be young to have this item recharged.
player.SendLocalizedMessage(1114333); // You must be young to have this item recharged.
}
return false;

View file

@ -148,7 +148,7 @@ namespace Server.Engines.Quests.Necro
private class SummonTimer : Timer
{
private SummonedPaladin m_Paladin;
private PlayerMobile m_Player;
private readonly PlayerMobile m_Player;
private int m_Step;
public SummonTimer(PlayerMobile player) : base(TimeSpan.FromSeconds(4.0))

View file

@ -6,7 +6,7 @@ namespace Server.Engines.Quests.Necro
{
public class AnimateMaabusCorpseObjective : QuestObjective
{
private static QuestItemInfo[] m_Info =
private static readonly QuestItemInfo[] m_Info =
{
new QuestItemInfo(1023643, 8787) // spellbook
};
@ -91,7 +91,7 @@ namespace Server.Engines.Quests.Necro
public class FindVaultOfSecretsObjective : QuestObjective
{
private static QuestItemInfo[] m_Info =
private static readonly QuestItemInfo[] m_Info =
{
new QuestItemInfo(1023676, 3679) // glowing rune
};
@ -156,7 +156,7 @@ namespace Server.Engines.Quests.Necro
public class ReturnToCrystalCaveObjective : QuestObjective
{
private static QuestItemInfo[] m_Info =
private static readonly QuestItemInfo[] m_Info =
{
new QuestItemInfo(1026153, 6178) // teleporter
};

View file

@ -5,7 +5,7 @@ namespace Server.Engines.Quests.Ninja
{
public class EminosUndertakingQuest : QuestSystem
{
private static Type[] m_TypeReferenceTable =
private static readonly Type[] m_TypeReferenceTable =
{
typeof(AcceptConversation),
typeof(FindZoelConversation),

View file

@ -151,7 +151,7 @@ namespace Server.Engines.Quests.Ninja
bool stolenTreasure = false;
HallwayWalkObjective walk = qs.FindObjective<HallwayWalkObjective>();
if (walk != null)
stolenTreasure = walk.StolenTreasure;

View file

@ -20,7 +20,7 @@ namespace Server.Engines.Quests.Ninja
}
[CommandProperty(AccessLevel.GameMaster)]
public int Message{ get; set; }
public int Message { get; set; }
public override int TalkNumber => -1;

View file

@ -41,7 +41,7 @@ namespace Server.Engines.Quests.Ninja
public class SneakPastGuardiansObjective : QuestObjective
{
public bool TaughtHowToUseSkills{ get; set; }
public bool TaughtHowToUseSkills { get; set; }
public override object Message => 1063261;
@ -131,7 +131,7 @@ namespace Server.Engines.Quests.Ninja
public class HallwayWalkObjective : QuestObjective
{
public bool StolenTreasure{ get; set; }
public bool StolenTreasure { get; set; }
public override object Message => 1063202;

View file

@ -5,7 +5,7 @@ namespace Server.Engines.Quests.Samurai
{
public class HaochisTrialsQuest : QuestSystem
{
private static Type[] m_TypeReferenceTable =
private static readonly Type[] m_TypeReferenceTable =
{
typeof(AcceptConversation),
typeof(RadarConversation),

View file

@ -117,7 +117,7 @@ namespace Server.Engines.Quests.Samurai
HaochisKatana katana = player.Backpack?.FindItemByType<HaochisKatana>();
if (katana == null)
return;
katana.Delete();
obj.Complete();

View file

@ -10,7 +10,6 @@ namespace Server.Engines.Quests.Samurai
{
}
public Relnia(Serial serial) : base(serial)
{
}

View file

@ -138,7 +138,7 @@ namespace Server.Engines.Quests.Samurai
public override object Message => 1063229;
public bool Dragon{ get; private set; }
public bool Dragon { get; private set; }
public override void OnComplete()
{
@ -230,7 +230,7 @@ namespace Server.Engines.Quests.Samurai
public override object Message => 1063242;
public bool KilledCat{ get; private set; }
public bool KilledCat { get; private set; }
public override void OnComplete()
{
@ -256,7 +256,7 @@ namespace Server.Engines.Quests.Samurai
{
public override object Message => 1063072;
public bool StolenTreasure{ get; set; }
public bool StolenTreasure { get; set; }
public override void OnComplete()
{

View file

@ -142,7 +142,7 @@ namespace Server.Engines.Quests.Matriarch
public class FullBackpackConversation : QuestConversation
{
private bool m_Logged;
private readonly bool m_Logged;
public FullBackpackConversation(bool logged) => m_Logged = logged;

View file

@ -23,7 +23,7 @@ namespace Server.Engines.Quests.Matriarch
{
}
public abstract bool RedSolen{ get; }
public abstract bool RedSolen { get; }
public override string DefaultName => "the solen matriarch";
public override bool DisallowAllMoves => false;
@ -193,8 +193,8 @@ namespace Server.Engines.Quests.Matriarch
private class ProcessZoogiFungusEntry : ContextMenuEntry
{
private PlayerMobile m_From;
private BaseSolenMatriarch m_Matriarch;
private readonly PlayerMobile m_From;
private readonly BaseSolenMatriarch m_Matriarch;
public ProcessZoogiFungusEntry(BaseSolenMatriarch matriarch, PlayerMobile from) : base(6184)
{
@ -211,8 +211,8 @@ namespace Server.Engines.Quests.Matriarch
private class ProcessFungiTarget : Target
{
private PlayerMobile m_From;
private BaseSolenMatriarch m_Matriarch;
private readonly PlayerMobile m_From;
private readonly BaseSolenMatriarch m_Matriarch;
public ProcessFungiTarget(BaseSolenMatriarch matriarch, PlayerMobile from) : base(-1, false, TargetFlags.None)
{

View file

@ -6,7 +6,7 @@ namespace Server.Engines.Quests.Matriarch
{
public class SolenMatriarchQuest : QuestSystem
{
private static Type[] m_TypeReferenceTable =
private static readonly Type[] m_TypeReferenceTable =
{
typeof(DontOfferConversation),
typeof(AcceptConversation),
@ -74,7 +74,7 @@ namespace Server.Engines.Quests.Matriarch
public override int Picture => 0x15C9;
public bool RedSolen{ get; private set; }
public bool RedSolen { get; private set; }
public override void ChildDeserialize(IGenericReader reader)
{

View file

@ -32,7 +32,6 @@ namespace Server.Engines.Quests.Naturalist
AddItem(new LongPants(0x59B));
AddItem(new Boots());
Utility.AssignRandomHair(this);
Utility.AssignRandomFacialHair(this, HairHue);
}
@ -44,7 +43,7 @@ namespace Server.Engines.Quests.Naturalist
StudyNestsObjective study = qs.FindObjective<StudyNestsObjective>();
if (study == null)
return;
if (!study.Completed)
{
PlaySound(0x41F);

View file

@ -21,7 +21,7 @@ namespace Server.Engines.Quests.Naturalist
new Rectangle2D(5672, 1857, 6, 20))
};
private Rectangle2D[] m_Rects;
private readonly Rectangle2D[] m_Rects;
private NestArea(bool special, params Rectangle2D[] rects)
{
@ -31,7 +31,7 @@ namespace Server.Engines.Quests.Naturalist
public static int NonSpecialCount => m_Areas.Count(area => !area.Special);
public bool Special{ get; }
public bool Special { get; }
public int ID
{

View file

@ -8,7 +8,7 @@ namespace Server.Engines.Quests.Naturalist
{
private NestArea m_CurrentNest;
private List<NestArea> m_StudiedNests = new List<NestArea>();
private readonly List<NestArea> m_StudiedNests = new List<NestArea>();
private DateTime m_StudyBegin;
private StudyState m_StudyState;
@ -16,7 +16,7 @@ namespace Server.Engines.Quests.Naturalist
public override int MaxProgress => NestArea.NonSpecialCount;
public bool StudiedSpecialNest{ get; private set; }
public bool StudiedSpecialNest { get; private set; }
public override bool GetTimerEvent() => true;

View file

@ -5,7 +5,7 @@ namespace Server.Engines.Quests.Naturalist
{
public class StudyOfSolenQuest : QuestSystem
{
private static Type[] m_TypeReferenceTable =
private static readonly Type[] m_TypeReferenceTable =
{
typeof(StudyNestsObjective),
typeof(ReturnToNaturalistObjective),
@ -35,7 +35,7 @@ namespace Server.Engines.Quests.Naturalist
public override int Picture => 0x15C7;
public Naturalist Naturalist{ get; private set; }
public Naturalist Naturalist { get; private set; }
public override void ChildDeserialize(IGenericReader reader)
{

View file

@ -5,7 +5,7 @@ namespace Server.Engines.Quests.Zento
{
public class TerribleHatchlingsQuest : QuestSystem
{
private static Type[] m_TypeReferenceTable =
private static readonly Type[] m_TypeReferenceTable =
{
typeof(AcceptConversation),
typeof(DirectionConversation),

View file

@ -21,13 +21,13 @@ namespace Server.Engines.Quests.Doom
public override int LabelNumber => 1050018; // bell of the dead
[CommandProperty(AccessLevel.GameMaster, AccessLevel.Administrator)]
public Chyloth Chyloth{ get; set; }
public Chyloth Chyloth { get; set; }
[CommandProperty(AccessLevel.GameMaster, AccessLevel.Administrator)]
public SkeletalDragon Dragon{ get; set; }
public SkeletalDragon Dragon { get; set; }
[CommandProperty(AccessLevel.GameMaster, AccessLevel.Administrator)]
public bool Summoning{ get; set; }
public bool Summoning { get; set; }
public override void OnDoubleClick(Mobile from)
{

View file

@ -9,7 +9,7 @@ namespace Server.Engines.Quests.Doom
{
public class Chyloth : BaseQuester
{
private static int[] m_Offsets =
private static readonly int[] m_Offsets =
{
-1, -1,
-1, 0,
@ -32,9 +32,9 @@ namespace Server.Engines.Quests.Doom
public override string DefaultName => "Chyloth";
public BellOfTheDead Bell{ get; set; }
public BellOfTheDead Bell { get; set; }
public Mobile AngryAt{ get; set; }
public Mobile AngryAt { get; set; }
public override void InitBody()
{
@ -226,8 +226,8 @@ namespace Server.Engines.Quests.Doom
public class ChylothPartyGump : Gump
{
private Mobile m_Leader;
private Mobile m_Member;
private readonly Mobile m_Leader;
private readonly Mobile m_Member;
public ChylothPartyGump(Mobile leader, Mobile member) : base(150, 50)
{

View file

@ -79,7 +79,7 @@ namespace Server.Engines.Quests.Doom
{
}
public Corpse CorpseWithSkull{ get; set; }
public Corpse CorpseWithSkull { get; set; }
public override object Message => 1050037;

View file

@ -6,7 +6,7 @@ namespace Server.Engines.Quests.Doom
{
public class TheSummoningQuest : QuestSystem
{
private static Type[] m_TypeReferenceTable =
private static readonly Type[] m_TypeReferenceTable =
{
typeof(AcceptConversation),
typeof(CollectBonesObjective),
@ -22,9 +22,9 @@ namespace Server.Engines.Quests.Doom
public override Type[] TypeReferenceTable => m_TypeReferenceTable;
public Victoria Victoria{ get; private set; }
public Victoria Victoria { get; private set; }
public bool WaitForSummon{ get; set; }
public bool WaitForSummon { get; set; }
public override object Name => 1050025;

View file

@ -22,7 +22,7 @@ namespace Server.Engines.Quests.Haven
public class UzeraanFirstTaskConversation : QuestConversation
{
private static QuestItemInfo[] m_Info =
private static readonly QuestItemInfo[] m_Info =
{
new QuestItemInfo(1023676, 0xE68) // glowing rune
};
@ -36,29 +36,29 @@ namespace Server.Engines.Quests.Haven
if (System.From.Profession == 2) // magician
return 1049386;
/* <I>Uzeraan nods at you with approval and begins to speak...</I><BR><BR>
*
* Now that you are ready, let me give you your first task.<BR><BR>
*
* As I mentioned earlier, we have been trying to fight back the wicked
* <I>Horde Minions</I> which have recently begun attacking our cities
* - but to no avail. Our need is great!<BR><BR>
*
* Your first task will be to assess the situation in the mountain pass,
* and help our troops defeat the Horde Minions there.<BR><BR>
*
* Take the road marked with glowing runes, that starts just outside of this mansion.
* Before you go into battle, it would be prudent to
* <a href="?ForceTopic27">review combat techniques</a> as well as
* <a href = "?ForceTopic29">information on healing yourself,
* using your Paladin ability 'Close Wounds'</a>.<BR><BR>
*
* To aid you in your fight, you may also wish to
* <a href = "?ForceTopic33">purchase equipment</a> from Frank the Blacksmith,
* who is standing just <a href = "?ForceTopic13">South</a> of here.<BR><BR>
*
* Good luck young Paladin!
*/
/* <I>Uzeraan nods at you with approval and begins to speak...</I><BR><BR>
*
* Now that you are ready, let me give you your first task.<BR><BR>
*
* As I mentioned earlier, we have been trying to fight back the wicked
* <I>Horde Minions</I> which have recently begun attacking our cities
* - but to no avail. Our need is great!<BR><BR>
*
* Your first task will be to assess the situation in the mountain pass,
* and help our troops defeat the Horde Minions there.<BR><BR>
*
* Take the road marked with glowing runes, that starts just outside of this mansion.
* Before you go into battle, it would be prudent to
* <a href="?ForceTopic27">review combat techniques</a> as well as
* <a href = "?ForceTopic29">information on healing yourself,
* using your Paladin ability 'Close Wounds'</a>.<BR><BR>
*
* To aid you in your fight, you may also wish to
* <a href = "?ForceTopic33">purchase equipment</a> from Frank the Blacksmith,
* who is standing just <a href = "?ForceTopic13">South</a> of here.<BR><BR>
*
* Good luck young Paladin!
*/
return 1060388;
}
}
@ -73,7 +73,7 @@ namespace Server.Engines.Quests.Haven
public class UzeraanReportConversation : QuestConversation
{
private static QuestItemInfo[] m_Info =
private static readonly QuestItemInfo[] m_Info =
{
new QuestItemInfo(1026153, 0x1822), // teleporter
new QuestItemInfo(1048032, 0xE76) // a bag
@ -126,7 +126,7 @@ namespace Server.Engines.Quests.Haven
public class SchmendrickConversation : QuestConversation
{
private static QuestItemInfo[] m_Info =
private static readonly QuestItemInfo[] m_Info =
{
new QuestItemInfo(1023637, 0xE34) // scroll
};
@ -169,7 +169,7 @@ namespace Server.Engines.Quests.Haven
public class UzeraanScrollOfPowerConversation : QuestConversation
{
private static QuestItemInfo[] m_Info =
private static readonly QuestItemInfo[] m_Info =
{
new QuestItemInfo(1048030, 0x14EB), // a Treasure Map
new QuestItemInfo(1023969, 0xF81), // Fertile Dirt
@ -198,7 +198,7 @@ namespace Server.Engines.Quests.Haven
public class UzeraanFertileDirtConversation : QuestConversation
{
private static QuestItemInfo[] m_Info =
private static readonly QuestItemInfo[] m_Info =
{
new QuestItemInfo(1023965, 0xF7D), // Daemon Blood
new QuestItemInfo(1022581, 0xA22) // lantern
@ -245,12 +245,12 @@ namespace Server.Engines.Quests.Haven
public class UzeraanDaemonBloodConversation : QuestConversation
{
private static QuestItemInfo[] m_Info =
private static readonly QuestItemInfo[] m_Info =
{
new QuestItemInfo(1017412, 0xF80) // Daemon Bone
};
private static QuestItemInfo[] m_InfoPaladin =
private static readonly QuestItemInfo[] m_InfoPaladin =
{
new QuestItemInfo(1017412, 0xF80), // Daemon Bone
new QuestItemInfo(1060577, 0x1F14) // Recall Rune

View file

@ -20,37 +20,37 @@ namespace Server.Engines.Quests.Haven
switch (direction)
{
case CannonDirection.North:
{
AddComponent(new CannonComponent(0xE8D), 0, 0, 0);
AddComponent(new CannonComponent(0xE8C), 0, 1, 0);
AddComponent(new CannonComponent(0xE8B), 0, 2, 0);
{
AddComponent(new CannonComponent(0xE8D), 0, 0, 0);
AddComponent(new CannonComponent(0xE8C), 0, 1, 0);
AddComponent(new CannonComponent(0xE8B), 0, 2, 0);
break;
}
break;
}
case CannonDirection.East:
{
AddComponent(new CannonComponent(0xE96), 0, 0, 0);
AddComponent(new CannonComponent(0xE95), -1, 0, 0);
AddComponent(new CannonComponent(0xE94), -2, 0, 0);
{
AddComponent(new CannonComponent(0xE96), 0, 0, 0);
AddComponent(new CannonComponent(0xE95), -1, 0, 0);
AddComponent(new CannonComponent(0xE94), -2, 0, 0);
break;
}
break;
}
case CannonDirection.South:
{
AddComponent(new CannonComponent(0xE91), 0, 0, 0);
AddComponent(new CannonComponent(0xE92), 0, -1, 0);
AddComponent(new CannonComponent(0xE93), 0, -2, 0);
{
AddComponent(new CannonComponent(0xE91), 0, 0, 0);
AddComponent(new CannonComponent(0xE92), 0, -1, 0);
AddComponent(new CannonComponent(0xE93), 0, -2, 0);
break;
}
break;
}
default:
{
AddComponent(new CannonComponent(0xE8E), 0, 0, 0);
AddComponent(new CannonComponent(0xE8F), 1, 0, 0);
AddComponent(new CannonComponent(0xE90), 2, 0, 0);
{
AddComponent(new CannonComponent(0xE8E), 0, 0, 0);
AddComponent(new CannonComponent(0xE8F), 1, 0, 0);
AddComponent(new CannonComponent(0xE90), 2, 0, 0);
break;
}
break;
}
}
}
@ -59,10 +59,10 @@ namespace Server.Engines.Quests.Haven
}
[CommandProperty(AccessLevel.GameMaster)]
public CannonDirection CannonDirection{ get; private set; }
public CannonDirection CannonDirection { get; private set; }
[CommandProperty(AccessLevel.GameMaster)]
public MilitiaCanoneer Canoneer{ get; set; }
public MilitiaCanoneer Canoneer { get; set; }
public override bool HandlesOnMovement => Canoneer?.Deleted == false && Canoneer.Active;
@ -97,10 +97,10 @@ namespace Server.Engines.Quests.Haven
var canFire = CannonDirection switch
{
CannonDirection.North => (m.X >= X - 7 && m.X <= X + 7 && m.Y == Y - 7 && oldLocation.Y < Y - 7),
CannonDirection.East => (m.Y >= Y - 7 && m.Y <= Y + 7 && m.X == X + 7 && oldLocation.X > X + 7),
CannonDirection.South => (m.X >= X - 7 && m.X <= X + 7 && m.Y == Y + 7 && oldLocation.Y > Y + 7),
_ => (m.Y >= Y - 7 && m.Y <= Y + 7 && m.X == X - 7 && oldLocation.X < X - 7)
CannonDirection.North => m.X >= X - 7 && m.X <= X + 7 && m.Y == Y - 7 && oldLocation.Y < Y - 7,
CannonDirection.East => m.Y >= Y - 7 && m.Y <= Y + 7 && m.X == X + 7 && oldLocation.X > X + 7,
CannonDirection.South => m.X >= X - 7 && m.X <= X + 7 && m.Y == Y + 7 && oldLocation.Y > Y + 7,
_ => m.Y >= Y - 7 && m.Y <= Y + 7 && m.X == X - 7 && oldLocation.X < X - 7
};
if (canFire && Canoneer.WillFire(this, m))

View file

@ -144,9 +144,9 @@ namespace Server.Engines.Quests.Haven
public class SBDryad : SBInfo
{
public override IShopSellInfo SellInfo{ get; } = new InternalSellInfo();
public override IShopSellInfo SellInfo { get; } = new InternalSellInfo();
public override List<GenericBuyInfo> BuyInfo{ get; } = new InternalBuyInfo();
public override List<GenericBuyInfo> BuyInfo { get; } = new InternalBuyInfo();
public class InternalBuyInfo : List<GenericBuyInfo>
{

View file

@ -13,7 +13,7 @@ namespace Server.Engines.Quests.Haven
}
[CommandProperty(AccessLevel.GameMaster)]
public bool Active{ get; set; }
public bool Active { get; set; }
public override void InitBody()
{

View file

@ -211,7 +211,7 @@ namespace Server.Engines.Quests.Haven
}
else
{
player.SendLocalizedMessage(1114333); //You must be young to have this item recharged.
player.SendLocalizedMessage(1114333); // You must be young to have this item recharged.
}
return false;

View file

@ -70,7 +70,7 @@ namespace Server.Engines.Quests.Haven
public KillHordeMinionsObjective(KillHordeMinionsStep step) => Step = step;
public KillHordeMinionsStep Step{ get; private set; }
public KillHordeMinionsStep Step { get; private set; }
public override object Message
{
@ -168,24 +168,24 @@ namespace Server.Engines.Quests.Haven
switch (Step)
{
case KillHordeMinionsStep.First:
{
QuestObjective obj = new KillHordeMinionsObjective(KillHordeMinionsStep.LearnKarma);
System.AddObjective(obj);
obj.CurProgress = CurProgress;
break;
}
{
QuestObjective obj = new KillHordeMinionsObjective(KillHordeMinionsStep.LearnKarma);
System.AddObjective(obj);
obj.CurProgress = CurProgress;
break;
}
case KillHordeMinionsStep.LearnKarma:
{
QuestObjective obj = new KillHordeMinionsObjective(KillHordeMinionsStep.Others);
System.AddObjective(obj);
obj.CurProgress = CurProgress;
break;
}
{
QuestObjective obj = new KillHordeMinionsObjective(KillHordeMinionsStep.Others);
System.AddObjective(obj);
obj.CurProgress = CurProgress;
break;
}
default:
{
System.AddObjective(new FindUzeraanAboutReportObjective());
break;
}
{
System.AddObjective(new FindUzeraanAboutReportObjective());
break;
}
}
else
System.AddObjective(new FindUzeraanAboutReportObjective());
@ -338,7 +338,7 @@ namespace Server.Engines.Quests.Haven
public class GetDaemonBoneObjective : QuestObjective
{
public Container CorpseWithBone{ get; set; }
public Container CorpseWithBone { get; set; }
public override object Message
{

View file

@ -5,7 +5,7 @@ namespace Server.Engines.Quests.Haven
{
public class UzeraanTurmoilQuest : QuestSystem
{
private static Type[] m_TypeReferenceTable =
private static readonly Type[] m_TypeReferenceTable =
{
typeof(AcceptConversation),
typeof(UzeraanTitheConversation),

View file

@ -99,7 +99,7 @@ namespace Server.Engines.Quests.Hag
public override void OnRead()
{
System.AddObjective(new FindIngredientObjective(new Ingredient[0]));
System.AddObjective(new FindIngredientObjective(global::System.Array.Empty<Ingredient>()));
}
}
@ -282,4 +282,4 @@ namespace Server.Engines.Quests.Hag
public override bool Logged => false;
}
}
}

View file

@ -24,7 +24,7 @@ namespace Server.Engines.Quests.Hag
public class IngredientInfo
{
private static IngredientInfo[] m_Table =
private static readonly IngredientInfo[] m_Table =
{
// sheep liver
new IngredientInfo(1055020, 5, typeof(Sheep)),
@ -65,11 +65,11 @@ namespace Server.Engines.Quests.Hag
Quantity = quantity;
}
public int Name{ get; }
public int Name { get; }
public Type[] Creatures{ get; }
public Type[] Creatures { get; }
public int Quantity{ get; }
public int Quantity { get; }
public static IngredientInfo Get(Ingredient ingredient)
{

View file

@ -7,10 +7,10 @@ namespace Server.Items
{
AddonComponent pot;
pot = new AddonComponent(2420);
AddComponent(pot, 0, 0, 0); //pot w/ support
AddComponent(pot, 0, 0, 0); // pot w/ support
AddonComponent fire;
fire = new AddonComponent(4012); //fire pit
fire = new AddonComponent(4012); // fire pit
fire.Light = LightType.Circle150;
AddComponent(fire, 0, 0, 0);
}

View file

@ -11,7 +11,7 @@ namespace Server.Items
stew = new AddonComponent(2416);
stew.Name = "stew";
stew.Visible = true;
AddComponent(stew, 0, 0, -7); //stew
AddComponent(stew, 0, 0, -7); // stew
}
public HagStew(Serial serial) : base(serial)
@ -28,7 +28,7 @@ namespace Server.Items
{
stew.Visible = false;
BreadLoaf hagstew = new BreadLoaf(); //this decides your fillrate
BreadLoaf hagstew = new BreadLoaf(); // this decides your fillrate
hagstew.Eat(from);
Timer m_timer = new ShowStew(stew);
@ -52,7 +52,7 @@ namespace Server.Items
public class ShowStew : Timer
{
private AddonComponent stew;
private readonly AddonComponent stew;
public ShowStew(AddonComponent ac) : base(TimeSpan.FromSeconds(30))
{

View file

@ -18,7 +18,7 @@ namespace Server.Engines.Quests.Hag
public override int LabelNumber => 1055060; // Grizelda's Extra Strength Hangover Cure
[CommandProperty(AccessLevel.GameMaster)]
public int Uses{ get; set; }
public int Uses { get; set; }
public override void OnDoubleClick(Mobile from)
{
@ -66,15 +66,15 @@ namespace Server.Engines.Quests.Hag
switch (version)
{
case 1:
{
Uses = reader.ReadEncodedInt();
break;
}
{
Uses = reader.ReadEncodedInt();
break;
}
case 0:
{
Uses = 20;
break;
}
{
Uses = 20;
break;
}
}
}
}

View file

@ -32,7 +32,7 @@ namespace Server.Engines.Quests.Hag
FindZeefzorpulObjective obj = qs.FindObjective<FindZeefzorpulObjective>();
if (obj?.Completed == false)
{
if (player.Map != Map.Trammel && player.Map != Map.Felucca || !player.InRange(obj.ImpLocation, 8))
if ((player.Map != Map.Trammel && player.Map != Map.Felucca) || !player.InRange(obj.ImpLocation, 8))
{
player.SendLocalizedMessage(
1055053); // Nothing happens. Zeefzorpul must not be hiding in this area.

View file

@ -159,8 +159,7 @@ namespace Server.Engines.Quests.Hag
{
bool gainedPath = false;
if (VirtueHelper.Award(player, VirtueName.Sacrifice, 250, ref gainedPath)
) // TODO: Check amount on OSI.
if (VirtueHelper.Award(player, VirtueName.Sacrifice, 250, ref gainedPath)) // TODO: Check amount on OSI.
player.SendLocalizedMessage(1054160); // You have gained in sacrifice.
PlaySound(0x253);

View file

@ -6,7 +6,7 @@ namespace Server.Engines.Quests.Hag
{
public class FindApprenticeObjective : QuestObjective
{
private static Point3D[] m_CorpseLocations =
private static readonly Point3D[] m_CorpseLocations =
{
new Point3D(778, 1158, 0),
new Point3D(698, 1443, 0),
@ -29,7 +29,7 @@ namespace Server.Engines.Quests.Hag
public override object Message => 1055014;
public Corpse Corpse{ get; private set; }
public Corpse Corpse { get; private set; }
private static Point3D RandomCorpseLocation()
{
@ -43,7 +43,7 @@ namespace Server.Engines.Quests.Hag
PlayerMobile player = System.From;
Map map = player.Map;
if (Corpse?.Deleted == false || map != Map.Trammel && map != Map.Felucca ||
if (Corpse?.Deleted == false || (map != Map.Trammel && map != Map.Felucca) ||
!player.InRange(m_CorpseLocation, 8))
return;
@ -85,15 +85,15 @@ namespace Server.Engines.Quests.Hag
switch (version)
{
case 1:
{
m_CorpseLocation = reader.ReadPoint3D();
goto case 0;
}
{
m_CorpseLocation = reader.ReadPoint3D();
goto case 0;
}
case 0:
{
Corpse = (Corpse)reader.ReadItem();
break;
}
{
Corpse = (Corpse)reader.ReadItem();
break;
}
}
if (version == 0)
@ -197,7 +197,7 @@ namespace Server.Engines.Quests.Hag
public override object Message => 1055017;
public Point3D ImpLocation{ get; private set; }
public Point3D ImpLocation { get; private set; }
public override void OnComplete()
{
@ -322,11 +322,11 @@ namespace Server.Engines.Quests.Hag
}
}
public Ingredient[] Ingredients{ get; private set; }
public Ingredient[] Ingredients { get; private set; }
public Ingredient Ingredient => Ingredients[Ingredients.Length - 1];
public int Step => Ingredients.Length;
public bool BlackheartMet{ get; private set; }
public bool BlackheartMet { get; private set; }
public override void RenderProgress(BaseQuestGump gump)
{

View file

@ -5,7 +5,7 @@ namespace Server.Engines.Quests.Hag
{
public class WitchApprenticeQuest : QuestSystem
{
private static Type[] m_TypeReferenceTable =
private static readonly Type[] m_TypeReferenceTable =
{
typeof(FindApprenticeObjective),
typeof(FindGrizeldaAboutMurderObjective),
@ -31,7 +31,7 @@ namespace Server.Engines.Quests.Hag
typeof(RecentlyFinishedConversation)
};
private static Point3D[] m_ZeefzorpulLocations =
private static readonly Point3D[] m_ZeefzorpulLocations =
{
new Point3D(1226, 1573, 0),
new Point3D(1929, 1148, 0),