Skip to content

Commit

Permalink
Merge pull request #569 from pacampbell/msq_s2_1
Browse files Browse the repository at this point in the history
feat: Season 2.1 Main Story Quests
  • Loading branch information
pacampbell authored Sep 22, 2024
2 parents 25f90c2 + 987934f commit e2a09a5
Show file tree
Hide file tree
Showing 17 changed files with 1,579 additions and 91 deletions.
4 changes: 4 additions & 0 deletions Arrowgene.Ddon.Database/Arrowgene.Ddon.Database.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<ContentWithTargetPath Remove="Files\Database\Script\equippoints_migration.sql" />
<ContentWithTargetPath Remove="Files\Database\Script\equip_migration_sqlite.sql" />
<ContentWithTargetPath Remove="files\database\script\migration_msq_2.0.sql" />
<ContentWithTargetPath Remove="files\database\script\migration_msq_2.1.sql" />
<ContentWithTargetPath Remove="Files\Database\Script\migration_quest_variant.sql" />
<ContentWithTargetPath Remove="Files\Database\Script\migration_rented_pawn.sql" />
<ContentWithTargetPath Remove="Files\Database\Script\pawncraftingdata_migration.sql" />
Expand Down Expand Up @@ -76,6 +77,9 @@
<None Update="Files\Database\Script\migration_msq_2.0.sql">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Files\Database\Script\migration_msq_2.1.sql">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Files\Database\Script\migration_rented_pawn.sql">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down
2 changes: 1 addition & 1 deletion Arrowgene.Ddon.Database/DdonDatabaseBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static class DdonDatabaseBuilder
private static readonly ILogger Logger = LogProvider.Logger<Logger>(typeof(DdonDatabaseBuilder));
private const string DefaultSchemaFile = "Script/schema_sqlite.sql";

public const uint Version = 16;
public const uint Version = 17;

public static IDatabase Build(DatabaseSetting settings)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
INSERT INTO ddon_quest_progress(character_common_id, quest_type, quest_id, step, variant_quest_id)
VALUES ((SELECT character_common_id FROM ddon_completed_quests WHERE quest_id = 20070), 3, 20080, 0, 0);
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System.Data.Common;

namespace Arrowgene.Ddon.Database.Sql.Core.Migration
{
public class Msq21Migration : IMigrationStrategy
{
public uint From => 16;
public uint To => 17;

private readonly DatabaseSetting DatabaseSetting;

public Msq21Migration(DatabaseSetting databaseSetting)
{
DatabaseSetting = databaseSetting;
}

public bool Migrate(IDatabase db, DbConnection conn)
{
string adaptedSchema = DdonDatabaseBuilder.GetAdaptedSchema(DatabaseSetting, "Script/migration_msq_2.1.sql");
db.Execute(conn, adaptedSchema);
return true;
}
}
}
4 changes: 2 additions & 2 deletions Arrowgene.Ddon.Shared/AssetReader/QuestAssetDeserializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -634,12 +634,14 @@ private bool ParseBlocks(QuestProcess questProcess, JsonElement jBlocks)
Logger.Error($"Unable to parse the quest type in block @ index {blockIndex - 1}.");
return false;
}
questBlock.OmInteractEvent.QuestType = questType;

if (!Enum.TryParse(jblock.GetProperty("interact_type").GetString(), true, out OmInteractType interactType))
{
Logger.Error($"Unable to parse the quest type in block @ index {blockIndex - 1}.");
return false;
}
questBlock.OmInteractEvent.InteractType = interactType;

questBlock.ShowMarker = true;
if (jblock.TryGetProperty("show_marker", out JsonElement jShowMarker))
Expand All @@ -651,8 +653,6 @@ private bool ParseBlocks(QuestProcess questProcess, JsonElement jBlocks)
{
questBlock.OmInteractEvent.QuestId = (QuestId)jQuestId.GetUInt32();
}

questBlock.OmInteractEvent.QuestType = questType;
}
break;
case QuestBlockType.DeliverItems:
Expand Down
38 changes: 5 additions & 33 deletions Arrowgene.Ddon.Shared/Files/Assets/EnemySpawn.json
Original file line number Diff line number Diff line change
Expand Up @@ -145895,11 +145895,11 @@
0,
4,
0,
"0x015104",
"0x015003",
2298,
0,
100,
65,
62,
0,
0,
0,
Expand All @@ -145912,10 +145912,10 @@
true,
false,
false,
62,
0,
0,
197000,
162,
155040,
-1,
"00:00,23:59"
],
[
Expand Down Expand Up @@ -218606,34 +218606,6 @@
331,
"00:00,23:59"
],
[
329,
0,
8,
0,
"0x070920",
2298,
0,
100,
65,
0,
0,
0,
0,
1,
0,
0,
0,
true,
true,
false,
false,
0,
0,
197000,
422,
"00:00,23:59"
],
[
329,
0,
Expand Down
2 changes: 1 addition & 1 deletion Arrowgene.Ddon.Shared/Files/Assets/quests/q00020070.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "Main",
"comment": "The Fate of Lestania",
"quest_id": 20070,
"next_quest": 0,
"next_quest": 20080,
"base_level": 57,
"minimum_item_rank": 0,
"discoverable": true,
Expand Down
155 changes: 155 additions & 0 deletions Arrowgene.Ddon.Shared/Files/Assets/quests/q00020080.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
{
"state_machine": "GenericStateMachine",
"type": "Main",
"comment": "A Fresh Incident",
"quest_id": 20080,
"next_quest": 20090,
"base_level": 64,
"minimum_item_rank": 0,
"discoverable": true,
"order_conditions": [
{"type": "MinimumLevel", "Param1": 64}
],
"rewards": [
{
"type": "exp",
"amount": 98000
},
{
"type": "wallet",
"wallet_type": "Gold",
"amount": 25000
},
{
"type": "wallet",
"wallet_type": "RiftPoints",
"amount": 2000
},
{
"type": "fixed",
"loot_pool": [
{
"item_id": 14191,
"num": 1
},
{
"item_id": 11510,
"num": 5
}
]
}
],
"enemy_groups": [
{
"stage_id": {
"id": 335,
"group_id": 4
},
"enemies": [
{
"comment": "Medusa",
"enemy_id": "0x015610",
"level": 64,
"exp": 156320,
"named_enemy_params_id": 934,
"is_boss": true
},
{
"comment": "Eliminator",
"enemy_id": "0x010530",
"level": 64,
"exp": 15632,
"named_enemy_params_id": 934
},
{
"comment": "Eliminator",
"enemy_id": "0x010530",
"level": 64,
"exp": 15632,
"named_enemy_params_id": 934
}
]
}
],
"processes": [
{
"comment": "Process 0",
"blocks": [
{
"type": "NpcTalkAndOrder",
"stage_id": {
"id": 3
},
"flags": [
{"type": "WorldManageLayout", "action": "Clear", "value": 8630, "quest_id": 70034001, "comment": "Spawns Gurdolin, Lise and Elliot"}
],
"npc_id": "Joseph",
"message_id": 0
},
{
"type": "PlayEvent",
"stage_id": {
"id": 3
},
"event_id": 140,
"flags": [
{"type": "WorldManageLayout", "action": "Clear", "value": 7390, "quest_id": 70032001, "comment": "The White Dragon (Full)"}
]
},
{
"type": "TalkToNpc",
"announce_type": "Accept",
"stage_id": {
"id": 3
},
"npc_id": "Klaus0",
"message_id": 15308,
"flags": [
{"type": "WorldManageLayout", "action": "Set", "value": 7390, "quest_id": 70032001, "comment": "The White Dragon (Full)"}
]
},
{
"type": "PartyGather",
"announce_type": "Update",
"checkpoint": true,
"stage_id": {
"id": 335
},
"location": {
"x": -2984,
"y": 1539,
"z": 2350
}
},
{
"type": "PlayEvent",
"stage_id": {
"id": 335
},
"event_id": 20
},
{
"type": "KillGroup",
"announce_type": "Update",
"groups": [ 0 ]
},
{
"type": "PlayEvent",
"stage_id": {
"id": 335
},
"event_id": 25
},
{
"type": "TalkToNpc",
"announce_type": "Update",
"stage_id": {
"id": 3
},
"npc_id": "Joseph",
"message_id": 15325
}
]
}
]
}
Loading

0 comments on commit e2a09a5

Please sign in to comment.