diff options
author | Serhan <serhanduzce@gmail.com> | 2023-09-23 14:26:43 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-23 13:26:43 +0200 |
commit | e3fb64e83b9c1e6ffea03ac1b30099eec5e4dfe3 (patch) | |
tree | 4ce07877aff74e88599997f73539767de25965a8 | |
parent | db2e655cd52fd0416130ee65c526e575adc34b94 (diff) | |
download | skyhanni-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…
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt | 27 |
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() |