forked from liza/Questionable
Add experimental NG+ support
This commit is contained in:
parent
09d50b1305
commit
af37252629
@ -36,6 +36,16 @@
|
|||||||
],
|
],
|
||||||
"TargetTerritoryId": 956
|
"TargetTerritoryId": 956
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"Position": {
|
||||||
|
"X": -431.53903,
|
||||||
|
"Y": -220.1193,
|
||||||
|
"Z": 301.76364
|
||||||
|
},
|
||||||
|
"TerritoryId": 956,
|
||||||
|
"InteractionType": "WalkTo",
|
||||||
|
"Fly": true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"DataId": 1039827,
|
"DataId": 1039827,
|
||||||
"Position": {
|
"Position": {
|
||||||
@ -45,7 +55,7 @@
|
|||||||
},
|
},
|
||||||
"TerritoryId": 956,
|
"TerritoryId": 956,
|
||||||
"InteractionType": "Interact",
|
"InteractionType": "Interact",
|
||||||
"Fly": true
|
"Fly": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -84,6 +84,16 @@
|
|||||||
"FlyingUnlocked"
|
"FlyingUnlocked"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"Position": {
|
||||||
|
"X": -431.53903,
|
||||||
|
"Y": -220.1193,
|
||||||
|
"Z": 301.76364
|
||||||
|
},
|
||||||
|
"TerritoryId": 956,
|
||||||
|
"InteractionType": "WalkTo",
|
||||||
|
"Fly": true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"DataId": 1039582,
|
"DataId": 1039582,
|
||||||
"Position": {
|
"Position": {
|
||||||
@ -93,7 +103,7 @@
|
|||||||
},
|
},
|
||||||
"TerritoryId": 956,
|
"TerritoryId": 956,
|
||||||
"InteractionType": "Interact",
|
"InteractionType": "Interact",
|
||||||
"Fly": true
|
"Fly": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -9,6 +9,7 @@ using System.Text;
|
|||||||
using Dalamud.Game;
|
using Dalamud.Game;
|
||||||
using Dalamud.Game.ClientState.Conditions;
|
using Dalamud.Game.ClientState.Conditions;
|
||||||
using Dalamud.Game.ClientState.Objects;
|
using Dalamud.Game.ClientState.Objects;
|
||||||
|
using Dalamud.Memory;
|
||||||
using Dalamud.Plugin.Services;
|
using Dalamud.Plugin.Services;
|
||||||
using Dalamud.Utility;
|
using Dalamud.Utility;
|
||||||
using FFXIVClientStructs.FFXIV.Application.Network.WorkDefinitions;
|
using FFXIVClientStructs.FFXIV.Application.Network.WorkDefinitions;
|
||||||
@ -153,7 +154,7 @@ internal sealed unsafe class GameFunctions
|
|||||||
{
|
{
|
||||||
// always prioritize accepting MSQ quests, to make sure we don't turn in one MSQ quest and then go off to do
|
// always prioritize accepting MSQ quests, to make sure we don't turn in one MSQ quest and then go off to do
|
||||||
// side quests until the end of time.
|
// side quests until the end of time.
|
||||||
var msqQuest = GetMainStoryQuest(questManager);
|
var msqQuest = GetMainScenarioQuest(questManager);
|
||||||
if (msqQuest.CurrentQuest != 0 && !questManager->IsQuestAccepted(msqQuest.CurrentQuest))
|
if (msqQuest.CurrentQuest != 0 && !questManager->IsQuestAccepted(msqQuest.CurrentQuest))
|
||||||
return msqQuest;
|
return msqQuest;
|
||||||
|
|
||||||
@ -186,9 +187,31 @@ internal sealed unsafe class GameFunctions
|
|||||||
return default;
|
return default;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO This doesn't work with unaccepted quests in NG+, only accepted quests
|
private (ushort CurrentQuest, byte Sequence) GetMainScenarioQuest(QuestManager* questManager)
|
||||||
private (ushort CurrentQuest, byte Sequence) GetMainStoryQuest(QuestManager* questManager)
|
|
||||||
{
|
{
|
||||||
|
if (QuestManager.IsQuestComplete(3759)) // Memories Rekindled
|
||||||
|
{
|
||||||
|
AgentInterface* questRedoHud = AgentModule.Instance()->GetAgentByInternalId(AgentId.QuestRedoHud);
|
||||||
|
if (questRedoHud != null && questRedoHud->IsAgentActive())
|
||||||
|
{
|
||||||
|
// there's surely better ways to check this, but the one in the OOB Plugin was even less reliable
|
||||||
|
if (_gameGui.TryGetAddonByName<AtkUnitBase>("QuestRedoHud", out var addon) &&
|
||||||
|
addon->AtkValuesCount == 4 &&
|
||||||
|
// 0 seems to be active,
|
||||||
|
// 1 seems to be paused,
|
||||||
|
// 2 is unknown, but it happens e.g. before the quest 'Alzadaal's Legacy'
|
||||||
|
// 3 seems to be having /ng+ open while active,
|
||||||
|
// 4 seems to be when (a) suspending the chapter, or (b) having turned in a quest
|
||||||
|
addon->AtkValues[0].UInt is 0 or 2 or 3 or 4)
|
||||||
|
{
|
||||||
|
// redoHud+44 is chapter
|
||||||
|
// redoHud+46 is quest
|
||||||
|
ushort questId = MemoryHelper.Read<ushort>((nint)questRedoHud + 46);
|
||||||
|
return (questId, QuestManager.GetQuestSequence(questId));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var scenarioTree = AgentScenarioTree.Instance();
|
var scenarioTree = AgentScenarioTree.Instance();
|
||||||
if (scenarioTree == null)
|
if (scenarioTree == null)
|
||||||
return default;
|
return default;
|
||||||
|
Loading…
Reference in New Issue
Block a user