//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package nursultan;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import java.util.Random;
import nursultan.bgw.a;
import nursultan.cpe.1;
import org.lwjgl.opengl.GL11;
public class KillAura extends Module {
private final ModeValue rotationMode = (ModeValue)this.b(new ModeValue("Mode", "Matrix", new String[]{"Matrix", "Sunrise"}));
private final ModeValue sortPriority = (ModeValue)this.b(new ModeValue("Sort", "Distance", new String[]{"Distance", "Health"}));
private final TargetsValue targets = (TargetsValue)this.b(new TargetsValue("Targets", new ctn.a[]{new ctn.a("Friends", true), new ctn.a("Naked", true), new ctn.a("Invisible", true), new ctn.a("Mobs", true), new ctn.a("Players", true)}));
private final BooleanValue smart = (BooleanValue)this.b(new BooleanValue("Smart", true));
public final FloatValue distance = (FloatValue)this.b(new FloatValue("Distance", 3.5F, 1.0F, 8.0F, 0.1F));
public final FloatValue rotationDistance = (FloatValue)this.b(new FloatValue("Rotation distance", 4.2F, 1.0F, 8.0F, 0.1F, () -> {
return !this.smart.getValue();
}));
private final BooleanValue rayTrace = (BooleanValue)this.b(new BooleanValue("Ray trace", true));
private final BooleanValue walls = (BooleanValue)this.b(new BooleanValue("Walls", true));
private final BooleanValue onlyWeapon = (BooleanValue)this.b(new BooleanValue("Only weapon", false));
private final BooleanValue clientRotation = (BooleanValue)this.b(new BooleanValue("Client rotation", false));
private final BooleanValue checkObsidian = (BooleanValue)this.b(new BooleanValue("Check obsidian", false));
public final FloatValue distanceToObsidian;
private final BooleanValue snap;
private final BooleanValue sync;
private final BooleanValue autoCrit;
private final BooleanValue adapriveCrits;
private final BooleanValue noCritIfTrapdoor;
private final BooleanValue targetesp;
public final BooleanValue shieldDesync;
public final BooleanValue shieldAttack;
private final BooleanValue breakShield;
private EntityLivingBase currentTarget;
public static boolean dSE;
private final Vec2f currentRotations;
public final Vec2f dSG;
private final double[] dSH;
public KillAura() {
super(Category.dPp, "KillAura", "Автоматически аттакует существ");
BooleanValue var10009 = this.checkObsidian;
Objects.requireNonNull(var10009);
this.distanceToObsidian = (FloatValue)this.b(new FloatValue("Distance to obsidian", 4.0F, 3.0F, 16.0F, 1.0F, var10009::getValue));
this.snap = (BooleanValue)this.b(new BooleanValue("Snap", false));
this.sync = (BooleanValue)this.b(new BooleanValue("Sync", true));
this.autoCrit = (BooleanValue)this.b(new BooleanValue("Auto crit", true));
BooleanValue var10006 = this.autoCrit;
Objects.requireNonNull(var10006);
this.adapriveCrits = (BooleanValue)this.b(new BooleanValue("Adaptive crits", false, var10006::getValue));
this.noCritIfTrapdoor = (BooleanValue)this.b(new BooleanValue("No crit if trapdoor", false));
this.targetesp = (BooleanValue)this.b(new BooleanValue("Target esp", true));
this.shieldDesync = (BooleanValue)this.b(new BooleanValue("Shield desync", true));
this.shieldAttack = (BooleanValue)this.b(new BooleanValue("Shield attack", true));
this.breakShield = (BooleanValue)this.b(new BooleanValue("Break shield", true));
this.currentRotations = new Vec2f();
this.dSG = new Vec2f();
this.dSH = new double[3];
}
private double B(double var1, double var3) {
return Math.sqrt(Math.pow(var1, 2.0) + Math.pow(var3, 2.0));
}
private void S(EntityLivingBase var1) {
if (this.T(var1)) {
boolean var2 = false;
if (bgw.cig) {
mc.player.connection.c(new bgw(mc.player, a.cio));
var2 = true;
}
dSE = true;
if (this.snap.getValue()) {
mc.player.baV = this.currentRotations.yaw;
mc.player.baW = this.currentRotations.pitch;
}
mc.playerController.attackEntity(mc.player, var1);
mc.player.a(brd.cEr);
this.attackEntity(var1);
if (var2) {
mc.player.connection.c(new bgw(mc.player, a.cin));
}
}
}
private boolean d(EntityPlayer var1, int var2) {
if (var1.lM() && !var1.bfe.isEmpty()) {
Item var3 = var1.bfe.ga();
return var3.aA(var1.bfe) == azy.caD && var3.aB(var1.bfe) - var1.bff >= var2;
} else {
return false;
}
}
private double f(double var1, double var3, double var5, double var7, double var9, double var11) {
double var13 = var1 - var7;
double var15 = var3 - var9;
double var17 = var5 - var11;
return (double)MathHelper.sqrt(var13 * var13 + var15 * var15 + var17 * var17);
}
private boolean R(EntityLivingBase var1) {
double var2 = var1.y(mc.player);
return var2 < Math.max((double)this.distance.getValue(), this.aBg());
}
private Vec3d i(EntityLivingBase var1, float var2) {
if (var1.z(var1) >= 36.0) {
return null;
} else {
Vec3d var3 = this.a(nursultan.cpe.a.dSJ, var1);
Vec3d var4 = this.a(nursultan.cpe.a.dSK, var1);
Vec3d var5 = this.a(nursultan.cpe.a.dSL, var1);
ArrayList var6 = new ArrayList(Arrays.asList(var3, var4, var5));
var6.removeIf((var3x) -> {
return Utils.a(this.u(var3x), var2, var1) != var1;
});
if (var6.isEmpty()) {
return null;
} else {
var6.sort((var1x, var2x) -> {
Vec2f var3 = this.a(this.currentRotations, var1x);
Vec2f var4 = this.a(this.currentRotations, var2x);
float var5 = Math.abs(var3.pitch);
float var6 = Math.abs(var4.pitch);
return (int)((var5 - var6) * 500.0F);
});
return (Vec3d)var6.get(0);
}
}
}
private Vec3d a(cpe.a var1, EntityLivingBase var2) {
float var10000;
switch (1.dSI[var1.ordinal()]) {
case 1 -> var10000 = var2.MA - 0.2F;
case 2 -> var10000 = var2.MA / 2.0F;
case 3 -> var10000 = 0.9F;
default -> throw new IncompatibleClassChangeError();
}
float var3 = var10000;
return var2.dT().X(0.0, (double)var3, 0.0);
}
private List<BlockPos> a(BlockPos var1, float var2) {
ArrayList var3 = new ArrayList();
int var4 = var1.getX();
int var5 = var1.getY();
int var6 = var1.getZ();
for(int var7 = var4 - (int)var2; (float)var7 <= (float)var4 + var2; ++var7) {
for(int var8 = var6 - (int)var2; (float)var8 <= (float)var6 + var2; ++var8) {
for(int var9 = var5 - (int)var2; (float)var9 < (float)var5 + var2; ++var9) {
double var10 = (double)((var4 - var7) * (var4 - var7) + (var6 - var8) * (var6 - var8) + (var5 - var9) * (var5 - var9));
if (var10 < (double)(var2 * var2)) {
var3.add(new BlockPos(var7, var9, var8));
}
}
}
}
return var3;
}
private Vec2f a(Vec2f var1, Vec3d var2) {
double var3 = var2.xCoord - mc.player.posX;
double var5 = var2.yCoord - mc.player.bL(1.0F).yCoord;
double var7 = var2.zCoord - mc.player.posZ;
double var9 = this.B(var3, var7);
float var11 = (float)MathHelper.aO(Math.toDegrees(Math.atan2(var7, var3)) - 90.0);
float var12 = (float)(-Math.toDegrees(Math.atan2(var5, var9)));
float var13 = MathHelper.cM(var11 - var1.yaw);
float var14 = var12 - var1.pitch;
return new Vec2f(var13, var14);
}
private Vec3d a(Vec3d var1, EntityLivingBase var2) {
float var3 = var2.Fn() + 0.1F;
but var4 = var2.sW().P((double)var3, (double)var3, (double)var3);
Vec3d var5 = this.i(var2, this.rotationDistance.getValue());
if (var5 == null) {
var5 = cuc.a(var1, var4, var2.bL(1.0F), false, (double)this.rotationDistance.getValue(), -1);
}
return var5;
}
@EventTarget
public void a(cod var1) {
if (this.currentTarget != null) {
RenderManager var2 = mc.getRenderManager();
MathUtils.a(this.currentTarget, this.dSH);
if (this.targetesp.getValue()) {
double var3 = this.dSH[0];
double var5 = this.dSH[1] + Math.sin((double)System.currentTimeMillis() / 200.0) + 1.0;
double var7 = this.dSH[2];
GlStateManager.glPushMatrix();
GlStateManager.glTranslated(-var2.viewX(), -var2.viewY(), -var2.viewZ());
GlStateManager.disableTexture2D();
GlStateManager.enableBlend();
GlStateManager.glBlendFunc(770, 771);
GlStateManager.glDepthMask(false);
GL11.glShadeModel(7425);
GlStateManager.disableCull();
float var9 = 0.5F;
ClientOverlay var12 = ckb.dJI.moduleManager.dPY;
bufferBuilder.begin(5, DefaultVertexFormats.POSITION_TEX);
for(int var11 = 0; var11 <= 45; ++var11) {
int var10 = var12.dT((float)(var11 * 48));
float var13 = MathHelper.sin(MathHelper.dg((float)(var11 * 16)));
float var14 = MathHelper.cos(MathHelper.dg((float)(var11 * 16)));
double var15 = var3 + (double)(0.5F * var14);
double var17 = var7 + (double)(0.5F * var13);
bufferBuilder.pos(var15, var5 - Math.cos((double)System.currentTimeMillis() / 200.0) / 3.0, var17).color(ColorUtils.setColorAlpha(var10, 0)).endVertex();
bufferBuilder.pos(var15, var5, var17).color(ColorUtils.setColorAlpha(var10, 180)).endVertex();
}
ebO.wh();
GL11.glShadeModel(7424);
GlStateManager.glDepthMask(true);
GlStateManager.us();
GlStateManager.enableCull();
GlStateManager.disableBlend();
GlStateManager.enableTexture2D();
GlStateManager.uO();
GlStateManager.glPopMatrix();
}
}
}
@EventTarget
public void a(cnu var1) {
if (this.currentTarget != null) {
if (var1.getPacket() instanceof bhf) {
var1.cZ(true);
}
Packet var3 = var1.getPacket();
if (var3 instanceof bhn) {
bhn var2 = (bhn)var3;
if (var2.WS().equals(nursultan.bhn.a.cjs) || var2.WS().equals(nursultan.bhn.a.cju)) {
var1.cZ(true);
}
}
}
}
@EventTarget
public void a(EventUpdate var1) {
boolean var2 = this.rotationMode.gL("Sunrise") || this.sync.getValue() || this.aBh();
if (var2) {
mc.world.cOe.stream().filter((var0) -> {
return var0 instanceof mk;
}).map((var0) -> {
return (mk)var0;
}).forEach(mk::ls);
}
this.currentTarget = this.getNewTarget();
if (this.currentTarget instanceof EntityPlayer && this.shieldDesync.getValue() && this.d(mc.player, 4 + (new Random()).nextInt(4)) && mc.player.lM()) {
mc.playerController.f(mc.player);
}
if (this.currentTarget != null) {
this.setRotation(this.currentTarget);
this.S(this.currentTarget);
}
if (var2) {
mc.world.cOe.stream().filter((var0) -> {
return var0 instanceof mk;
}).map((var0) -> {
return (mk)var0;
}).forEach(mk::lt);
}
}
@EventTarget
private void a(EventUpdateWalkingPlayer var1) {
AutoPotion var2 = ckb.dJI.moduleManager.dQh;
boolean var3 = var2.qS() && var2.aCa();
if (this.currentTarget != null) {
var1.q(this.currentRotations.yaw, var3 ? var1.getPitch() : this.currentRotations.pitch);
if (this.clientRotation.getValue()) {
mc.player.baV = this.dSG.yaw;
mc.player.baW = this.dSG.pitch;
}
} else {
this.aBl();
}
}
private void setRotation(EntityLivingBase var1) {
Vec3d var2 = this.a(mc.player.bL(1.0F), var1);
double var3 = mc.player.posX;
double var5 = mc.player.posY + (double)mc.player.FZ();
double var7 = mc.player.posZ;
double var9 = var1.posX - var3;
double var11 = var1.dT().X(0.0, (double)(var1.MA / 2.0F), 0.0).yCoord - var5;
double var13 = var1.posZ - var7;
double var15 = this.B(var9, var13);
float var17 = (float)(-Math.toDegrees(Math.atan2(var11, var15)));
double var18 = var2.xCoord - var3;
double var20 = var2.yCoord - var5;
double var22 = var2.zCoord - var7;
double var24 = this.B(var18, var22);
float[] var26 = new float[]{(float)MathHelper.aY(Math.atan2(var22, var18)) - 90.0F, (float)(-MathHelper.aY(Math.atan2(var20, var24)))};
this.dSG.yaw += MathHelper.M(MathHelper.cM(var26[0] - this.dSG.yaw), -45.0F, 45.0F);
this.dSG.pitch += MathHelper.M(var17 - this.dSG.pitch, -90.0F, 90.0F);
float var27 = var26[0] - this.currentRotations.yaw;
float var28 = var26[1] - this.currentRotations.pitch;
float var29 = MathHelper.cM(var27);
float var30 = MathUtils.interpolateRandom(-2.0F, 2.0F);
float var31 = MathUtils.interpolateRandom(-5.0F, 5.0F);
float var32 = MathHelper.M(var29 + var30, -60.0F + var31, 60.0F + var31);
float var33 = MathHelper.M(var28 + var30, (float)(-(this.rotationMode.gL("Sunrise") ? 13 : 45)), (float)(this.rotationMode.gL("Sunrise") ? 13 : 45));
var26[0] = this.currentRotations.yaw + var32;
var26[1] = MathHelper.M(this.currentRotations.pitch + var33 / (this.rotationMode.gL("Sunrise") ? 4.0F : 2.0F), -90.0F, 90.0F);
float var34 = mc.CT.aNz * 0.6F + 0.2F;
double var35 = Math.pow((double)var34, 3.0) * 8.0;
double var37 = var35 * 0.15000000596046448;
var26[0] = (float)((double)var26[0] - (double)(var26[0] - this.currentRotations.yaw) % var37);
var26[1] = (float)((double)var26[1] - (double)(var26[1] - this.currentRotations.pitch) % var37);
this.currentRotations.yaw = var26[0];
this.currentRotations.pitch = var26[1];
}
private Vec2f u(Vec3d var1) {
double var2 = var1.xCoord - mc.player.posX;
double var4 = var1.yCoord - mc.player.bL(1.0F).yCoord;
double var6 = var1.zCoord - mc.player.posZ;
double var8 = this.B(var2, var6);
float var10 = (float)MathHelper.aO(Math.toDegrees(Math.atan2(var6, var2)) - 90.0);
float var11 = (float)(-Math.toDegrees(Math.atan2(var4, var8)));
return new Vec2f(var10, var11);
}
private boolean T(EntityLivingBase var1) {
boolean var2 = this.noCritIfTrapdoor.getValue() && (mc.world.getBlockState(new BlockPos(mc.player.posX, mc.player.posY - 0.10000000149011612, mc.player.posZ)).getBlock() instanceof jt || mc.world.getBlockState(new BlockPos(mc.player.posX, mc.player.posY + (double)mc.player.MA + 0.10000000149011612, mc.player.posZ)).getBlock() instanceof jt);
boolean var3 = mc.player.Fb() || mc.player.isInWater() || mc.player.isInWeb || mc.player.lP() || mc.player.GK() || mc.player.b(this.currentTarget) && this.adapriveCrits.getValue() || mc.player.b(ayk.bMO) || mc.player.bys.bzX || var2;
ItemStack var4 = mc.player.getHeldItemMainhand();
boolean var5 = this.rayTrace.getValue() && !Utils.a(this.currentRotations.yaw, this.currentRotations.pitch, 0.0F, var1, (double)this.distance.getValue());
if (!var5 && !(mc.player.y(var1) > (double)this.distance.getValue())) {
if (this.onlyWeapon.getValue() && !(var4.ga() instanceof bdb) && !(var4.ga() instanceof baj)) {
return false;
} else if (mc.player.cA(1.5F) < 0.93F) {
return false;
} else {
boolean var6 = this.checkObsidian.getValue() && this.aBi();
if (!var6 && !var3 && this.autoCrit.getValue()) {
return !mc.player.onGround && mc.player.bbj > 0.0F;
} else {
return true;
}
}
} else {
return false;
}
}
private double bk(BlockPos var1) {
return this.f(mc.player.posX, mc.player.posY, mc.player.posZ, (double)var1.getX(), (double)var1.getY(), (double)var1.getZ());
}
private boolean checkEntity(EntityLivingBase var1) {
if (var1 == null) {
return false;
} else if (!mc.world.cNY.contains(var1)) {
return false;
} else if (var1 == mc.player) {
return false;
} else if (!var1.Fj()) {
return false;
} else if (!this.R(var1)) {
return false;
} else if (var1.Ey() == -1236879299) {
return false;
} else if (!this.targets.jA(4) && var1 instanceof EntityPlayer) {
return false;
} else if (!this.targets.jA(2) && var1.FA()) {
return false;
} else {
if (var1 instanceof EntityPlayer) {
EntityPlayer var2 = (EntityPlayer)var1;
if (this.targets.jA(0) || !ckb.dJI.dJM.gz(var2.sp().getName())) {
return true;
}
if (!var1.Z(mc.player) && !this.walls.getValue()) {
return false;
}
}
return var1 instanceof axf && this.targets.jA(3);
}
}
private void attackEntity(Entity var1) {
int var2 = Utils.aCO();
if (!this.breakShield.getValue() || var2 != -1) {
if (var1 instanceof EntityLivingBase) {
EntityLivingBase var3 = (EntityLivingBase)var1;
if (var3.IE().ga() instanceof bco) {
mc.player.connection.c(new bgx(var2));
mc.playerController.rD();
mc.playerController.attackEntity(mc.player, var1);
mc.player.a(brd.cEr);
mc.player.connection.c(new bgx(mc.player.bxU.bzR));
}
}
}
}
private boolean bi(BlockPos var1) {
IBlockState var2 = mc.world.getBlockState(var1);
return var2.getBlock() instanceof BlockObsidian;
}
public EntityLivingBase aBk() {
return this.currentTarget;
}
public void onEnable() {
if (mc.player != null) {
this.aBl();
}
this.currentTarget = null;
super.onEnable();
}
public void onDisable() {
this.currentTarget = null;
super.onDisable();
}
private EntityLivingBase getNewTarget() {
ArrayList var1 = new ArrayList();
Iterator var2 = Utils.ebT.iterator();
while(true) {
EntityLivingBase var4;
do {
do {
Entity var3;
do {
do {
do {
if (!var2.hasNext()) {
if (var1.isEmpty()) {
return null;
}
if (this.currentTarget != null && var1.contains(this.currentTarget)) {
return this.currentTarget;
}
if (var1.size() > 1) {
switch (this.sortPriority.aCw()) {
case "Distance":
EntityPlayerSP var10001 = mc.player;
Objects.requireNonNull(var10001);
var1.sort(Comparator.comparingDouble(var10001::x));
break;
case "Health":
var1.sort((var0, var1x) -> {
return (int)(var0.HW() - var1x.HW());
});
}
}
return (EntityLivingBase)var1.get(0);
}
var3 = (Entity)var2.next();
} while(var3 == null);
} while(var3 == mc.player);
} while(!(var3 instanceof EntityLivingBase));
var4 = (EntityLivingBase)var3;
} while(!this.checkEntity(var4));
} while(!this.targets.jA(1) && var4.HZ() < 6.0F);
if (var4.HW() > 0.0F) {
var1.add(var4);
}
}
}
private boolean aBi() {
if (!this.checkObsidian.getValue()) {
return false;
} else {
BlockPos var1 = (BlockPos)this.a(this.aBj(), this.distanceToObsidian.getValue()).stream().filter(this::bi).min(Comparator.comparing(this::bk)).orElse((Object)null);
return var1 != null;
}
}
private double aBg() {
return this.aBh() ? (double)this.rotationDistance.asN() : (this.smart.getValue() ? (double)(this.distance.getValue() + 0.5F) : (double)this.rotationDistance.getValue());
}
private void aBl() {
this.currentRotations.yaw = mc.player.baV;
this.currentRotations.pitch = mc.player.baW;
this.dSG.yaw = mc.player.baV;
this.dSG.pitch = mc.player.baW;
}
private BlockPos aBj() {
return mc.player == null ? BlockPos.ORIGIN : new BlockPos(Math.floor(mc.player.posX), Math.floor(mc.player.posY), Math.floor(mc.player.posZ));
}
private boolean aBh() {
Jesus var1 = ckb.dJI.moduleManager.dPI;
double var2 = mc.player.posX;
double var4 = mc.player.posY - 0.009999999776482582;
double var6 = mc.player.posZ;
return var1.qS() && Utils.af(var2, var4, var6) == ayg.bCM;
}
}