Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add Trinity helper #3462

Open
wants to merge 5 commits into
base: beta
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ public class DungeonConfig {
@Accordion
public LividFinderConfig lividFinder = new LividFinderConfig();

@Expose
@ConfigOption(name = "Trinity", desc = "")
@Accordion
public DungeonTrinityHelperConfig trinityHelper = new DungeonTrinityHelperConfig();

@Expose
@ConfigOption(name = "Terracotta Phase", desc = "")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package at.hannibal2.skyhanni.config.features.dungeon;

import at.hannibal2.skyhanni.config.FeatureToggle;
import com.google.gson.annotations.Expose;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean;
import io.github.notenoughupdates.moulconfig.annotations.ConfigOption;

public class DungeonTrinityHelperConfig {

@Expose
@ConfigOption(name = "Enabled", desc = "Notifies user when Trinity is highly likely to appear on dungeon. (Puzzle count == 5)")
@ConfigEditorBoolean
@FeatureToggle
public boolean enabled = true;

@Expose
@ConfigOption(name = "Notify party", desc = "Automatically send message to party to watch out for Trinity")
@ConfigEditorBoolean
@FeatureToggle
public boolean sendPartyChat = true;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package at.hannibal2.skyhanni.features.dungeon

import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.api.event.HandleEvent
import at.hannibal2.skyhanni.data.model.TabWidget
import at.hannibal2.skyhanni.events.dungeon.DungeonStartEvent
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.utils.HypixelCommands
import at.hannibal2.skyhanni.utils.LorenzUtils
import kotlin.time.Duration.Companion.seconds

@SkyHanniModule
object DungeonTrinityHelper {
private val config get() = SkyHanniMod.feature.dungeon.trinityHelper

@HandleEvent
fun onDungeonStart(event: DungeonStartEvent) {
if (!config.enabled) return

TabWidget.DUNGEON_PUZZLE.matchMatcherFirstLine {
val puzzleCount = group("amount")?.toIntOrNull() ?: 0

// https://hypixel.net/threads/best-way-to-get-trinitys-number-instead-of-acquiring-actual-friends.5489159/
if (puzzleCount == 5) {
LorenzUtils.sendTitle("§dTrinity ?!?!", 5.seconds)
if (config.sendPartyChat) HypixelCommands.partyChat("5 Puzzle dungeon, watch out for Trinity room")
}
}
}

}