Skip to content

Commit

Permalink
Fix T3 event materials being unavailable from certain events (#846)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
SapiensAnatis authored May 29, 2024
1 parent b05ced8 commit 06a51be
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion DragaliaAPI/DragaliaAPI/Features/Event/EventDropService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion DragaliaAPI/DragaliaAPI/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"RedisOptions__Hostname": "localhost",
"PostgresOptions__Hostname": "localhost"
},
"applicationUrl": "http://localhost:80"
"applicationUrl": "http://*:80"
}
}
}

0 comments on commit 06a51be

Please sign in to comment.