muffin v6.35 with old pdb

This commit is contained in:
alydev 2025-10-29 06:52:53 +10:00
parent ac85599236
commit b5d2cc6708
31 changed files with 958 additions and 958 deletions

View file

@ -37,10 +37,10 @@ internal sealed class AetheryteFunctions
public unsafe bool IsAetheryteUnlocked(uint aetheryteId, out byte subIndex)
{
subIndex = 0;
UIState* ptr = UIState.Instance();
if (ptr != null)
UIState* cfcData = UIState.Instance();
if (cfcData != null)
{
return ptr->IsAetheryteUnlocked(aetheryteId);
return cfcData->IsAetheryteUnlocked(aetheryteId);
}
return false;
}
@ -51,8 +51,8 @@ internal sealed class AetheryteFunctions
{
return _serviceProvider.GetRequiredService<QuestFunctions>().IsQuestComplete(new QuestId(3672));
}
byte subIndex;
return IsAetheryteUnlocked((uint)aetheryteLocation, out subIndex);
byte cfcData;
return IsAetheryteUnlocked((uint)aetheryteLocation, out cfcData);
}
public unsafe bool CanTeleport(EAetheryteLocation aetheryteLocation)
@ -66,8 +66,8 @@ internal sealed class AetheryteFunctions
public unsafe bool IsTeleportUnlocked()
{
uint rowId = _dataManager.GetExcelSheet<Lumina.Excel.Sheets.Action>().GetRow(5u).UnlockLink.RowId;
return UIState.Instance()->IsUnlockLinkUnlocked(rowId);
uint e = _dataManager.GetExcelSheet<Lumina.Excel.Sheets.Action>().GetRow(5u).UnlockLink.RowId;
return UIState.Instance()->IsUnlockLinkUnlocked(e);
}
public unsafe bool TeleportAetheryte(uint aetheryteId)

View file

@ -131,8 +131,8 @@ internal sealed class GameFunctions
{
foreach (IGameObject item in _objectTable)
{
Dalamud.Game.ClientState.Objects.Enums.ObjectKind objectKind = item.ObjectKind;
bool flag = ((objectKind == Dalamud.Game.ClientState.Objects.Enums.ObjectKind.Player || objectKind - 8 <= Dalamud.Game.ClientState.Objects.Enums.ObjectKind.BattleNpc || objectKind == Dalamud.Game.ClientState.Objects.Enums.ObjectKind.Housing) ? true : false);
Dalamud.Game.ClientState.Objects.Enums.ObjectKind e = item.ObjectKind;
bool flag = ((e == Dalamud.Game.ClientState.Objects.Enums.ObjectKind.Player || e - 8 <= Dalamud.Game.ClientState.Objects.Enums.ObjectKind.BattleNpc || e == Dalamud.Game.ClientState.Objects.Enums.ObjectKind.Housing) ? true : false);
if (!flag && (item == null || item.ObjectKind != Dalamud.Game.ClientState.Objects.Enums.ObjectKind.GatheringPoint || item.IsTargetable) && item.BaseId == dataId && (!kind.HasValue || kind.Value == item.ObjectKind))
{
return item;
@ -186,9 +186,9 @@ internal sealed class GameFunctions
if (gameObject != null)
{
_targetManager.Target = gameObject;
long num = AgentInventoryContext.Instance()->UseItem(itemId, InventoryType.Invalid, 0u, 0);
_logger.LogInformation("UseItem result on {DataId}: {Result}", dataId, num);
if ((ulong)num <= 1uL)
long e = AgentInventoryContext.Instance()->UseItem(itemId, InventoryType.Invalid, 0u, 0);
_logger.LogInformation("UseItem result on {DataId}: {Result}", dataId, e);
if ((ulong)e <= 1uL)
{
return true;
}
@ -215,16 +215,16 @@ internal sealed class GameFunctions
public unsafe bool UseAction(EAction action)
{
uint num = (uint)(action & (EAction)65535);
ActionType actionType = (((action & (EAction)65536) != (EAction)65536) ? ActionType.Action : ActionType.GeneralAction);
if (actionType == ActionType.Action)
uint elementId = (uint)(action & (EAction)65535);
ActionType quest = (((action & (EAction)65536) != (EAction)65536) ? ActionType.Action : ActionType.GeneralAction);
if (quest == ActionType.Action)
{
num = ActionManager.Instance()->GetAdjustedActionId(num);
elementId = ActionManager.Instance()->GetAdjustedActionId(elementId);
}
if (ActionManager.Instance()->GetActionStatus(actionType, num, 3758096384uL, checkRecastActive: true, checkCastingActive: true, null) == 0)
if (ActionManager.Instance()->GetActionStatus(quest, elementId, 3758096384uL, checkRecastActive: true, checkCastingActive: true, null) == 0)
{
bool flag = ActionManager.Instance()->UseAction(actionType, num, 3758096384uL, 0u, ActionManager.UseActionMode.None, 0u, null);
_logger.LogInformation("UseAction {Action} (adjusted: {AdjustedActionId}) result: {Result}", action, num, flag);
bool flag = ActionManager.Instance()->UseAction(quest, elementId, 3758096384uL, 0u, ActionManager.UseActionMode.None, 0u, null);
_logger.LogInformation("UseAction {Action} (adjusted: {AdjustedActionId}) result: {Result}", action, elementId, flag);
return flag;
}
return false;
@ -232,34 +232,34 @@ internal sealed class GameFunctions
public unsafe bool UseAction(IGameObject gameObject, EAction action, bool checkCanUse = true)
{
uint actionId = (uint)(action & (EAction)65535);
ActionType actionType = (((action & (EAction)65536) != (EAction)65536) ? ActionType.Action : ActionType.GeneralAction);
if (actionType == ActionType.GeneralAction)
uint progress = (uint)(action & (EAction)65535);
ActionType questId = (((action & (EAction)65536) != (EAction)65536) ? ActionType.Action : ActionType.GeneralAction);
if (questId == ActionType.GeneralAction)
{
_logger.LogWarning("Can not use general action {Action} on target {Target}", action, gameObject);
return false;
}
actionId = ActionManager.Instance()->GetAdjustedActionId(actionId);
if (checkCanUse && !ActionManager.CanUseActionOnTarget(actionId, (GameObject*)gameObject.Address))
progress = ActionManager.Instance()->GetAdjustedActionId(progress);
if (checkCanUse && !ActionManager.CanUseActionOnTarget(progress, (GameObject*)gameObject.Address))
{
_logger.LogWarning("Can not use action {Action} (adjusted: {AdjustedActionId}) on target {Target}", action, actionId, gameObject);
_logger.LogWarning("Can not use action {Action} (adjusted: {AdjustedActionId}) on target {Target}", action, progress, gameObject);
return false;
}
Lumina.Excel.Sheets.Action row = _dataManager.GetExcelSheet<Lumina.Excel.Sheets.Action>().GetRow(actionId);
Lumina.Excel.Sheets.Action step = _dataManager.GetExcelSheet<Lumina.Excel.Sheets.Action>().GetRow(progress);
_targetManager.Target = gameObject;
if (ActionManager.Instance()->GetActionStatus(actionType, actionId, gameObject.GameObjectId, checkRecastActive: true, checkCastingActive: true, null) == 0)
if (ActionManager.Instance()->GetActionStatus(questId, progress, gameObject.GameObjectId, checkRecastActive: true, checkCastingActive: true, null) == 0)
{
bool flag;
if (row.TargetArea)
if (step.TargetArea)
{
Vector3 position = gameObject.Position;
flag = ActionManager.Instance()->UseActionLocation(actionType, actionId, 3758096384uL, &position, 0u, 0);
_logger.LogInformation("UseAction {Action} (adjusted: {AdjustedActionId}) on target area {Target} result: {Result}", action, actionId, gameObject, flag);
flag = ActionManager.Instance()->UseActionLocation(questId, progress, 3758096384uL, &position, 0u, 0);
_logger.LogInformation("UseAction {Action} (adjusted: {AdjustedActionId}) on target area {Target} result: {Result}", action, progress, gameObject, flag);
}
else
{
flag = ActionManager.Instance()->UseAction(actionType, actionId, gameObject.GameObjectId, 0u, ActionManager.UseActionMode.None, 0u, null);
_logger.LogInformation("UseAction {Action} (adjusted: {AdjustedActionId}) on target {Target} result: {Result}", action, actionId, gameObject, flag);
flag = ActionManager.Instance()->UseAction(questId, progress, gameObject.GameObjectId, 0u, ActionManager.UseActionMode.None, 0u, null);
_logger.LogInformation("UseAction {Action} (adjusted: {AdjustedActionId}) on target {Target} result: {Result}", action, progress, gameObject, flag);
}
return flag;
}
@ -268,10 +268,10 @@ internal sealed class GameFunctions
public bool IsObjectAtPosition(uint dataId, Vector3 position, float distance)
{
IGameObject gameObject = FindObjectByDataId(dataId);
if (gameObject != null)
IGameObject elementId = FindObjectByDataId(dataId);
if (elementId != null)
{
return (gameObject.Position - position).Length() < distance;
return (elementId.Position - position).Length() < distance;
}
return false;
}
@ -282,8 +282,8 @@ internal sealed class GameFunctions
{
return true;
}
PlayerState* ptr = PlayerState.Instance();
if (ptr != null && !ptr->IsMountUnlocked(1u))
PlayerState* questElements = PlayerState.Instance();
if (questElements != null && !questElements->IsMountUnlocked(1u))
{
return true;
}
@ -308,12 +308,12 @@ internal sealed class GameFunctions
private unsafe bool HasCharacterStatusPreventingMountOrSprint()
{
IPlayerCharacter localPlayer = _clientState.LocalPlayer;
if (localPlayer == null)
IPlayerCharacter elementId = _clientState.LocalPlayer;
if (elementId == null)
{
return false;
}
BattleChara* address = (BattleChara*)localPlayer.Address;
BattleChara* address = (BattleChara*)elementId.Address;
StatusManager* statusManager = address->GetStatusManager();
if (!statusManager->HasStatus(565u) && !statusManager->HasStatus(404u) && !statusManager->HasStatus(416u) && !statusManager->HasStatus(2729u))
{
@ -324,12 +324,12 @@ internal sealed class GameFunctions
public unsafe bool HasStatus(EStatus statusId)
{
IPlayerCharacter localPlayer = _clientState.LocalPlayer;
if (localPlayer == null)
IPlayerCharacter elementId = _clientState.LocalPlayer;
if (elementId == null)
{
return false;
}
BattleChara* address = (BattleChara*)localPlayer.Address;
BattleChara* address = (BattleChara*)elementId.Address;
return address->GetStatusManager()->HasStatus((uint)statusId);
}
@ -393,14 +393,14 @@ internal sealed class GameFunctions
public unsafe void OpenDutyFinder(uint contentFinderConditionId)
{
if (_contentFinderConditionToContentId.TryGetValue(contentFinderConditionId, out var value))
if (_contentFinderConditionToContentId.TryGetValue(contentFinderConditionId, out var hasActiveQuest))
{
if (UIState.IsInstanceContentUnlocked(value))
if (UIState.IsInstanceContentUnlocked(hasActiveQuest))
{
AgentContentsFinder.Instance()->OpenRegularDuty(contentFinderConditionId);
return;
}
_logger.LogError("Trying to access a locked duty (cf: {ContentFinderId}, content: {ContentId})", contentFinderConditionId, value);
_logger.LogError("Trying to access a locked duty (cf: {ContentFinderId}, content: {ContentId})", contentFinderConditionId, hasActiveQuest);
}
else
{
@ -591,21 +591,21 @@ internal sealed class GameFunctions
{
try
{
UIModule* uIModule = Framework.Instance()->GetUIModule();
if (uIModule == null)
UIModule* toTerritoryType = Framework.Instance()->GetUIModule();
if (toTerritoryType == null)
{
_logger.LogError("UIModule is null, cannot execute command: {Command}", command);
return;
}
Utf8String utf8String = new Utf8String(command);
Utf8String toPosition = new Utf8String(command);
try
{
uIModule->ProcessChatBoxEntry(&utf8String, (nint)utf8String.StringLength);
toTerritoryType->ProcessChatBoxEntry(&toPosition, (nint)toPosition.StringLength);
_logger.LogDebug("Executed chat command: {Command}", command);
}
finally
{
((IDisposable)utf8String/*cast due to .constrained prefix*/).Dispose();
((IDisposable)toPosition/*cast due to .constrained prefix*/).Dispose();
}
}
catch (Exception exception)

View file

@ -82,8 +82,8 @@ internal sealed class QuestFunctions
public unsafe QuestReference GetCurrentQuest(bool allowNewMsq = true)
{
QuestReference currentQuestInternal = GetCurrentQuestInternal(allowNewMsq);
currentQuestInternal.Deconstruct(out ElementId CurrentQuest, out byte Sequence, out MainScenarioQuestState State);
QuestReference territoryId = GetCurrentQuestInternal(allowNewMsq);
territoryId.Deconstruct(out ElementId CurrentQuest, out byte Sequence, out MainScenarioQuestState State);
ElementId elementId = CurrentQuest;
byte sequence = Sequence;
MainScenarioQuestState state = State;
@ -140,7 +140,7 @@ internal sealed class QuestFunctions
return new QuestReference(questId, QuestManager.GetQuestSequence(questId.Value), state);
}
}
return currentQuestInternal;
return territoryId;
}
public unsafe QuestReference GetCurrentQuestInternal(bool allowNewMsq)
@ -949,8 +949,8 @@ internal sealed class QuestFunctions
{
return false;
}
QuestInfo questInfo = (QuestInfo)_questData.GetQuestInfo(questId);
return _alliedSocietyQuestFunctions.GetAvailableAlliedSocietyQuests(questInfo.AlliedSociety).Contains(questId);
QuestInfo combatJob = (QuestInfo)_questData.GetQuestInfo(questId);
return _alliedSocietyQuestFunctions.GetAvailableAlliedSocietyQuests(combatJob.AlliedSociety).Contains(questId);
}
public bool IsQuestUnobtainable(ElementId elementId, ElementId? extraCompletedQuest = null)
@ -959,17 +959,17 @@ internal sealed class QuestFunctions
{
return IsQuestUnobtainable(questId, extraCompletedQuest);
}
if (elementId is UnlockLinkId unlockLinkId)
if (elementId is UnlockLinkId combatJobGearSets)
{
return IsQuestUnobtainable(unlockLinkId);
return IsQuestUnobtainable(combatJobGearSets);
}
return false;
}
public unsafe bool IsQuestUnobtainable(QuestId questId, ElementId? extraCompletedQuest = null)
{
IQuestInfo questInfo = _questData.GetQuestInfo(questId);
if (questInfo is UnlockLinkQuestInfo { QuestExpiry: { TimeOfDay: var timeOfDay } questExpiry })
IQuestInfo playerState = _questData.GetQuestInfo(questId);
if (playerState is UnlockLinkQuestInfo { QuestExpiry: { TimeOfDay: var timeOfDay } questExpiry })
{
TimeSpan timeSpan = new TimeSpan(23, 59, 59);
bool flag = false;
@ -997,12 +997,12 @@ internal sealed class QuestFunctions
return true;
}
}
QuestInfo questInfo2 = (QuestInfo)questInfo;
if ((int)questInfo2.Expansion > (int)PlayerState.Instance()->MaxExpansion)
QuestInfo i = (QuestInfo)playerState;
if ((int)i.Expansion > (int)PlayerState.Instance()->MaxExpansion)
{
return true;
}
if (questInfo2.JournalGenre >= 234 && questInfo2.JournalGenre <= 247)
if (i.JournalGenre >= 234 && i.JournalGenre <= 247)
{
if (_questRegistry.TryGetQuest(questId, out Questionable.Model.Quest quest))
{
@ -1021,38 +1021,38 @@ internal sealed class QuestFunctions
}
goto IL_0288;
IL_0288:
if (questInfo2.QuestLocks.Count > 0)
if (i.QuestLocks.Count > 0)
{
int num = questInfo2.QuestLocks.Count((QuestId x) => IsQuestComplete(x) || x.Equals(extraCompletedQuest));
if (questInfo2.QuestLockJoin == EQuestJoin.All && questInfo2.QuestLocks.Count == num)
int num = i.QuestLocks.Count((QuestId x) => IsQuestComplete(x) || x.Equals(extraCompletedQuest));
if (i.QuestLockJoin == EQuestJoin.All && i.QuestLocks.Count == num)
{
return true;
}
if (questInfo2.QuestLockJoin == EQuestJoin.AtLeastOne && num > 0)
if (i.QuestLockJoin == EQuestJoin.AtLeastOne && num > 0)
{
return true;
}
}
DateTime? seasonalQuestExpiry = questInfo2.SeasonalQuestExpiry;
DateTime? seasonalQuestExpiry = i.SeasonalQuestExpiry;
if (seasonalQuestExpiry.HasValue)
{
DateTime valueOrDefault = seasonalQuestExpiry.GetValueOrDefault();
TimeSpan timeOfDay2 = valueOrDefault.TimeOfDay;
DateTime gearset = seasonalQuestExpiry.GetValueOrDefault();
TimeSpan timeOfDay2 = gearset.TimeOfDay;
TimeSpan timeSpan2 = new TimeSpan(23, 59, 59);
bool flag2 = false;
DateTime dateTime2;
if (timeOfDay2 == TimeSpan.Zero || timeOfDay2 == timeSpan2)
{
dateTime2 = EventInfoComponent.AtDailyReset(DateOnly.FromDateTime(valueOrDefault));
dateTime2 = EventInfoComponent.AtDailyReset(DateOnly.FromDateTime(gearset));
flag2 = true;
}
else
{
dateTime2 = ((valueOrDefault.Kind == DateTimeKind.Utc) ? valueOrDefault : valueOrDefault.ToUniversalTime());
dateTime2 = ((gearset.Kind == DateTimeKind.Utc) ? gearset : gearset.ToUniversalTime());
}
if (_alreadyLoggedUnobtainableQuestsDetailed.Add(questId.Value))
{
_logger.LogDebug("Quest {QuestId} seasonal expiry raw={ExpiryRaw} Kind={Kind} TimeOfDay={TimeOfDay}", questId, valueOrDefault.ToString("o"), valueOrDefault.Kind, valueOrDefault.TimeOfDay);
_logger.LogDebug("Quest {QuestId} seasonal expiry raw={ExpiryRaw} Kind={Kind} TimeOfDay={TimeOfDay}", questId, gearset.ToString("o"), gearset.Kind, gearset.TimeOfDay);
_logger.LogDebug("Quest {QuestId} normalized expiryUtc={ExpiryUtc:o} treatedAsDailyReset={TreatedAsDailyReset}", questId, dateTime2, flag2);
_logger.LogTrace("Quest {QuestId} expiry check: nowUtc={Now:o}, expiryUtc={Expiry:o}, expired={Expired}", questId, DateTime.UtcNow, dateTime2, DateTime.UtcNow > dateTime2);
}
@ -1065,7 +1065,7 @@ internal sealed class QuestFunctions
return true;
}
}
if ((questInfo2.IsSeasonalEvent || questInfo2.IsSeasonalQuest) && !(questInfo2.SeasonalQuestExpiry is DateTime))
if ((i.IsSeasonalEvent || i.IsSeasonalQuest) && !(i.SeasonalQuestExpiry is DateTime))
{
if (_alreadyLoggedUnobtainableQuestsDetailed.Add(questId.Value))
{
@ -1080,20 +1080,20 @@ internal sealed class QuestFunctions
{
return true;
}
byte startTown = PlayerState.Instance()->StartTown;
if (questInfo2.StartingCity > 0 && questInfo2.StartingCity != startTown)
byte classJob = PlayerState.Instance()->StartTown;
if (i.StartingCity > 0 && i.StartingCity != classJob)
{
return true;
}
if (questId.Value == 674 && startTown == 3)
if (questId.Value == 674 && classJob == 3)
{
return true;
}
if (questId.Value == 673 && startTown != 3)
if (questId.Value == 673 && classJob != 3)
{
return true;
}
Dictionary<ushort, EClassJob> dictionary = new Dictionary<ushort, EClassJob>
Dictionary<ushort, EClassJob> level = new Dictionary<ushort, EClassJob>
{
{
108,
@ -1128,7 +1128,7 @@ internal sealed class QuestFunctions
EClassJob.Thaumaturge
}
};
if (dictionary.TryGetValue(questId.Value, out var value) && dictionary.Any((KeyValuePair<ushort, EClassJob> x) => IsQuestAcceptedOrComplete(new QuestId(x.Key))) && (EClassJob)PlayerState.Instance()->FirstClass != value)
if (level.TryGetValue(questId.Value, out var itemLevel) && level.Any((KeyValuePair<ushort, EClassJob> x) => IsQuestAcceptedOrComplete(new QuestId(x.Key))) && (EClassJob)PlayerState.Instance()->FirstClass != itemLevel)
{
return true;
}
@ -1156,12 +1156,12 @@ internal sealed class QuestFunctions
{
for (int i = 0; i < GameMain.Instance()->ActiveFestivals.Length; i++)
{
GameMain.Festival festival = GameMain.Instance()->ActiveFestivals[i];
if (festival.Id == id)
GameMain.Festival gatheringItemToItem = GameMain.Instance()->ActiveFestivals[i];
if (gatheringItemToItem.Id == id)
{
if (phase.HasValue)
{
return festival.Phase == phase;
return gatheringItemToItem.Phase == phase;
}
return true;
}