diff --git a/uran/TODO b/uran/TODO index 5426f3a9..e08e75ec 100644 --- a/uran/TODO +++ b/uran/TODO @@ -24,13 +24,13 @@ AutoSticky No AutoShoot when disguised Fixing NoZoom flickering Ambassador bodyshotting -No Aim Mediguns +No Trigger Mediguns FOV = Float +More projectile weapons aimbot (wrap assassin, wrangler, stickybomb, airstrike) Recalculate rifles' headshot ability (Bazaar + Precision rifles) Auto Uber Flash Auto trigger DR before rockets AutoHeal -Airstuck Critical rifles bodyshotting Show spectators Tracers/Spy Alert/Spy Cam diff --git a/uran/src/enums.h b/uran/src/enums.h index 71e0e018..16560662 100644 --- a/uran/src/enums.h +++ b/uran/src/enums.h @@ -529,23 +529,14 @@ enum weaponmode { weapon_projectile, weapon_melee, weapon_pda, - weapon_medigun + weapon_medigun, + weapon_consumable }; enum hitbox { hb_head = 0 }; -enum weapons { - WP_SNIPERRIFLE = 295, - WP_ROCKET_LAUNCHER = 282, - WP_DIRECT_HIT = 284, - WP_GRENADE_LAUNCHER = 211, - WP_HUNTSMAN = 197, - WP_SANDMAN = 188, - WP_FLAREGUN = 205 -}; - enum relation { NEUTRAL = 0, FRIEND = 1, diff --git a/uran/src/hack.cpp b/uran/src/hack.cpp index 266b66be..33b95bdf 100644 --- a/uran/src/hack.cpp +++ b/uran/src/hack.cpp @@ -24,13 +24,8 @@ #include "hooks.h" #include "hacks/IHack.h" #include "helpers.h" -#include "hacks/HBunnyhop.h" -#include "hacks/HTrigger.h" #include "followbot/ipcctl.h" #include "hacks/AutoReflect.h" -#include "hacks/HEsp.h" -//#include "hacks/HGlow.h" -#include "hacks/HAimbot.h" #include "hacks/AntiAim.h" #include "hacks/Misc.h" #include "hacks/AntiDisguise.h" @@ -68,6 +63,10 @@ #include "CDumper.h" #include "hacks/FollowBot.h" #include "globals.h" +#include "hacks/Aimbot.h" +#include "hacks/Bunnyhop.h" +#include "hacks/ESP.h" +#include "hacks/Trigger.h" /* * Credits to josh33901 aka F1ssi0N for butifel F1Public and Darkstorm 2015 Linux @@ -177,7 +176,19 @@ ICvar* g_pCVar = 0; void hack::InitHacks() { - hack::AddHack(g_phAutoStrafe = new AutoStrafe()); + ADD_HACK(AutoStrafe); + ADD_HACK(AntiAim); + ADD_HACK(AntiDisguise); + ADD_HACK(AutoReflect); + ADD_HACK(FollowBot); + ADD_HACK(Misc); + ADD_HACK(Aimbot); + ADD_HACK(Bunnyhop); + ADD_HACK(ESP); + ADD_HACK(Triggerbot); + ADD_HACK(AutoSticky); + ADD_HACK(Airstuck); + /*hack::AddHack(g_phAutoStrafe = new AutoStrafe()); hack::AddHack(g_phAntiAim = new AntiAim()); hack::AddHack(g_phAntiDisguise = new AntiDisguise()); hack::AddHack(g_phAutoReflect = new AutoReflect()); @@ -188,7 +199,7 @@ void hack::InitHacks() { hack::AddHack(g_phEsp = new HEsp()); hack::AddHack(g_phTrigger = new HTrigger()); hack::AddHack(g_phAutoSticky = new AutoSticky()); - hack::AddHack(g_phAirstuck = new Airstuck()); + hack::AddHack(g_phAirstuck = new Airstuck());*/ } void hack::Initialize() { diff --git a/uran/src/hack.h b/uran/src/hack.h index 7648e87c..61f99f4c 100644 --- a/uran/src/hack.h +++ b/uran/src/hack.h @@ -10,6 +10,9 @@ #include +#define ADD_HACK(x) \ + hack::AddHack(g_ph##x = new x()); + class IHack; class CUserCmd; class CViewSetup; diff --git a/uran/src/hacks/HAimbot.cpp b/uran/src/hacks/Aimbot.cpp similarity index 96% rename from uran/src/hacks/HAimbot.cpp rename to uran/src/hacks/Aimbot.cpp index 1a3f1915..8ab5fc14 100644 --- a/uran/src/hacks/HAimbot.cpp +++ b/uran/src/hacks/Aimbot.cpp @@ -5,8 +5,6 @@ * Author: nullifiedcat */ -#include "HAimbot.h" - #include "../usercmd.h" #include "../helpers.h" #include "../entity.h" @@ -31,6 +29,9 @@ #include #include #include "../sdk/in_buttons.h" +#include "Aimbot.h" + +DEFINE_HACK_SINGLETON(Aimbot); Vector viewangles_old; bool fix_silent; @@ -45,12 +46,12 @@ enum TargetSystem_t { ITargetSystem* target_systems[3]; -const char* HAimbot::GetName() { +const char* Aimbot::GetName() { return "AIMBOT"; } /* null-safe */ -HAimbot::HAimbot() { +Aimbot::Aimbot() { target_systems[0] = new TargetSystemSmart(); target_systems[1] = new TargetSystemFOV(); target_systems[2] = new TargetSystemDistance(); @@ -84,7 +85,7 @@ HAimbot::HAimbot() { fix_silent = false; } -bool HAimbot::CreateMove(void*, float, CUserCmd* cmd) { +bool Aimbot::CreateMove(void*, float, CUserCmd* cmd) { if (!this->v_bEnabled->GetBool()) return true; this->m_iLastTarget = -1; if (this->v_iAimKey->GetBool()) { @@ -95,7 +96,15 @@ bool HAimbot::CreateMove(void*, float, CUserCmd* cmd) { } } + switch (GetWeaponMode(g_pLocalPlayer->entity)) { + case weapon_medigun: + case weapon_pda: + case weapon_consumable: + return true; + }; + if (g_pLocalPlayer->cond_0 & cond::cloaked) return true; // TODO other kinds of cloak + // TODO m_bFeignDeathReady no aim if (this->v_bActiveOnlyWhenCanShoot->GetBool() && !BulletTime()) return true; @@ -215,7 +224,7 @@ bool HAimbot::CreateMove(void*, float, CUserCmd* cmd) { return !this->v_bSilent->GetBool(); } -void HAimbot::PaintTraverse(void*, unsigned int, bool, bool) { +void Aimbot::PaintTraverse(void*, unsigned int, bool, bool) { if (!v_bEnabled->GetBool()) return; if (this->m_iLastTarget == -1) return; IClientEntity* ent = interfaces::entityList->GetClientEntity(this->m_iLastTarget); @@ -231,7 +240,7 @@ void HAimbot::PaintTraverse(void*, unsigned int, bool, bool) { } } -bool HAimbot::ShouldTarget(IClientEntity* entity) { +bool Aimbot::ShouldTarget(IClientEntity* entity) { if (!entity) return false; if (entity->IsDormant()) return false; if (IsPlayer(entity)) { @@ -310,7 +319,7 @@ void PredictPosition(Vector vec, IClientEntity* ent) { vec += vel * latency; } -bool HAimbot::Aim(IClientEntity* entity, CUserCmd* cmd) { +bool Aimbot::Aim(IClientEntity* entity, CUserCmd* cmd) { Vector hit; Vector angles; if (!entity) return false; @@ -361,5 +370,3 @@ bool HAimbot::Aim(IClientEntity* entity, CUserCmd* cmd) { } return true; } - -HAimbot* g_phAimbot = 0; diff --git a/uran/src/hacks/HAimbot.h b/uran/src/hacks/Aimbot.h similarity index 94% rename from uran/src/hacks/HAimbot.h rename to uran/src/hacks/Aimbot.h index 2cfc35fe..63de9094 100644 --- a/uran/src/hacks/HAimbot.h +++ b/uran/src/hacks/Aimbot.h @@ -13,10 +13,10 @@ class ConVar; class IClientEntity; -class HAimbot : public IHack { +class Aimbot : public IHack { public: DECLARE_HACK_METHODS(); - HAimbot(); + Aimbot(); bool ShouldTarget(IClientEntity* entity); bool Aim(IClientEntity* entity, CUserCmd* cmd); @@ -57,6 +57,6 @@ public: ConVar* v_iPriorityMode; }; -extern HAimbot* g_phAimbot; +DECLARE_HACK_SINGLETON(Aimbot); #endif /* HAIMBOT_H_ */ diff --git a/uran/src/hacks/Airstuck.cpp b/uran/src/hacks/Airstuck.cpp index 73fc75bf..46790be3 100644 --- a/uran/src/hacks/Airstuck.cpp +++ b/uran/src/hacks/Airstuck.cpp @@ -15,6 +15,8 @@ #include "../fixsdk.h" #include +DEFINE_HACK_SINGLETON(Airstuck); + Airstuck::Airstuck() { v_bStuck = CreateConVar("u_airstuck", "0", "Toggle airstuck"); } @@ -39,5 +41,3 @@ bool Airstuck::CreateMove(void*, float, CUserCmd* cmd) { } void Airstuck::PaintTraverse(void*, unsigned int, bool, bool) {}; - -Airstuck* g_phAirstuck = 0; diff --git a/uran/src/hacks/Airstuck.h b/uran/src/hacks/Airstuck.h index 9bc65a67..c7658eab 100644 --- a/uran/src/hacks/Airstuck.h +++ b/uran/src/hacks/Airstuck.h @@ -18,6 +18,6 @@ public: ConVar* v_bStuck; }; -extern Airstuck* g_phAirstuck; +DECLARE_HACK_SINGLETON(Airstuck); #endif /* HACKS_AIRSTUCK_H_ */ diff --git a/uran/src/hacks/AntiAim.cpp b/uran/src/hacks/AntiAim.cpp index 23fc4034..5a7bf956 100644 --- a/uran/src/hacks/AntiAim.cpp +++ b/uran/src/hacks/AntiAim.cpp @@ -11,6 +11,8 @@ #include "../helpers.h" #include "../sdk/in_buttons.h" +DEFINE_HACK_SINGLETON(AntiAim); + const char* AntiAim::GetName() { return "ANTI-AIM"; } @@ -38,5 +40,3 @@ bool AntiAim::CreateMove(void*, float, CUserCmd* cmd) { } void AntiAim::PaintTraverse(void*, unsigned int, bool, bool) {} - -AntiAim* g_phAntiAim = 0; diff --git a/uran/src/hacks/AntiAim.h b/uran/src/hacks/AntiAim.h index 20cfc713..9fc14f0f 100644 --- a/uran/src/hacks/AntiAim.h +++ b/uran/src/hacks/AntiAim.h @@ -19,6 +19,6 @@ public: ConVar* v_flPitch; }; -extern AntiAim* g_phAntiAim; +DECLARE_HACK_SINGLETON(AntiAim); #endif /* ANTIAIM_H_ */ diff --git a/uran/src/hacks/AntiDisguise.cpp b/uran/src/hacks/AntiDisguise.cpp index a1bf12ff..2545f020 100644 --- a/uran/src/hacks/AntiDisguise.cpp +++ b/uran/src/hacks/AntiDisguise.cpp @@ -15,6 +15,8 @@ #include #include +DEFINE_HACK_SINGLETON(AntiDisguise); + const char* AntiDisguise::GetName() { return "ANTI-DISGUISE"; } @@ -37,5 +39,3 @@ void AntiDisguise::PaintTraverse(void*, unsigned int, bool, bool) { } bool AntiDisguise::CreateMove(void*, float, CUserCmd*) {return true;} - -AntiDisguise* g_phAntiDisguise = 0; diff --git a/uran/src/hacks/AntiDisguise.h b/uran/src/hacks/AntiDisguise.h index e4310b7d..2897bd8f 100644 --- a/uran/src/hacks/AntiDisguise.h +++ b/uran/src/hacks/AntiDisguise.h @@ -17,6 +17,6 @@ public: ConVar* v_bEnabled; }; -extern AntiDisguise* g_phAntiDisguise; +DECLARE_HACK_SINGLETON(AntiDisguise); #endif /* HACKS_ANTIDISGUISE_H_ */ diff --git a/uran/src/hacks/AutoReflect.cpp b/uran/src/hacks/AutoReflect.cpp index 2bf9c441..e0bdb740 100644 --- a/uran/src/hacks/AutoReflect.cpp +++ b/uran/src/hacks/AutoReflect.cpp @@ -21,6 +21,8 @@ #include #include +DEFINE_HACK_SINGLETON(AutoReflect); + const char* AutoReflect::GetName() { return "AUTO-REFLECT"; } @@ -85,4 +87,3 @@ bool AutoReflect::CreateMove(void*, float, CUserCmd* cmd) { void AutoReflect::PaintTraverse(void*, unsigned int, bool, bool) {} -AutoReflect* g_phAutoReflect = 0; diff --git a/uran/src/hacks/AutoReflect.h b/uran/src/hacks/AutoReflect.h index 7e259d30..1fa9ef4e 100644 --- a/uran/src/hacks/AutoReflect.h +++ b/uran/src/hacks/AutoReflect.h @@ -22,6 +22,6 @@ public: ConVar* v_iReflectDistance; }; -extern AutoReflect* g_phAutoReflect; +DECLARE_HACK_SINGLETON(AutoReflect); #endif /* HACKS_AUTOREFLECT_H_ */ diff --git a/uran/src/hacks/AutoSticky.cpp b/uran/src/hacks/AutoSticky.cpp index cd16a898..1a92f4b6 100644 --- a/uran/src/hacks/AutoSticky.cpp +++ b/uran/src/hacks/AutoSticky.cpp @@ -19,6 +19,8 @@ #include #include +DEFINE_HACK_SINGLETON(AutoSticky); + const char* AutoSticky::GetName() { return "AUTO-STICKY"; } @@ -67,5 +69,3 @@ bool AutoSticky::CreateMove(void*, float, CUserCmd* cmd) { void AutoSticky::PaintTraverse(void*, unsigned int, bool, bool) { } - -DEFINE_HACK_SINGLETON(AutoSticky); diff --git a/uran/src/hacks/AutoStrafe.cpp b/uran/src/hacks/AutoStrafe.cpp index 8f279931..dbf40463 100644 --- a/uran/src/hacks/AutoStrafe.cpp +++ b/uran/src/hacks/AutoStrafe.cpp @@ -12,6 +12,8 @@ #include "../localplayer.h" #include "../usercmd.h" +DEFINE_HACK_SINGLETON(AutoStrafe); + const char* AutoStrafe::GetName() { return "AUTOSTRAFE"; } @@ -33,5 +35,3 @@ bool AutoStrafe::CreateMove(void*, float, CUserCmd* cmd) { } void AutoStrafe::PaintTraverse(void*, unsigned int, bool, bool) {} - -AutoStrafe* g_phAutoStrafe = 0; diff --git a/uran/src/hacks/AutoStrafe.h b/uran/src/hacks/AutoStrafe.h index b035e01c..3a8740bd 100644 --- a/uran/src/hacks/AutoStrafe.h +++ b/uran/src/hacks/AutoStrafe.h @@ -17,6 +17,6 @@ public: ConVar* v_bEnabled; }; -extern AutoStrafe* g_phAutoStrafe; +DECLARE_HACK_SINGLETON(AutoStrafe); #endif /* HACKS_AUTOSTRAFE_H_ */ diff --git a/uran/src/hacks/HBunnyhop.cpp b/uran/src/hacks/Bunnyhop.cpp similarity index 82% rename from uran/src/hacks/HBunnyhop.cpp rename to uran/src/hacks/Bunnyhop.cpp index 3dd36a9f..2e831283 100644 --- a/uran/src/hacks/HBunnyhop.cpp +++ b/uran/src/hacks/Bunnyhop.cpp @@ -5,8 +5,6 @@ * Author: nullifiedcat */ -#include "HBunnyhop.h" - #include "../usercmd.h" #include "../interfaces.h" #include "../entity.h" @@ -19,18 +17,21 @@ #include #include #include +#include "Bunnyhop.h" -const char* HBunnyhop::GetName() { +DEFINE_HACK_SINGLETON(Bunnyhop); + +const char* Bunnyhop::GetName() { return "BUNNYHOP"; } -HBunnyhop::HBunnyhop() { +Bunnyhop::Bunnyhop() { this->v_bEnabled = CreateConVar("u_bhop_enabled", "1", "Enable/Disable BunnyHop"); } bool bDoubleJumpFix = false; -bool HBunnyhop::CreateMove(void* thisptr, float sampling, CUserCmd* cmd) { +bool Bunnyhop::CreateMove(void* thisptr, float sampling, CUserCmd* cmd) { if (!this->v_bEnabled->GetBool()) return true; int player = interfaces::engineClient->GetLocalPlayer(); IClientEntity* entity = interfaces::entityList->GetClientEntity(player); @@ -55,7 +56,4 @@ bool HBunnyhop::CreateMove(void* thisptr, float sampling, CUserCmd* cmd) { return true; } -void HBunnyhop::PaintTraverse(void*, unsigned int, bool, bool) {} - -HBunnyhop* g_phBunnyhop = 0; - +void Bunnyhop::PaintTraverse(void*, unsigned int, bool, bool) {} diff --git a/uran/src/hacks/HBunnyhop.h b/uran/src/hacks/Bunnyhop.h similarity index 75% rename from uran/src/hacks/HBunnyhop.h rename to uran/src/hacks/Bunnyhop.h index 521384b4..6e5fb7df 100644 --- a/uran/src/hacks/HBunnyhop.h +++ b/uran/src/hacks/Bunnyhop.h @@ -12,13 +12,13 @@ class ConVar; -class HBunnyhop : public IHack { +class Bunnyhop : public IHack { public: DECLARE_HACK_METHODS(); - HBunnyhop(); + Bunnyhop(); ConVar* v_bEnabled; }; -extern HBunnyhop* g_phBunnyhop; +DECLARE_HACK_SINGLETON(Bunnyhop); #endif /* HBUNNYHOP_H_ */ diff --git a/uran/src/hacks/HEsp.cpp b/uran/src/hacks/ESP.cpp similarity index 97% rename from uran/src/hacks/HEsp.cpp rename to uran/src/hacks/ESP.cpp index f953a9ff..9b1bff3e 100644 --- a/uran/src/hacks/HEsp.cpp +++ b/uran/src/hacks/ESP.cpp @@ -5,7 +5,8 @@ * Author: nullifiedcat */ -#include "HEsp.h" +#include "ESP.h" + #include "../fixsdk.h" #include "../drawing.h" #include "../interfaces.h" @@ -24,7 +25,9 @@ #include #include -const char* HEsp::GetName() { +DEFINE_HACK_SINGLETON(ESP); + +const char* ESP::GetName() { return "ESP"; } @@ -40,13 +43,13 @@ const char* classes[] = { "Engineer" }; -void HEsp::PaintTraverse(void*, unsigned int, bool, bool) { +void ESP::PaintTraverse(void*, unsigned int, bool, bool) { for (int i = 0; i < gEntityCache.m_nMax; i++) { ProcessEntityPT(gEntityCache.GetEntity(i)); } } -HEsp::HEsp() { +ESP::ESP() { this->v_bEnabled = CreateConVar("u_esp_enabled", "1", "Enables ESP"); this->v_bEntityESP = CreateConVar("u_esp_entity", "0", "Entity ESP (dev)"); this->v_bTeammates = CreateConVar("u_esp_teammates", "0", "ESP own team"); @@ -69,7 +72,7 @@ HEsp::HEsp() { #define ESP_HEIGHT 14 -void HEsp::DrawBox(CachedEntity* ent, Color clr, float widthFactor, float addHeight, bool healthbar, int health, int healthmax) { +void ESP::DrawBox(CachedEntity* ent, Color clr, float widthFactor, float addHeight, bool healthbar, int health, int healthmax) { if (!CheckCE(ent)) return; Vector min, max; ent->m_pEntity->GetRenderBounds(min, max); @@ -109,7 +112,7 @@ void HEsp::DrawBox(CachedEntity* ent, Color clr, float widthFactor, float addHei //draw::OutlineRect(min(smin.x, smax.x), min(smin.y, smax.y), max(smin.x, smax.x), max(smin.y, smax.y), clr); } -void HEsp::ProcessEntityPT(CachedEntity* ent) { +void ESP::ProcessEntityPT(CachedEntity* ent) { if (!this->v_bEnabled->GetBool()) return; if (!this->v_bBox->GetBool()) return; if (!CheckCE(ent)) return; @@ -153,7 +156,7 @@ void HEsp::ProcessEntityPT(CachedEntity* ent) { } } -void HEsp::ProcessEntity(CachedEntity* ent) { +void ESP::ProcessEntity(CachedEntity* ent) { if (!this->v_bEnabled->GetBool()) return; if (!CheckCE(ent)) return; @@ -373,13 +376,9 @@ void HEsp::ProcessEntity(CachedEntity* ent) { }*/ } -bool HEsp::CreateMove(void*, float, CUserCmd*) { +bool ESP::CreateMove(void*, float, CUserCmd*) { for (int i = 0; i < gEntityCache.m_nMax; i++) { ProcessEntity(gEntityCache.GetEntity(i)); } return true; }; - - -HEsp* g_phEsp; - diff --git a/uran/src/hacks/HEsp.h b/uran/src/hacks/ESP.h similarity index 93% rename from uran/src/hacks/HEsp.h rename to uran/src/hacks/ESP.h index 1b236afe..e7b1cca5 100644 --- a/uran/src/hacks/HEsp.h +++ b/uran/src/hacks/ESP.h @@ -14,10 +14,10 @@ class ConVar; class Color; class CachedEntity; -class HEsp : public IHack { +class ESP : public IHack { public: DECLARE_HACK_METHODS(); - HEsp(); + ESP(); void DrawBox(CachedEntity* ent, Color clr, float widthFactor, float addHeight, bool healthbar, int health, int healthmax); void ProcessEntity(CachedEntity* ent); void ProcessEntityPT(CachedEntity* ent); @@ -44,6 +44,6 @@ public: //ConVar* v_bModelInfo; }; -extern HEsp* g_phEsp; +DECLARE_HACK_SINGLETON(ESP); #endif /* HESP_H_ */ diff --git a/uran/src/hacks/FollowBot.cpp b/uran/src/hacks/FollowBot.cpp index 07c019a6..4055e41b 100644 --- a/uran/src/hacks/FollowBot.cpp +++ b/uran/src/hacks/FollowBot.cpp @@ -26,6 +26,8 @@ #include #include +DEFINE_HACK_SINGLETON(FollowBot); + unsigned long g_nTick = 0; const char* FollowBot::GetName() { @@ -410,5 +412,3 @@ FollowBot::~FollowBot() { } void FollowBot::PaintTraverse(void*, unsigned int, bool, bool) {} - -FollowBot* g_phFollowBot = 0; diff --git a/uran/src/hacks/FollowBot.h b/uran/src/hacks/FollowBot.h index 65986319..8e6470b9 100644 --- a/uran/src/hacks/FollowBot.h +++ b/uran/src/hacks/FollowBot.h @@ -66,6 +66,6 @@ public: unsigned last_command_local; }; -extern FollowBot* g_phFollowBot; +DECLARE_HACK_SINGLETON(FollowBot) #endif /* HPYROBOT_H_ */ diff --git a/uran/src/hacks/HPowerupList.cpp b/uran/src/hacks/HPowerupList.cpp deleted file mode 100644 index e720acac..00000000 --- a/uran/src/hacks/HPowerupList.cpp +++ /dev/null @@ -1,10 +0,0 @@ -/* - * HPowerupList.cpp - * - * Created on: Oct 10, 2016 - * Author: nullifiedcat - */ - - - - diff --git a/uran/src/hacks/HPowerupList.h b/uran/src/hacks/HPowerupList.h deleted file mode 100644 index bc5df4d5..00000000 --- a/uran/src/hacks/HPowerupList.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * HPowerupList.h - * - * Created on: Oct 10, 2016 - * Author: nullifiedcat - */ - -#ifndef HPOWERUPLIST_H_ -#define HPOWERUPLIST_H_ - -#include "IHack.h" - - -// TODO implement -/*class HPowerupList : public IHack { -public: - void Create(); - void Destroy(); - void CreateMove(void*, float, CUserCmd*); - void PaintTraverse(void*, unsigned int, bool, bool); - - ConVar* v_bEnabled; - ConVar* v_iPosX; - ConVar* v_iPosY; - ConVar* v_bShowNames; - ConVar* v_bShowClass; - ConVar* v_bShowDistance; - - // TODO -}; -*/ - -#endif /* HPOWERUPLIST_H_ */ diff --git a/uran/src/hacks/InfoSpam.cpp b/uran/src/hacks/InfoSpam.cpp deleted file mode 100644 index 2bd70455..00000000 --- a/uran/src/hacks/InfoSpam.cpp +++ /dev/null @@ -1,16 +0,0 @@ -/* - * InfoSpam.cpp - * - * Created on: Nov 19, 2016 - * Author: nullifiedcat - */ - -#include "InfoSpam.h" - -/*void InfoSpam::Create() { - -} - -bool InfoSpam::CreateMove(void*, float, CUserCmd*) { return true; } -void InfoSpam::PaintTraverse(void*, unsigned int, bool, bool) {} -void InfoSpam::Destroy() {}*/ diff --git a/uran/src/hacks/InfoSpam.h b/uran/src/hacks/InfoSpam.h deleted file mode 100644 index 83216de4..00000000 --- a/uran/src/hacks/InfoSpam.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * InfoSpam.h - * - * Created on: Nov 19, 2016 - * Author: nullifiedcat - */ - -#ifndef HACKS_INFOSPAM_H_ -#define HACKS_INFOSPAM_H_ - -#include "IHack.h" - -// TODO -/*#include - -void CC_ShowInfo(const CCommand& args); - -class InfoSpam : public IHack { -public: - DECLARE_HACK(); - ConVar* v_bEnabled; - ConCommand* c_ShowInfo; -};*/ - -#endif /* HACKS_INFOSPAM_H_ */ diff --git a/uran/src/hacks/Misc.cpp b/uran/src/hacks/Misc.cpp index 54304222..c92522c9 100644 --- a/uran/src/hacks/Misc.cpp +++ b/uran/src/hacks/Misc.cpp @@ -30,6 +30,8 @@ #include #include +DEFINE_HACK_SINGLETON(Misc); + const char* Misc::GetName() { return "MISC"; } @@ -275,11 +277,10 @@ void Misc::PaintTraverse(void*, unsigned int, bool, bool) { AddSideString(draw::white, draw::black, "realtime: %f", interfaces::gvars->realtime); AddSideString(draw::white, draw::black, "interval_per_tick: %f", interfaces::gvars->interval_per_tick); AddSideString(draw::white, draw::black, "ambassador_can_headshot: %i", (interfaces::gvars->curtime - GetEntityValue(g_pLocalPlayer->weapon, eoffsets.flLastFireTime)) > 0.95); + AddSideString(draw::white, draw::black, "WeaponMode: %i", GetWeaponMode(g_pLocalPlayer->entity)); //AddSideString(draw::white, draw::black, "VecPunchAngle: %f %f %f", pa.x, pa.y, pa.z); //draw::DrawString(10, y, draw::white, draw::black, false, "VecPunchAngleVel: %f %f %f", pav.x, pav.y, pav.z); //y += 14; //AddCenterString(draw::font_handle, interfaces::input->GetAnalogValue(AnalogCode_t::MOUSE_X), interfaces::input->GetAnalogValue(AnalogCode_t::MOUSE_Y), draw::white, L"S\u0FD5"); } } - -Misc* g_phMisc = 0; diff --git a/uran/src/hacks/Misc.h b/uran/src/hacks/Misc.h index b0d4b9bb..c03aa9ff 100644 --- a/uran/src/hacks/Misc.h +++ b/uran/src/hacks/Misc.h @@ -38,6 +38,6 @@ public: ConCommand* c_DisconnectVAC; }; -extern Misc* g_phMisc; +DECLARE_HACK_SINGLETON(Misc); #endif /* HACKS_MISC_H_ */ diff --git a/uran/src/hacks/HTrigger.cpp b/uran/src/hacks/Trigger.cpp similarity index 93% rename from uran/src/hacks/HTrigger.cpp rename to uran/src/hacks/Trigger.cpp index d2adcdf6..66a5bd89 100644 --- a/uran/src/hacks/HTrigger.cpp +++ b/uran/src/hacks/Trigger.cpp @@ -5,8 +5,6 @@ * Author: nullifiedcat */ -#include "HTrigger.h" - #include "../interfaces.h" #include "../drawing.h" #include "../usercmd.h" @@ -28,8 +26,11 @@ #include #include #include +#include "Trigger.h" -const char* HTrigger::GetName() { +DEFINE_HACK_SINGLETON(Triggerbot); + +const char* Triggerbot::GetName() { return "TRIGGER"; } @@ -37,7 +38,7 @@ Vector eye; trace_t* enemy_trace; trace::FilterDefault* filter; -HTrigger::HTrigger() { +Triggerbot::Triggerbot() { filter = new trace::FilterDefault(); enemy_trace = new trace_t(); this->v_bBodyshot = CreateConVar("u_trigger_bodyshot", "1", "Enables bodyshotting when there is enough charge to oneshot enemy"); @@ -50,7 +51,7 @@ HTrigger::HTrigger() { this->v_bBuildings = CreateConVar("u_trigger_buildings", "1", "Trigger is activated at buildings"); } -bool HTrigger::CreateMove(void* thisptr, float sampl, CUserCmd* cmd) { +bool Triggerbot::CreateMove(void* thisptr, float sampl, CUserCmd* cmd) { if (!this->v_bEnabled->GetBool()) return true; if (g_pLocalPlayer->life_state) return true; /*IClientEntity* local = interfaces::entityList->GetClientEntity(interfaces::engineClient->GetLocalPlayer()); @@ -134,11 +135,9 @@ bool HTrigger::CreateMove(void* thisptr, float sampl, CUserCmd* cmd) { return true; } -HTrigger::~HTrigger() { +Triggerbot::~Triggerbot() { delete filter; delete enemy_trace; } -void HTrigger::PaintTraverse(void*, unsigned int, bool, bool) {}; - -HTrigger* g_phTrigger = 0; +void Triggerbot::PaintTraverse(void*, unsigned int, bool, bool) {}; diff --git a/uran/src/hacks/HTrigger.h b/uran/src/hacks/Trigger.h similarity index 81% rename from uran/src/hacks/HTrigger.h rename to uran/src/hacks/Trigger.h index 7f205285..1369ba00 100644 --- a/uran/src/hacks/HTrigger.h +++ b/uran/src/hacks/Trigger.h @@ -12,11 +12,11 @@ class ConVar; -class HTrigger : public IHack { +class Triggerbot : public IHack { public: DECLARE_HACK_METHODS(); - HTrigger(); - ~HTrigger(); + Triggerbot(); + ~Triggerbot(); ConVar* v_bEnabled; ConVar* v_bIgnoreCloak; ConVar* v_bZoomedOnly; @@ -28,6 +28,6 @@ public: ConVar* v_bIgnoreVaccinator; }; -extern HTrigger* g_phTrigger; +DECLARE_HACK_SINGLETON(Triggerbot); #endif /* HTRIGGER_H_ */ diff --git a/uran/src/helpers.cpp b/uran/src/helpers.cpp index 5bce3c8f..ae6c37b7 100644 --- a/uran/src/helpers.cpp +++ b/uran/src/helpers.cpp @@ -416,10 +416,26 @@ weaponmode GetWeaponMode(IClientEntity* player) { int weapon_handle = GetEntityValue(player, eoffsets.hActiveWeapon); if (weapon_handle == GetEntityValue(player, eoffsets.hMyWeapons + sizeof(int) * 2)) return weaponmode::weapon_melee; IClientEntity* weapon = interfaces::entityList->GetClientEntity(weapon_handle & 0xFFF); + if (!weapon) return weaponmode::weapon_invalid; + switch (weapon->GetClientClass()->m_ClassID) { + case ClassID::CTFLunchBox: + case ClassID::CTFLunchBox_Drink: + return weaponmode::weapon_consumable; + case ClassID::CTFRocketLauncher_DirectHit: + case ClassID::CTFRocketLauncher: + case ClassID::CTFGrenadeLauncher: + case ClassID::CTFCompoundBow: + case ClassID::CTFBat_Wood: + case ClassID::CTFBat_Giftwrap: + case ClassID::CTFFlareGun: + case ClassID::CTFFlareGun_Revenge: + case ClassID::CTFSyringeGun: + return weaponmode::weapon_projectile; + }; + if (weapon_handle == GetEntityValue(player, eoffsets.hMyWeapons + sizeof(int) * 3)) return weaponmode::weapon_pda; if (GetEntityValue(player, eoffsets.iClass) == tf_class::tf_medic) { if (weapon_handle == GetEntityValue(player, eoffsets.hMyWeapons + sizeof(int) * 1)) return weaponmode::weapon_medigun; } - return weaponmode::weapon_hitscan; } @@ -429,22 +445,22 @@ bool GetProjectileData(IClientEntity* weapon, float& speed, bool& arc, float& gr bool rarc; float rgrav = 0.5f; switch (weapon->GetClientClass()->m_ClassID) { - case weapons::WP_DIRECT_HIT: + case ClassID::CTFRocketLauncher_DirectHit: rspeed = 1980.0f; rarc = false; //rgrav = 0.0f; break; - case weapons::WP_ROCKET_LAUNCHER: + case ClassID::CTFRocketLauncher: rspeed = 1100.0f; rarc = false; //rgrav = 0.0f; break; - case weapons::WP_GRENADE_LAUNCHER: + case ClassID::CTFGrenadeLauncher: rspeed = 1200.0f; // TODO Loch-N-Load: 1500u rarc = true; //rgrav = 0.5f; break; - case weapons::WP_HUNTSMAN: { + case ClassID::CTFCompoundBow: { // TODO curtime float begincharge = GetEntityValue(weapon, eoffsets.flChargeBeginTime); float charge = 0; @@ -456,12 +472,12 @@ bool GetProjectileData(IClientEntity* weapon, float& speed, bool& arc, float& gr rspeed = 1800 + 800 * charge; rarc = true; } break; - case weapons::WP_SANDMAN: + case ClassID::CTFBat_Wood: //rgrav = 1.0f; rspeed = 3000.0f; rarc = true; break; - case weapons::WP_FLAREGUN: + case ClassID::CTFFlareGun: //rgrav = 1.0f; rspeed = 2000.0f; rarc = true;