-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathLocationSpecialtyHandler.patch
32 lines (27 loc) · 1.82 KB
/
LocationSpecialtyHandler.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
commit 5a09dbfc0166effe4b7fde29072482a0f5244b16
Author: Adam Balan <a-kyle@hotmail.com>
Date: Fri Nov 8 17:53:32 2024 -0700
Added fixes to the way weekly fights happen, as well as a few other fixes here and there.
diff --git a/app/Game/BattleRewardProcessing/Handlers/LocationSpecialtyHandler.php b/app/Game/BattleRewardProcessing/Handlers/LocationSpecialtyHandler.php
index 60f165317..8d75e1316 100644
--- a/app/Game/BattleRewardProcessing/Handlers/LocationSpecialtyHandler.php
+++ b/app/Game/BattleRewardProcessing/Handlers/LocationSpecialtyHandler.php
@@ -144,16 +144,19 @@ class LocationSpecialtyHandler
$equippedItems = $this->fetchEquipped($character) ?? collect();
$equippedChance = 0.01;
+ $totalEquippedChance = 0;
- $chance += match ($character->map->gameMap->mapType()) {
+ $totalEquippedChance = match ($character->map->gameMap->name) {
MapNameValue::HELL => $equippedChance * $equippedItems->whereNull('item.specialty_type')->where('item.skill_level_required', 400)->sum(),
MapNameValue::DELUSIONAL_MEMORIES => $equippedChance * $equippedItems->where('item.specialty_type', ItemSpecialtyType::PURGATORY_CHAINS)->sum(),
MapNameValue::TWISTED_MEMORIES => $equippedChance * $equippedItems->where('item.specialty_type', ItemSpecialtyType::TWISTED_EARTH)->sum(),
default => 0.0
};
+ $chance += $totalEquippedChance;
+
if ($chance >= 80) {
- $typeOfItem = match ($character->map->gameMap->mapType()) {
+ $typeOfItem = match ($character->map->gameMap->name) {
MapNameValue::HELL => ItemSpecialtyType::HELL_FORGED,
MapNameValue::DELUSIONAL_MEMORIES => ItemSpecialtyType::DELUSIONAL_SILVER,
MapNameValue::TWISTED_MEMORIES => ItemSpecialtyType::FAITHLESS_PLATE,