muffin v7.38.4
This commit is contained in:
parent
bbc394c386
commit
7177a5440c
8 changed files with 5330 additions and 4542 deletions
|
|
@ -92,7 +92,7 @@ public static class DataManagerExtensions
|
|||
ReadOnlySePayloadType.Text => payload.ToString(),
|
||||
ReadOnlySePayloadType.Macro => payload.MacroCode switch
|
||||
{
|
||||
MacroCode.NewLine => "",
|
||||
MacroCode.NewLine => Environment.NewLine,
|
||||
MacroCode.NonBreakingSpace => " ",
|
||||
MacroCode.Hyphen => "-",
|
||||
MacroCode.SoftHyphen => "",
|
||||
|
|
|
|||
|
|
@ -1789,6 +1789,10 @@
|
|||
"properties": {
|
||||
"ItemCount": {
|
||||
"type": "number"
|
||||
},
|
||||
"RequireHq": {
|
||||
"type": "boolean",
|
||||
"description": "If true, only HQ items will be counted towards completion."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -68,6 +68,8 @@ public sealed class QuestStep
|
|||
|
||||
public int? ItemCount { get; set; }
|
||||
|
||||
public bool? RequireHq { get; set; }
|
||||
|
||||
public EEmote? Emote { get; set; }
|
||||
|
||||
public ChatMessage? ChatMessage { get; set; }
|
||||
|
|
|
|||
|
|
@ -30,16 +30,16 @@ internal static class Craft
|
|||
return new global::_003C_003Ez__ReadOnlyArray<ITask>(new ITask[2]
|
||||
{
|
||||
new Questionable.Controller.Steps.Common.Mount.UnmountTask(),
|
||||
new CraftTask(step.ItemId.Value, step.ItemCount.Value)
|
||||
new CraftTask(step.ItemId.Value, step.ItemCount.Value, step.RequireHq == true)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed record CraftTask(uint ItemId, int ItemCount) : ITask
|
||||
internal sealed record CraftTask(uint ItemId, int ItemCount, bool RequireHq) : ITask
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
return $"Craft {ItemCount}x {ItemId} (with Artisan)";
|
||||
return $"Craft {ItemCount}x {ItemId}{(RequireHq ? " (HQ)" : "")} (with Artisan)";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -49,7 +49,7 @@ internal static class Craft
|
|||
{
|
||||
if (HasRequestedItems())
|
||||
{
|
||||
logger.LogInformation("Already own {ItemCount}x {ItemId}", base.Task.ItemCount, base.Task.ItemId);
|
||||
logger.LogInformation("Already own {ItemCount}x {ItemId}{HqSuffix}", base.Task.ItemCount, base.Task.ItemId, base.Task.RequireHq ? " (HQ)" : "");
|
||||
return false;
|
||||
}
|
||||
RecipeLookup? rowOrDefault = dataManager.GetExcelSheet<RecipeLookup>().GetRowOrDefault(base.Task.ItemId);
|
||||
|
|
@ -88,7 +88,7 @@ internal static class Craft
|
|||
throw new TaskException($"Unable to determine recipe for item {base.Task.ItemId}");
|
||||
}
|
||||
int num2 = base.Task.ItemCount - GetOwnedItemCount();
|
||||
logger.LogInformation("Starting craft for item {ItemId} with recipe {RecipeId} for {RemainingItemCount} items", base.Task.ItemId, num, num2);
|
||||
logger.LogInformation("Starting craft for item {ItemId} with recipe {RecipeId} for {RemainingItemCount} items{HqSuffix}", base.Task.ItemId, num, num2, base.Task.RequireHq ? " (HQ required)" : "");
|
||||
if (!artisanIpc.CraftItem((ushort)num, num2))
|
||||
{
|
||||
throw new TaskException($"Failed to start Artisan craft for recipe {num}");
|
||||
|
|
@ -128,7 +128,16 @@ internal static class Craft
|
|||
private unsafe int GetOwnedItemCount()
|
||||
{
|
||||
InventoryManager* ptr = InventoryManager.Instance();
|
||||
return ptr->GetInventoryItemCount(base.Task.ItemId, isHq: false, checkEquipped: false, checkArmory: true, 0) + ptr->GetInventoryItemCount(base.Task.ItemId, isHq: true, checkEquipped: false, checkArmory: true, 0);
|
||||
if (base.Task.RequireHq)
|
||||
{
|
||||
int inventoryItemCount = ptr->GetInventoryItemCount(base.Task.ItemId, isHq: true, checkEquipped: false, checkArmory: true, 0);
|
||||
logger.LogTrace("HQ item count for {ItemId}: {Count}", base.Task.ItemId, inventoryItemCount);
|
||||
return inventoryItemCount;
|
||||
}
|
||||
int inventoryItemCount2 = ptr->GetInventoryItemCount(base.Task.ItemId, isHq: false, checkEquipped: false, checkArmory: true, 0);
|
||||
int inventoryItemCount3 = ptr->GetInventoryItemCount(base.Task.ItemId, isHq: true, checkEquipped: false, checkArmory: true, 0);
|
||||
logger.LogTrace("Total item count for {ItemId}: {NqCount} NQ + {HqCount} HQ = {Total}", base.Task.ItemId, inventoryItemCount2, inventoryItemCount3, inventoryItemCount2 + inventoryItemCount3);
|
||||
return inventoryItemCount2 + inventoryItemCount3;
|
||||
}
|
||||
|
||||
public override bool ShouldInterruptOnDamage()
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,11 +1,14 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using System.Runtime.InteropServices;
|
||||
using Dalamud.Plugin;
|
||||
using Dalamud.Plugin.Ipc;
|
||||
using Questionable.Controller;
|
||||
using Questionable.Controller.Steps;
|
||||
using Questionable.Data;
|
||||
using Questionable.Functions;
|
||||
using Questionable.Model;
|
||||
using Questionable.Model.Questing;
|
||||
|
|
@ -38,6 +41,13 @@ internal sealed class QuestionableIpc : IDisposable
|
|||
public required int RemainingTaskCount { get; init; }
|
||||
}
|
||||
|
||||
public sealed class StopConditionData
|
||||
{
|
||||
public required bool Enabled { get; init; }
|
||||
|
||||
public required int TargetValue { get; init; }
|
||||
}
|
||||
|
||||
private const string IpcIsRunning = "Questionable.IsRunning";
|
||||
|
||||
private const string IpcGetCurrentQuestId = "Questionable.GetCurrentQuestId";
|
||||
|
|
@ -62,16 +72,6 @@ internal sealed class QuestionableIpc : IDisposable
|
|||
|
||||
private const string IpcIsQuestUnobtainable = "Questionable.IsQuestUnobtainable";
|
||||
|
||||
private const string IpcImportQuestPriority = "Questionable.ImportQuestPriority";
|
||||
|
||||
private const string IpcClearQuestPriority = "Questionable.ClearQuestPriority";
|
||||
|
||||
private const string IpcAddQuestPriority = "Questionable.AddQuestPriority";
|
||||
|
||||
private const string IpcInsertQuestPriority = "Questionable.InsertQuestPriority";
|
||||
|
||||
private const string IpcExportQuestPriority = "Questionable.ExportQuestPriority";
|
||||
|
||||
private const string IpcGetDefaultDutyMode = "Questionable.GetDefaultDutyMode";
|
||||
|
||||
private const string IpcSetDefaultDutyMode = "Questionable.SetDefaultDutyMode";
|
||||
|
|
@ -84,14 +84,68 @@ internal sealed class QuestionableIpc : IDisposable
|
|||
|
||||
private const string IpcClearAllDutyModeOverrides = "Questionable.ClearAllDutyModeOverrides";
|
||||
|
||||
private const string IpcImportQuestPriority = "Questionable.ImportQuestPriority";
|
||||
|
||||
private const string IpcClearQuestPriority = "Questionable.ClearQuestPriority";
|
||||
|
||||
private const string IpcAddQuestPriority = "Questionable.AddQuestPriority";
|
||||
|
||||
private const string IpcInsertQuestPriority = "Questionable.InsertQuestPriority";
|
||||
|
||||
private const string IpcExportQuestPriority = "Questionable.ExportQuestPriority";
|
||||
|
||||
private const string IpcGetPriorityQuests = "Questionable.GetPriorityQuests";
|
||||
|
||||
private const string IpcRemovePriorityQuest = "Questionable.RemovePriorityQuest";
|
||||
|
||||
private const string IpcReorderPriorityQuest = "Questionable.ReorderPriorityQuest";
|
||||
|
||||
private const string IpcGetAvailablePresets = "Questionable.GetAvailablePresets";
|
||||
|
||||
private const string IpcGetPresetQuests = "Questionable.GetPresetQuests";
|
||||
|
||||
private const string IpcAddPresetToPriority = "Questionable.AddPresetToPriority";
|
||||
|
||||
private const string IpcIsPresetAvailable = "Questionable.IsPresetAvailable";
|
||||
|
||||
private const string IpcIsQuestInPriority = "Questionable.IsQuestInPriority";
|
||||
|
||||
private const string IpcGetQuestPriorityIndex = "Questionable.GetQuestPriorityIndex";
|
||||
|
||||
private const string IpcHasAvailablePriorityQuests = "Questionable.HasAvailablePriorityQuests";
|
||||
|
||||
private const string IpcGetStopConditionsEnabled = "Questionable.GetStopConditionsEnabled";
|
||||
|
||||
private const string IpcSetStopConditionsEnabled = "Questionable.SetStopConditionsEnabled";
|
||||
|
||||
private const string IpcGetStopQuestList = "Questionable.GetStopQuestList";
|
||||
|
||||
private const string IpcAddStopQuest = "Questionable.AddStopQuest";
|
||||
|
||||
private const string IpcRemoveStopQuest = "Questionable.RemoveStopQuest";
|
||||
|
||||
private const string IpcClearStopQuests = "Questionable.ClearStopQuests";
|
||||
|
||||
private const string IpcGetLevelStopCondition = "Questionable.GetLevelStopCondition";
|
||||
|
||||
private const string IpcSetLevelStopCondition = "Questionable.SetLevelStopCondition";
|
||||
|
||||
private const string IpcGetSequenceStopCondition = "Questionable.GetSequenceStopCondition";
|
||||
|
||||
private const string IpcSetSequenceStopCondition = "Questionable.SetSequenceStopCondition";
|
||||
|
||||
private readonly QuestController _questController;
|
||||
|
||||
private readonly QuestRegistry _questRegistry;
|
||||
|
||||
private readonly QuestFunctions _questFunctions;
|
||||
|
||||
private readonly QuestData _questData;
|
||||
|
||||
private readonly ManualPriorityComponent _manualPriorityComponent;
|
||||
|
||||
private readonly PresetBuilderComponent _presetBuilderComponent;
|
||||
|
||||
private readonly Configuration _configuration;
|
||||
|
||||
private readonly IDalamudPluginInterface _pluginInterface;
|
||||
|
|
@ -120,16 +174,6 @@ internal sealed class QuestionableIpc : IDisposable
|
|||
|
||||
private readonly ICallGateProvider<string, bool> _isQuestUnobtainable;
|
||||
|
||||
private readonly ICallGateProvider<string, bool> _importQuestPriority;
|
||||
|
||||
private readonly ICallGateProvider<string, bool> _addQuestPriority;
|
||||
|
||||
private readonly ICallGateProvider<bool> _clearQuestPriority;
|
||||
|
||||
private readonly ICallGateProvider<int, string, bool> _insertQuestPriority;
|
||||
|
||||
private readonly ICallGateProvider<string> _exportQuestPriority;
|
||||
|
||||
private readonly ICallGateProvider<int> _getDefaultDutyMode;
|
||||
|
||||
private readonly ICallGateProvider<int, bool> _setDefaultDutyMode;
|
||||
|
|
@ -142,13 +186,65 @@ internal sealed class QuestionableIpc : IDisposable
|
|||
|
||||
private readonly ICallGateProvider<bool> _clearAllDutyModeOverrides;
|
||||
|
||||
public QuestionableIpc(QuestController questController, EventInfoComponent eventInfoComponent, QuestRegistry questRegistry, QuestFunctions questFunctions, ManualPriorityComponent manualPriorityComponent, Configuration configuration, IDalamudPluginInterface pluginInterface)
|
||||
private readonly ICallGateProvider<string, bool> _importQuestPriority;
|
||||
|
||||
private readonly ICallGateProvider<string, bool> _addQuestPriority;
|
||||
|
||||
private readonly ICallGateProvider<bool> _clearQuestPriority;
|
||||
|
||||
private readonly ICallGateProvider<int, string, bool> _insertQuestPriority;
|
||||
|
||||
private readonly ICallGateProvider<string> _exportQuestPriority;
|
||||
|
||||
private readonly ICallGateProvider<List<string>> _getPriorityQuests;
|
||||
|
||||
private readonly ICallGateProvider<string, bool> _removePriorityQuest;
|
||||
|
||||
private readonly ICallGateProvider<string, int, bool> _reorderPriorityQuest;
|
||||
|
||||
private readonly ICallGateProvider<List<string>> _getAvailablePresets;
|
||||
|
||||
private readonly ICallGateProvider<string, List<string>> _getPresetQuests;
|
||||
|
||||
private readonly ICallGateProvider<string, int> _addPresetToPriority;
|
||||
|
||||
private readonly ICallGateProvider<string, bool> _isPresetAvailable;
|
||||
|
||||
private readonly ICallGateProvider<string, bool> _isQuestInPriority;
|
||||
|
||||
private readonly ICallGateProvider<string, int> _getQuestPriorityIndex;
|
||||
|
||||
private readonly ICallGateProvider<bool> _hasAvailablePriorityQuests;
|
||||
|
||||
private readonly ICallGateProvider<bool> _getStopConditionsEnabled;
|
||||
|
||||
private readonly ICallGateProvider<bool, bool> _setStopConditionsEnabled;
|
||||
|
||||
private readonly ICallGateProvider<List<string>> _getStopQuestList;
|
||||
|
||||
private readonly ICallGateProvider<string, bool> _addStopQuest;
|
||||
|
||||
private readonly ICallGateProvider<string, bool> _removeStopQuest;
|
||||
|
||||
private readonly ICallGateProvider<bool> _clearStopQuests;
|
||||
|
||||
private readonly ICallGateProvider<StopConditionData> _getLevelStopCondition;
|
||||
|
||||
private readonly ICallGateProvider<bool, int, bool> _setLevelStopCondition;
|
||||
|
||||
private readonly ICallGateProvider<StopConditionData> _getSequenceStopCondition;
|
||||
|
||||
private readonly ICallGateProvider<bool, int, bool> _setSequenceStopCondition;
|
||||
|
||||
public QuestionableIpc(QuestController questController, EventInfoComponent eventInfoComponent, QuestRegistry questRegistry, QuestFunctions questFunctions, QuestData questData, ManualPriorityComponent manualPriorityComponent, PresetBuilderComponent presetBuilderComponent, Configuration configuration, IDalamudPluginInterface pluginInterface)
|
||||
{
|
||||
QuestionableIpc questionableIpc = this;
|
||||
_questController = questController;
|
||||
_questRegistry = questRegistry;
|
||||
_questFunctions = questFunctions;
|
||||
_questData = questData;
|
||||
_manualPriorityComponent = manualPriorityComponent;
|
||||
_presetBuilderComponent = presetBuilderComponent;
|
||||
_configuration = configuration;
|
||||
_pluginInterface = pluginInterface;
|
||||
_isRunning = pluginInterface.GetIpcProvider<bool>("Questionable.IsRunning");
|
||||
|
|
@ -176,16 +272,6 @@ internal sealed class QuestionableIpc : IDisposable
|
|||
_isQuestAccepted.RegisterFunc(IsQuestAccepted);
|
||||
_isQuestUnobtainable = pluginInterface.GetIpcProvider<string, bool>("Questionable.IsQuestUnobtainable");
|
||||
_isQuestUnobtainable.RegisterFunc(IsQuestUnobtainable);
|
||||
_importQuestPriority = pluginInterface.GetIpcProvider<string, bool>("Questionable.ImportQuestPriority");
|
||||
_importQuestPriority.RegisterFunc(ImportQuestPriority);
|
||||
_addQuestPriority = pluginInterface.GetIpcProvider<string, bool>("Questionable.AddQuestPriority");
|
||||
_addQuestPriority.RegisterFunc(AddQuestPriority);
|
||||
_clearQuestPriority = pluginInterface.GetIpcProvider<bool>("Questionable.ClearQuestPriority");
|
||||
_clearQuestPriority.RegisterFunc(ClearQuestPriority);
|
||||
_insertQuestPriority = pluginInterface.GetIpcProvider<int, string, bool>("Questionable.InsertQuestPriority");
|
||||
_insertQuestPriority.RegisterFunc(InsertQuestPriority);
|
||||
_exportQuestPriority = pluginInterface.GetIpcProvider<string>("Questionable.ExportQuestPriority");
|
||||
_exportQuestPriority.RegisterFunc(_manualPriorityComponent.EncodeQuestPriority);
|
||||
_getDefaultDutyMode = pluginInterface.GetIpcProvider<int>("Questionable.GetDefaultDutyMode");
|
||||
_getDefaultDutyMode.RegisterFunc(GetDefaultDutyMode);
|
||||
_setDefaultDutyMode = pluginInterface.GetIpcProvider<int, bool>("Questionable.SetDefaultDutyMode");
|
||||
|
|
@ -198,6 +284,56 @@ internal sealed class QuestionableIpc : IDisposable
|
|||
_clearDutyModeOverride.RegisterFunc(ClearDutyModeOverride);
|
||||
_clearAllDutyModeOverrides = pluginInterface.GetIpcProvider<bool>("Questionable.ClearAllDutyModeOverrides");
|
||||
_clearAllDutyModeOverrides.RegisterFunc(ClearAllDutyModeOverrides);
|
||||
_importQuestPriority = pluginInterface.GetIpcProvider<string, bool>("Questionable.ImportQuestPriority");
|
||||
_importQuestPriority.RegisterFunc(ImportQuestPriority);
|
||||
_addQuestPriority = pluginInterface.GetIpcProvider<string, bool>("Questionable.AddQuestPriority");
|
||||
_addQuestPriority.RegisterFunc(AddQuestPriority);
|
||||
_clearQuestPriority = pluginInterface.GetIpcProvider<bool>("Questionable.ClearQuestPriority");
|
||||
_clearQuestPriority.RegisterFunc(ClearQuestPriority);
|
||||
_insertQuestPriority = pluginInterface.GetIpcProvider<int, string, bool>("Questionable.InsertQuestPriority");
|
||||
_insertQuestPriority.RegisterFunc(InsertQuestPriority);
|
||||
_exportQuestPriority = pluginInterface.GetIpcProvider<string>("Questionable.ExportQuestPriority");
|
||||
_exportQuestPriority.RegisterFunc(_manualPriorityComponent.EncodeQuestPriority);
|
||||
_getPriorityQuests = pluginInterface.GetIpcProvider<List<string>>("Questionable.GetPriorityQuests");
|
||||
_getPriorityQuests.RegisterFunc(GetPriorityQuests);
|
||||
_removePriorityQuest = pluginInterface.GetIpcProvider<string, bool>("Questionable.RemovePriorityQuest");
|
||||
_removePriorityQuest.RegisterFunc(RemovePriorityQuest);
|
||||
_reorderPriorityQuest = pluginInterface.GetIpcProvider<string, int, bool>("Questionable.ReorderPriorityQuest");
|
||||
_reorderPriorityQuest.RegisterFunc(ReorderPriorityQuest);
|
||||
_getAvailablePresets = pluginInterface.GetIpcProvider<List<string>>("Questionable.GetAvailablePresets");
|
||||
_getAvailablePresets.RegisterFunc(GetAvailablePresets);
|
||||
_getPresetQuests = pluginInterface.GetIpcProvider<string, List<string>>("Questionable.GetPresetQuests");
|
||||
_getPresetQuests.RegisterFunc(GetPresetQuests);
|
||||
_addPresetToPriority = pluginInterface.GetIpcProvider<string, int>("Questionable.AddPresetToPriority");
|
||||
_addPresetToPriority.RegisterFunc(AddPresetToPriority);
|
||||
_isPresetAvailable = pluginInterface.GetIpcProvider<string, bool>("Questionable.IsPresetAvailable");
|
||||
_isPresetAvailable.RegisterFunc(IsPresetAvailable);
|
||||
_isQuestInPriority = pluginInterface.GetIpcProvider<string, bool>("Questionable.IsQuestInPriority");
|
||||
_isQuestInPriority.RegisterFunc(IsQuestInPriority);
|
||||
_getQuestPriorityIndex = pluginInterface.GetIpcProvider<string, int>("Questionable.GetQuestPriorityIndex");
|
||||
_getQuestPriorityIndex.RegisterFunc(GetQuestPriorityIndex);
|
||||
_hasAvailablePriorityQuests = pluginInterface.GetIpcProvider<bool>("Questionable.HasAvailablePriorityQuests");
|
||||
_hasAvailablePriorityQuests.RegisterFunc(HasAvailablePriorityQuests);
|
||||
_getStopConditionsEnabled = pluginInterface.GetIpcProvider<bool>("Questionable.GetStopConditionsEnabled");
|
||||
_getStopConditionsEnabled.RegisterFunc(GetStopConditionsEnabled);
|
||||
_setStopConditionsEnabled = pluginInterface.GetIpcProvider<bool, bool>("Questionable.SetStopConditionsEnabled");
|
||||
_setStopConditionsEnabled.RegisterFunc(SetStopConditionsEnabled);
|
||||
_getStopQuestList = pluginInterface.GetIpcProvider<List<string>>("Questionable.GetStopQuestList");
|
||||
_getStopQuestList.RegisterFunc(GetStopQuestList);
|
||||
_addStopQuest = pluginInterface.GetIpcProvider<string, bool>("Questionable.AddStopQuest");
|
||||
_addStopQuest.RegisterFunc(AddStopQuest);
|
||||
_removeStopQuest = pluginInterface.GetIpcProvider<string, bool>("Questionable.RemoveStopQuest");
|
||||
_removeStopQuest.RegisterFunc(RemoveStopQuest);
|
||||
_clearStopQuests = pluginInterface.GetIpcProvider<bool>("Questionable.ClearStopQuests");
|
||||
_clearStopQuests.RegisterFunc(ClearStopQuests);
|
||||
_getLevelStopCondition = pluginInterface.GetIpcProvider<StopConditionData>("Questionable.GetLevelStopCondition");
|
||||
_getLevelStopCondition.RegisterFunc(GetLevelStopCondition);
|
||||
_setLevelStopCondition = pluginInterface.GetIpcProvider<bool, int, bool>("Questionable.SetLevelStopCondition");
|
||||
_setLevelStopCondition.RegisterFunc(SetLevelStopCondition);
|
||||
_getSequenceStopCondition = pluginInterface.GetIpcProvider<StopConditionData>("Questionable.GetSequenceStopCondition");
|
||||
_getSequenceStopCondition.RegisterFunc(GetSequenceStopCondition);
|
||||
_setSequenceStopCondition = pluginInterface.GetIpcProvider<bool, int, bool>("Questionable.SetSequenceStopCondition");
|
||||
_setSequenceStopCondition.RegisterFunc(SetSequenceStopCondition);
|
||||
}
|
||||
|
||||
private bool StartQuest(string questId, bool single)
|
||||
|
|
@ -307,37 +443,6 @@ internal sealed class QuestionableIpc : IDisposable
|
|||
return false;
|
||||
}
|
||||
|
||||
private bool ImportQuestPriority(string encodedQuestPriority)
|
||||
{
|
||||
List<ElementId> questElements = PriorityWindow.DecodeQuestPriority(encodedQuestPriority);
|
||||
_questController.ImportQuestPriority(questElements);
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool ClearQuestPriority()
|
||||
{
|
||||
_questController.ClearQuestPriority();
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool AddQuestPriority(string questId)
|
||||
{
|
||||
if (ElementId.TryFromString(questId, out ElementId elementId) && elementId != null && _questRegistry.IsKnownQuest(elementId))
|
||||
{
|
||||
return _questController.AddQuestPriority(elementId);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool InsertQuestPriority(int index, string questId)
|
||||
{
|
||||
if (ElementId.TryFromString(questId, out ElementId elementId) && elementId != null && _questRegistry.IsKnownQuest(elementId))
|
||||
{
|
||||
return _questController.InsertQuestPriority(index, elementId);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private int GetDefaultDutyMode()
|
||||
{
|
||||
return (int)_configuration.Duties.DefaultDutyMode;
|
||||
|
|
@ -391,14 +496,433 @@ internal sealed class QuestionableIpc : IDisposable
|
|||
return true;
|
||||
}
|
||||
|
||||
private bool ImportQuestPriority(string encodedQuestPriority)
|
||||
{
|
||||
List<ElementId> questElements = PriorityWindow.DecodeQuestPriority(encodedQuestPriority);
|
||||
_questController.ImportQuestPriority(questElements);
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool ClearQuestPriority()
|
||||
{
|
||||
_questController.ClearQuestPriority();
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool AddQuestPriority(string questId)
|
||||
{
|
||||
if (ElementId.TryFromString(questId, out ElementId elementId) && elementId != null && _questRegistry.IsKnownQuest(elementId))
|
||||
{
|
||||
return _questController.AddQuestPriority(elementId);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool InsertQuestPriority(int index, string questId)
|
||||
{
|
||||
if (ElementId.TryFromString(questId, out ElementId elementId) && elementId != null && _questRegistry.IsKnownQuest(elementId))
|
||||
{
|
||||
return _questController.InsertQuestPriority(index, elementId);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private List<string> GetPriorityQuests()
|
||||
{
|
||||
return _questController.ManualPriorityQuests.Select((Quest q) => q.Id.ToString()).ToList();
|
||||
}
|
||||
|
||||
private bool RemovePriorityQuest(string questId)
|
||||
{
|
||||
if (ElementId.TryFromString(questId, out ElementId elementId) && elementId != null)
|
||||
{
|
||||
Quest quest = _questController.ManualPriorityQuests.FirstOrDefault((Quest q) => q.Id.Equals(elementId));
|
||||
if (quest != null)
|
||||
{
|
||||
_questController.ManualPriorityQuests.Remove(quest);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool ReorderPriorityQuest(string questId, int newIndex)
|
||||
{
|
||||
if (ElementId.TryFromString(questId, out ElementId elementId) && elementId != null)
|
||||
{
|
||||
Quest quest = _questController.ManualPriorityQuests.FirstOrDefault((Quest q) => q.Id.Equals(elementId));
|
||||
if (quest != null && newIndex >= 0 && newIndex < _questController.ManualPriorityQuests.Count)
|
||||
{
|
||||
_questController.ManualPriorityQuests.Remove(quest);
|
||||
_questController.ManualPriorityQuests.Insert(newIndex, quest);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private List<string> GetAvailablePresets()
|
||||
{
|
||||
return new List<string>
|
||||
{
|
||||
"aether_currents_hw", "aether_currents_sb", "aether_currents_shb", "aether_currents_ew", "aether_currents_dt", "aethernet_limsa", "aethernet_gridania", "aethernet_uldah", "aethernet_goldsaucer", "aethernet_ishgard",
|
||||
"aethernet_idyllshire", "aethernet_rhalgrs_reach", "aethernet_kugane", "aethernet_doman_enclave", "aethernet_the_crystarium", "aethernet_eulmore", "aethernet_old_sharlayan", "aethernet_radz_at_han", "aethernet_tuliyollal", "aethernet_solution_nine",
|
||||
"crystal_tower", "hard_primals"
|
||||
};
|
||||
}
|
||||
|
||||
private List<string> GetPresetQuests(string presetName)
|
||||
{
|
||||
List<ElementId> source;
|
||||
switch (presetName)
|
||||
{
|
||||
case "aether_currents_hw":
|
||||
source = GetAetherCurrentQuestsByExpansion(EExpansionVersion.Heavensward);
|
||||
break;
|
||||
case "aether_currents_sb":
|
||||
source = GetAetherCurrentQuestsByExpansion(EExpansionVersion.Stormblood);
|
||||
break;
|
||||
case "aether_currents_shb":
|
||||
source = GetAetherCurrentQuestsByExpansion(EExpansionVersion.Shadowbringers);
|
||||
break;
|
||||
case "aether_currents_ew":
|
||||
source = GetAetherCurrentQuestsByExpansion(EExpansionVersion.Endwalker);
|
||||
break;
|
||||
case "aether_currents_dt":
|
||||
source = GetAetherCurrentQuestsByExpansion(EExpansionVersion.Dawntrail);
|
||||
break;
|
||||
case "aethernet_limsa":
|
||||
{
|
||||
int num = 1;
|
||||
List<ElementId> list15 = new List<ElementId>(num);
|
||||
CollectionsMarshal.SetCount(list15, num);
|
||||
Span<ElementId> span = CollectionsMarshal.AsSpan(list15);
|
||||
int index = 0;
|
||||
span[index] = new AethernetId(1);
|
||||
source = list15;
|
||||
break;
|
||||
}
|
||||
case "aethernet_gridania":
|
||||
{
|
||||
int index = 1;
|
||||
List<ElementId> list14 = new List<ElementId>(index);
|
||||
CollectionsMarshal.SetCount(list14, index);
|
||||
Span<ElementId> span = CollectionsMarshal.AsSpan(list14);
|
||||
int num = 0;
|
||||
span[num] = new AethernetId(2);
|
||||
source = list14;
|
||||
break;
|
||||
}
|
||||
case "aethernet_uldah":
|
||||
{
|
||||
int num = 1;
|
||||
List<ElementId> list13 = new List<ElementId>(num);
|
||||
CollectionsMarshal.SetCount(list13, num);
|
||||
Span<ElementId> span = CollectionsMarshal.AsSpan(list13);
|
||||
int index = 0;
|
||||
span[index] = new AethernetId(3);
|
||||
source = list13;
|
||||
break;
|
||||
}
|
||||
case "aethernet_goldsaucer":
|
||||
{
|
||||
int index = 1;
|
||||
List<ElementId> list12 = new List<ElementId>(index);
|
||||
CollectionsMarshal.SetCount(list12, index);
|
||||
Span<ElementId> span = CollectionsMarshal.AsSpan(list12);
|
||||
int num = 0;
|
||||
span[num] = new AethernetId(4);
|
||||
source = list12;
|
||||
break;
|
||||
}
|
||||
case "aethernet_ishgard":
|
||||
{
|
||||
int num = 1;
|
||||
List<ElementId> list11 = new List<ElementId>(num);
|
||||
CollectionsMarshal.SetCount(list11, num);
|
||||
Span<ElementId> span = CollectionsMarshal.AsSpan(list11);
|
||||
int index = 0;
|
||||
span[index] = new AethernetId(5);
|
||||
source = list11;
|
||||
break;
|
||||
}
|
||||
case "aethernet_idyllshire":
|
||||
{
|
||||
int index = 1;
|
||||
List<ElementId> list10 = new List<ElementId>(index);
|
||||
CollectionsMarshal.SetCount(list10, index);
|
||||
Span<ElementId> span = CollectionsMarshal.AsSpan(list10);
|
||||
int num = 0;
|
||||
span[num] = new AethernetId(6);
|
||||
source = list10;
|
||||
break;
|
||||
}
|
||||
case "aethernet_rhalgrs_reach":
|
||||
{
|
||||
int num = 1;
|
||||
List<ElementId> list9 = new List<ElementId>(num);
|
||||
CollectionsMarshal.SetCount(list9, num);
|
||||
Span<ElementId> span = CollectionsMarshal.AsSpan(list9);
|
||||
int index = 0;
|
||||
span[index] = new AethernetId(7);
|
||||
source = list9;
|
||||
break;
|
||||
}
|
||||
case "aethernet_kugane":
|
||||
{
|
||||
int index = 1;
|
||||
List<ElementId> list8 = new List<ElementId>(index);
|
||||
CollectionsMarshal.SetCount(list8, index);
|
||||
Span<ElementId> span = CollectionsMarshal.AsSpan(list8);
|
||||
int num = 0;
|
||||
span[num] = new AethernetId(8);
|
||||
source = list8;
|
||||
break;
|
||||
}
|
||||
case "aethernet_doman_enclave":
|
||||
{
|
||||
int num = 1;
|
||||
List<ElementId> list7 = new List<ElementId>(num);
|
||||
CollectionsMarshal.SetCount(list7, num);
|
||||
Span<ElementId> span = CollectionsMarshal.AsSpan(list7);
|
||||
int index = 0;
|
||||
span[index] = new AethernetId(9);
|
||||
source = list7;
|
||||
break;
|
||||
}
|
||||
case "aethernet_the_crystarium":
|
||||
{
|
||||
int index = 1;
|
||||
List<ElementId> list6 = new List<ElementId>(index);
|
||||
CollectionsMarshal.SetCount(list6, index);
|
||||
Span<ElementId> span = CollectionsMarshal.AsSpan(list6);
|
||||
int num = 0;
|
||||
span[num] = new AethernetId(10);
|
||||
source = list6;
|
||||
break;
|
||||
}
|
||||
case "aethernet_eulmore":
|
||||
{
|
||||
int num = 1;
|
||||
List<ElementId> list5 = new List<ElementId>(num);
|
||||
CollectionsMarshal.SetCount(list5, num);
|
||||
Span<ElementId> span = CollectionsMarshal.AsSpan(list5);
|
||||
int index = 0;
|
||||
span[index] = new AethernetId(11);
|
||||
source = list5;
|
||||
break;
|
||||
}
|
||||
case "aethernet_old_sharlayan":
|
||||
{
|
||||
int index = 1;
|
||||
List<ElementId> list4 = new List<ElementId>(index);
|
||||
CollectionsMarshal.SetCount(list4, index);
|
||||
Span<ElementId> span = CollectionsMarshal.AsSpan(list4);
|
||||
int num = 0;
|
||||
span[num] = new AethernetId(12);
|
||||
source = list4;
|
||||
break;
|
||||
}
|
||||
case "aethernet_radz_at_han":
|
||||
{
|
||||
int num = 1;
|
||||
List<ElementId> list3 = new List<ElementId>(num);
|
||||
CollectionsMarshal.SetCount(list3, num);
|
||||
Span<ElementId> span = CollectionsMarshal.AsSpan(list3);
|
||||
int index = 0;
|
||||
span[index] = new AethernetId(13);
|
||||
source = list3;
|
||||
break;
|
||||
}
|
||||
case "aethernet_tuliyollal":
|
||||
{
|
||||
int index = 1;
|
||||
List<ElementId> list2 = new List<ElementId>(index);
|
||||
CollectionsMarshal.SetCount(list2, index);
|
||||
Span<ElementId> span = CollectionsMarshal.AsSpan(list2);
|
||||
int num = 0;
|
||||
span[num] = new AethernetId(14);
|
||||
source = list2;
|
||||
break;
|
||||
}
|
||||
case "aethernet_solution_nine":
|
||||
{
|
||||
int num = 1;
|
||||
List<ElementId> list = new List<ElementId>(num);
|
||||
CollectionsMarshal.SetCount(list, num);
|
||||
Span<ElementId> span = CollectionsMarshal.AsSpan(list);
|
||||
int index = 0;
|
||||
span[index] = new AethernetId(15);
|
||||
source = list;
|
||||
break;
|
||||
}
|
||||
case "crystal_tower":
|
||||
source = QuestData.CrystalTowerQuests.Cast<ElementId>().ToList();
|
||||
break;
|
||||
case "hard_primals":
|
||||
source = QuestData.HardModePrimals.Cast<ElementId>().ToList();
|
||||
break;
|
||||
default:
|
||||
source = new List<ElementId>();
|
||||
break;
|
||||
}
|
||||
return source.Select((ElementId q) => q.ToString()).ToList();
|
||||
}
|
||||
|
||||
private int AddPresetToPriority(string presetName)
|
||||
{
|
||||
List<string> presetQuests = GetPresetQuests(presetName);
|
||||
int num = 0;
|
||||
foreach (string item in presetQuests)
|
||||
{
|
||||
if (ElementId.TryFromString(item, out ElementId elementId) && elementId != null && (_questFunctions.IsReadyToAcceptQuest(elementId) || _questFunctions.IsQuestAccepted(elementId)) && !_questController.ManualPriorityQuests.Any((Quest q) => q.Id.Equals(elementId)) && _questRegistry.IsKnownQuest(elementId) && _questController.AddQuestPriority(elementId))
|
||||
{
|
||||
num++;
|
||||
}
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
private static List<ElementId> GetAetherCurrentQuestsByExpansion(EExpansionVersion expansion)
|
||||
{
|
||||
uint[] territoryRanges = expansion switch
|
||||
{
|
||||
EExpansionVersion.Heavensward => new uint[5] { 397u, 398u, 399u, 400u, 401u },
|
||||
EExpansionVersion.Stormblood => new uint[6] { 612u, 613u, 614u, 620u, 621u, 622u },
|
||||
EExpansionVersion.Shadowbringers => new uint[6] { 813u, 814u, 815u, 816u, 817u, 818u },
|
||||
EExpansionVersion.Endwalker => new uint[6] { 956u, 957u, 958u, 959u, 960u, 961u },
|
||||
EExpansionVersion.Dawntrail => new uint[6] { 1187u, 1188u, 1189u, 1190u, 1191u, 1192u },
|
||||
_ => Array.Empty<uint>(),
|
||||
};
|
||||
return QuestData.AetherCurrentQuestsByTerritory.Where<KeyValuePair<uint, ImmutableList<QuestId>>>((KeyValuePair<uint, ImmutableList<QuestId>> kvp) => territoryRanges.Contains(kvp.Key)).SelectMany((KeyValuePair<uint, ImmutableList<QuestId>> kvp) => kvp.Value).Cast<ElementId>()
|
||||
.ToList();
|
||||
}
|
||||
|
||||
private bool IsPresetAvailable(string presetName)
|
||||
{
|
||||
return GetAvailablePresets().Contains(presetName);
|
||||
}
|
||||
|
||||
private bool IsQuestInPriority(string questId)
|
||||
{
|
||||
if (ElementId.TryFromString(questId, out ElementId elementId) && elementId != null)
|
||||
{
|
||||
return _questController.ManualPriorityQuests.Any((Quest q) => q.Id.Equals(elementId));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private int GetQuestPriorityIndex(string questId)
|
||||
{
|
||||
if (ElementId.TryFromString(questId, out ElementId elementId) && elementId != null)
|
||||
{
|
||||
Quest quest = _questController.ManualPriorityQuests.FirstOrDefault((Quest q) => q.Id.Equals(elementId));
|
||||
if (quest != null)
|
||||
{
|
||||
return _questController.ManualPriorityQuests.IndexOf(quest);
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
private bool HasAvailablePriorityQuests()
|
||||
{
|
||||
return _questFunctions.GetNextPriorityQuestsThatCanBeAccepted().Any((PriorityQuestInfo x) => x.IsAvailable);
|
||||
}
|
||||
|
||||
private bool GetStopConditionsEnabled()
|
||||
{
|
||||
return _configuration.Stop.Enabled;
|
||||
}
|
||||
|
||||
private bool SetStopConditionsEnabled(bool enabled)
|
||||
{
|
||||
_configuration.Stop.Enabled = enabled;
|
||||
_pluginInterface.SavePluginConfig(_configuration);
|
||||
return true;
|
||||
}
|
||||
|
||||
private List<string> GetStopQuestList()
|
||||
{
|
||||
return _configuration.Stop.QuestsToStopAfter.Select((ElementId q) => q.ToString()).ToList();
|
||||
}
|
||||
|
||||
private bool AddStopQuest(string questId)
|
||||
{
|
||||
if (ElementId.TryFromString(questId, out ElementId elementId) && elementId != null && _questRegistry.IsKnownQuest(elementId) && !_configuration.Stop.QuestsToStopAfter.Contains(elementId))
|
||||
{
|
||||
_configuration.Stop.QuestsToStopAfter.Add(elementId);
|
||||
_pluginInterface.SavePluginConfig(_configuration);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool RemoveStopQuest(string questId)
|
||||
{
|
||||
if (ElementId.TryFromString(questId, out ElementId elementId) && elementId != null)
|
||||
{
|
||||
bool num = _configuration.Stop.QuestsToStopAfter.Remove(elementId);
|
||||
if (num)
|
||||
{
|
||||
_pluginInterface.SavePluginConfig(_configuration);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool ClearStopQuests()
|
||||
{
|
||||
_configuration.Stop.QuestsToStopAfter.Clear();
|
||||
_pluginInterface.SavePluginConfig(_configuration);
|
||||
return true;
|
||||
}
|
||||
|
||||
private StopConditionData GetLevelStopCondition()
|
||||
{
|
||||
return new StopConditionData
|
||||
{
|
||||
Enabled = _configuration.Stop.LevelToStopAfter,
|
||||
TargetValue = _configuration.Stop.TargetLevel
|
||||
};
|
||||
}
|
||||
|
||||
private bool SetLevelStopCondition(bool enabled, int targetLevel)
|
||||
{
|
||||
if (targetLevel < 1 || targetLevel > 100)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
_configuration.Stop.LevelToStopAfter = enabled;
|
||||
_configuration.Stop.TargetLevel = targetLevel;
|
||||
_pluginInterface.SavePluginConfig(_configuration);
|
||||
return true;
|
||||
}
|
||||
|
||||
private StopConditionData GetSequenceStopCondition()
|
||||
{
|
||||
return new StopConditionData
|
||||
{
|
||||
Enabled = _configuration.Stop.SequenceToStopAfter,
|
||||
TargetValue = _configuration.Stop.TargetSequence
|
||||
};
|
||||
}
|
||||
|
||||
private bool SetSequenceStopCondition(bool enabled, int targetSequence)
|
||||
{
|
||||
if (targetSequence < 0 || targetSequence > 255)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
_configuration.Stop.SequenceToStopAfter = enabled;
|
||||
_configuration.Stop.TargetSequence = targetSequence;
|
||||
_pluginInterface.SavePluginConfig(_configuration);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_clearAllDutyModeOverrides.UnregisterFunc();
|
||||
_clearDutyModeOverride.UnregisterFunc();
|
||||
_setDutyModeOverride.UnregisterFunc();
|
||||
_getDutyModeOverride.UnregisterFunc();
|
||||
_setDefaultDutyMode.UnregisterFunc();
|
||||
_getDefaultDutyMode.UnregisterFunc();
|
||||
_exportQuestPriority.UnregisterFunc();
|
||||
_insertQuestPriority.UnregisterFunc();
|
||||
_clearQuestPriority.UnregisterFunc();
|
||||
|
|
@ -416,5 +940,31 @@ internal sealed class QuestionableIpc : IDisposable
|
|||
_getCurrentStepData.UnregisterFunc();
|
||||
_getCurrentQuestId.UnregisterFunc();
|
||||
_isRunning.UnregisterFunc();
|
||||
_clearAllDutyModeOverrides.UnregisterFunc();
|
||||
_clearDutyModeOverride.UnregisterFunc();
|
||||
_setDutyModeOverride.UnregisterFunc();
|
||||
_getDutyModeOverride.UnregisterFunc();
|
||||
_setDefaultDutyMode.UnregisterFunc();
|
||||
_getDefaultDutyMode.UnregisterFunc();
|
||||
_hasAvailablePriorityQuests.UnregisterFunc();
|
||||
_getQuestPriorityIndex.UnregisterFunc();
|
||||
_isQuestInPriority.UnregisterFunc();
|
||||
_isPresetAvailable.UnregisterFunc();
|
||||
_addPresetToPriority.UnregisterFunc();
|
||||
_getPresetQuests.UnregisterFunc();
|
||||
_getAvailablePresets.UnregisterFunc();
|
||||
_reorderPriorityQuest.UnregisterFunc();
|
||||
_removePriorityQuest.UnregisterFunc();
|
||||
_getPriorityQuests.UnregisterFunc();
|
||||
_setSequenceStopCondition.UnregisterFunc();
|
||||
_getSequenceStopCondition.UnregisterFunc();
|
||||
_setLevelStopCondition.UnregisterFunc();
|
||||
_getLevelStopCondition.UnregisterFunc();
|
||||
_clearStopQuests.UnregisterFunc();
|
||||
_removeStopQuest.UnregisterFunc();
|
||||
_addStopQuest.UnregisterFunc();
|
||||
_getStopQuestList.UnregisterFunc();
|
||||
_setStopConditionsEnabled.UnregisterFunc();
|
||||
_getStopConditionsEnabled.UnregisterFunc();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,6 +56,8 @@ internal sealed class QuestFunctions
|
|||
|
||||
private readonly HashSet<ushort> _alreadyLoggedLevelRequirements = new HashSet<ushort>();
|
||||
|
||||
private readonly HashSet<ushort> _alreadyLoggedGcLockedQuests = new HashSet<ushort>();
|
||||
|
||||
private ElementId? _lastLoggedLevelLockedMsq;
|
||||
|
||||
private ElementId? _lastLoggedForcedClassQuest;
|
||||
|
|
@ -154,8 +156,11 @@ internal sealed class QuestFunctions
|
|||
}
|
||||
QuestReference questReference = GetMainScenarioQuest().Item1;
|
||||
if (questReference.CurrentQuest != null && !_questRegistry.IsKnownQuest(questReference.CurrentQuest))
|
||||
{
|
||||
if (questReference.CurrentQuest is QuestId questId && _alreadyLoggedUnobtainableQuestsDetailed.Add(questId.Value))
|
||||
{
|
||||
_logger.LogWarning("MSQ {MsqQuestId} is not in the quest registry, resetting to NoQuest", questReference.CurrentQuest);
|
||||
}
|
||||
questReference = QuestReference.NoQuest(questReference.State);
|
||||
}
|
||||
byte currentLevel = _clientState.LocalPlayer?.Level ?? 0;
|
||||
|
|
@ -200,15 +205,15 @@ internal sealed class QuestFunctions
|
|||
select x).ToList();
|
||||
if (list.Count > 0)
|
||||
{
|
||||
ElementId questId = list.First().QuestId;
|
||||
if (!IsQuestComplete(questId))
|
||||
ElementId questId2 = list.First().QuestId;
|
||||
if (!IsQuestComplete(questId2))
|
||||
{
|
||||
if (_lastLoggedForcedClassQuest != questId)
|
||||
if (_lastLoggedForcedClassQuest != questId2)
|
||||
{
|
||||
_logger.LogInformation("MSQ level locked. Forcing class quest {ClassQuestId} for {ClassJob} (level {QuestLevel})", questId, valueOrDefault, list.First().Level);
|
||||
_lastLoggedForcedClassQuest = questId;
|
||||
_logger.LogInformation("MSQ level locked. Forcing class quest {ClassQuestId} for {ClassJob} (level {QuestLevel})", questId2, valueOrDefault, list.First().Level);
|
||||
_lastLoggedForcedClassQuest = questId2;
|
||||
}
|
||||
return new QuestReference(questId, QuestManager.GetQuestSequence(questId.Value), questReference.State);
|
||||
return new QuestReference(questId2, QuestManager.GetQuestSequence(questId2.Value), questReference.State);
|
||||
}
|
||||
}
|
||||
else if (_lastLoggedLevelLockedMsq == questReference.CurrentQuest && _lastLoggedForcedClassQuest == null)
|
||||
|
|
@ -222,9 +227,9 @@ internal sealed class QuestFunctions
|
|||
select x).ToList();
|
||||
if (list2.Count > 0)
|
||||
{
|
||||
ElementId questId2 = list2.First().QuestId;
|
||||
_logger.LogInformation("MSQ level locked. Prioritizing class quest {ClassQuestId} for {ClassJob} (level {QuestLevel}) from registry", questId2, valueOrDefault, list2.First().Level);
|
||||
return new QuestReference(questId2, QuestManager.GetQuestSequence(questId2.Value), questReference.State);
|
||||
ElementId questId3 = list2.First().QuestId;
|
||||
_logger.LogInformation("MSQ level locked. Prioritizing class quest {ClassQuestId} for {ClassJob} (level {QuestLevel}) from registry", questId3, valueOrDefault, list2.First().Level);
|
||||
return new QuestReference(questId3, QuestManager.GetQuestSequence(questId3.Value), questReference.State);
|
||||
}
|
||||
_logger.LogWarning("MSQ level locked but no available early class quests found for {ClassJob} at level {CurrentLevel}", valueOrDefault, currentLevel);
|
||||
}
|
||||
|
|
@ -471,6 +476,20 @@ internal sealed class QuestFunctions
|
|||
return (new QuestReference(questId, QuestManager.GetQuestSequence(questId.Value), MainScenarioQuestState.Available), item);
|
||||
}
|
||||
|
||||
private static byte GetRequiredGCRank(QuestId questId)
|
||||
{
|
||||
return questId.Value switch
|
||||
{
|
||||
1128 => 8,
|
||||
1129 => 8,
|
||||
1130 => 8,
|
||||
1131 => 9,
|
||||
1132 => 9,
|
||||
1133 => 9,
|
||||
_ => 1,
|
||||
};
|
||||
}
|
||||
|
||||
private unsafe bool IsOnAlliedSocietyMount()
|
||||
{
|
||||
BattleChara* ptr = (BattleChara*)(_clientState.LocalPlayer?.Address ?? 0);
|
||||
|
|
@ -859,10 +878,20 @@ internal sealed class QuestFunctions
|
|||
return true;
|
||||
}
|
||||
QuestInfo questInfo = (QuestInfo)_questData.GetQuestInfo(questId);
|
||||
if (questInfo.GrandCompany != FFXIVClientStructs.FFXIV.Client.UI.Agent.GrandCompany.None && questInfo.GrandCompany != GetGrandCompany())
|
||||
if (questInfo.GrandCompany != FFXIVClientStructs.FFXIV.Client.UI.Agent.GrandCompany.None)
|
||||
{
|
||||
FFXIVClientStructs.FFXIV.Client.UI.Agent.GrandCompany grandCompany = GetGrandCompany();
|
||||
byte grandCompanyRank = GetGrandCompanyRank();
|
||||
byte requiredGCRank = GetRequiredGCRank(questId);
|
||||
if (questInfo.GrandCompany != grandCompany || grandCompanyRank < requiredGCRank)
|
||||
{
|
||||
if (_alreadyLoggedGcLockedQuests.Add(questId.Value))
|
||||
{
|
||||
_logger.LogDebug("Quest {QuestId} locked: required GC {RequiredGc}, required rank {RequiredRank}, player GC {PlayerGc}, player rank {PlayerRank}", questId, questInfo.GrandCompany, requiredGCRank, grandCompany, grandCompanyRank);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (questInfo.AlliedSociety != EAlliedSociety.None && questInfo.IsRepeatable)
|
||||
{
|
||||
return !IsDailyAlliedSocietyQuestAndAvailableToday(questId);
|
||||
|
|
@ -1274,6 +1303,11 @@ internal sealed class QuestFunctions
|
|||
return (FFXIVClientStructs.FFXIV.Client.UI.Agent.GrandCompany)PlayerState.Instance()->GrandCompany;
|
||||
}
|
||||
|
||||
public unsafe byte GetGrandCompanyRank()
|
||||
{
|
||||
return PlayerState.Instance()->GetGrandCompanyRank();
|
||||
}
|
||||
|
||||
public bool IsMainScenarioQuestComplete()
|
||||
{
|
||||
return IsQuestComplete(_questData.LastMainScenarioQuestId);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue