From f5f4d1332ece4c1af212c3d709225b52eb1c4db0 Mon Sep 17 00:00:00 2001 From: julianacat Date: Tue, 1 Aug 2017 03:49:53 -0500 Subject: [PATCH 1/4] Added bodyshot with crit --- src/hacks/Aimbot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hacks/Aimbot.cpp b/src/hacks/Aimbot.cpp index 1848ea7c..d8b381ae 100644 --- a/src/hacks/Aimbot.cpp +++ b/src/hacks/Aimbot.cpp @@ -667,7 +667,7 @@ int BestHitbox(CachedEntity* target) { // We only want to aim for the head if the ambassador can headshot headonly = AmbassadorCanHeadshot(); // 18 health is a good number to use as thats the usual minimum damage it can do with a bodyshot, but damage could potentially be higher - if (target->m_iHealth <= 18) headonly = false; + if (target->m_iHealth <= 18 || IsPlayerCritBoosted(g_pLocalPlayer->entity)) headonly = false; // If player is using a rocket based weapon, prefer the hip } else if (ci == CL_CLASS(CTFRocketLauncher) || ci == CL_CLASS(CTFRocketLauncher_AirStrike) || From 2514e5d75ee845b9fcabc8b455b34fc0a9f57c75 Mon Sep 17 00:00:00 2001 From: julianacat Date: Wed, 2 Aug 2017 20:15:58 -0500 Subject: [PATCH 2/4] Few changes with debug command --- simple-ipc | 2 +- src/hacks/Spam.cpp | 2 +- src/helpers.cpp | 18 ++++++++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/simple-ipc b/simple-ipc index dd569c63..e532876f 160000 --- a/simple-ipc +++ b/simple-ipc @@ -1 +1 @@ -Subproject commit dd569c63b2ca85e8d9d395a586d54464bb0e1916 +Subproject commit e532876ffd707a48389d54ff904dcc40a84f2839 diff --git a/src/hacks/Spam.cpp b/src/hacks/Spam.cpp index 4d72160e..d059047a 100644 --- a/src/hacks/Spam.cpp +++ b/src/hacks/Spam.cpp @@ -25,7 +25,6 @@ CatVar teamname_spam(CV_SWITCH, "spam_teamname", "0", "Teamname Spam", "Spam cha std::chrono::time_point last_spam_point {}; -bool teamname_swap = false; int current_index { 0 }; TextFile file {}; @@ -185,6 +184,7 @@ void CreateMove() { IF_GAME (IsTF2()) { // Spam changes the tournament name in casual and compeditive gamemodes if (teamname_spam) { + static bool teamname_swap = false; if (teamname_swap) { teamname_swap = false; g_IEngine->ServerCmd("tournament_teamname Cat"); diff --git a/src/helpers.cpp b/src/helpers.cpp index 6d427130..18525921 100644 --- a/src/helpers.cpp +++ b/src/helpers.cpp @@ -752,6 +752,24 @@ bool IsEntityVisiblePenetration(CachedEntity* entity, int hb) { return false; } +CatCommand print_classnames("debug_print_classnames", "Lists classnames currently available in console", []() { + + CachedEntity* ent; + + // Go through all the entities + for (int i = 0; i < HIGHEST_ENTITY; i++) { + + // Get an entity + ent = ENTITY(i); + // Check for null/dormant + if (CE_BAD(ent)) continue; + + // Print in console, the class name of the ent + logging::Info(format(RAW_ENT(ent)->GetClientClass()->m_pNetworkName).c_str()); + } + +}); + void PrintChat(const char* fmt, ...) { CHudBaseChat* chat = (CHudBaseChat*)g_CHUD->FindElement("CHudChat"); if (chat) { From 07c6c936f78e705d7f89db196fd3649f6318ad10 Mon Sep 17 00:00:00 2001 From: julianacat Date: Thu, 3 Aug 2017 02:31:42 -0500 Subject: [PATCH 3/4] Push psudo code --- src/prediction.cpp | 91 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/src/prediction.cpp b/src/prediction.cpp index e1409e3e..21d03410 100644 --- a/src/prediction.cpp +++ b/src/prediction.cpp @@ -290,3 +290,94 @@ float DistanceToGround(Vector origin) { g_ITrace->TraceRay(ray, MASK_PLAYERSOLID, &trace::filter_no_player, &ground_trace); return 8192.0f * ground_trace.fraction; } + +/* +// Set of to be fuctions for preciting players, similear to ncc prediction. + +// The way air prediction works is that we use getabsvel to get a baseline position of where the player could be +// next tick. Then we save that into the array for our math next tick. +// After the first tick passed, we check to see how the GetAbsVel function actually performed and we can correct for its +// mistakes by comparing the result from GetAbsVel last tick and where the player currently is this tick and applying an +// offset for predictions. +// With the new offset, you can use GetAbsVel and apply the offset to get 1 tick but for every other time you would need +// to apply the offset due to the way airstrafing works. +// GetAbsVel only works in a strait fassion of what the players current velocity and doesnt factor in what the players +// next velocity could be due to the player having the ability to airstrafe and change that by quite a bit. + +// Ground prediction works in the way of it using GetAbsVel to get a baseline direction of where the player is going and +// attempting to predict the players movement from that. The prediction should check its surroundings for corners, walls, +// and the like to determine a path of where the player could potentially go. We would also want to check if players +// collision box would intercept a wall or floor and interpolate even more with that in mind. +// If a player is moving too steeply onto a wall, the prediction should stop there and count that as a place for where the +// player would be for any time after it. + +// we can change between the two prediction types based on the ground flag netvar. + +// For using the predictions to work as projectile aimbot, we can determine the distance from the player kind of like how +// the current projectile aimbot currently does but we will follow the predicted path instead of just placing a vector in +// a really simple fassion. + +// This is based on the estimation that GetAbsVelocity predicts players next position for the next createmove tick + +// A set of vectors for every potential player +static Vector last_predicted_vector[32]; +// An array to store predictions +static Vector last_predictions[32]; +// Vectors to determine whether the player was in the air last tick +static bool last_predicted_inair[32]; + +// Should be run every createmove to predict playermovement +void RunPredictPlayers() { + + // Create a cached ent for use in the for loop + CachedEntity* ent; + + // Loop through players + for (int i = 0; i < 32; i++) { + + // Get an ent from current loop and check for dormancy/null + ent = ENTITY(i); + if (CE_BAD(ent)) continue; + + // Grab netvar for ground to control type of prediction + int flags = CE_INT(g_pLocalPlayer->entity, netvar.iFlags); + bool ground = (flags & (1 << 0)); + + // For ground prediction, we would just use the old method for now + if (ground) { + + // Set our last "in air" state to false + last_predicted_vector_inair[i] = false; + + + // For air prediction, attempts to exerpolate strafing speed + } else { + + // If we were not in the air last tick, we need to create our first prediction + if (!last_predicted_inair[i]) { + + // Set "in air" to true to allow air prediction to work next tick + last_predicted_inair[i] = true; + // Get our abs velocity and set it into the array + velocity::EstimateAbsVelocity(RAW_ENT(ent), last_predicted_vector[i]); + + + // Since we have been in the air last tick, we can create an offset off of prediction errors + } else { + + // Create a storage vector and get abs velocity of + Vector current_prediction; + velocity::EstimateAbsVelocity(RAW_ENT(ent), current_prediction); + last_predictions[32]; + } + } + } +} + + + +// Draws our predicted player pathing for debug or visual use +void DrawPredictPlayers() { + // TODO +} +*/ From 009b0e5763c2fa3f27f2263f6c8ff80e9b18b8f9 Mon Sep 17 00:00:00 2001 From: julianacat Date: Thu, 3 Aug 2017 03:45:34 -0500 Subject: [PATCH 4/4] Added pomson to prog pred --- src/helpers.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/helpers.cpp b/src/helpers.cpp index d614daf8..bbd92ff3 100644 --- a/src/helpers.cpp +++ b/src/helpers.cpp @@ -482,7 +482,8 @@ weaponmode GetWeaponMode() { weapon->m_iClassID == CL_CLASS(CTFFlareGun_Revenge) || weapon->m_iClassID == CL_CLASS(CTFSyringeGun) || weapon->m_iClassID == CL_CLASS(CTFCrossbow) || - weapon->m_iClassID == CL_CLASS(CTFShotgunBuildingRescue)) { + weapon->m_iClassID == CL_CLASS(CTFShotgunBuildingRescue) || + weapon->m_iClassID == CL_CLASS(CTFDRGPomson)) { return weaponmode::weapon_projectile; } else if (weapon->m_iClassID == CL_CLASS(CTFJar) || weapon->m_iClassID == CL_CLASS(CTFJarMilk)) { @@ -503,6 +504,7 @@ bool LineIntersectsBox(Vector& bmin, Vector& bmax, Vector& lmin, Vector& lmax) { return true; } +// TODO add bison and grapple hook // TODO FIX this function bool GetProjectileData(CachedEntity* weapon, float& speed, float& gravity) { float rspeed, rgrav; @@ -545,6 +547,8 @@ bool GetProjectileData(CachedEntity* weapon, float& speed, float& gravity) { } else if (weapon->m_iClassID == CL_CLASS(CTFShotgunBuildingRescue)) { rgrav = 0.2f; rspeed = 2400.0f; + } else if (weapon->m_iClassID == CL_CLASS(CTFDRGPomson)) { + rspeed = 1200.0f; } speed = rspeed; gravity = rgrav; @@ -752,8 +756,10 @@ bool IsEntityVisiblePenetration(CachedEntity* entity, int hb) { return false; } +// Used for getting class names CatCommand print_classnames("debug_print_classnames", "Lists classnames currently available in console", []() { + // Create a tmp ent for the loop CachedEntity* ent; // Go through all the entities