Compare commits

...

10 Commits

14 changed files with 142 additions and 36 deletions

View File

@ -1,5 +1,5 @@
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<Version>2.17</Version> <Version>2.19</Version>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View File

@ -62,6 +62,9 @@ internal static class QuestStepExtensions
Assignment(nameof(QuestStep.IgnoreDistanceToObject), Assignment(nameof(QuestStep.IgnoreDistanceToObject),
step.IgnoreDistanceToObject, emptyStep.IgnoreDistanceToObject) step.IgnoreDistanceToObject, emptyStep.IgnoreDistanceToObject)
.AsSyntaxNodeOrToken(), .AsSyntaxNodeOrToken(),
Assignment(nameof(QuestStep.RestartNavigationIfCancelled),
step.RestartNavigationIfCancelled, emptyStep.RestartNavigationIfCancelled)
.AsSyntaxNodeOrToken(),
Assignment(nameof(QuestStep.Comment), step.Comment, emptyStep.Comment) Assignment(nameof(QuestStep.Comment), step.Comment, emptyStep.Comment)
.AsSyntaxNodeOrToken(), .AsSyntaxNodeOrToken(),
Assignment(nameof(QuestStep.Aetheryte), step.Aetheryte, emptyStep.Aetheryte) Assignment(nameof(QuestStep.Aetheryte), step.Aetheryte, emptyStep.Aetheryte)

View File

@ -53,6 +53,7 @@
"Y": -0.63573146, "Y": -0.63573146,
"Z": -166.33862 "Z": -166.33862
}, },
"StopDistance": 5,
"TerritoryId": 141, "TerritoryId": 141,
"InteractionType": "Interact" "InteractionType": "Interact"
} }

View File

@ -35,6 +35,7 @@
}, },
"TerritoryId": 155, "TerritoryId": 155,
"InteractionType": "CompleteQuest", "InteractionType": "CompleteQuest",
"Mount": true,
"DialogueChoices": [ "DialogueChoices": [
{ {
"Type": "YesNo", "Type": "YesNo",

View File

@ -337,16 +337,6 @@
"InteractionType": "WalkTo", "InteractionType": "WalkTo",
"Fly": true "Fly": true
}, },
{
"Position": {
"X": 233.0817,
"Y": 8,
"Z": -21.83023
},
"TerritoryId": 146,
"InteractionType": "WalkTo",
"Fly": true
},
{ {
"DataId": 2000077, "DataId": 2000077,
"Position": { "Position": {
@ -360,18 +350,16 @@
"KillEnemyDataIds": [ "KillEnemyDataIds": [
9489 9489
], ],
"$": "0 0 0 0 0 0 -> 16 17 0 0 0 128" "$": "0 0 0 0 0 0 -> 16 17 0 0 0 128",
}, "CompletionQuestVariablesFlags": [
{ null,
"Position": { null,
"X": 614.4023, null,
"Y": 301.81046, null,
"Z": -101.94888 null,
}, 128
"TerritoryId": 155, ],
"InteractionType": "WalkTo", "Fly": true
"Fly": true,
"AetheryteShortcut": "Coerthas Central Highlands - Camp Dragonhead"
}, },
{ {
"DataId": 2000078, "DataId": 2000078,
@ -386,7 +374,17 @@
"KillEnemyDataIds": [ "KillEnemyDataIds": [
9490 9490
], ],
"$": "16 17 0 0 0 128 -> 0 17 0 0 0 0" "Fly": true,
"AetheryteShortcut": "Coerthas Central Highlands - Camp Dragonhead",
"$": "16 17 0 0 0 128 -> 0 17 0 0 0 0",
"CompletionQuestVariablesFlags": [
null,
null,
null,
null,
null,
64
]
} }
] ]
}, },

View File

@ -191,6 +191,15 @@
"AethernetShard": "[Gold Saucer] Cactpot Board", "AethernetShard": "[Gold Saucer] Cactpot Board",
"DelaySecondsAtStart": 3 "DelaySecondsAtStart": 3
}, },
{
"Position": {
"X": 111.36922,
"Y": 13.000123,
"Z": -24.209782
},
"TerritoryId": 144,
"InteractionType": "WalkTo"
},
{ {
"DataId": 1011079, "DataId": 1011079,
"Position": { "Position": {
@ -207,6 +216,15 @@
{ {
"Sequence": 6, "Sequence": 6,
"Steps": [ "Steps": [
{
"Position": {
"X": 111.36922,
"Y": 13.000123,
"Z": -24.209782
},
"TerritoryId": 144,
"InteractionType": "WalkTo"
},
{ {
"TerritoryId": 144, "TerritoryId": 144,
"InteractionType": "None", "InteractionType": "None",

View File

@ -35,7 +35,8 @@
8578, 8578,
8579, 8579,
8580 8580
] ],
"Fly": true
} }
] ]
}, },

View File

@ -21,6 +21,32 @@
{ {
"Sequence": 1, "Sequence": 1,
"Steps": [ "Steps": [
{
"DataId": 1025066,
"Position": {
"X": -155.90149,
"Y": 66.2623,
"Z": -366.93372
},
"TerritoryId": 612,
"InteractionType": "Emote",
"Emote": "rally",
"Fly": true,
"RequiredQuestVariables": [null, null, [16], null, null, null]
},
{
"DataId": 1025064,
"Position": {
"X": 185.62585,
"Y": 68.93902,
"Z": -372.15234
},
"TerritoryId": 612,
"InteractionType": "Emote",
"RequiredQuestVariables": [null, [1, 17], null, null, null, null],
"Emote": "soothe",
"Fly": true
},
{ {
"DataId": 1025063, "DataId": 1025063,
"Position": { "Position": {
@ -30,6 +56,7 @@
}, },
"TerritoryId": 612, "TerritoryId": 612,
"InteractionType": "Emote", "InteractionType": "Emote",
"RequiredQuestVariables": [null, [2, 18], null, null, null, null],
"Emote": "soothe", "Emote": "soothe",
"Fly": true "Fly": true
}, },
@ -42,6 +69,7 @@
}, },
"TerritoryId": 612, "TerritoryId": 612,
"InteractionType": "Emote", "InteractionType": "Emote",
"RequiredQuestVariables": [null, null, [32], null, null, null],
"Emote": "rally", "Emote": "rally",
"Fly": true "Fly": true
} }
@ -58,6 +86,7 @@
}, },
"TerritoryId": 612, "TerritoryId": 612,
"InteractionType": "WalkTo", "InteractionType": "WalkTo",
"AetheryteShortcut": "Fringes - Peering Stones",
"Fly": true "Fly": true
}, },
{ {

View File

@ -0,0 +1,7 @@
```
0 0 x x 0 0 | 1025063 1025064 1025065 1025066
1 16 x x
2 16 x x
1 32 x x
2 32 x x
```

View File

@ -235,6 +235,16 @@ internal sealed class InteractionUiController : IDisposable
_logger.LogInformation("Checking if current quest {Name} is on the list", currentQuest.Quest.Info.Name); _logger.LogInformation("Checking if current quest {Name} is on the list", currentQuest.Quest.Info.Name);
if (CheckQuestSelection(addonSelectIconString, currentQuest.Quest, answers)) if (CheckQuestSelection(addonSelectIconString, currentQuest.Quest, answers))
return; return;
var sequence = currentQuest.Quest.FindSequence(currentQuest.Sequence);
QuestStep? step = sequence?.FindStep(currentQuest.Step);
if (step is { InteractionType: EInteractionType.AcceptQuest, PickUpQuestId: not null } &&
_questRegistry.TryGetQuest(step.PickUpQuestId, out Quest? pickupQuest))
{
_logger.LogInformation("Checking if current picked-up {Name} is on the list", pickupQuest.Info.Name);
if (CheckQuestSelection(addonSelectIconString, pickupQuest, answers))
return;
}
} }
var nextQuest = _questController.NextQuest; var nextQuest = _questController.NextQuest;

View File

@ -68,7 +68,7 @@ internal static class MoveTo
public ITask Move(MoveParams moveParams) public ITask Move(MoveParams moveParams)
{ {
return new MoveInternal(moveParams, movementController, gameFunctions, return new MoveInternal(moveParams, movementController, gameFunctions,
loggerFactory.CreateLogger<MoveInternal>(), condition, clientState, dataManager); loggerFactory.CreateLogger<MoveInternal>(), clientState, dataManager);
} }
public ITask Land() public ITask Land()
@ -163,24 +163,22 @@ internal static class MoveTo
private readonly string _cannotExecuteAtThisTime; private readonly string _cannotExecuteAtThisTime;
private readonly MovementController _movementController; private readonly MovementController _movementController;
private readonly ILogger<MoveInternal> _logger; private readonly ILogger<MoveInternal> _logger;
private readonly ICondition _condition;
private readonly IClientState _clientState; private readonly IClientState _clientState;
private readonly Action _startAction; private readonly Action _startAction;
private readonly Vector3 _destination; private readonly Vector3 _destination;
private readonly MoveParams _moveParams; private readonly MoveParams _moveParams;
private bool _canRestart;
public MoveInternal(MoveParams moveParams, public MoveInternal(MoveParams moveParams,
MovementController movementController, MovementController movementController,
GameFunctions gameFunctions, GameFunctions gameFunctions,
ILogger<MoveInternal> logger, ILogger<MoveInternal> logger,
ICondition condition,
IClientState clientState, IClientState clientState,
IDataManager dataManager) IDataManager dataManager)
{ {
_movementController = movementController; _movementController = movementController;
_logger = logger; _logger = logger;
_condition = condition;
_clientState = clientState; _clientState = clientState;
_cannotExecuteAtThisTime = dataManager.GetString<LogMessage>(579, x => x.Text)!; _cannotExecuteAtThisTime = dataManager.GetString<LogMessage>(579, x => x.Text)!;
@ -213,6 +211,7 @@ internal static class MoveTo
} }
_moveParams = moveParams; _moveParams = moveParams;
_canRestart = moveParams.RestartNavigation;
} }
public bool Start() public bool Start()
@ -231,13 +230,20 @@ internal static class MoveTo
if (movementStartedAt == DateTime.MaxValue || movementStartedAt.AddSeconds(2) >= DateTime.Now) if (movementStartedAt == DateTime.MaxValue || movementStartedAt.AddSeconds(2) >= DateTime.Now)
return ETaskResult.StillRunning; return ETaskResult.StillRunning;
if (_moveParams.RestartNavigation && if (_canRestart &&
Vector3.Distance(_clientState.LocalPlayer!.Position, _destination) > Vector3.Distance(_clientState.LocalPlayer!.Position, _destination) >
(_moveParams.StopDistance ?? QuestStep.DefaultStopDistance) + 5f) (_moveParams.StopDistance ?? QuestStep.DefaultStopDistance) + 5f)
{ {
_logger.LogInformation("Looks like movement was interrupted, re-attempting to move"); _canRestart = false;
_startAction(); if (_clientState.TerritoryType == _moveParams.TerritoryId)
return ETaskResult.StillRunning; {
_logger.LogInformation("Looks like movement was interrupted, re-attempting to move");
_startAction();
return ETaskResult.StillRunning;
}
else
_logger.LogInformation(
"Looks like movement was interrupted, do nothing since we're in a different territory now");
} }
return ETaskResult.TaskComplete; return ETaskResult.TaskComplete;
@ -247,8 +253,7 @@ internal static class MoveTo
public bool OnErrorToast(SeString message) public bool OnErrorToast(SeString message)
{ {
if (GameFunctions.GameStringEquals(_cannotExecuteAtThisTime, message.TextValue) && if (GameFunctions.GameStringEquals(_cannotExecuteAtThisTime, message.TextValue))
_condition[ConditionFlag.Diving])
return true; return true;
return false; return false;

View File

@ -0,0 +1,31 @@
using System;
using Dalamud.Plugin;
using Dalamud.Plugin.Ipc;
using Questionable.Controller;
namespace Questionable.External;
internal sealed class QuestionableIpc : IDisposable
{
private const string IpcIsRunning = "Questionable.IsRunning";
private const string IpcGetCurrentQuestId = "Questionable.GetCurrentQuestId";
private readonly ICallGateProvider<bool> _isRunning;
private readonly ICallGateProvider<string?> _getCurrentQuestId;
public QuestionableIpc(QuestController questController, IDalamudPluginInterface pluginInterface)
{
_isRunning = pluginInterface.GetIpcProvider<bool>(IpcIsRunning);
_isRunning.RegisterFunc(() => questController.IsRunning);
_getCurrentQuestId = pluginInterface.GetIpcProvider<string?>(IpcGetCurrentQuestId);
_getCurrentQuestId.RegisterFunc(() => questController.CurrentQuest?.Quest.Id.ToString());
}
public void Dispose()
{
_getCurrentQuestId.UnregisterFunc();
_isRunning.UnregisterFunc();
}
}

View File

@ -120,6 +120,7 @@ public sealed class QuestionablePlugin : IDalamudPlugin
serviceCollection.AddSingleton<LifestreamIpc>(); serviceCollection.AddSingleton<LifestreamIpc>();
serviceCollection.AddSingleton<YesAlreadyIpc>(); serviceCollection.AddSingleton<YesAlreadyIpc>();
serviceCollection.AddSingleton<ArtisanIpc>(); serviceCollection.AddSingleton<ArtisanIpc>();
serviceCollection.AddSingleton<QuestionableIpc>();
} }
private static void AddTaskFactories(ServiceCollection serviceCollection) private static void AddTaskFactories(ServiceCollection serviceCollection)
@ -235,6 +236,7 @@ public sealed class QuestionablePlugin : IDalamudPlugin
serviceProvider.GetRequiredService<CreditsController>(); serviceProvider.GetRequiredService<CreditsController>();
serviceProvider.GetRequiredService<HelpUiController>(); serviceProvider.GetRequiredService<HelpUiController>();
serviceProvider.GetRequiredService<LeveUiController>(); serviceProvider.GetRequiredService<LeveUiController>();
serviceProvider.GetRequiredService<QuestionableIpc>();
serviceProvider.GetRequiredService<DalamudInitializer>(); serviceProvider.GetRequiredService<DalamudInitializer>();
} }

View File

@ -177,7 +177,7 @@ internal sealed partial class ActiveQuestComponent
{ {
using var _ = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow); using var _ = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow);
ImGui.TextUnformatted( ImGui.TextUnformatted(
$"Next Quest: {Shorten(currentQuest.Quest.Info.Name)} / {currentQuest.Sequence} / {currentQuest.Step}"); $"Next Quest: {Shorten(nextQuest.Quest.Info.Name)} / {nextQuest.Sequence} / {nextQuest.Step}");
} }
} }
} }