This commit is contained in:
BenCat07 2018-07-01 11:10:22 +02:00
parent b34fdeb7cc
commit 3bcb96a45f
6 changed files with 45 additions and 15 deletions

View File

@ -19,4 +19,5 @@ extern CatCommand follow_steam;
extern unsigned steamid;
void DrawTick();
void WorldTick();
int ClassPriority(CachedEntity* ent);
}

View File

@ -311,7 +311,7 @@ void DoResistSwitching()
int force_healing_target{ 0 };
static CatCommand heal_steamid(
"autoheal_heal_steamid",
"Heals a player with SteamID (ONCE. Use for easy airstuck med setup)",
"Heals a player with SteamID",
[](const CCommand &args) {
if (args.ArgC() < 2)
{
@ -434,7 +434,6 @@ void CreateMove()
GetHitbox(target, 7, out);
AimAt(g_pLocalPlayer->v_Eye, out, g_pUserCmd);
g_pUserCmd->buttons |= IN_ATTACK;
force_healing_target = 0;
}
}
if (!enabled)
@ -553,19 +552,20 @@ int HealingPriority(int idx)
int overheal = maxoverheal - (maxbuffedhealth - health);
float overhealp = ((float) overheal / (float) maxoverheal);
float healthp = ((float) health / (float) maxhealth);
priority += hacks::shared::followbot::ClassPriority(ent) * 10;
switch (playerlist::AccessData(ent).state)
{
case playerlist::k_EState::FRIEND:
priority += 70 * (1 - healthp);
priority += 15 * (1 - overhealp);
priority += 5 * (1 - overhealp);
break;
case playerlist::k_EState::IPC:
priority += 100 * (1 - healthp);
priority += 20 * (1 - overhealp);
priority += 10 * (1 - overhealp);
break;
default:
priority += 50 * (1 - healthp);
priority += 10 * (1 - overhealp);
priority += 40 * (1 - healthp);
priority += 3 * (1 - overhealp);
}
#if ENABLE_IPC
if (ipc::peer)
@ -573,7 +573,7 @@ int HealingPriority(int idx)
if (hacks::shared::followbot::followbot &&
hacks::shared::followbot::follow_target == idx)
{
priority *= 3.0f;
priority *= 6.0f;
}
}
#endif

View File

@ -120,7 +120,7 @@ void Update()
{
if (autojoin_team and UnassignedTeam())
{
hack::ExecuteCommand("jointeam auto");
hack::ExecuteCommand("autoteam");
}
else if (preferred_class and UnassignedClass())
{

View File

@ -149,7 +149,32 @@ bool addCrumbs(CachedEntity *target, Vector corner = g_pLocalPlayer->v_Origin)
}
return false;
}
int ClassPriority(CachedEntity* ent)
{
switch (g_pPlayerResource->GetClass(ent))
{
if (g_pPlayerResource->GetClass(ent) == tf_spy)
return 0;
case tf_engineer:
return 1;
case tf_medic:
return 2;
case tf_pyro:
return 3;
case tf_scout:
return 4;
case tf_sniper:
return 5;
case tf_demoman:
return 6;
case tf_soldier:
return 7;
case tf_heavy:
return 8;
default:
return 0;
}
}
void WorldTick()
{
if (!followbot)
@ -197,7 +222,6 @@ void WorldTick()
continue;
if (steamid != entity->player_info.friendsID) // steamid check
continue;
logging::Info("Success");
if (!entity->m_bAlivePlayer()) // Dont follow dead players
continue;
@ -220,7 +244,7 @@ void WorldTick()
}
// If we dont have a follow target from that, we look again for someone
// else who is suitable
if ((!follow_target || change) && roambot)
if ((!follow_target || change || ClassPriority(ENTITY(follow_target)) < 6) && roambot)
{
// Try to get a new target
auto ent_count = HIGHEST_ENTITY;
@ -278,7 +302,11 @@ void WorldTick()
if (follow_target &&
ENTITY(follow_target)->m_flDistance() >
entity->m_flDistance()) // favor closer entitys
continue;
{
if (ClassPriority(ENTITY(follow_target)) > ClassPriority(entity))
continue;
}
// ooooo, a target
follow_target = i;
afkTicks[i].update(); // set afk time to 0

View File

@ -125,9 +125,9 @@ const std::vector<std::string> builtin_cathook = {
"-> I am charged!",
"-> Not a step back! UBERCHARGE USED!",
"-> My Ubercharge comes to an end!",
"-> I have a bit of ubercharge!",
"-> I have %i%% of ubercharge!",
"-> I have half of the ubercharge!",
"-> Ubercharge almost ready!"
"-> Ubercharge almost ready! (%i%%)"
};
const std::vector<std::string> builtin_nonecore = {
">>> GET READY TO RUMBLE! <<<", ">>> CHEATS ACTIVATED! <<<",

View File

@ -144,7 +144,8 @@ Vector VischeckWall(CachedEntity *player, CachedEntity *target, float maxdist)
if (VisCheckEntFromEntVector(
virtualOrigin, player,
target)) // check if the virtualOrigin can see the target
return virtualOrigin; // return the corner position that we know
if (abs(player->m_vecOrigin().z - virtualOrigin.z) < 400) // check for accidental height tracers
return virtualOrigin; // return the corner position that we know
// can see the target
}
}