Polished First Half of Elpis
authorLiza Carvelli <liza@carvel.li>
Tue, 28 May 2024 22:17:19 +0000 (00:17 +0200)
committerLiza Carvelli <liza@carvel.li>
Tue, 28 May 2024 22:17:19 +0000 (00:17 +0200)
17 files changed:
Questionable/Controller/QuestController.cs
Questionable/GameFunctions.cs
Questionable/Model/V1/Converter/InteractionTypeConverter.cs
Questionable/Model/V1/EInteractionType.cs
Questionable/Model/V1/QuestStep.cs
Questionable/QuestPaths/Endwalker/MSQ/E-Elpis/4419_Return to the Crystarium.json
Questionable/QuestPaths/Endwalker/MSQ/E-Elpis/4420_Hope Upon a Flower.json
Questionable/QuestPaths/Endwalker/MSQ/E-Elpis/4421_Petalouda Hunt.json
Questionable/QuestPaths/Endwalker/MSQ/E-Elpis/4423_Ponder Warrant Cherish Welcome.json
Questionable/QuestPaths/Endwalker/MSQ/E-Elpis/4424_Lives Apart.json
Questionable/QuestPaths/Endwalker/MSQ/E-Elpis/4425_Their Greatest Contribution.json
Questionable/QuestPaths/Endwalker/MSQ/E-Elpis/4426_Aether to Aether.json
Questionable/QuestPaths/Endwalker/MSQ/E-Elpis/4427_A Sentimental Gift.json
Questionable/QuestPaths/Endwalker/MSQ/E-Elpis/4428_Verdict and Execution.json
Questionable/QuestPaths/Endwalker/MSQ/E-Elpis/4429_Travelers at the Crossroads.json
Questionable/QuestSchema/schema_v1.json
Questionable/Windows/DebugWindow.cs

index 3bc4b7ba390876d0c3becb9884c38568bccef9eb..c38b16278195550bb7a4aa99032a6454108c1485 100644 (file)
@@ -339,7 +339,7 @@ internal sealed class QuestController
 
         if (step.TargetTerritoryId == _clientState.TerritoryType)
         {
-            // no more movement
+            _pluginLog.Information("Skipping any movement");
         }
         else if (step.Position != null)
         {
@@ -349,7 +349,6 @@ internal sealed class QuestController
             else
                 distance = step.StopDistance ?? MovementController.DefaultStopDistance;
 
-            _pluginLog.Information($"Stop dist: {distance}");
             var position = _clientState.LocalPlayer?.Position ?? new Vector3();
             float actualDistance = (position - step.Position.Value).Length();
 
@@ -473,7 +472,12 @@ internal sealed class QuestController
                 if (_gameFunctions.Unmount())
                     return;
 
-                if (step is { DataId: not null, ItemId: not null })
+                if (step is { DataId: not null, ItemId: not null, GroundTarget: true })
+                {
+                    _gameFunctions.UseItemOnGround(step.DataId.Value, step.ItemId.Value);
+                    IncreaseStepCount();
+                }
+                else if (step is { DataId: not null, ItemId: not null })
                 {
                     _gameFunctions.UseItem(step.DataId.Value, step.ItemId.Value);
                     IncreaseStepCount();
@@ -507,6 +511,26 @@ internal sealed class QuestController
                     _gameFunctions.UseEmote(step.DataId.Value, step.Emote.Value);
                     IncreaseStepCount();
                 }
+                else if (step.Emote != null)
+                {
+                    _gameFunctions.UseEmote(step.Emote.Value);
+                    IncreaseStepCount();
+                }
+
+                break;
+
+            case EInteractionType.Say:
+                if (_condition[ConditionFlag.Mounted])
+                {
+                    _gameFunctions.Unmount();
+                    return;
+                }
+
+                if (!string.IsNullOrEmpty(step.ChatMessage))
+                {
+                    _gameFunctions.ExecuteCommand($"/say {step.ChatMessage}");
+                    IncreaseStepCount();
+                }
 
                 break;
 
index 8619b5c9b34e1511bfa96186ac1305eb42eb9e1c..14499a7292e114e0c9ad9db4f68d45aa050733a1 100644 (file)
@@ -355,6 +355,16 @@ internal sealed unsafe class GameFunctions
         }
     }
 
+    public void UseItemOnGround(uint dataId, uint itemId)
+    {
+        GameObject? gameObject = FindObjectByDataId(dataId);
+        if (gameObject != null)
+        {
+            var position = (FFXIVClientStructs.FFXIV.Common.Math.Vector3)gameObject.Position;
+            ActionManager.Instance()->UseActionLocation(ActionType.KeyItem, itemId, gameObject.ObjectId, &position);
+        }
+    }
+
     public void UseEmote(uint dataId, EEmote emote)
     {
         GameObject? gameObject = FindObjectByDataId(dataId);
@@ -365,6 +375,11 @@ internal sealed unsafe class GameFunctions
         }
     }
 
+    public void UseEmote(EEmote emote)
+    {
+        ExecuteCommand($"{_emoteCommands[emote]} motion");
+    }
+
     public bool IsObjectAtPosition(uint dataId, Vector3 position)
     {
         GameObject? gameObject = FindObjectByDataId(dataId);
index 1bab6dc7aec40faad8ed46586a8e2ab40f94629d..e6786e3c35190a01ce24f52400d28b584b0aec17 100644 (file)
@@ -17,6 +17,7 @@ public sealed class InteractionTypeConverter : JsonConverter<EInteractionType>
         { EInteractionType.AttuneAetherCurrent, "AttuneAetherCurrent" },
         { EInteractionType.Combat, "Combat" },
         { EInteractionType.UseItem, "UseItem" },
+        { EInteractionType.Say, "Say" },
         { EInteractionType.Emote, "Emote" },
         { EInteractionType.WaitForObjectAtPosition, "WaitForNpcAtPosition" },
         { EInteractionType.ManualAction, "ManualAction" }
index 9e9311b11eb56326d419eefd3f8b58f0fbf3f504..9c9c8d386e7a5c370a999292748fc03f6a377cac 100644 (file)
@@ -9,6 +9,7 @@ public enum EInteractionType
     AttuneAetherCurrent,
     Combat,
     UseItem,
+    Say,
     Emote,
     WaitForObjectAtPosition,
     ManualAction
index 1a4dbfbc63f1be0987a9616a85632c7a919f8804..404e6910cf08d1285a1d8b0af2198e79c1db5ddf 100644 (file)
@@ -33,9 +33,11 @@ public class QuestStep
     public uint? AetherCurrentId { get; set; }
 
     public uint? ItemId { get; set; }
+    public bool? GroundTarget { get; set; }
 
     [JsonConverter(typeof(EmoteConverter))]
     public EEmote? Emote { get; set; }
+    public string ChatMessage { get; set; }
 
     [JsonConverter(typeof(EnemySpawnTypeConverter))]
     public EEnemySpawnType? EnemySpawnType { get; set; }
index b295c1e153c47cb6a02cc9938496bf507952aecf..c813dc9cde197cb705c4001180578fd8baf600f3 100644 (file)
@@ -29,7 +29,9 @@
             "Z": 305.80603
           },
           "TerritoryId": 813,
-          "InteractionType": "Interact"
+          "InteractionType": "Interact",
+          "AetheryteShortcut": "Lakeland - Fort Jobb",
+          "Fly": true
         }
       ]
     },
@@ -46,6 +48,7 @@
           "TerritoryId": 819,
           "InteractionType": "ManualAction",
           "Comment": "Cutscene Interaction needed",
+          "AetheryteShortcut": "Crystarium",
           "AethernetShortcut": [
             "[Crystarium] Aetheryte Plaza",
             "[Crystarium] The Cabinet of Curiosity"
@@ -63,6 +66,7 @@
             "Y": -37.7,
             "Z": -208.85028
           },
+          "StopDistance": 6,
           "TerritoryId": 819,
           "InteractionType": "Interact"
         }
index 2699e71f4a2fcf5892aaa15e4c2a57e7cd5e12cd..d232461d29fb8316d788c9edb0a65e99762e1923 100644 (file)
@@ -12,6 +12,7 @@
             "Y": -37.7,
             "Z": -208.85028
           },
+          "StopDistance": 6,
           "TerritoryId": 819,
           "InteractionType": "Interact"
         }
       ]
     },
     {
-      "Sequence": 2,
+      "Sequence": 3,
       "Steps": [
         {
-          "DataId": 2012128,
           "Position": {
-            "X": -0.001528129,
-            "Y": 4.931927,
-            "Z": 0.01416349
+            "X": -6.1157894,
+            "Y": 2.0849845,
+            "Z": -4.654831
           },
           "TerritoryId": 1031,
-          "InteractionType": "ManualAction",
-          "Comment": "Interact with Aetheryte (Navmesh can't jump)"
+          "InteractionType": "WalkTo"
+        },
+        {
+          "DataId": 2012128,
+          "TerritoryId": 1031,
+          "InteractionType": "Interact",
+          "Comment": "Interact with Aetheryte (Navmesh can't jump)",
+          "$": "QuestVariables after: 16 0 16 0 0 16"
         },
         {
           "DataId": 1039993,
@@ -58,7 +64,8 @@
             "Z": -9.353821
           },
           "TerritoryId": 1031,
-          "InteractionType": "Interact"
+          "InteractionType": "Interact",
+          "$": "QuestVariables after: 32 1 16 0 0 144"
         },
         {
           "DataId": 1039994,
@@ -68,7 +75,8 @@
             "Z": 2.1209717
           },
           "TerritoryId": 1031,
-          "InteractionType": "Interact"
+          "InteractionType": "Interact",
+          "$": "QuestVariables after: 49 1 16 0 0 208"
         },
         {
           "DataId": 1039995,
             "Y": 44.32154,
             "Z": 771.4198
           },
+          "StopDistance": 5,
           "TerritoryId": 961,
           "InteractionType": "Interact"
         }
index 7fddea41784851241da21391d9b15e51df935406..3782a480e1ea7a6b94ddb2665af093858bd5908f 100644 (file)
@@ -12,6 +12,7 @@
             "Y": 44.32154,
             "Z": 771.4198
           },
+          "StopDistance": 5,
           "TerritoryId": 961,
           "InteractionType": "Interact"
         }
       "Steps": [
         {
           "DataId": 1039998,
-          "Position": {
-            "X": 206.0426,
-            "Y": 20.561113,
-            "Z": 629.14465
-          },
           "TerritoryId": 961,
           "InteractionType": "ManualAction",
           "Comment": "Capture Mobs with less than 50% HP"
index 955cd7e0d003651feee9031b66a1f503a10afff7..28f0c21ea84d609bdbab50d493f55de766b45dc3 100644 (file)
@@ -12,6 +12,7 @@
             "Y": -1.1050489,
             "Z": 158.0376
           },
+          "StopDistance": 5,
           "TerritoryId": 961,
           "InteractionType": "Interact"
         }
@@ -42,6 +43,7 @@
             "Y": 11.703674,
             "Z": 126.878784
           },
+          "StopDistance": 6,
           "TerritoryId": 961,
           "InteractionType": "AttuneAetheryte"
         },
index 40515e3b757da12d4a787b0b3ab961b52eb00841..807b85e47c7ddb50a9b14e72145b2b5c1f38958f 100644 (file)
             "Z": 1.5411377
           },
           "TerritoryId": 961,
-          "InteractionType": "ManualAction",
-          "Comment": "Use Quest Item on ground locations"
+          "InteractionType": "UseItem",
+          "ItemId": 2003234,
+          "GroundTarget": true,
+          "$": "QuestValues after: 1 16 0 0 0 128"
+        },
+        {
+          "DataId": 2012132,
+          "Position": {
+            "X": 373.18982,
+            "Y": 2.9754639,
+            "Z": 10.788086
+          },
+          "TerritoryId": 961,
+          "InteractionType": "UseItem",
+          "ItemId": 2003234,
+          "GroundTarget": true
         }
       ]
     },
index fae408258341b7fd35d6ba6893cbd217e2776b67..40923502cf81a0590327191f54e94b0b85e29309 100644 (file)
             "Z": 107.9021
           },
           "TerritoryId": 961,
-          "InteractionType": "AttuneAetherCurrent"
+          "InteractionType": "AttuneAetherCurrent",
+          "AetherCurrentId": 2818374
+        },
+        {
+          "Position": {
+            "X": 346.73517,
+            "Y": -15.572778,
+            "Z": -105.96149
+          },
+          "TerritoryId": 961,
+          "InteractionType": "WalkTo",
+          "Comment": "Needs manual jumping"
         },
         {
           "DataId": 1040052,
     {
       "Sequence": 4,
       "Steps": [
+        {
+          "Position": {
+            "X": 339.039,
+            "Y": -14.322072,
+            "Z": -101.509995
+          },
+          "StopDistance": 0.5,
+          "TerritoryId": 961,
+          "InteractionType": "WalkTo",
+          "DisableNavmesh": true
+        },
         {
           "DataId": 2012022,
           "Position": {
             "Z": 2.5177002
           },
           "TerritoryId": 961,
-          "InteractionType": "AttuneAetherCurrent"
+          "InteractionType": "AttuneAetherCurrent",
+          "AetherCurrentId": 2818376
         },
         {
           "DataId": 1040061,
             "Z": -104.631165
           },
           "TerritoryId": 961,
-          "InteractionType": "ManualAction",
+          "InteractionType": "Say",
           "ChatMessage": "I have a favor to ask"
         }
       ]
             "Z": -104.631165
           },
           "TerritoryId": 961,
-          "InteractionType": "ManualAction",
+          "InteractionType": "Say",
           "ChatMessage": "Please, Emet-Selch"
         }
       ]
       "Sequence": 6,
       "Steps": [
         {
-          "Position": {
-            "X": -64.09766,
-            "Y": -15.335736,
-            "Z": -84.71621
-          },
           "TerritoryId": 961,
           "InteractionType": "Emote",
-          "Emote": "wave"
+          "Emote": "wave",
+          "Comment": "Need to jump manually"
         }
       ]
     },
             "Z": 88.91431
           },
           "TerritoryId": 961,
-          "InteractionType": "Interact"
+          "InteractionType": "Interact",
+          "AetheryteShortcut": "Elpis - Anagnorisis"
         }
       ]
     }
index 86783bc8cca2e86690b8146e08f83cabf4547a1f..4262112ac87d2c7e8945615a64d95a7170aa4a0a 100644 (file)
@@ -12,6 +12,7 @@
             "Y": 10.385857,
             "Z": 89.34155
           },
+          "StopDistance": 5,
           "TerritoryId": 961,
           "InteractionType": "Interact"
         }
     {
       "Sequence": 1,
       "Steps": [
+        {
+          "Position": {
+            "X": -137.80992,
+            "Y": -26.995626,
+            "Z": 543.8281
+          },
+          "TerritoryId": 961,
+          "InteractionType": "WalkTo"
+        },
+        {
+          "Position": {
+            "X": -137.80992,
+            "Y": -26.995626,
+            "Z": 543.8281
+          },
+          "TerritoryId": 961,
+          "InteractionType": "ManualAction",
+          "Comment": "Jump on Ledge"
+        },
         {
           "DataId": 2012023,
           "Position": {
             "Z": 551.5067
           },
           "TerritoryId": 961,
-          "InteractionType": "AttuneAetherCurrent"
+          "InteractionType": "AttuneAetherCurrent",
+          "AetherCurrentId": 2818377
+        },
+        {
+          "Position": {
+            "X": -139.15512,
+            "Y": -27.030453,
+            "Z": 535.6933
+          },
+          "TerritoryId": 961,
+          "InteractionType": "WalkTo",
+          "DisableNavmesh": true
         },
         {
           "DataId": 1040073,
@@ -53,7 +84,8 @@
             "Z": 490.53174
           },
           "TerritoryId": 961,
-          "InteractionType": "AttuneAetherCurrent"
+          "InteractionType": "AttuneAetherCurrent",
+          "AetherCurrentId": 2818378
         },
         {
           "DataId": 1040080,
             "Y": -22.394821,
             "Z": 527.88574
           },
+          "StopDistance": 5,
           "TerritoryId": 961,
           "InteractionType": "Interact"
         }
index a12e021313b8addba4c79f05eb6d5f53e52e9f11..796271742dba4c2079fd4f4ef60e9f7d8ae8ea08 100644 (file)
@@ -12,6 +12,7 @@
             "Y": -22.39482,
             "Z": 525.47485
           },
+          "StopDistance": 5,
           "TerritoryId": 961,
           "InteractionType": "Interact"
         }
@@ -27,6 +28,7 @@
             "Y": -22.394821,
             "Z": 527.88574
           },
+          "StopDistance": 5,
           "TerritoryId": 961,
           "InteractionType": "Interact"
         }
     {
       "Sequence": 7,
       "Steps": [
+        {
+          "Position": {
+            "X": -734.30804,
+            "Y": -28.391644,
+            "Z": 432.59787
+          },
+          "TerritoryId": 961,
+          "InteractionType": "WalkTo"
+        },
         {
           "DataId": 2012021,
           "Position": {
             "Z": 411.12378
           },
           "TerritoryId": 961,
-          "InteractionType": "AttuneAetherCurrent"
+          "InteractionType": "AttuneAetherCurrent",
+          "AetherCurrentId": 2818375,
+          "DisableNavmesh": true
         },
         {
           "DataId": 2012141,
index ec8a8112d033c19e268385ad2deb06e1dea7b274..6b4040f2dc87ab75fbc3a575425889c8ab0d0153 100644 (file)
@@ -58,6 +58,7 @@
           },
           "TerritoryId": 961,
           "InteractionType": "Combat",
+          "EnemySpawnType": "AutoOnEnterArea",
           "KillEnemyDataIds": [
             14075,
             14074
@@ -90,6 +91,7 @@
             "Y": -22.39482,
             "Z": 504.90576
           },
+          "StopDistance": 5,
           "TerritoryId": 961,
           "InteractionType": "Interact"
         }
index bfed8039dc4dd12e1d9cd6c1aa2267f9962e2f9b..7d19f42f0184c1d97c264f26d05192f6c0c5061c 100644 (file)
@@ -12,6 +12,7 @@
             "Y": -22.39482,
             "Z": 505.08887
           },
+          "StopDistance": 5,
           "TerritoryId": 961,
           "InteractionType": "Interact"
         }
index 45cd7534ef3be335dee72514ab60b028dd49215a..b1030690bdf3613235eada566d7bcd019af62493 100644 (file)
@@ -96,6 +96,7 @@
                     "AttuneAetherCurrent",
                     "Combat",
                     "UseItem",
+                    "Say",
                     "Emote",
                     "WaitForNpcAtPosition",
                     "ManualAction"
                     "deny"
                   ]
                 },
+                "ChatMessage": {
+                  "type": "string",
+                  "description": "The text to use with /say"
+                },
                 "ItemId": {
                   "type": ["number", "null"],
                   "description": "The Item to use",
index daf1ea2f0b03c97a53a64e9e68502c1b9700f828..96bfcef03a2a40b36257a61b5076988220a89702 100644 (file)
@@ -107,6 +107,27 @@ internal sealed class DebugWindow : Window
         var q = _gameFunctions.GetCurrentQuest();
         ImGui.Text($"Current Quest: {q.CurrentQuest} → {q.Sequence}");
 
+        var questManager = QuestManager.Instance();
+        if (questManager != null)
+        {
+            for (int i = 0; i < 1 /*questManager->TrackedQuestsSpan.Length*/; ++i)
+            {
+                var trackedQuest = questManager->TrackedQuestsSpan[i];
+                switch (trackedQuest.QuestType)
+                {
+                    default:
+                        ImGui.Text($"Tracked quest {i}: {trackedQuest.QuestType}, {trackedQuest.Index}");
+                        break;
+
+                    case 1:
+                        ImGui.Text(
+                            $"Tracked quest: {questManager->NormalQuestsSpan[trackedQuest.Index].QuestId}, {trackedQuest.Index}");
+                        break;
+                }
+            }
+        }
+
+
         if (_targetManager.Target != null)
         {
             ImGui.Separator();