random name option, fix backtrack issues, Party Client additions, wrangler aimbot, run fakelag before rest of CreateMove

This commit is contained in:
LightCat 2019-03-17 13:20:36 +01:00
parent e06745dd46
commit 020e395276
15 changed files with 30109 additions and 32 deletions

View File

@ -65,6 +65,7 @@
<Option name="Active" value="2"/>
</Select>
</LabeledObject>
<AutoVariable width="fill" target="misc.random-name" label="Random Name"/>
</List>
<List width="220" x="232">
<AutoVariable width="fill" target="noisemaker-spam.enable" label="Noisemaker spam"/>

29987
data/names.txt Executable file

File diff suppressed because it is too large Load Diff

2
external/chirc vendored

@ -1 +1 @@
Subproject commit 4b51a8b590a8149de24061c21b2c61a78fcb69bd
Subproject commit 0a95f463d295362153709d0ec1e69292aaeff470

View File

@ -103,7 +103,7 @@ float DistToSqr(CachedEntity *entity);
void fClampAngle(Vector &qaAng);
// const char* MakeInfoString(IClientEntity* player);
bool GetProjectileData(CachedEntity *weapon, float &speed, float &gravity);
bool IsVectorVisible(Vector a, Vector b, bool enviroment_only = false);
bool IsVectorVisible(Vector a, Vector b, bool enviroment_only = false, CachedEntity *self = LOCAL_E);
Vector GetForwardVector(Vector origin, Vector viewangles, float distance);
Vector GetForwardVector(float distance);
bool IsSentryBuster(CachedEntity *ent);

View File

@ -30,6 +30,7 @@ public:
int GetNumOnlineMembers();
int GetNumMembers();
int PromotePlayerToLeader(CSteamID steamid);
std::vector<unsigned> GetPartySteamIDs();
int KickPlayer(CSteamID steamid);
bool GetCurrentPartyLeader(CSteamID &id);
};

View File

@ -66,6 +66,22 @@ static settings::Bool fov_draw{ "aimbot.fov-circle.enable", "0" };
static settings::Float fovcircle_opacity{ "aimbot.fov-circle.opacity", "0.7" };
#endif
int GetSentry()
{
for (int i = 0; i < HIGHEST_ENTITY; i++)
{
CachedEntity *ent = ENTITY(i);
if (CE_BAD(ent))
continue;
if (ent->m_Type() != ENTITY_BUILDING || ent->m_iClassID() != CL_CLASS(CObjectSentrygun))
continue;
if ((CE_INT(ent, netvar.m_hBuilder) & 0xFFF) != g_pLocalPlayer->entity_idx)
continue;
return i;
}
return -1;
}
namespace hacks::shared::aimbot
{
settings::Bool ignore_cloak{ "aimbot.target.ignore-cloaked-spies", "1" };
@ -576,6 +592,17 @@ bool IsTargetStateGood(CachedEntity *entity)
// Vis check + fov check
if (!VischeckPredictedEntity(entity, IsBacktracking() && !projectile_mode))
return false;
if (LOCAL_W->m_iClassID() == CL_CLASS(CTFLaserPointer))
{
int sentry = GetSentry();
if (sentry == -1)
return false;
Vector pos = GetBuildingPosition(ENTITY(sentry));
if (hitbox == -1 || !entity->hitboxes.GetHitbox(cd.hitbox))
return false;
if (!IsVectorVisible(pos, entity->hitboxes.GetHitbox(cd.hitbox)->center, false, ENTITY(sentry)))
return false;
}
if (*fov > 0.0f && cd.fov > *fov)
return false;
@ -625,6 +652,15 @@ bool IsTargetStateGood(CachedEntity *entity)
// Vis and fov checks
if (!VischeckPredictedEntity(entity, false))
return false;
if (LOCAL_W->m_iClassID() == CL_CLASS(CTFLaserPointer))
{
int sentry = GetSentry();
if (sentry == -1)
return false;
Vector pos = GetBuildingPosition(ENTITY(sentry));
if (!IsVectorVisible(pos, GetBuildingPosition(entity), false, ENTITY(sentry)))
return false;
}
if (*fov > 0.0f && cd.fov > *fov)
return false;
@ -668,6 +704,15 @@ bool IsTargetStateGood(CachedEntity *entity)
// Vis and fov check
if (!VischeckPredictedEntity(entity, false))
return false;
if (LOCAL_W->m_iClassID() == CL_CLASS(CTFLaserPointer))
{
int sentry = GetSentry();
if (sentry == -1)
return false;
Vector pos = GetBuildingPosition(ENTITY(sentry));
if (!IsVectorVisible(pos, entity->m_vecOrigin(), false))
return false;
}
if (*fov > 0.0f && cd.fov > *fov)
return false;

View File

@ -106,7 +106,6 @@ static void doBacktrackStab()
ent = ENTITY(hacks::shared::backtrack::iBestTarget);
if (!ent->m_bEnemy() || !player_tools::shouldTarget(ent))
return;
auto &btd = hacks::shared::backtrack::headPositions[ent->m_IDX];
Vector newangle = g_pLocalPlayer->v_OrigViewangles;
std::vector<float> yangles;
@ -164,8 +163,9 @@ static void doBacktrackStab()
current_user_cmd->viewangles = newangle;
current_user_cmd->buttons |= IN_ATTACK;
g_pLocalPlayer->bUseSilentAngles = true;
return;
}
if (!*bSendPackets)
*bSendPackets = true;
}
void CreateMove()

View File

@ -130,6 +130,10 @@ static void Run()
continue;
if (HasCondition<TFCond_HalloweenGhostMode>(pEntity))
continue;
if (!*bSendPackets)
headPositions[i][cmd->command_number % getTicks()] = {};
else
{
auto &hbd = headPositions[i][cmd->command_number % getTicks()];
float _viewangles = CE_VECTOR(pEntity, netvar.m_angEyeAngles).y;
hbd.viewangles = (_viewangles > 180) ? _viewangles - 360 : _viewangles;
@ -150,6 +154,7 @@ static void Run()
memcpy((void *) hbd.bones, (void *) pEntity->hitboxes.bones, sizeof(matrix3x4_t) * 128);
}
}
}
if (iBestTarget != -1 && CanShoot())
{

View File

@ -1158,7 +1158,7 @@ netvar.iHealth));
return buf;
}*/
bool IsVectorVisible(Vector origin, Vector target, bool enviroment_only)
bool IsVectorVisible(Vector origin, Vector target, bool enviroment_only, CachedEntity *self)
{
if (!enviroment_only)
@ -1166,7 +1166,7 @@ bool IsVectorVisible(Vector origin, Vector target, bool enviroment_only)
trace_t trace_visible;
Ray_t ray;
trace::filter_no_player.SetSelf(RAW_ENT(g_pLocalPlayer->entity));
trace::filter_no_player.SetSelf(RAW_ENT(self));
ray.Init(origin, target);
PROF_SECTION(IEVV_TraceRay);
g_ITrace->TraceRay(ray, MASK_SHOT_HULL, &trace::filter_no_player, &trace_visible);
@ -1177,7 +1177,7 @@ bool IsVectorVisible(Vector origin, Vector target, bool enviroment_only)
trace_t trace_visible;
Ray_t ray;
trace::filter_no_entity.SetSelf(RAW_ENT(g_pLocalPlayer->entity));
trace::filter_no_entity.SetSelf(RAW_ENT(self));
ray.Init(origin, target);
PROF_SECTION(IEVV_TraceRay);
g_ITrace->TraceRay(ray, MASK_SHOT_HULL, &trace::filter_no_entity, &trace_visible);

View File

@ -308,14 +308,6 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time, CUs
hacks::shared::anti_anti_aim::createMove();
}
{
PROF_SECTION(CM_WRAPPER);
EC::run(EC::CreateMove_NoEnginePred);
if (engine_pred)
engine_prediction::RunEnginePrediction(RAW_ENT(LOCAL_E), current_user_cmd);
EC::run(EC::CreateMove);
}
if (CE_GOOD(g_pLocalPlayer->entity))
{
if (!g_pLocalPlayer->life_state && CE_GOOD(g_pLocalPlayer->weapon()))
@ -352,6 +344,14 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time, CUs
Prediction_CreateMove();
}
}
{
PROF_SECTION(CM_WRAPPER);
EC::run(EC::CreateMove_NoEnginePred);
if (engine_pred)
engine_prediction::RunEnginePrediction(RAW_ENT(LOCAL_E), current_user_cmd);
EC::run(EC::CreateMove);
}
if (time_replaced)
g_GlobalVars->curtime = curtime_old;
g_Settings.bInvalid = false;

View File

@ -8,7 +8,7 @@
#include "PlayerTools.hpp"
static settings::String ipc_name{ "name.ipc", "" };
static settings::String force_name{ "name.custom", "" };
settings::String force_name{ "name.custom", "" };
static settings::Int namesteal{ "name.namesteal", "0" };
static std::string stolen_name;

View File

@ -14,6 +14,8 @@
static settings::Bool halloween_mode{ "misc.force-halloween", "false" };
static settings::Int skybox_changer{ "misc.skybox-override", "0" };
extern settings::Bool random_name;
extern settings::String force_name;
const char *skynum[] = { "", "sky_tf2_04", "sky_upward", "sky_dustbowl_01", "sky_goldrush_01", "sky_granary_01", "sky_well_01", "sky_gravel_01", "sky_badlands_01", "sky_hydro_01", "sky_night_01", "sky_nightfall_01", "sky_trainyard_01", "sky_stormfront_01", "sky_morningsnow_01", "sky_alpinestorm_01", "sky_harvest_01", "sky_harvest_night_01", "sky_halloween", "sky_halloween_night_01", "sky_halloween_night2014_01", "sky_island_01", "sky_jungle_01", "sky_invasion2fort_01", "sky_well_02", "sky_outpost_01", "sky_coastal_01", "sky_rainbow_01", "sky_badlands_pyroland_01", "sky_pyroland_01", "sky_pyroland_02", "sky_pyroland_03" };
@ -60,5 +62,14 @@ DEFINE_HOOKED_METHOD(LevelInit, void, void *this_, const char *name)
ipc::peer->memory->peer_user_data[ipc::peer->client_id].ts_connected = time(nullptr);
}
#endif
if (*random_name && *force_name == "")
{
static TextFile file;
if (file.TryLoad("names.txt"))
{
force_name = file.lines.at(rand() % file.lines.size());
g_IEngine->ClientCmd_Unrestricted("retry");
}
}
}
} // namespace hooked_methods

View File

@ -10,6 +10,8 @@
static settings::Bool die_if_vac{ "misc.die-if-vac", "false" };
static settings::Bool autoabandon{ "misc.auto-abandon", "false" };
static settings::String custom_disconnect_reason{ "misc.disconnect-reason", "" };
settings::Bool random_name{ "misc.random-name", "false" };
extern settings::String force_name;
namespace hooked_methods
{
@ -45,5 +47,13 @@ DEFINE_HOOKED_METHOD(Shutdown, void, INetChannel *this_, const char *reason)
tfmm::disconnectAndAbandon();
}
hacks::shared::autojoin::onShutdown();
if (*random_name)
{
static TextFile file;
if (file.TryLoad("names.txt"))
{
force_name = file.lines.at(rand() % file.lines.size());
}
}
}
} // namespace hooked_methods

View File

@ -389,6 +389,7 @@ static void run()
else
size = -1;
state.party_size = size;
state.is_ingame = true;
irc.setState(state);
}
}

View File

@ -136,6 +136,22 @@ int re::CTFPartyClient::PromotePlayerToLeader(CSteamID steamid)
return PromotePlayerToLeader_fn(this, steamid);
}
std::vector<unsigned> re::CTFPartyClient::GetPartySteamIDs()
{
typedef bool (*SteamIDOfSlot_t)(int slot, CSteamID *our);
static uintptr_t addr = gSignatures.GetClientSignature("55 89 E5 56 53 31 DB 83 EC ? 8B 75 ? E8");
static SteamIDOfSlot_t SteamIDOfSlot_fn = SteamIDOfSlot_t(addr);
std::vector<unsigned> party_members;
for (int i = 0; i < GetNumMembers(); i++)
{
CSteamID out;
SteamIDOfSlot_fn(i, &out);
if (out.GetAccountID())
party_members.push_back(out.GetAccountID());
}
return party_members;
}
int re::CTFPartyClient::KickPlayer(CSteamID steamid)
{
typedef int (*KickPlayer_t)(re::CTFPartyClient *, CSteamID);