From d8742dd83a3b9d48312a82518f651fd6191f66ab Mon Sep 17 00:00:00 2001 From: nullifiedcat Date: Tue, 18 Apr 2017 19:07:54 +0300 Subject: [PATCH] 2d box expand, radar/glow pink on aimbot aim --- src/EffectGlow.cpp | 1 + src/gui/ncc/Menu.cpp | 2 ++ src/hacks/Aimbot.cpp | 4 +++- src/hacks/Aimbot.h | 2 ++ src/hacks/ESP.cpp | 27 ++++++++++++++++++++++----- src/hacks/Radar.cpp | 3 ++- 6 files changed, 32 insertions(+), 7 deletions(-) diff --git a/src/EffectGlow.cpp b/src/EffectGlow.cpp index 559f309b..380394e6 100644 --- a/src/EffectGlow.cpp +++ b/src/EffectGlow.cpp @@ -170,6 +170,7 @@ void EffectGlow::Init() { int EffectGlow::GlowColor(IClientEntity* entity) { CachedEntity* ent = ENTITY(entity->entindex()); if (CE_BAD(ent)) return colors::white; + if (ent == hacks::shared::aimbot::target_highest) return colors::pink; if (vfunc(entity, 0xBE, 0)(entity)) { IClientEntity* owner = vfunc(entity, 0x1C3, 0)(entity); if (owner) { diff --git a/src/gui/ncc/Menu.cpp b/src/gui/ncc/Menu.cpp index 76bab102..74813792 100644 --- a/src/gui/ncc/Menu.cpp +++ b/src/gui/ncc/Menu.cpp @@ -210,6 +210,8 @@ List& MainList() { "esp_distance" "esp_box" "esp_box_text_position" + "esp_box_nodraw" + "esp_box_expand" "3D Box" [ "3D Box Settings" "esp_3d_box" diff --git a/src/hacks/Aimbot.cpp b/src/hacks/Aimbot.cpp index 00827aae..1356d142 100644 --- a/src/hacks/Aimbot.cpp +++ b/src/hacks/Aimbot.cpp @@ -41,7 +41,10 @@ int ClosestHitbox(CachedEntity* target) { return closest; } +CachedEntity* target_highest = 0; + void CreateMove() { + target_highest = 0; if (!enabled) return; if (HasCondition(g_pLocalPlayer->entity, TFCond_Taunting)) return; @@ -78,7 +81,6 @@ void CreateMove() { if (proj_gravity) cur_proj_grav = (float)proj_gravity; // TODO priority modes (FOV, Smart, Distance, etc) - CachedEntity* target_highest = 0; float target_highest_score = -256; for (int i = 0; i < HIGHEST_ENTITY; i++) { CachedEntity* ent = ENTITY(i); diff --git a/src/hacks/Aimbot.h b/src/hacks/Aimbot.h index 74dd12e5..4f131652 100644 --- a/src/hacks/Aimbot.h +++ b/src/hacks/Aimbot.h @@ -29,6 +29,8 @@ struct AimKeyMode_t { void CreateMove(); void Reset(); +extern CachedEntity* target_highest; + int ShouldTarget(CachedEntity* entity); bool Aim(CachedEntity* entity, CUserCmd* cmd); bool ShouldAim(CUserCmd* cmd); diff --git a/src/hacks/ESP.cpp b/src/hacks/ESP.cpp index 1f17cff6..4ab3eff4 100644 --- a/src/hacks/ESP.cpp +++ b/src/hacks/ESP.cpp @@ -219,6 +219,9 @@ void Draw3DBox(CachedEntity* ent, int clr, bool healthbar, int health, int healt } } +static CatVar box_nodraw(CV_SWITCH, "esp_box_nodraw", "0", "Invisible 2D Box", "Don't draw 2D box"); +static CatVar box_expand(CV_INT, "esp_box_expand", "0", "Expand 2D Box", "Expand 2D box by N units"); + void DrawBox(CachedEntity* ent, int clr, float widthFactor, float addHeight, bool healthbar, int health, int healthmax) { if (CE_BAD(ent)) return; bool cloak = ent->m_iClassID == g_pClassID->C_Player && IsPlayerInvisible(ent); @@ -251,6 +254,15 @@ void DrawBox(CachedEntity* ent, int clr, float widthFactor, float addHeight, boo min_y = so.y - height; max_y = so.y; min_x = so.x - width / 2; + + if (box_expand) { + const float& exp = (float)box_expand; + max_x += exp; + max_y += exp; + min_x -= exp; + min_y -= exp; + } + switch ((int)esp_box_text_position) { case 0: { // TOP RIGHT data.at(ent->m_IDX).esp_origin = Vector(max_x, min_y, 0); @@ -270,15 +282,20 @@ void DrawBox(CachedEntity* ent, int clr, float widthFactor, float addHeight, boo unsigned char alpha = clr >> 24; float trf = (float)((float)alpha / 255.0f); int border = cloak ? colors::Create(160, 160, 160, alpha) : colors::Transparent(colors::black, trf); + if (!box_nodraw) { + draw::OutlineRect(min_x, min_y, max_x - min_x, max_y - min_y, border); + draw::OutlineRect(min_x + 1, min_y + 1, max_x - min_x - 2, max_y - min_y - 2, clr); + draw::OutlineRect(min_x + 2, min_y + 2, max_x - min_x - 4, max_y - min_y - 4, border); + //draw::OutlineRect(so.x - width / 2 - 1, so.y - 1 - height, width + 2, height + 2, border); + //draw::OutlineRect(so.x - width / 2, so.y - height, width, height, clr); + //draw::OutlineRect(so.x - width / 2 + 1, so.y + 1 - height, width - 2, height - 2, border); + } - draw::OutlineRect(so.x - width / 2 - 1, so.y - 1 - height, width + 2, height + 2, border); - draw::OutlineRect(so.x - width / 2, so.y - height, width, height, clr); - draw::OutlineRect(so.x - width / 2 + 1, so.y + 1 - height, width - 2, height - 2, border); if (healthbar) { int hp = colors::Transparent(colors::Health(health, healthmax), trf); int hbh = (height) * min((float)health / (float)healthmax, 1.0f); - draw::DrawRect(so.x - width / 2 - 7, so.y - 1 - height, 6, height + 2, border); - draw::DrawRect(so.x - width / 2 - 6, so.y - hbh, 5, hbh, hp); + draw::OutlineRect(min_x - 6, min_y, 7, max_y - min_y, border); + draw::DrawRect(min_x - 5, max_y - hbh - 1, 5, hbh, hp); } //draw::OutlineRect(min(smin.x, smax.x) - 1, min(smin.y, smax.y) - 1, max(smin.x, smax.x), max(smin.y, smax.y), draw::black); //draw::OutlineRect(min(smin.x, smax.x), min(smin.y, smax.y), max(smin.x, smax.x), max(smin.y, smax.y), clr); diff --git a/src/hacks/Radar.cpp b/src/hacks/Radar.cpp index 3fd8f943..035ff390 100644 --- a/src/hacks/Radar.cpp +++ b/src/hacks/Radar.cpp @@ -125,7 +125,8 @@ void Draw() { const int x = (int)radar_x; const int y = (int)radar_y; draw::DrawRect(x, y, (int)size, (int)size, colors::Transparent(colors::black, 0.4f)); - draw::OutlineRect(x, y, (int)size, (int)size, GUIColor()); + int outlineclr = hacks::shared::aimbot::target_highest ? colors::pink : GUIColor(); + draw::OutlineRect(x, y, (int)size, (int)size, outlineclr); draw::DrawLine(x + (int)size / 2, y, 0, (int)size, GUIColor()); draw::DrawLine(x, y + (int)size / 2, (int)size, 0, GUIColor()); static std::vector enemies {};