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

feat(Criticals-Blink): range option #4701

Merged
merged 1 commit into from
Nov 26, 2024
Merged
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 @@ -76,7 +76,7 @@ object ModuleCriticals : ClientModule("Criticals", Category.COMBAT) {
&& world.findEnemy(0.0f..enemyInRange) != null

val stopSprinting by enumChoice("StopSprinting", StopSprintingMode.LEGIT)
private val enemyInRange by float("Range", 3.0f, 0.0f..10.0f)
private val enemyInRange by float("Range", 4.0f, 0.0f..10.0f)

@Suppress("unused")
private val attackHandler = handler<AttackEntityEvent>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ package net.ccbluex.liquidbounce.features.module.modules.combat.criticals.modes

import net.ccbluex.liquidbounce.config.types.Choice
import net.ccbluex.liquidbounce.config.types.ChoiceConfigurable
import net.ccbluex.liquidbounce.event.events.GameTickEvent
import net.ccbluex.liquidbounce.event.events.QueuePacketEvent
import net.ccbluex.liquidbounce.event.events.TransferOrigin
import net.ccbluex.liquidbounce.event.handler
import net.ccbluex.liquidbounce.features.module.modules.combat.criticals.ModuleCriticals
import net.ccbluex.liquidbounce.features.module.modules.combat.criticals.ModuleCriticals.wouldDoCriticalHit
import net.ccbluex.liquidbounce.utils.client.PacketQueueManager
import net.ccbluex.liquidbounce.utils.combat.findEnemy
import net.minecraft.network.packet.c2s.common.ResourcePackStatusC2SPacket
import net.minecraft.network.packet.c2s.play.*

Expand All @@ -35,13 +37,20 @@ object CriticalsBlink : Choice("Blink") {
get() = ModuleCriticals.modes

private val delay by intRange("Delay", 300..600, 0..1000, "ms")
private val range by float("Range", 4.0f, 0.0f..10.0f)
private var nextDelay = delay.random()

var isInState = false
private var enemyInRange = false

@Suppress("unused")
private val tickHandler = handler<GameTickEvent> {
enemyInRange = world.findEnemy(0.0f..range) != null
}

@Suppress("unused")
private val fakeLagHandler = handler<QueuePacketEvent> { event ->
if (event.origin == TransferOrigin.SEND && !wouldDoCriticalHit(ignoreSprint = true)) {
if (event.origin == TransferOrigin.SEND && !wouldDoCriticalHit(ignoreSprint = true) && !enemyInRange) {
if (PacketQueueManager.isAboveTime(nextDelay.toLong())) {
nextDelay = delay.random()
return@handler
Expand Down
Loading