muffin v7.5.13
This commit is contained in:
parent
911ed68baa
commit
acf3e3cb18
69 changed files with 2731 additions and 1425 deletions
|
|
@ -23,6 +23,22 @@ namespace Questionable.Functions;
|
|||
|
||||
internal sealed class QuestFunctions
|
||||
{
|
||||
private static readonly Dictionary<byte, QuestId> ComingToStartingCityQuests = new Dictionary<byte, QuestId>
|
||||
{
|
||||
{
|
||||
1,
|
||||
new QuestId(107)
|
||||
},
|
||||
{
|
||||
2,
|
||||
new QuestId(39)
|
||||
},
|
||||
{
|
||||
3,
|
||||
new QuestId(594)
|
||||
}
|
||||
};
|
||||
|
||||
private static readonly Dictionary<ushort, EClassJob> CloseToHomeQuests = new Dictionary<ushort, EClassJob>
|
||||
{
|
||||
{
|
||||
|
|
@ -95,6 +111,56 @@ internal sealed class QuestFunctions
|
|||
|
||||
private static readonly HashSet<ushort> RemovedQuestIds = new HashSet<ushort> { 487, 1428, 1429 };
|
||||
|
||||
public static bool IsStartingCityOpeningQuest(ElementId elementId)
|
||||
{
|
||||
if (elementId is QuestId questId)
|
||||
{
|
||||
if (!ComingToStartingCityQuests.ContainsValue(questId))
|
||||
{
|
||||
return CloseToHomeQuests.ContainsKey(questId.Value);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public QuestId? GetActiveStartingCityOpeningQuest()
|
||||
{
|
||||
QuestId questId = ComingToStartingCityQuests.Values.Concat(CloseToHomeQuests.Keys.Select((ushort x) => new QuestId(x))).Where(IsQuestAccepted).Cast<QuestId>()
|
||||
.FirstOrDefault();
|
||||
if (questId != null)
|
||||
{
|
||||
return questId;
|
||||
}
|
||||
EClassJob startingClass = ((EClassJob?)_objectTable.LocalPlayer?.ClassJob.RowId).GetValueOrDefault();
|
||||
ushort num = (from x in CloseToHomeQuests
|
||||
where x.Value == startingClass
|
||||
select x.Key).FirstOrDefault();
|
||||
if (num != 0)
|
||||
{
|
||||
QuestId questId2 = new QuestId(num);
|
||||
if (IsReadyToAcceptQuest(questId2, ignoreLevel: true))
|
||||
{
|
||||
return questId2;
|
||||
}
|
||||
}
|
||||
if (ComingToStartingCityQuests.TryGetValue(PlayerStateHelper.GetStartTown(), out QuestId value) && IsReadyToAcceptQuest(value, ignoreLevel: true))
|
||||
{
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public byte GetStartingCityOpeningSequence(QuestId questId)
|
||||
{
|
||||
byte questSequence = QuestManager.GetQuestSequence(questId.Value);
|
||||
if (ComingToStartingCityQuests.ContainsValue(questId) && IsQuestAccepted(questId) && questSequence == 0)
|
||||
{
|
||||
return byte.MaxValue;
|
||||
}
|
||||
return questSequence;
|
||||
}
|
||||
|
||||
public QuestFunctions(QuestRegistry questRegistry, QuestData questData, JournalData journalData, AetheryteFunctions aetheryteFunctions, AlliedSocietyQuestFunctions alliedSocietyQuestFunctions, AlliedSocietyData alliedSocietyData, Configuration configuration, IDataManager dataManager, IObjectTable objectTable, IGameGui gameGui, ILogger<QuestFunctions> logger)
|
||||
{
|
||||
_questRegistry = questRegistry;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue