From 06a51bec772c835bd49ddad8214bb13e64dbb0b3 Mon Sep 17 00:00:00 2001 From: Jay Malhotra <5047192+SapiensAnatis@users.noreply.github.com> Date: Wed, 29 May 2024 20:44:58 +0100 Subject: [PATCH] Fix T3 event materials being unavailable from certain events (#846) Closes #507 Replaces the calculation based on VariationType with one that looks at the least significant digits of the quest ID, as these always follow a particular structure for wave quests across all events. It produces an identical result to the old calculation assuming that the old calculation was intended for typical events with VariationType 3 and 4 in the wave quests. \+ `launchSettings.json` fix for making the server accessible via a mobile device --- .../DragaliaAPI/Features/Event/EventDropService.cs | 12 +++++++++++- .../DragaliaAPI/Properties/launchSettings.json | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/DragaliaAPI/DragaliaAPI/Features/Event/EventDropService.cs b/DragaliaAPI/DragaliaAPI/Features/Event/EventDropService.cs index 5aa6edd34..7e8ccc3dd 100644 --- a/DragaliaAPI/DragaliaAPI/Features/Event/EventDropService.cs +++ b/DragaliaAPI/DragaliaAPI/Features/Event/EventDropService.cs @@ -180,8 +180,18 @@ double buildDropMultiplier if (type == DungeonTypes.Wave) { // T3 only drops from Challenge Battle quests + + // Typically, there are two challenge battle quests - an easier one and a harder one. We want to give more + // rewards for the harder one. This previously used questData.VariationType, but that is inconsistent + // between events; see https://github.com/SapiensAnatis/Dawnshard/issues/507. + // This hack instead relies on the fact that the quest IDs for wave quests are always organized like: + // 208170501 Season's Beatings: Expert + // 208170502 Season's Beatings: Master + // It therefore provides a multiplier of 1 for the hard quest, and 0.5 for the easy quest. + double t3Multiplier = quest.Id % 10 / 2d; + int t3Quantity = GenerateDropAmount( - 10 * record.Wave * ((variation - VariationTypes.Hard) / 2d) * buildDropMultiplier + 10 * record.Wave * t3Multiplier * buildDropMultiplier ); yield return new Entity(evt.ViewEntityType3, evt.ViewEntityId3, t3Quantity); } diff --git a/DragaliaAPI/DragaliaAPI/Properties/launchSettings.json b/DragaliaAPI/DragaliaAPI/Properties/launchSettings.json index d42861d83..795b58871 100644 --- a/DragaliaAPI/DragaliaAPI/Properties/launchSettings.json +++ b/DragaliaAPI/DragaliaAPI/Properties/launchSettings.json @@ -8,7 +8,7 @@ "RedisOptions__Hostname": "localhost", "PostgresOptions__Hostname": "localhost" }, - "applicationUrl": "http://localhost:80" + "applicationUrl": "http://*:80" } } }