Fix quest chain logic
authorLiza Carvelli <liza@carvel.li>
Thu, 11 Jul 2024 11:11:50 +0000 (13:11 +0200)
committerLiza Carvelli <liza@carvel.li>
Thu, 11 Jul 2024 11:11:50 +0000 (13:11 +0200)
12 files changed:
QuestPaths/Dawntrail/MSQ/F-Living Memory/4959_Dawntrail.json
QuestPaths/Dawntrail/RoleQuests/MagicalRanged/4842_Power Forgotten.json
QuestPaths/Dawntrail/Unlocks/Dungeons/5013_It Belongs in a Museum.json [new file with mode: 0644]
QuestPaths/Dawntrail/Unlocks/Hunts/5009_A New Dawn, A New Hunt.json [new file with mode: 0644]
QuestPaths/Dawntrail/Unlocks/Hunts/5010_Why We Hunt.json [new file with mode: 0644]
QuestPaths/Dawntrail/Unlocks/Hunts/5011_Hunting the Hunter.json [new file with mode: 0644]
QuestPaths/Dawntrail/Unlocks/Hunts/5012_The Hunt Goes On.json [new file with mode: 0644]
Questionable/Controller/CommandHandler.cs
Questionable/Controller/QuestController.cs
Questionable/Controller/Steps/BaseTasks/NextQuest.cs
Questionable/Questionable.csproj
Questionable/QuestionablePlugin.cs

index 4d320523e01a6d6b3dfd86ade4c3f04ad871ca78..6cbdaee5ae209666828f16bdebc5f0749dbae2d7 100644 (file)
@@ -83,7 +83,7 @@
             "Y": -14.999356,
             "Z": 204.42505
           },
-          "StopDistance": 5,
+          "StopDistance": 7,
           "TerritoryId": 1185,
           "InteractionType": "CompleteQuest"
         }
index 124f68790d6d02cfcac3982956ee3708ccdb449c..c23273f2aee412f9a11ea170d6dd737d1cf3529a 100644 (file)
@@ -44,7 +44,8 @@
             "Z": 618.2803
           },
           "TerritoryId": 957,
-          "InteractionType": "Interact"
+          "InteractionType": "Interact",
+          "AetheryteShortcut": "Thavnair - Yedlihmad"
         }
       ]
     },
diff --git a/QuestPaths/Dawntrail/Unlocks/Dungeons/5013_It Belongs in a Museum.json b/QuestPaths/Dawntrail/Unlocks/Dungeons/5013_It Belongs in a Museum.json
new file mode 100644 (file)
index 0000000..0302612
--- /dev/null
@@ -0,0 +1,98 @@
+{
+  "$schema": "https://carvel.li/questionable/quest-1.0",
+  "Author": "liza",
+  "QuestSequence": [
+    {
+      "Sequence": 0,
+      "Steps": [
+        {
+          "DataId": 1051434,
+          "Position": {
+            "X": 28.580078,
+            "Y": -14,
+            "Z": 75.66943
+          },
+          "TerritoryId": 1185,
+          "InteractionType": "AcceptQuest"
+        }
+      ]
+    },
+    {
+      "Sequence": 1,
+      "Steps": [
+        {
+          "DataId": 1051435,
+          "Position": {
+            "X": 383.1692,
+            "Y": -17.700003,
+            "Z": -771.3283
+          },
+          "TerritoryId": 1190,
+          "InteractionType": "Interact",
+          "AetheryteShortcut": "Shaaloani - Mehwahhetsoan",
+          "Fly": true
+        }
+      ]
+    },
+    {
+      "Sequence": 2,
+      "Steps": [
+        {
+          "TerritoryId": 1190,
+          "InteractionType": "Duty",
+          "ContentFinderConditionId": 834
+        }
+      ]
+    },
+    {
+      "Sequence": 3,
+      "Steps": [
+        {
+          "DataId": 1051435,
+          "Position": {
+            "X": 383.1692,
+            "Y": -17.700003,
+            "Z": -771.3283
+          },
+          "TerritoryId": 1190,
+          "InteractionType": "Interact",
+          "AetheryteShortcut": "Shaaloani - Mehwahhetsoan",
+          "SkipIf": [
+            "AetheryteShortcutIfInSameTerritory"
+          ]
+        }
+      ]
+    },
+    {
+      "Sequence": 4,
+      "Steps": [
+        {
+          "DataId": 1051436,
+          "Position": {
+            "X": 476.73767,
+            "Y": 114.935,
+            "Z": 661.6769
+          },
+          "TerritoryId": 1187,
+          "InteractionType": "Interact",
+          "AetheryteShortcut": "Urqopacha - Worlar's Echo"
+        }
+      ]
+    },
+    {
+      "Sequence": 255,
+      "Steps": [
+        {
+          "DataId": 1051438,
+          "Position": {
+            "X": -498.7717,
+            "Y": 59.21188,
+            "Z": 145.00647
+          },
+          "TerritoryId": 1187,
+          "InteractionType": "CompleteQuest"
+        }
+      ]
+    }
+  ]
+}
diff --git a/QuestPaths/Dawntrail/Unlocks/Hunts/5009_A New Dawn, A New Hunt.json b/QuestPaths/Dawntrail/Unlocks/Hunts/5009_A New Dawn, A New Hunt.json
new file mode 100644 (file)
index 0000000..3cb1080
--- /dev/null
@@ -0,0 +1,37 @@
+{
+  "$schema": "https://carvel.li/questionable/quest-1.0",
+  "Author": "liza",
+  "QuestSequence": [
+    {
+      "Sequence": 0,
+      "Steps": [
+        {
+          "DataId": 1051413,
+          "Position": {
+            "X": -75.21173,
+            "Y": -10.00001,
+            "Z": 138.8418
+          },
+          "TerritoryId": 1185,
+          "InteractionType": "AcceptQuest"
+        }
+      ]
+    },
+    {
+      "Sequence": 255,
+      "Steps": [
+        {
+          "DataId": 1048541,
+          "Position": {
+            "X": 23.5141,
+            "Y": -14,
+            "Z": 137.40747
+          },
+          "TerritoryId": 1185,
+          "InteractionType": "CompleteQuest",
+          "NextQuestId": 5010
+        }
+      ]
+    }
+  ]
+}
diff --git a/QuestPaths/Dawntrail/Unlocks/Hunts/5010_Why We Hunt.json b/QuestPaths/Dawntrail/Unlocks/Hunts/5010_Why We Hunt.json
new file mode 100644 (file)
index 0000000..438994d
--- /dev/null
@@ -0,0 +1,52 @@
+{
+  "$schema": "https://carvel.li/questionable/quest-1.0",
+  "Author": "liza",
+  "QuestSequence": [
+    {
+      "Sequence": 0,
+      "Steps": [
+        {
+          "DataId": 1048541,
+          "Position": {
+            "X": 23.5141,
+            "Y": -14,
+            "Z": 137.40747
+          },
+          "TerritoryId": 1185,
+          "InteractionType": "AcceptQuest"
+        }
+      ]
+    },
+    {
+      "Sequence": 1,
+      "Steps": [
+        {
+          "DataId": 1051414,
+          "Position": {
+            "X": -90.348694,
+            "Y": -19.6019,
+            "Z": 212.54285
+          },
+          "TerritoryId": 1185,
+          "InteractionType": "Interact"
+        }
+      ]
+    },
+    {
+      "Sequence": 255,
+      "Steps": [
+        {
+          "DataId": 1048541,
+          "Position": {
+            "X": 23.5141,
+            "Y": -14,
+            "Z": 137.40747
+          },
+          "TerritoryId": 1185,
+          "InteractionType": "CompleteQuest",
+          "NextQuestId": 5011
+        }
+      ]
+    }
+  ]
+}
diff --git a/QuestPaths/Dawntrail/Unlocks/Hunts/5011_Hunting the Hunter.json b/QuestPaths/Dawntrail/Unlocks/Hunts/5011_Hunting the Hunter.json
new file mode 100644 (file)
index 0000000..08fd382
--- /dev/null
@@ -0,0 +1,106 @@
+{
+  "$schema": "https://carvel.li/questionable/quest-1.0",
+  "Author": "liza",
+  "QuestSequence": [
+    {
+      "Sequence": 0,
+      "Steps": [
+        {
+          "DataId": 1048541,
+          "Position": {
+            "X": 23.5141,
+            "Y": -14,
+            "Z": 137.40747
+          },
+          "TerritoryId": 1185,
+          "InteractionType": "AcceptQuest"
+        }
+      ]
+    },
+    {
+      "Sequence": 1,
+      "Steps": [
+        {
+          "DataId": 1049457,
+          "Position": {
+            "X": -223.92621,
+            "Y": 30,
+            "Z": -603.11285
+          },
+          "TerritoryId": 1191,
+          "InteractionType": "Interact",
+          "AetheryteShortcut": "Heritage Found - The Outskirts"
+        }
+      ]
+    },
+    {
+      "Sequence": 2,
+      "Steps": [
+        {
+          "Position": {
+            "X": -65.20557,
+            "Y": 38.80659,
+            "Z": -459.1674
+          },
+          "TerritoryId": 1186,
+          "InteractionType": "WalkTo",
+          "AetheryteShortcut": "Solution Nine",
+          "AethernetShortcut": [
+            "[Solution Nine] Aetheryte Plaza",
+            "[Solution Nine] Resolution"
+          ]
+        },
+        {
+          "DataId": 1049180,
+          "Position": {
+            "X": -67.27704,
+            "Y": 38.80659,
+            "Z": -459.22028
+          },
+          "TerritoryId": 1186,
+          "InteractionType": "Interact"
+        }
+      ]
+    },
+    {
+      "Sequence": 3,
+      "Steps": [
+        {
+          "DataId": 1051415,
+          "Position": {
+            "X": -400.351,
+            "Y": 14.029996,
+            "Z": 112.26062
+          },
+          "TerritoryId": 1186,
+          "InteractionType": "Interact",
+          "AethernetShortcut": [
+            "[Solution Nine] Resolution",
+            "[Solution Nine] Residential Sector"
+          ]
+        }
+      ]
+    },
+    {
+      "Sequence": 255,
+      "Steps": [
+        {
+          "DataId": 1048541,
+          "Position": {
+            "X": 23.5141,
+            "Y": -14,
+            "Z": 137.40747
+          },
+          "TerritoryId": 1185,
+          "InteractionType": "CompleteQuest",
+          "AetheryteShortcut": "Tuliyollal",
+          "AethernetShortcut": [
+            "[Tuliyollal] Aetheryte Plaza",
+            "[Tuliyollal] Bayside Bevy Marketplace"
+          ],
+          "NextQuestId": 5012
+        }
+      ]
+    }
+  ]
+}
diff --git a/QuestPaths/Dawntrail/Unlocks/Hunts/5012_The Hunt Goes On.json b/QuestPaths/Dawntrail/Unlocks/Hunts/5012_The Hunt Goes On.json
new file mode 100644 (file)
index 0000000..73b6917
--- /dev/null
@@ -0,0 +1,61 @@
+{
+  "$schema": "https://carvel.li/questionable/quest-1.0",
+  "Author": "liza",
+  "QuestSequence": [
+    {
+      "Sequence": 0,
+      "Steps": [
+        {
+          "DataId": 1048541,
+          "Position": {
+            "X": 23.5141,
+            "Y": -14,
+            "Z": 137.40747
+          },
+          "TerritoryId": 1185,
+          "InteractionType": "AcceptQuest"
+        }
+      ]
+    },
+    {
+      "Sequence": 1,
+      "Steps": [
+        {
+          "DataId": 1051415,
+          "Position": {
+            "X": -400.351,
+            "Y": 14.029996,
+            "Z": 112.26062
+          },
+          "TerritoryId": 1186,
+          "InteractionType": "Interact",
+          "AetheryteShortcut": "Solution Nine",
+          "AethernetShortcut": [
+            "[Solution Nine] Aetheryte Plaza",
+            "[Solution Nine] Residential Sector"
+          ]
+        }
+      ]
+    },
+    {
+      "Sequence": 255,
+      "Steps": [
+        {
+          "DataId": 1048541,
+          "Position": {
+            "X": 23.5141,
+            "Y": -14,
+            "Z": 137.40747
+          },
+          "TerritoryId": 1185,
+          "InteractionType": "CompleteQuest",
+          "AetheryteShortcut": "Tuliyollal",
+          "AethernetShortcut": [
+            "[Tuliyollal] Aetheryte Plaza",
+            "[Tuliyollal] Bayside Bevy Marketplace"
+          ]
+        }
+      ]
+    }
+  ]
+}
index 6cc495bbb3c747e77930d2cca90af9fe765a7173..af894e8d0461f279366d6fad406b9c6b2537ef7e 100644 (file)
@@ -93,10 +93,10 @@ internal sealed class CommandHandler : IDisposable
 
         if (arguments.Length >= 1 && ushort.TryParse(arguments[0], out ushort questId))
         {
-            if (_questRegistry.IsKnownQuest(questId))
+            if (_questRegistry.TryGetQuest(questId, out Quest? quest))
             {
                 _debugOverlay.HighlightedQuest = questId;
-                _chatGui.Print($"[Questionable] Set highlighted quest to {questId}.");
+                _chatGui.Print($"[Questionable] Set highlighted quest to {questId} ({quest.Info.Name}).");
             }
             else
                 _chatGui.PrintError($"[Questionable] Unknown quest {questId}.");
@@ -115,7 +115,7 @@ internal sealed class CommandHandler : IDisposable
             if (_questRegistry.TryGetQuest(questId, out Quest? quest))
             {
                 _questController.SetNextQuest(quest);
-                _chatGui.Print($"[Questionable] Set next quest to {questId}.");
+                _chatGui.Print($"[Questionable] Set next quest to {questId} ({quest.Info.Name}).");
             }
             else
             {
@@ -136,7 +136,7 @@ internal sealed class CommandHandler : IDisposable
             if (_questRegistry.TryGetQuest(questId, out Quest? quest))
             {
                 _questController.SimulateQuest(quest);
-                _chatGui.Print($"[Questionable] Simulating quest {questId}.");
+                _chatGui.Print($"[Questionable] Simulating quest {questId} ({quest.Info.Name}).");
             }
             else
                 _chatGui.PrintError($"[Questionable] Unknown quest {questId}.");
index 68b984afe797c7c670627c06ef94801baa0c8148..221bb2242216b9da28fbc8c3219880579a57b1eb 100644 (file)
@@ -78,6 +78,8 @@ internal sealed class QuestController
     {
         lock (_lock)
         {
+            _logger.LogInformation("Reload, resetting curent quest progress");
+
             _startedQuest = null;
             _nextQuest = null;
             _simulatedQuest = null;
@@ -328,9 +330,8 @@ internal sealed class QuestController
         {
             _logger.LogInformation("Stopping automatic questing");
             _automatic = false;
+            _nextQuest = null;
         }
-
-        _nextQuest = null;
     }
 
     public void SimulateQuest(Quest? quest)
index 0790d75b9b2800e2855c612f25ef1a48a712a8fe..c03f5a0680ffbf9145ced33cf76a4b898189287b 100644 (file)
@@ -50,5 +50,7 @@ internal static class NextQuest
         }
 
         public ETaskResult Update() => ETaskResult.TaskComplete;
+
+        public override string ToString() => $"SetNextQuest({NextQuestId})";
     }
 }
index d8f32ddbd63c8ed3d76f9190481fb2ecffeab2ff..6b39ffc1c2b87f8a2210ed9c6349c1044719f64f 100644 (file)
@@ -1,6 +1,6 @@
 <Project Sdk="Dalamud.NET.Sdk/9.0.2">
     <PropertyGroup>
-        <Version>1.3</Version>
+        <Version>1.4</Version>
         <OutputPath>dist</OutputPath>
         <PathMap Condition="$(SolutionDir) != ''">$(SolutionDir)=X:\</PathMap>
     </PropertyGroup>
index e7b943da87e8985fb35ad2254253159aecfed654..3b1e59ca2b7d4871f8311c329e5c0d0d77d25f82 100644 (file)
@@ -87,6 +87,7 @@ public sealed class QuestionablePlugin : IDalamudPlugin
         serviceCollection.AddTaskWithFactory<Move.Factory, Move.MoveInternal, Move.ExpectToBeNearDataId>();
         serviceCollection.AddTransient<Move.MoveBuilder>();
 
+        serviceCollection.AddTaskWithFactory<NextQuest.Factory, NextQuest.SetQuest>();
         serviceCollection.AddTaskWithFactory<AetherCurrent.Factory, AetherCurrent.DoAttune>();
         serviceCollection.AddTaskWithFactory<AethernetShard.Factory, AethernetShard.DoAttune>();
         serviceCollection.AddTaskWithFactory<Aetheryte.Factory, Aetheryte.DoAttune>();
@@ -111,7 +112,6 @@ public sealed class QuestionablePlugin : IDalamudPlugin
                 WaitAtEnd.WaitObjectAtPosition>();
         serviceCollection.AddTransient<WaitAtEnd.WaitQuestAccepted>();
         serviceCollection.AddTransient<WaitAtEnd.WaitQuestCompleted>();
-        serviceCollection.AddTaskWithFactory<NextQuest.Factory, NextQuest.SetQuest>();
 
         serviceCollection.AddSingleton<MovementController>();
         serviceCollection.AddSingleton<QuestRegistry>();