aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSerhan <serhanduzce@gmail.com>2023-09-23 14:26:43 +0300
committerGitHub <noreply@github.com>2023-09-23 13:26:43 +0200
commite3fb64e83b9c1e6ffea03ac1b30099eec5e4dfe3 (patch)
tree4ce07877aff74e88599997f73539767de25965a8 /src
parentdb2e655cd52fd0416130ee65c526e575adc34b94 (diff)
downloadskyhanni-e3fb64e83b9c1e6ffea03ac1b30099eec5e4dfe3.tar.gz
skyhanni-e3fb64e83b9c1e6ffea03ac1b30099eec5e4dfe3.tar.bz2
skyhanni-e3fb64e83b9c1e6ffea03ac1b30099eec5e4dfe3.zip
crimson rep helper trophy fish chat message #491
* fix: Crimson Reputation Helper doesn't count trophy fish when sacks e…
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt27
1 files changed, 10 insertions, 17 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt
index 424f51653..6be7eae2e 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt
@@ -51,28 +51,11 @@ class DailyQuestHelper(val reputationHelper: CrimsonIsleReputationHelper) {
fun onTick(event: LorenzTickEvent) {
if (!isEnabled()) return
- if (event.repeatSeconds(1)) {
- checkInventoryForTrophyFish()
- }
-
if (event.repeatSeconds(3)) {
checkInventoryForFetchItem()
}
}
- // TODO use OwnInventoryItemUpdateEvent
- private fun checkInventoryForTrophyFish() {
- val fishQuest = getQuest<TrophyFishQuest>() ?: return
- if (fishQuest.state != QuestState.ACCEPTED && fishQuest.state != QuestState.READY_TO_COLLECT) return
-
- val fishName = fishQuest.fishName
- val currentlyInInventory = InventoryUtils.countItemsInLowerInventory { it.name?.contains(fishName) ?: false }
- val diff = currentlyInInventory - latestTrophyFishInInventory
- if (diff < 1) return
- latestTrophyFishInInventory = currentlyInInventory
- updateProcessQuest(fishQuest, fishQuest.haveAmount + diff)
- }
-
fun update() {
reputationHelper.update()
}
@@ -148,6 +131,16 @@ class DailyQuestHelper(val reputationHelper: CrimsonIsleReputationHelper) {
rescueMissionQuest.state = QuestState.READY_TO_COLLECT
update()
}
+
+ if (message.contains("§6§lTROPHY FISH! §r§bYou caught a")) {
+ val fishQuest = getQuest<TrophyFishQuest>() ?: return
+ if (fishQuest.state != QuestState.ACCEPTED && fishQuest.state != QuestState.READY_TO_COLLECT) return
+ val fishName = fishQuest.fishName
+
+ if (message.contains(fishName)) {
+ updateProcessQuest(fishQuest, fishQuest.haveAmount + 1)
+ }
+ }
}
inline fun <reified T : Quest> getQuest() = quests.filterIsInstance<T>().firstOrNull()