From 6eddca69312787e3aa60e5bccde8575488163abb Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Sun, 25 Aug 2024 19:23:15 +0200 Subject: [PATCH] Pick up DT aether current quests (first four zones) during the MSQ --- .../SkipConditionsExtensions.cs | 4 ++ ...All Good Potpacts Must Come to an End.json | 3 +- .../Shaaloani/5138_Rroneek Seeker.json | 9 +++ .../5140_When the Bill Comes Due.json | 24 +++++++- .../5094_Secrets in the Cinderfield.json | 11 ++++ .../4868_A Well-mannered Shipwright.json | 18 ++++-- .../4870_Knowing the Hanuhanu.json | 24 +++++++- .../4872_Traders of Happiness.json | 10 ++-- .../4877_Knowing the Pelupelu.json | 24 ++++++++ .../4878_The Success of Others.json | 2 +- .../4879_For All Turali.json | 1 + .../4884_The Shape of Peace.json | 22 +++++++ .../4889_History's Keepers.json | 7 ++- .../4896_The Promise of Peace.json | 24 ++++++++ .../C-Yak T'el/4903_Into the Traverse.json | 55 ++++++++++-------- .../4909_Road to the Golden City.json | 22 +++++++ .../4919_And the Land Would Tremble.json | 57 +++++++++++++++++++ .../4923_In Yyasulani's Shadow.json | 11 ++++ QuestPaths/quest-v1.json | 16 +++++- .../Converter/ElementIdListConverter.cs | 36 ++++++++++++ .../Questing/SkipAetheryteCondition.cs | 9 +++ .../Questing/SkipStepConditions.cs | 7 +++ .../Steps/Shared/AethernetShortcut.cs | 20 ++++++- .../Steps/Shared/AetheryteShortcut.cs | 15 +++++ 24 files changed, 387 insertions(+), 44 deletions(-) create mode 100644 Questionable.Model/Questing/Converter/ElementIdListConverter.cs diff --git a/QuestPathGenerator/RoslynElements/SkipConditionsExtensions.cs b/QuestPathGenerator/RoslynElements/SkipConditionsExtensions.cs index 87d5e0a26..6307020f3 100644 --- a/QuestPathGenerator/RoslynElements/SkipConditionsExtensions.cs +++ b/QuestPathGenerator/RoslynElements/SkipConditionsExtensions.cs @@ -128,6 +128,10 @@ internal static class SkipConditionsExtensions skipAetheryteCondition.InSameTerritory, emptyAetheryte.InSameTerritory), AssignmentList(nameof(SkipAetheryteCondition.InTerritory), skipAetheryteCondition.InTerritory), + AssignmentList(nameof(SkipAetheryteCondition.QuestsAccepted), + skipAetheryteCondition.QuestsAccepted), + AssignmentList(nameof(skipAetheryteCondition.QuestsCompleted), + skipAetheryteCondition.QuestsCompleted), Assignment(nameof(SkipAetheryteCondition.AetheryteLocked), skipAetheryteCondition.AetheryteLocked, emptyAetheryte.AetheryteLocked) .AsSyntaxNodeOrToken(), diff --git a/QuestPaths/7.x - Dawntrail/Aether Currents/Kozama'uka/5085_All Good Potpacts Must Come to an End.json b/QuestPaths/7.x - Dawntrail/Aether Currents/Kozama'uka/5085_All Good Potpacts Must Come to an End.json index dfb621258..8e4b42da9 100644 --- a/QuestPaths/7.x - Dawntrail/Aether Currents/Kozama'uka/5085_All Good Potpacts Must Come to an End.json +++ b/QuestPaths/7.x - Dawntrail/Aether Currents/Kozama'uka/5085_All Good Potpacts Must Come to an End.json @@ -102,7 +102,8 @@ "Z": 342.85498 }, "TerritoryId": 1188, - "InteractionType": "CompleteQuest" + "InteractionType": "CompleteQuest", + "Mount": true } ] } diff --git a/QuestPaths/7.x - Dawntrail/Aether Currents/Shaaloani/5138_Rroneek Seeker.json b/QuestPaths/7.x - Dawntrail/Aether Currents/Shaaloani/5138_Rroneek Seeker.json index 9db9564ad..92d92c8f7 100644 --- a/QuestPaths/7.x - Dawntrail/Aether Currents/Shaaloani/5138_Rroneek Seeker.json +++ b/QuestPaths/7.x - Dawntrail/Aether Currents/Shaaloani/5138_Rroneek Seeker.json @@ -20,6 +20,15 @@ { "Sequence": 1, "Steps": [ + { + "Position": { + "X": 323.5058, + "Y": -16.330368, + "Z": -254.18399 + }, + "TerritoryId": 1190, + "InteractionType": "WalkTo" + }, { "DataId": 1050656, "Position": { diff --git a/QuestPaths/7.x - Dawntrail/Aether Currents/Shaaloani/5140_When the Bill Comes Due.json b/QuestPaths/7.x - Dawntrail/Aether Currents/Shaaloani/5140_When the Bill Comes Due.json index 49204d8c3..912043e18 100644 --- a/QuestPaths/7.x - Dawntrail/Aether Currents/Shaaloani/5140_When the Bill Comes Due.json +++ b/QuestPaths/7.x - Dawntrail/Aether Currents/Shaaloani/5140_When the Bill Comes Due.json @@ -28,7 +28,8 @@ "Z": 427.2068 }, "TerritoryId": 1190, - "InteractionType": "Interact" + "InteractionType": "Interact", + "Mount": true } ] }, @@ -50,6 +51,27 @@ { "Sequence": 3, "Steps": [ + { + "Position": { + "X": 369.3906, + "Y": 5.9371996, + "Z": 417.16574 + }, + "TerritoryId": 1190, + "InteractionType": "WalkTo", + "$": "Shaaloani Hhusatahwi Saloon Stairs (top)" + }, + { + "Position": { + "X": 359.11545, + "Y": 1.9823306, + "Z": 419.5714 + }, + "TerritoryId": 1190, + "InteractionType": "WalkTo", + "$": "Shaaloani Hhusatahwi Saloon Stairs (bottom)", + "DisableNavmesh": true + }, { "DataId": 1051286, "Position": { diff --git a/QuestPaths/7.x - Dawntrail/Aether Currents/Yak T'el/5094_Secrets in the Cinderfield.json b/QuestPaths/7.x - Dawntrail/Aether Currents/Yak T'el/5094_Secrets in the Cinderfield.json index 4357cd5de..a3e6ab874 100644 --- a/QuestPaths/7.x - Dawntrail/Aether Currents/Yak T'el/5094_Secrets in the Cinderfield.json +++ b/QuestPaths/7.x - Dawntrail/Aether Currents/Yak T'el/5094_Secrets in the Cinderfield.json @@ -174,6 +174,17 @@ { "Sequence": 255, "Steps": [ + { + "DataId": 2013948, + "Position": { + "X": 610.7728, + "Y": 9.597839, + "Z": 233.05103 + }, + "TerritoryId": 1189, + "InteractionType": "AttuneAetherCurrent", + "AetherCurrentId": 2818440 + }, { "DataId": 1051073, "Position": { diff --git a/QuestPaths/7.x - Dawntrail/MSQ/A-Kozama'uka1-Urqopacha1/4868_A Well-mannered Shipwright.json b/QuestPaths/7.x - Dawntrail/MSQ/A-Kozama'uka1-Urqopacha1/4868_A Well-mannered Shipwright.json index 4a550c01f..28bd626b1 100644 --- a/QuestPaths/7.x - Dawntrail/MSQ/A-Kozama'uka1-Urqopacha1/4868_A Well-mannered Shipwright.json +++ b/QuestPaths/7.x - Dawntrail/MSQ/A-Kozama'uka1-Urqopacha1/4868_A Well-mannered Shipwright.json @@ -151,13 +151,21 @@ "Steps": [ { "Position": { - "X": -510.96463, - "Y": -0.47684515, - "Z": -305.96155 + "X": -510.37933, + "Y": -0.39999998, + "Z": -277.78192 }, "TerritoryId": 1188, - "InteractionType": "WalkTo", - "Comment": "Waypoint after swimming through the river" + "InteractionType": "WalkTo" + }, + { + "Position": { + "X": -521.0261, + "Y": -0.40000004, + "Z": -329.19336 + }, + "TerritoryId": 1188, + "InteractionType": "WalkTo" }, { "DataId": 2013936, diff --git a/QuestPaths/7.x - Dawntrail/MSQ/A-Kozama'uka1-Urqopacha1/4870_Knowing the Hanuhanu.json b/QuestPaths/7.x - Dawntrail/MSQ/A-Kozama'uka1-Urqopacha1/4870_Knowing the Hanuhanu.json index 83eb0953a..d54e499a1 100644 --- a/QuestPaths/7.x - Dawntrail/MSQ/A-Kozama'uka1-Urqopacha1/4870_Knowing the Hanuhanu.json +++ b/QuestPaths/7.x - Dawntrail/MSQ/A-Kozama'uka1-Urqopacha1/4870_Knowing the Hanuhanu.json @@ -12,7 +12,7 @@ "Y": 9.773315, "Z": -533.135 }, - "StopDistance": 5, + "StopDistance": 7, "TerritoryId": 1188, "InteractionType": "AcceptQuest" } @@ -135,6 +135,28 @@ { "Sequence": 255, "Steps": [ + { + "DataId": 1048782, + "Position": { + "X": -68.52832, + "Y": 6.536739, + "Z": -486.53394 + }, + "TerritoryId": 1188, + "InteractionType": "AcceptQuest", + "PickUpQuestId": 5064 + }, + { + "DataId": 1051237, + "Position": { + "X": -251.20929, + "Y": 5.5572896, + "Z": -554.89435 + }, + "TerritoryId": 1188, + "InteractionType": "AcceptQuest", + "PickUpQuestId": 5081 + }, { "DataId": 1046537, "Position": { diff --git a/QuestPaths/7.x - Dawntrail/MSQ/A-Kozama'uka1-Urqopacha1/4872_Traders of Happiness.json b/QuestPaths/7.x - Dawntrail/MSQ/A-Kozama'uka1-Urqopacha1/4872_Traders of Happiness.json index 7ce2e342a..d1e8367e5 100644 --- a/QuestPaths/7.x - Dawntrail/MSQ/A-Kozama'uka1-Urqopacha1/4872_Traders of Happiness.json +++ b/QuestPaths/7.x - Dawntrail/MSQ/A-Kozama'uka1-Urqopacha1/4872_Traders of Happiness.json @@ -21,6 +21,11 @@ { "Sequence": 1, "Steps": [ + { + "TerritoryId": 1187, + "InteractionType": "AttuneAetheryte", + "Aetheryte": "Urqopacha - Wachunpelo" + }, { "DataId": 1046557, "Position": { @@ -39,11 +44,6 @@ 128 ] }, - { - "TerritoryId": 1187, - "InteractionType": "AttuneAetheryte", - "Aetheryte": "Urqopacha - Wachunpelo" - }, { "DataId": 1046559, "Position": { diff --git a/QuestPaths/7.x - Dawntrail/MSQ/A-Kozama'uka1-Urqopacha1/4877_Knowing the Pelupelu.json b/QuestPaths/7.x - Dawntrail/MSQ/A-Kozama'uka1-Urqopacha1/4877_Knowing the Pelupelu.json index 7166e4a68..879ca7506 100644 --- a/QuestPaths/7.x - Dawntrail/MSQ/A-Kozama'uka1-Urqopacha1/4877_Knowing the Pelupelu.json +++ b/QuestPaths/7.x - Dawntrail/MSQ/A-Kozama'uka1-Urqopacha1/4877_Knowing the Pelupelu.json @@ -52,6 +52,30 @@ { "Sequence": 255, "Steps": [ + { + "DataId": 1050684, + "Position": { + "X": 391.37854, + "Y": -156.07434, + "Z": -388.50995 + }, + "TerritoryId": 1187, + "InteractionType": "AcceptQuest", + "PickUpQuestId": 5039, + "Comment": "Traveler to the Rescue" + }, + { + "DataId": 1051195, + "Position": { + "X": 383.29138, + "Y": -154.50243, + "Z": -420.49292 + }, + "TerritoryId": 1187, + "InteractionType": "AcceptQuest", + "PickUpQuestId": 5051, + "Comment": "Crisis of Corruption" + }, { "DataId": 1046537, "Position": { diff --git a/QuestPaths/7.x - Dawntrail/MSQ/A-Kozama'uka1-Urqopacha1/4878_The Success of Others.json b/QuestPaths/7.x - Dawntrail/MSQ/A-Kozama'uka1-Urqopacha1/4878_The Success of Others.json index 3d40ae970..b6f50a5ce 100644 --- a/QuestPaths/7.x - Dawntrail/MSQ/A-Kozama'uka1-Urqopacha1/4878_The Success of Others.json +++ b/QuestPaths/7.x - Dawntrail/MSQ/A-Kozama'uka1-Urqopacha1/4878_The Success of Others.json @@ -100,7 +100,7 @@ "Y": -19.725424, "Z": 203.72314 }, - "StopDistance": 5, + "StopDistance": 7, "TerritoryId": 1185, "InteractionType": "CompleteQuest" } diff --git a/QuestPaths/7.x - Dawntrail/MSQ/A-Kozama'uka1-Urqopacha1/4879_For All Turali.json b/QuestPaths/7.x - Dawntrail/MSQ/A-Kozama'uka1-Urqopacha1/4879_For All Turali.json index 7c8031809..9a9839434 100644 --- a/QuestPaths/7.x - Dawntrail/MSQ/A-Kozama'uka1-Urqopacha1/4879_For All Turali.json +++ b/QuestPaths/7.x - Dawntrail/MSQ/A-Kozama'uka1-Urqopacha1/4879_For All Turali.json @@ -15,6 +15,7 @@ "Y": -19.725424, "Z": 203.72314 }, + "StopDistance": 7, "TerritoryId": 1185, "InteractionType": "AcceptQuest" } diff --git a/QuestPaths/7.x - Dawntrail/MSQ/B-Kozama'uka2-Urqopacha2/4884_The Shape of Peace.json b/QuestPaths/7.x - Dawntrail/MSQ/B-Kozama'uka2-Urqopacha2/4884_The Shape of Peace.json index e5d6be1ec..32e96d548 100644 --- a/QuestPaths/7.x - Dawntrail/MSQ/B-Kozama'uka2-Urqopacha2/4884_The Shape of Peace.json +++ b/QuestPaths/7.x - Dawntrail/MSQ/B-Kozama'uka2-Urqopacha2/4884_The Shape of Peace.json @@ -63,6 +63,28 @@ { "Sequence": 3, "Steps": [ + { + "DataId": 1051263, + "Position": { + "X": -521.0193, + "Y": 121.63345, + "Z": 319.38647 + }, + "TerritoryId": 1188, + "InteractionType": "AcceptQuest", + "PickUpQuestId": 5085 + }, + { + "DataId": 1048855, + "Position": { + "X": -491.63043, + "Y": 121.63846, + "Z": 271.50366 + }, + "TerritoryId": 1188, + "InteractionType": "AcceptQuest", + "PickUpQuestId": 5074 + }, { "DataId": 1046876, "Position": { diff --git a/QuestPaths/7.x - Dawntrail/MSQ/B-Kozama'uka2-Urqopacha2/4889_History's Keepers.json b/QuestPaths/7.x - Dawntrail/MSQ/B-Kozama'uka2-Urqopacha2/4889_History's Keepers.json index eb22764c8..60df90002 100644 --- a/QuestPaths/7.x - Dawntrail/MSQ/B-Kozama'uka2-Urqopacha2/4889_History's Keepers.json +++ b/QuestPaths/7.x - Dawntrail/MSQ/B-Kozama'uka2-Urqopacha2/4889_History's Keepers.json @@ -12,6 +12,7 @@ "Y": 119.49004, "Z": 190.72253 }, + "StopDistance": 5, "TerritoryId": 1188, "InteractionType": "AcceptQuest" } @@ -29,7 +30,8 @@ }, "TerritoryId": 1188, "InteractionType": "Interact", - "AetheryteShortcut": "Kozama'uka - Earthenshire" + "AetheryteShortcut": "Kozama'uka - Earthenshire", + "Fly": true } ] }, @@ -44,7 +46,8 @@ }, "TerritoryId": 1188, "InteractionType": "WalkTo", - "TargetTerritoryId": 1187 + "TargetTerritoryId": 1187, + "Fly": true }, { "DataId": 1046814, diff --git a/QuestPaths/7.x - Dawntrail/MSQ/B-Kozama'uka2-Urqopacha2/4896_The Promise of Peace.json b/QuestPaths/7.x - Dawntrail/MSQ/B-Kozama'uka2-Urqopacha2/4896_The Promise of Peace.json index 300238e9a..03eed811c 100644 --- a/QuestPaths/7.x - Dawntrail/MSQ/B-Kozama'uka2-Urqopacha2/4896_The Promise of Peace.json +++ b/QuestPaths/7.x - Dawntrail/MSQ/B-Kozama'uka2-Urqopacha2/4896_The Promise of Peace.json @@ -21,6 +21,30 @@ { "Sequence": 1, "Steps": [ + { + "DataId": 1051207, + "Position": { + "X": 425.07043, + "Y": 118.935005, + "Z": 606.13403 + }, + "StopDistance": 5, + "TerritoryId": 1187, + "InteractionType": "AcceptQuest", + "PickUpQuestId": 5055 + }, + { + "DataId": 1048730, + "Position": { + "X": 399.0692, + "Y": 122.53533, + "Z": 542.9922 + }, + "StopDistance": 5, + "TerritoryId": 1187, + "InteractionType": "AcceptQuest", + "PickUpQuestId": 5047 + }, { "DataId": 1046926, "Position": { diff --git a/QuestPaths/7.x - Dawntrail/MSQ/C-Yak T'el/4903_Into the Traverse.json b/QuestPaths/7.x - Dawntrail/MSQ/C-Yak T'el/4903_Into the Traverse.json index 52a6b9a8a..f6cca46ee 100644 --- a/QuestPaths/7.x - Dawntrail/MSQ/C-Yak T'el/4903_Into the Traverse.json +++ b/QuestPaths/7.x - Dawntrail/MSQ/C-Yak T'el/4903_Into the Traverse.json @@ -21,6 +21,36 @@ { "Sequence": 1, "Steps": [ + { + "DataId": 1050872, + "Position": { + "X": -408.71295, + "Y": 20.420113, + "Z": -398.8861 + }, + "TerritoryId": 1189, + "InteractionType": "AcceptQuest", + "DialogueChoices": [ + { + "Type": "List", + "ExcelSheet": "quest/051/KinGzd201_05110", + "Prompt": "TEXT_KINGZD201_05110_Q1_000_000", + "Answer": "TEXT_KINGZD201_05110_A1_000_001" + } + ], + "PickUpQuestId": 5110 + }, + { + "DataId": 1051073, + "Position": { + "X": 41.09253, + "Y": 8.205902, + "Z": -629.8467 + }, + "TerritoryId": 1189, + "InteractionType": "AcceptQuest", + "PickUpQuestId": 5094 + }, { "DataId": 1047577, "Position": { @@ -36,28 +66,6 @@ { "Sequence": 2, "Steps": [ - { - "DataId": 2013948, - "Position": { - "X": 610.7728, - "Y": 9.597839, - "Z": 233.05103 - }, - "TerritoryId": 1189, - "InteractionType": "AttuneAetherCurrent", - "AetherCurrentId": 2818440 - }, - { - "Position": { - "X": 614.25964, - "Y": -29.554798, - "Z": 202.75368 - }, - "TerritoryId": 1189, - "InteractionType": "WalkTo", - "DisableNavmesh": true, - "Mount": false - }, { "DataId": 1048230, "Position": { @@ -66,8 +74,7 @@ "Z": 214.83167 }, "TerritoryId": 1189, - "InteractionType": "Interact", - "DisableNavmesh": true + "InteractionType": "Interact" } ] }, diff --git a/QuestPaths/7.x - Dawntrail/MSQ/C-Yak T'el/4909_Road to the Golden City.json b/QuestPaths/7.x - Dawntrail/MSQ/C-Yak T'el/4909_Road to the Golden City.json index c959a428f..39387ac54 100644 --- a/QuestPaths/7.x - Dawntrail/MSQ/C-Yak T'el/4909_Road to the Golden City.json +++ b/QuestPaths/7.x - Dawntrail/MSQ/C-Yak T'el/4909_Road to the Golden City.json @@ -24,6 +24,28 @@ { "Sequence": 1, "Steps": [ + { + "DataId": 1051052, + "Position": { + "X": 585.90063, + "Y": -142.49187, + "Z": 510.21594 + }, + "TerritoryId": 1189, + "InteractionType": "AcceptQuest", + "PickUpQuestId": 5103 + }, + { + "DataId": 1050884, + "Position": { + "X": 531.0597, + "Y": -142.49185, + "Z": 492.0271 + }, + "TerritoryId": 1189, + "InteractionType": "AcceptQuest", + "PickUpQuestId": 5114 + }, { "DataId": 1047701, "Position": { diff --git a/QuestPaths/7.x - Dawntrail/MSQ/D-Shaaloani-HeritageFound1/4919_And the Land Would Tremble.json b/QuestPaths/7.x - Dawntrail/MSQ/D-Shaaloani-HeritageFound1/4919_And the Land Would Tremble.json index 16c8605fd..30d005a18 100644 --- a/QuestPaths/7.x - Dawntrail/MSQ/D-Shaaloani-HeritageFound1/4919_And the Land Would Tremble.json +++ b/QuestPaths/7.x - Dawntrail/MSQ/D-Shaaloani-HeritageFound1/4919_And the Land Would Tremble.json @@ -52,6 +52,62 @@ { "Sequence": 3, "Steps": [ + { + "DataId": 1050655, + "Position": { + "X": 289.02112, + "Y": -15.566031, + "Z": -478.78235 + }, + "TerritoryId": 1190, + "InteractionType": "AcceptQuest", + "PickUpQuestId": 5138 + }, + { + "Position": { + "X": 386.84927, + "Y": -0.84392637, + "Z": 435.0579 + }, + "TerritoryId": 1190, + "InteractionType": "WalkTo", + "AetheryteShortcut": "Shaaloani - Hhusatahwi", + "SkipConditions": { + "StepIf": { + "QuestsCompleted": [ + 5140 + ] + }, + "AetheryteShortcutIf": { + "QuestsCompleted": [ + 5140 + ] + } + } + }, + { + "DataId": 1051283, + "Position": { + "X": 374.19702, + "Y": -0.24794838, + "Z": 437.2472 + }, + "StopDistance": 6, + "TerritoryId": 1190, + "InteractionType": "AcceptQuest", + "PickUpQuestId": 5140 + }, + { + "DataId": 1049324, + "Position": { + "X": -108.659546, + "Y": 4.055336, + "Z": 319.5697 + }, + "TerritoryId": 1190, + "InteractionType": "AcceptQuest", + "PickUpQuestId": 5130 + }, { "DataId": 1047001, "Position": { @@ -61,6 +117,7 @@ }, "TerritoryId": 1190, "InteractionType": "Interact", + "AetheryteShortcut": "Shaaloani - Sheshenewezi Springs", "DialogueChoices": [ { "Type": "YesNo", diff --git a/QuestPaths/7.x - Dawntrail/MSQ/D-Shaaloani-HeritageFound1/4923_In Yyasulani's Shadow.json b/QuestPaths/7.x - Dawntrail/MSQ/D-Shaaloani-HeritageFound1/4923_In Yyasulani's Shadow.json index edaedfc93..1bf3b8397 100644 --- a/QuestPaths/7.x - Dawntrail/MSQ/D-Shaaloani-HeritageFound1/4923_In Yyasulani's Shadow.json +++ b/QuestPaths/7.x - Dawntrail/MSQ/D-Shaaloani-HeritageFound1/4923_In Yyasulani's Shadow.json @@ -161,6 +161,17 @@ { "Sequence": 7, "Steps": [ + { + "DataId": 1051316, + "Position": { + "X": -380.30066, + "Y": 18.718708, + "Z": -114.24432 + }, + "TerritoryId": 1190, + "InteractionType": "AcceptQuest", + "PickUpQuestId": 5144 + }, { "DataId": 1047082, "Position": { diff --git a/QuestPaths/quest-v1.json b/QuestPaths/quest-v1.json index ff535a8ff..93efd3c02 100644 --- a/QuestPaths/quest-v1.json +++ b/QuestPaths/quest-v1.json @@ -234,13 +234,13 @@ "QuestsAccepted": { "type": "array", "items": { - "type": "number" + "type": ["number", "string"] } }, "QuestsCompleted": { "type": "array", "items": { - "type": "number" + "type": ["number", "string"] } }, "AetheryteLocked": { @@ -290,6 +290,18 @@ "type": "integer" } }, + "QuestsAccepted": { + "type": "array", + "items": { + "type": ["number", "string"] + } + }, + "QuestsCompleted": { + "type": "array", + "items": { + "type": ["number", "string"] + } + }, "AetheryteLocked": { "$ref": "https://git.carvel.li/liza/Questionable/raw/branch/master/Questionable.Model/common-schema.json#/$defs/Aetheryte" }, diff --git a/Questionable.Model/Questing/Converter/ElementIdListConverter.cs b/Questionable.Model/Questing/Converter/ElementIdListConverter.cs new file mode 100644 index 000000000..25dd688db --- /dev/null +++ b/Questionable.Model/Questing/Converter/ElementIdListConverter.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Questionable.Model.Questing.Converter; + +public sealed class ElementIdListConverter : JsonConverter> +{ + public override List Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + reader.Read(); + + List values = []; + while (reader.TokenType != JsonTokenType.EndArray) + { + + if (reader.TokenType == JsonTokenType.Number) + values.Add(new QuestId(reader.GetUInt16())); + else + values.Add(ElementId.FromString(reader.GetString() ?? throw new JsonException())); + + reader.Read(); + } + + return values; + } + + public override void Write(Utf8JsonWriter writer, List value, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } +} diff --git a/Questionable.Model/Questing/SkipAetheryteCondition.cs b/Questionable.Model/Questing/SkipAetheryteCondition.cs index 573c3e2ec..70e134747 100644 --- a/Questionable.Model/Questing/SkipAetheryteCondition.cs +++ b/Questionable.Model/Questing/SkipAetheryteCondition.cs @@ -1,5 +1,7 @@ using System.Collections.Generic; +using System.Text.Json.Serialization; using Questionable.Model.Common; +using Questionable.Model.Questing.Converter; namespace Questionable.Model.Questing; @@ -8,6 +10,13 @@ public sealed class SkipAetheryteCondition public bool Never { get; set; } public bool InSameTerritory { get; set; } public List InTerritory { get; set; } = new(); + + [JsonConverter(typeof(ElementIdListConverter))] + public List QuestsAccepted { get; set; } = new(); + + [JsonConverter(typeof(ElementIdListConverter))] + public List QuestsCompleted { get; set; } = new(); + public EAetheryteLocation? AetheryteLocked { get; set; } public EAetheryteLocation? AetheryteUnlocked { get; set; } public bool RequiredQuestVariablesNotMet { get; set; } diff --git a/Questionable.Model/Questing/SkipStepConditions.cs b/Questionable.Model/Questing/SkipStepConditions.cs index 323a0dc07..bfb8fcfc7 100644 --- a/Questionable.Model/Questing/SkipStepConditions.cs +++ b/Questionable.Model/Questing/SkipStepConditions.cs @@ -1,6 +1,8 @@ using System.Collections.Generic; using System.Linq; +using System.Text.Json.Serialization; using Questionable.Model.Common; +using Questionable.Model.Questing.Converter; namespace Questionable.Model.Questing; @@ -14,8 +16,13 @@ public sealed class SkipStepConditions public List InTerritory { get; set; } = new(); public List NotInTerritory { get; set; } = new(); public SkipItemConditions? Item { get; set; } + + [JsonConverter(typeof(ElementIdListConverter))] public List QuestsAccepted { get; set; } = new(); + + [JsonConverter(typeof(ElementIdListConverter))] public List QuestsCompleted { get; set; } = new(); + public EAetheryteLocation? AetheryteLocked { get; set; } public EAetheryteLocation? AetheryteUnlocked { get; set; } public NearPositionCondition? NearPosition { get; set; } diff --git a/Questionable/Controller/Steps/Shared/AethernetShortcut.cs b/Questionable/Controller/Steps/Shared/AethernetShortcut.cs index 9297297e7..29c76f0c5 100644 --- a/Questionable/Controller/Steps/Shared/AethernetShortcut.cs +++ b/Questionable/Controller/Steps/Shared/AethernetShortcut.cs @@ -24,6 +24,7 @@ internal static class AethernetShortcut MovementController movementController, AetheryteFunctions aetheryteFunctions, GameFunctions gameFunctions, + QuestFunctions questFunctions, IClientState clientState, AetheryteData aetheryteData, TerritoryData territoryData, @@ -46,8 +47,8 @@ internal static class AethernetShortcut public ITask Use(EAetheryteLocation from, EAetheryteLocation to, SkipAetheryteCondition? skipConditions = null) { return new UseAethernetShortcut(from, to, skipConditions ?? new(), - loggerFactory.CreateLogger(), aetheryteFunctions, gameFunctions, clientState, - aetheryteData, territoryData, lifestreamIpc, movementController, condition); + loggerFactory.CreateLogger(), aetheryteFunctions, gameFunctions, questFunctions, + clientState, aetheryteData, territoryData, lifestreamIpc, movementController, condition); } } @@ -58,6 +59,7 @@ internal static class AethernetShortcut ILogger logger, AetheryteFunctions aetheryteFunctions, GameFunctions gameFunctions, + QuestFunctions questFunctions, IClientState clientState, AetheryteData aetheryteData, TerritoryData territoryData, @@ -90,6 +92,20 @@ internal static class AethernetShortcut return false; } + if (skipConditions.QuestsCompleted.Count > 0 && + skipConditions.QuestsCompleted.All(questFunctions.IsQuestComplete)) + { + logger.LogInformation("Skipping aethernet shortcut, all prequisite quests are complete"); + return true; + } + + if (skipConditions.QuestsAccepted.Count > 0 && + skipConditions.QuestsAccepted.All(questFunctions.IsQuestAccepted)) + { + logger.LogInformation("Skipping aethernet shortcut, all prequisite quests are accepted"); + return true; + } + if (skipConditions.AetheryteLocked != null && !aetheryteFunctions.IsAetheryteUnlocked(skipConditions.AetheryteLocked.Value)) { diff --git a/Questionable/Controller/Steps/Shared/AetheryteShortcut.cs b/Questionable/Controller/Steps/Shared/AetheryteShortcut.cs index 2d72afd1a..0b12bb3fc 100644 --- a/Questionable/Controller/Steps/Shared/AetheryteShortcut.cs +++ b/Questionable/Controller/Steps/Shared/AetheryteShortcut.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Numerics; using Dalamud.Plugin.Services; using FFXIVClientStructs.FFXIV.Application.Network.WorkDefinitions; @@ -93,6 +94,20 @@ internal static class AetheryteShortcut return true; } + if (skipConditions.QuestsCompleted.Count > 0 && + skipConditions.QuestsCompleted.All(questFunctions.IsQuestComplete)) + { + logger.LogInformation("Skipping aetheryte, all prequisite quests are complete"); + return true; + } + + if (skipConditions.QuestsAccepted.Count > 0 && + skipConditions.QuestsAccepted.All(questFunctions.IsQuestAccepted)) + { + logger.LogInformation("Skipping aetheryte, all prequisite quests are accepted"); + return true; + } + if (skipConditions.AetheryteLocked != null && !aetheryteFunctions.IsAetheryteUnlocked(skipConditions.AetheryteLocked.Value)) {