muffin v7.38.8

This commit is contained in:
alydev 2025-11-30 10:36:46 +10:00
parent 5e2d8f648b
commit 3e10cbbbf2
51 changed files with 2585 additions and 1972 deletions

View file

@ -44,6 +44,8 @@ internal sealed class QuestFunctions
private readonly IDataManager _dataManager;
private readonly IObjectTable _objectTable;
private readonly IClientState _clientState;
private readonly IGameGui _gameGui;
@ -68,7 +70,7 @@ internal sealed class QuestFunctions
private ElementId? _lastLoggedAcceptedHiddenMsq;
public QuestFunctions(QuestRegistry questRegistry, QuestData questData, AetheryteFunctions aetheryteFunctions, AlliedSocietyQuestFunctions alliedSocietyQuestFunctions, AlliedSocietyData alliedSocietyData, AetheryteData aetheryteData, Configuration configuration, IDataManager dataManager, IClientState clientState, IGameGui gameGui, IAetheryteList aetheryteList, ILogger<QuestFunctions> logger)
public QuestFunctions(QuestRegistry questRegistry, QuestData questData, AetheryteFunctions aetheryteFunctions, AlliedSocietyQuestFunctions alliedSocietyQuestFunctions, AlliedSocietyData alliedSocietyData, AetheryteData aetheryteData, Configuration configuration, IDataManager dataManager, IObjectTable objectTable, IClientState clientState, IGameGui gameGui, IAetheryteList aetheryteList, ILogger<QuestFunctions> logger)
{
_questRegistry = questRegistry;
_questData = questData;
@ -78,6 +80,7 @@ internal sealed class QuestFunctions
_aetheryteData = aetheryteData;
_configuration = configuration;
_dataManager = dataManager;
_objectTable = objectTable;
_clientState = clientState;
_gameGui = gameGui;
_aetheryteList = aetheryteList;
@ -163,14 +166,14 @@ internal sealed class QuestFunctions
}
questReference = QuestReference.NoQuest(questReference.State);
}
byte currentLevel = _clientState.LocalPlayer?.Level ?? 0;
byte currentLevel = _objectTable.LocalPlayer?.Level ?? 0;
if (questReference.CurrentQuest != null)
{
Questionable.Model.Quest quest;
bool flag = _questRegistry.TryGetQuest(questReference.CurrentQuest, out quest);
bool flag2 = IsQuestAccepted(questReference.CurrentQuest);
_logger.LogTrace("MSQ check: QuestId={QuestId}, InRegistry={InRegistry}, Level={QuestLevel}, CurrentLevel={CurrentLevel}, IsAccepted={IsAccepted}", questReference.CurrentQuest, flag, ((int?)quest?.Info.Level) ?? (-1), currentLevel, flag2);
EClassJob valueOrDefault = ((EClassJob?)_clientState.LocalPlayer?.ClassJob.RowId).GetValueOrDefault();
EClassJob valueOrDefault = ((EClassJob?)_objectTable.LocalPlayer?.ClassJob.RowId).GetValueOrDefault();
if (valueOrDefault != EClassJob.Adventurer)
{
QuestInfo questInfo = (from x in _questData.GetClassJobQuests(valueOrDefault)
@ -467,7 +470,7 @@ internal sealed class QuestFunctions
return (QuestReference.NoQuest(MainScenarioQuestState.Unavailable), $"Not readdy to accept quest {questId.Value}");
}
_lastLoggedNotReadyQuest = null;
if (!(_clientState.LocalPlayer?.Level).HasValue)
if (!(_objectTable.LocalPlayer?.Level).HasValue)
{
_logger.LogTrace("GetMainScenarioQuest: In loading screen");
return (QuestReference.NoQuest(MainScenarioQuestState.LoadingScreen), "In loading screen");
@ -492,7 +495,7 @@ internal sealed class QuestFunctions
private unsafe bool IsOnAlliedSocietyMount()
{
BattleChara* ptr = (BattleChara*)(_clientState.LocalPlayer?.Address ?? 0);
BattleChara* ptr = (BattleChara*)(_objectTable.LocalPlayer?.Address ?? 0);
if (ptr != null && ptr->Mount.MountId != 0)
{
return _alliedSocietyData.Mounts.ContainsKey(ptr->Mount.MountId);
@ -639,7 +642,7 @@ internal sealed class QuestFunctions
}
if (!_configuration.Advanced.SkipClassJobQuests)
{
EClassJob valueOrDefault = ((EClassJob?)_clientState.LocalPlayer?.ClassJob.RowId).GetValueOrDefault();
EClassJob valueOrDefault = ((EClassJob?)_objectTable.LocalPlayer?.ClassJob.RowId).GetValueOrDefault();
uint[] shadowbringersRoleQuestChapters = QuestData.AllRoleQuestChapters.Select((IReadOnlyList<uint> x) => x[0]).ToArray();
if (valueOrDefault != EClassJob.Adventurer)
{
@ -712,7 +715,7 @@ internal sealed class QuestFunctions
}
if (!ignoreLevel)
{
byte b = _clientState.LocalPlayer?.Level ?? 0;
byte b = _objectTable.LocalPlayer?.Level ?? 0;
if (b == 0)
{
return false;