From eb69c24ef488950e268204d4fe46ad65aff85f45 Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Fri, 19 Jul 2024 16:31:38 +0200 Subject: [PATCH] Minor cleanup for ARR part 2 --- QuestPathGenerator/QuestSourceGenerator.cs | 4 +- .../MSQ-2/3856_We Come in Peace.json | 20 +-- .../MSQ-2/3857_Dance Dance Diplomacy.json | 16 +- .../MSQ-2/3858_Forest Friend.json | 62 +++++-- .../MSQ-2/3860_Never Forget.json | 12 +- .../MSQ-2/3861_Microbrewing.json | 23 ++- .../MSQ-2/514_Into the Beast's Maw.json | 5 +- .../MSQ-2/709_Sylphic Studies.json | 31 +++- .../MSQ-2/715_First Contact.json | 20 +-- .../MSQ-2/719_Presence of the Enemy.json | 18 +- .../MSQ-2/738_Sylphish Concerns.json | 157 +++++++++++++++--- .../MSQ-2/743_A Simple Gift.json | 7 +- .../MSQ-2/744_Believe in Your Sylph.json | 3 +- .../MSQ-2/746_Back from the Wood.json | 20 +-- QuestPaths/quest-v1.json | 5 +- .../Converter/StringListOrValueConverter.cs | 43 +++++ Questionable.Model/V1/QuestRoot.cs | 6 +- 17 files changed, 333 insertions(+), 119 deletions(-) create mode 100644 Questionable.Model/V1/Converter/StringListOrValueConverter.cs diff --git a/QuestPathGenerator/QuestSourceGenerator.cs b/QuestPathGenerator/QuestSourceGenerator.cs index 8cdd45623..40d1fafe9 100644 --- a/QuestPathGenerator/QuestSourceGenerator.cs +++ b/QuestPathGenerator/QuestSourceGenerator.cs @@ -222,9 +222,7 @@ public class QuestSourceGenerator : ISourceGenerator SyntaxKind.ObjectInitializerExpression, SeparatedList( SyntaxNodeList( - Assignment(nameof(QuestRoot.Author), quest.Author, null) - .AsSyntaxNodeOrToken(), - AssignmentList(nameof(QuestRoot.Contributors), quest.Contributors) + AssignmentList(nameof(QuestRoot.Author), quest.Author) .AsSyntaxNodeOrToken(), Assignment(nameof(QuestRoot.Comment), quest.Comment, null) .AsSyntaxNodeOrToken(), diff --git a/QuestPaths/2.x - A Realm Reborn/MSQ-2/3856_We Come in Peace.json b/QuestPaths/2.x - A Realm Reborn/MSQ-2/3856_We Come in Peace.json index 580148adc..6cada47e4 100644 --- a/QuestPaths/2.x - A Realm Reborn/MSQ-2/3856_We Come in Peace.json +++ b/QuestPaths/2.x - A Realm Reborn/MSQ-2/3856_We Come in Peace.json @@ -1,6 +1,6 @@ { "$schema": "https://carvel.li/questionable/quest-1.0", - "Author": "liza, JerryWester", + "Author": ["liza", "JerryWester"], "QuestSequence": [ { "Sequence": 0, @@ -58,7 +58,6 @@ "Sequence": 255, "Steps": [ { - "$": "TODO: Questionable doesn't seem to interact with this ferry skipper", "DataId": 1001263, "Position": { "X": 181.41443, @@ -67,20 +66,7 @@ }, "TerritoryId": 133, "InteractionType": "Interact", - "DialogueChoices": [ - { - "Type": "List", - "ExcelSheet": "Warp", - "Prompt": "Null", - "Answer": "131077" - }, - { - "Type": "YesNo", - "ExcelSheet": "Warp", - "Prompt": "Board the ferry to Sweetbloom Pier?", - "Yes": true - } - ] + "TargetTerritoryId": 152 }, { "TerritoryId": 152, @@ -101,4 +87,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/QuestPaths/2.x - A Realm Reborn/MSQ-2/3857_Dance Dance Diplomacy.json b/QuestPaths/2.x - A Realm Reborn/MSQ-2/3857_Dance Dance Diplomacy.json index c3027536c..918865320 100644 --- a/QuestPaths/2.x - A Realm Reborn/MSQ-2/3857_Dance Dance Diplomacy.json +++ b/QuestPaths/2.x - A Realm Reborn/MSQ-2/3857_Dance Dance Diplomacy.json @@ -35,7 +35,7 @@ "InteractionType": "Emote", "Emote": "dance", "CompletionQuestVariablesFlags": [ - 1, + null, null, null, null, @@ -54,7 +54,7 @@ "InteractionType": "Emote", "Emote": "dance", "CompletionQuestVariablesFlags": [ - 1, + null, null, null, null, @@ -71,7 +71,15 @@ }, "TerritoryId": 152, "InteractionType": "Emote", - "Emote": "dance" + "Emote": "dance", + "CompletionQuestVariablesFlags": [ + null, + null, + null, + null, + null, + 32 + ] } ] }, @@ -91,4 +99,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/QuestPaths/2.x - A Realm Reborn/MSQ-2/3858_Forest Friend.json b/QuestPaths/2.x - A Realm Reborn/MSQ-2/3858_Forest Friend.json index b7def57eb..4154bc4bd 100644 --- a/QuestPaths/2.x - A Realm Reborn/MSQ-2/3858_Forest Friend.json +++ b/QuestPaths/2.x - A Realm Reborn/MSQ-2/3858_Forest Friend.json @@ -12,6 +12,7 @@ "Y": -3.7126513, "Z": 209.76575 }, + "StopDistance": 5, "TerritoryId": 152, "InteractionType": "AcceptQuest", "AetheryteShortcut": "East Shroud - Hawthorne Hut", @@ -48,11 +49,22 @@ "TerritoryId": 152, "InteractionType": "Combat", "EnemySpawnType": "OverworldEnemies", - "KillEnemyDataIds": [ - 179 + "ComplexCombatData": [ + { + "DataId": 179, + "CompletionQuestVariablesFlags": [ + 16, + 1, + null, + null, + null, + null + ], + "MinimumKillCount": 1 + } ], "CompletionQuestVariablesFlags": [ - 16, + null, 1, null, null, @@ -71,9 +83,9 @@ "TerritoryId": 152, "InteractionType": "Interact", "CompletionQuestVariablesFlags": [ - 1, null, - 16, + null, + null, null, null, 32 @@ -90,9 +102,9 @@ "TerritoryId": 152, "InteractionType": "Interact", "CompletionQuestVariablesFlags": [ - 1, null, - 16, + null, + null, null, null, 64 @@ -108,6 +120,14 @@ }, "TerritoryId": 152, "InteractionType": "Interact", + "CompletionQuestVariablesFlags": [ + null, + null, + null, + null, + null, + 128 + ], "$": "18 1 32 0 0 96 -> 35 1 48 0 0 224" }, { @@ -119,9 +139,29 @@ "TerritoryId": 152, "InteractionType": "Combat", "EnemySpawnType": "OverworldEnemies", - "KillEnemyDataIds": [ - 7 - ] + "ComplexCombatData": [ + { + "DataId": 7, + "CompletionQuestVariablesFlags": [ + null, + 16, + null, + null, + null, + null + ], + "MinimumKillCount": 1 + } + ], + "CompletionQuestVariablesFlags": [ + null, + 16, + null, + null, + null, + null + ], + "$": "If skipping the previous step: 34 17 32 0 0 96" } ] }, @@ -141,4 +181,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/QuestPaths/2.x - A Realm Reborn/MSQ-2/3860_Never Forget.json b/QuestPaths/2.x - A Realm Reborn/MSQ-2/3860_Never Forget.json index 2d579a30d..cb71a8911 100644 --- a/QuestPaths/2.x - A Realm Reborn/MSQ-2/3860_Never Forget.json +++ b/QuestPaths/2.x - A Realm Reborn/MSQ-2/3860_Never Forget.json @@ -89,15 +89,7 @@ "StopDistance": 7, "TerritoryId": 129, "InteractionType": "Interact", - "TargetTerritoryId": 138, - "DialogueChoices": [ - { - "Type": "List", - "ExcelSheet": "Warp", - "Prompt": null, - "Answer": 131109 - } - ] + "TargetTerritoryId": 138 }, { "DataId": 1003393, @@ -137,4 +129,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/QuestPaths/2.x - A Realm Reborn/MSQ-2/3861_Microbrewing.json b/QuestPaths/2.x - A Realm Reborn/MSQ-2/3861_Microbrewing.json index 4bddedd4d..064bc4a4d 100644 --- a/QuestPaths/2.x - A Realm Reborn/MSQ-2/3861_Microbrewing.json +++ b/QuestPaths/2.x - A Realm Reborn/MSQ-2/3861_Microbrewing.json @@ -20,6 +20,17 @@ { "Sequence": 1, "Steps": [ + { + "Position": { + "X": -422.68066, + "Y": -2.5542965, + "Z": 150.50304 + }, + "TerritoryId": 139, + "InteractionType": "WalkTo", + "DisableNavmesh": true, + "Comment": "Avoids swimming" + }, { "Position": { "X": -585.1562, @@ -43,6 +54,16 @@ { "Sequence": 255, "Steps": [ + { + "Position": { + "X": -422.68066, + "Y": -2.5542965, + "Z": 150.50304 + }, + "TerritoryId": 139, + "InteractionType": "WalkTo", + "Comment": "Avoids swimming" + }, { "DataId": 1006193, "Position": { @@ -56,4 +77,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/QuestPaths/2.x - A Realm Reborn/MSQ-2/514_Into the Beast's Maw.json b/QuestPaths/2.x - A Realm Reborn/MSQ-2/514_Into the Beast's Maw.json index d40967294..7e95e9f9d 100644 --- a/QuestPaths/2.x - A Realm Reborn/MSQ-2/514_Into the Beast's Maw.json +++ b/QuestPaths/2.x - A Realm Reborn/MSQ-2/514_Into the Beast's Maw.json @@ -1,6 +1,9 @@ { "$schema": "https://carvel.li/questionable/quest-1.0", "Author": "JerryWester", + "TerritoryBlacklist": [ + 1039 + ], "QuestSequence": [ { "Sequence": 0, @@ -62,4 +65,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/QuestPaths/2.x - A Realm Reborn/MSQ-2/709_Sylphic Studies.json b/QuestPaths/2.x - A Realm Reborn/MSQ-2/709_Sylphic Studies.json index e3736c9a0..b5811f5e6 100644 --- a/QuestPaths/2.x - A Realm Reborn/MSQ-2/709_Sylphic Studies.json +++ b/QuestPaths/2.x - A Realm Reborn/MSQ-2/709_Sylphic Studies.json @@ -12,6 +12,7 @@ "Y": 3.543561, "Z": 283.71094 }, + "StopDistance": 5, "TerritoryId": 152, "InteractionType": "AcceptQuest", "AetheryteShortcut": "East Shroud - Hawthorne Hut", @@ -32,7 +33,15 @@ "Z": 279.92664 }, "TerritoryId": 152, - "InteractionType": "Interact" + "InteractionType": "Interact", + "CompletionQuestVariablesFlags": [ + null, + null, + null, + null, + null, + 128 + ] }, { "DataId": 1000557, @@ -43,7 +52,14 @@ }, "TerritoryId": 152, "InteractionType": "Interact", - "$": "0 0 0 0 0 0 -> 17 0 0 0 0 128" + "CompletionQuestVariablesFlags": [ + null, + null, + null, + null, + null, + 64 + ] }, { "DataId": 1000553, @@ -54,7 +70,14 @@ }, "TerritoryId": 152, "InteractionType": "Interact", - "$": "17 0 0 0 0 128 -> 33 16 0 0 0 192" + "CompletionQuestVariablesFlags": [ + null, + null, + null, + null, + null, + 32 + ] } ] }, @@ -74,4 +97,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/QuestPaths/2.x - A Realm Reborn/MSQ-2/715_First Contact.json b/QuestPaths/2.x - A Realm Reborn/MSQ-2/715_First Contact.json index d1ef58463..07ec1cbd8 100644 --- a/QuestPaths/2.x - A Realm Reborn/MSQ-2/715_First Contact.json +++ b/QuestPaths/2.x - A Realm Reborn/MSQ-2/715_First Contact.json @@ -17,14 +17,6 @@ "AetheryteShortcut": "East Shroud - Hawthorne Hut", "SkipIf": [ "AetheryteShortcutIfInSameTerritory" - ], - "CompletionQuestVariablesFlags": [ - null, - 16, - null, - null, - null, - null ] } ] @@ -40,15 +32,7 @@ "Z": 283.4973 }, "TerritoryId": 152, - "InteractionType": "Interact", - "CompletionQuestVariablesFlags": [ - null, - 1, - null, - null, - null, - null - ] + "InteractionType": "Interact" } ] }, @@ -99,4 +83,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/QuestPaths/2.x - A Realm Reborn/MSQ-2/719_Presence of the Enemy.json b/QuestPaths/2.x - A Realm Reborn/MSQ-2/719_Presence of the Enemy.json index 0f54aeffe..209eb4048 100644 --- a/QuestPaths/2.x - A Realm Reborn/MSQ-2/719_Presence of the Enemy.json +++ b/QuestPaths/2.x - A Realm Reborn/MSQ-2/719_Presence of the Enemy.json @@ -35,7 +35,7 @@ "InteractionType": "Interact", "$": "0 0 0 0 0 0 -> 1 0 0 0 0 128", "CompletionQuestVariablesFlags": [ - 1, + null, null, null, null, @@ -54,7 +54,7 @@ "InteractionType": "Interact", "$": "1 0 0 0 0 128 -> 2 0 0 0 0 192", "CompletionQuestVariablesFlags": [ - 1, + null, null, null, null, @@ -74,7 +74,7 @@ "AetheryteShortcut": "East Shroud - Hawthorne Hut", "$": "2 0 0 0 0 192 -> 3 0 0 0 0 224", "CompletionQuestVariablesFlags": [ - 1, + null, null, null, null, @@ -90,7 +90,15 @@ "Z": 286.9154 }, "TerritoryId": 152, - "InteractionType": "Interact" + "InteractionType": "Interact", + "CompletionQuestVariablesFlags": [ + null, + null, + null, + null, + null, + 16 + ] } ] }, @@ -165,4 +173,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/QuestPaths/2.x - A Realm Reborn/MSQ-2/738_Sylphish Concerns.json b/QuestPaths/2.x - A Realm Reborn/MSQ-2/738_Sylphish Concerns.json index 9043705ca..0150939eb 100644 --- a/QuestPaths/2.x - A Realm Reborn/MSQ-2/738_Sylphish Concerns.json +++ b/QuestPaths/2.x - A Realm Reborn/MSQ-2/738_Sylphish Concerns.json @@ -32,19 +32,42 @@ "Z": -130.11371 }, "TerritoryId": 153, - "InteractionType": "Combat", - "EnemySpawnType": "AfterInteraction", - "KillEnemyDataIds": [ - 55 - ], + "InteractionType": "Interact", "$": "0 0 0 0 0 0 -> 16 0 16 0 0 128", "CompletionQuestVariablesFlags": [ - 16, null, - 16, + null, + null, null, null, 128 + ], + "Comment": "Enemy loses aggro by the next waypoint" + }, + { + "Position": { + "X": -108.2742, + "Y": 5.6416674, + "Z": -80.21974 + }, + "StopDistance": 0.25, + "TerritoryId": 153, + "InteractionType": "Jump", + "JumpDestination": { + "Position": { + "X": -111.25065, + "Y": 8.312978, + "Z": -82.8167 + }, + "DelaySeconds": 0.25 + }, + "CompletionQuestVariablesFlags": [ + null, + null, + null, + null, + null, + -8 ] }, { @@ -57,15 +80,42 @@ "TerritoryId": 153, "InteractionType": "Interact", "$": "16 0 16 0 0 128 -> 32 1 16 0 0 136", + "DisableNavmesh": true, "CompletionQuestVariablesFlags": [ - 16, - 1, + null, + null, null, null, null, 8 ] }, + { + "Position": { + "X": -90.467575, + "Y": 3.3634722, + "Z": -27.515985 + }, + "StopDistance": 0.25, + "TerritoryId": 153, + "InteractionType": "Jump", + "JumpDestination": { + "Position": { + "X": -84.96217, + "Y": 6.1436205, + "Z": -23.793756 + }, + "DelaySeconds": 0.25 + }, + "CompletionQuestVariablesFlags": [ + null, + null, + null, + null, + null, + -32 + ] + }, { "DataId": 2001951, "Position": { @@ -75,7 +125,50 @@ }, "TerritoryId": 153, "InteractionType": "Interact", - "$": "32 1 16 0 0 136 -> 49 1 16 0 0 168" + "$": "32 1 16 0 0 136 -> 49 1 16 0 0 168", + "CompletionQuestVariablesFlags": [ + null, + null, + null, + null, + null, + 32 + ] + }, + { + "Position": { + "X": -77.875786, + "Y": 3.9296143, + "Z": -27.107864 + }, + "TerritoryId": 153, + "InteractionType": "WalkTo", + "DisableNavmesh": true, + "CompletionQuestVariablesFlags": [ + null, + null, + null, + null, + null, + -16 + ] + }, + { + "Position": { + "X": 15.053005, + "Y": 3.8386261, + "Z": -40.758984 + }, + "TerritoryId": 153, + "InteractionType": "WalkTo", + "CompletionQuestVariablesFlags": [ + null, + null, + null, + null, + null, + -16 + ] }, { "DataId": 2001952, @@ -84,9 +177,18 @@ "Y": 7.614197, "Z": -43.137268 }, + "StopDistance": 6, "TerritoryId": 153, "InteractionType": "Interact", - "$": "49 1 16 0 0 168 -> 65 17 16 0 0 184" + "$": "49 1 16 0 0 168 -> 65 17 16 0 0 184", + "CompletionQuestVariablesFlags": [ + null, + null, + null, + null, + null, + 16 + ] }, { "DataId": 2001950, @@ -96,19 +198,33 @@ "Z": -32.333923 }, "TerritoryId": 153, - "InteractionType": "Combat", - "EnemySpawnType": "AfterInteraction", - "KillEnemyDataIds": [ - 64, - 61 - ], - "$": "65 17 16 0 0 184 -> " + "InteractionType": "Interact", + "$": "65 17 16 0 0 184 -> ", + "CompletionQuestVariablesFlags": [ + null, + null, + null, + null, + null, + 64 + ] } ] }, { "Sequence": 255, "Steps": [ + { + "Position": { + "X": 51.85704, + "Y": 2.712612, + "Z": -42.67677 + }, + "TerritoryId": 153, + "InteractionType": "WalkTo", + "DisableNavmesh": true, + "Mount": false + }, { "DataId": 1000590, "Position": { @@ -117,9 +233,10 @@ "Z": -81.34589 }, "TerritoryId": 153, - "InteractionType": "CompleteQuest" + "InteractionType": "CompleteQuest", + "Mount": false } ] } ] -} \ No newline at end of file +} diff --git a/QuestPaths/2.x - A Realm Reborn/MSQ-2/743_A Simple Gift.json b/QuestPaths/2.x - A Realm Reborn/MSQ-2/743_A Simple Gift.json index bc6e19c63..103d35609 100644 --- a/QuestPaths/2.x - A Realm Reborn/MSQ-2/743_A Simple Gift.json +++ b/QuestPaths/2.x - A Realm Reborn/MSQ-2/743_A Simple Gift.json @@ -24,6 +24,11 @@ { "Sequence": 255, "Steps": [ + { + "TerritoryId": 153, + "InteractionType": "AttuneAetheryte", + "Aetheryte": "South Shroud - Camp Tranquil" + }, { "DataId": 1000576, "Position": { @@ -38,4 +43,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/QuestPaths/2.x - A Realm Reborn/MSQ-2/744_Believe in Your Sylph.json b/QuestPaths/2.x - A Realm Reborn/MSQ-2/744_Believe in Your Sylph.json index 09439a145..d8479af16 100644 --- a/QuestPaths/2.x - A Realm Reborn/MSQ-2/744_Believe in Your Sylph.json +++ b/QuestPaths/2.x - A Realm Reborn/MSQ-2/744_Believe in Your Sylph.json @@ -30,6 +30,7 @@ "Y": 8.673417, "Z": 187.67012 }, + "StopDistance": 0.5, "TerritoryId": 152, "InteractionType": "Emote", "Emote": "lookout" @@ -53,4 +54,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/QuestPaths/2.x - A Realm Reborn/MSQ-2/746_Back from the Wood.json b/QuestPaths/2.x - A Realm Reborn/MSQ-2/746_Back from the Wood.json index 352d3f5cf..a2c370216 100644 --- a/QuestPaths/2.x - A Realm Reborn/MSQ-2/746_Back from the Wood.json +++ b/QuestPaths/2.x - A Realm Reborn/MSQ-2/746_Back from the Wood.json @@ -54,14 +54,7 @@ }, "TerritoryId": 140, "InteractionType": "Interact", - "DialogueChoices": [ - { - "ExcelSheet": "Warp", - "Type": "YesNo", - "Yes": true, - "Prompt": 131088 - } - ] + "TargetTerritoryId": 212 } ] }, @@ -77,14 +70,7 @@ }, "TerritoryId": 212, "InteractionType": "Interact", - "DialogueChoices": [ - { - "ExcelSheet": "Warp", - "Type": "YesNo", - "Yes": true, - "Prompt": 131090 - } - ] + "TargetTerritoryId": 212 }, { "DataId": 1006688, @@ -99,4 +85,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/QuestPaths/quest-v1.json b/QuestPaths/quest-v1.json index a59faa7c3..124677a92 100644 --- a/QuestPaths/quest-v1.json +++ b/QuestPaths/quest-v1.json @@ -11,10 +11,7 @@ }, "Author": { "description": "Author of the quest sequence", - "type": "string" - }, - "Contributors": { - "type": "array", + "type": ["string", "array"], "items": { "type": "string" } diff --git a/Questionable.Model/V1/Converter/StringListOrValueConverter.cs b/Questionable.Model/V1/Converter/StringListOrValueConverter.cs new file mode 100644 index 000000000..d3e6ea6fd --- /dev/null +++ b/Questionable.Model/V1/Converter/StringListOrValueConverter.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Questionable.Model.V1.Converter; + +public sealed class StringListOrValueConverter : JsonConverter> +{ + public override List? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType == JsonTokenType.String) + return [reader.GetString()!]; + + if (reader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + reader.Read(); + + List value = []; + while (reader.TokenType != JsonTokenType.EndArray) + { + value.Add(reader.GetString()!); + reader.Read(); + } + + return value; + } + + public override void Write(Utf8JsonWriter writer, List? value, JsonSerializerOptions options) + { + if (value == null) + writer.WriteNullValue(); + else if (value.Count == 1) + writer.WriteStringValue(value[0]); + else + { + writer.WriteStartArray(); + foreach (var v in value) + writer.WriteStringValue(v); + writer.WriteEndArray(); + } + } +} diff --git a/Questionable.Model/V1/QuestRoot.cs b/Questionable.Model/V1/QuestRoot.cs index cf1967c44..ada2e9fd9 100644 --- a/Questionable.Model/V1/QuestRoot.cs +++ b/Questionable.Model/V1/QuestRoot.cs @@ -1,11 +1,13 @@ using System.Collections.Generic; +using System.Text.Json.Serialization; +using Questionable.Model.V1.Converter; namespace Questionable.Model.V1; public sealed class QuestRoot { - public string Author { get; set; } = null!; - public List Contributors { get; set; } = new(); + [JsonConverter(typeof(StringListOrValueConverter))] + public List Author { get; set; } = new(); /// /// This is only relevant for release builds.