From 0b910c4bda217d8a24d93d8334f89c5e6937a4a6 Mon Sep 17 00:00:00 2001 From: noil Date: Sat, 6 Nov 2021 19:48:54 -0400 Subject: [PATCH] CrystalAura: Added attackLocalDistance --- .../seppuku/impl/module/combat/CrystalAuraModule.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/me/rigamortis/seppuku/impl/module/combat/CrystalAuraModule.java b/src/main/java/me/rigamortis/seppuku/impl/module/combat/CrystalAuraModule.java index 3eab4b6..2f2c8bf 100644 --- a/src/main/java/me/rigamortis/seppuku/impl/module/combat/CrystalAuraModule.java +++ b/src/main/java/me/rigamortis/seppuku/impl/module/combat/CrystalAuraModule.java @@ -48,6 +48,7 @@ public final class CrystalAuraModule extends Module { public final Value attackDelay = new Value("AttackDelay", new String[]{"AttackDelay", "AttackDel", "Del"}, "The delay to attack in milliseconds", 50.0f, 0.0f, 500.0f, 1.0f); public final Value attackRadius = new Value("AttackRadius", new String[]{"ARange", "HitRange", "AttackDistance", "AttackRange", "ARadius"}, "The maximum range to attack crystals", 4.0f, 0.0f, 7.0f, 0.1f); public final Value attackMaxDistance = new Value("AttackMaxDistance", new String[]{"AMaxRange", "MaxAttackRange", "AMaxRadius", "AMD", "AMR"}, "Range around the enemy crystals will be attacked", 8.0f, 1.0f, 20.0f, 1.0f); + public final Value attackLocalDistance = new Value("AttackLocalDistance", new String[]{"ALocalRange", "LocalAttackRange", "ALocalRadius", "ALD", "ALR"}, "Enemy must be within this range to start attacking", 8.0f, 1.0f, 20.0f, 1.0f); public final Value attackWhenEmpty = new Value("AttackWhenEmpty", new String[]{"AWhenEmpty"}, "Continue to attack other crystals when we don't have any left", true); public final Value place = new Value("Place", new String[]{"AutoPlace"}, "Automatically place crystals", true); public final Value placeRapid = new Value("PlaceRapid", new String[]{"RapidPlace"}, "Remove place delay", true); @@ -110,6 +111,12 @@ public final class CrystalAuraModule extends Module { switch (event.getStage()) { case PRE: + if (this.currentAttackPlayer != null && this.currentAttackEntity != null) { + if (this.currentAttackPlayer.getDistance(this.currentAttackEntity) > this.attackMaxDistance.getValue()) { + this.currentAttackEntity = null; + } + } + if (this.currentAttackPlayer != null && this.currentPlacePosition != null) { if (this.currentAttackPlayer.getDistance(this.currentPlacePosition.getX(), this.currentPlacePosition.getY(), this.currentPlacePosition.getZ()) > this.placeMaxDistance.getValue()) { this.currentPlacePosition = null; @@ -132,7 +139,7 @@ public final class CrystalAuraModule extends Module { // target reset if (currentAttackPlayer != null) { - if ((mc.player.getDistance(this.currentAttackPlayer) > this.attackMaxDistance.getValue()) || !this.currentAttackPlayer.isEntityAlive()) { + if ((mc.player.getDistance(this.currentAttackPlayer) > this.attackLocalDistance.getValue()) || !this.currentAttackPlayer.isEntityAlive()) { this.currentAttackPlayer = null; this.currentPlacePosition = null; }