From 5375ec25bc1e9c942c4aa5aba89efade9c8141c2 Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Mon, 19 Aug 2024 23:51:48 +0200 Subject: [PATCH] Add Kai-Shirr/Ameliance unlock quests --- .../Custom Deliveries/Kurenai/S3_Kurenai.json | 13 +-- .../Kai-Shirr/3729_Oh, Beehive Yourself.json | 64 ++++++++++++ .../4523_Of Mothers and Merchants.json | 80 +++++++++++++++ .../4318_Leveilleur Philanthropy.json | 98 +++++++++++++++++++ Questionable/Controller/Steps/Shared/Move.cs | 32 ++++-- 5 files changed, 269 insertions(+), 18 deletions(-) create mode 100644 QuestPaths/5.x - Shadowbringers/Custom Deliveries/Kai-Shirr/3729_Oh, Beehive Yourself.json create mode 100644 QuestPaths/6.x - Endwalker/Custom Deliveries/Ameliance/4523_Of Mothers and Merchants.json create mode 100644 QuestPaths/6.x - Endwalker/Side Quests/Old Sharlayan/4318_Leveilleur Philanthropy.json diff --git a/QuestPaths/4.x - Stormblood/Custom Deliveries/Kurenai/S3_Kurenai.json b/QuestPaths/4.x - Stormblood/Custom Deliveries/Kurenai/S3_Kurenai.json index 93d55255..3fef30be 100644 --- a/QuestPaths/4.x - Stormblood/Custom Deliveries/Kurenai/S3_Kurenai.json +++ b/QuestPaths/4.x - Stormblood/Custom Deliveries/Kurenai/S3_Kurenai.json @@ -5,17 +5,6 @@ { "Sequence": 0, "Steps": [ - { - "Position": { - "X": 344.12048, - "Y": -120.3312, - "Z": -303.85397 - }, - "TerritoryId": 613, - "InteractionType": "WalkTo", - "AetheryteShortcut": "Ruby Sea - Tamamizu", - "RequiredGatheredItems": [] - }, { "DataId": 1025878, "Position": { @@ -25,6 +14,8 @@ }, "TerritoryId": 613, "InteractionType": "Interact", + "RequiredGatheredItems": [], + "AetheryteShortcut": "Ruby Sea - Tamamizu", "DialogueChoices": [ { "Type": "List", diff --git a/QuestPaths/5.x - Shadowbringers/Custom Deliveries/Kai-Shirr/3729_Oh, Beehive Yourself.json b/QuestPaths/5.x - Shadowbringers/Custom Deliveries/Kai-Shirr/3729_Oh, Beehive Yourself.json new file mode 100644 index 00000000..683f05b6 --- /dev/null +++ b/QuestPaths/5.x - Shadowbringers/Custom Deliveries/Kai-Shirr/3729_Oh, Beehive Yourself.json @@ -0,0 +1,64 @@ +{ + "$schema": "https://git.carvel.li/liza/Questionable/raw/branch/master/QuestPaths/quest-v1.json", + "Author": "liza", + "QuestSequence": [ + { + "Sequence": 0, + "Steps": [ + { + "DataId": 1031781, + "Position": { + "X": 24.246582, + "Y": 82.78206, + "Z": 25.77246 + }, + "TerritoryId": 820, + "InteractionType": "AcceptQuest", + "AetheryteShortcut": "Eulmore", + "SkipConditions": { + "AetheryteShortcutIf": { + "InSameTerritory": true + } + }, + "DialogueChoices": [ + { + "Type": "List", + "Prompt": "TEXT_SUBCTS640_03729_Q1_000_000", + "Answer": "TEXT_SUBCTS640_03729_A1_000_002" + } + ] + } + ] + }, + { + "Sequence": 1, + "Steps": [ + { + "DataId": 2010842, + "Position": { + "X": 27.450928, + "Y": 82.6886, + "Z": -45.456665 + }, + "TerritoryId": 820, + "InteractionType": "Interact" + } + ] + }, + { + "Sequence": 255, + "Steps": [ + { + "DataId": 1031801, + "Position": { + "X": 52.8114, + "Y": 83.001076, + "Z": -65.38495 + }, + "TerritoryId": 820, + "InteractionType": "CompleteQuest" + } + ] + } + ] +} diff --git a/QuestPaths/6.x - Endwalker/Custom Deliveries/Ameliance/4523_Of Mothers and Merchants.json b/QuestPaths/6.x - Endwalker/Custom Deliveries/Ameliance/4523_Of Mothers and Merchants.json new file mode 100644 index 00000000..71a2c398 --- /dev/null +++ b/QuestPaths/6.x - Endwalker/Custom Deliveries/Ameliance/4523_Of Mothers and Merchants.json @@ -0,0 +1,80 @@ +{ + "$schema": "https://git.carvel.li/liza/Questionable/raw/branch/master/QuestPaths/quest-v1.json", + "Author": "liza", + "QuestSequence": [ + { + "Sequence": 0, + "Steps": [ + { + "DataId": 1042242, + "Position": { + "X": 72.43445, + "Y": 5.1, + "Z": -75.30328 + }, + "TerritoryId": 962, + "InteractionType": "AcceptQuest", + "AetheryteShortcut": "Old Sharlayan", + "SkipConditions": { + "AetheryteShortcutIf": { + "InSameTerritory": true + } + } + } + ] + }, + { + "Sequence": 1, + "Steps": [ + { + "DataId": 2012872, + "Position": { + "X": -86.930725, + "Y": -12.985474, + "Z": 140.30664 + }, + "TerritoryId": 962, + "InteractionType": "Interact", + "AethernetShortcut": [ + "[Old Sharlayan] Aetheryte Plaza", + "[Old Sharlayan] Scholar's Harbor" + ] + } + ] + }, + { + "Sequence": 2, + "Steps": [ + { + "DataId": 1042427, + "Position": { + "X": -84.06195, + "Y": -13.777, + "Z": 140.12354 + }, + "TerritoryId": 962, + "InteractionType": "Interact" + } + ] + }, + { + "Sequence": 255, + "Steps": [ + { + "DataId": 1042428, + "Position": { + "X": 222.85791, + "Y": 24.942732, + "Z": -197.71118 + }, + "TerritoryId": 962, + "InteractionType": "CompleteQuest", + "AethernetShortcut": [ + "[Old Sharlayan] Scholar's Harbor", + "[Old Sharlayan] The Leveilleur Estate" + ] + } + ] + } + ] +} diff --git a/QuestPaths/6.x - Endwalker/Side Quests/Old Sharlayan/4318_Leveilleur Philanthropy.json b/QuestPaths/6.x - Endwalker/Side Quests/Old Sharlayan/4318_Leveilleur Philanthropy.json new file mode 100644 index 00000000..dd925a7b --- /dev/null +++ b/QuestPaths/6.x - Endwalker/Side Quests/Old Sharlayan/4318_Leveilleur Philanthropy.json @@ -0,0 +1,98 @@ +{ + "$schema": "https://git.carvel.li/liza/Questionable/raw/branch/master/QuestPaths/quest-v1.json", + "Author": "liza", + "QuestSequence": [ + { + "Sequence": 0, + "Steps": [ + { + "DataId": 1041303, + "Position": { + "X": 209.55212, + "Y": 19.316555, + "Z": -110.70422 + }, + "TerritoryId": 962, + "InteractionType": "AcceptQuest", + "AetheryteShortcut": "Old Sharlayan", + "AethernetShortcut": [ + "[Old Sharlayan] Aetheryte Plaza", + "[Old Sharlayan] The Leveilleur Estate" + ], + "SkipConditions": { + "AetheryteShortcutIf": { + "InSameTerritory": true + } + }, + "DialogueChoices": [ + { + "Type": "List", + "Prompt": "TEXT_AKTKZI003_04318_Q1_000_000", + "Answer": "TEXT_AKTKZI003_04318_A1_000_001" + } + ] + } + ] + }, + { + "Sequence": 1, + "Steps": [ + { + "DataId": 2012440, + "Position": { + "X": 213.9773, + "Y": 8.224609, + "Z": -33.737732 + }, + "TerritoryId": 962, + "InteractionType": "Interact", + "CompletionQuestVariablesFlags": [ + null, + null, + null, + null, + null, + 128 + ] + }, + { + "DataId": 2012441, + "Position": { + "X": 168.0476, + "Y": 1.296936, + "Z": 53.94055 + }, + "TerritoryId": 962, + "InteractionType": "Interact", + "CompletionQuestVariablesFlags": [ + null, + null, + null, + null, + null, + 64 + ] + } + ] + }, + { + "Sequence": 255, + "Steps": [ + { + "DataId": 1041303, + "Position": { + "X": 209.55212, + "Y": 19.316555, + "Z": -110.70422 + }, + "TerritoryId": 962, + "InteractionType": "CompleteQuest", + "AethernetShortcut": [ + "[Old Sharlayan] Journey's End", + "[Old Sharlayan] The Leveilleur Estate" + ] + } + ] + } + ] +} diff --git a/Questionable/Controller/Steps/Shared/Move.cs b/Questionable/Controller/Steps/Shared/Move.cs index 256badef..3cdd6bec 100644 --- a/Questionable/Controller/Steps/Shared/Move.cs +++ b/Questionable/Controller/Steps/Shared/Move.cs @@ -70,6 +70,7 @@ internal static class Move TerritoryData territoryData, AetheryteData aetheryteData) { + public ElementId QuestId { get; set; } = null!; public QuestStep Step { get; set; } = null!; public Vector3 Destination { get; set; } @@ -90,9 +91,9 @@ internal static class Move yield return new WaitConditionTask(() => movementController.IsNavmeshReady, "Wait(navmesh ready)"); - float distance = Step.CalculateActualStopDistance(); - var position = clientState.LocalPlayer?.Position ?? new Vector3(); - float actualDistance = (position - Destination).Length(); + float stopDistance = Step.CalculateActualStopDistance(); + Vector3? position = clientState.LocalPlayer?.Position; + float actualDistance = position == null ? float.MaxValue : Vector3.Distance(position.Value, Destination); // if we teleport to a different zone, assume we always need to move; this is primarily relevant for cases // where you're e.g. in Lakeland, and the step navigates via Crystarium → Tesselation back into the same @@ -101,8 +102,19 @@ internal static class Move // Side effects of this check being broken include: // - mounting when near the target npc (if you spawn close enough for the next step) // - trying to fly when near the target npc (if close enough where no movement is required) - if (Step.AetheryteShortcut != null && aetheryteData.TerritoryIds[Step.AetheryteShortcut.Value] != Step.TerritoryId) + if (Step.AetheryteShortcut != null && + aetheryteData.TerritoryIds[Step.AetheryteShortcut.Value] != Step.TerritoryId) + { + logger.LogDebug("Aetheryte: Changing distance to max, previous distance: {Distance}", actualDistance); actualDistance = float.MaxValue; + } + + if (QuestId is SatisfactionSupplyNpcId) + { + logger.LogDebug("SatisfactionSupply: Changing distance to max, previous distance: {Distance}", + actualDistance); + actualDistance = float.MaxValue; + } if (Step.Mount == true) yield return serviceProvider.GetRequiredService() @@ -115,7 +127,7 @@ internal static class Move if (Step.Mount == null) { MountTask.EMountIf mountIf = - actualDistance > distance && Step.Fly == true && + actualDistance > stopDistance && Step.Fly == true && gameFunctions.IsFlyingUnlocked(Step.TerritoryId) ? MountTask.EMountIf.Always : MountTask.EMountIf.AwayFromPosition; @@ -123,20 +135,26 @@ internal static class Move .With(Step.TerritoryId, mountIf, Destination); } - if (actualDistance > distance) + if (actualDistance > stopDistance) { yield return serviceProvider.GetRequiredService() .With(Step, Destination); } + else + logger.LogInformation("Skipping move task, distance: {ActualDistance} < {StopDistance}", + actualDistance, stopDistance); } else { // navmesh won't move close enough - if (actualDistance > distance) + if (actualDistance > stopDistance) { yield return serviceProvider.GetRequiredService() .With(Step, Destination); } + else + logger.LogInformation("Skipping move task, distance: {ActualDistance} < {StopDistance}", + actualDistance, stopDistance); } if (Step.Fly == true && Step.Land == true)